Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blood moon rising #16344

Merged
merged 4 commits into from
Oct 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
88 changes: 88 additions & 0 deletions code/game/gamemodes/endgame/halloween/gravestone.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/obj/effect/gravestone
name = "gravestone"
desc = "Whoever lies here must sure be confused as to how they were buried in a space station."
icon = 'icons/obj/halloween.dmi'
icon_state = "gravestone_wood"
anchored = 1

/obj/effect/gravestone/New()
gravestone_flick()
..()

/obj/effect/gravestone/proc/gravestone_flick()
return

/obj/effect/gravestone/stone
icon_state = "gravestone_stone"

var/list/halloween_spawns = list(
"default" = list(/mob/living/simple_animal/hostile/humanoid/skellington),

"cargo" = list(/mob/living/simple_animal/hostile/humanoid/mummy, /mob/living/simple_animal/hostile/mimic/crate/chest,\
/mob/living/simple_animal/hostile/mimic/crate/item) + typesof(/mob/living/simple_animal/hostile/humanoid/jackal),

"kitchen" = list(/mob/living/simple_animal/hostile/humanoid/kitchen/poutine, /mob/living/simple_animal/hostile/humanoid/kitchen/meatballer),

"library" = list(/mob/living/simple_animal/hostile/scarybat/book, /mob/living/simple_animal/hostile/mannequin/cult),

"medical" = list(/mob/living/simple_animal/hostile/blood_splot, /obj/structure/skele_stand, /mob/living/simple_animal/hostile/monster/cyber_horror)\
+ typesof(/mob/living/simple_animal/hostile/necro/zombie),

"maintenance" = list(/mob/living/simple_animal/hostile/humanoid/vampire, /mob/living/simple_animal/hostile/gremlin/greytide,\
/mob/living/simple_animal/hostile/gremlin, /mob/living/simple_animal/hostile/necro/zombie/putrid),

"engineering" = list(/mob/living/simple_animal/hostile/humanoid/supermatter, /mob/living/simple_animal/hostile/syphoner),

)

/obj/effect/gravestone/halloween
name = "strange gravestone"

/obj/effect/gravestone/halloween/New()
icon_state = pick("gravestone_wood","gravestone_stone")
..()
spawn_enemies()

/obj/effect/gravestone/halloween/gravestone_flick()
flick("[icon_state]_new", src)

/obj/effect/gravestone/halloween/proc/spawn_enemies()
set waitfor = 0
var/our_area = get_area_string()

if(our_area == "space" || our_area == "chapel")
animate(src, alpha = 0, time = 1 SECONDS)
sleep(1 SECONDS)
qdel(src)
return

var/list/possible_spawns = halloween_spawns["default"] + halloween_spawns[our_area]

spawn(rand(15 SECONDS, 30 SECONDS))
var/to_spawn = pick(possible_spawns)
if(to_spawn)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could to_spawn ever return null here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did, and I was unable to reproduce why and/or how. Happened both on the test_tiny and boxstation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. Weird.

new to_spawn(get_turf(src))
animate(src, alpha = 0, time = 3 SECONDS)
spawn(3 SECONDS)
qdel(src)

/obj/effect/gravestone/halloween/proc/get_area_string()
. = "default"

var/area/A = get_area(src)
if(isspace(A))
. = "space"
else if(istype(A,/area/engine) || istype(A,/area/engineering) || istype(A,/area/construction))
. = "engineering"
else if(istype(A,/area/medical))
. = "medical"
else if(istype(A,/area/chapel))
. = "chapel"
else if(istype(A,/area/library))
. = "library"
else if(istype(A, /area/maintenance))
. = "maintenance"
else if(istype(A, /area/supply))
. = "cargo"
else if(istype(A,/area/crew_quarters/kitchen) || istype(A,/area/hydroponics))
. = "kitchen"
118 changes: 118 additions & 0 deletions code/game/gamemodes/endgame/halloween/halloween.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/* Halloween Rising
* Kill the lights, kill the power, ruin the APCs
* Shuttle is called for 10 minutes
* Sprinkle the station with monsters of halloween variety (Vampires, mummies, zombies, etc.)
* Have some area-specific monsters, such as the Poutine Titan for the kitchen
*/

/datum/universal_state/halloween
name = "All Hallows Eve"
desc = "Double, double toil and Trouble. Fire burn and Cauldron bubble."

decay_rate = 0

/datum/universal_state/halloween/OnShuttleCall(var/mob/user)
return 1

/datum/universal_state/halloween/DecayTurf(var/turf/T)
if(!T.holy)
T.cultify()
for(var/obj/machinery/light/L in T.contents)
L.broken()

/datum/universal_state/halloween/OnTurfChange(var/turf/T)
if(T.name == "space")
T.overlays += image(icon = T.icon, icon_state = "hell01")
T.underlays -= "hell01"
else
T.overlays -= image(icon = T.icon, icon_state = "hell01")

/datum/universal_state/halloween/OnEnter()
set background = 1
/*
if(emergency_shuttle.direction==2)
captain_announce("The emergency shuttle has returned due to bluespace distortion.")

emergency_shuttle.force_shutdown()
*/

escape_list = get_area_turfs(locate(/area/hallway/secondary/exit))
CHECK_TICK
suspend_alert = 1

convert_all_parallax()
//separated into separate procs for profiling
AreaSet()
MiscSet()
APCSet()
OverlayAndAmbientSet()

ticker.StartThematic("endgame")


/datum/universal_state/halloween/proc/AreaSet()
for(var/area/A in areas)
if(!istype(A,/area) || isspace(A))
continue

// No cheating~
A.jammed=2

// Reset all alarms.
A.fire = null
A.atmos = 1
A.atmosalm = 0
A.poweralm = 1
A.party = null
A.radalert = 0
A.updateicon()
CHECK_TICK


/datum/universal_state/halloween/OverlayAndAmbientSet()
set waitfor = FALSE
for(var/turf/T in world)
if(istype(T, /turf/space))
T.overlays += image(icon = T.icon, icon_state = "hell01")
else
if(!T.holy && prob(5) && T.z == STATION_Z && istype(T, /turf/simulated/floor))
new /obj/effect/gravestone/halloween(T)
T.underlays += "hell01"
CHECK_TICK

for(var/datum/lighting_corner/C in global.all_lighting_corners)
if (!C.active)
continue

C.update_lumcount(0.5, 0, 0)
CHECK_TICK

/datum/universal_state/halloween/proc/MiscSet()
for (var/obj/machinery/firealarm/alm in machines)
if (!(alm.stat & BROKEN))
alm.ex_act(2)
CHECK_TICK

/datum/universal_state/halloween/proc/APCSet()
for (var/obj/machinery/power/apc/APC in power_machines)
if (!(APC.stat & BROKEN) && !(istype(APC.areaMaster,/area/turret_protected/ai) || istype(APC.areaMaster, /area/engineering/engine)))
APC.chargemode = 0
if(APC.cell)
APC.cell.charge = 0
APC.emagged = 1
APC.queue_icon_update()
CHECK_TICK

/datum/universal_state/halloween/proc/convert_all_parallax()
for(var/client/C in clients)
var/obj/abstract/screen/plane_master/parallax_spacemaster/PS = locate() in C.screen
if(PS)
convert_parallax(PS)
CHECK_TICK

/datum/universal_state/halloween/convert_parallax(obj/abstract/screen/plane_master/parallax_spacemaster/PS)
PS.color = list(
0,0,0,0,
0,0,0,0,
0,0,0,0,
1,0,0,1)
1 change: 1 addition & 0 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ var/global/floorIsLava = 0
<A href='?src=\ref[src];secretsfun=hellonearth'>Summon Nar-Sie</A><BR>
<A href='?src=\ref[src];secretsfun=supermattercascade'>Start a Supermatter Cascade</A><BR>
<A href='?src=\ref[src];secretsfun=meteorstorm'>Trigger an undending Meteor Storm</A><BR>
<A href='?src=\ref[src];secretsfun=halloween'>Awaken the damned for some spooky shenanigans</A><BR>
"}

if(check_rights(R_SERVER,0))
Expand Down
7 changes: 7 additions & 0 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3303,6 +3303,13 @@
if(choice == "BRING ME MY FRIDGE")
SetUniversalState(/datum/universal_state/meteor_storm, 1, 1)
message_admins("[key_name_admin(usr)] has summoned an unending meteor storm upon the station. Go ahead and ask him for the details, don't forget to scream at him.")
if("halloween")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","HW")
var/choice = input("Are you sure you want to wake up the space indian burial ground?. Misuse of this could result in removal of flags or hilarity.") in list("Get our spook on", "Cancel")
if(choice != "Cancel")
SetUniversalState(/datum/universal_state/halloween, 1, 1)
message_admins("[key_name_admin(usr)] has pressed the halloween fun button. Truly [key_name_admin(usr)] is the spookiest.")
if("mobswarm")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","MS")
Expand Down