From 49921a9bb108abefd980714d51e17eabee70f640 Mon Sep 17 00:00:00 2001 From: phil235 Date: Wed, 29 Oct 2014 16:50:13 +0100 Subject: [PATCH] adding CoolDown to welding repair on bot/borg/mecha Now eye prot needed to repair bot/borg/mecha fix bug where you're repairing despite weldingtool being off Fixes the amount of fuel used per repair to 1 for bot/borg/mecha Adding message when not enough fuel during borg/mecha repair. Fuel not used when repair attempt on borg/mecha is canceled (no damage or welder off). For bot/borg/mecha, now using notice span class for all repair messages and visible message instead of << . All cancel messages uses warning span class. --- code/game/machinery/bots/bots.dm | 50 ++++++++++--------- code/game/mecha/mecha.dm | 27 +++++----- .../modules/mob/living/silicon/robot/robot.dm | 17 ++++--- 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 49c8f205ef4..81dc4400098 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -234,34 +234,36 @@ user << "Maintenance panel is now [open ? "opened" : "closed"]." else user << "Maintenance panel is locked." - else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "harm") - if(health < maxhealth) - if(open) - var/obj/item/weapon/weldingtool/WT = W - if(!WT.isOn()) - user << "The welder must be on for this task." - health = min(maxhealth, health+10) - user.visible_message("[user] repairs [src]!","You repair [src]!") - else - user << "Unable to repair with the maintenance panel closed." - else - user << "[src] does not need a repair." else if (istype(W, /obj/item/weapon/card/emag) && emagged < 2) Emag(user) else user.changeNext_move(CLICK_CD_MELEE) - if(W.force) //if force is non-zero - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(5, 1, src) - switch(W.damtype) - if("fire") - health -= W.force * fire_dam_coeff - s.start() - if("brute") - health -= W.force * brute_dam_coeff - s.start() - ..() - healthcheck() + if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "harm") + if(health >= maxhealth) + user << "[src] does not need a repair." + return + if(!open) + user << "Unable to repair with the maintenance panel closed." + return + var/obj/item/weapon/weldingtool/WT = W + if(WT.remove_fuel(0, user)) + health = min(maxhealth, health+10) + user.visible_message("[user] repairs [src]!","You repair [src]!") + else + user << "The welder must be on for this task." + else + if(W.force) //if force is non-zero + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + switch(W.damtype) + if("fire") + health -= W.force * fire_dam_coeff + s.start() + if("brute") + health -= W.force * brute_dam_coeff + s.start() + ..() + healthcheck() /obj/machinery/bot/bullet_act(var/obj/item/projectile/Proj) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index acbe4455335..b423e855dd8 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -520,8 +520,8 @@ src.visible_message("The [A] fastens firmly to [src].") return if(prob(src.deflect_chance) || istype(A, /mob)) - src.occupant_message("The [A] bounces off the armor.") - src.visible_message("The [A] bounces off the [src.name] armor") + src.occupant_message("[A] bounces off the armor.") + src.visible_message("[A] bounces off the [src.name] armor") src.log_append_to_last("Armor saved.") if(istype(A, /mob/living)) var/mob/living/M = A @@ -738,19 +738,22 @@ return else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "harm") + user.changeNext_move(CLICK_CD_MELEE) var/obj/item/weapon/weldingtool/WT = W - if (WT.remove_fuel(0,user)) - if (hasInternalDamage(MECHA_INT_TANK_BREACH)) - clearInternalDamage(MECHA_INT_TANK_BREACH) - user << "You repair the damaged gas tank." - else - return if(src.healthYou repair some damage to [src.name]." - src.health += min(10, initial(src.health)-src.health) + if (WT.remove_fuel(0,user)) + if (hasInternalDamage(MECHA_INT_TANK_BREACH)) + clearInternalDamage(MECHA_INT_TANK_BREACH) + user << "You repair the damaged gas tank." + else + user.visible_message("[user] repairs some damage to [src.name].") + src.health += min(10, initial(src.health)-src.health) + else + user << "The welder must be on for this task." + return 1 else - user << "The [src.name] is at full integrity" - return + user << "The [src.name] is at full integrity." + return 1 else if(istype(W, /obj/item/mecha_parts/mecha_tracking)) if(!user.unEquip(W)) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 8b4076e265b..6d95ac70527 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -397,29 +397,30 @@ return if (istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "harm") + user.changeNext_move(CLICK_CD_MELEE) var/obj/item/weapon/weldingtool/WT = W if (src == user) user << "You lack the reach to be able to repair yourself." - return + return 1 if (src.health >= src.maxHealth) user << "[src] is already in good condition." - return - if (WT.remove_fuel(0)) + return 1 + if (WT.remove_fuel(0, user)) adjustBruteLoss(-30) updatehealth() add_fingerprint(user) - for(var/mob/O in viewers(user, null)) - O.show_message(text("[user] has fixed some of the dents on [src]!"), 1) + visible_message("[user] has fixed some of the dents on [src].") + return 0 else - return + user << "The welder must be on for this task." + return 1 else if(istype(W, /obj/item/stack/cable_coil) && wiresexposed) var/obj/item/stack/cable_coil/coil = W if (coil.use(1)) adjustFireLoss(-30) updatehealth() - for(var/mob/O in viewers(user, null)) - O.show_message(text("[user] has fixed some of the burnt wires on [src]!"), 1) + visible_message("[user] has fixed some of the burnt wires on [src].") else user << "You need one length of cable to repair [src]."