Sprinting, Stamina and Temporary Modifiers (#1030)

Introduces:
- Temporary modifiers process and datums for that
- A new stamina and sprinting mechanic. That is in need of further development! Weee!
This commit is contained in:
NanakoAC
2016-10-26 16:22:39 +01:00
committed by skull132
parent a3f051693d
commit c4b36a5490
32 changed files with 1097 additions and 80 deletions
@@ -39,6 +39,10 @@
return
if(!affects_dead && M.stat == DEAD)
return
if(!dose && volume)//If dose is currently zero, we do the first effect
initial_effect(M, alien)
if(overdose && (dose > overdose) && (location != CHEM_TOUCH))
overdose(M, alien)
var/removed = metabolism
@@ -61,6 +65,11 @@
remove_self(removed)
return
//Initial effect is called once when the reagent first starts affecting a mob.
/datum/reagent/proc/initial_effect(var/mob/living/carbon/M, var/alien)
return
/datum/reagent/proc/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
return
@@ -65,6 +65,8 @@
var/adj_temp = 0
var/targ_temp = 310
var/halluci = 0
var/datum/modifier/caffeine_mod
var/caffeine = 0
glass_icon_state = "glass_clear"
glass_name = "glass of ethanol"
@@ -103,6 +105,10 @@
if(halluci)
M.hallucination = max(M.hallucination, halluci)
if (caffeine && !caffeine_mod)
caffeine_mod = M.add_modifier(/datum/modifier/stimulant, MODIFIER_REAGENT, src, _strength = caffeine, override = MODIFIER_OVERRIDE_STRENGTHEN)
/datum/reagent/ethanol/touch_obj(var/obj/O)
if(istype(O, /obj/item/weapon/paper))
@@ -354,12 +354,17 @@
var/adj_drowsy = 0
var/adj_sleepy = 0
var/adj_temp = 0
var/caffeine = 0 // strength of stimulant effect, since so many drinks use it
var/datum/modifier/modifier = null
/datum/reagent/drink/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.adjustToxLoss(removed) // Probably not a good idea; not very deadly though
return
/datum/reagent/drink/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if (caffeine && !modifier)
modifier = M.add_modifier(/datum/modifier/stimulant, MODIFIER_REAGENT, src, _strength = caffeine, override = MODIFIER_OVERRIDE_STRENGTHEN)
M.nutrition += nutrition * removed
M.dizziness = max(0, M.dizziness + adj_dizzy)
M.drowsyness = max(0, M.drowsyness + adj_drowsy)
@@ -586,6 +591,7 @@
adj_sleepy = -2
adj_temp = 25
overdose = 45
caffeine = 0.3
glass_icon_state = "hot_coffee"
glass_name = "cup of coffee"
@@ -606,6 +612,7 @@
M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT))
/datum/reagent/drink/coffee/overdose(var/mob/living/carbon/M, var/alien)
if(alien == IS_DIONA)
return
@@ -757,6 +764,7 @@
id = "rewriter"
color = "#485000"
adj_temp = -5
caffeine = 0.4
glass_icon_state = "rewriter"
glass_name = "glass of Rewriter"
@@ -767,6 +775,7 @@
..()
M.make_jittery(5)
/datum/reagent/drink/nuka_cola
name = "Nuka Cola"
id = "nuka_cola"
@@ -774,6 +783,7 @@
color = "#100800"
adj_temp = -5
adj_sleepy = -2
caffeine = 1
glass_icon_state = "nuka_colaglass"
glass_name = "glass of Nuka-Cola"
@@ -1043,6 +1053,7 @@
description = "A widely known, Mexican coffee-flavoured liqueur. In production since 1936!"
color = "#664300"
strength = 20
caffeine = 0.25
glass_icon_state = "kahluaglass"
glass_name = "glass of RR coffee liquor"
@@ -1115,6 +1126,7 @@
color = "#102000"
strength = 10
nutriment_factor = 1
caffeine = 0.5
glass_icon_state = "thirteen_loko_glass"
glass_name = "glass of Thirteen Loko"
@@ -1390,6 +1402,7 @@
description = "It's just as effective as Dutch-Courage!"
color = "#664300"
strength = 30
caffeine = 0.2
glass_icon_state = "bravebullglass"
glass_name = "glass of Brave Bull"
@@ -1598,6 +1611,7 @@
description = "Coffee, and alcohol. More fun than a Mimosa to drink in the morning."
color = "#664300"
strength = 15
caffeine = 0.3
glass_icon_state = "irishcoffeeglass"
glass_name = "glass of Irish coffee"
@@ -1979,6 +1993,7 @@
adj_sleepy = -3
adj_temp = 30
overdose = 40
caffeine = 0.4
glass_icon_state = "blackcoffee"
glass_name = "A mug of rich Black Coffee"
@@ -1994,6 +2009,7 @@
adj_sleepy = -3
adj_temp = 30
overdose = 40
caffeine = 0.3
glass_icon_state = "whitecoffee"
glass_name = "A mug of Café Au Lait"
@@ -2013,6 +2029,7 @@
adj_sleepy = -3
adj_temp = 30
overdose = 40
caffeine = 0.3
glass_icon_state = "whitecoffee"
glass_name = "A mug of Café Mélange"
@@ -9,11 +9,15 @@
overdose = REAGENTS_OVERDOSE * 2
metabolism = REM * 0.5
scannable = 1
var/datum/modifier/modifier
/datum/reagent/inaprovaline/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien != IS_DIONA)
M.add_chemical_effect(CE_STABLE)
M.add_chemical_effect(CE_PAINKILLER, 25)
if (!modifier)
modifier = M.add_modifier(/datum/modifier/adrenaline, MODIFIER_REAGENT, src, _strength = 0.6, override = MODIFIER_OVERRIDE_STRENGTHEN)
/datum/reagent/bicaridine
name = "Bicaridine"
@@ -212,6 +216,7 @@
metabolism = REM * 0.05
overdose = REAGENTS_OVERDOSE
scannable = 1
var/datum/modifier/modifier
/datum/reagent/synaptizine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
@@ -224,6 +229,10 @@
M.hallucination = max(0, M.hallucination - 10)
M.adjustToxLoss(5 * removed) // It used to be incredibly deadly due to an oversight. Not anymore!
M.add_chemical_effect(CE_PAINKILLER, 40)
if (!modifier)
modifier = M.add_modifier(/datum/modifier/adrenaline, MODIFIER_REAGENT, src, _strength = 1, override = MODIFIER_OVERRIDE_STRENGTHEN)
/datum/reagent/alkysine
name = "Alkysine"
@@ -305,6 +314,7 @@
color = "#FF3300"
metabolism = REM * 0.15
overdose = REAGENTS_OVERDOSE * 0.5
var/datum/modifier = null
/datum/reagent/hyperzine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
@@ -312,7 +322,8 @@
if(prob(5))
M.emote(pick("twitch", "blink_r", "shiver"))
M.add_chemical_effect(CE_SPEEDBOOST, 1)
if (!modifier)
modifier = M.add_modifier(/datum/modifier/stimulant, MODIFIER_REAGENT, src, _strength = 1, override = MODIFIER_OVERRIDE_STRENGTHEN)
#define ETHYL_INTOX_COST 3 //The cost of power to remove one unit of intoxication from the patient