From 37df89cd722bc036b46d9fca7b15a3845aa8152f Mon Sep 17 00:00:00 2001 From: Arceniu Date: Wed, 10 Jul 2024 14:00:38 +0300 Subject: [PATCH] qol: unlimited event spawner --- modular_nova/modules/events/code/event_spawner.dm | 9 +++++---- modular_nova/modules/events/code/event_spawner_menu.dm | 9 ++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modular_nova/modules/events/code/event_spawner.dm b/modular_nova/modules/events/code/event_spawner.dm index 1b28c2267d0256..8875a647779aa7 100644 --- a/modular_nova/modules/events/code/event_spawner.dm +++ b/modular_nova/modules/events/code/event_spawner.dm @@ -13,7 +13,7 @@ var/flavor_text = "" var/list/additional_equipment var/disappear_after_spawn - + var/infinite = TRUE var/used = FALSE /obj/character_event_spawner/attack_ghost(mob/user) @@ -78,9 +78,10 @@ if(!user || !user.client) return message_admins("[ADMIN_LOOKUPFLW(user)] spawned as a [job_name] by using a spawner.") - used = TRUE - icon_state = "cryopod-open" - name = "opened cryogenic sleeper" + if(!infinite) + used = TRUE + icon_state = "cryopod-open" + name = "opened cryogenic sleeper" //Spawn and copify prefs var/mob/living/carbon/human/H = new(src) user.client.prefs.safe_transfer_prefs_to(H) diff --git a/modular_nova/modules/events/code/event_spawner_menu.dm b/modular_nova/modules/events/code/event_spawner_menu.dm index 6cfaf9619e694a..41d2571cbb1910 100644 --- a/modular_nova/modules/events/code/event_spawner_menu.dm +++ b/modular_nova/modules/events/code/event_spawner_menu.dm @@ -12,7 +12,7 @@ var/list/additional_equipment = list() var/disappear_after_spawn = FALSE var/prompt_players = FALSE - + var/infinite = FALSE var/show_outfit_equipment = FALSE /datum/event_spawner_instance/New(_id, template_id) @@ -35,6 +35,7 @@ CES.gets_loadout = gets_loadout CES.headset_override = headset_override CES.flavor_text = flavor_text + CES.infinite = infinite CES.disappear_after_spawn = disappear_after_spawn CES.name = "[job_name] cryogenic sleeper" if(prompt_players) @@ -58,6 +59,7 @@ blocks["gender_whitelist"] = gender_whitelist.Copy() blocks["ckey_whitelist"] = ckey_whitelist.Copy() blocks["disappear_after_spawn"] = disappear_after_spawn + blocks["infinite"] = infinite blocks["prompt_players"] = prompt_players return json_encode(blocks) @@ -77,6 +79,7 @@ species_whitelist = blocks["species_whitelist"] gender_whitelist = blocks["gender_whitelist"] ckey_whitelist = blocks["ckey_whitelist"] + infinite = blocks["infinite"] disappear_after_spawn = blocks["disappear_after_spawn"] prompt_players = blocks["prompt_players"] @@ -206,6 +209,7 @@ dat += "[ckey]" dat += " <- Add" dat += "
If no ckeys are in the list, then any ckey can join as this role." + dat += "
Spawner can spawn infinite peoples: [ESI.infinite ? "Yes" : "No"]" dat += "
Spawner disappears after spawn: [ESI.disappear_after_spawn ? "Yes" : "No"]" dat += "
Prompt players when spawner created: [ESI.prompt_players ? "Yes" : "No"] This will only prompt ckeys which can access the spawner." dat += "
Create spawner on current location
" @@ -260,6 +264,8 @@ ESI.show_outfit_equipment = !ESI.show_outfit_equipment if("loadout") ESI.gets_loadout = !ESI.gets_loadout + if("infinite") + ESI.infinite = !ESI.infinite if("disappear_after_spawn") ESI.disappear_after_spawn = !ESI.disappear_after_spawn if("prompt_players") @@ -360,6 +366,7 @@ ESI2.gets_loadout = ESI.gets_loadout ESI2.headset_override = ESI.headset_override ESI2.flavor_text = ESI.flavor_text + ESI2.infinite = ESI.infinite ESI2.disappear_after_spawn = ESI.disappear_after_spawn ESI2.prompt_players = ESI.prompt_players