From ef807518acabb4e714b3695bac4320edc7853422 Mon Sep 17 00:00:00 2001 From: Nicaragua Date: Tue, 19 Feb 2019 17:46:00 -0300 Subject: [PATCH 1/4] Cleanbot now drops correct arm --- code/modules/mob/living/simple_animal/bot/bot.dm | 5 +++++ code/modules/mob/living/simple_animal/bot/cleanbot.dm | 6 +----- code/modules/mob/living/simple_animal/bot/construction.dm | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index dbec1d42bbe..d8fd3f7ca09 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -63,6 +63,7 @@ var/new_destination // pending new destination (waiting for beacon response) var/destination // destination description tag var/next_destination // the next destination in the patrol route + var/robot_arm = /obj/item/robot_parts/r_arm var/blockcount = 0 //number of times retried a blocked path var/awaiting_beacon = 0 // count of pticks awaiting a beacon response @@ -1106,3 +1107,7 @@ Pass a positive integer as an argument to override a bot's default speed. if(I) I.icon = null path.Cut(1, 2) + +/mob/living/simple_animal/bot/proc/drop_part(obj/item/drop_item, dropzone) + new drop_item(dropzone) + drop_item = null \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index b6cca5940e3..0c52b1517f3 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -179,14 +179,10 @@ on = 0 visible_message("[src] blows apart!") var/turf/Tsec = get_turf(src) - new /obj/item/reagent_containers/glass/bucket(Tsec) - new /obj/item/assembly/prox_sensor(Tsec) - if(prob(50)) - new /obj/item/robot_parts/l_arm(Tsec) - + drop_part(robot_arm, Tsec) do_sparks(3, 1, src) ..() diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 9c11a3d872c..59476262101 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -22,6 +22,7 @@ var/turf/T = get_turf(loc) var/mob/living/simple_animal/bot/cleanbot/A = new /mob/living/simple_animal/bot/cleanbot(T) A.name = created_name + A.robot_arm = W.type to_chat(user, "You add the robot arm to the bucket and sensor assembly. Beep boop!") user.unEquip(src, 1) qdel(src) From b810e4d9e15a2679c4077d17ed13b95510346fce Mon Sep 17 00:00:00 2001 From: Nicaragua Date: Tue, 19 Feb 2019 19:22:44 -0300 Subject: [PATCH 2/4] All bots drop the correct arm and each construction method (bots that have robotics arms) --- .../living/simple_animal/bot/construction.dm | 19 +++++++++++++++---- .../mob/living/simple_animal/bot/floorbot.dm | 5 +---- .../mob/living/simple_animal/bot/honkbot.dm | 10 ++++------ .../mob/living/simple_animal/bot/medbot.dm | 2 +- .../mob/living/simple_animal/bot/secbot.dm | 7 +------ 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 59476262101..94239d63d47 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -1,4 +1,5 @@ //Bot Construction +var/robot_arm = /obj/item/robot_parts/l_arm //Cleanbot assembly /obj/item/bucket_sensor @@ -269,6 +270,7 @@ var/turf/T = get_turf(user.loc) var/mob/living/simple_animal/bot/floorbot/A = new /mob/living/simple_animal/bot/floorbot(T) A.name = created_name + A.robot_arm = W.type to_chat(user, "You add the robot arm to the odd looking toolbox assembly. Boop beep!") user.unEquip(src, 1) qdel(src) @@ -285,7 +287,10 @@ //Medbot Assembly /obj/item/storage/firstaid/attackby(obj/item/I, mob/user, params) if(!istype(I, /obj/item/robot_parts/l_arm) && !istype(I, /obj/item/robot_parts/r_arm)) - return ..() + return ..() + else + robot_arm = I.type + //Making a medibot! if(contents.len) @@ -293,7 +298,7 @@ return var/obj/item/firstaid_arm_assembly/A = new /obj/item/firstaid_arm_assembly(loc, med_bot_skin) - + A.req_one_access = req_one_access A.syndicate_aligned = syndicate_aligned A.treatment_oxy = treatment_oxy @@ -378,6 +383,7 @@ S.treatment_fire = treatment_fire S.treatment_tox = treatment_tox S.treatment_virus = treatment_virus + S.robot_arm = robot_arm else new /mob/living/simple_animal/bot/medbot/syndicate(T) //Syndicate medibots are a special case that have so many unique vars on them, it's not worth passing them through construction phases user.unEquip(src, 1) @@ -441,6 +447,7 @@ to_chat(user, "You add the robot arm to [src]!") name = "helmet/signaler/prox sensor/robot arm assembly" overlays += "hs_arm" + robot_arm = I.type qdel(I) else if((istype(I, /obj/item/melee/baton)) && (build_step >= 3)) @@ -451,6 +458,7 @@ var/mob/living/simple_animal/bot/secbot/S = new /mob/living/simple_animal/bot/secbot S.forceMove(get_turf(src)) S.name = created_name + S.robot_arm = robot_arm qdel(I) qdel(src) @@ -484,8 +492,10 @@ //Honkbot Assembly /obj/item/storage/box/clown/attackby(obj/item/W, mob/user, params) - if(!istype(W, /obj/item/robot_parts/l_arm) && !istype(W, /obj/item/robot_parts/r_arm)) + if(istype(W, /obj/item/robot_parts/l_arm) && !istype(W, /obj/item/robot_parts/r_arm)) return ..() + else + robot_arm = W.type if(contents.len) to_chat(user, "You need to empty [src] out first!") @@ -532,5 +542,6 @@ return to_chat(user, "You add the trombone to [src]! Heeeenk! ") qdel(W) - new /mob/living/simple_animal/bot/honkbot(get_turf(loc)) + var/mob/living/simple_animal/bot/honkbot/A = new /mob/living/simple_animal/bot/honkbot(T) + A.robot_arm = robot_arm qdel(src) \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 68e64ee65ed..c22d37eed19 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -388,14 +388,11 @@ on = 0 visible_message("[src] blows apart!") var/turf/Tsec = get_turf(src) - var/obj/item/storage/toolbox/mechanical/N = new /obj/item/storage/toolbox/mechanical(Tsec) N.contents = list() - new /obj/item/assembly/prox_sensor(Tsec) - if(prob(50)) - new /obj/item/robot_parts/l_arm(Tsec) + drop_part(robot_arm, Tsec) while(amount)//Dumps the tiles into the appropriate sized stacks if(amount >= 16) diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm index 1505e71e6db..c4e6ea86400 100644 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm @@ -278,16 +278,14 @@ else continue -/mob/living/simple_animal/bot/honkbot/explode() +/mob/living/simple_animal/bot/honkbot/explode() //doesn't drop cardboard nor its assembly, since its a very frail material. walk_to(src, 0) visible_message("[src] blows apart!") var/turf/Tsec = get_turf(src) - //doesn't drop cardboard nor its assembly, since its a very frail material. + new /obj/item/bikehorn(Tsec) + new /obj/item/assembly/prox_sensor(Tsec) if(prob(50)) - new /obj/item/robot_parts/r_arm(Tsec) - new /obj/item/bikehorn(Tsec) - new /obj/item/assembly/prox_sensor(Tsec) - + drop_part(robot_arm, Tsec) var/datum/effect_system/spark_spread/s = new s.set_up(3, 1, src) s.start() diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 1c7cb902be3..9507b91e4f0 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -591,7 +591,7 @@ new /obj/item/healthanalyzer(Tsec) if(prob(50)) - new /obj/item/robot_parts/l_arm(Tsec) + drop_part(robot_arm, Tsec) if(reagent_glass) reagent_glass.forceMove(Tsec) diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 84ab158504d..769e4d14dd9 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -417,23 +417,18 @@ Auto Patrol: []"}, return 0 /mob/living/simple_animal/bot/secbot/explode() - walk_to(src,0) visible_message("[src] blows apart!") var/turf/Tsec = get_turf(src) - var/obj/item/secbot_assembly/Sa = new /obj/item/secbot_assembly(Tsec) Sa.build_step = 1 Sa.overlays += "hs_hole" Sa.created_name = name new /obj/item/assembly/prox_sensor(Tsec) new /obj/item/melee/baton(Tsec) - if(prob(50)) - new /obj/item/robot_parts/l_arm(Tsec) - + drop_part(robot_arm, Tsec) do_sparks(3, 1, src) - new /obj/effect/decal/cleanable/blood/oil(loc) ..() From 47fa6ce819ccec53e3e36b0b049d54f707bec899 Mon Sep 17 00:00:00 2001 From: Nicaragua Date: Tue, 19 Feb 2019 19:37:04 -0300 Subject: [PATCH 3/4] fix missing ! hmm --- code/modules/mob/living/simple_animal/bot/construction.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 94239d63d47..dc53ef59b2b 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -492,7 +492,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm //Honkbot Assembly /obj/item/storage/box/clown/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/robot_parts/l_arm) && !istype(W, /obj/item/robot_parts/r_arm)) + if(!istype(W, /obj/item/robot_parts/l_arm) && !istype(W, /obj/item/robot_parts/r_arm)) return ..() else robot_arm = W.type From 55c418b61ee2f6dc418926ae10449b71ac8dd46a Mon Sep 17 00:00:00 2001 From: Nicaragua Date: Tue, 26 Feb 2019 16:35:12 -0300 Subject: [PATCH 4/4] removed null --- code/modules/mob/living/simple_animal/bot/bot.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index d8fd3f7ca09..a0b6652f883 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -1109,5 +1109,4 @@ Pass a positive integer as an argument to override a bot's default speed. path.Cut(1, 2) /mob/living/simple_animal/bot/proc/drop_part(obj/item/drop_item, dropzone) - new drop_item(dropzone) - drop_item = null \ No newline at end of file + new drop_item(dropzone) \ No newline at end of file