From 6a8aeb015335df4e3c1e735c8783cecca3ea9501 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 20 Jun 2015 19:01:23 -0400 Subject: [PATCH] Makes fire extinguishers effective at putting out mob fires Doubles the amount of water extinguishers carry and quadruples the amount of water sprayed with each use. Halves the damage taken by slimes when exposed to water to compensate. Also refactors chair propelling a bit. --- code/game/objects/effects/chem/water.dm | 2 +- .../objects/items/weapons/extinguisher.dm | 67 ++++++++----------- .../Chemistry-Reagents-Core.dm | 34 +++++----- 3 files changed, 46 insertions(+), 57 deletions(-) diff --git a/code/game/objects/effects/chem/water.dm b/code/game/objects/effects/chem/water.dm index 30f436db9a..1b2ac9bb39 100644 --- a/code/game/objects/effects/chem/water.dm +++ b/code/game/objects/effects/chem/water.dm @@ -30,7 +30,7 @@ else if(ismob(A) && !M) M = A if(M) - reagents.trans_to(M, reagents.total_volume) + reagents.splash(M, reagents.total_volume) break if(T == get_turf(target)) break diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index 4eec1009e5..aa7f6df8e4 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -15,8 +15,8 @@ attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed") var/spray_particles = 6 - var/spray_amount = 2 //units of liquid per particle - var/max_water = 120 + var/spray_amount = 8 //units of liquid per particle + var/max_water = 240 var/last_use = 1.0 var/safety = 1 var/sprite_name = "fire_extinguisher" @@ -30,7 +30,8 @@ throwforce = 2 w_class = 2.0 force = 3.0 - max_water = 60 + max_water = 120 + spray_particles = 5 sprite_name = "miniFE" /obj/item/weapon/extinguisher/New() @@ -49,6 +50,24 @@ user << "The safety is [safety ? "on" : "off"]." return +/obj/item/weapon/extinguisher/proc/propel_object(var/obj/O, mob/user, movementdirection) + if(O.anchored) return + + var/obj/structure/bed/chair/C + if(istype(O, /obj/structure/bed/chair)) + C = O + + var/list/move_speed = list(1, 1, 1, 2, 2, 3) + for(var/i in 1 to 6) + if(C) C.propelled = (6-i) + O.Move(get_step(user,movementdirection), movementdirection) + sleep(move_speed[i]) + + //additional movement + for(var/i in 1 to 3) + O.Move(get_step(user,movementdirection), movementdirection) + sleep(3) + /obj/item/weapon/extinguisher/afterattack(var/atom/target, var/mob/user, var/flag) //TODO; Add support for reagents in water. @@ -73,35 +92,9 @@ var/direction = get_dir(src,target) - if(user.buckled && isobj(user.buckled) && !user.buckled.anchored ) + if(user.buckled && isobj(user.buckled)) spawn(0) - var/obj/structure/bed/chair/C = null - if(istype(user.buckled, /obj/structure/bed/chair)) - C = user.buckled - var/obj/B = user.buckled - var/movementdirection = turn(direction,180) - if(C) C.propelled = 4 - B.Move(get_step(user,movementdirection), movementdirection) - sleep(1) - B.Move(get_step(user,movementdirection), movementdirection) - if(C) C.propelled = 3 - sleep(1) - B.Move(get_step(user,movementdirection), movementdirection) - sleep(1) - B.Move(get_step(user,movementdirection), movementdirection) - if(C) C.propelled = 2 - sleep(2) - B.Move(get_step(user,movementdirection), movementdirection) - if(C) C.propelled = 1 - sleep(2) - B.Move(get_step(user,movementdirection), movementdirection) - if(C) C.propelled = 0 - sleep(3) - B.Move(get_step(user,movementdirection), movementdirection) - sleep(3) - B.Move(get_step(user,movementdirection), movementdirection) - sleep(3) - B.Move(get_step(user,movementdirection), movementdirection) + propel_object(user.buckled, user, turn(direction,180)) var/turf/T = get_turf(target) var/turf/T1 = get_step(T,turn(direction, 90)) @@ -111,19 +104,15 @@ for(var/a = 1 to spray_particles) spawn(0) + if(!src || !reagents.total_volume) return + var/obj/effect/effect/water/W = PoolOrNew(/obj/effect/effect/water, get_turf(src)) var/turf/my_target - if(a == 1) - my_target = T - else if(a == 2) - my_target = T1 - else if(a == 3) - my_target = T2 + if(a <= the_targets.len) + my_target = the_targets[a] else my_target = pick(the_targets) W.create_reagents(spray_amount) - if(!src) - return reagents.trans_to_obj(W, spray_amount) W.set_color() W.set_up(my_target) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm index 16dd0bd323..94a92e3129 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm @@ -143,26 +143,26 @@ environment.add_thermal_energy(-removed_heat) if (prob(5)) T.visible_message("The water sizzles as it lands on \the [T]!") - else - if(volume >= 3) - if(T.wet >= 1) + + else if(volume >= 10) + if(T.wet >= 1) + return + T.wet = 1 + if(T.wet_overlay) + T.overlays -= T.wet_overlay + T.wet_overlay = null + T.wet_overlay = image('icons/effects/water.dmi',T,"wet_floor") + T.overlays += T.wet_overlay + + spawn(800) // This is terrible and needs to be changed when possible. + if(!T || !istype(T)) return - T.wet = 1 + if(T.wet >= 2) + return + T.wet = 0 if(T.wet_overlay) T.overlays -= T.wet_overlay T.wet_overlay = null - T.wet_overlay = image('icons/effects/water.dmi',T,"wet_floor") - T.overlays += T.wet_overlay - - spawn(800) // This is terrible and needs to be changed when possible. - if(!T || !istype(T)) - return - if(T.wet >= 2) - return - T.wet = 0 - if(T.wet_overlay) - T.overlays -= T.wet_overlay - T.wet_overlay = null /datum/reagent/water/touch_obj(var/obj/O) if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeycube)) @@ -184,7 +184,7 @@ /datum/reagent/water/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) if(istype(M, /mob/living/carbon/slime)) var/mob/living/carbon/slime/S = M - S.adjustToxLoss(15 * removed) // Babies have 150 health, adults have 200; So, 10 units and 13.5 + S.adjustToxLoss(8 * removed) // Babies have 150 health, adults have 200; So, 10 units and 13.5 if(!S.client) if(S.Target) // Like cats S.Target = null