mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Random Event Fixes (#9582)
This commit is contained in:
@@ -1,102 +0,0 @@
|
||||
/datum/event/horde_infestation
|
||||
announceWhen = 30
|
||||
endWhen = 200
|
||||
var/spawncount = 1
|
||||
var/list/vents = list()
|
||||
var/spiders = FALSE
|
||||
var/metroids = FALSE
|
||||
|
||||
/datum/event/horde_infestation/setup()
|
||||
if(prob(25)) //CHOMP Add 25% chance for the event to fail if chosen
|
||||
log_debug("Horde infestation failed successfully.")
|
||||
kill()
|
||||
return //The event dies here.
|
||||
|
||||
announceWhen = rand(announceWhen, announceWhen + 60)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) //Gathering together all possible areas to spawn mobs.
|
||||
//CHOMPEdit: Added a couple areas to the exclusion.
|
||||
var/in_area = get_area(temp_vent)
|
||||
if(istype(in_area, /area/crew_quarters/sleep) || istype(in_area, /area/hallway/secondary/entry))
|
||||
continue
|
||||
if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) //No spawns on welded vents
|
||||
if(temp_vent.network.normal_members.len > 10) //CHOMP Edit: Most our networks are 40. SM is 4 and toxins is 2. This needed to change in order to spawn.
|
||||
vents += temp_vent
|
||||
|
||||
if(prob(50)) //50/50 chance on spiders or metroids.
|
||||
log_debug("Hord event, spiders selected.")
|
||||
spawncount = rand(4 * severity, 10 * severity)
|
||||
sent_spiders_to_station = 0
|
||||
spiders = TRUE
|
||||
|
||||
else
|
||||
log_debug("Horde event, metroids selected.")
|
||||
spawncount = rand(2 * severity, 4 * severity)
|
||||
metroids = TRUE
|
||||
|
||||
|
||||
/datum/event/horde_infestation/announce()
|
||||
if(spiders) //Horrible way of doing this
|
||||
command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||
if(metroids) //Horrible way of doing this
|
||||
command_announcement.Announce("High-energy lifeforms detected coming aboard [station_name()]. All crew members, stay alert, and listen to security instructions.", "Lifesign Alert", new_sound = 'sound/misc/alarm1.ogg')
|
||||
|
||||
/datum/event/horde_infestation/start()
|
||||
if(spiders)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
|
||||
//CHOMPEdit: Added a couple areas to the exclusion. Also made this actually work.
|
||||
var/in_area = get_area(temp_vent)
|
||||
if(istype(in_area, /area/crew_quarters/sleep) || istype(in_area, /area/hallway/secondary/entry))
|
||||
continue
|
||||
if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels))
|
||||
if(temp_vent.network.normal_members.len > 10) //CHOMP Edit: Most our networks are 40. SM is 4 and toxins is 2. This needed to change to 10 from 50 in order for spawns to work.
|
||||
var/area/A = get_area(temp_vent)
|
||||
if(!(A.flag_check(AREA_FORBID_EVENTS)))
|
||||
vents += temp_vent
|
||||
|
||||
while((spawncount >= 1) && vents.len)
|
||||
var/obj/vent = pick(vents)
|
||||
//CHOMPEDIT START adding spider EGGS to the possible spawns instead of singular spiderling spawns.
|
||||
var/spawn_spiderlings = pickweight(list(
|
||||
/obj/effect/spider/spiderling/space = 95,
|
||||
/obj/effect/spider/eggcluster/space = 4,
|
||||
/obj/effect/spider/eggcluster/royal/space = 1
|
||||
))
|
||||
new spawn_spiderlings(vent.loc) //VOREStation Edit - No nurses //Oh my JESUS CHRIST, this slipped past me. Literally no nurses. Well guess what, nurses are back.
|
||||
//CHOMPEDIT END
|
||||
vents -= vent
|
||||
spawncount--
|
||||
if(metroids)
|
||||
while((spawncount >= 1) && vents.len)
|
||||
var/obj/vent = pick(vents)
|
||||
var/spawn_metroids = pickweight(list(
|
||||
/mob/living/simple_mob/metroid/juvenile/baby = 60,
|
||||
/mob/living/simple_mob/metroid/juvenile/super = 30,
|
||||
/mob/living/simple_mob/metroid/juvenile/alpha = 10,
|
||||
/mob/living/simple_mob/metroid/juvenile/gamma = 3,
|
||||
/mob/living/simple_mob/metroid/juvenile/zeta = 2,
|
||||
/mob/living/simple_mob/metroid/juvenile/omega = 1,
|
||||
))
|
||||
new spawn_metroids(get_turf(vent))
|
||||
vents -= vent
|
||||
spawncount--
|
||||
vents.Cut()
|
||||
|
||||
/datum/event/horde_infestation/end()
|
||||
if(spiders)
|
||||
return
|
||||
if(metroids)
|
||||
var/list/area_names = list()
|
||||
for(var/metroids in existing_metroids)
|
||||
var/mob/living/M = metroids
|
||||
if(!M || M.stat == DEAD)
|
||||
continue
|
||||
var/area/metroid_area = get_area(M)
|
||||
if(!metroid_area) //Huh, really?
|
||||
if(!get_turf(M)) //No turf either?
|
||||
qdel(M) //Must have been nullspaced
|
||||
continue
|
||||
area_names |= metroid_area.name
|
||||
if(area_names.len)
|
||||
var/english_list = english_list(area_names)
|
||||
command_announcement.Announce("Sensors have narrowed down remaining lifeforms to the followng areas: [english_list]", "Lifesign Alert")
|
||||
@@ -1,62 +0,0 @@
|
||||
/datum/event/metroid_infestation
|
||||
announceWhen = 90
|
||||
endWhen = 200
|
||||
var/spawncount = 1
|
||||
var/list/vents = list()
|
||||
var/give_positions = 0
|
||||
var/active_metroid_event = TRUE
|
||||
|
||||
/datum/event/metroid_infestation/setup()
|
||||
if(prob(50)) //50% chance of the event to even occur if procced
|
||||
active_metroid_event = FALSE
|
||||
log_debug("Metroid infestation failed successfully.")
|
||||
kill()
|
||||
return
|
||||
active_metroid_event = TRUE
|
||||
announceWhen = rand(announceWhen, announceWhen + 60)
|
||||
|
||||
spawncount = rand(2 * severity, 4 * severity)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
|
||||
//CHOMPEdit: Added a couple areas to the exclusion. Also made this actually work.
|
||||
var/in_area = get_area(temp_vent)
|
||||
if(istype(in_area, /area/crew_quarters/sleep) || istype(in_area, /area/hallway/secondary/entry))
|
||||
continue
|
||||
if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels))
|
||||
if(temp_vent.network.normal_members.len > 10) //CHOMP Edit: Most our networks are 40. SM is 4 and toxins is 2. This needed to change in order to spawn.
|
||||
vents += temp_vent
|
||||
|
||||
/datum/event/metroid_infestation/announce()
|
||||
command_announcement.Announce("High-energy lifeforms detected coming aboard [station_name()]. All crew members, stay alert, and listen to security instructions.", "Lifesign Alert", new_sound = 'sound/misc/alarm1.ogg')
|
||||
|
||||
/datum/event/metroid_infestation/start()
|
||||
while((spawncount >= 1) && vents.len)
|
||||
var/obj/vent = pick(vents)
|
||||
var/spawn_metroids = pickweight(list(
|
||||
/mob/living/simple_mob/metroid/juvenile/baby = 60,
|
||||
/mob/living/simple_mob/metroid/juvenile/super = 30,
|
||||
/mob/living/simple_mob/metroid/juvenile/alpha = 10,
|
||||
/mob/living/simple_mob/metroid/juvenile/gamma = 3,
|
||||
/mob/living/simple_mob/metroid/juvenile/zeta = 2,
|
||||
/mob/living/simple_mob/metroid/juvenile/omega = 1,
|
||||
))
|
||||
new spawn_metroids(get_turf(vent))
|
||||
vents -= vent
|
||||
spawncount--
|
||||
vents.Cut()
|
||||
|
||||
/datum/event/metroid_infestation/end()
|
||||
var/list/area_names = list()
|
||||
for(var/metroids in existing_metroids)
|
||||
var/mob/living/M = metroids
|
||||
if(!M || M.stat == DEAD)
|
||||
continue
|
||||
var/area/metroid_area = get_area(M)
|
||||
if(!metroid_area) //Huh, really?
|
||||
if(!get_turf(M)) //No turf either?
|
||||
qdel(M) //Must have been nullspaced
|
||||
continue
|
||||
area_names |= metroid_area.name
|
||||
if(area_names.len && active_metroid_event == TRUE)
|
||||
var/english_list = english_list(area_names)
|
||||
command_announcement.Announce("Sensors have narrowed down remaining lifeforms to the followng areas: [english_list]", "Lifesign Alert")
|
||||
@@ -1,104 +0,0 @@
|
||||
#define LOC_KITCHEN 0
|
||||
#define LOC_ATMOS 1
|
||||
#define LOC_CHAPEL 2
|
||||
#define LOC_LIBRARY 3
|
||||
#define LOC_HYDRO 4
|
||||
#define LOC_TECH 5
|
||||
#define LOC_HANGAR1 6
|
||||
#define LOC_HANGAR2 7
|
||||
#define LOC_HANGAR3 8
|
||||
#define LOC_FIELD 9 // CHOMPEdit - More mutant places! This one might allow them to grow
|
||||
|
||||
|
||||
#define VERM_RATS 0
|
||||
#define VERM_LIZARDMEN 1
|
||||
|
||||
/datum/event/mutants
|
||||
announceWhen = 25
|
||||
endWhen = 26
|
||||
var/location
|
||||
var/locstring
|
||||
var/vermin
|
||||
var/vermstring
|
||||
|
||||
/datum/event/mutants/start()
|
||||
|
||||
location = rand(0,9) // CHOMPEdit - Bumping up to 9
|
||||
var/list/turf/simulated/floor/turfs = list()
|
||||
var/spawn_area_type
|
||||
switch(location)
|
||||
if(LOC_KITCHEN)
|
||||
spawn_area_type = /area/crew_quarters/kitchen
|
||||
locstring = "the kitchen"
|
||||
if(LOC_ATMOS)
|
||||
spawn_area_type = /area/engineering/atmos
|
||||
locstring = "atmospherics"
|
||||
if(LOC_CHAPEL)
|
||||
spawn_area_type = /area/chapel/main
|
||||
locstring = "the chapel"
|
||||
if(LOC_LIBRARY)
|
||||
spawn_area_type = /area/library
|
||||
locstring = "the library"
|
||||
if(LOC_HYDRO)
|
||||
spawn_area_type = /area/hydroponics
|
||||
locstring = "hydroponics"
|
||||
if(LOC_TECH)
|
||||
spawn_area_type = /area/storage/tech
|
||||
locstring = "technical storage"
|
||||
if(LOC_HANGAR1)
|
||||
spawn_area_type = /area/hangar/one
|
||||
locstring = "the hangar deck"
|
||||
if(LOC_HANGAR2)
|
||||
spawn_area_type = /area/hangar/two
|
||||
locstring = "the hangar deck"
|
||||
if(LOC_HANGAR3)
|
||||
spawn_area_type = /area/hangar/three
|
||||
locstring = "the hangar deck"
|
||||
if(LOC_FIELD) // CHOMPEdit - Another one for the list...
|
||||
spawn_area_type = /area/maintenance/field
|
||||
locstring = "the maintenance deck"
|
||||
|
||||
for(var/areapath in typesof(spawn_area_type))
|
||||
var/area/A = locate(areapath)
|
||||
for(var/turf/simulated/floor/F in A.contents)
|
||||
if(turf_clear(F))
|
||||
turfs += F
|
||||
|
||||
var/list/spawn_types = list()
|
||||
var/max_number
|
||||
vermin = rand(0,1)
|
||||
switch(vermin)
|
||||
if(VERM_RATS)
|
||||
spawn_types = list(/mob/living/simple_mob/animal/passive/mouse/event)
|
||||
max_number = 6
|
||||
vermstring = "mutant mice"
|
||||
if(VERM_LIZARDMEN)
|
||||
spawn_types = list(/mob/living/simple_mob/animal/passive/lizard/event)
|
||||
max_number = 6
|
||||
vermstring = "mutant lizards"
|
||||
|
||||
spawn(0)
|
||||
var/num = rand(2,max_number)
|
||||
while(turfs.len > 0 && num > 0)
|
||||
var/turf/simulated/floor/T = pick(turfs)
|
||||
turfs.Remove(T)
|
||||
num--
|
||||
var/spawn_type = pick(spawn_types)
|
||||
new spawn_type(T)
|
||||
|
||||
|
||||
/datum/event/mutants/announce()
|
||||
command_announcement.Announce("Bioscans indicate... What are those? It looks like [vermstring] have been breeding in [locstring]. Clear them out, just in case.", "Vermin infestation")
|
||||
|
||||
#undef LOC_KITCHEN
|
||||
#undef LOC_ATMOS
|
||||
#undef LOC_CHAPEL
|
||||
#undef LOC_LIBRARY
|
||||
#undef LOC_HYDRO
|
||||
#undef LOC_TECH
|
||||
#undef LOC_HANGAR1
|
||||
#undef LOC_HANGAR2
|
||||
#undef LOC_HANGAR3
|
||||
|
||||
#undef VERM_RATS
|
||||
#undef VERM_LIZARDMEN
|
||||
@@ -6,11 +6,6 @@
|
||||
|
||||
|
||||
/datum/event/spider_infestation/setup()
|
||||
if(prob(25)) //CHOMP Add 25% chance for the event to fail if chosen
|
||||
log_debug("Spider infestation failed successfully.")
|
||||
kill()
|
||||
return
|
||||
|
||||
announceWhen = rand(announceWhen, announceWhen + 60)
|
||||
spawncount = rand(4 * severity, 10 * severity) //spiderlings only have a 50% chance to grow big and strong //CHOMP Edit: old: 2/4 new: 6/14 new: 4/10
|
||||
sent_spiders_to_station = 0
|
||||
|
||||
Reference in New Issue
Block a user