Made overall reagent effects balance out with REAGENTS_METABOLISM

This is a BS12 compatability change, with the intent of making it easier to change the rate at which chemicals are metabolized. This doesn't actually change anything about the effect of chemicals, until REAGENT_METABOLISM is adjusted, at which point the effect of a lot of chemicals will automatically adjust accordingly.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5556 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
CIB123
2013-01-15 16:10:45 +00:00
parent 0c431e95d1
commit eeacf01186
2 changed files with 69 additions and 58 deletions
+60 -56
View File
@@ -2,6 +2,8 @@
#define LIQUID 2
#define GAS 3
#define REM REAGENTS_EFFECT_MULTIPLIER
//The reaction procs must ALWAYS set src = null, this detaches the proc from the object (the reagent)
//so that it can continue working when the reagent is deleted while the proc is still active.
@@ -83,9 +85,9 @@ datum
on_mob_life(var/mob/living/M as mob)
if(prob(10))
M << "\red Your insides are burning!"
M.adjustToxLoss(rand(20,60))
M.adjustToxLoss(rand(20,60)*REM)
else if(prob(40))
M.heal_organ_damage(5,0)
M.heal_organ_damage(5*REM,0)
..()
return
@@ -268,29 +270,29 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.drowsyness = max(M.drowsyness-2, 0)
M.drowsyness = max(M.drowsyness-2*REM, 0)
if(holder.has_reagent("toxin"))
holder.remove_reagent("toxin", 2)
holder.remove_reagent("toxin", 2*REM)
if(holder.has_reagent("stoxin"))
holder.remove_reagent("stoxin", 2)
holder.remove_reagent("stoxin", 2*REM)
if(holder.has_reagent("plasma"))
holder.remove_reagent("plasma", 1)
holder.remove_reagent("plasma", 1*REM)
if(holder.has_reagent("sacid"))
holder.remove_reagent("sacid", 1)
holder.remove_reagent("sacid", 1*REM)
if(holder.has_reagent("cyanide"))
holder.remove_reagent("cyanide", 1)
holder.remove_reagent("cyanide", 1*REM)
if(holder.has_reagent("amatoxin"))
holder.remove_reagent("amatoxin", 2)
holder.remove_reagent("amatoxin", 2*REM)
if(holder.has_reagent("chloralhydrate"))
holder.remove_reagent("chloralhydrate", 5)
holder.remove_reagent("chloralhydrate", 5*REM)
if(holder.has_reagent("carpotoxin"))
holder.remove_reagent("carpotoxin", 1)
holder.remove_reagent("carpotoxin", 1*REM)
if(holder.has_reagent("zombiepowder"))
holder.remove_reagent("zombiepowder", 0.5)
holder.remove_reagent("zombiepowder", 0.5*REM)
if(holder.has_reagent("mindbreaker"))
holder.remove_reagent("mindbreaker", 2)
M.hallucination = max(0, M.hallucination - 5)
M.adjustToxLoss(-2)
holder.remove_reagent("mindbreaker", 2*REM)
M.hallucination = max(0, M.hallucination - 5*REM)
M.adjustToxLoss(-2*REM)
..()
return
@@ -303,7 +305,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.adjustToxLoss(1.5)
M.adjustToxLoss(1.5*REM)
..()
return
@@ -316,8 +318,8 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.adjustToxLoss(3)
M.adjustOxyLoss(3)
M.adjustToxLoss(3*REM)
M.adjustOxyLoss(3*REM)
M.sleeping += 1
..()
return
@@ -455,7 +457,7 @@ datum
if(!M) M = holder.my_atom
if(M.losebreath >= 10)
M.losebreath = max(10, M.losebreath-5)
holder.remove_reagent(src.id, 0.2)
holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM)
return
space_drugs
@@ -472,7 +474,7 @@ datum
if(M.canmove)
if(prob(10)) step(M, pick(cardinal))
if(prob(7)) M.emote(pick("twitch","drool","moan","giggle"))
holder.remove_reagent(src.id, 0.2)
holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM)
return
serotrotium
@@ -485,7 +487,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(ishuman(M))
if(prob(7)) M.emote(pick("twitch","drool","moan","gasp"))
holder.remove_reagent(src.id, 0.1)
holder.remove_reagent(src.id, 0.25 * REAGENTS_METABOLISM)
return
/* silicate
@@ -601,7 +603,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.take_organ_damage(1, 0)
M.take_organ_damage(1*REM, 0)
..()
return
@@ -614,7 +616,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.adjustToxLoss(1)
M.adjustToxLoss(1*REM)
..()
return
@@ -655,7 +657,7 @@ datum
color = "#808080" // rgb: 128, 128, 128
on_mob_life(var/mob/living/M as mob)
M.nutrition += 1
M.nutrition += 1*REM
..()
return
@@ -668,8 +670,8 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.adjustToxLoss(1)
M.take_organ_damage(0, 1)
M.adjustToxLoss(1*REM)
M.take_organ_damage(0, 1*REM)
..()
return
reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)
@@ -741,7 +743,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.adjustToxLoss(1)
M.adjustToxLoss(1*REM)
..()
return
@@ -833,7 +835,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.apply_effect(2,IRRADIATE,0)
M.apply_effect(2*REM,IRRADIATE,0)
..()
return
@@ -928,7 +930,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.nutrition += nutriment_factor
M.nutrition += nutriment_factor*REM
..()
return
@@ -1152,8 +1154,8 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
if(holder.has_reagent("inaprovaline"))
holder.remove_reagent("inaprovaline", 2)
M.adjustToxLoss(3)
holder.remove_reagent("inaprovaline", 2*REM)
M.adjustToxLoss(3*REM)
..()
return
reaction_obj(var/obj/O, var/volume)
@@ -1206,7 +1208,7 @@ datum
M.make_dizzy(1)
if(!M.confused) M.confused = 1
M.confused = max(M.confused, 20)
holder.remove_reagent(src.id, 0.2)
holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM)
..()
return
@@ -1222,7 +1224,7 @@ datum
return
if(!M) M = holder.my_atom
if(prob(33))
M.take_organ_damage(1, 0)
M.take_organ_damage(1*REM, 0)
M.adjustOxyLoss(3)
if(prob(20)) M.emote("gasp")
..()
@@ -1239,7 +1241,7 @@ datum
if(M.stat == 2.0)
return
if(!M) M = holder.my_atom
M.heal_organ_damage(0,2)
M.heal_organ_damage(0,2*REM)
..()
return
@@ -1254,7 +1256,7 @@ datum
if(M.stat == 2.0) //THE GUY IS **DEAD**! BEREFT OF ALL LIFE HE RESTS IN PEACE etc etc. He does NOT metabolise shit anymore, god DAMN
return
if(!M) M = holder.my_atom
M.heal_organ_damage(0,3)
M.heal_organ_damage(0,3*REM)
..()
return
@@ -1269,9 +1271,9 @@ datum
if(M.stat == 2.0)
return //See above, down and around. --Agouri
if(!M) M = holder.my_atom
M.adjustOxyLoss(-2)
M.adjustOxyLoss(-2*REM)
if(holder.has_reagent("lexorin"))
holder.remove_reagent("lexorin", 2)
holder.remove_reagent("lexorin", 2*REM)
..()
return
@@ -1288,7 +1290,7 @@ datum
if(!M) M = holder.my_atom
M.adjustOxyLoss(-M.getOxyLoss())
if(holder.has_reagent("lexorin"))
holder.remove_reagent("lexorin", 2)
holder.remove_reagent("lexorin", 2*REM)
..()
return
@@ -1303,10 +1305,10 @@ datum
if(M.stat == 2.0)
return
if(!M) M = holder.my_atom
if(M.getOxyLoss() && prob(80)) M.adjustOxyLoss(-1)
if(M.getBruteLoss() && prob(80)) M.heal_organ_damage(1,0)
if(M.getFireLoss() && prob(80)) M.heal_organ_damage(0,1)
if(M.getToxLoss() && prob(80)) M.adjustToxLoss(-1)
if(M.getOxyLoss() && prob(80)) M.adjustOxyLoss(-1*REM)
if(M.getBruteLoss() && prob(80)) M.heal_organ_damage(1*REM,0)
if(M.getFireLoss() && prob(80)) M.heal_organ_damage(0,1*REM)
if(M.getToxLoss() && prob(80)) M.adjustToxLoss(-1*REM)
..()
return
@@ -1405,7 +1407,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.jitteriness = max(M.jitteriness-5,0)
if(prob(80)) M.adjustBrainLoss(1)
if(prob(80)) M.adjustBrainLoss(1*REM)
if(prob(50)) M.drowsyness = max(M.drowsyness, 3)
if(prob(10)) M.emote("drool")
..()
@@ -1420,7 +1422,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.radiation = max(M.radiation-3,0)
M.radiation = max(M.radiation-3*REM,0)
..()
return
@@ -1435,8 +1437,8 @@ datum
if(M.stat == 2.0)
return //See above, down and around. --Agouri
if(!M) M = holder.my_atom
M.radiation = max(M.radiation-7,0)
M.adjustToxLoss(-1)
M.radiation = max(M.radiation-7*REM,0)
M.adjustToxLoss(-1*REM)
if(prob(15))
M.take_organ_damage(1, 0)
..()
@@ -1451,7 +1453,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.adjustBrainLoss(-3)
M.adjustBrainLoss(-3*REM)
..()
return
@@ -1483,7 +1485,7 @@ datum
if(M.stat == 2.0)
return
if(!M) M = holder.my_atom
M.heal_organ_damage(2,0)
M.heal_organ_damage(2*REM,0)
..()
return
@@ -1497,7 +1499,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
if(prob(5)) M.emote(pick("twitch","blink_r","shiver"))
holder.remove_reagent(src.id, 0.2)
holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM)
..()
return
@@ -1556,7 +1558,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.adjustToxLoss(2)
M.adjustToxLoss(2*REM)
..()
return
@@ -1569,8 +1571,8 @@ datum
on_mob_life(var/mob/living/carbon/M as mob)
if(!M) M = holder.my_atom
M.status_flags |= FAKEDEATH
M.adjustOxyLoss(0.5)
M.adjustToxLoss(0.5)
M.adjustOxyLoss(0.5*REM)
M.adjustToxLoss(0.5*REM)
M.Weaken(10)
M.silent = max(M.silent, 10)
M.tod = worldtime2text()
@@ -1738,7 +1740,7 @@ datum
M.sleeping += 1
if(51 to INFINITY)
M.sleeping += 1
M.adjustToxLoss(data - 50)
M.adjustToxLoss((data - 50)*REM)
..()
return
@@ -2001,7 +2003,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
M.adjustToxLoss(1)
M.adjustToxLoss(1*REM)
..()
return
@@ -2238,7 +2240,7 @@ datum
on_mob_life(var/mob/living/M as mob)
M.nutrition += nutriment_factor
if(!M) M = holder.my_atom
if(M.getToxLoss() && prob(20)) M.adjustToxLoss(-1)
if(M.getToxLoss() && prob(20)) M.adjustToxLoss(-1*REM)
M.nutrition++
..()
return
@@ -4158,4 +4160,6 @@ datum
else if(data >= 115 && prob(33))
M.confused = max(M.confused+15,15)
..()
return
return
// Undefine the alias for REAGENTS_EFFECT_MULTIPLER
#undef REM
+9 -2
View File
@@ -70,7 +70,14 @@
// Factor of how fast mob nutrition decreases
#define HUNGER_FACTOR 0.1
#define REAGENTS_METABOLISM 0.4
// How many units of reagent are consumed per tick, by default.
#define REAGENTS_METABOLISM 0.4
// By defining the effect multiplier this way, it'll exactly adjust
// all effects according to how they originally were with the 0.4 metabolism
#define REAGENTS_EFFECT_MULTIPLIER REAGENTS_METABOLISM / 0.4
#define MINIMUM_AIR_RATIO_TO_SUSPEND 0.05
//Minimum ratio of air that must move to/from a tile to suspend group processing
@@ -619,4 +626,4 @@ var/list/be_special_flags = list(
#define LANGUAGE_BINARY 16
#define LANGUAGE_OTHER 32768
#define LANGUAGE_UNIVERSAL 65535
#define LANGUAGE_UNIVERSAL 65535