From 3964cb3126530b027eca6c99e0625ef5472b71c8 Mon Sep 17 00:00:00 2001 From: Iamgoofball Date: Mon, 2 Mar 2015 20:50:48 -0800 Subject: [PATCH] Adds heart attacks properly. --- .../effects/effect_system/effects_foam.dm | 9 +++++---- code/game/objects/items/weapons/defib.dm | 2 ++ .../items/weapons/grenades/chem_grenade.dm | 19 +++++++++++++++++++ code/modules/mob/living/carbon/carbon.dm | 8 ++++++++ .../mob/living/carbon/carbon_defines.dm | 1 + code/modules/mob/living/carbon/human/life.dm | 9 +++++++++ code/modules/mob/living/carbon/life.dm | 6 ++++++ .../reagents/Chemistry-Goon-420BlazeIt.dm | 7 ++++--- .../reagents/Chemistry-Goon-Pyrotechnics.dm | 18 +++++++++--------- .../modules/reagents/Chemistry-Goon-Toxins.dm | 9 +++++++-- 10 files changed, 70 insertions(+), 18 deletions(-) diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index d00614174e9..a4a5dcad577 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -102,10 +102,11 @@ /////////////////////////////////////////////// //FOAM EFFECT DATUM /datum/effect/effect/system/foam_spread - var/amount = 5 // the size of the foam spread. + var/amount = 10 // the size of the foam spread. var/obj/chemholder var/obj/effect/effect/foam/foamtype = /obj/effect/effect/foam var/metal = 0 + var/foam_color /datum/effect/effect/system/foam_spread/metal @@ -126,8 +127,9 @@ else location = get_turf(loca) - amount = round(sqrt(amt / 3), 1) + amount = round(sqrt(amt / 2), 1) carry.copy_to(chemholder, carry.total_volume) + foam_color = mix_color_from_reagents(carry.reagent_list) /datum/effect/effect/system/foam_spread/metal/set_up(amt=5, loca, var/datum/reagents/carry = null, var/metaltype) @@ -140,9 +142,8 @@ foundfoam.amount += amount else var/obj/effect/effect/foam/F = new foamtype(src.location) - var/foamcolor = mix_color_from_reagents(chemholder.reagents.reagent_list) chemholder.reagents.copy_to(F, chemholder.reagents.total_volume) - F.color = foamcolor + F.color = foam_color F.amount = amount F.metal = metal diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index ad5cb815cfa..2a738e2ba8c 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -381,6 +381,8 @@ busy = 0 update_icon() return + if(H.heart_attack) + H.heart_attack = 0 if(H.stat == 2) var/health = H.health M.visible_message("[M]'s body convulses a bit.") diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index bda6191104b..5826fe552f9 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -388,6 +388,25 @@ beakers += B1 beakers += B2 +/obj/item/weapon/grenade/chem_grenade/clf3 + name = "clf3 grenade" + desc = "BURN!-brand foaming clf3. In a special applicator for rapid purging of wide areas." + stage = READY + +/obj/item/weapon/grenade/chem_grenade/clf3/New() + ..() + var/obj/item/weapon/reagent_containers/glass/beaker/bluespace/B1 = new(src) + var/obj/item/weapon/reagent_containers/glass/beaker/bluespace/B2 = new(src) + + B1.reagents.add_reagent("fluorosurfactant", 290) + B1.reagents.add_reagent("clf3", 10) + B2.reagents.add_reagent("water", 290) + B2.reagents.add_reagent("clf3", 10) + + beakers += B1 + beakers += B2 + + #undef EMPTY #undef WIRED #undef READY diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 2be2571ea3e..91ec145e815 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -86,6 +86,8 @@ "You feel a powerful shock coursing through your body!", \ "You hear a heavy electrical crack." \ ) + if(prob(25) && heart_attack) + heart_attack = 0 jitteriness += 1000 //High numbers for violent convulsions do_jitter_animation(jitteriness) stuttering += 2 @@ -377,3 +379,9 @@ var/const/GALOSHES_DONT_HELP = 8 /mob/living/carbon/is_muzzled() return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) + + +/mob/living/carbon/revive() + heart_attack = 0 + ..() + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index a1237ccd8c8..65ebbcff2d0 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -15,3 +15,4 @@ var/obj/item/weapon/tank/internal = null var/datum/dna/dna = null//Carbon + var/heart_attack = 0 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index a32591f9d52..9c1d78fe973 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -622,4 +622,13 @@ I.loc = get_turf(src) visible_message("\the [I] falls out of [name]'s [L.getDisplayName()]!","\the [I] falls out of your [L.getDisplayName()]!") +/mob/living/carbon/human/handle_heart() + if(!heart_attack) + return + else + losebreath += 5 + adjustOxyLoss(5) + adjustBrainLoss(10) + return + #undef HUMAN_MAX_OXYLOSS diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 006aa7f31f9..5c8bc237d7b 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -48,6 +48,9 @@ //Random events (vomiting etc) handle_random_events() + //Heart Attacks, etc. + handle_heart() + . = 1 handle_fire() @@ -97,6 +100,9 @@ /mob/living/carbon/proc/handle_blood() return +/mob/living/carbon/proc/handle_heart() + return + /mob/living/carbon/proc/handle_random_events() return diff --git a/code/modules/reagents/Chemistry-Goon-420BlazeIt.dm b/code/modules/reagents/Chemistry-Goon-420BlazeIt.dm index 2a0a1f7f700..0b9b14272da 100644 --- a/code/modules/reagents/Chemistry-Goon-420BlazeIt.dm +++ b/code/modules/reagents/Chemistry-Goon-420BlazeIt.dm @@ -502,8 +502,9 @@ datum/reagent/hotline/addiction_act_stage4(var/mob/living/M as mob) M.adjustBrainLoss(rand(1,30)) M.hallucination += 30 M.druggy = max(M.druggy, 30) - if(prob(1)) - M.visible_message("[M] clutches at their chest! It looks like they're having a heart attack!") - M.adjustBruteLoss(80) // don't do drugs kids + var/mob/living/carbon/human/H = M + if(prob(1) && !H.heart_attack) + H.visible_message("[H] clutches at their chest! It looks like they're having a heart attack!") + H.heart_attack = 1 // don't do drugs kids ..() return \ No newline at end of file diff --git a/code/modules/reagents/Chemistry-Goon-Pyrotechnics.dm b/code/modules/reagents/Chemistry-Goon-Pyrotechnics.dm index aa52e461ad1..508f6629298 100644 --- a/code/modules/reagents/Chemistry-Goon-Pyrotechnics.dm +++ b/code/modules/reagents/Chemistry-Goon-Pyrotechnics.dm @@ -9,7 +9,7 @@ id = "stabilizing_agent" description = "Keeps unstable chemicals stable. This does not work on everything." reagent_state = LIQUID - color = "#60A584" // rgb: 96, 165, 132 + color = "#FF0000" // rgb: 96, 165, 132 /datum/chemical_reaction/stabilizing_agent name = "stabilizing_agent" @@ -23,7 +23,7 @@ id = "clf3" description = "Makes a temporary 3x3 fireball when it comes into existence, so be careful when mixing. ClF3 applied to a surface burns things that wouldn't otherwise burn, sometimes through the very floors of the station and exposing it to the vacuum of space." reagent_state = LIQUID - color = "#60A584" // rgb: 96, 165, 132 + color = "#FFFFFF" // rgb: 96, 165, 132 metabolization_rate = 4 /datum/chemical_reaction/clf3 @@ -57,7 +57,7 @@ F.ChangeTurf(/turf/space) if(istype(T, /turf/simulated/floor/)) var/turf/simulated/floor/F = T - if(prob(volume/5)) + if(prob(volume/10)) F.make_plating() if(istype(F, /turf/simulated/floor/)) new /obj/effect/hotspot(F) @@ -79,7 +79,7 @@ id = "sorium" description = "Sends everything flying from the detonation point." reagent_state = LIQUID - color = "#60A584" //rgb: 96, 165, 132 + color = "#FFA500" //rgb: 96, 165, 132 /datum/chemical_reaction/sorium name = "Sorium" @@ -111,7 +111,7 @@ id = "liquid_dark_matter" description = "Sucks everything into the detonation point." reagent_state = LIQUID - color = "#60A584" //rgb: 96, 165, 132 + color = "#800080" //rgb: 96, 165, 132 /datum/chemical_reaction/liquid_dark_matter name = "Liquid Dark Matter" @@ -359,7 +359,7 @@ id = "phlogiston" description = "+1 BURN, +1 BURNING and sets you alight. Don't be deceived by that meager +1, having phlogiston in the bloodstream can be very dangerous without a fire extinguisher or firebot. Even then, they can't prevent you from spontaneously igniting every cycle." reagent_state = LIQUID - color = "#60A584" // rgb: 96, 165, 132 + color = "#FF9999" // rgb: 96, 165, 132 /datum/chemical_reaction/phlogiston name = "phlogiston" @@ -380,7 +380,7 @@ datum/reagent/cryostylane name = "Cryostylane" id = "cryostylane" description = "Comes into existence at 20K. As long as there is sufficient oxygen for it to react with, Cryostylane slowly cools all other reagents in the mob down to 0K." - color = "#B31008" // rgb: 139, 166, 233 + color = "#B2B2FF" // rgb: 139, 166, 233 /datum/chemical_reaction/cryostylane name = "cryostylane" @@ -410,7 +410,7 @@ datum/reagent/pyrosium name = "Pyrosium" id = "pyrosium" description = "Comes into existence at 20K. As long as there is sufficient oxygen for it to react with, Pyrosium slowly cools all other reagents in the mob down to 0K." - color = "#B31008" // rgb: 139, 166, 233 + color = "#B20000" // rgb: 139, 166, 233 /datum/chemical_reaction/pyrosium name = "pyrosium" @@ -435,7 +435,7 @@ datum/reagent/pyrosium/on_mob_life(var/mob/living/M as mob) id = "argine" description = "Explodes when lowered to freezing temperatures." reagent_state = LIQUID - color = "#000000" //rgb: 96, 165, 132 + color = "#FFFFFF" //rgb: 96, 165, 132 /datum/chemical_reaction/argine_explosion name = "Argine Kaboom" diff --git a/code/modules/reagents/Chemistry-Goon-Toxins.dm b/code/modules/reagents/Chemistry-Goon-Toxins.dm index e8514ab09ea..dd3adf14ba4 100644 --- a/code/modules/reagents/Chemistry-Goon-Toxins.dm +++ b/code/modules/reagents/Chemistry-Goon-Toxins.dm @@ -229,8 +229,13 @@ datum/reagent/initropidril/on_mob_life(var/mob/living/M as mob) M.losebreath += 10 M.adjustOxyLoss(rand(5,25)) if(3) - M.visible_message("[M] clutches at their chest as if their heart stopped!") - M.adjustBruteLoss(100) // rip in pepperoni + var/mob/living/carbon/human/H = M + if(!H.heart_attack) + H.visible_message("[H] clutches at their chest as if their heart stopped!") + H.heart_attack = 1 // rip in pepperoni + else + H.losebreath += 10 + H.adjustOxyLoss(rand(5,25)) ..() return