Files
Paradise/code/modules/mob/living/init_signals.dm
T
Charlie NolanGitHubBurzahparadisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
e6f99049f6 MILLA phase 2 (#27659)
* MILLA phase 2

* Lint.

* Build Rust library

* Assorted bugfixes and tweaks

* Simplify fire mechanics and make hotspot sending to DM more reliable.

* Assorted tweaks, fixed an issue in the core engine and removed the softcap it made necesary.

* SM fixes, slower plasmafire, less overpowered pyro anomalies, and air alarm improvements.

* Review fixes.

* Build Rust library

* Unbalanced icon.

* Rebalance immovable rods.

* Unbalanced has alerts, can fight airflow (but get slowed)

* Build Rust library

* Stronger space cooling, slower temperature flow, faster burns, burnt floors, and a hotspot display fix.

* Build Rust library

* Tweaks to avoid merge conflict

* Oops.

* Build Rust library

* Rebalance wind.

* Rebalance temperature flow and space cooling.

* Fix gas flamethrower.

* Build Rust library

* Make air push slowdown directional, so you don't get slowed while moving with the air.

* Variable name cleanup.

* Reduce the speed of wind pushes.

* Prevent wind pushes from breaking your pull.

* Prevent swaps during wind push.

* Made supermatter crytals reliably run last in atmos machinery.

* Sped up plasmafire burning, but dropped the minimum burn amount.

* Rebalanced SM heat output.

* Rebalanced pyro anomaly.

* Build Rust library

* Lint

* Build Rust library

* Uncap fuel burnt readout.

* Added Custom air alarm mode, dropped Refill cap to ONE_ATMOSPHERE.

* Updated air alarm modes to use pressure settings instead of ONE_ATMOSPHERE

* Added a list of areas not in Filtering to atmos alert computer.

* Increase pressure gradient and vent output, especially at low distro pressure.

* Changed Immovable Rod from Moderate to Major.

* Lint

* Build Rust library

* More lint!

* Build Rust library

* Magboots, scaled slowdown, and nukie borg immunity

* Wind image

* Wind v2

* Wind v3

* pngcrush

* pngcrush again

* Moved hotspot removal into SSair, add wind effect.

* Lint

* Build Rust library

* Fix hotspots.

* Hotspot visual based on gas burnt

* Build Rust library

* Scaled wind to gas amount, stopped first wind push while moving.

* Made Rust panic logging safer.

* Made MILLA full tick and sleep timers more honest.

* Pressure overlay, ghost mode, atmos goggles.

* Build Rust library

* Lint

* Build Rust library

* More lint-y stuff.

* Build Rust library

* Repair pressure overlay if it loses its loc.

* Bind pressure overlays to their tile better.

* Build Rust library

* Make the pressure overlay work on z=1 and not proliferate effects.

* Don't block the supply shuttle.

* Don't fine for special effects.

* Maybe don't fine for ghosts, either.

* Build Rust library

* Make pressure overlay play nice with shuttles.

* Build Rust library

* Pressure scanning for borgs.

* Build Rust library

* Lint

* Build Rust library

* Made explosions not generate so much wind.

* Removed an old and non-functional proc.

* Clientless mobs can get pushed again.

* Build Rust library

* cargo fmt

* Build Rust library

* Don't divide by zero.

* Plasmafire generator for the Shadow

* Update shadow to use plasmafire generators

* Fix shadow's plasmafire generators going out on depart.

* Prevent heat2color from runtiming at absolute zero.

* Better nanofrost

* Build Rust library

* Singularity immunity

* Build Rust library

* Add back meson mode to atmospheric scanner goggles, so they don't stare deeply into the SM

* Build Rust library

* Dump panic outputs into data/ instead.

* Build Rust library

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>

* Saner handling of MILLA crash.

* Build Rust library

---------

Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>
Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2025-01-01 20:12:05 +00:00

191 lines
7.1 KiB
Plaintext

/// Called on [/mob/living/proc/Initialize], for the mob to register to relevant signals.
/mob/living/proc/register_init_signals()
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_KNOCKEDOUT), PROC_REF(on_knockedout_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_KNOCKEDOUT), PROC_REF(on_knockedout_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FAKEDEATH), PROC_REF(on_fakedeath_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FAKEDEATH), PROC_REF(on_fakedeath_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), PROC_REF(on_handsblocked_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_HANDS_BLOCKED), PROC_REF(on_handsblocked_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_UI_BLOCKED), PROC_REF(on_ui_blocked_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_UI_BLOCKED), PROC_REF(on_ui_blocked_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_CANNOT_PULL), PROC_REF(on_pull_blocked_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_CANNOT_PULL), PROC_REF(on_pull_blocked_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_RESTRAINED), PROC_REF(on_restrained_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_RESTRAINED), PROC_REF(on_restrained_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_UNKNOWN), PROC_REF(on_unknown_trait))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_UNKNOWN), PROC_REF(on_unknown_trait))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_PRESSURE_VISION), PROC_REF(on_pressure_vision_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_PRESSURE_VISION), PROC_REF(on_pressure_vision_trait_loss))
/// Called when [TRAIT_KNOCKEDOUT] is added to the mob.
/mob/living/proc/on_knockedout_trait_gain(datum/source)
SIGNAL_HANDLER
if(stat < UNCONSCIOUS)
KnockOut()
/// Called when [TRAIT_KNOCKEDOUT] is removed from the mob.
/mob/living/proc/on_knockedout_trait_loss(datum/source)
SIGNAL_HANDLER
if(stat <= UNCONSCIOUS)
WakeUp()
/// Called when [TRAIT_IMMOBILIZED] is added to the mob.
/mob/living/proc/on_immobilized_trait_gain(datum/source)
SIGNAL_HANDLER
mobility_flags &= ~MOBILITY_MOVE
/// Called when [TRAIT_IMMOBILIZED] is removed from the mob.
/mob/living/proc/on_immobilized_trait_loss(datum/source)
SIGNAL_HANDLER
mobility_flags |= MOBILITY_MOVE
/// Called when [TRAIT_FLOORED] is added to the mob.
/mob/living/proc/on_floored_trait_gain(datum/source)
SIGNAL_HANDLER
if(HAS_TRAIT(src, TRAIT_FORCED_STANDING))
return // Don't go horizontal if mob has forced standing trait.
mobility_flags &= ~MOBILITY_STAND
on_floored_start()
/mob/living/proc/on_floored_start()
if(body_position == STANDING_UP) //force them on the ground
fall()
/// Called when [TRAIT_FLOORED] is removed from the mob.
/mob/living/proc/on_floored_trait_loss(datum/source)
SIGNAL_HANDLER
mobility_flags |= MOBILITY_STAND
on_floored_end()
/mob/living/proc/on_floored_end()
if(!resting)
stand_up(FALSE)
/// Called when [TRAIT_FORCED_STANDING] is added to the mob.
/mob/living/proc/on_forced_standing_trait_gain(datum/source)
SIGNAL_HANDLER
set_body_position(STANDING_UP)
/// Called when [TRAIT_FORCED_STANDING] is removed from the mob.
/mob/living/proc/on_forced_standing_trait_loss(datum/source)
SIGNAL_HANDLER
if(HAS_TRAIT(src, TRAIT_FLOORED))
fall()
else if(resting)
lay_down()
/// Called when [TRAIT_HANDS_BLOCKED] is added to the mob.
/mob/living/proc/on_handsblocked_trait_gain(datum/source)
SIGNAL_HANDLER
mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP)
on_handsblocked_start()
/mob/living/proc/on_handsblocked_start()
drop_l_hand()
drop_r_hand()
ADD_TRAIT(src, TRAIT_UI_BLOCKED, TRAIT_HANDS_BLOCKED)
ADD_TRAIT(src, TRAIT_CANNOT_PULL, TRAIT_HANDS_BLOCKED)
/// Called when [TRAIT_HANDS_BLOCKED] is removed from the mob.
/mob/living/proc/on_handsblocked_trait_loss(datum/source)
SIGNAL_HANDLER
mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP)
on_handsblocked_end()
/mob/living/proc/on_handsblocked_end()
REMOVE_TRAIT(src, TRAIT_UI_BLOCKED, TRAIT_HANDS_BLOCKED)
REMOVE_TRAIT(src, TRAIT_CANNOT_PULL, TRAIT_HANDS_BLOCKED)
/// Called when [TRAIT_UI_BLOCKED] is added to the mob.
/mob/living/proc/on_ui_blocked_trait_gain(datum/source)
SIGNAL_HANDLER
unset_machine()
update_action_buttons_icon()
/// Called when [TRAIT_UI_BLOCKED] is removed from the mob.
/mob/living/proc/on_ui_blocked_trait_loss(datum/source)
SIGNAL_HANDLER
update_action_buttons_icon()
/// Called when [TRAIT_CANNOT_PULL] is added to the mob.
/mob/living/proc/on_pull_blocked_trait_gain(datum/source)
SIGNAL_HANDLER
mobility_flags &= ~(MOBILITY_PULL)
if(pulling)
stop_pulling()
/// Called when [TRAIT_CANNOT_PULL] is removed from the mob.
/mob/living/proc/on_pull_blocked_trait_loss(datum/source)
SIGNAL_HANDLER
mobility_flags |= MOBILITY_PULL
/// Called when [TRAIT_RESTRAINED] is added to the mob.
/mob/living/proc/on_restrained_trait_gain(datum/source)
SIGNAL_HANDLER
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, TRAIT_RESTRAINED)
/// Called when [TRAIT_RESTRAINED] is removed from the mob.
/mob/living/proc/on_restrained_trait_loss(datum/source)
SIGNAL_HANDLER
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, TRAIT_RESTRAINED)
/// Called when [TRAIT_FAKEDEATH] is added to the mob.
/mob/living/proc/on_fakedeath_trait_gain(datum/source)
SIGNAL_HANDLER
ADD_TRAIT(src, TRAIT_KNOCKEDOUT, TRAIT_FAKEDEATH)
apply_status_effect(STATUS_EFFECT_REVIVABLE)
/mob/living/carbon/human/on_fakedeath_trait_gain(datum/source)
. = ..()
stop_tail_wagging()
/// Called when [TRAIT_FAKEDEATH] is removed from the mob.
/mob/living/proc/on_fakedeath_trait_loss(datum/source)
SIGNAL_HANDLER
REMOVE_TRAIT(src, TRAIT_KNOCKEDOUT, TRAIT_FAKEDEATH)
remove_status_effect(STATUS_EFFECT_REVIVABLE)
/// Gaining or losing [TRAIT_UNKNOWN] updates our name and our sechud
/mob/living/proc/on_unknown_trait(datum/source)
SIGNAL_HANDLER // SIGNAL_ADDTRAIT(TRAIT_UNKNOWN), SIGNAL_REMOVETRAIT(TRAIT_UNKNOWN)
addtimer(CALLBACK(src, PROC_REF(on_unknown_trait_part_2)), 0.1 SECONDS) // Remove signal is sent before the trait is removed, we need to wait a tick
/mob/living/proc/on_unknown_trait_part_2()
name = get_visible_name()
sec_hud_set_ID()
/// Called when [TRAIT_PRESSURE_VISION] is added to the mob.
/mob/living/proc/on_pressure_vision_trait_gain(datum/source)
SIGNAL_HANDLER
var/datum/atom_hud/data/pressure/hud = GLOB.huds[DATA_HUD_PRESSURE]
if(!(src in hud.hudusers))
hud.add_hud_to(src)
/// Called when [TRAIT_PRESSURE_VISION] is removed from the mob.
/mob/living/proc/on_pressure_vision_trait_loss(datum/source)
SIGNAL_HANDLER
var/datum/atom_hud/data/pressure/hud = GLOB.huds[DATA_HUD_PRESSURE]
if(src in hud.hudusers)
hud.remove_hud_from(src)