mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 13:39:16 +01:00
code/global.dm => code/_global_vars/ (#17244)
* 1 * Full conversion * . * . --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
event_type = /datum/event2/event/shipping_error
|
||||
|
||||
/datum/event2/meta/shipping_error/get_weight()
|
||||
return (metric.count_people_with_job(/datum/job/cargo_tech) + metric.count_people_with_job(/datum/job/qm)) * 30
|
||||
return (GLOB.metric.count_people_with_job(/datum/job/cargo_tech) + GLOB.metric.count_people_with_job(/datum/job/qm)) * 30
|
||||
|
||||
/datum/event2/event/shipping_error/start()
|
||||
var/datum/supply_order/O = new /datum/supply_order()
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
event_type = /datum/event2/event/manifest_malfunction
|
||||
|
||||
/datum/event2/meta/manifest_malfunction/get_weight()
|
||||
var/security = metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/security = GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
|
||||
if(!security || !data_core)
|
||||
if(!security || !GLOB.data_core)
|
||||
return 0
|
||||
|
||||
var/command = metric.count_people_with_job(/datum/job/hop) + metric.count_people_with_job(/datum/job/captain)
|
||||
var/synths = metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
var/everyone = metric.count_people_in_department(DEPARTMENT_EVERYONE) - (synths + security + command) // So they don't get counted twice.
|
||||
var/command = GLOB.metric.count_people_with_job(/datum/job/hop) + GLOB.metric.count_people_with_job(/datum/job/captain)
|
||||
var/synths = GLOB.metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
var/everyone = GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) - (synths + security + command) // So they don't get counted twice.
|
||||
|
||||
return (security * 10) + (synths * 20) + (command * 20) + (everyone * 5)
|
||||
|
||||
@@ -51,10 +51,10 @@
|
||||
|
||||
switch(record_class_to_delete)
|
||||
if("security")
|
||||
R = safepick(data_core.security)
|
||||
R = safepick(GLOB.data_core.security)
|
||||
|
||||
if("medical")
|
||||
R = safepick(data_core.medical)
|
||||
R = safepick(GLOB.data_core.medical)
|
||||
|
||||
if(R)
|
||||
log_debug("Manifest malfunction event is now deleting [R.fields["name"]]'s [record_class_to_delete] record.")
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
event_type = /datum/event2/event/money_hacker
|
||||
|
||||
/datum/event2/meta/money_hacker/get_weight()
|
||||
var/command = metric.count_people_with_job(/datum/job/hop) + metric.count_people_with_job(/datum/job/captain)
|
||||
var/command = GLOB.metric.count_people_with_job(/datum/job/hop) + GLOB.metric.count_people_with_job(/datum/job/captain)
|
||||
|
||||
if(!command)
|
||||
return 0
|
||||
@@ -34,13 +34,13 @@
|
||||
Notifications will be sent as updates occur."
|
||||
var/my_department = "[location_name()] Firewall Subroutines"
|
||||
|
||||
for(var/obj/machinery/message_server/MS in machines)
|
||||
for(var/obj/machinery/message_server/MS in GLOB.machines)
|
||||
if(!MS.active)
|
||||
continue
|
||||
MS.send_rc_message(JOB_HEAD_OF_PERSONNEL + "'s Desk", my_department, "[message]<br>", "", "", 2)
|
||||
|
||||
// Nobody reads the requests consoles so lets use the radio as well.
|
||||
global_announcer.autosay(message, my_department, DEPARTMENT_COMMAND)
|
||||
GLOB.global_announcer.autosay(message, my_department, DEPARTMENT_COMMAND)
|
||||
|
||||
/datum/event2/event/money_hacker/end()
|
||||
var/message = null
|
||||
@@ -55,11 +55,11 @@
|
||||
|
||||
var/my_department = "[location_name()] Firewall Subroutines"
|
||||
|
||||
for(var/obj/machinery/message_server/MS in machines)
|
||||
for(var/obj/machinery/message_server/MS in GLOB.machines)
|
||||
if(!MS.active) continue
|
||||
MS.send_rc_message(JOB_HEAD_OF_PERSONNEL + "'s Desk", my_department, message, "", "", 2)
|
||||
|
||||
global_announcer.autosay(message, my_department, DEPARTMENT_COMMAND)
|
||||
GLOB.global_announcer.autosay(message, my_department, DEPARTMENT_COMMAND)
|
||||
|
||||
/datum/event2/event/money_hacker/proc/hack_account(datum/money_account/A)
|
||||
// Subtract the money.
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
event_type = /datum/event2/event/raise_funds
|
||||
|
||||
/datum/event2/meta/raise_funds/get_weight()
|
||||
var/command = metric.count_people_in_department(DEPARTMENT_COMMAND)
|
||||
var/command = GLOB.metric.count_people_in_department(DEPARTMENT_COMMAND)
|
||||
if(!command) // Need someone to read the centcom message.
|
||||
return 0
|
||||
|
||||
var/cargo = metric.count_people_in_department(DEPARTMENT_CARGO)
|
||||
var/cargo = GLOB.metric.count_people_in_department(DEPARTMENT_CARGO)
|
||||
return (command * 20) + (cargo * 20)
|
||||
|
||||
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
|
||||
|
||||
/datum/event2/meta/airlock_failure/get_weight()
|
||||
var/engineering = metric.count_people_in_department(DEPARTMENT_ENGINEERING)
|
||||
var/engineering = GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING)
|
||||
|
||||
// Synths are good both for fixing the doors and getting blamed for the doors zapping people.
|
||||
var/synths = metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
var/synths = GLOB.metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
if(!engineering && !synths) // Nobody's around to fix the door.
|
||||
return 0
|
||||
|
||||
// Medical might be needed for some of the more violent airlock failures.
|
||||
var/medical = metric.count_people_in_department(DEPARTMENT_MEDICAL)
|
||||
var/medical = GLOB.metric.count_people_in_department(DEPARTMENT_MEDICAL)
|
||||
if(!medical && needs_medical)
|
||||
return 0
|
||||
|
||||
|
||||
@@ -31,17 +31,17 @@
|
||||
|
||||
/datum/event2/meta/blob/get_weight()
|
||||
// Count the 'fighters'.
|
||||
var/list/engineers = metric.get_people_in_department(DEPARTMENT_ENGINEERING)
|
||||
var/list/security = metric.get_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/list/engineers = GLOB.metric.get_people_in_department(DEPARTMENT_ENGINEERING)
|
||||
var/list/security = GLOB.metric.get_people_in_department(DEPARTMENT_SECURITY)
|
||||
|
||||
if(engineers.len + security.len < required_fighters)
|
||||
return 0
|
||||
|
||||
// Now count the 'support'.
|
||||
var/list/medical = metric.get_people_in_department(DEPARTMENT_MEDICAL)
|
||||
var/list/medical = GLOB.metric.get_people_in_department(DEPARTMENT_MEDICAL)
|
||||
var/need_medical = FALSE
|
||||
|
||||
var/list/robotics = metric.get_people_with_job(/datum/job/roboticist)
|
||||
var/list/robotics = GLOB.metric.get_people_with_job(/datum/job/roboticist)
|
||||
var/need_robotics = FALSE
|
||||
|
||||
// Determine what kind of support might be needed.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
event_type = /datum/event2/event/brand_intelligence
|
||||
|
||||
/datum/event2/meta/brand_intelligence/get_weight()
|
||||
return 10 + (metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20)
|
||||
return 10 + (GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20)
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
var/last_malware_spread_time = null
|
||||
|
||||
/datum/event2/event/brand_intelligence/set_up()
|
||||
for(var/obj/machinery/vending/V in machines)
|
||||
for(var/obj/machinery/vending/V in GLOB.machines)
|
||||
if(!(V.z in using_map.station_levels))
|
||||
continue
|
||||
vending_machines += V
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
event_type = /datum/event2/event/camera_damage
|
||||
|
||||
/datum/event2/meta/camera_damage/get_weight()
|
||||
return 30 + (metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20) + (metric.count_people_in_department(DEPARTMENT_SYNTHETIC) * 40)
|
||||
return 30 + (GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20) + (GLOB.metric.count_people_in_department(DEPARTMENT_SYNTHETIC) * 40)
|
||||
|
||||
/datum/event2/event/camera_damage
|
||||
var/camera_range = 7
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
event_type = /datum/event2/event/canister_leak
|
||||
|
||||
/datum/event2/meta/canister_leak/get_weight()
|
||||
return metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 30
|
||||
return GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 30
|
||||
|
||||
/datum/event2/event/canister_leak/start()
|
||||
// List of all non-destroyed canisters on station levels
|
||||
var/list/all_canisters = list()
|
||||
for(var/obj/machinery/portable_atmospherics/canister/C in machines)
|
||||
for(var/obj/machinery/portable_atmospherics/canister/C in GLOB.machines)
|
||||
if(!C.destroyed && (C.z in using_map.station_levels) && C.air_contents.total_moles >= MOLES_CELLSTANDARD)
|
||||
all_canisters += C
|
||||
var/obj/machinery/portable_atmospherics/canister/C = pick(all_canisters)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
event_type = /datum/event2/event/dust
|
||||
|
||||
/datum/event2/meta/dust/get_weight()
|
||||
return metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20
|
||||
return GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
/datum/event2/meta/gas_leak/get_weight()
|
||||
// Synthetics are counted in higher value because they can wirelessly connect to alarms.
|
||||
var/engineering_factor = metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10
|
||||
var/synthetic_factor = metric.count_people_in_department(DEPARTMENT_SYNTHETIC) * 30
|
||||
var/engineering_factor = GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10
|
||||
var/synthetic_factor = GLOB.metric.count_people_in_department(DEPARTMENT_SYNTHETIC) * 30
|
||||
return (15 + engineering_factor + synthetic_factor) / (times_ran + 1)
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
return highest_overpower
|
||||
|
||||
/datum/event2/meta/grid_check/get_weight()
|
||||
var/population_factor = metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10
|
||||
var/population_factor = GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10
|
||||
var/overpower_factor = 50 * get_overpower() // Will be 0 if not overloaded at all, and 50 if turbines are outputting twice as much as rated.
|
||||
return (20 + population_factor + overpower_factor) / (times_ran + 1)
|
||||
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
|
||||
/datum/event2/meta/meteor_defense/get_weight()
|
||||
// Engineers count as 20.
|
||||
var/engineers = metric.count_people_in_department(DEPARTMENT_ENGINEERING)
|
||||
var/engineers = GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING)
|
||||
if(engineers < 3) // There -must- be at least three engineers for this to be possible.
|
||||
return 0
|
||||
|
||||
. = engineers * 20
|
||||
|
||||
// Cargo and AI/borgs count as 10.
|
||||
var/cargo = metric.count_people_with_job(/datum/job/cargo_tech) + metric.count_people_with_job(/datum/job/qm)
|
||||
var/bots = metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
var/cargo = GLOB.metric.count_people_with_job(/datum/job/cargo_tech) + GLOB.metric.count_people_with_job(/datum/job/qm)
|
||||
var/bots = GLOB.metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
|
||||
. += (cargo + bots) * 10
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
meteor_types = meteors_threatening.Copy()
|
||||
|
||||
/datum/event2/event/meteor_defense/set_up()
|
||||
direction = pick(cardinal) // alldirs doesn't work with current meteor code unfortunately.
|
||||
direction = pick(GLOB.cardinal) // GLOB.alldirs doesn't work with current meteor code unfortunately.
|
||||
waves = rand(3, 6)
|
||||
switch(direction)
|
||||
if(NORTH)
|
||||
@@ -74,7 +74,7 @@
|
||||
waves--
|
||||
message_admins("[waves] more wave\s of meteors remain.")
|
||||
// Dir is reversed because the direction describes where meteors are going, not what side it's gonna hit.
|
||||
spawn_meteors(rand(wave_upper_bound, wave_lower_bound), meteor_types, reverse_dir[direction])
|
||||
spawn_meteors(rand(wave_upper_bound, wave_lower_bound), meteor_types, GLOB.reverse_dir[direction])
|
||||
|
||||
/datum/event2/event/meteor_defense/should_end()
|
||||
return waves <= 0
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
event_type = /datum/event2/event/spacevine
|
||||
|
||||
/datum/event2/meta/spacevine/get_weight()
|
||||
return 20 + (metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10) + (metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5)
|
||||
return 20 + (GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10) + (GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
event_type = /datum/event2/event/wallrot
|
||||
|
||||
/datum/event2/meta/wallrot/get_weight()
|
||||
return (10 + metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10) / (times_ran + 1)
|
||||
return (10 + GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10) / (times_ran + 1)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
event_type = /datum/event2/event/window_break
|
||||
|
||||
/datum/event2/meta/window_break/get_weight()
|
||||
return (metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20) / (times_ran + 1)
|
||||
return (GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 20) / (times_ran + 1)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
event_type = /datum/event2/event/comms_blackout
|
||||
|
||||
/datum/event2/meta/comms_blackout/get_weight()
|
||||
return 50 + metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5
|
||||
return 50 + GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5
|
||||
|
||||
|
||||
|
||||
@@ -39,5 +39,5 @@
|
||||
T.emp_act(1)
|
||||
|
||||
// Communicators go down no matter what.
|
||||
for(var/obj/machinery/exonet_node/N in machines)
|
||||
for(var/obj/machinery/exonet_node/N in GLOB.machines)
|
||||
N.emp_act(1)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
event_type = /datum/event2/event/electrical_fault
|
||||
|
||||
/datum/event2/meta/electrical_fault/get_weight()
|
||||
return 10 + (metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5)
|
||||
return 10 + (GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5)
|
||||
|
||||
|
||||
/datum/event2/event/electrical_fault
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
event_type = /datum/event2/event/gravity
|
||||
|
||||
/datum/event2/meta/gravity/get_weight()
|
||||
return (20 + (metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5)) / (times_ran + 1)
|
||||
return (20 + (GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5)) / (times_ran + 1)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
event_type = /datum/event2/event/gravity
|
||||
|
||||
/datum/event2/meta/gravity/get_weight()
|
||||
return (20 + (metric.count_people_in_department(DEPARTMENT_EVERYONE) * 20)) / (times_ran + 1)
|
||||
return (20 + (GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 20)) / (times_ran + 1)
|
||||
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
command_announcement.Announce("Feedback surge detected in mass-distributions systems. Artificial gravity has been disabled. Please wait for the system to reinitialize, or contact your engineering department.", "Gravity Failure")
|
||||
|
||||
/datum/event2/event/gravity/start()
|
||||
gravity_is_on = 0
|
||||
GLOB.gravity_is_on = FALSE
|
||||
|
||||
for(var/obj/machinery/gravity_generator/main/GG in machines)
|
||||
for(var/obj/machinery/gravity_generator/main/GG in GLOB.machines)
|
||||
if((GG.z in get_location_z_levels()) && GG.on)
|
||||
generators += GG
|
||||
GG.breaker = FALSE
|
||||
@@ -31,7 +31,7 @@
|
||||
GG.charge_count = 10
|
||||
|
||||
/datum/event2/event/gravity/end()
|
||||
gravity_is_on = 1
|
||||
GLOB.gravity_is_on = TRUE
|
||||
|
||||
var/did_anything = FALSE
|
||||
for(var/obj/machinery/gravity_generator/main/GG in generators)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
departments = list(DEPARTMENT_EVERYONE)
|
||||
|
||||
/datum/event2/meta/infestation/get_weight()
|
||||
return metric.count_people_in_department(DEPARTMENT_EVERYONE) * 10
|
||||
return GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 10
|
||||
|
||||
/datum/event2/meta/infestation/rodents
|
||||
name = "infestation - rodents"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
event_type = /datum/event2/event/pda_spam
|
||||
|
||||
/datum/event2/meta/pda_spam/get_weight()
|
||||
return metric.count_people_in_department(DEPARTMENT_EVERYONE) * 2
|
||||
return GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 2
|
||||
|
||||
|
||||
/datum/event2/event/pda_spam
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
event_type = /datum/event2/event/radiation_storm
|
||||
|
||||
/datum/event2/meta/radiation_storm/get_weight()
|
||||
var/medical_factor = metric.count_people_in_department(DEPARTMENT_MEDICAL) * 10
|
||||
var/population_factor = metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5 // Note medical people will get counted twice at 25 weight.
|
||||
var/medical_factor = GLOB.metric.count_people_in_department(DEPARTMENT_MEDICAL) * 10
|
||||
var/population_factor = GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5 // Note medical people will get counted twice at 25 weight.
|
||||
return 20 + medical_factor + population_factor
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// This has an abnormally high weight due to antags being very important for the round,
|
||||
// however the weight will decay with more antags, and more attempts to add antags.
|
||||
/datum/event2/meta/random_antagonist/get_weight()
|
||||
var/antags = metric.count_all_antags()
|
||||
var/antags = GLOB.metric.count_all_antags()
|
||||
return 200 / (antags + times_ran + 1)
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
event_type = /datum/event2/event/solar_storm
|
||||
|
||||
/datum/event2/meta/solar_storm/get_weight()
|
||||
var/population_factor = metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10
|
||||
var/space_factor = metric.count_all_space_mobs() * 50
|
||||
var/population_factor = GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) * 10
|
||||
var/space_factor = GLOB.metric.count_all_space_mobs() * 50
|
||||
return (20 + population_factor + space_factor) / (times_ran + 1)
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/datum/event2/meta/sudden_weather_shift/get_weight()
|
||||
// The proc name is a bit misleading, it only counts players outside, not all mobs.
|
||||
return (metric.count_all_outdoor_mobs() * 20) / (times_ran + 1)
|
||||
return (GLOB.metric.count_all_outdoor_mobs() * 20) / (times_ran + 1)
|
||||
|
||||
/datum/event2/event/sudden_weather_shift
|
||||
start_delay_lower_bound = 30 SECONDS
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
event_type = /datum/event2/event/appendicitis
|
||||
|
||||
/datum/event2/meta/appendicitis/get_weight()
|
||||
var/list/doctors = metric.get_people_with_job(/datum/job/doctor)
|
||||
var/list/doctors = GLOB.metric.get_people_with_job(/datum/job/doctor)
|
||||
|
||||
doctors -= metric.get_people_with_alt_title(/datum/job/doctor, /datum/alt_title/nurse)
|
||||
doctors -= metric.get_people_with_alt_title(/datum/job/doctor, /datum/alt_title/virologist)
|
||||
doctors += metric.get_people_with_job(/datum/job/cmo)
|
||||
doctors -= GLOB.metric.get_people_with_alt_title(/datum/job/doctor, /datum/alt_title/nurse)
|
||||
doctors -= GLOB.metric.get_people_with_alt_title(/datum/job/doctor, /datum/alt_title/virologist)
|
||||
doctors += GLOB.metric.get_people_with_job(/datum/job/cmo)
|
||||
|
||||
return doctors.len * 10
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
continue
|
||||
|
||||
// Or doctors (otherwise it could be possible for the only surgeon to need surgery).
|
||||
if(H in metric.get_people_with_job(/datum/job/doctor) )
|
||||
if(H in GLOB.metric.get_people_with_job(/datum/job/doctor) )
|
||||
continue
|
||||
|
||||
if(H.appendicitis())
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
event_type = /datum/event2/event/mob_spawning/carp_migration
|
||||
|
||||
/datum/event2/meta/carp_migration/get_weight()
|
||||
return 10 + (metric.count_people_in_department(DEPARTMENT_SECURITY) * 20) + (metric.count_all_space_mobs() * 40)
|
||||
return 10 + (GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY) * 20) + (GLOB.metric.count_all_space_mobs() * 40)
|
||||
|
||||
|
||||
/datum/event2/event/mob_spawning/carp_migration
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
event_type = /datum/event2/event/security_drill
|
||||
|
||||
/datum/event2/meta/security_drill/get_weight()
|
||||
var/sec = metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/everyone = metric.count_people_in_department(DEPARTMENT_EVERYONE)
|
||||
var/sec = GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/everyone = GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE)
|
||||
|
||||
if(!sec) // If there's no security, then there is no drill.
|
||||
return 0
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
/datum/event2/meta/prison_break/get_weight()
|
||||
// First, don't do this if nobody can fix the doors.
|
||||
var/door_fixers = metric.count_people_in_department(DEPARTMENT_ENGINEERING) + metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
var/door_fixers = GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING) + GLOB.metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
if(!door_fixers)
|
||||
return 0
|
||||
var/list/afflicted_departments = departments.Copy()
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
afflicted_departments -= DEPARTMENT_SYNTHETIC
|
||||
for(var/D in afflicted_departments)
|
||||
afflicted_crew += metric.count_people_in_department(D)
|
||||
afflicted_crew += GLOB.metric.count_people_in_department(D)
|
||||
|
||||
// Don't do it if nobody is around to ""appreciate"" it.
|
||||
if(!afflicted_crew)
|
||||
@@ -59,7 +59,7 @@
|
||||
for(var/mob/living/L in player_list)
|
||||
if(is_mob_in_relevant_area(L))
|
||||
// Don't count them if they're in security.
|
||||
if(!(L in metric.count_people_in_department(DEPARTMENT_SECURITY)))
|
||||
if(!(L in GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY)))
|
||||
. += 40
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
for(var/mob/living/L in player_list)
|
||||
if(is_mob_in_relevant_area(L))
|
||||
// Don't count them if they're in medical.
|
||||
if(!(L in metric.count_people_in_department(DEPARTMENT_MEDICAL)))
|
||||
if(!(L in GLOB.metric.count_people_in_department(DEPARTMENT_MEDICAL)))
|
||||
. += 40
|
||||
|
||||
|
||||
@@ -194,11 +194,11 @@
|
||||
within approximately three minutes. Direct intervention is required immediately. Disabling the \
|
||||
main breaker in the APCs will protect the APC's room from being compromised."
|
||||
|
||||
for(var/obj/machinery/message_server/MS in machines)
|
||||
for(var/obj/machinery/message_server/MS in GLOB.machines)
|
||||
MS.send_rc_message(DEPARTMENT_ENGINEERING, my_department, "[message]<br>", "", "", 2)
|
||||
|
||||
// Nobody reads the requests consoles so lets use the radio as well.
|
||||
global_announcer.autosay(message, my_department, DEPARTMENT_ENGINEERING)
|
||||
GLOB.global_announcer.autosay(message, my_department, DEPARTMENT_ENGINEERING)
|
||||
|
||||
for(var/mob/living/silicon/ai/A in player_list)
|
||||
to_chat(A, span_danger("Malicious program detected in the [area_display_name] lighting and airlock control systems by [my_department]. \
|
||||
@@ -227,7 +227,7 @@
|
||||
in \the [location_name()] [area_display_name] [containment_display_desc] subroutines. Secure any compromised \
|
||||
areas immediately. AI involvement is recommended.", "[capitalize(containment_display_desc)] Alert")
|
||||
|
||||
global_announcer.autosay(
|
||||
GLOB.global_announcer.autosay(
|
||||
"It is now safe to reactivate the APCs' main breakers inside [area_display_name].",
|
||||
"[location_name()] Firewall Subroutines",
|
||||
DEPARTMENT_ENGINEERING
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
/datum/event2/meta/rogue_drones/get_weight()
|
||||
. = 10 // Start with a base weight, since this event does provide some value even if no sec is around.
|
||||
. += metric.count_people_in_department(DEPARTMENT_SECURITY) * 20
|
||||
. += metric.count_all_space_mobs() * 40
|
||||
. += GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY) * 20
|
||||
. += GLOB.metric.count_all_space_mobs() * 40
|
||||
|
||||
|
||||
/datum/event2/event/mob_spawning/rogue_drones
|
||||
|
||||
@@ -6,23 +6,23 @@
|
||||
|
||||
/datum/event2/meta/security_screening/get_weight()
|
||||
. = 0
|
||||
var/sec = metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/sec = GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
if(!sec < 2)
|
||||
return 0 // Can't screen with no security.
|
||||
. += sec * 10
|
||||
. += metric.count_people_in_department(DEPARTMENT_EVERYONE) * 2
|
||||
. += GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 2
|
||||
|
||||
// Having ""suspecious"" people present makes this more likely to be picked.
|
||||
var/suspicious_people = 0
|
||||
suspicious_people += metric.count_all_of_specific_species(SPECIES_PROMETHEAN) * 20
|
||||
suspicious_people += metric.count_all_of_specific_species(SPECIES_UNATHI) * 10
|
||||
suspicious_people += metric.count_all_of_specific_species(SPECIES_ZADDAT) * 10
|
||||
suspicious_people += metric.count_all_of_specific_species(SPECIES_SKRELL) * 5 // Not sure why skrell are so high.
|
||||
suspicious_people += metric.count_all_of_specific_species(SPECIES_TAJARAN) * 5
|
||||
suspicious_people += metric.count_all_of_specific_species(SPECIES_TESHARI) * 5
|
||||
suspicious_people += metric.count_all_of_specific_species(SPECIES_HUMAN_VATBORN) * 5
|
||||
suspicious_people += metric.count_all_FBPs_of_kind(FBP_DRONE) * 20
|
||||
suspicious_people += metric.count_all_FBPs_of_kind(FBP_POSI) * 10
|
||||
suspicious_people += GLOB.metric.count_all_of_specific_species(SPECIES_PROMETHEAN) * 20
|
||||
suspicious_people += GLOB.metric.count_all_of_specific_species(SPECIES_UNATHI) * 10
|
||||
suspicious_people += GLOB.metric.count_all_of_specific_species(SPECIES_ZADDAT) * 10
|
||||
suspicious_people += GLOB.metric.count_all_of_specific_species(SPECIES_SKRELL) * 5 // Not sure why skrell are so high.
|
||||
suspicious_people += GLOB.metric.count_all_of_specific_species(SPECIES_TAJARAN) * 5
|
||||
suspicious_people += GLOB.metric.count_all_of_specific_species(SPECIES_TESHARI) * 5
|
||||
suspicious_people += GLOB.metric.count_all_of_specific_species(SPECIES_HUMAN_VATBORN) * 5
|
||||
suspicious_people += GLOB.metric.count_all_FBPs_of_kind(FBP_DRONE) * 20
|
||||
suspicious_people += GLOB.metric.count_all_FBPs_of_kind(FBP_POSI) * 10
|
||||
if(!suspicious_people)
|
||||
return 0
|
||||
. += suspicious_people
|
||||
@@ -52,7 +52,7 @@
|
||||
// First pass makes popular things more likely to get picked, e.g. 5 prommies vs 1 drone.
|
||||
for(var/species_name in species_weights)
|
||||
var/give_weight = 0
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
for(var/datum/data/record/R in GLOB.data_core.general)
|
||||
if(R.fields["species"] == species_name)
|
||||
give_weight += species_weights[species_name]
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
for(var/bot_type in synth_weights)
|
||||
var/give_weight = 0
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
for(var/datum/data/record/R in GLOB.data_core.general)
|
||||
if(R.fields["brain_type"] == bot_type)
|
||||
give_weight += synth_weights[bot_type]
|
||||
|
||||
@@ -72,11 +72,11 @@
|
||||
var/victim_chosen = pickweight(end_weights)
|
||||
|
||||
if(victim_chosen in synth_weights)
|
||||
if(metric.count_all_FBPs_of_kind(victim_chosen) > 0)
|
||||
if(GLOB.metric.count_all_FBPs_of_kind(victim_chosen) > 0)
|
||||
victim = victim_chosen
|
||||
break
|
||||
else
|
||||
if(metric.count_all_of_specific_species(victim_chosen) > 0)
|
||||
if(GLOB.metric.count_all_of_specific_species(victim_chosen) > 0)
|
||||
victim = victim_chosen
|
||||
break
|
||||
if(!victim)
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
/datum/event2/meta/spider_infestation/get_weight()
|
||||
. = 10
|
||||
. += metric.count_people_in_department(DEPARTMENT_SECURITY) * 20
|
||||
. += metric.count_people_in_department(DEPARTMENT_MEDICAL) * 10
|
||||
. += GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY) * 20
|
||||
. += GLOB.metric.count_people_in_department(DEPARTMENT_MEDICAL) * 10
|
||||
|
||||
|
||||
// This isn't a /mob_spawning subtype since spiderlings aren't actually mobs.
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
/datum/event2/event/spider_infestation/start()
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.machines)
|
||||
if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in get_location_z_levels()))
|
||||
if(temp_vent.network.normal_members.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
if(istype(ticker.mode, /datum/game_mode/extended) && !safe_for_extended)
|
||||
return 0
|
||||
|
||||
var/security = metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/everyone = metric.count_people_in_department(DEPARTMENT_EVERYONE) - security
|
||||
var/ghost_activity = metric.assess_all_dead_mobs() / 100
|
||||
var/security = GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/everyone = GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) - security
|
||||
var/ghost_activity = GLOB.metric.assess_all_dead_mobs() / 100
|
||||
|
||||
return ( (security * 20) + (everyone * 2) ) * ghost_activity
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
event_type = /datum/event2/event/surprise_carp
|
||||
|
||||
/datum/event2/meta/surprise_carp/get_weight()
|
||||
return metric.count_all_space_mobs() * 50
|
||||
return GLOB.metric.count_all_space_mobs() * 50
|
||||
|
||||
|
||||
/datum/event2/event/surprise_carp
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
if(istype(ticker.mode, /datum/game_mode/extended) && !safe_for_extended)
|
||||
return 0
|
||||
|
||||
var/security = metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/engineering = metric.count_people_in_department(DEPARTMENT_ENGINEERING)
|
||||
var/everyone = metric.count_people_in_department(DEPARTMENT_EVERYONE) - (engineering + security)
|
||||
var/security = GLOB.metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
var/engineering = GLOB.metric.count_people_in_department(DEPARTMENT_ENGINEERING)
|
||||
var/everyone = GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) - (engineering + security)
|
||||
|
||||
var/ghost_activity = metric.assess_all_dead_mobs() / 100
|
||||
var/ghost_activity = GLOB.metric.assess_all_dead_mobs() / 100
|
||||
|
||||
return ( (security * 20) + (engineering * 10) + (everyone * 2) ) * ghost_activity
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
event_type = /datum/event2/event/ion_storm
|
||||
|
||||
/datum/event2/meta/ion_storm/get_weight()
|
||||
var/list/bots = metric.get_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
var/list/bots = GLOB.metric.get_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
. = 5 // A small chance even if no synths are on, since it can still emag beepsky.
|
||||
for(var/mob/living/silicon/S in bots)
|
||||
if(istype(S, /mob/living/silicon/robot/drone)) // Drones don't get their laws screwed with, so don't count them.
|
||||
|
||||
Reference in New Issue
Block a user