Security / PseudoCargo Expansion (#6482)

* Security Expansion work.

* Weaponized Racism, Stowaways, Meteors

* Fix Fix. Prep modular armor for addition.

* Fix the boots.

* More modular armor work. Now in cargo!

* Fixfix

* Fixfix

* Thank you anxiety very cool.

* Make a Stowaway Antag

* FixFix
This commit is contained in:
Mechoid
2019-11-24 14:22:25 -08:00
committed by Anewbe
parent 2dddf3d594
commit 7ecdcb40d2
83 changed files with 2710 additions and 68 deletions
@@ -0,0 +1,10 @@
/datum/gm_action/security_drill
name = "security drills"
departments = list(ROLE_SECURITY, ROLE_EVERYONE)
/datum/gm_action/security_drill/announce()
spawn(rand(1 MINUTE, 2 MINUTES))
command_announcement.Announce("[pick("A NanoTrasen security director", "A Vir-Gov correspondant", "Local Sif authoritiy")] has advised the enactment of [pick("a rampant wildlife", "a fire", "a hostile boarding", "a nonstandard", "a bomb", "an emergent intelligence")] drill with the personnel onboard \the [station_name()].", "Security Advisement")
/datum/gm_action/security_drill/get_weight()
return max(-20, 10 + gm.staleness - (gm.danger * 2)) + (metric.count_people_in_department(ROLE_SECURITY) * 5) + (metric.count_people_in_department(ROLE_EVERYONE) * 1.5)
+1 -1
View File
@@ -14,4 +14,4 @@
/datum/gm_action/dust/start()
..()
dust_swarm("norm")
dust_swarm("norm")
@@ -0,0 +1,116 @@
#define LOC_KITCHEN 0
#define LOC_ATMOS 1
#define LOC_CHAPEL 2
#define LOC_LIBRARY 3
#define LOC_HYDRO 4
#define LOC_VAULT 5
#define LOC_CONSTR 6
#define LOC_TECH 7
#define LOC_GARDEN 8
#define VERM_MICE 0
#define VERM_LIZARDS 1
#define VERM_SPIDERS 2
/datum/gm_action/infestation
name = "animal infestation"
departments = list(ROLE_EVERYONE)
var/location
var/locstring
var/vermin
var/vermstring
var/list/turf/simulated/floor/turfs = list()
var/spawn_types
var/max_number
/datum/gm_action/infestation/set_up()
location = rand(0,8)
turfs.Cut()
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_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_GARDEN)
spawn_area_type = /area/hydroponics/garden
locstring = "the public garden"
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
spawn_types = list()
max_number = 0
vermin = rand(0,2)
switch(vermin)
if(VERM_MICE)
spawn_types = list(/mob/living/simple_mob/animal/passive/mouse/gray, /mob/living/simple_mob/animal/passive/mouse/brown, /mob/living/simple_mob/animal/passive/mouse/white, /mob/living/simple_mob/animal/passive/mouse/rat)
max_number = 12
vermstring = "mice"
if(VERM_LIZARDS)
spawn_types = list(/mob/living/simple_mob/animal/passive/lizard, /mob/living/simple_mob/animal/passive/lizard, /mob/living/simple_mob/animal/passive/lizard/large, /mob/living/simple_mob/animal/passive/lizard/large/defensive)
max_number = 6
vermstring = "lizards"
if(VERM_SPIDERS)
spawn_types = list(/obj/effect/spider/spiderling)
max_number = 3
vermstring = "spiders"
/datum/gm_action/infestation/start()
spawn()
var/num = rand(2,max_number)
while(turfs.len > 0 && num > 0)
var/turf/simulated/floor/T = pick(turfs)
turfs.Remove(T)
num--
if(vermin == VERM_SPIDERS)
var/obj/effect/spider/spiderling/S = new(T)
S.amount_grown = -1
else
var/spawn_type = pick(spawn_types)
new spawn_type(T)
/datum/gm_action/infestation/announce()
command_announcement.Announce("Bioscans indicate that [vermstring] have been breeding in [locstring]. Clear them out, before this starts to affect productivity.", "Vermin infestation")
/datum/gm_action/infestation/get_weight()
return 5 + (metric.count_people_in_department(ROLE_EVERYONE) * 20)
#undef LOC_KITCHEN
#undef LOC_ATMOS
#undef LOC_CHAPEL
#undef LOC_LIBRARY
#undef LOC_HYDRO
#undef LOC_VAULT
#undef LOC_TECH
#undef LOC_GARDEN
#undef VERM_MICE
#undef VERM_LIZARDS
#undef VERM_SPIDERS
@@ -1,4 +1,6 @@
/datum/gm_action/ionstorm
name = "ion storm"
departments = list(ROLE_SYNTHETIC)
var/botEmagChance = 0.5
var/list/players = list()
var/active = FALSE
@@ -41,3 +43,8 @@
spawn(rand(5000,8000))
if(prob(50))
ion_storm_announcement()
/datum/gm_action/ionstorm/get_weight()
var/bots = metric.count_people_in_department(ROLE_SYNTHETIC)
var/weight = 5 + (bots * 20)
return weight
@@ -0,0 +1,52 @@
/datum/gm_action/manifest_malfunction
name = "manifest malfunction"
enabled = TRUE
departments = list(ROLE_SECURITY, ROLE_SYNTHETIC, ROLE_EVERYONE)
chaotic = 3
reusable = FALSE
length = 0
var/recordtype
/datum/gm_action/manifest_malfunction/set_up()
severity = pickweight(EVENT_LEVEL_MUNDANE = 6,
EVENT_LEVEL_MODERATE = 2,
EVENT_LEVEL_MAJOR = 1
)
recordtype = pickweight("medical" = 10,"security" = (severity * 15))
return
/datum/gm_action/manifest_malfunction/get_weight()
. = -10
var/security = metric.count_people_in_department(ROLE_SECURITY)
if(security && data_core)
. += (metric.count_people_in_department(ROLE_EVERYONE) * 5) - (metric.count_people_in_department(ROLE_SYNTHETIC) * 5)
return .
/datum/gm_action/manifest_malfunction/start()
..()
var/manifest_cut_count = 1 * severity
for(var/I = 1 to manifest_cut_count)
var/datum/data/record/R
switch(recordtype)
if("security")
R = pick(data_core.security)
if("medical")
R = pick(data_core.medical)
qdel(R)
/datum/gm_action/manifest_malfunction/announce()
if(prob(30 * severity))
spawn(rand(5 MINUTES, 10 MINUTES))
command_announcement.Announce("An ongoing mass upload of malware for [recordtype] record cores has been detected onboard [station_name()]", "Data Breach Alert")
return
@@ -2,18 +2,38 @@
/datum/gm_action/meteor_defense
name = "meteor defense"
departments = list(ROLE_ENGINEERING)
departments = list(ROLE_ENGINEERING, ROLE_CARGO)
chaotic = 50
var/direction = null
var/dir_text = null
var/waves = 0
var/meteor_types
/datum/gm_action/meteor_defense/get_weight()
var/engineers = metric.count_people_in_department(ROLE_ENGINEERING)
var/weight = (max(engineers - 1, 0) * 25) // If only one engineer exists, no meteors for now.
var/cargo = metric.count_people_in_department(ROLE_CARGO)
var/bots = metric.count_people_in_department(ROLE_SYNTHETIC)
var/weight = (max(engineers - 1, 0) * 20) // If only one engineer exists, no meteors for now.
if(engineers >= 2)
weight += ((cargo - 1) * 10)
weight += (bots * 15)
return weight
/datum/gm_action/meteor_defense/set_up()
severity = pickweight(EVENT_LEVEL_MUNDANE = 10,
EVENT_LEVEL_MODERATE = 3
)
switch(severity)
if(EVENT_LEVEL_MUNDANE)
meteor_types = meteors_threatening.Copy()
if(EVENT_LEVEL_MODERATE)
meteor_types = meteors_catastrophic.Copy()
direction = pick(cardinal) // alldirs doesn't work with current meteor code unfortunately.
waves = rand(5, 8)
switch(direction)
@@ -27,17 +47,17 @@
dir_text = "starboard"
/datum/gm_action/meteor_defense/announce()
var/announcement = "Alert! Two other asteroids have collided near [station_name()]. Chunks of it are expected to approach from the [dir_text] side. ETA to arrival is \
approximately 10 minutes."
var/announcement = "Alert! Two asteroids have collided near [station_name()]. Chunks of it are expected to approach from the [dir_text] side. ETA to arrival is \
approximately [round(5 * severity * 2)] minutes."
command_announcement.Announce(announcement, "Meteor Alert", new_sound = 'sound/AI/meteors.ogg')
/datum/gm_action/meteor_defense/start()
..()
spawn(0)
sleep(5 MINUTES)
var/announcement = "The incoming debris are expected to approach from the [dir_text] side. ETA to arrival is approximately 5 minutes."
sleep(round(5 * severity) MINUTES)
var/announcement = "The incoming debris are expected to approach from the [dir_text] side. ETA to arrival is approximately [round(5 * severity)] minutes."
command_announcement.Announce(announcement, "Meteor Alert - Update")
sleep(5 MINUTES)
sleep(round(5 * severity) MINUTES)
announcement = "Incoming debris approaches from the [dir_text] side!"
command_announcement.Announce(announcement, "Meteor Alert - Update")
while(waves)
@@ -46,6 +66,6 @@
spawn_meteors(rand(8, 12), meteors_threatening, reverse_dir[direction])
waves--
sleep(30 SECONDS)
announcement = "The colony has cleared the incoming debris."
announcement = "The station has cleared the incoming debris."
command_announcement.Announce(announcement, "Meteor Alert - Update")
message_admins("Meteor defense event has ended.")
message_admins("Meteor defense event has ended.")
@@ -0,0 +1,49 @@
/datum/gm_action/security_screening
name = "security screening"
departments = list(ROLE_SECURITY, ROLE_EVERYONE)
var/list/species_weights = list(
SPECIES_SKRELL = 9,
SPECIES_UNATHI = 15,
SPECIES_HUMAN_VATBORN = 6,
SPECIES_TESHARI = 2,
SPECIES_TAJ = 3,
SPECIES_DIONA = 1,
SPECIES_ZADDAT = 25,
SPECIES_HUMAN = 3,
SPECIES_PROMETHEAN = 30
)
var/list/synth_weights = list(
"Cybernetic" = 15,
"Drone" = 30,
"Positronic" = 25
)
var/list/end_weights = list()
/datum/gm_action/security_screening/set_up()
for(var/species_name in species_weights)
var/giveweight = 0
for(var/datum/data/record/R in data_core.general)
if(R.fields["species"] == species_name)
giveweight += species_weights[species_name]
end_weights[species_name] = giveweight
for(var/bottype in synth_weights)
var/giveweight = 0
for(var/datum/data/record/R in data_core.general)
if(R.fields["brain_type"] == bottype)
giveweight += synth_weights[bottype]
end_weights[bottype] = giveweight
/datum/gm_action/security_screening/announce()
spawn(rand(1 MINUTE, 2 MINUTES))
command_announcement.Announce("[pick("A nearby Navy vessel", "A Solar official", "A Vir-Gov official", "A NanoTrasen board director")] has requested the screening of [pick("every other", "every", "suspicious", "willing")] [pickweight(end_weights)] personnel onboard \the [station_name()].", "Security Advisement")
/datum/gm_action/security_screening/get_weight()
return max(-20, 10 + round(gm.staleness * 1.5) - (gm.danger * 2)) + (metric.count_people_in_department(ROLE_SECURITY) * 10) + (metric.count_people_in_department(ROLE_EVERYONE) * 1.5)
@@ -7,21 +7,28 @@
var/spawncount = 1
/datum/gm_action/spider_infestation/set_up()
spawn(rand(600, 6000))
announce()
var/spawntype = /obj/effect/spider/spiderling
if(prob(40))
severity = rand(2,3)
else
severity = 1
/datum/gm_action/spider_infestation/set_up()
severity = pickweight(EVENT_LEVEL_MUNDANE = max(1,(12 - (3 * metric.count_people_in_department(ROLE_SECURITY)))),
EVENT_LEVEL_MODERATE = (7 + (2 * metric.count_people_in_department(ROLE_SECURITY))),
EVENT_LEVEL_MAJOR = (1 + (2 * metric.count_people_in_department(ROLE_SECURITY)))
)
switch(severity)
if(EVENT_LEVEL_MUNDANE)
spawntype = /obj/effect/spider/spiderling/stunted
if(EVENT_LEVEL_MODERATE)
spawntype = /obj/effect/spider/spiderling
if(EVENT_LEVEL_MAJOR)
spawntype = /obj/effect/spider/spiderling
spawncount = rand(4 * severity, 6 * severity)
/datum/gm_action/spider_infestation/announce()
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(severity >= 3)
if(severity >= EVENT_LEVEL_MAJOR)
spawn(rand(600, 3000))
command_announcement.Announce("Unidentified lifesigns previously detected coming aboard [station_name()] have been classified as a swarm of arachnids. Extreme caution is advised.", "Arachnid Alert")
@@ -0,0 +1,14 @@
/datum/gm_action/station_fund_raise
name = "local funding drive"
departments = list(ROLE_SECURITY, ROLE_CARGO, ROLE_EVERYONE)
/datum/gm_action/station_fund_raise/announce()
spawn(rand(1 MINUTE, 2 MINUTES))
command_announcement.Announce("Due to [pick("recent", "unfortunate", "possible future")] budget [pick("changes", "issues")], in-system stations are now advised to increase funding income.", "Security & Supply Advisement")
/datum/gm_action/station_fund_raise/get_weight()
var/weight_modifier = 0.5
if(station_account.money <= 80000)
weight_modifier = 1
return (max(-20, 10 + gm.staleness) + ((metric.count_people_in_department(ROLE_SECURITY) + (metric.count_people_in_department(ROLE_CARGO))) * 5) + (metric.count_people_in_department(ROLE_EVERYONE) * 3)) * weight_modifier
@@ -0,0 +1,80 @@
/datum/gm_action/stowaway
name = "stowaway pod"
departments = list(ROLE_EVERYONE, ROLE_SECURITY)
chaotic = 10
observers_used = TRUE
var/area/target_area // Chosen target area
var/area/target_turf // Chosen target turf in target_area
var/list/area/excluded = list(
/area/submap,
/area/shuttle,
/area/crew_quarters,
/area/holodeck,
/area/engineering/engine_room
)
var/list/area/included = list(
/area/maintenance
)
/datum/gm_action/stowaway/set_up()
severity = pickweight(EVENT_LEVEL_MUNDANE = 20,
EVENT_LEVEL_MODERATE = 5,
EVENT_LEVEL_MAJOR = 1
)
var/list/area/grand_list_of_areas = get_station_areas(excluded)
for(var/area/Incl in included)
for(var/area/A in grand_list_of_areas)
if(!istype(A, Incl))
grand_list_of_areas -= A
// Okay, now lets try and pick a target! Lets try 10 times, otherwise give up
for(var/i in 1 to 10)
var/area/A = pick(grand_list_of_areas)
if(is_area_occupied(A))
log_debug("[name] event: Rejected [A] because it is occupied.")
continue
// A good area, great! Lets try and pick a turf
var/list/turfs = list()
for(var/turf/simulated/floor/F in A)
if(turf_clear(F))
turfs += F
if(turfs.len == 0)
log_debug("[name] event: Rejected [A] because it has no clear turfs.")
continue
target_area = A
target_turf = pick(turfs)
if(!target_area)
log_debug("[name] event: Giving up after too many failures to pick target area")
return
/datum/gm_action/stowaway/start()
if(!target_turf)
return
..()
var/obj/structure/ghost_pod/ghost_activated/human/HP = new (target_turf)
if(severity == EVENT_LEVEL_MUNDANE || istype(ticker.mode, /datum/game_mode/extended))
HP.make_antag = MODE_STOWAWAY
else if(severity == EVENT_LEVEL_MODERATE)
HP.make_antag = MODE_RENEGADE
HP.occupant_type = "renegade [HP.occupant_type]"
else if(severity == EVENT_LEVEL_MAJOR)
HP.make_antag = MODE_INFILTRATOR
HP.occupant_type = "volatile [HP.occupant_type]"
say_dead_object("A <span class='notice'>[HP.occupant_type]</span> pod is now available in \the [target_area].", HP)
/datum/gm_action/stowaway/get_weight()
return -20 + (metric.count_people_in_department(ROLE_SECURITY) * 15 + metric.count_people_in_department(ROLE_SYNTHETIC) * 5 + metric.count_people_in_department(ROLE_EVERYONE) * 1)
/datum/gm_action/stowaway/announce()
spawn(rand(15 MINUTES, 30 MINUTES))
if(prob(20) && severity >= EVENT_LEVEL_MODERATE && atc && !atc.squelched)
atc.msg("Attention civilian vessels in [using_map.starsys_name] shipping lanes, caution is advised as [pick("an unidentified vessel", "a known criminal's vessel", "a derelict vessel")] has been detected passing multiple local stations.")
@@ -0,0 +1,62 @@
/datum/gm_action/nanotrasen_budget_allocation
name = "supply point to cargo budget"
enabled = TRUE
departments = list(ROLE_CARGO)
chaotic = 0
reusable = TRUE
var/datum/controller/supply/SC
var/running = FALSE
var/last_run
var/thaler_earned
/datum/gm_action/nanotrasen_budget_allocation/set_up()
SC = supply_controller
running = TRUE
return
/datum/gm_action/nanotrasen_budget_allocation/get_weight()
. = round(SC.points / 15)
var/cargo = metric.count_people_in_department(ROLE_CARGO)
var/personnel = metric.count_people_in_department(ROLE_EVERYONE)
if(cargo)
. = round(SC.points / (10 + personnel)) + cargo * 10
if(running || ( world.time < (last_run + 30 MINUTES)))
. = 0
return .
/datum/gm_action/nanotrasen_budget_allocation/start()
. = ..()
last_run = world.time
var/point_difference = SC.points
if(SC.points >= 1000)
SC.points = round(SC.points / 3)
point_difference -= SC.points
else if(SC.points >= 500)
SC.points -= 100 * (rand(5, 20) / 10)
point_difference -= SC.points
else
SC.points = round(SC.points / 1.25)
point_difference -= SC.points
if(point_difference > 0)
thaler_earned = round(point_difference / SC.points_per_money)
/datum/gm_action/nanotrasen_budget_allocation/end()
spawn(5 MINUTES)
running = FALSE
return
/datum/gm_action/nanotrasen_budget_allocation/announce()
spawn(rand(1 MINUTE, 5 MINUTES))
command_announcement.Announce("[station_name()] Supply Department has earned a converted thaler budget of [thaler_earned] due to their backlogged daily requisition tokens.", "Supply Budget Conversion")
return
@@ -0,0 +1,11 @@
/datum/gm_action/request
name = "general request"
departments = list(ROLE_CARGO)
/datum/gm_action/request/announce()
spawn(rand(1 MINUTE, 2 MINUTES))
command_announcement.Announce("[pick("A nearby vessel", "A Solar contractor", "A Skrellian contractor", "A NanoTrasen board director")] has requested the delivery of [pick("one","two","three","several")] [pick("medical","engineering","research","civilian")] supply packages. The [station_name()] has been tasked with completing this request.", "Supply Request")
/datum/gm_action/request/get_weight()
return max(15, 15 + round(gm.staleness / 2) - gm.danger) + (metric.count_people_in_department(ROLE_CARGO) * 10)
@@ -0,0 +1,75 @@
/datum/gm_action/swarm_boarder
name = "swarmer shell"
departments = list(ROLE_EVERYONE, ROLE_SECURITY, ROLE_ENGINEERING)
chaotic = 30
observers_used = TRUE
var/area/target_area // Chosen target area
var/area/target_turf // Chosen target turf in target_area
var/list/area/excluded = list(
/area/submap,
/area/shuttle,
/area/crew_quarters,
/area/holodeck,
/area/engineering/engine_room
)
var/list/area/included = list(
/area/maintenance
)
/datum/gm_action/swarm_boarder/set_up()
severity = pickweight(EVENT_LEVEL_MUNDANE = 30,
EVENT_LEVEL_MODERATE = 10,
EVENT_LEVEL_MAJOR = 1
)
var/list/area/grand_list_of_areas = get_station_areas(excluded)
for(var/area/Incl in included)
for(var/area/A in grand_list_of_areas)
if(!istype(A, Incl))
grand_list_of_areas -= A
// Okay, now lets try and pick a target! Lets try 10 times, otherwise give up
for(var/i in 1 to 10)
var/area/A = pick(grand_list_of_areas)
if(is_area_occupied(A))
log_debug("[name] event: Rejected [A] because it is occupied.")
continue
// A good area, great! Lets try and pick a turf
var/list/turfs = list()
for(var/turf/simulated/floor/F in A)
if(turf_clear(F))
turfs += F
if(turfs.len == 0)
log_debug("[name] event: Rejected [A] because it has no clear turfs.")
continue
target_area = A
target_turf = pick(turfs)
if(!target_area)
log_debug("[name] event: Giving up after too many failures to pick target area")
return
/datum/gm_action/swarm_boarder/start()
if(!target_turf)
return
..()
var/swarmertype = /obj/structure/ghost_pod/ghost_activated/swarm_drone/event
if(severity == EVENT_LEVEL_MODERATE)
swarmertype = /obj/structure/ghost_pod/ghost_activated/swarm_drone/event/melee
if(severity == EVENT_LEVEL_MAJOR)
swarmertype = /obj/structure/ghost_pod/ghost_activated/swarm_drone/event/gunner
new swarmertype(target_turf)
/datum/gm_action/swarm_boarder/get_weight()
return -60 + (metric.count_people_in_department(ROLE_SECURITY) * 20 + metric.count_people_in_department(ROLE_SYNTHETIC) * 5 + metric.count_people_in_department(ROLE_EVERYONE) * 1)
/datum/gm_action/swarm_boarder/announce()
spawn(rand(5 MINUTES, 15 MINUTES))
if(prob(80) && severity >= EVENT_LEVEL_MODERATE && atc && !atc.squelched)
atc.msg("Attention civilian vessels in [using_map.starsys_name] shipping lanes, caution is advised as [pick("an unidentified vessel", "a known criminal's vessel", "a derelict vessel")] has been detected passing multiple local stations.")
+10 -1
View File
@@ -15,13 +15,22 @@
var/next_action = 0 // Minimum amount of time of nothingness until the GM can pick something again.
var/last_department_used = null // If an event was done for a specific department, it is written here, so it doesn't do it again.
/datum/game_master/New()
..()
available_actions = init_subtypes(/datum/gm_action)
for(var/datum/gm_action/action in available_actions)
action.gm = src
var/config_setup_delay = TRUE
spawn(0)
while(config_setup_delay)
if(config)
config_setup_delay = FALSE
if(config.enable_game_master)
suspended = FALSE
else
sleep(30 SECONDS)
/datum/game_master/process()
if(ticker && ticker.current_state == GAME_STATE_PLAYING && !suspended)
adjust_staleness(1)