From cf56a206b3b6ce3a07599fe13dc26c265ba9becd Mon Sep 17 00:00:00 2001 From: cib Date: Tue, 12 Feb 2013 17:50:06 +0100 Subject: [PATCH 1/2] Medical side effects confirmed to work now. --- code/WorkInProgress/Cib/MedicalSideEffects.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/WorkInProgress/Cib/MedicalSideEffects.dm b/code/WorkInProgress/Cib/MedicalSideEffects.dm index eb23d21b14..522f1162cd 100644 --- a/code/WorkInProgress/Cib/MedicalSideEffects.dm +++ b/code/WorkInProgress/Cib/MedicalSideEffects.dm @@ -12,7 +12,7 @@ /mob/proc/add_side_effect(name, strength = 0) /mob/living/carbon/human/add_side_effect(name, strength = 0) for(var/datum/medical_effect/M in src.side_effects) if(M.name == name) - M.strength = max(M.strength, strength = 10) + M.strength = max(M.strength, 10) return var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect @@ -25,19 +25,19 @@ /mob/living/carbon/human/proc/handle_medical_side_effects() // One full cycle(in terms of strength) every 10 minutes - var/strength_percent = sin(life_tick / 300) + var/strength_percent = sin(life_tick / 2) // Only do anything if the effect is currently strong enough if(strength_percent >= 0.4) for (var/datum/medical_effect/M in side_effects) - if (M.cure()) + if (M.cure(src)) side_effects -= M del(M) else - if(life_tick % 30 == 0) + if(life_tick % 15 == 0) M.on_life(src, strength_percent*M.strength) // Effect slowly growing stronger - M.strength+=0.2 + M.strength+=0.05 // HEADACHE // ======== From 31cd43945d4ae76ff1f6c9818e203a55ac25e274 Mon Sep 17 00:00:00 2001 From: cib Date: Tue, 12 Feb 2013 18:20:57 +0100 Subject: [PATCH 2/2] Added various new side effects: - Headache triggered by bicaridine, alkysine and cryoxadone, treated with tramadol or alkysine - Cramps triggered by bandages and ointment, treated with inaprovaline - Bad stomach, triggered by dermaline, kelatone or being cloned, treated with anti-toxin --- code/WorkInProgress/Cib/MedicalSideEffects.dm | 78 +++++++++++++++++++ code/game/machinery/cloning.dm | 1 + code/game/objects/items/stacks/medical.dm | 1 + code/modules/reagents/Chemistry-Reagents.dm | 1 - 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/code/WorkInProgress/Cib/MedicalSideEffects.dm b/code/WorkInProgress/Cib/MedicalSideEffects.dm index 522f1162cd..d701bbb94f 100644 --- a/code/WorkInProgress/Cib/MedicalSideEffects.dm +++ b/code/WorkInProgress/Cib/MedicalSideEffects.dm @@ -24,6 +24,13 @@ side_effects += M /mob/living/carbon/human/proc/handle_medical_side_effects() + if(src.reagents.has_reagent("bicaridine") || src.reagents.has_reagent("tricordrazine") || src.reagents.has_reagent("cryoxadone")) + src.add_side_effect("Headache") + + + if(src.reagents.has_reagent("kelotane") || src.reagents.has_reagent("dermaline")) + src.add_side_effect("Bad Stomach") + // One full cycle(in terms of strength) every 10 minutes var/strength_percent = sin(life_tick / 2) @@ -60,4 +67,75 @@ /datum/medical_effect/headache/cure(mob/living/carbon/human/H) if(H.reagents.has_reagent("alkysine")) return 1 + return 0 + +// HEADACHE +// ======== +/datum/medical_effect/headache/name = "Headache" +/datum/medical_effect/headache/on_life(mob/living/carbon/human/H, strength) + switch(strength) + if(1 to 10) + H.custom_pain("You feel a light pain in your head.",0) + if(11 to 30) + H.custom_pain("You feel a throbbing pain in your head!",1) + if(31 to 99) + H.custom_pain("You feel an excrutiating pain in your head!",1) + H.adjustBrainLoss(1) + if(99 to INFINITY) + H.custom_pain("It feels like your head is about to split open!",1) + H.adjustBrainLoss(3) + var/datum/organ/external/O = H.organs_by_name["head"] + O.take_damage(0, 1, 0, "Headache") + +/datum/medical_effect/headache/cure(mob/living/carbon/human/H) + if(H.reagents.has_reagent("alkysine") || H.reagents.has_reagent("tramadol")) + H << "\red Your head stops throbbing.." + return 1 + return 0 + +// BAD STOMACH +// =========== +/datum/medical_effect/bad_stomach/name = "Bad Stomach" +/datum/medical_effect/bad_stomach/on_life(mob/living/carbon/human/H, strength) + switch(strength) + if(1 to 10) + H.custom_pain("You feel a bit light around the stomach.",0) + if(11 to 30) + H.custom_pain("Your stomach hurts.",0) + if(31 to 99) + H.custom_pain("You feel sick.",1) + H.adjustToxLoss(1) + if(99 to INFINITY) + H.custom_pain("You can't hold it in any longer!",1) + H.vomit() + +/datum/medical_effect/bad_stomach/cure(mob/living/carbon/human/H) + if(H.reagents.has_reagent("anti_toxin")) + H << "\red Your stomach feels a little better now.." + return 1 + return 0 + + +// CRAMPS +// ====== +/datum/medical_effect/cramps/name = "Cramps" +/datum/medical_effect/cramps/on_life(mob/living/carbon/human/H, strength) + switch(strength) + if(1 to 10) + H.custom_pain("The muscles in your body hurt a little.",0) + if(11 to 30) + H.custom_pain("The muscles in your body cramp up painfully.",0) + if(31 to 99) + H.emote("me",1,"flinches as all the muscles in their body cramp up.") + H.custom_pain("There's pain all over your body.",1) + H.adjustToxLoss(1) + if(99 to INFINITY) + H.emote("me",1,"flinches as all the muscles in their body cramp up.") + H.custom_pain("It feels as though your muscles are being ripped apart!",1) + H.apply_damage(1, used_weapon = "Cramps") + +/datum/medical_effect/cramps/cure(mob/living/carbon/human/H) + if(H.reagents.has_reagent("inaprovaline")) + H << "\red The cramps let up.." + return 1 return 0 \ No newline at end of file diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 5bbcd9b32b..fd54da9de1 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -326,6 +326,7 @@ src.icon_state = "pod_0" src.eject_wait = 0 //If it's still set somehow. domutcheck(src.occupant) //Waiting until they're out before possible monkeyizing. + src.occupant.add_side_effect("Bad Stomach") // Give them an extra side-effect for free. src.occupant = null return diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 659900aefc..b4f738304f 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -53,6 +53,7 @@ user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \ "\blue You salve wounds on [M]'s [affecting.display_name]." ) + H.add_side_effect("Cramps") H.UpdateDamageIcon() else M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2)) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 623e45c6cd..acec96cba7 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -1501,7 +1501,6 @@ datum return if(!M) M = holder.my_atom M.heal_organ_damage(2*REM,0) - M.add_side_effect("Headache") ..() return