Files
Paradise/code/modules/events/undead_event.dm
DGamerL bad8b31afa Changes all .len to length() where applicable (#25174)
* Globals work

* Double access works

* All other things

* Revert "All other things"

This reverts commit 6574442eb6.

* More changes that compile and work

* IT WORKS AAAAAA

* Changes even more .len to length()

* Apply suggestions from code review

* Update code/datums/mind.dm

* Update code/__HELPERS/sorts/InsertSort.dm

Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>

* Update code/__HELPERS/sanitize_values.dm

Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>

---------

Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
2024-04-19 17:32:09 +00:00

41 lines
1.2 KiB
Plaintext

/datum/event/undead
var/spawn_prob = 10
startWhen = 2
announceWhen = 3
/datum/event/undead/start()
var/datum/event/electrical_storm/RS = new
RS.lightsoutAmount = pick(2,2,3)
RS.start()
RS.kill()
for(var/area/A in GLOB.all_areas)
if(!is_station_level(A.z)) continue //Spook on main station only.
if(A.luminosity) continue
// if(A.lighting_space) continue
if(A.type == /area) continue
var/list/turflist = list()
for(var/turf/T in A)
if(isspaceturf(T) || T.density) continue
if(locate(/mob/living) in T) continue
var/okay = 1
for(var/obj/O in T)
if(O.density)
okay = 0
break
if(okay)
turflist += T
if(!length(turflist)) continue
var/turfs = round(length(turflist) * spawn_prob/100,1)
while(turfs > 0 && length(turflist)) // safety
turfs--
var/turf/T = pick_n_take(turflist)
var/undeadtype = pick(/mob/living/simple_animal/hostile/retaliate/skeleton,
80;/mob/living/simple_animal/hostile/retaliate/zombie,
60;/mob/living/simple_animal/hostile/retaliate/ghost)
new undeadtype(T)
/datum/event/undead/announce()
for(var/mob/living/M in GLOB.player_list)
to_chat(M, "You feel [pick("a chill","a deathly chill","the undead","dirty", "creeped out","afraid","fear")]!")