mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 03:51:49 +01: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>
81 lines
2.1 KiB
Plaintext
81 lines
2.1 KiB
Plaintext
/**********************
|
|
* ENDGAME STUFF
|
|
**********************/
|
|
|
|
// Universal State
|
|
// Handles stuff like space icon_state, constants, etc.
|
|
// Essentially a policy manager. Once shit hits the fan, this changes its policies.
|
|
// Called by master controller.
|
|
|
|
// Default shit.
|
|
/datum/universal_state
|
|
// Just for reference, for now.
|
|
// Might eventually add an observatory job.
|
|
var/name = "Normal"
|
|
var/desc = "Nothing seems awry."
|
|
|
|
// Sets world.turf, replaces all turfs of type /turf/space.
|
|
var/space_type = /turf/space
|
|
|
|
// Replaces all turfs of type /turf/space/transit/bluespace
|
|
var/transit_space_type = /turf/space/transit/bluespace
|
|
|
|
// Chance of a floor or wall getting damaged [0-100]
|
|
// Simulates stuff getting broken due to molecular bonds decaying.
|
|
var/decay_rate = 0
|
|
|
|
// Actually decay the turf.
|
|
/datum/universal_state/proc/DecayTurf(var/turf/T)
|
|
if(istype(T,/turf/simulated/wall))
|
|
var/turf/simulated/wall/W=T
|
|
W.melt()
|
|
return
|
|
if(istype(T,/turf/simulated/floor))
|
|
var/turf/simulated/floor/F=T
|
|
// Burnt?
|
|
if(!F.burnt)
|
|
F.burn_tile()
|
|
else
|
|
F.ReplaceWithLattice()
|
|
return
|
|
|
|
// Return 0 to cause shuttle call to fail.
|
|
/datum/universal_state/proc/OnShuttleCall(var/mob/user)
|
|
return 1
|
|
|
|
// Processed per tick
|
|
/datum/universal_state/proc/OnTurfTick(var/turf/T)
|
|
if(decay_rate && prob(decay_rate))
|
|
DecayTurf(T)
|
|
|
|
// Apply changes when exiting state
|
|
/datum/universal_state/proc/OnExit()
|
|
return // Does nothing by default
|
|
|
|
// Apply changes when entering state
|
|
/datum/universal_state/proc/OnEnter()
|
|
return // Does nothing by default
|
|
|
|
// Apply changes to a new turf.
|
|
/datum/universal_state/proc/OnTurfChange(var/turf/NT)
|
|
return
|
|
|
|
/datum/universal_state/proc/OverlayAndAmbientSet()
|
|
return
|
|
|
|
/datum/universal_state/proc/OnPlayerLatejoin(var/mob/living/M)
|
|
return
|
|
|
|
/datum/universal_state/proc/OnTouchMapEdge(var/atom/A)
|
|
return TRUE //return FALSE to cancel map edge handling
|
|
|
|
/proc/SetUniversalState(var/newstate,var/on_exit=1, var/on_enter=1, list/arguments=null)
|
|
if(on_exit)
|
|
GLOB.universe.OnExit()
|
|
if(arguments)
|
|
GLOB.universe = new newstate(arglist(arguments))
|
|
else
|
|
GLOB.universe = new newstate
|
|
if(on_enter)
|
|
GLOB.universe.OnEnter()
|