diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index c3f5734c83..ba7b172588 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -57,27 +57,32 @@ GLOBAL_VAR(obfs_y) GLOBAL_VAR_INIT(ai_xeno_weeding, FALSE) GLOBAL_VAR_INIT(xenosurge_spawner_limit, 30) + +GLOBAL_VAR_INIT(xenosurge_surge_started, 0) GLOBAL_VAR_INIT(xenosurge_wave_xenos_max, 100) GLOBAL_VAR_INIT(xenosurge_wave_xenos_current, 0) +GLOBAL_VAR_INIT(xenosurge_wave_veteran_xenos_current, 0) +GLOBAL_VAR_INIT(xenosurge_veteran_xenos_max, 6) -GLOBAL_VAR_INIT(xenosurge_wave_xenos_hp_factor, 1) -GLOBAL_VAR_INIT(xenosurge_wave_xenos_dam_factor, 1) -GLOBAL_LIST_EMPTY(xenosurge_configured_spawners) +GLOBAL_VAR_INIT(xenosurge_wave_xenos_hp, 50) +GLOBAL_VAR_INIT(xenosurge_wave_xenos_armor, 0) +GLOBAL_VAR_INIT(xenosurge_wave_xenos_dam_min, 5) +GLOBAL_VAR_INIT(xenosurge_wave_xenos_dam_max, 7) + GLOBAL_VAR_INIT(xenosurge_spawner_xenos, 5) GLOBAL_VAR_INIT(xenosurge_spawner_delay, 100) +GLOBAL_VAR_INIT(xenosurge_spawner_variance, 10) -GLOBAL_LIST_EMPTY(xenosurge_configured_veteran_spawners) -GLOBAL_VAR_INIT(xenosurge_veteran_spawner_xenos, 2) +GLOBAL_VAR_INIT(xenosurge_veteran_spawner_xenos_max, 2) GLOBAL_VAR_INIT(xenosurge_veteran_spawner_delay, 200) GLOBAL_VAR_INIT(xenosurge_veteran_spawner_variance, 100) -GLOBAL_VAR_INIT(xenosurge_veteran_xenos_hp_factor, 2) -GLOBAL_VAR_INIT(xenosurge_veteran_xenos_dam_factor, 0.5) + +GLOBAL_LIST_EMPTY(xenosurge_configured_spawners) GLOBAL_VAR_INIT(spawner_number, 1) -GLOBAL_VAR_INIT(veteran_spawner_number, 1) -GLOBAL_VAR_INIT(quest_items_number, 1) +GLOBAL_VAR_INIT(quest_items_number, 0) GLOBAL_VAR_INIT(quest_items_found, 0) GLOBAL_VAR_INIT(ammo_restock_next, 0) diff --git a/code/modules/admin/PvE/spawner_control.dm b/code/modules/admin/PvE/spawner_control.dm index 91a3331b89..a71ea64b25 100644 --- a/code/modules/admin/PvE/spawner_control.dm +++ b/code/modules/admin/PvE/spawner_control.dm @@ -1,17 +1,3 @@ -/client/proc/create_spawner_setup() - set category = "DM.Xenosurge" - set name = "Spawners - Create Setup" - set desc = "Configures spawner creation variables." - - if(!check_rights(R_ADMIN)) - return - var/max_to_pass = tgui_input_number(usr, "How many xenos total from created spawners","Spawner Setup",default = GLOB.xenosurge_spawner_xenos, timeout = 0) - if(max_to_pass == null) return - GLOB.xenosurge_spawner_xenos = max_to_pass - var/delay_to_pass = tgui_input_number(usr, "Dealy, in ticks (~10 a second) between spawn checks","Spawner Setup",default = GLOB.xenosurge_spawner_delay, timeout = 0) - if(delay_to_pass == null) return - GLOB.xenosurge_spawner_delay = delay_to_pass - /client/proc/setup_surge() set category = "DM.Xenosurge" set name = "Surge - Setup" @@ -20,49 +6,99 @@ if(!check_rights(R_ADMIN)) return var/surge_setup_value - switch(tgui_input_list(usr, "Max:[GLOB.xenosurge_spawner_limit]\nSpawned:[GLOB.xenosurge_wave_xenos_current] out of [GLOB.xenosurge_wave_xenos_max]", "SURGE", list("Global Xeno Limit","Number of Surge Xenos","Factors","Spawn List"))) + switch(tgui_input_list(usr, "Max:[GLOB.xenosurge_spawner_limit]\nSpawned:[GLOB.xenosurge_wave_xenos_current] out of [GLOB.xenosurge_wave_xenos_max]", "SURGE SETUP CHOICE", list("Global Xeno Limit","Number of Surge Xenos","Factors","Spawn List"))) if(null) return if("Global Xeno Limit") - surge_setup_value = tgui_input_number(usr, "Pick maximum xenos at once. This is a global control to prevent lag. Generally suggest leaving this alone.", "SURGE",GLOB.xenosurge_spawner_limit,timeout = 0) + surge_setup_value = tgui_input_number(usr, "Pick maximum xenos at once. This is a global control to prevent lag. Generally suggest leaving this alone.", "SURGE SETUP GLOBAL XENOS",GLOB.xenosurge_spawner_limit,timeout = 0) if(surge_setup_value == null) return GLOB.xenosurge_spawner_limit = surge_setup_value to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) - if("Number of Surge Xenos") - surge_setup_value = tgui_input_number(usr, "Xenos to spawn in the wave", "SURGE",GLOB.xenosurge_wave_xenos_max,timeout = 0) + if("Number of Surge") + surge_setup_value = tgui_input_number(usr, "Xenos to spawn in the wave", "SURGE SETUP SURGE NO",GLOB.xenosurge_wave_xenos_max,timeout = 0) if(surge_setup_value == null) return GLOB.xenosurge_wave_xenos_max = surge_setup_value to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) - if("Factors") - surge_setup_value = tgui_input_number(usr, "HP Factor", "SURGE",GLOB.xenosurge_wave_xenos_hp_factor,timeout = 0) + if("Number of Veteran Surge") + surge_setup_value = tgui_input_number(usr, "Xenos to spawn in the wave", "SURGE SETUP VETERAN NO",GLOB.xenosurge_veteran_xenos_max,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_veteran_xenos_max = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + +/client/proc/setup_surge_globals() + set category = "DM.Xenosurge" + set name = "Surge - Globals Setup" + set desc = "Accesses Surge Globals." + + if(!check_rights(R_ADMIN)) + return + var/surge_setup_value + switch(tgui_input_list(usr, "Max:[GLOB.xenosurge_spawner_limit]\nSpawned:[GLOB.xenosurge_wave_xenos_current] out of [GLOB.xenosurge_wave_xenos_max]", "ADVANCED SURGE SETUP CHOICE", list("Global Xeno Limit","Number of Surge Xenos","Factors","Spawn List"))) + if(null) + return + if("Regular HP") + surge_setup_value = tgui_input_number(usr, "Regular Wave HP", "REGULAR WAVE HP",GLOB.xenosurge_wave_xenos_hp,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_wave_xenos_hp = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + if("Regular ARMOR") + surge_setup_value = tgui_input_number(usr, "Regular Wave Armor", "REGULAR WAVE ARMOR",GLOB.xenosurge_wave_xenos_armor,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_wave_xenos_armor = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + if("Regular DAM MIN") + surge_setup_value = tgui_input_number(usr, "Regular Damage Min", "REGULAR DAM MIN",GLOB.xenosurge_wave_xenos_dam_min,timeout = 0) if(surge_setup_value == null) return - GLOB.xenosurge_wave_xenos_hp_factor = surge_setup_value + GLOB.xenosurge_wave_xenos_dam_min = surge_setup_value to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) - surge_setup_value = tgui_input_number(usr, "Damage Factor", "SURGE",GLOB.xenosurge_wave_xenos_dam_factor,timeout = 0) + if("Regular DAM MAX") + surge_setup_value = tgui_input_number(usr, "Regular Damage Max", "REGULAR DAM MAX",GLOB.xenosurge_wave_xenos_dam_max,timeout = 0) if(surge_setup_value == null) return - GLOB.xenosurge_wave_xenos_dam_factor = surge_setup_value + GLOB.xenosurge_wave_xenos_dam_max = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + if("Regular Spawner Xenos") + surge_setup_value = tgui_input_number(usr, "Regular Spawner Xenos spawned per spawning loop", "REGULAR SPAWNER XENOS",GLOB.xenosurge_spawner_xenos,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_spawner_xenos = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + if("Regular Spawner Dealy") + surge_setup_value = tgui_input_number(usr, "Regular Spawner Delay between loops", "REGULAR SPAWNER DELAY",GLOB.xenosurge_spawner_delay,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_spawner_delay = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + if("Regular Spawner Variance") + surge_setup_value = tgui_input_number(usr, "Regular Spawner Loop Spawn Variance", "REGULAR SPAWNER VARIANCE",GLOB.xenosurge_spawner_variance,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_spawner_variance = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + if("Veteran Spawner Xenos") + surge_setup_value = tgui_input_number(usr, "Veteran Spawner Xenos spawned per spawning loop", "VETERAN SPAWNER XENOS",GLOB.xenosurge_veteran_spawner_xenos_max,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_veteran_spawner_xenos_max = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + if("Veteran Spawner Dealy") + surge_setup_value = tgui_input_number(usr, "Veteran Spawner Delay between loops", "VETERAN SPAWNER DELAY",GLOB.xenosurge_veteran_spawner_delay,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_veteran_spawner_delay = surge_setup_value + to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) + if("Veteran Spawner Variance") + surge_setup_value = tgui_input_number(usr, "Veteran Spawner Loop Spawn Variance", "VETERAN SPAWNER VARIANCE",GLOB.xenosurge_veteran_spawner_variance,timeout = 0) + if(surge_setup_value == null) return + GLOB.xenosurge_veteran_spawner_variance = surge_setup_value to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) - if("Spawn List") - var/list/spawns_to_set = list() - var/current_number = 1 - var/adding_finished = 0 - while(adding_finished == 0) - var/type_to_add = tgui_input_list(usr, "Current position: [current_number], select a xeno to add:", "SURGE", list(XENO_CASTE_DRONE, XENO_CASTE_RUNNER, XENO_CASTE_LURKER, XENO_CASTE_CRUSHER, XENO_CASTE_FACEHUGGER, "FINISH"), timeout = 0, default = XENO_CASTE_DRONE) - if(type_to_add == null) return - if(type_to_add != "FINISH") - spawns_to_set.Add(list(type_to_add)) - current_number += 1 - else - spawns_to_set.Add(list(null)) - adding_finished = 1 - for(var/obj/structure/xenosurge_spawner/spawner in GLOB.xenosurge_configured_spawners) - if(!spawner) - to_chat(usr, SPAN_WARNING("No spawners set!")) - return - spawner.spawn_list = spawns_to_set return - +/client/proc/surge_status() + set category = "DM.Xenosurge" + set name = "Surge - Status" + set desc = "Checks surge status" + if(!check_rights(R_ADMIN)) + return + if(GLOB.xenosurge_surge_started == 0) + to_chat(usr, SPAN_INFO("Xenosurge nor started.")) + else + to_chat(usr, SPAN_INFO("Xenosurge Ongoing!")) + to_chat(usr, SPAN_INFO("Spawned Normal:[GLOB.xenosurge_wave_xenos_current] out of [GLOB.xenosurge_wave_xenos_max], Veterans: [GLOB.xenosurge_wave_veteran_xenos_current] out of [GLOB.xenosurge_veteran_xenos_max].")) /client/proc/start_surge() set category = "DM.Xenosurge" @@ -81,10 +117,7 @@ if(spawner.spawner_initiated == TRUE) spawner.start_spawning() spawner_count += 1 - for (var/obj/structure/xenosurge_veteran_spawner/veteran_spawner in GLOB.xenosurge_configured_veteran_spawners) - if(veteran_spawner.spawner_initiated == TRUE) - veteran_spawner.start_spawning() - veteran_spawner_count += 1 + GLOB.xenosurge_surge_started = 1 to_chat(usr, SPAN_INFO("Spawner activation complete. Spawners activated: [spawner_count] and [veteran_spawner_count] veterans.")) message_admins("[usr] has activated a [spawner_count] spawner Xenosurge. Parameters: Max:[GLOB.xenosurge_spawner_limit], Xenos:[GLOB.xenosurge_wave_xenos_max]") @@ -96,12 +129,7 @@ if(!check_rights(R_ADMIN)) return if(tgui_alert(usr, "Confirm: Stop Xenosurge?","STOP",list("Cancel","OK"), timeout = 0) == "OK") - for (var/obj/structure/xenosurge_spawner/spawner in GLOB.xenosurge_configured_spawners) - if(spawner.spawner_initiated == TRUE) - spawner.spawner_initiated = FALSE - for (var/obj/structure/xenosurge_veteran_spawner/veteran_spawner in GLOB.xenosurge_configured_veteran_spawners) - if(veteran_spawner.spawner_initiated == TRUE) - veteran_spawner.spawner_initiated = FALSE + GLOB.xenosurge_surge_started = 0 GLOB.xenosurge_wave_xenos_current = 0 to_chat(usr, SPAN_INFO("All spawners have been deactivated, the surge is effectively stopped.")) @@ -118,27 +146,8 @@ qdel(spawner) GLOB.xenosurge_configured_spawners = list() GLOB.spawner_number = 1 - for (var/obj/structure/xenosurge_veteran_spawner/veteran_spawner in world) - qdel(veteran_spawner) - GLOB.xenosurge_configured_veteran_spawners = list() - GLOB.veteran_spawner_number = 1 to_chat(usr, SPAN_INFO("Spawners removed and ID number reset.")) -/client/proc/reinitialize_spawners() - set category = "DM.Xenosurge" - set name = "Spawners - Reinitialize" - set desc = "Reinits spawners to let them be used in active surges again." - if(!check_rights(R_ADMIN)) - return - if(tgui_alert(usr, "Confirm: Reinit spawners?","REINIT",list("Cancel","OK"), timeout = 0) == "OK") - for (var/obj/structure/xenosurge_spawner/spawner in GLOB.xenosurge_configured_spawners) - if(spawner.spawner_initiated == FALSE) - spawner.spawner_initiated = TRUE - for (var/obj/structure/xenosurge_veteran_spawner/veteran_spawner in GLOB.xenosurge_configured_veteran_spawners) - if(veteran_spawner.spawner_initiated == FALSE) - veteran_spawner.spawner_initiated = TRUE - to_chat(usr, SPAN_INFO("Spawners reinitialized. You may now restart a surge.")) - /client/proc/surge_preset_hp() set category = "DM.Xenosurge" set name = "Surge - Xeno HP and Damage" @@ -149,63 +158,35 @@ if(null) return if("Fodder") - GLOB.xenosurge_wave_xenos_hp_factor = 0.3 - GLOB.xenosurge_wave_xenos_dam_factor = 0.5 + GLOB.xenosurge_wave_xenos_hp = 50 + GLOB.xenosurge_wave_xenos_armor = 0 + GLOB.xenosurge_wave_xenos_dam_min = 5 + GLOB.xenosurge_wave_xenos_dam_max = 7 if("Very Weak") - GLOB.xenosurge_wave_xenos_hp_factor = 0.5 - GLOB.xenosurge_wave_xenos_dam_factor = 0.5 + GLOB.xenosurge_wave_xenos_hp = 100 + GLOB.xenosurge_wave_xenos_armor = 0 + GLOB.xenosurge_wave_xenos_dam_min = 5 + GLOB.xenosurge_wave_xenos_dam_max = 8 if("Weak") - GLOB.xenosurge_wave_xenos_hp_factor = 0.7 - GLOB.xenosurge_wave_xenos_dam_factor = 0.7 + GLOB.xenosurge_wave_xenos_hp = 150 + GLOB.xenosurge_wave_xenos_armor = 0 + GLOB.xenosurge_wave_xenos_dam_min = 5 + GLOB.xenosurge_wave_xenos_dam_max = 9 if("Normal") - GLOB.xenosurge_wave_xenos_hp_factor = 1 - GLOB.xenosurge_wave_xenos_dam_factor = 1 + GLOB.xenosurge_wave_xenos_hp = 200 + GLOB.xenosurge_wave_xenos_armor = 0 + GLOB.xenosurge_wave_xenos_dam_min = 5 + GLOB.xenosurge_wave_xenos_dam_max = 10 if("Strong") - GLOB.xenosurge_wave_xenos_hp_factor = 1.3 - GLOB.xenosurge_wave_xenos_dam_factor = 1.2 + GLOB.xenosurge_wave_xenos_hp = 250 + GLOB.xenosurge_wave_xenos_armor = 20 + GLOB.xenosurge_wave_xenos_dam_min = 7 + GLOB.xenosurge_wave_xenos_dam_max = 10 if("Very Strong") - GLOB.xenosurge_wave_xenos_hp_factor = 1.5 - GLOB.xenosurge_wave_xenos_dam_factor = 1.5 - -/client/proc/surge_preset_waves() - set category = "DM.Xenosurge" - set name = "Surge - Xeno types" - set desc = "Switch all spawner xeno lists to a specific type." - if(!check_rights(R_ADMIN)) - return - var/list/list_to_set = list() - switch(tgui_input_list(usr, "Select a surge preset:","SURGE",list("Drones","Runners","Lurkers","Crushers","Drones-Runners","Drones-Lurkers","Runners-Lurkers","Drones-Runners-Lurkers","Drones-Crushers","Runners-Crushers","All-Out"), timeout = 0, default = "Normal")) - if(null) - return - if("Drones") - list_to_set = list(1 = XENO_CASTE_DRONE, 2 = null,) - if("Runners") - list_to_set = list(1 = XENO_CASTE_RUNNER, 2 = null,) - if("Lurkers") - list_to_set = list(1 = XENO_CASTE_LURKER, 2 = null,) - if("Crushers") - list_to_set = list(1 = XENO_CASTE_CRUSHER, 2 = null,) - if("Drones-Runners") - list_to_set = list(1 = XENO_CASTE_DRONE, 2 = XENO_CASTE_DRONE, 3 = XENO_CASTE_RUNNER, 4 = null) - if("Drones-Lurkers") - list_to_set = list(1 = XENO_CASTE_DRONE, 2 = XENO_CASTE_DRONE, 3 = XENO_CASTE_LURKER, 4 = null) - if("Runners-Lurkers") - list_to_set = list(1 = XENO_CASTE_RUNNER, 2 = XENO_CASTE_RUNNER, 3 = XENO_CASTE_LURKER, 4 = null) - if("Drones-Runners-Lurkers") - list_to_set = list(1 = XENO_CASTE_DRONE, 2 = XENO_CASTE_DRONE, 3 = XENO_CASTE_RUNNER, 4 = XENO_CASTE_LURKER, 5 = null) - if("Drones-Crushers") - list_to_set = list(1 = XENO_CASTE_DRONE, 2 = XENO_CASTE_DRONE, 3 = XENO_CASTE_DRONE, 4 = XENO_CASTE_CRUSHER, 5 = null) - if("Runners-Crushers") - list_to_set = list(1 = XENO_CASTE_RUNNER, 2 = XENO_CASTE_RUNNER, 3 = XENO_CASTE_RUNNER, 4 = XENO_CASTE_CRUSHER, 5 = null) - if("All-Out") - list_to_set = list(1 = XENO_CASTE_DRONE, 2 = XENO_CASTE_DRONE, 3 = XENO_CASTE_DRONE, 4 = XENO_CASTE_RUNNER, 5 = XENO_CASTE_RUNNER, 6 = XENO_CASTE_LURKER, 7 = XENO_CASTE_CRUSHER, 8 = null) - if(list_to_set.len != 0) - var/spawner_count = 0 - for (var/obj/structure/xenosurge_spawner/spawner in GLOB.xenosurge_configured_spawners) - if(spawner.spawner_initiated == TRUE) - spawner.spawn_list = list_to_set - spawner_count += 1 - to_chat(usr, SPAN_INFO("Done. [spawner_count] spawners set.")) + GLOB.xenosurge_wave_xenos_hp = 300 + GLOB.xenosurge_wave_xenos_armor = 20 + GLOB.xenosurge_wave_xenos_dam_min = 9 + GLOB.xenosurge_wave_xenos_dam_max = 12 /client/proc/create_surge_spawner(turf/T in turfs) set name = "Create Surge Spawner" @@ -214,73 +195,5 @@ if(!src.admin_holder || !(admin_holder.rights & R_MOD)) to_chat(src, "Only administrators may use this command.") return - - var/obj/structure/xenosurge_spawner/spawner = new(T) - if(spawner.setup_spawner(max = GLOB.xenosurge_spawner_xenos, delay = GLOB.xenosurge_spawner_delay) == 0) - to_chat(usr, SPAN_WARNING("Spawner not configured. Discarding.")) - qdel(spawner) - return - -/client/proc/create_veteran_spawner_setup() - set category = "DM.Xenosurge" - set name = "Veterans - Creation" - set desc = "Configures Veteran spawner creation variables." - - if(!check_rights(R_ADMIN)) - return - var/max_to_pass = tgui_input_number(usr, "How many total veterans per spawner?","Spawner Setup",default = GLOB.xenosurge_veteran_spawner_xenos, timeout = 0) - if(max_to_pass == null) return - GLOB.xenosurge_veteran_spawner_xenos = max_to_pass - var/delay_to_pass = tgui_input_number(usr, "Base veteran spawn delay","Spawner Setup",default = GLOB.xenosurge_veteran_spawner_delay, timeout = 0) - if(delay_to_pass == null) return - GLOB.xenosurge_veteran_spawner_delay = delay_to_pass - var/variance_to_pass = tgui_input_number(usr, "Delay variance, added maximum between this and 1 is added to base delay","Spawner Setup",default = GLOB.xenosurge_veteran_spawner_variance, timeout = 0) - if(variance_to_pass == null) return - GLOB.xenosurge_veteran_spawner_variance = variance_to_pass - -/client/proc/veteran_setup() - set category = "DM.Xenosurge" - set name = "Veterans - Setup" - set desc = "Changes Veteran spawners" - if(!check_rights(R_ADMIN)) - return - var/list/list_to_set = list() - switch(tgui_input_list(usr, "Select a veteran type:","VETERAN",list("Drones","Runners","Lurkers","Crushers"), timeout = 0, default = "Normal")) - if(null, "Drones") - list_to_set = list(1 = XENO_CASTE_DRONE, 2 = null,) - if("Runners") - list_to_set = list(1 = XENO_CASTE_RUNNER, 2 = null,) - if("Lurkers") - list_to_set = list(1 = XENO_CASTE_LURKER, 2 = null,) - if("Crushers") - list_to_set = list(1 = XENO_CASTE_CRUSHER, 2 = null,) - if(list_to_set.len != 0) - var/spawner_count = 0 - for (var/obj/structure/xenosurge_veteran_spawner/spawner in GLOB.xenosurge_configured_veteran_spawners) - if(spawner.spawner_initiated == TRUE) - spawner.spawn_list = list_to_set - spawner_count += 1 - to_chat(usr, SPAN_INFO("Done. [spawner_count] veteran spawners set.")) - var/surge_setup_value - surge_setup_value = tgui_input_number(usr, "HP Factor", "VETERAN",GLOB.xenosurge_veteran_xenos_hp_factor,timeout = 0) - if(surge_setup_value == null) surge_setup_value = GLOB.xenosurge_veteran_xenos_hp_factor - GLOB.xenosurge_veteran_xenos_hp_factor = surge_setup_value - to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) - surge_setup_value = tgui_input_number(usr, "Damage Factor", "VETERAN",GLOB.xenosurge_veteran_xenos_dam_factor,timeout = 0) - if(surge_setup_value == null) surge_setup_value = GLOB.xenosurge_veteran_xenos_dam_factor - GLOB.xenosurge_veteran_xenos_dam_factor = surge_setup_value - to_chat(usr, SPAN_INFO("[surge_setup_value] set.")) - -/client/proc/create_veteran_surge_spawner(turf/T in turfs) - set name = "Create Veteran Surge Spawner" - set category = null - - if(!src.admin_holder || !(admin_holder.rights & R_MOD)) - to_chat(src, "Only administrators may use this command.") - return - - var/obj/structure/xenosurge_veteran_spawner/spawner = new(T) - if(spawner.setup_spawner(max = GLOB.xenosurge_veteran_spawner_xenos, delay = GLOB.xenosurge_veteran_spawner_delay, variance = GLOB.xenosurge_veteran_spawner_variance) == 0) - to_chat(usr, SPAN_WARNING("Spawner not configured. Discarding.")) - qdel(spawner) + new /obj/structure/xenosurge_spawner(T) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index a7abd416f8..a1d7868f6d 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -141,14 +141,11 @@ var/list/admin_verbs_minor_event = list( /client/proc/admin_biohazard_alert, /client/proc/toggle_hardcore_perma, /client/proc/toggle_bypass_joe_restriction, - /client/proc/create_spawner_setup, /client/proc/remove_spawners, - /client/proc/reinitialize_spawners, /client/proc/setup_surge, /client/proc/start_surge, /client/proc/stop_surge, /client/proc/surge_preset_hp, - /client/proc/surge_preset_waves, /client/proc/set_narration_preset, /client/proc/speak_to_comms, /client/proc/call_tgui_play_directly, @@ -157,6 +154,8 @@ var/list/admin_verbs_minor_event = list( /client/proc/change_objective, /client/proc/enable_full_restock, /client/proc/admin_shutter_control, + /client/proc/surge_status, + /client/proc/setup_surge_globals, ) var/list/admin_verbs_major_event = list( @@ -179,9 +178,6 @@ var/list/admin_verbs_major_event = list( /client/proc/change_weather, /client/proc/admin_blurb, /client/proc/create_surge_spawner, - /client/proc/create_veteran_spawner_setup, - /client/proc/veteran_setup, - /client/proc/create_veteran_surge_spawner, ) var/list/admin_verbs_spawn = list( diff --git a/code/modules/admin/game_master/game_master.dm b/code/modules/admin/game_master/game_master.dm index 730b7d5c1f..2135d63cf7 100644 --- a/code/modules/admin/game_master/game_master.dm +++ b/code/modules/admin/game_master/game_master.dm @@ -352,10 +352,11 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100) for(var/i = 1 to xeno_spawn_count) var/mob/living/carbon/xenomorph/spawned_xeno = new spawning_xeno_type(spawn_turf, null, selected_hive, !spawn_ai) - spawned_xeno.health = ceil(spawned_xeno.health * GLOB.xenosurge_wave_xenos_hp_factor) - spawned_xeno.maxHealth = ceil(spawned_xeno.maxHealth * GLOB.xenosurge_wave_xenos_hp_factor) - spawned_xeno.melee_damage_lower = ceil(spawned_xeno.melee_damage_lower * GLOB.xenosurge_wave_xenos_dam_factor) - spawned_xeno.melee_damage_upper = ceil(spawned_xeno.melee_damage_upper * GLOB.xenosurge_wave_xenos_dam_factor) + spawned_xeno.health = GLOB.xenosurge_wave_xenos_hp + spawned_xeno.maxHealth = GLOB.xenosurge_wave_xenos_hp + spawned_xeno.melee_damage_lower = GLOB.xenosurge_wave_xenos_dam_min + spawned_xeno.melee_damage_upper = GLOB.xenosurge_wave_xenos_dam_max + spawned_xeno.armor_deflection = GLOB.xenosurge_wave_xenos_armor return TRUE if(BEHAVIOR_CLICK_INTERCEPT_ACTION) diff --git a/code/modules/admin/game_master/game_master_submenu/ambush.dm b/code/modules/admin/game_master/game_master_submenu/ambush.dm index 02ad9a5ae7..2503bf993c 100644 --- a/code/modules/admin/game_master/game_master_submenu/ambush.dm +++ b/code/modules/admin/game_master/game_master_submenu/ambush.dm @@ -206,10 +206,11 @@ playsound(referenced_atom, pick(ambush_sounds), 25, 1) var/mob/living/carbon/xenomorph/spawned_xeno = new xeno_type(spawn_turf, null, selected_hive) - spawned_xeno.health *= GLOB.xenosurge_wave_xenos_hp_factor - spawned_xeno.maxHealth *= GLOB.xenosurge_wave_xenos_hp_factor - spawned_xeno.melee_damage_lower = ceil(spawned_xeno.melee_damage_lower * GLOB.xenosurge_wave_xenos_dam_factor) - spawned_xeno.melee_damage_upper = ceil(spawned_xeno.melee_damage_upper * GLOB.xenosurge_wave_xenos_dam_factor) + spawned_xeno.health = GLOB.xenosurge_wave_xenos_hp + spawned_xeno.maxHealth = GLOB.xenosurge_wave_xenos_hp + spawned_xeno.melee_damage_lower = GLOB.xenosurge_wave_xenos_dam_min + spawned_xeno.melee_damage_upper = GLOB.xenosurge_wave_xenos_dam_max + spawned_xeno.armor_deflection = GLOB.xenosurge_wave_xenos_armor /// Shakes the spawner via animation and returns a callback to reset the animation /datum/game_master_submenu/ambush/proc/shake_spawner() diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index a19397a69f..f27616508d 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -342,8 +342,6 @@ var/atom/movable/vis_obj/xeno_wounds/wound_icon_holder var/atom/movable/vis_obj/xeno_pack/backpack_icon_holder - //ai spawner fun - var/spawner_id /mob/living/carbon/xenomorph/Initialize(mapload, mob/living/carbon/xenomorph/oldXeno, h_number, ai_hard_off = FALSE) var/area/A = get_area(src) diff --git a/code/modules/pve/spawner.dm b/code/modules/pve/spawner.dm index 12ce051596..c9532fdffd 100644 --- a/code/modules/pve/spawner.dm +++ b/code/modules/pve/spawner.dm @@ -10,91 +10,87 @@ indestructible = TRUE unacidable = TRUE unslashable = TRUE - var/xenos_to_spawn_max = 5 - var/list/spawn_list = list(1 = XENO_CASTE_DRONE, 2 = null,) - var/xenos_to_spawn_delay = 100 var/spawner_initiated = FALSE + var/veterans_spawned = 0 var/spawner_id - var/extra_delay = 0 + +/obj/structure/xenosurge_spawner/Initialize(mapload, ...) + . = ..() + if(!spawner_id) + spawner_id = GLOB.spawner_number + GLOB.spawner_number += 1 + spawner_initiated = TRUE + to_chat(usr, SPAN_INFO("Spawner number [spawner_id] set.")) + GLOB.xenosurge_configured_spawners.Add(src) + if(GLOB.xenosurge_surge_started == 1) + to_chat(usr, SPAN_INFO("In-Progress Xenosurge detected. Starting spawn loop for spawner [spawner_id].")) + INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/structure/xenosurge_spawner/, spawner_spawn)) + return 1 /obj/structure/xenosurge_spawner/proc/spawner_limit_reached() message_admins("Wave limit of [GLOB.xenosurge_wave_xenos_max] reached. Disabling spawners.") - for (var/obj/structure/xenosurge_spawner/spawner in GLOB.xenosurge_configured_spawners) - spawner.spawner_initiated = FALSE + GLOB.xenosurge_surge_started = 0 GLOB.xenosurge_wave_xenos_current = 0 + GLOB.xenosurge_wave_veteran_xenos_current = 0 /obj/structure/xenosurge_spawner/proc/spawner_loop() - sleep(xenos_to_spawn_delay + extra_delay) - if(spawner_initiated == FALSE) + sleep(GLOB.xenosurge_spawner_delay) + if(GLOB.xenosurge_surge_started == FALSE) return else spawner_spawn() +/obj/structure/xenosurge_spawner/proc/veteran_spawn_loop() + if(GLOB.xenosurge_wave_veteran_xenos_current >= GLOB.xenosurge_veteran_xenos_max) return + var/veterans_to_spawn = GLOB.xenosurge_veteran_spawner_xenos_max + while(veterans_to_spawn > 0) + if(GLOB.xenosurge_surge_started == 0) + veterans_to_spawn = 0 + break + sleep(GLOB.xenosurge_veteran_spawner_delay + (rand(1,GLOB.xenosurge_spawner_variance))) + var/veteran_xenos_to_spawn_type = XENO_CASTE_DRONE + var/turf/veteran_spawner_xeno_turf = get_random_turf_in_range(src, 2, 0) + var/veteran_spawner_xeno_typepath = RoleAuthority.get_caste_by_text(veteran_xenos_to_spawn_type) + var/mob/living/carbon/xenomorph/drone/spawned_veteran = new veteran_spawner_xeno_typepath(veteran_spawner_xeno_turf, null, "xeno_hive_normal") + spawned_veteran.health = 1000 + spawned_veteran.maxHealth = 1000 + spawned_veteran.melee_damage_lower = 15 + spawned_veteran.melee_damage_upper = 25 + spawned_veteran.armor_deflection = 20 + veterans_to_spawn -= 1 + GLOB.xenosurge_wave_veteran_xenos_current += 1 + /obj/structure/xenosurge_spawner/proc/spawner_spawn() var/global_xeno_count = 0 - var/ai_count = 0 for (var/mob/living/carbon/xenomorph/xeno in world) if(xeno.loc != null) global_xeno_count += 1 - if(xeno.spawner_id == spawner_id) - ai_count += 1 if(global_xeno_count > GLOB.xenosurge_spawner_limit) - if(extra_delay != 0) extra_delay += 50 - INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/structure/xenosurge_spawner/, spawner_loop)) - return - if(ai_count >= xenos_to_spawn_max) INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/structure/xenosurge_spawner/, spawner_loop)) return else - var/xenos_to_spawn = xenos_to_spawn_max - ai_count - var/current_spawnlistpos = 1 - while(xenos_to_spawn > 0) - var/xenos_to_spawn_type = spawn_list[current_spawnlistpos] + var/surge_to_spawn = GLOB.xenosurge_spawner_xenos + if(veterans_spawned == 0) + veterans_spawned = 1 + INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/structure/xenosurge_spawner/, veteran_spawn_loop)) + while(surge_to_spawn > 0) + var/xenos_to_spawn_type = XENO_CASTE_DRONE var/turf/spawner_xeno_turf = get_random_turf_in_range(src, 2, 0) var/spawner_xeno_typepath = RoleAuthority.get_caste_by_text(xenos_to_spawn_type) var/mob/living/carbon/xenomorph/drone/spawned_xeno = new spawner_xeno_typepath(spawner_xeno_turf, null, "xeno_hive_normal") - spawned_xeno.spawner_id = spawner_id - spawned_xeno.health *= GLOB.xenosurge_wave_xenos_hp_factor - spawned_xeno.maxHealth *= GLOB.xenosurge_wave_xenos_hp_factor - spawned_xeno.melee_damage_lower = ceil(spawned_xeno.melee_damage_lower * GLOB.xenosurge_wave_xenos_dam_factor) - spawned_xeno.melee_damage_upper = ceil(spawned_xeno.melee_damage_upper * GLOB.xenosurge_wave_xenos_dam_factor) - if(spawn_list[current_spawnlistpos + 1] != null) - current_spawnlistpos += 1 - else - current_spawnlistpos = 1 - xenos_to_spawn -= 1 - global_xeno_count += 1 + spawned_xeno.health = GLOB.xenosurge_wave_xenos_hp + spawned_xeno.maxHealth = GLOB.xenosurge_wave_xenos_hp + spawned_xeno.melee_damage_lower = GLOB.xenosurge_wave_xenos_dam_min + spawned_xeno.melee_damage_upper = GLOB.xenosurge_wave_xenos_dam_max + spawned_xeno.armor_deflection = GLOB.xenosurge_wave_xenos_armor + surge_to_spawn -= 1 GLOB.xenosurge_wave_xenos_current += 1 - if(global_xeno_count >= GLOB.xenosurge_spawner_limit) - xenos_to_spawn = 0 - extra_delay += 150 - break + sleep(rand(1,GLOB.xenosurge_spawner_variance)) if(GLOB.xenosurge_wave_xenos_current >= GLOB.xenosurge_wave_xenos_max) spawner_limit_reached() else INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/structure/xenosurge_spawner/, spawner_loop)) -/obj/structure/xenosurge_spawner/proc/setup_spawner(max = null, delay = null) - if(max == null) - xenos_to_spawn_max = tgui_input_number(usr, "How many xenos total from this spawner","Spawner Setup",xenos_to_spawn_max, timeout = 0) - if(xenos_to_spawn_max == null) return 0 - else - xenos_to_spawn_max = max - if(delay == null) - xenos_to_spawn_delay = tgui_input_number(usr, "Dealy, in ticks (~10 a second) between spawn checks.","Spawner Setup",xenos_to_spawn_delay, timeout = 0) - if(xenos_to_spawn_delay == null) return 0 - else - xenos_to_spawn_delay = delay - if(!spawner_id) - spawner_id = GLOB.spawner_number - GLOB.spawner_number += 1 - spawner_initiated = TRUE - to_chat(usr, SPAN_INFO("Spawner number [spawner_id] set.")) - GLOB.xenosurge_configured_spawners.Add(src) - if(GLOB.xenosurge_wave_xenos_current > 0) - to_chat(usr, SPAN_INFO("In-Progress Xenosurge detected. Starting spawn loop for spawner [spawner_id].")) - spawner_spawn() - return 1 /obj/structure/xenosurge_spawner/proc/start_spawning() if(spawner_initiated == FALSE) @@ -105,88 +101,5 @@ spawner_spawn() return -/obj/structure/xenosurge_veteran_spawner - name = "veteran AI spawner" - desc = "just spawnin' veteran shit" - opacity = FALSE - density = FALSE - invisibility = INVISIBILITY_OBSERVER - icon_state = "campfire_on" - indestructible = TRUE - unacidable = TRUE - unslashable = TRUE - var/xenos_to_spawn_max = 5 - var/list/spawn_list = list(1 = XENO_CASTE_DRONE, 2 = null,) - var/xenos_to_spawn_delay = 200 - var/spawner_variance = 100 - var/spawner_initiated = FALSE - var/spawner_id - var/extra_delay = 0 - -/obj/structure/xenosurge_veteran_spawner/proc/spawner_loop() - sleep(xenos_to_spawn_delay + extra_delay + rand(1,spawner_variance)) - if(spawner_initiated == FALSE) - return - else - spawner_spawn() - -/obj/structure/xenosurge_veteran_spawner/proc/spawner_spawn() - var/xenos_to_spawn = xenos_to_spawn_max - var/current_spawnlistpos = 1 - while(xenos_to_spawn > 0) - var/xenos_to_spawn_type = spawn_list[current_spawnlistpos] - var/turf/spawner_xeno_turf = get_random_turf_in_range(src, 2, 0) - var/spawner_xeno_typepath = RoleAuthority.get_caste_by_text(xenos_to_spawn_type) - var/mob/living/carbon/xenomorph/drone/spawned_xeno = new spawner_xeno_typepath(spawner_xeno_turf, null, "xeno_hive_normal") - spawned_xeno.spawner_id = spawner_id - spawned_xeno.health *= GLOB.xenosurge_veteran_xenos_hp_factor - spawned_xeno.maxHealth *= GLOB.xenosurge_veteran_xenos_hp_factor - spawned_xeno.melee_damage_lower = ceil(spawned_xeno.melee_damage_lower * GLOB.xenosurge_veteran_xenos_dam_factor) - spawned_xeno.melee_damage_upper = ceil(spawned_xeno.melee_damage_upper * GLOB.xenosurge_veteran_xenos_dam_factor) - if(spawn_list[current_spawnlistpos + 1] != null) - current_spawnlistpos += 1 - else - current_spawnlistpos = 1 - xenos_to_spawn -= 1 - sleep(rand(1,spawner_variance)) - spawner_initiated = FALSE - - -/obj/structure/xenosurge_veteran_spawner/proc/setup_spawner(max = null, delay = null, variance = null) - if(max == null) - xenos_to_spawn_max = tgui_input_number(usr, "How many veteran xenos to spawn","Spawner Setup",xenos_to_spawn_max, timeout = 0) - if(xenos_to_spawn_max == null) return 0 - else - xenos_to_spawn_max = max - if(delay == null) - xenos_to_spawn_delay = tgui_input_number(usr, "Base dealy until spawner starts spawning.","Spawner Setup",xenos_to_spawn_delay, timeout = 0) - if(xenos_to_spawn_delay == null) return 0 - else - xenos_to_spawn_delay = delay - if(variance == null) - spawner_variance = tgui_input_number(usr, "Variance in pause (in ticks) to dealy and individual spawns.","Spawner Setup",spawner_variance, timeout = 0) - if(spawner_variance == null) return 0 - else - spawner_variance = variance - - if(!spawner_id) - spawner_id = GLOB.veteran_spawner_number - GLOB.veteran_spawner_number += 1 - spawner_initiated = TRUE - to_chat(usr, SPAN_INFO("Veteran spawner number [spawner_id] set.")) - GLOB.xenosurge_configured_veteran_spawners.Add(src) - if(GLOB.xenosurge_wave_xenos_current > 0) - to_chat(usr, SPAN_INFO("In-Progress Xenosurge detected. Starting spawn loop for veteran spawner [spawner_id].")) - spawner_spawn() - return 1 - -/obj/structure/xenosurge_veteran_spawner/proc/start_spawning() - if(spawner_initiated == FALSE) - to_chat(usr, SPAN_WARNING("Failed. Spawner not initiated.")) - return - else - message_admins("Veteran Spawner [spawner_id] starting.") - spawner_loop() - return #undef AI_XENOS