Skip to content
Open
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
1 change: 1 addition & 0 deletions aquila/aquila.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "code\datum\wires\wires_jukebox.dm"
#include "code\datums\components\nanites.dm"
#include "code\datums\diseases\advance\symptoms\fleshgrowth.dm"
#include "code\datums\diseases\advance\symptoms\heal.dm"
#include "code\datums\diseases\transformation.dm"
#include "code\datums\ai_laws.dm"
#include "code\datums\dna.dm"
Expand Down
55 changes: 55 additions & 0 deletions aquila/code/datums/diseases/advance/symptoms/heal.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/datum/symptom/heal/symbiotic
name = "Symbiotic Regeneration"
desc = "The virus forms a symbiotic relationship with vital organs in the host's body, accelerating the host's natural healing processes while resting."
stealth = -3
resistance = -1
stage_speed = 2
transmission = -4

level = 3
passive_message = "<span class='notice'>You feel calm."

/// When was the last time the affected mob moved?
var/last_moved = 0
/// How long do you need to stand still to start healing?
var/heal_delay = 3 SECONDS

threshold_desc = list(
"Stage speed 9" = "Shorter delay until healing starts.",
"Resistance 9" = "Increased rate of healing.",
)

/datum/symptom/heal/symbiotic/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.stealth >= 5) //stronger healing
heal_delay = 1 SECONDS
if(A.resistance >= 10) //no delay
power = 3
RegisterSignal(A.affected_mob, COMSIG_MOB_CLIENT_PRE_MOVE, PROC_REF(on_move))

/datum/symptom/heal/symbiotic/End(datum/disease/advance/A)
UnregisterSignal(A.affected_mob, COMSIG_MOB_CLIENT_PRE_MOVE)
return ..()

/datum/symptom/heal/symbiotic/proc/on_move(mob/living/mover, dir)
last_moved = world.time

/datum/symptom/heal/symbiotic/CanHeal(datum/disease/advance/A)
if(last_moved + heal_delay > world.time)
return FALSE
return power

/datum/symptom/heal/symbiotic/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
if(M.health == M.maxHealth)
return
if(last_moved + heal_delay > world.time)
return

if(M.getBruteLoss() || M.getFireLoss() || M.getToxLoss())
var/heal_amount = actual_power * 0.5
M.heal_bodypart_damage(heal_amount, heal_amount, required_status = BODYTYPE_ORGANIC)
M.adjustToxLoss(-heal_amount)
return TRUE
return FALSE // stop healing if there isn't any damage to heal