Skip to content
Closed

Life DTs #21501

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code/modules/hallucinations/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
..()

//Main handling proc, called in life()
/mob/living/carbon/proc/handle_hallucinations()
hallucination -= 1 //Tick down the duration
/mob/living/carbon/proc/handle_hallucinations(seconds_per_tick)
hallucination -= seconds_per_tick //Tick down the duration

//Good/bad chems affecting duration
if(chem_effects[CE_HALLUCINATE] < 0)
hallucination = max(0, hallucination - abs(chem_effects[CE_HALLUCINATE]))
if(chem_effects[CE_HALLUCINATE] > 0 && prob(chem_effects[CE_HALLUCINATE]*20))
hallucination += chem_effects[CE_HALLUCINATE]
hallucination = max(0, hallucination - (abs(chem_effects[CE_HALLUCINATE]) * seconds_per_tick))
if(chem_effects[CE_HALLUCINATE] > 0 && SPT_PROB(chem_effects[CE_HALLUCINATE] * 20, seconds_per_tick))
hallucination += chem_effects[CE_HALLUCINATE] * seconds_per_tick

if(hallucination <= 0) //We're done
hallucination = 0
Expand Down
4 changes: 2 additions & 2 deletions code/modules/heavy_vehicle/mech_life.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/mob/living/heavy_vehicle/handle_disabilities()
/mob/living/heavy_vehicle/handle_disabilities(seconds_per_tick)
return

/mob/living/heavy_vehicle/handle_status_effects()
/mob/living/heavy_vehicle/handle_status_effects(seconds_per_tick)
return

/mob/living/heavy_vehicle/Life(seconds_per_tick, times_fired)
Expand Down
16 changes: 8 additions & 8 deletions code/modules/mob/living/carbon/alien/diona/diona_nymph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
. += "You have enough biomass to grow!"

//Overriding this function from /mob/living/carbon/alien/life.dm
/mob/living/carbon/alien/diona/handle_regular_status_updates()
/mob/living/carbon/alien/diona/handle_regular_status_updates(seconds_per_tick)
if(status_flags & GODMODE)
return FALSE

Expand All @@ -302,8 +302,8 @@
silent = FALSE
else
updatehealth()
handle_stunned()
handle_weakened()
handle_stunned(seconds_per_tick)
handle_weakened(seconds_per_tick)
if(health <= 0)
cleanupTransfer()
death()
Expand All @@ -322,7 +322,7 @@
if(sleeping)
if(mind)
if(mind.active && client)
sleeping = max(sleeping-1, 0)
sleeping = max(sleeping - seconds_per_tick, 0)
blinded = TRUE
set_stat(UNCONSCIOUS)
else if(!resting)
Expand All @@ -334,17 +334,17 @@
blinded = TRUE
eye_blurry = TRUE
else if(eye_blind)
eye_blind = max(eye_blind-1,0)
eye_blind = max(eye_blind - seconds_per_tick,0)
blinded = TRUE
else if(eye_blurry)
eye_blurry = max(eye_blurry-1, 0)
eye_blurry = max(eye_blurry - seconds_per_tick, 0)

//Ears
if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own
ear_deaf = max(ear_deaf, 1)
else if(ear_deaf) //deafness, heals slowly over time
ear_deaf = max(ear_deaf-1, 0)
ear_damage = max(ear_damage-0.05, 0)
ear_deaf = max(ear_deaf - seconds_per_tick, 0)
ear_damage = max(ear_damage - (seconds_per_tick / 20), 0)

update_icon()

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/alien/diona/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if(stat != DEAD)
diona_handle_light(DS)

/mob/living/carbon/alien/diona/handle_chemicals_in_body()
/mob/living/carbon/alien/diona/handle_chemicals_in_body(seconds_per_tick)
chem_effects.Cut()
analgesic = 0

Expand Down
24 changes: 12 additions & 12 deletions code/modules/mob/living/carbon/alien/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
return 1


/mob/living/carbon/alien/handle_mutations_and_radiation()
/mob/living/carbon/alien/handle_mutations_and_radiation(seconds_per_tick)

// Currently both Dionaea and larvae like to eat radiation, so I'm defining the
// rad absorbtion here. This will need to be changed if other baby aliens are added.

if(!total_radiation)
return

var/rads = total_radiation/25
apply_radiation(rads*-1)
var/rads = total_radiation / 25 * seconds_per_tick
apply_radiation(-rads)
adjustNutritionLoss(-rads)
heal_overall_damage(rads,rads)
adjustOxyLoss(-(rads))
adjustToxLoss(-(rads))
adjustOxyLoss(-rads)
adjustToxLoss(-rads)
return

/mob/living/carbon/alien/handle_regular_status_updates()
/mob/living/carbon/alien/handle_regular_status_updates(seconds_per_tick)

if(status_flags & GODMODE) return 0

Expand All @@ -55,34 +55,34 @@
blinded = 1
set_stat(UNCONSCIOUS)
if(getHalLoss() > 0)
adjustHalLoss(-3)
adjustHalLoss(-(3 * seconds_per_tick))

if(sleeping)
adjustHalLoss(-3)
adjustHalLoss(-(3 * seconds_per_tick))
if (mind)
if(mind.active && client != null)
sleeping = max(sleeping-1, 0)
blinded = 1
set_stat(UNCONSCIOUS)
else if(resting)
if(getHalLoss() > 0)
adjustHalLoss(-3)
adjustHalLoss(-(3 * seconds_per_tick))

else
set_stat(CONSCIOUS)
if(getHalLoss() > 0)
adjustHalLoss(-1)
adjustHalLoss(-seconds_per_tick)

// Eyes and blindness.
if(!has_eyes())
eye_blind = 1
blinded = 1
eye_blurry = 1
else if(eye_blind)
eye_blind = max(eye_blind-1,0)
eye_blind = max(eye_blind - seconds_per_tick,0)
blinded = 1
else if(eye_blurry)
eye_blurry = max(eye_blurry-1, 0)
eye_blurry = max(eye_blurry - seconds_per_tick, 0)

update_icon()

Expand Down
41 changes: 19 additions & 22 deletions code/modules/mob/living/carbon/brain/life.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/mob/living/carbon/brain/handle_breathing()
return

/mob/living/carbon/brain/handle_mutations_and_radiation()
/mob/living/carbon/brain/handle_mutations_and_radiation(seconds_per_tick)
if (total_radiation)
if (total_radiation > RADS_MAX)
total_radiation = RADS_MAX
Expand All @@ -12,15 +12,15 @@

switch(total_radiation)
if(RADS_LOW to RADS_MED-1)
apply_radiation(-1)
if(prob(25))
apply_radiation(-seconds_per_tick)
if(SPT_PROB(25, seconds_per_tick))
adjustToxLoss(1)
updatehealth()

if(RADS_MED to RADS_HIGH-1)
apply_radiation(-2)
adjustToxLoss(1)
if(prob(5))
apply_radiation(-(2 * seconds_per_tick))
adjustToxLoss(seconds_per_tick)
if(SPT_PROB(5, seconds_per_tick))
apply_radiation(-5)
if(!container)
to_chat(src, SPAN_WARNING("You feel weak."))
Expand All @@ -29,8 +29,8 @@
updatehealth()

if(RADS_HIGH to RADS_MAX)
apply_radiation(-3)
adjustToxLoss(3)
apply_radiation(-(3 * seconds_per_tick))
adjustToxLoss((3 * seconds_per_tick))
updatehealth()


Expand Down Expand Up @@ -71,7 +71,7 @@
adjustFireLoss(5.0*discomfort)


/mob/living/carbon/brain/handle_chemicals_in_body()
/mob/living/carbon/brain/handle_chemicals_in_body(seconds_per_tick)
chem_effects.Cut()
analgesic = 0

Expand All @@ -84,18 +84,18 @@
if(CE_PAINKILLER in chem_effects)
analgesic = chem_effects[CE_PAINKILLER]

confused = max(0, confused - 1)
confused = max(0, confused - seconds_per_tick)
// decrement dizziness counter, clamped to 0
if(resting)
dizziness = max(0, dizziness - 5)
dizziness = max(0, dizziness - (5 * seconds_per_tick))
else
dizziness = max(0, dizziness - 1)
dizziness = max(0, dizziness - seconds_per_tick)

updatehealth()

return //TODO: DEFERRED

/mob/living/carbon/brain/handle_regular_status_updates() //TODO: comment out the unused bits >_>
/mob/living/carbon/brain/handle_regular_status_updates(seconds_per_tick) //TODO: comment out the unused bits >_>
updatehealth()

if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
Expand Down Expand Up @@ -126,43 +126,40 @@
emote("alarm")
to_chat(src, SPAN_WARNING("Major electrical distruption detected: System rebooting."))
alert = 1
if(prob(75))
emp_damage -= 1
emp_damage -= 0.75 * seconds_per_tick
if(20)
alert = 0
blinded = 0
eye_blind = 0
ear_deaf = 0
silent = 0
emp_damage -= 1
emp_damage -= seconds_per_tick
if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage
eye_blurry = 1
ear_damage = 1
if(!alert)
emote("alert")
to_chat(src, SPAN_WARNING("Primary systems are now online."))
alert = 1
if(prob(50))
emp_damage -= 1
emp_damage -= 0.5 * seconds_per_tick
if(10)
alert = 0
eye_blurry = 0
ear_damage = 0
emp_damage -= 1
emp_damage -= seconds_per_tick
if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere)
if(!alert)
emote("notice")
to_chat(src, SPAN_WARNING("System reboot nearly complete."))
alert = 1
if(prob(25))
emp_damage -= 1
emp_damage -= 0.25 * seconds_per_tick
if(1)
alert = 0
to_chat(src, SPAN_WARNING("All systems restored."))
emp_damage -= 1

//Other
handle_statuses()
handle_statuses(seconds_per_tick)
return 1

/mob/living/carbon/brain/handle_regular_hud_updates()
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
handle_breathing()

//Chemicals in the body
handle_chemicals_in_body()
handle_chemicals_in_body(seconds_per_tick)

//Random events (vomiting etc)
handle_random_events()
handle_random_events(seconds_per_tick)

// eye, ear, brain damages
handle_disabilities()
handle_disabilities(seconds_per_tick)

//all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc
handle_statuses()
handle_statuses(seconds_per_tick)

. = 1

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
. = ..(gibbed, species.death_message, species.death_message_range)

if(!gibbed) //We want to handle organs one last time to make sure that hearts don't report a positive pulse after death.
handle_organs()
handle_organs(1)

handle_hud_list()

Expand Down
Loading
Loading