mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-13 19:02:12 +00:00
* SDQL2 update * fix that verb * cl * fix that * toworld * this is pointless * update info * siiiiick.. * vv edit update * fix that * fix editing vars * fix VV * Port the /TG/ globals controller. * part 1 * part 2 * oops * part 3 * Hollow Purple * sadas * bsbsdb * muda na agaki ta * ids 1-15 * 16-31 * 41-75 * bring me back to how things used to be before i lost it all * the strength of mayhem * final touches * cl * protect some vars * update sdql2 to use glob * stuff? * forgot that is not defined there * whoops * observ * but it never gets better * a --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
26 lines
691 B
Plaintext
26 lines
691 B
Plaintext
// Observer Pattern Implementation: Stat Set
|
|
// Registration type: /mob/living
|
|
//
|
|
// Raised when: A /mob/living changes stat, using the set_stat() proc
|
|
//
|
|
// Arguments that the called proc should expect:
|
|
// /mob/living/stat_mob: The mob whose stat changed
|
|
// /old_stat: Status before the change.
|
|
// /new_stat: Status after the change.
|
|
|
|
GLOBAL_DATUM_INIT(stat_set_event, /singleton/observ/stat_set, new)
|
|
|
|
|
|
/singleton/observ/stat_set
|
|
name = "Stat Set"
|
|
expected_type = /mob/living
|
|
|
|
/****************
|
|
* Stat Handling *
|
|
****************/
|
|
/mob/living/set_stat(var/new_stat)
|
|
var/old_stat = stat
|
|
. = ..()
|
|
if(stat != old_stat)
|
|
GLOB.stat_set_event.raise_event(src, old_stat, new_stat)
|