mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 08:56:49 +01:00
cadd19beac
* 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>
27 lines
689 B
Plaintext
27 lines
689 B
Plaintext
// Observer Pattern Implementation: Sight Set
|
|
// Registration type: /mob
|
|
//
|
|
// Raised when: A mob's sight value changes.
|
|
//
|
|
// Arguments that the called proc should expect:
|
|
// /mob/sightee: The mob that had its sight set
|
|
// /old_sight: sight before the change
|
|
// /new_sight: sight after the change
|
|
|
|
GLOBAL_DATUM_INIT(sight_set_event, /singleton/observ/sight_set, new)
|
|
|
|
|
|
/singleton/observ/sight_set
|
|
name = "Sight Set"
|
|
expected_type = /mob
|
|
|
|
/*********************
|
|
* Sight Set Handling *
|
|
*********************/
|
|
|
|
/mob/proc/set_sight(var/new_sight)
|
|
var/old_sight = sight
|
|
if(old_sight != new_sight)
|
|
sight = new_sight
|
|
GLOB.sight_set_event.raise_event(src, old_sight, new_sight)
|