From b810e4d9e15a2679c4077d17ed13b95510346fce Mon Sep 17 00:00:00 2001 From: Nicaragua Date: Tue, 19 Feb 2019 19:22:44 -0300 Subject: [PATCH] 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) ..()