Files
Bubberstation/code/modules/hallucination/fire.dm
skylord-a52 be0e6efdf6 [IDB IGNORE] [MDB IGNORE] Makes the icons/mob folder sane (#69302)
About The Pull Request

Reorganizes the entire icons/mob folder.

Added the following new subfolders:

    nonhuman-player (this was initially just called "antag", but then I realized guardians aren't technically antags)
    simplemob
    silicon
    effects (for bloodstains, fire, etc)
    simplemob/held-pets (for exactly that -- I wasn't sure if this should go in inhands instead)
    species/monkey

Moves the following stuff:

    All human parts moved into species, with moth, lizard, monkey, etc parts moved to corresponding subfolders. Previously, there were some moth parts in mob/species/moth, and others just loose in mob. Other species were similar.
    icemoon, lavaland, and jungle folders made into subfolders of simplemob
    All AI and silicon stuff, as well as Beepsky et al. into the silicon folder, simplemobs into the simplemob folder, aliens into the nonhuman-player folder, etc.
    Split up animal_parts.dmi into two bodyparts.dmi which were put in their respective folders (species/alien and species/monkey)

Code changes:

    Filepath changes to account for all of this
    Adds a check when performing surgery on monkeys and xenos, because we can no longer assume their limbs are in the same file
    Turns some hardcoded statues and showcases that were built into maps into objects instead

Things I'd like to do in the future but cant be assed right now:

    Remove primarily-antag sprites from simplemob/mob.dmi (Revenant, Morph, etc.) and put them in the nonhuman-player folder
    Split up mutant_bodyparts.dmi into different files for Tizirans, Felinids, monkeys, etc and put them in their own folders. Those may have once been meant primarily for mutated humans but that's now how they're being used right now.
2022-09-03 11:52:54 -07:00

90 lines
2.3 KiB
Plaintext

#define RAISE_FIRE_COUNT 3
#define RAISE_FIRE_TIME 3
/datum/hallucination/fire
var/active = TRUE
var/stage = 0
var/image/fire_overlay
var/next_action = 0
var/times_to_lower_stamina
var/fire_clearing = FALSE
var/increasing_stages = TRUE
var/time_spent = 0
/datum/hallucination/fire/New(mob/living/carbon/C, forced = TRUE)
set waitfor = FALSE
..()
target.set_fire_stacks(max(target.fire_stacks, 0.1)) //Placebo flammability
fire_overlay = image('icons/mob/effects/onfire.dmi', target, "human_burning", ABOVE_MOB_LAYER)
if(target.client)
target.client.images += fire_overlay
to_chat(target, span_userdanger("You're set on fire!"))
target.throw_alert(ALERT_FIRE, /atom/movable/screen/alert/fire, override = TRUE)
times_to_lower_stamina = rand(5, 10)
addtimer(CALLBACK(src, .proc/start_expanding), 20)
/datum/hallucination/fire/Destroy()
. = ..()
STOP_PROCESSING(SSfastprocess, src)
/datum/hallucination/fire/proc/start_expanding()
if (isnull(target))
qdel(src)
return
START_PROCESSING(SSfastprocess, src)
/datum/hallucination/fire/process(delta_time)
if (isnull(target))
qdel(src)
return
if(target.fire_stacks <= 0)
clear_fire()
time_spent += delta_time
if (fire_clearing)
next_action -= delta_time
if (next_action < 0)
stage -= 1
update_temp()
next_action += 3
else if (increasing_stages)
var/new_stage = min(round(time_spent / RAISE_FIRE_TIME), RAISE_FIRE_COUNT)
if (stage != new_stage)
stage = new_stage
update_temp()
if (stage == RAISE_FIRE_COUNT)
increasing_stages = FALSE
else if (times_to_lower_stamina)
next_action -= delta_time
if (next_action < 0)
target.adjustStaminaLoss(15)
next_action += 2
times_to_lower_stamina -= 1
else
clear_fire()
/datum/hallucination/fire/proc/update_temp()
if(stage <= 0)
target.clear_alert(ALERT_TEMPERATURE, clear_override = TRUE)
else
target.clear_alert(ALERT_TEMPERATURE, clear_override = TRUE)
target.throw_alert(ALERT_TEMPERATURE, /atom/movable/screen/alert/hot, stage, override = TRUE)
/datum/hallucination/fire/proc/clear_fire()
if(!active)
return
active = FALSE
target.clear_alert(ALERT_FIRE, clear_override = TRUE)
if(target.client)
target.client.images -= fire_overlay
QDEL_NULL(fire_overlay)
fire_clearing = TRUE
next_action = 0
#undef RAISE_FIRE_COUNT
#undef RAISE_FIRE_TIME