mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
renamed a file, added rogue drones random event (laser drones spawn and fly around the map, teleport out after a while), added infestation random event (lizards, mice, slimes spawn on the map in some rooms)
Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -41,26 +41,26 @@
|
||||
// Check for additional possible events
|
||||
possibleEvents[/datum/event/economic_event] = 100 //see Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm
|
||||
possibleEvents[/datum/event/carp_migration] = 50 + 50 * active_with_role["Engineer"]
|
||||
possibleEvents[/datum/event/brand_intelligence] = 50 + 25 * active_with_role["Janitor"]
|
||||
|
||||
possibleEvents[/datum/event/rogue_drone] = 50 + 25 * active_with_role["Engineer"] + 25 * active_with_role["Security"]
|
||||
possibleEvents[/datum/event/infestation] = 50 + 25 * active_with_role["Janitor"]
|
||||
|
||||
possibleEvents[/datum/event/communications_blackout] = 50 + 25 * active_with_role["AI"] + active_with_role["Scientist"] * 25
|
||||
possibleEvents[/datum/event/ionstorm] = active_with_role["AI"] * 25 + active_with_role["Cyborg"] * 25 + active_with_role["Engineer"] * 10 + active_with_role["Scientist"] * 5
|
||||
possibleEvents[/datum/event/grid_check] = 10 * active_with_role["Engineer"]
|
||||
possibleEvents[/datum/event/electrical_storm] = 75 + 25 * active_with_role["Janitor"] + 5 * active_with_role["Engineer"]
|
||||
|
||||
if(active_with_role["AI"] > 0 || active_with_role["Cyborg"] > 0)
|
||||
possibleEvents[/datum/event/ionstorm] = active_with_role["AI"] * 25 + active_with_role["Cyborg"] * 25 + active_with_role["Engineer"] * 10 + active_with_role["Scientist"] * 5
|
||||
|
||||
if(active_with_role["Janitor"] > 0)
|
||||
possibleEvents[/datum/event/brand_intelligence] = 50 + 25 * active_with_role["Janitor"]
|
||||
|
||||
if(!spacevines_spawned)
|
||||
possibleEvents[/datum/event/spacevine] = 5 + 10 * active_with_role["Engineer"]
|
||||
if(active_with_role["Engineer"] > 0 && minutes_passed >= 30) // Give engineers time to set up engine
|
||||
possibleEvents[/datum/event/meteor_wave] = 20 * active_with_role["Engineer"]
|
||||
possibleEvents[/datum/event/meteor_shower] = 80 * active_with_role["Engineer"]
|
||||
possibleEvents[/datum/event/blob] = 30 * active_with_role["Engineer"]
|
||||
if(!spacevines_spawned)
|
||||
possibleEvents[/datum/event/spacevine] = 10 * active_with_role["Engineer"]
|
||||
possibleEvents[/datum/event/grid_check] = 10 * active_with_role["Engineer"]
|
||||
possibleEvents[/datum/event/electrical_storm] = 75 + 25 * active_with_role["Janitor"] + 5 * active_with_role["Engineer"]
|
||||
|
||||
possibleEvents[/datum/event/viral_infection] = active_with_role["Medical"] * 50
|
||||
if(active_with_role["Medical"] > 0)
|
||||
possibleEvents[/datum/event/radiation_storm] = active_with_role["Medical"] * 100
|
||||
possibleEvents[/datum/event/viral_infection] = active_with_role["Medical"] * 50
|
||||
possibleEvents[/datum/event/viral_outbreak] = active_with_role["Medical"] * 25
|
||||
possibleEvents[/datum/event/spontaneous_appendicitis] = active_with_role["Medical"] * 50
|
||||
|
||||
114
code/modules/events/infestation.dm
Normal file
114
code/modules/events/infestation.dm
Normal file
@@ -0,0 +1,114 @@
|
||||
#define LOC_KITCHEN 0
|
||||
#define LOC_ATMOS 1
|
||||
#define LOC_INCIN 2
|
||||
#define LOC_CHAPEL 3
|
||||
#define LOC_LIBRARY 4
|
||||
#define LOC_HYDRO 5
|
||||
#define LOC_VAULT 6
|
||||
#define LOC_CONSTR 7
|
||||
#define LOC_TECH 8
|
||||
#define LOC_ASSEMBLY 9
|
||||
|
||||
#define VERM_MICE 0
|
||||
#define VERM_LIZARDS 1
|
||||
#define VERM_SLIMES 2
|
||||
|
||||
/datum/event/infestation
|
||||
announceWhen = 10
|
||||
endWhen = 11
|
||||
var/location
|
||||
var/locstring
|
||||
var/vermin
|
||||
var/vermstring
|
||||
|
||||
/datum/event/infestation/start()
|
||||
|
||||
location = rand(0,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/atmos
|
||||
locstring = "atmospherics"
|
||||
if(LOC_INCIN)
|
||||
spawn_area_type = /area/maintenance/incinerator
|
||||
locstring = "the incinerator"
|
||||
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_VAULT)
|
||||
spawn_area_type = /area/security/nuke_storage
|
||||
locstring = "the vault"
|
||||
if(LOC_CONSTR)
|
||||
spawn_area_type = /area/construction
|
||||
locstring = "the construction area"
|
||||
if(LOC_TECH)
|
||||
spawn_area_type = /area/storage/tech
|
||||
locstring = "technical storage"
|
||||
if(LOC_ASSEMBLY)
|
||||
spawn_area_type = /area/assembly/assembly_line
|
||||
locstring = "the unused assembly line"
|
||||
|
||||
world << "looking for [spawn_area_type]"
|
||||
for(var/areapath in typesof(spawn_area_type))
|
||||
world << " checking [areapath]"
|
||||
var/area/A = locate(areapath)
|
||||
world << " A: [A], contents.len: [A.contents.len]"
|
||||
for(var/area/B in A.related)
|
||||
world << " B: [B], contents.len: [B.contents.len]"
|
||||
for(var/turf/simulated/floor/F in B.contents)
|
||||
if(!F.contents.len)
|
||||
turfs += F
|
||||
|
||||
var/list/spawn_types = list()
|
||||
var/max_number
|
||||
vermin = rand(0,2)
|
||||
switch(vermin)
|
||||
if(VERM_MICE)
|
||||
spawn_types = list(/mob/living/simple_animal/mouse/gray, /mob/living/simple_animal/mouse/brown, /mob/living/simple_animal/mouse/white)
|
||||
max_number = 12
|
||||
vermstring = "mice"
|
||||
if(VERM_LIZARDS)
|
||||
spawn_types = list(/mob/living/simple_animal/lizard)
|
||||
max_number = 6
|
||||
vermstring = "lizards"
|
||||
if(VERM_SLIMES)
|
||||
spawn_types = list(/mob/living/carbon/slime)
|
||||
max_number = 3
|
||||
vermstring = "slimes"
|
||||
|
||||
spawn(0)
|
||||
var/num = rand(2,max_number)
|
||||
while(turfs.len > 0 && num > 0)
|
||||
var/turf/simulated/floor/T = pick(turfs)
|
||||
turfs.Remove(T)
|
||||
var/spawn_type = pick(spawn_types)
|
||||
new spawn_type(T)
|
||||
num--
|
||||
world << "[vermstring] spawned in [spawn_area_type]"
|
||||
|
||||
/datum/event/infestation/announce()
|
||||
command_alert("Bioscans indicate that [vermstring] have been breeding in [locstring]. Clear them out, before this starts to affect productivity.", "Vermin infestation")
|
||||
|
||||
#undef LOC_KITCHEN
|
||||
#undef LOC_ATMOS
|
||||
#undef LOC_INCIN
|
||||
#undef LOC_CHAPEL
|
||||
#undef LOC_LIBRARY
|
||||
#undef LOC_HYDRO
|
||||
#undef LOC_VAULT
|
||||
#undef LOC_TECH
|
||||
#undef LOC_ASSEMBLY
|
||||
|
||||
#undef VERM_MICE
|
||||
#undef VERM_LIZARDS
|
||||
#undef VERM_SLIMES
|
||||
53
code/modules/events/rogue_drones.dm
Normal file
53
code/modules/events/rogue_drones.dm
Normal file
@@ -0,0 +1,53 @@
|
||||
/datum/event/rogue_drone
|
||||
startWhen = 10
|
||||
endWhen = 1000
|
||||
var/list/drones_list = list()
|
||||
|
||||
/datum/event/rogue_drone/start()
|
||||
//spawn them at the same place as carp
|
||||
var/list/possible_spawns = list()
|
||||
for(var/obj/effect/landmark/C in landmarks_list)
|
||||
if(C.name == "carpspawn")
|
||||
possible_spawns.Add(C)
|
||||
|
||||
//25% chance for this to be a false alarm
|
||||
var/num
|
||||
if(prob(25))
|
||||
num = 0
|
||||
else
|
||||
num = rand(2,6)
|
||||
for(var/i=0, i<num, i++)
|
||||
var/mob/living/simple_animal/hostile/retaliate/malf_drone/D = new(get_turf(pick(possible_spawns)))
|
||||
drones_list.Add(D)
|
||||
if(prob(25))
|
||||
D.disabled = rand(15, 60)
|
||||
|
||||
/datum/event/rogue_drone/announce()
|
||||
var/msg
|
||||
if(prob(33))
|
||||
msg = "A combat drone wing operating out of the NMV Icarus has failed to return from a sweep of this sector, if any are sighted approach with caution."
|
||||
else if(prob(50))
|
||||
msg = "Contact has been lost with a combat drone wing operating out of the NMV Icarus. If any are sighted in the area, approach with caution."
|
||||
else
|
||||
msg = "Syndicate saboteurs have targetted a combat drone wing deployed from the NMV Icarus. If any are sighted in the area, approach with caution."
|
||||
command_alert(msg, "Rogue drone alert")
|
||||
|
||||
/datum/event/rogue_drone/tick()
|
||||
return
|
||||
|
||||
/datum/event/rogue_drone/end()
|
||||
var/num_recovered = 0
|
||||
for(var/mob/living/simple_animal/hostile/retaliate/malf_drone/D in drones_list)
|
||||
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
|
||||
sparks.set_up(3, 0, D.loc)
|
||||
sparks.start()
|
||||
D.z = 2
|
||||
D.has_loot = 0
|
||||
|
||||
del(D)
|
||||
num_recovered++
|
||||
|
||||
if(num_recovered > drones_list.len * 0.75)
|
||||
command_alert("Icarus drone control reports the malfunctioning wing has been recovered safely.", "Rogue drone alert")
|
||||
else
|
||||
command_alert("Icarus drone control registers disappointment at the loss of the drones, but the survivors have been recovered.", "Rogue drone alert")
|
||||
Reference in New Issue
Block a user