diff --git a/code/__DEFINES/__game.dm b/code/__DEFINES/__game.dm index f1424f5560ec..765603df629c 100644 --- a/code/__DEFINES/__game.dm +++ b/code/__DEFINES/__game.dm @@ -103,7 +103,7 @@ block( \ #define SOUND_MIDI (1<<1) #define SOUND_AMBIENCE (1<<2) #define SOUND_LOBBY (1<<3) -#define SOUND_INTERNET (1<<4) +#define SOUND_INTERNET (1<<4) // Unused currently. Kept for default prefs compat only #define SOUND_REBOOT (1<<5) #define SOUND_ADMIN_MEME (1<<6) #define SOUND_ADMIN_ATMOSPHERIC (1<<7) diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 6844721cd7f0..31103fee93ee 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -22,7 +22,7 @@ #define NOTE_SYNTHETIC 4 #define NOTE_YAUTJA 5 ///Note categories in text form, in order of their numerical #defines. -var/global/list/note_categories = list("Admin", "Merit", "Commanding Officer", "Synthetic", "Yautja") +GLOBAL_LIST_INIT(note_categories, list("Admin", "Merit", "Commanding Officer", "Synthetic", "Yautja")) #define ADMIN_FLW(user) "(FLW)" #define ADMIN_PP(user) "(PP)" diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index de7eb672e87b..999a840b7fdd 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -37,9 +37,6 @@ #define GAS_TYPE_PHORON "phoron" #define GAS_TYPE_CO2 "carbon dioxyde" -/// This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage -var/MAX_EXPLOSION_RANGE = 14 - /// Used in /obj/structure/pipes/vents/proc/create_gas #define VENT_GAS_SMOKE "Smoke" #define VENT_GAS_CN20 "CN20 Nerve Gas" diff --git a/code/__DEFINES/clans.dm b/code/__DEFINES/clans.dm index 1b95d11c030c..576bbf6b76d5 100644 --- a/code/__DEFINES/clans.dm +++ b/code/__DEFINES/clans.dm @@ -49,26 +49,6 @@ /// Scales with clan size #define CLAN_LIMIT_SIZE 2 -var/global/list/datum/yautja_rank/clan_ranks = list( - CLAN_RANK_UNBLOODED = new /datum/yautja_rank/unblooded(), - CLAN_RANK_YOUNG = new /datum/yautja_rank/young(), - CLAN_RANK_BLOODED = new /datum/yautja_rank/blooded(), - CLAN_RANK_ELITE = new /datum/yautja_rank/elite(), - CLAN_RANK_ELDER = new /datum/yautja_rank/elder(), - CLAN_RANK_LEADER = new /datum/yautja_rank/leader(), - CLAN_RANK_ADMIN = new /datum/yautja_rank/ancient() -) - -var/global/list/clan_ranks_ordered = list( - CLAN_RANK_UNBLOODED = CLAN_RANK_UNBLOODED_INT, - CLAN_RANK_YOUNG = CLAN_RANK_YOUNG_INT, - CLAN_RANK_BLOODED = CLAN_RANK_BLOODED_INT, - CLAN_RANK_ELITE = CLAN_RANK_ELITE_INT, - CLAN_RANK_ELDER = CLAN_RANK_ELDER_INT, - CLAN_RANK_LEADER = CLAN_RANK_LEADER_INT, - CLAN_RANK_ADMIN = CLAN_RANK_ADMIN_INT -) - #define CLAN_HREF "clan_href" #define CLAN_TARGET_HREF "clan_target_href" diff --git a/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm b/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm index 89a65dad230e..56cd4dd8cd8e 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm @@ -33,3 +33,8 @@ /// From /mob/living/Collide(): (atom/A) #define COMSIG_LIVING_PRE_COLLIDE "living_pre_collide" #define COMPONENT_LIVING_COLLIDE_HANDLED (1<<0) + +///from base of mob/living/set_buckled(): (new_buckled) +#define COMSIG_LIVING_SET_BUCKLED "living_set_buckled" +///from base of mob/living/set_body_position() +#define COMSIG_LIVING_SET_BODY_POSITION "living_set_body_position" diff --git a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm index 32717a2115f2..f4beec321c9e 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm @@ -37,10 +37,6 @@ #define COMSIG_MOB_FIRED_GUN_ATTACHMENT "mob_fired_gun_attachment" /// From /mob/proc/death #define COMSIG_MOB_DEATH "mob_death" -/// From /mob/proc/update_canmove() -#define COMSIG_MOB_GETTING_UP "mob_getting_up" -/// From /mob/proc/update_canmove() -#define COMSIG_MOB_KNOCKED_DOWN "mob_knocked_down" /// For when a mob is dragged #define COMSIG_MOB_DRAGGED "mob_dragged" /// From /obj/item/proc/unequipped() @@ -86,8 +82,6 @@ //from /mob/proc/on_deafness_loss() #define COMSIG_MOB_REGAINED_HEARING "mob_regained_hearing" -#define COMSIG_MOB_POST_UPDATE_CANMOVE "mob_can_move" - #define COMSIG_ATTEMPT_MOB_PULL "attempt_mob_pull" #define COMPONENT_CANCEL_MOB_PULL (1<<0) diff --git a/code/__DEFINES/equipment.dm b/code/__DEFINES/equipment.dm index 6628a5c925c2..f0688282572d 100644 --- a/code/__DEFINES/equipment.dm +++ b/code/__DEFINES/equipment.dm @@ -493,7 +493,7 @@ GLOBAL_LIST_INIT(slot_to_contained_sprite_shorthand, list( #define UNIFORM_VEND_DRESS_EXTRA "dress extra" -var/global/list/uniform_categories = list( +GLOBAL_LIST_INIT(uniform_categories, list( "UTILITY" = list(UNIFORM_VEND_UTILITY_UNIFORM, UNIFORM_VEND_UTILITY_JACKET, UNIFORM_VEND_UTILITY_HEAD, UNIFORM_VEND_UTILITY_GLOVES, UNIFORM_VEND_UTILITY_SHOES), "UTILITY EXTRAS" = list(UNIFORM_VEND_UTILITY_EXTRA), "SERVICE" = list(UNIFORM_VEND_SERVICE_UNIFORM, UNIFORM_VEND_SERVICE_JACKET, UNIFORM_VEND_SERVICE_GLOVES, UNIFORM_VEND_SERVICE_SHOES), @@ -502,7 +502,7 @@ var/global/list/uniform_categories = list( "DRESS" = list(UNIFORM_VEND_DRESS_UNIFORM, UNIFORM_VEND_DRESS_JACKET, UNIFORM_VEND_DRESS_GLOVES, UNIFORM_VEND_DRESS_SHOES), "DRESS HEADWEAR" = list(UNIFORM_VEND_DRESS_HEAD), "DRESS EXTRAS" = list(UNIFORM_VEND_DRESS_EXTRA) -) +)) //================================================= diff --git a/code/__DEFINES/job.dm b/code/__DEFINES/job.dm index 56062cb0213b..ad3b9fe3af32 100644 --- a/code/__DEFINES/job.dm +++ b/code/__DEFINES/job.dm @@ -1,6 +1,6 @@ #define get_job_playtime(client, job) (client.player_data? LAZYACCESS(client.player_data.playtimes, job)? client.player_data.playtimes[job].total_minutes MINUTES_TO_DECISECOND : 0 : 0) -#define GET_MAPPED_ROLE(title) (RoleAuthority?.role_mappings[title] ? RoleAuthority.role_mappings[title] : RoleAuthority.roles_by_name[title]) -#define GET_DEFAULT_ROLE(title) (RoleAuthority?.default_roles[title] ? RoleAuthority.default_roles[title] : title) +#define GET_MAPPED_ROLE(title) (GLOB.RoleAuthority?.role_mappings[title] ? GLOB.RoleAuthority.role_mappings[title] : GLOB.RoleAuthority.roles_by_name[title]) +#define GET_DEFAULT_ROLE(title) (GLOB.RoleAuthority?.default_roles[title] ? GLOB.RoleAuthority.default_roles[title] : title) // Squad name defines #define SQUAD_MARINE_1 "Alpha" @@ -24,7 +24,7 @@ #define JOB_SQUAD_ROLES /datum/timelock/squad #define JOB_SQUAD_ROLES_LIST list(JOB_SQUAD_MARINE, JOB_SQUAD_LEADER, JOB_SQUAD_ENGI, JOB_SQUAD_MEDIC, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_TEAM_LEADER) -var/global/list/job_squad_roles = JOB_SQUAD_ROLES_LIST +GLOBAL_LIST_INIT(job_squad_roles, JOB_SQUAD_ROLES_LIST) #define JOB_COLONIST "Colonist" #define JOB_PASSENGER "Passenger" @@ -72,7 +72,7 @@ var/global/list/job_squad_roles = JOB_SQUAD_ROLES_LIST #define JOB_SO "Staff Officer" #define JOB_COMMAND_ROLES /datum/timelock/command #define JOB_COMMAND_ROLES_LIST list(JOB_CO, JOB_XO, JOB_SO) -var/global/list/job_command_roles = JOB_COMMAND_ROLES_LIST +GLOBAL_LIST_INIT(job_command_roles, JOB_COMMAND_ROLES_LIST) #define JOB_AUXILIARY_OFFICER "Auxiliary Support Officer" #define JOB_PILOT "Pilot Officer" diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 072738184807..0dcd26de3e3a 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -374,7 +374,7 @@ // Hellhound strain flags #define HELLHOUND_NORMAL "Normal" -var/list/default_onmob_icons = list( +GLOBAL_LIST_INIT(default_onmob_icons, list( WEAR_L_HAND = 'icons/mob/humans/onmob/items_lefthand_0.dmi', WEAR_R_HAND = 'icons/mob/humans/onmob/items_righthand_0.dmi', WEAR_WAIST = 'icons/mob/humans/onmob/belt.dmi', @@ -393,9 +393,9 @@ var/list/default_onmob_icons = list( WEAR_HANDS = 'icons/mob/humans/onmob/hands.dmi', WEAR_J_STORE = 'icons/mob/humans/onmob/suit_slot.dmi', WEAR_ACCESSORIES = 'icons/mob/humans/onmob/ties.dmi' - ) + )) -var/list/default_xeno_onmob_icons = list( +GLOBAL_LIST_INIT(default_xeno_onmob_icons, list( /mob/living/carbon/xenomorph/runner = 'icons/mob/xenos/onmob/runner.dmi', /mob/living/carbon/xenomorph/praetorian = 'icons/mob/xenos/onmob/praetorian.dmi', /mob/living/carbon/xenomorph/drone = 'icons/mob/xenos/onmob/drone.dmi', @@ -403,7 +403,7 @@ var/list/default_xeno_onmob_icons = list( /mob/living/carbon/xenomorph/defender = 'icons/mob/xenos/onmob/defender.dmi', /mob/living/carbon/xenomorph/sentinel = 'icons/mob/xenos/onmob/sentinel.dmi', /mob/living/carbon/xenomorph/spitter = 'icons/mob/xenos/onmob/spitter.dmi' - ) + )) // species names #define SPECIES_HUMAN "Human" @@ -418,3 +418,32 @@ var/list/default_xeno_onmob_icons = list( #define EXTREMITY_LIMBS list("l_leg","l_foot","r_leg","r_foot","l_arm","l_hand","r_arm","r_hand") #define CORE_LIMBS list("chest","head","groin") +#define SYMPTOM_ACTIVATION_PROB 3 + +// Body position defines. +/// Mob is standing up, usually associated with lying_angle value of 0. +#define STANDING_UP 0 +/// Mob is lying down, usually associated with lying_angle values of 90 or 270. +#define LYING_DOWN 1 + +/// Possible value of [/atom/movable/buckle_lying]. If set to a different (positive-or-zero) value than this, the buckling thing will force a lying angle on the buckled. +#define NO_BUCKLE_LYING -1 + +// ==================================== +// /mob/living /tg/ mobility_flags +// These represent in what capacity the mob is capable of moving +// Because porting this is underway, NOT ALL FLAGS ARE CURRENTLY IN. + +/// can move +#define MOBILITY_MOVE (1<<0) +/// can, and is, standing up +#define MOBILITY_STAND (1<<1) +/// can rest +#define MOBILITY_REST (1<<7) +/// can lie down +#define MOBILITY_LIEDOWN (1<<8) + +#define MOBILITY_FLAGS_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND) +#define MOBILITY_FLAGS_CARBON_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_REST | MOBILITY_LIEDOWN) +#define MOBILITY_FLAGS_REST_CAPABLE_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_REST | MOBILITY_LIEDOWN) + diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 854da7a52b4c..218bfef5eb40 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -109,34 +109,34 @@ //================================================= //Role defines, specifically lists of roles for job bans, crew manifests and the like. -var/global/list/ROLES_COMMAND = list(JOB_CO, JOB_XO, JOB_SO, JOB_AUXILIARY_OFFICER, JOB_INTEL, JOB_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_CREWMAN, JOB_POLICE, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_CHIEF_REQUISITION, JOB_CHIEF_ENGINEER, JOB_CMO, JOB_CHIEF_POLICE, JOB_SEA, JOB_SYNTH, JOB_WARDEN) +GLOBAL_LIST_INIT(ROLES_COMMAND, list(JOB_CO, JOB_XO, JOB_SO, JOB_AUXILIARY_OFFICER, JOB_INTEL, JOB_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_CREWMAN, JOB_POLICE, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_CHIEF_REQUISITION, JOB_CHIEF_ENGINEER, JOB_CMO, JOB_CHIEF_POLICE, JOB_SEA, JOB_SYNTH, JOB_WARDEN)) //Marine roles #define ROLES_OFFICERS list(JOB_CO, JOB_XO, JOB_SO, JOB_AUXILIARY_OFFICER, JOB_INTEL, JOB_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_SEA, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_SYNTH, JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE) -var/global/list/ROLES_CIC = list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO) -var/global/list/ROLES_AUXIL_SUPPORT = list(JOB_AUXILIARY_OFFICER, JOB_INTEL, JOB_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_WO_PILOT) -var/global/list/ROLES_MISC = list(JOB_SYNTH, JOB_WORKING_JOE, JOB_SEA, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_WO_CORPORATE_LIAISON, JOB_WO_SYNTH) -var/global/list/ROLES_POLICE = list(JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE) -var/global/list/ROLES_ENGINEERING = list(JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH) -var/global/list/ROLES_REQUISITION = list(JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_WO_CHIEF_REQUISITION, JOB_WO_REQUISITION) -var/global/list/ROLES_MEDICAL = list(JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_WO_CMO, JOB_WO_RESEARCHER, JOB_WO_DOCTOR) -var/global/list/ROLES_MARINES = list(JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE) -var/global/list/ROLES_SQUAD_ALL = list(SQUAD_MARINE_1, SQUAD_MARINE_2, SQUAD_MARINE_3, SQUAD_MARINE_4, SQUAD_MARINE_5, SQUAD_MARINE_CRYO, SQUAD_MARINE_INTEL) +GLOBAL_LIST_INIT(ROLES_CIC, list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO)) +GLOBAL_LIST_INIT(ROLES_AUXIL_SUPPORT, list(JOB_AUXILIARY_OFFICER, JOB_INTEL, JOB_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_WO_PILOT)) +GLOBAL_LIST_INIT(ROLES_MISC, list(JOB_SYNTH, JOB_WORKING_JOE, JOB_SEA, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_WO_CORPORATE_LIAISON, JOB_WO_SYNTH)) +GLOBAL_LIST_INIT(ROLES_POLICE, list(JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE)) +GLOBAL_LIST_INIT(ROLES_ENGINEERING, list(JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH)) +GLOBAL_LIST_INIT(ROLES_REQUISITION, list(JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_WO_CHIEF_REQUISITION, JOB_WO_REQUISITION)) +GLOBAL_LIST_INIT(ROLES_MEDICAL, list(JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_WO_CMO, JOB_WO_RESEARCHER, JOB_WO_DOCTOR)) +GLOBAL_LIST_INIT(ROLES_MARINES, list(JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE)) +GLOBAL_LIST_INIT(ROLES_SQUAD_ALL, list(SQUAD_MARINE_1, SQUAD_MARINE_2, SQUAD_MARINE_3, SQUAD_MARINE_4, SQUAD_MARINE_5, SQUAD_MARINE_CRYO, SQUAD_MARINE_INTEL)) +GLOBAL_LIST_INIT(ROLES_WO, list(JOB_WO_CO, JOB_WO_XO, JOB_WO_CORPORATE_LIAISON, JOB_WO_SYNTH, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_WO_PILOT, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH, JOB_WO_CHIEF_REQUISITION, JOB_WO_REQUISITION, JOB_WO_CMO, JOB_WO_DOCTOR, JOB_WO_RESEARCHER, JOB_WO_SQUAD_MARINE, JOB_WO_SQUAD_MEDIC, JOB_WO_SQUAD_ENGINEER, JOB_WO_SQUAD_SMARTGUNNER, JOB_WO_SQUAD_SPECIALIST, JOB_WO_SQUAD_LEADER)) //Groundside roles -var/global/list/ROLES_XENO = list(JOB_XENOMORPH_QUEEN, JOB_XENOMORPH) -var/global/list/ROLES_WHITELISTED = list(JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_PREDATOR) -var/global/list/ROLES_SPECIAL = list(JOB_SURVIVOR) +GLOBAL_LIST_INIT(ROLES_XENO, list(JOB_XENOMORPH_QUEEN, JOB_XENOMORPH)) +GLOBAL_LIST_INIT(ROLES_WHITELISTED, list(JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_PREDATOR)) +GLOBAL_LIST_INIT(ROLES_SPECIAL, list(JOB_SURVIVOR)) -var/global/list/ROLES_USCM = ROLES_CIC + ROLES_POLICE + ROLES_AUXIL_SUPPORT + ROLES_MISC + ROLES_ENGINEERING + ROLES_REQUISITION + ROLES_MEDICAL + ROLES_MARINES - ROLES_WO -var/global/list/ROLES_GROUND = ROLES_XENO + ROLES_SPECIAL + ROLES_WHITELISTED +GLOBAL_LIST_INIT(ROLES_USCM, ROLES_CIC + GLOB.ROLES_POLICE + GLOB.ROLES_AUXIL_SUPPORT + GLOB.ROLES_MISC + GLOB.ROLES_ENGINEERING + GLOB.ROLES_REQUISITION + GLOB.ROLES_MEDICAL + GLOB.ROLES_MARINES - ROLES_WO) +GLOBAL_LIST_INIT(ROLES_GROUND, GLOB.ROLES_XENO + ROLES_SPECIAL + ROLES_WHITELISTED) -var/global/list/ROLES_DISTRESS_SIGNAL = ROLES_USCM + ROLES_GROUND -var/global/list/ROLES_FACTION_CLASH = ROLES_USCM + JOB_PREDATOR +GLOBAL_LIST_INIT(ROLES_DISTRESS_SIGNAL, GLOB.ROLES_USCM + GLOB.ROLES_GROUND) +GLOBAL_LIST_INIT(ROLES_FACTION_CLASH, ROLES_USCM + JOB_PREDATOR) -var/global/list/ROLES_UNASSIGNED = list(JOB_SQUAD_MARINE) -var/global/list/ROLES_WO = list(JOB_WO_CO, JOB_WO_XO, JOB_WO_CORPORATE_LIAISON, JOB_WO_SYNTH, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_WO_PILOT, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH, JOB_WO_CHIEF_REQUISITION, JOB_WO_REQUISITION, JOB_WO_CMO, JOB_WO_DOCTOR, JOB_WO_RESEARCHER, JOB_WO_SQUAD_MARINE, JOB_WO_SQUAD_MEDIC, JOB_WO_SQUAD_ENGINEER, JOB_WO_SQUAD_SMARTGUNNER, JOB_WO_SQUAD_SPECIALIST, JOB_WO_SQUAD_LEADER) +GLOBAL_LIST_INIT(ROLES_UNASSIGNED, list(JOB_SQUAD_MARINE)) //Role lists used for switch() checks in show_blurb_uscm(). Cosmetic, determines ex. "Engineering, USS Almayer", "2nd Bat. 'Falling Falcons'" etc. #define BLURB_USCM_COMBAT JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_SEA,\ JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE @@ -153,7 +153,7 @@ var/global/list/ROLES_WO = list(JOB_WO_CO, JOB_WO_XO, JOB_WO_CORPORATE_LIAISON, #define WHITELIST_COUNCIL "Council" #define WHITELIST_LEADER "Leader" -var/global/list/whitelist_hierarchy = list(WHITELIST_NORMAL, WHITELIST_COUNCIL, WHITELIST_LEADER) +GLOBAL_LIST_INIT(whitelist_hierarchy, list(WHITELIST_NORMAL, WHITELIST_COUNCIL, WHITELIST_LEADER)) //================================================= #define WHITELIST_YAUTJA (1<<0) @@ -186,7 +186,7 @@ var/global/list/whitelist_hierarchy = list(WHITELIST_NORMAL, WHITELIST_COUNCIL, #define WHITELIST_EVERYTHING (WHITELISTS_GENERAL|WHITELISTS_COUNCIL|WHITELISTS_LEADER) -#define isCouncil(A) (RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_YAUTJA_COUNCIL) || (RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_SYNTHETIC_COUNCIL) || (RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_COMMANDER_COUNCIL) +#define isCouncil(A) (GLOB.RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_YAUTJA_COUNCIL) || (GLOB.RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_SYNTHETIC_COUNCIL) || (GLOB.RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_COMMANDER_COUNCIL) //================================================= @@ -265,6 +265,6 @@ var/global/list/whitelist_hierarchy = list(WHITELIST_NORMAL, WHITELIST_COUNCIL, // global vars to prevent spam of the "one xyz alive" messages -var/global/last_ares_callout +GLOBAL_VAR(last_ares_callout) -var/global/last_qm_callout +GLOBAL_VAR(last_qm_callout) diff --git a/code/__DEFINES/objects.dm b/code/__DEFINES/objects.dm index a6b95c879ae4..292b315360c5 100644 --- a/code/__DEFINES/objects.dm +++ b/code/__DEFINES/objects.dm @@ -54,6 +54,8 @@ #define SHOCK 8 #define SAFE 16 +#define CLOSED 2 + //metal, glass, rod stacks #define MAX_STACK_AMOUNT_METAL 50 #define MAX_STACK_AMOUNT_GLASS 50 @@ -77,14 +79,14 @@ #define GETPULSE_HAND 0 //less accurate (hand) #define GETPULSE_TOOL 1 //more accurate (med scanner, sleeper, etc) -var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accessed by preexisting terminals. AIs and new terminals can't use them. +GLOBAL_LIST_INIT(RESTRICTED_CAMERA_NETWORKS, list( //Those networks can only be accessed by preexisting terminals. AIs and new terminals can't use them.) "thunder", "ERT", "NUKE", CAMERA_NET_LADDER, CAMERA_NET_COLONY, CAMERA_NET_OVERWATCH, - ) + )) #define STASIS_IN_BAG 1 #define STASIS_IN_CRYO_CELL 2 diff --git a/code/__DEFINES/regex.dm b/code/__DEFINES/regex.dm index f56871ec83f2..a0d9c9a7323b 100644 --- a/code/__DEFINES/regex.dm +++ b/code/__DEFINES/regex.dm @@ -6,38 +6,38 @@ // The lazy URL finder. Lazy in that it matches the bare minimum // Replicates BYOND's own URL parser in functionality. -var/global/regex/url_find_lazy +GLOBAL_DATUM(url_find_lazy, /regex) // REGEX datums used for process_chat_markup. -var/global/regex/markup_bold -var/global/regex/markup_italics -var/global/regex/markup_strike -var/global/regex/markup_underline +GLOBAL_DATUM(markup_bold, /regex) +GLOBAL_DATUM(markup_italics, /regex) +GLOBAL_DATUM(markup_strike, /regex) +GLOBAL_DATUM(markup_underline, /regex) // Global list for mark-up REGEX datums. // Initialized in the hook, to avoid passing by null value. -var/global/list/markup_regex = list() +GLOBAL_LIST_EMPTY(markup_regex) // Global list for mark-up REGEX tag collection. -var/global/list/markup_tags = list("/" = list("", ""), +GLOBAL_LIST_INIT(markup_tags, list("/" = list("", ""), "*" = list("", ""), "~" = list("", ""), - "_" = list("", "")) + "_" = list("", ""))) /proc/initialize_global_regex() - url_find_lazy = new(@"((https?|byond):\/\/[^\s]*)", "g") + GLOB.url_find_lazy = new(@"((https?|byond):\/\/[^\s]*)", "g") - markup_bold = new("((\\W|^)\\*)(\[^\\*\]*)(\\*(\\W|$))", "g") - markup_italics = new("((\\W|^)\\/)(\[^\\/\]*)(\\/(\\W|$))", "g") - markup_strike = new("((\\W|^)\\~)(\[^\\~\]*)(\\~(\\W|$))", "g") - markup_underline = new("((\\W|^)\\_)(\[^\\_\]*)(\\_(\\W|$))", "g") + GLOB.markup_bold = new("((\\W|^)\\*)(\[^\\*\]*)(\\*(\\W|$))", "g") + GLOB.markup_italics = new("((\\W|^)\\/)(\[^\\/\]*)(\\/(\\W|$))", "g") + GLOB.markup_strike = new("((\\W|^)\\~)(\[^\\~\]*)(\\~(\\W|$))", "g") + GLOB.markup_underline = new("((\\W|^)\\_)(\[^\\_\]*)(\\_(\\W|$))", "g") // List needs to be initialized here, due to DM mixing and matching pass-by-value and -reference as it chooses. - markup_regex = list( - "/" = markup_italics, - "*" = markup_bold, - "~" = markup_strike, - "_" = markup_underline, + GLOB.markup_regex = list( + "/" = GLOB.markup_italics, + "*" = GLOB.markup_bold, + "~" = GLOB.markup_strike, + "_" = GLOB.markup_underline, ) return 1 diff --git a/code/__DEFINES/sounds.dm b/code/__DEFINES/sounds.dm index a6bb381100e7..541d95d28189 100644 --- a/code/__DEFINES/sounds.dm +++ b/code/__DEFINES/sounds.dm @@ -27,7 +27,7 @@ #define SOUND_CHANNEL_AMBIENCE 1019 #define SOUND_CHANNEL_WALKMAN 1020 #define SOUND_CHANNEL_SOUNDSCAPE 1021 -#define SOUND_CHANNEL_ADMIN_MIDI 1022 +//#define SOUND_CHANNEL_ADMIN_MIDI 1022 #define SOUND_CHANNEL_LOBBY 1023 #define SOUND_CHANNEL_Z 1024 diff --git a/code/__DEFINES/text.dm b/code/__DEFINES/text.dm index e3724e65f620..0ce7e508daac 100644 --- a/code/__DEFINES/text.dm +++ b/code/__DEFINES/text.dm @@ -17,3 +17,10 @@ #define SHOW_MESSAGE_VISIBLE 1 #define SHOW_MESSAGE_AUDIBLE 2 + +//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam +#define MAX_MESSAGE_LEN 1024 +#define MAX_EMOTE_LEN 256 +#define MAX_PAPER_MESSAGE_LEN 3072 +#define MAX_BOOK_MESSAGE_LEN 9216 +#define MAX_NAME_LEN 26 diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index af8af22ca707..8962230946c8 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -143,10 +143,20 @@ // #define TRAIT_X "t_x" //-- mob traits -- -/// Prevents voluntary movement. -#define TRAIT_IMMOBILIZED "immobilized" /// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this! #define TRAIT_UNDENSE "undense" +/// Forces the user to stay unconscious. +#define TRAIT_KNOCKEDOUT "knockedout" +/// Prevents voluntary movement. +#define TRAIT_IMMOBILIZED "immobilized" +/// Prevents voluntary standing or staying up on its own. +#define TRAIT_FLOORED "floored" +/// Forces user to stay standing +#define TRAIT_FORCED_STANDING "forcedstanding" +/// Stuns preventing movement and using objects but without further impairement +#define TRAIT_INCAPACITATED "incapacitated" +/// Apply this to identify a mob as merged with weeds +#define TRAIT_MERGED_WITH_WEEDS "merged_with_weeds" // SPECIES TRAITS /// Knowledge of Yautja technology @@ -296,7 +306,10 @@ GLOBAL_LIST_INIT(mob_traits, list( */ GLOBAL_LIST_INIT(traits_by_type, list( /mob = list( + "TRAIT_KNOCKEDOUT" = TRAIT_KNOCKEDOUT, "TRAIT_IMMOBILIZED" = TRAIT_IMMOBILIZED, + "TRAIT_INCAPACITATED" = TRAIT_INCAPACITATED, + "TRAIT_FLOORED" = TRAIT_FLOORED, "TRAIT_UNDENSE" = TRAIT_UNDENSE, "TRAIT_YAUTJA_TECH" = TRAIT_YAUTJA_TECH, "TRAIT_SUPER_STRONG" = TRAIT_SUPER_STRONG, @@ -414,13 +427,39 @@ GLOBAL_LIST(trait_name_map) //Status trait coming from clothing. #define TRAIT_SOURCE_CLOTHING "t_s_clothing" -/// traits associated with actively interacted machinery -#define INTERACTION_TRAIT "interaction" +/// trait associated to being buckled +#define BUCKLED_TRAIT "buckled" // Yes the name doesn't conform. /tg/ appears to have changed naming style inbetween +/// trait source when an effect is coming from a fakedeath effect (refactor this) +#define FAKEDEATH_TRAIT "fakedeath" +/// trait source where a condition comes from body state +#define BODY_TRAIT "body" +/// Trait associated to lying down (having a [lying_angle] of a different value than zero). +#define LYING_DOWN_TRAIT "lying-down" +/// trait associated to a stat value or range of +#define STAT_TRAIT "stat" +/// trait effect related to the queen ovipositor +#define OVIPOSITOR_TRAIT "ovipositor" +/// trait associated to being held in a chokehold +#define CHOKEHOLD_TRAIT "chokehold" /// trait effect related to active specialist gear #define SPECIALIST_GEAR_TRAIT "specialist_gear" /// traits associated with usage of snowflake dropship double seats #define DOUBLE_SEATS_TRAIT "double_seats" /// traits associated with xeno on-ground weeds #define XENO_WEED_TRAIT "xeno_weed" +/// traits associated with actively interacted machinery +#define INTERACTION_TRAIT "interaction" +/// traits bound by stunned status effects +#define STUNNED_TRAIT "stunned" +/// traits bound by knocked_down status effect +#define KNOCKEDDOWN_TRAIT "knockeddown" +/// traits bound by knocked_out status effect +#define KNOCKEDOUT_TRAIT "knockedout" +/// traits from being pounced +#define POUNCED_TRAIT "pounced" +/// traits from step_triggers on the map +#define STEP_TRIGGER_TRAIT "step_trigger" +/// traits from hacked machine interactions +#define HACKED_TRAIT "hacked" /// traits from chloroform usage #define CHLOROFORM_TRAIT "chloroform" diff --git a/code/__DEFINES/typecheck/items.dm b/code/__DEFINES/typecheck/items.dm index 09153cde25c2..5c4d099b8112 100644 --- a/code/__DEFINES/typecheck/items.dm +++ b/code/__DEFINES/typecheck/items.dm @@ -1,10 +1,10 @@ #define iswelder(O) (istype(O, /obj/item/tool/weldingtool)) #define iscoil(O) (istype(O, /obj/item/stack/cable_coil)) #define iswire(O) (istype(O, /obj/item/stack/cable_coil)) -#define isweapon(O) (O && is_type_in_list(O, weapons)) +#define isweapon(O) (O && is_type_in_list(O, GLOB.weapons)) #define isgun(O) (istype(O, /obj/item/weapon/gun)) #define isbanana(O) (istype(O, /obj/item/reagent_container/food/snacks/grown/banana)) -#define istool(O) (O && is_type_in_list(O, common_tools)) +#define istool(O) (O && is_type_in_list(O, GLOB.common_tools)) #define ispowerclamp(O) (istype(O, /obj/item/powerloader_clamp)) #define isstorage(O) (istype(O, /obj/item/storage)) #define isclothing(O) (istype(O, /obj/item/clothing)) @@ -12,13 +12,13 @@ #define isdefenses(O) (istype(O, /obj/structure/machinery/defenses)) //Quick type checks for weapons -var/global/list/weapons = list( +GLOBAL_LIST_INIT(weapons, list( /obj/item/weapon, /obj/item/attachable/bayonet -) +)) //Quick type checks for some tools -var/global/list/common_tools = list( +GLOBAL_LIST_INIT(common_tools, list( /obj/item/stack/cable_coil, /obj/item/tool/wrench, /obj/item/tool/weldingtool, @@ -26,7 +26,7 @@ var/global/list/common_tools = list( /obj/item/tool/wirecutters, /obj/item/device/multitool, /obj/item/tool/crowbar -) +)) /obj/item/proc/can_pry() if(pry_capable > IS_PRY_CAPABLE_SIMPLE || HAS_TRAIT(src, TRAIT_TOOL_CROWBAR)) diff --git a/code/__DEFINES/weapon_stats.dm b/code/__DEFINES/weapon_stats.dm index beac54d98892..3a69002a3b93 100644 --- a/code/__DEFINES/weapon_stats.dm +++ b/code/__DEFINES/weapon_stats.dm @@ -18,17 +18,17 @@ Accuracy determines if your bullets will hit whatever you're shooting at. Think It DOES NOT control where your bullets go, that's scatter and projectile variance. .../update_projectiles/guns/code.dm -var/accuracy_mult //Base firearm accuracy when firing from a 2-hand, "secure", wielded, etc, whatever grip. -var/accuracy_mult_unwielded //Base firearm accuracy when firing from hip. Both of these default to 1, with additions or subtractions from the mult vars. + var/accuracy_mult //Base firearm accuracy when firing from a 2-hand, "secure", wielded, etc, whatever grip. + var/accuracy_mult_unwielded //Base firearm accuracy when firing from hip. Both of these default to 1, with additions or subtractions from the mult vars. .../updated_projectiles/ammo_datums.dm -var/accuracy //This is added to the firearm's base accuracy when the specific ammo is shot. -var/accuracy_var_low //These two vars are used for the upper and lower bounds of accuracy variance when a bullet is fired. Bullet 'wobble' if you will. -var/accuracy_var_high + var/accuracy //This is added to the firearm's base accuracy when the specific ammo is shot. + var/accuracy_var_low //These two vars are used for the upper and lower bounds of accuracy variance when a bullet is fired. Bullet 'wobble' if you will. + var/accuracy_var_high .../updated_projectiles/gun_attachables.dm -var/accuracy_mult //Attachments ADD an additional multiplier to the base config value. Only ever use accuracy_mult config references. -var/accuracy_mult_unwielded + var/accuracy_mult //Attachments ADD an additional multiplier to the base config value. Only ever use accuracy_mult config references. + var/accuracy_mult_unwielded */ #define HIT_ACCURACY_TIER_1 5 diff --git a/code/__HELPERS/#maths.dm b/code/__HELPERS/#maths.dm index 5419b9cd9624..ccd077003e62 100644 --- a/code/__HELPERS/#maths.dm +++ b/code/__HELPERS/#maths.dm @@ -1,13 +1,10 @@ // Credits to Nickr5 for the useful procs I've taken from his library resource. -var/const/E = 2.71828183 -var/const/Sqrt2 = 1.41421356 - // List of square roots for the numbers 1-100. -var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, +GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10) + 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10)) // MATH DEFINES diff --git a/code/__HELPERS/_time.dm b/code/__HELPERS/_time.dm index b929ae8636b3..8386feff41c2 100644 --- a/code/__HELPERS/_time.dm +++ b/code/__HELPERS/_time.dm @@ -15,19 +15,19 @@ #define DECISECONDS_TO_HOURS /36000 -var/midnight_rollovers = 0 -var/rollovercheck_last_timeofday = 0 +GLOBAL_VAR_INIT(midnight_rollovers, 0) +GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0) // Real time that is still reliable even when the round crosses over midnight time reset. #define REALTIMEOFDAY (world.timeofday + (864000 * MIDNIGHT_ROLLOVER_CHECK)) -#define MIDNIGHT_ROLLOVER_CHECK ( rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : midnight_rollovers ) +#define MIDNIGHT_ROLLOVER_CHECK ( GLOB.rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : GLOB.midnight_rollovers ) /proc/update_midnight_rollover() - if(world.timeofday < rollovercheck_last_timeofday) - midnight_rollovers++ + if(world.timeofday < GLOB.rollovercheck_last_timeofday) + GLOB.midnight_rollovers++ - rollovercheck_last_timeofday = world.timeofday - return midnight_rollovers + GLOB.rollovercheck_last_timeofday = world.timeofday + return GLOB.midnight_rollovers ///Returns the world time in english. Do not use to get date information - starts at 0 + a random time offset from 10 minutes to 24 hours. /proc/worldtime2text(format = "hh:mm", time = world.time) diff --git a/code/__HELPERS/animations.dm b/code/__HELPERS/animations.dm new file mode 100644 index 000000000000..f85fb763a4a6 --- /dev/null +++ b/code/__HELPERS/animations.dm @@ -0,0 +1,2 @@ +/// The duration of the animate call in mob/living/update_transform +#define UPDATE_TRANSFORM_ANIMATION_TIME (0.2 SECONDS) diff --git a/code/__HELPERS/cmp.dm b/code/__HELPERS/cmp.dm index ff8e31ad3e8a..31308ac5812f 100644 --- a/code/__HELPERS/cmp.dm +++ b/code/__HELPERS/cmp.dm @@ -16,12 +16,12 @@ /proc/cmp_name_dsc(atom/a, atom/b) return sorttext(a.name, b.name) -var/cmp_field = "name" +GLOBAL_LIST_INIT(cmp_field, "name") /proc/cmp_records_asc(datum/data/record/a, datum/data/record/b) - return sorttext((b ? b.fields[cmp_field] : ""), (a ? a.fields[cmp_field] : a)) + return sorttext((b ? b.fields[GLOB.cmp_field] : ""), (a ? a.fields[GLOB.cmp_field] : a)) /proc/cmp_records_dsc(datum/data/record/a, datum/data/record/b) - return sorttext(a.fields[cmp_field], b.fields[cmp_field]) + return sorttext(a.fields[GLOB.cmp_field], b.fields[GLOB.cmp_field]) /proc/cmp_ckey_asc(client/a, client/b) return sorttext(b.ckey, a.ckey) @@ -53,7 +53,6 @@ var/cmp_field = "name" if (!.) . = B.qdels - A.qdels -var/atom/cmp_dist_origin=null /proc/cmp_typepaths_asc(A, B) return sorttext("[B]","[A]") diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index f88fe7168f8d..54bb438cd167 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -46,11 +46,11 @@ PLEASE USE RESPONSIBLY, Some log files canr each sizes of 4MB! */ /client/proc/file_spam_check() - var/time_to_wait = fileaccess_timer - world.time + var/time_to_wait = GLOB.fileaccess_timer - world.time if(time_to_wait > 0) to_chat(src, "Error: file_spam_check(): Spam. Please wait [round(time_to_wait/10)] seconds.") return 1 - fileaccess_timer = world.time + FTPDELAY + GLOB.fileaccess_timer = world.time + FTPDELAY return 0 #undef FTPDELAY diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 37c623bc3215..5ef9ff7e35c3 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -52,9 +52,6 @@ turfs += T return turfs - -//var/debug_mob = 0 - // Will recursively loop through an atom's contents and check for mobs, then it will loop through every atom in that atom's contents. // It will keep doing this until it checks every content possible. This will fix any problems with mobs, that are inside objects, // being unable to hear people due to being in a box within a bag. diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 24e39ff16c89..97243002740d 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -14,8 +14,7 @@ CHANGING ICONS Several new procs have been added to the /icon datum to simplify working with icons. To use them, remember you first need to setup an /icon var like so: - -var/icon/my_icon = new('iconfile.dmi') + var/icon/my_icon = new('iconfile.dmi') icon/ChangeOpacity(amount = 1) A very common operation in DM is to try to make an icon more or less transparent. Making an icon more diff --git a/code/__HELPERS/logging.dm b/code/__HELPERS/logging.dm index 5ecbff108725..c20db3da303f 100644 --- a/code/__HELPERS/logging.dm +++ b/code/__HELPERS/logging.dm @@ -35,27 +35,27 @@ // will get logs that are one big line if the system is Linux and they are using notepad. This solves it by adding CR to every line ending // in the logs. ascii character 13 = CR -/var/global/log_end= world.system_type == UNIX ? ascii2text(13) : "" +GLOBAL_VAR_INIT(log_end, world.system_type == UNIX ? ascii2text(13) : "") /proc/error(msg) - world.log << "## ERROR: [msg][log_end]" + world.log << "## ERROR: [msg][GLOB.log_end]" GLOB.STUI.debug.Add("\[[time_stamp()]]DEBUG: [msg]") GLOB.STUI.processing |= STUI_LOG_DEBUG #define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [src] usr: [usr].") //print a warning message to world.log /proc/warning(msg) - world.log << "## WARNING: [msg][log_end]" + world.log << "## WARNING: [msg][GLOB.log_end]" GLOB.STUI.debug.Add("\[[time_stamp()]]WARNING: [msg]") GLOB.STUI.processing |= STUI_LOG_DEBUG //print a testing-mode debug message to world.log /proc/testing(msg) - world.log << "## TESTING: [msg][log_end]" + world.log << "## TESTING: [msg][GLOB.log_end]" GLOB.STUI.debug.Add("\[[time_stamp()]]TESTING: [msg]") GLOB.STUI.processing |= STUI_LOG_DEBUG /proc/log_admin(text) var/time = time_stamp() - admin_log.Add(text) + GLOB.admin_log.Add(text) if (CONFIG_GET(flag/log_admin)) WRITE_LOG(GLOB.world_game_log, "ADMIN: [text]") LOG_REDIS("admin", "\[[time]\] [text]") @@ -63,14 +63,14 @@ GLOB.STUI.processing |= STUI_LOG_ADMIN /proc/log_asset(text) - asset_log.Add(text) + GLOB.asset_log.Add(text) if (CONFIG_GET(flag/log_asset)) var/time = time_stamp() WRITE_LOG(GLOB.world_game_log, "ASSET: [text]") LOG_REDIS("asset", "\[[time]\] [text]") /proc/log_adminpm(text) - admin_log.Add(text) + GLOB.admin_log.Add(text) if (CONFIG_GET(flag/log_admin)) WRITE_LOG(GLOB.world_game_log, "ADMIN: [text]") GLOB.STUI.staff.Add("\[[time_stamp()]]ADMIN: [text]") diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 9aa1bdc3ea2f..55b234b1e419 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -51,8 +51,10 @@ return f_style /proc/random_name(gender, species = "Human") - if(gender==FEMALE) return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) - else return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + if(gender==FEMALE) + return capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) + else + return capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) /proc/has_species(mob/M, species) if(!M || !istype(M,/mob/living/carbon/human)) diff --git a/code/__HELPERS/sorts/TimSort.dm b/code/__HELPERS/sorts/TimSort.dm index cfa55f0dfa3c..ae83bd9b0682 100644 --- a/code/__HELPERS/sorts/TimSort.dm +++ b/code/__HELPERS/sorts/TimSort.dm @@ -8,10 +8,14 @@ if(toIndex <= 0) toIndex += L.len + 1 - sortInstance.L = L - sortInstance.cmp = cmp - sortInstance.associative = associative + var/datum/sortInstance/sort_instance = GLOB.sortInstance + if(!sort_instance) + sort_instance = new() - sortInstance.timSort(fromIndex, toIndex) + sort_instance.L = L + sort_instance.cmp = cmp + sort_instance.associative = associative + + sort_instance.timSort(fromIndex, toIndex) return L diff --git a/code/__HELPERS/sorts/_Main.dm b/code/__HELPERS/sorts/_Main.dm index 7bc906be7e63..5d6f5210be47 100644 --- a/code/__HELPERS/sorts/_Main.dm +++ b/code/__HELPERS/sorts/_Main.dm @@ -8,8 +8,8 @@ //When we get into galloping mode, we stay there until both runs win less often than MIN_GALLOP consecutive times. #define MIN_GALLOP 7 - //This is a global instance to allow much of this code to be reused. The interfaces are kept separately -var/datum/sortInstance/sortInstance = new() +//This is a global instance to allow much of this code to be reused. The interfaces are kept separately +GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) /datum/sortInstance //The array being sorted. var/list/L diff --git a/code/__HELPERS/status_effects.dm b/code/__HELPERS/status_effects.dm new file mode 100644 index 000000000000..d06cb687f6a5 --- /dev/null +++ b/code/__HELPERS/status_effects.dm @@ -0,0 +1 @@ +#define TRAIT_STATUS_EFFECT(effect_id) "[effect_id]-trait" diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index d4d9eb320633..36dcfed6cfea 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -341,8 +341,8 @@ // ---Begin URL caching. var/list/urls = list() var/i = 1 - while (url_find_lazy.Find_char(message)) - urls["\ref[urls]-[i]"] = url_find_lazy.match + while (GLOB.url_find_lazy.Find_char(message)) + urls["\ref[urls]-[i]"] = GLOB.url_find_lazy.match i++ for (var/ref in urls) @@ -350,9 +350,9 @@ // ---End URL caching var/regex/tag_markup - for (var/tag in (markup_tags - ignore_tags)) - tag_markup = markup_regex[tag] - message = tag_markup.Replace_char(message, "$2[markup_tags[tag][1]]$3[markup_tags[tag][2]]$5") + for (var/tag in (GLOB.markup_tags - ignore_tags)) + tag_markup = GLOB.markup_regex[tag] + message = tag_markup.Replace_char(message, "$2[GLOB.markup_tags[tag][1]]$3[GLOB.markup_tags[tag][2]]$5") // ---Unload URL cache for (var/ref in urls) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 38c02e776735..a7af9d7f6324 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -916,110 +916,110 @@ return FALSE -var/global/image/busy_indicator_clock -var/global/image/busy_indicator_medical -var/global/image/busy_indicator_build -var/global/image/busy_indicator_friendly -var/global/image/busy_indicator_hostile -var/global/image/emote_indicator_highfive -var/global/image/emote_indicator_fistbump -var/global/image/emote_indicator_headbutt -var/global/image/emote_indicator_tailswipe -var/global/image/emote_indicator_rock_paper_scissors -var/global/image/emote_indicator_rock -var/global/image/emote_indicator_paper -var/global/image/emote_indicator_scissors -var/global/image/action_red_power_up -var/global/image/action_green_power_up -var/global/image/action_blue_power_up -var/global/image/action_purple_power_up +GLOBAL_DATUM(busy_indicator_clock, /image) +GLOBAL_DATUM(busy_indicator_medical, /image) +GLOBAL_DATUM(busy_indicator_build, /image) +GLOBAL_DATUM(busy_indicator_friendly, /image) +GLOBAL_DATUM(busy_indicator_hostile, /image) +GLOBAL_DATUM(emote_indicator_highfive, /image) +GLOBAL_DATUM(emote_indicator_fistbump, /image) +GLOBAL_DATUM(emote_indicator_headbutt, /image) +GLOBAL_DATUM(emote_indicator_tailswipe, /image) +GLOBAL_DATUM(emote_indicator_rock_paper_scissors, /image) +GLOBAL_DATUM(emote_indicator_rock, /image) +GLOBAL_DATUM(emote_indicator_paper, /image) +GLOBAL_DATUM(emote_indicator_scissors, /image) +GLOBAL_DATUM(action_red_power_up, /image) +GLOBAL_DATUM(action_green_power_up, /image) +GLOBAL_DATUM(action_blue_power_up, /image) +GLOBAL_DATUM(action_purple_power_up, /image) /proc/get_busy_icon(busy_type) if(busy_type == BUSY_ICON_GENERIC) - if(!busy_indicator_clock) - busy_indicator_clock = image('icons/mob/mob.dmi', null, "busy_generic", "pixel_y" = 22) - busy_indicator_clock.layer = FLY_LAYER - return busy_indicator_clock + if(!GLOB.busy_indicator_clock) + GLOB.busy_indicator_clock = image('icons/mob/mob.dmi', null, "busy_generic", "pixel_y" = 22) + GLOB.busy_indicator_clock.layer = FLY_LAYER + return GLOB.busy_indicator_clock else if(busy_type == BUSY_ICON_MEDICAL) - if(!busy_indicator_medical) - busy_indicator_medical = image('icons/mob/mob.dmi', null, "busy_medical", "pixel_y" = 0) //This shows directly on top of the mob, no offset! - busy_indicator_medical.layer = FLY_LAYER - return busy_indicator_medical + if(!GLOB.busy_indicator_medical) + GLOB.busy_indicator_medical = image('icons/mob/mob.dmi', null, "busy_medical", "pixel_y" = 0) //This shows directly on top of the mob, no offset! + GLOB.busy_indicator_medical.layer = FLY_LAYER + return GLOB.busy_indicator_medical else if(busy_type == BUSY_ICON_BUILD) - if(!busy_indicator_build) - busy_indicator_build = image('icons/mob/mob.dmi', null, "busy_build", "pixel_y" = 22) - busy_indicator_build.layer = FLY_LAYER - return busy_indicator_build + if(!GLOB.busy_indicator_build) + GLOB.busy_indicator_build = image('icons/mob/mob.dmi', null, "busy_build", "pixel_y" = 22) + GLOB.busy_indicator_build.layer = FLY_LAYER + return GLOB.busy_indicator_build else if(busy_type == BUSY_ICON_FRIENDLY) - if(!busy_indicator_friendly) - busy_indicator_friendly = image('icons/mob/mob.dmi', null, "busy_friendly", "pixel_y" = 22) - busy_indicator_friendly.layer = FLY_LAYER - return busy_indicator_friendly + if(!GLOB.busy_indicator_friendly) + GLOB.busy_indicator_friendly = image('icons/mob/mob.dmi', null, "busy_friendly", "pixel_y" = 22) + GLOB.busy_indicator_friendly.layer = FLY_LAYER + return GLOB.busy_indicator_friendly else if(busy_type == BUSY_ICON_HOSTILE) - if(!busy_indicator_hostile) - busy_indicator_hostile = image('icons/mob/mob.dmi', null, "busy_hostile", "pixel_y" = 22) - busy_indicator_hostile.layer = FLY_LAYER - return busy_indicator_hostile + if(!GLOB.busy_indicator_hostile) + GLOB.busy_indicator_hostile = image('icons/mob/mob.dmi', null, "busy_hostile", "pixel_y" = 22) + GLOB.busy_indicator_hostile.layer = FLY_LAYER + return GLOB.busy_indicator_hostile else if(busy_type == EMOTE_ICON_HIGHFIVE) - if(!emote_indicator_highfive) - emote_indicator_highfive = image('icons/mob/mob.dmi', null, "emote_highfive", "pixel_y" = 22) - emote_indicator_highfive.layer = FLY_LAYER - return emote_indicator_highfive + if(!GLOB.emote_indicator_highfive) + GLOB.emote_indicator_highfive = image('icons/mob/mob.dmi', null, "emote_highfive", "pixel_y" = 22) + GLOB.emote_indicator_highfive.layer = FLY_LAYER + return GLOB.emote_indicator_highfive else if(busy_type == EMOTE_ICON_FISTBUMP) - if(!emote_indicator_fistbump) - emote_indicator_fistbump = image('icons/mob/mob.dmi', null, "emote_fistbump", "pixel_y" = 22) - emote_indicator_fistbump.layer = FLY_LAYER - return emote_indicator_fistbump + if(!GLOB.emote_indicator_fistbump) + GLOB.emote_indicator_fistbump = image('icons/mob/mob.dmi', null, "emote_fistbump", "pixel_y" = 22) + GLOB.emote_indicator_fistbump.layer = FLY_LAYER + return GLOB.emote_indicator_fistbump else if(busy_type == EMOTE_ICON_ROCK_PAPER_SCISSORS) - if(!emote_indicator_rock_paper_scissors) - emote_indicator_rock_paper_scissors = image('icons/mob/mob.dmi', null, "emote_rps", "pixel_y" = 22) - emote_indicator_rock_paper_scissors.layer = FLY_LAYER - return emote_indicator_rock_paper_scissors + if(!GLOB.emote_indicator_rock_paper_scissors) + GLOB.emote_indicator_rock_paper_scissors = image('icons/mob/mob.dmi', null, "emote_rps", "pixel_y" = 22) + GLOB.emote_indicator_rock_paper_scissors.layer = FLY_LAYER + return GLOB.emote_indicator_rock_paper_scissors else if(busy_type == EMOTE_ICON_ROCK) - if(!emote_indicator_rock) - emote_indicator_rock = image('icons/mob/mob.dmi', null, "emote_rock", "pixel_y" = 22) - emote_indicator_rock.layer = FLY_LAYER - return emote_indicator_rock + if(!GLOB.emote_indicator_rock) + GLOB.emote_indicator_rock = image('icons/mob/mob.dmi', null, "emote_rock", "pixel_y" = 22) + GLOB.emote_indicator_rock.layer = FLY_LAYER + return GLOB.emote_indicator_rock else if(busy_type == EMOTE_ICON_PAPER) - if(!emote_indicator_paper) - emote_indicator_paper = image('icons/mob/mob.dmi', null, "emote_paper", "pixel_y" = 22) - emote_indicator_paper.layer = FLY_LAYER - return emote_indicator_paper + if(!GLOB.emote_indicator_paper) + GLOB.emote_indicator_paper = image('icons/mob/mob.dmi', null, "emote_paper", "pixel_y" = 22) + GLOB.emote_indicator_paper.layer = FLY_LAYER + return GLOB.emote_indicator_paper else if(busy_type == EMOTE_ICON_SCISSORS) - if(!emote_indicator_scissors) - emote_indicator_scissors = image('icons/mob/mob.dmi', null, "emote_scissors", "pixel_y" = 22) - emote_indicator_scissors.layer = FLY_LAYER - return emote_indicator_scissors + if(!GLOB.emote_indicator_scissors) + GLOB.emote_indicator_scissors = image('icons/mob/mob.dmi', null, "emote_scissors", "pixel_y" = 22) + GLOB.emote_indicator_scissors.layer = FLY_LAYER + return GLOB.emote_indicator_scissors else if(busy_type == EMOTE_ICON_HEADBUTT) - if(!emote_indicator_headbutt) - emote_indicator_headbutt = image('icons/mob/mob.dmi', null, "emote_headbutt", "pixel_y" = 22) - emote_indicator_headbutt.layer = FLY_LAYER - return emote_indicator_headbutt + if(!GLOB.emote_indicator_headbutt) + GLOB.emote_indicator_headbutt = image('icons/mob/mob.dmi', null, "emote_headbutt", "pixel_y" = 22) + GLOB.emote_indicator_headbutt.layer = FLY_LAYER + return GLOB.emote_indicator_headbutt else if(busy_type == EMOTE_ICON_TAILSWIPE) - if(!emote_indicator_tailswipe) - emote_indicator_tailswipe = image('icons/mob/mob.dmi', null, "emote_tailswipe", "pixel_y" = 22) - emote_indicator_tailswipe.layer = FLY_LAYER - return emote_indicator_tailswipe + if(!GLOB.emote_indicator_tailswipe) + GLOB.emote_indicator_tailswipe = image('icons/mob/mob.dmi', null, "emote_tailswipe", "pixel_y" = 22) + GLOB.emote_indicator_tailswipe.layer = FLY_LAYER + return GLOB.emote_indicator_tailswipe else if(busy_type == ACTION_RED_POWER_UP) - if(!action_red_power_up) - action_red_power_up = image('icons/effects/effects.dmi', null, "anger", "pixel_x" = 16) - action_red_power_up.layer = FLY_LAYER - return action_red_power_up + if(!GLOB.action_red_power_up) + GLOB.action_red_power_up = image('icons/effects/effects.dmi', null, "anger", "pixel_x" = 16) + GLOB.action_red_power_up.layer = FLY_LAYER + return GLOB.action_red_power_up else if(busy_type == ACTION_GREEN_POWER_UP) - if(!action_green_power_up) - action_green_power_up = image('icons/effects/effects.dmi', null, "vitality", "pixel_x" = 16) - action_green_power_up.layer = FLY_LAYER - return action_green_power_up + if(!GLOB.action_green_power_up) + GLOB.action_green_power_up = image('icons/effects/effects.dmi', null, "vitality", "pixel_x" = 16) + GLOB.action_green_power_up.layer = FLY_LAYER + return GLOB.action_green_power_up else if(busy_type == ACTION_BLUE_POWER_UP) - if(!action_blue_power_up) - action_blue_power_up = image('icons/effects/effects.dmi', null, "shock", "pixel_x" = 16) - action_blue_power_up.layer = FLY_LAYER - return action_blue_power_up + if(!GLOB.action_blue_power_up) + GLOB.action_blue_power_up = image('icons/effects/effects.dmi', null, "shock", "pixel_x" = 16) + GLOB.action_blue_power_up.layer = FLY_LAYER + return GLOB.action_blue_power_up else if(busy_type == ACTION_PURPLE_POWER_UP) - if(!action_purple_power_up) - action_purple_power_up = image('icons/effects/effects.dmi', null, "pain", "pixel_x" = 16) - action_purple_power_up.layer = FLY_LAYER - return action_purple_power_up + if(!GLOB.action_purple_power_up) + GLOB.action_purple_power_up = image('icons/effects/effects.dmi', null, "pain", "pixel_x" = 16) + GLOB.action_purple_power_up.layer = FLY_LAYER + return GLOB.action_purple_power_up /* @@ -1089,7 +1089,7 @@ var/global/image/action_purple_power_up target_orig_turf = get_turf(target) var/obj/user_holding = busy_user.get_active_hand() var/obj/target_holding - var/cur_user_lying = busy_user.lying + var/cur_user_lying = busy_user.body_position var/cur_target_lying var/expected_total_time = delayfraction*numticks var/time_remaining = expected_total_time @@ -1097,7 +1097,7 @@ var/global/image/action_purple_power_up if(has_target && istype(T)) cur_target_zone_sel = T.zone_selected target_holding = T.get_active_hand() - cur_target_lying = T.lying + cur_target_lying = T.body_position . = TRUE for(var/i in 1 to numticks) @@ -1121,13 +1121,13 @@ var/global/image/action_purple_power_up ) . = FALSE break - if(user_flags & INTERRUPT_KNOCKED_DOWN && busy_user.knocked_down || \ - target_is_mob && (target_flags & INTERRUPT_KNOCKED_DOWN && T.knocked_down) + if(user_flags & INTERRUPT_KNOCKED_DOWN && HAS_TRAIT(busy_user, TRAIT_FLOORED) || \ + target_is_mob && (target_flags & INTERRUPT_KNOCKED_DOWN && HAS_TRAIT(T, TRAIT_FLOORED)) ) . = FALSE break - if(user_flags & INTERRUPT_STUNNED && busy_user.stunned || \ - target_is_mob && (target_flags & INTERRUPT_STUNNED && T.stunned) + if(user_flags & INTERRUPT_STUNNED && HAS_TRAIT(busy_user, TRAIT_INCAPACITATED)|| \ + target_is_mob && (target_flags & INTERRUPT_STUNNED && HAS_TRAIT(T, TRAIT_INCAPACITATED)) ) . = FALSE break @@ -1201,8 +1201,8 @@ var/global/image/action_purple_power_up ) . = FALSE break - if(user_flags & INTERRUPT_CHANGED_LYING && busy_user.lying != cur_user_lying || \ - target_is_mob && (target_flags & INTERRUPT_CHANGED_LYING && T.lying != cur_target_lying) + if(user_flags & INTERRUPT_CHANGED_LYING && busy_user.body_position != cur_user_lying || \ + target_is_mob && (target_flags & INTERRUPT_CHANGED_LYING && T.body_position != cur_target_lying) ) . = FALSE break @@ -1465,7 +1465,7 @@ var/global/image/action_purple_power_up /* Checks if that loc and dir has a item on the wall */ -var/list/WALLITEMS = list( +GLOBAL_LIST_INIT(WALLITEMS, list( /obj/structure/machinery/power/apc, /obj/structure/machinery/alarm, /obj/item/device/radio/intercom, @@ -1486,10 +1486,11 @@ var/list/WALLITEMS = list( /obj/structure/mirror, /obj/structure/closet/fireaxecabinet, /obj/structure/machinery/computer/cameras/telescreen/entertainment, - ) + )) + /proc/gotwallitem(loc, dir) for(var/obj/O in loc) - for(var/item in WALLITEMS) + for(var/item in GLOB.WALLITEMS) if(istype(O, item)) //Direction works sometimes if(O.dir == dir) @@ -1513,7 +1514,7 @@ var/list/WALLITEMS = list( //Some stuff is placed directly on the wallturf (signs) for(var/obj/O in get_step(loc, dir)) - for(var/item in WALLITEMS) + for(var/item in GLOB.WALLITEMS) if(istype(O, item)) if(O.pixel_x == 0 && O.pixel_y == 0) return 1 @@ -1650,7 +1651,7 @@ var/list/WALLITEMS = list( var/turf/Turf = get_turf(explosive) if(!(Turf.loc.type in GLOB.explosive_antigrief_exempt_areas)) var/crash_occured = (SSticker?.mode?.is_in_endgame) - if((Turf.z in SSmapping.levels_by_any_trait(list(ZTRAIT_MARINE_MAIN_SHIP, ZTRAIT_RESERVED))) && (security_level < SEC_LEVEL_RED) && !crash_occured) + if((Turf.z in SSmapping.levels_by_any_trait(list(ZTRAIT_MARINE_MAIN_SHIP, ZTRAIT_RESERVED))) && (GLOB.security_level < SEC_LEVEL_RED) && !crash_occured) switch(CONFIG_GET(number/explosive_antigrief)) if(ANTIGRIEF_DISABLED) return FALSE diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index b85aa18fdb6b..541d1a05362d 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -369,6 +369,13 @@ DEFINE_BITFIELD(mob_flags, list( "NOBIOSCAN" = NOBIOSCAN, )) +DEFINE_BITFIELD(mobility_flags, list( + "MOVE" = MOBILITY_MOVE, + "STAND" = MOBILITY_STAND, + "REST" = MOBILITY_REST, + "LIEDOWN" = MOBILITY_LIEDOWN +)) + DEFINE_BITFIELD(flags, list( "NO_BLOOD" = NO_BLOOD, "NO_BREATHE" = NO_BREATHE, diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index 3ba92a7c4d0c..6e1b229e562f 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -20,14 +20,11 @@ GLOBAL_LIST_EMPTY(larva_burst_by_hive) GLOBAL_LIST_INIT_TYPED(custom_huds_list, /datum/custom_hud, setup_all_huds()) GLOBAL_LIST_INIT_TYPED(custom_human_huds, /datum/custom_hud, setup_human_huds()) -//Since it didn't really belong in any other category, I'm putting this here -//This is for procs to replace all the goddamn 'in world's that are chilling around the code - -var/readied_players = 0 //How many players are readied up in the lobby +GLOBAL_VAR_INIT(readied_players, 0) //How many players are readied up in the lobby GLOBAL_LIST_EMPTY_TYPED(other_factions_human_list, /mob/living/carbon/human) -var/global/list/ai_mob_list = list() //List of all AIs +GLOBAL_LIST_EMPTY(ai_mob_list) //List of all AIs GLOBAL_LIST_EMPTY(freed_mob_list) // List of mobs freed for ghosts @@ -109,12 +106,12 @@ GLOBAL_LIST_INIT_TYPED(resin_mark_meanings, /datum/xeno_mark_define, setup_resin GLOBAL_REFERENCE_LIST_INDEXED(xeno_datum_list, /datum/caste_datum, caste_type) //Chem Stuff -var/global/list/chemical_reactions_filtered_list //List of all /datum/chemical_reaction datums filtered by reaction components. Used during chemical reactions -var/global/list/chemical_reactions_list //List of all /datum/chemical_reaction datums indexed by reaction id. Used to search for the result instead of the components. -var/global/list/chemical_reagents_list //List of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff -var/global/list/chemical_properties_list //List of all /datum/chem_property datums indexed by property name +GLOBAL_LIST(chemical_reactions_filtered_list) //List of all /datum/chemical_reaction datums filtered by reaction components. Used during chemical reactions +GLOBAL_LIST(chemical_reactions_list) //List of all /datum/chemical_reaction datums indexed by reaction id. Used to search for the result instead of the components. +GLOBAL_LIST(chemical_reagents_list) //List of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff +GLOBAL_LIST(chemical_properties_list) //List of all /datum/chem_property datums indexed by property name //List of all id's from classed /datum/reagent datums indexed by class or tier. Used by chemistry generator and chem spawners. -var/global/list/list/chemical_gen_classes_list = list("C" = list(),"C1" = list(),"C2" = list(),"C3" = list(),"C4" = list(),"C5" = list(),"C6" = list(),"T1" = list(),"T2" = list(),"T3" = list(),"T4" = list(),"tau" = list()) +GLOBAL_LIST_INIT_TYPED(chemical_gen_classes_list, /list, list("C" = list(),"C1" = list(),"C2" = list(),"C3" = list(),"C4" = list(),"C5" = list(),"C6" = list(),"T1" = list(),"T2" = list(),"T3" = list(),"T4" = list(),"tau", list())) //properties generated in chemicals, helps to make sure the same property doesn't show up 10 times GLOBAL_LIST_INIT_TYPED(generated_properties, /list, list("positive" = list(), "negative" = list(), "neutral" = list())) @@ -140,13 +137,12 @@ GLOBAL_LIST_INIT(surgical_patient_types, setup_surgical_patient_types()) GLOBAL_LIST_INIT_TYPED(gear_path_presets_list, /datum/equipment_preset, setup_gear_path_presets()) GLOBAL_LIST_INIT_TYPED(gear_name_presets_list, /datum/equipment_preset, setup_gear_name_presets()) -var/global/list/active_areas = list() -var/global/list/all_areas = list() +GLOBAL_LIST_EMPTY(active_areas) +GLOBAL_LIST_EMPTY(all_areas) -var/global/list/turfs = list() -var/global/list/z1turfs = list() +GLOBAL_LIST_EMPTY(turfs) -/var/global/list/objects_of_interest // This is used to track the stealing objective for Agents. +GLOBAL_LIST(objects_of_interest) // This is used to track the stealing objective for Agents. // Areas exempt from explosive antigrief (not Z-levels) GLOBAL_LIST_INIT(explosive_antigrief_exempt_areas, list( @@ -209,23 +205,23 @@ GLOBAL_REFERENCE_LIST_INDEXED(hair_gradient_list, /datum/sprite_accessory/hair_g GLOBAL_REFERENCE_LIST_INDEXED(yautja_hair_styles_list, /datum/sprite_accessory/yautja_hair, name) //Backpacks -var/global/list/backbaglist = list("Backpack", "Satchel") +GLOBAL_LIST_INIT(backbaglist, list("Backpack", "Satchel")) //Armor styles GLOBAL_LIST_INIT(armor_style_list, list("Padded" = 1, "Padless" = 2, "Ridged" = 3, "Carrier" = 4, "Skull" = 5, "Smooth" = 6, "Random")) // var/global/list/exclude_jobs = list(/datum/job/ai,/datum/job/cyborg) -var/global/round_should_check_for_win = TRUE +GLOBAL_VAR_INIT(round_should_check_for_win, TRUE) -var/global/list/key_mods = list("CTRL", "ALT", "SHIFT") +GLOBAL_LIST_INIT(key_mods, list("CTRL", "ALT", "SHIFT")) // A list storing the pass flags for specific types of atoms -var/global/list/pass_flags_cache = list() +GLOBAL_LIST_EMPTY(pass_flags_cache) //Parameterss cache -var/global/list/paramslist_cache = list() +GLOBAL_LIST_EMPTY(paramslist_cache) //Turf Edge info uberlist -- a list whos states contain GLOB.edgeinfo_X keyed as different icon_states -var/global/list/turf_edgeinfo_cache = list() +GLOBAL_LIST_EMPTY(turf_edgeinfo_cache) #define FULL_EDGE 1 #define HALF_EDGE_RIGHT 2 @@ -277,10 +273,10 @@ GLOBAL_LIST_INIT(typecache_living, typecacheof(/mob/living)) GLOBAL_LIST_INIT(emote_list, init_emote_list()) /proc/cached_params_decode(params_data, decode_proc) - . = paramslist_cache[params_data] + . = GLOB.paramslist_cache[params_data] if(!.) . = call(decode_proc)(params_data) - paramslist_cache[params_data] = . + GLOB.paramslist_cache[params_data] = . /proc/key_number_decode(key_number_data) var/list/L = params2list(key_number_data) @@ -461,10 +457,10 @@ GLOBAL_LIST_INIT(emote_list, init_emote_list()) /* // Uncomment to debug chemical reaction list. /client/verb/debug_chemical_list() - for (var/reaction in chemical_reactions_filtered_list) - . += "chemical_reactions_filtered_list\[\"[reaction]\"\] = \"[chemical_reactions_filtered_list[reaction]]\"\n" - if(islist(chemical_reactions_filtered_list[reaction])) - var/list/L = chemical_reactions_filtered_list[reaction] + for (var/reaction in GLOB.chemical_reactions_filtered_list) + . += "GLOB.chemical_reactions_filtered_list\[\"[reaction]\"\] = \"[GLOB.chemical_reactions_filtered_list[reaction]]\"\n" + if(islist(GLOB.chemical_reactions_filtered_list[reaction])) + var/list/L = GLOB.chemical_reactions_filtered_list[reaction] for(var/t in L) . += " has: [t]\n" world << . @@ -478,22 +474,22 @@ GLOBAL_LIST_EMPTY(timelocks) //the global list of specialist kits that haven't been claimed yet. -var/global/list/available_specialist_sets = list( +GLOBAL_LIST_INIT(available_specialist_sets, list( "Scout Set", "Sniper Set", "Demolitionist Set", "Heavy Grenadier Set", "Pyro Set" - ) + )) //Similar thing, but used in /obj/item/spec_kit -var/global/list/available_specialist_kit_boxes = list( +GLOBAL_LIST_INIT(available_specialist_kit_boxes, list( "Pyro" = 2, "Grenadier" = 2, "Sniper" = 2, "Scout" = 2, "Demo" = 2, - ) + )) /proc/init_global_referenced_datums() init_keybindings() diff --git a/code/_globalvars/lists/clans.dm b/code/_globalvars/lists/clans.dm new file mode 100644 index 000000000000..f04915a37435 --- /dev/null +++ b/code/_globalvars/lists/clans.dm @@ -0,0 +1,19 @@ +GLOBAL_LIST_INIT_TYPED(clan_ranks, /datum/yautja_rank, list( + CLAN_RANK_UNBLOODED = new /datum/yautja_rank/unblooded(), + CLAN_RANK_YOUNG = new /datum/yautja_rank/young(), + CLAN_RANK_BLOODED = new /datum/yautja_rank/blooded(), + CLAN_RANK_ELITE = new /datum/yautja_rank/elite(), + CLAN_RANK_ELDER = new /datum/yautja_rank/elder(), + CLAN_RANK_LEADER = new /datum/yautja_rank/leader(), + CLAN_RANK_ADMIN = new /datum/yautja_rank/ancient() +)) + +GLOBAL_LIST_INIT(clan_ranks_ordered, list( + CLAN_RANK_UNBLOODED = CLAN_RANK_UNBLOODED_INT, + CLAN_RANK_YOUNG = CLAN_RANK_YOUNG_INT, + CLAN_RANK_BLOODED = CLAN_RANK_BLOODED_INT, + CLAN_RANK_ELITE = CLAN_RANK_ELITE_INT, + CLAN_RANK_ELDER = CLAN_RANK_ELDER_INT, + CLAN_RANK_LEADER = CLAN_RANK_LEADER_INT, + CLAN_RANK_ADMIN = CLAN_RANK_ADMIN_INT +)) diff --git a/code/_globalvars/lists/names.dm b/code/_globalvars/lists/names.dm new file mode 100644 index 000000000000..09ad2b422d3c --- /dev/null +++ b/code/_globalvars/lists/names.dm @@ -0,0 +1,39 @@ +GLOBAL_LIST_INIT(ai_names, file2list("strings/ai.txt")) +GLOBAL_LIST_INIT(first_names_male, file2list("strings/first_male.txt")) +GLOBAL_LIST_INIT(first_names_female, file2list("strings/first_female.txt")) +GLOBAL_LIST_INIT(last_names, file2list("strings/last.txt")) +GLOBAL_LIST_INIT(clown_names, file2list("strings/clown.txt")) +GLOBAL_LIST_INIT(operation_titles, file2list("strings/operation_title.txt")) +GLOBAL_LIST_INIT(operation_prefixes, file2list("strings/operation_prefix.txt")) +GLOBAL_LIST_INIT(operation_postfixes, file2list("strings/operation_postfix.txt")) + +GLOBAL_LIST_INIT(verbs, file2list("strings/verbs.txt")) +//loaded on startup because of " +//would include in rsc if ' was used + + +GLOBAL_LIST_INIT(first_names_male_clf, list("Alan","Jack","Bil","Jonathan","John","Shiro","Gareth","Clark","Sam", "Lionel", "Aaron", "Charlie", "Scott", "Winston", "Aidan", "Ellis", "Mason", "Wesley", "Nicholas", "Calvin", "Nishikawa", "Hiroto", "Chiba", "Ouchi", "Furuse", "Takagi", "Oba", "Kishimoto")) +GLOBAL_LIST_INIT(first_names_female_clf, list("Emma", "Adelynn", "Mary", "Halie", "Chelsea", "Lexie", "Arya", "Alicia", "Selah", "Amber", "Heather", "Myra", "Heidi", "Charlotte", "Oliva", "Lydia", "Tia", "Riko", "Ari", "Machida", "Ueki", "Mihara", "Noda")) +GLOBAL_LIST_INIT(last_names_clf, list("Hawkins","Rickshaw","Elliot","Billard","Cooper","Fox", "Barlow", "Barrows", "Stewart", "Morgan", "Green", "Stone", "Burr", "Hunt", "Yuko", "Gesshin", "Takanibu", "Tetsuzan", "Tomomi", "Bokkai", "Takesi")) + +GLOBAL_LIST_INIT(first_names_male_colonist, list("Alan","Jack","Bil","Jonathan","John","Shiro","Gareth","Clark","Sam", "Lionel", "Aaron", "Charlie", "Scott", "Winston", "Aidan", "Ellis", "Mason", "Wesley", "Nicholas", "Calvin", "Nishikawa", "Hiroto", "Chiba", "Ouchi", "Furuse", "Takagi", "Oba", "Kishimoto")) +GLOBAL_LIST_INIT(first_names_female_colonist, list("Emma", "Adelynn", "Mary", "Halie", "Chelsea", "Lexie", "Arya", "Alicia", "Selah", "Amber", "Heather", "Myra", "Heidi", "Charlotte", "Ashley", "Raven", "Tori", "Anne", "Madison", "Oliva", "Lydia", "Tia", "Riko", "Ari", "Machida", "Ueki", "Mihara", "Noda")) +GLOBAL_LIST_INIT(last_names_colonist, list("Hawkins","Rickshaw","Elliot","Billard","Cooper","Fox", "Barlow", "Barrows", "Stewart", "Morgan", "Green", "Stone", "Titan", "Crowe", "Krantz", "Pathillo", "Driggers", "Burr", "Hunt", "Yuko", "Gesshin", "Takanibu", "Tetsuzan", "Tomomi", "Bokkai", "Takesi")) + +GLOBAL_LIST_INIT(first_names_male_upp, list("Badai","Mongkeemur","Alexei","Andrei","Artyom","Viktor","Xiangai","Ivan","Choban","Oleg", "Dayan", "Taghi", "Batu", "Arik", "Orda", "Ghazan", "Bala", "Gao", "Zhan", "Ren", "Hou", "Xue", "Serafim", "Luca", "Su", "György", "István", "Mihály", "Vladimir", "Aleksandr", "Fyodor", "Bhodar", "Qazem", "Łukasz", "Miłogost", "Radogost", "Uniegost", "Hostirad", "Hostimil", "Hostisvit", "Lubgost", "Gościsław", "Vseslav", "Bohuměr", "Bronisław", "Česćiměr", "Dobysław", "Horisław", "Jaroměr", "Mirosław", "Mječisław", "Radoměr", "Stanij", "Stanisław", "Wjeleměr", "Wójsław")) +GLOBAL_LIST_INIT(first_names_female_upp, list("Altani","Cirina","Anastasiya","Saran","Wei","Oksana","Ren","Svena","Tatyana","Yaroslava", "Izabella", "Kata", "Krisztina", "Miruna", "Flori", "Lucia", "Anica", "Li", "Yimu", "Alona", "Hsiau-Li", "Xiaoling", "Erhong", "Baśka", "Angela", "Angelina", "Angja", "Ankica", "Biljana", "Bisera", "Bistra", "Blaga", "Blagica", "Blagorodna", "Verka", "Vladica", "Denica", "Živka", "Zlata", "Jagoda", "Letka", "Ljupka", "Mila", "Mirjana", "Mirka", "Rada", "Radmila", "Slavica", "Slavka", "Snežana", "Stojna", "Ubavka", "Jaromir", "Mscëwòj", "Subisłôw", "Swiãtopôłk", "Ji-Sun", "Chaeyong", "Chaewon", "Saerom", "Seoyeong", "Jiheon", "Hayoung")) +GLOBAL_LIST_INIT(last_names_upp, list("Azarov","Bogdanov","Barsukov","Golovin","Davydov","Khan","Noica","Barbu","Zhukov","Ivanov","Mihai","Kasputin","Belov", "Belova","Melnikov", "Vasilevsky", "Aleksander", "Halkovich", "Stanislaw", "Proca", "Zaituc", "Arcos", "Kubat", "Kral", "Volf", "Xun", "Jia", "Bachoń", "Wang", "Ji", "Xiang", "Zhang", "Mei", "Ma", "Kim", "Yi", "Ri", "Pak", "Chong", "Baek", "Kwon", "Hwang", "Roh", "Lee", "Song")) + +GLOBAL_LIST_INIT(first_names_male_pmc, list("Owen","Luka","Nelson","Branson", "Tyson", "Leo", "Bryant", "Kobe", "Rohan", "Riley", "Aidan", "Watase","Egawa", "Hisakawa", "Koide", "Remy", "Martial", "Magnus", "Heiko", "Lennard")) +GLOBAL_LIST_INIT(first_names_female_pmc, list("Madison","Jessica","Anna","Juliet", "Olivia", "Lea", "Diane", "Kaori", "Beatrice", "Riley", "Amy", "Natsue","Yumi", "Aiko", "Fujiko", "Jennifer", "Ashley", "Mary", "Hitomi", "Lisa")) +GLOBAL_LIST_INIT(last_names_pmc, list("Bates","Shaw","Hansen","Black", "Chambers", "Hall", "Gibson", "Weiss", "Waller", "Burton", "Bakin", "Rohan", "Naomichi", "Yakumo", "Yosai", "Gallagher", "Hiles", "Bourdon", "Strassman", "Palau")) + +GLOBAL_LIST_INIT(first_names_male_gladiator, list("Augustus", "Maximus", "Octavius", "Septimus", "Titus", "Brutus", "Caesar", "Justinian")) +GLOBAL_LIST_INIT(first_names_female_gladiator, list("Aelia", "Aquila", "Caecilia", "Camilla", "Claudia", "Flavia", "Martina", "Theodora")) + +GLOBAL_LIST_INIT(first_names_male_dutch, list("Raymond", "Jesse", "Jack", "John", "Sam", "Aaron", "Charlie", "Ellis", "Nick", "Francis", "Louis")) +GLOBAL_LIST_INIT(first_names_female_dutch, list("Chelsea", "Mira", "Jessica", "Catherine", "Eliza", "Emma", "Ashley", "Annie", "Alicia", "Miranda", "Ellen")) + +GLOBAL_LIST_INIT(monkey_names, list("Abu", "Aldo", "Bear", "Bingo", "Clyde", "Crystal", "Gordo", "George", "Koko", "Marcel", "Nim", "Rafiki", "Spike", "Banana", "Boots", "Bubbles", "Smiley", "Winston")) + +GLOBAL_LIST_INIT(weapon_surnames, list("Adze", "Axe", "Bagh Nakha", "Bo", "Bola", "Bow", "Bowman", "Cannon", "Carbine", "Cestus", "Club", "Culverin", "Dagger", "Dao", "Derringer", "Dha", "Dussack", "Emeici", "Falchion", "Fan", "Flyssa", "Gauntlet", "Hammer", "Halberd", "Harquebus", "Hatchet", "Hwando", "Katar", "Kampilan", "Knuckles", "Lance", "Lancer", "Larim", "Maduvu", "Mace", "Maru", "Mauser", "Messer", "Mine", "Mubucae", "Nyepel", "Onager", "Pata", "Pike", "Ram", "Saber", "Seax", "Shamsir", "Sickle", "Sling", "Spear", "Spears", "Staff", "Sword", "Tekko")) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index cd6708198eae..0b7a4af0f05f 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -1,3 +1,89 @@ +GLOBAL_VAR_INIT(game_year, 2182) + +GLOBAL_VAR_INIT(ooc_allowed, TRUE) +GLOBAL_VAR_INIT(looc_allowed, TRUE) +GLOBAL_VAR_INIT(dsay_allowed, TRUE) +GLOBAL_VAR_INIT(dooc_allowed, TRUE) +GLOBAL_VAR_INIT(dlooc_allowed, FALSE) + +GLOBAL_VAR_INIT(enter_allowed, TRUE) + +GLOBAL_LIST_EMPTY(admin_log) +GLOBAL_LIST_EMPTY(asset_log) + +// multiplier for watts per tick <> cell storage (eg: 0.02 means if there is a load of 1000 watts, 20 units will be taken from a cell per second) +//It's a conversion constant. power_used*CELLRATE = charge_provided, or charge_used/CELLRATE = power_provided +#define CELLRATE 0.006 + +// Cap for how fast cells charge, as a percentage-per-tick (0.01 means cellcharge is capped to 1% per second) +#define CHARGELEVEL 0.001 + +GLOBAL_VAR(VehicleElevatorConsole) +GLOBAL_VAR(VehicleGearConsole) + +//Spawnpoints. +GLOBAL_LIST_EMPTY(fallen_list) +/// This is for dogtags placed on crosses- they will show up at the end-round memorial. +GLOBAL_LIST_EMPTY(fallen_list_cross) + +GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) +GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) +GLOBAL_LIST_INIT(reverse_dir, list(2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15, 32, 34, 33, 35, 40, 42, 41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21, 23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63)) + + + +GLOBAL_VAR(join_motd) +GLOBAL_VAR(current_tms) + +GLOBAL_LIST_INIT(BorgWireColorToFlag, RandomBorgWires()) +GLOBAL_LIST(BorgIndexToFlag) +GLOBAL_LIST(BorgIndexToWireColor) +GLOBAL_LIST(BorgWireColorToIndex) +GLOBAL_LIST_INIT(AAlarmWireColorToFlag, RandomAAlarmWires()) +GLOBAL_LIST(AAlarmIndexToFlag) +GLOBAL_LIST(AAlarmIndexToWireColor) +GLOBAL_LIST(AAlarmWireColorToIndex) + +/// 3 minutes in the station. +#define shuttle_time_in_station 3 MINUTES +/// 10 minutes to arrive. +#define shuttle_time_to_arrive 10 MINUTES + + // For FTP requests. (i.e. downloading runtime logs.) + // However it'd be ok to use for accessing attack logs and such too, which are even laggier. +GLOBAL_VAR_INIT(fileaccess_timer, 0) + +// Reference list for disposal sort junctions. Filled up by sorting junction's New() +GLOBAL_LIST_EMPTY(tagger_locations) + +//added for Xenoarchaeology, might be useful for other stuff +GLOBAL_LIST_INIT(alphabet_uppercase, list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")) +GLOBAL_LIST_INIT(alphabet_lowercase, list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")) + +GLOBAL_LIST_INIT(greek_letters, list("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omnicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega")) +GLOBAL_LIST_INIT(nato_phonetic_alphabet, list("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliett", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-Ray", "Yankee", "Zulu")) + +//Used for autocall procs on ERT +GLOBAL_VAR_INIT(distress_cancel, FALSE) +GLOBAL_VAR_INIT(destroy_cancel, FALSE) + +// Which lobby art is on display +// This is updated by the lobby art turf when it initializes +GLOBAL_VAR_INIT(displayed_lobby_art, -1) + +// Last global ID that was assigned to a mob (for round recording purposes) +GLOBAL_VAR_INIT(last_mob_gid, 0) + +GLOBAL_LIST_INIT(almayer_ship_sections, list( + "Upper deck Foreship", + "Upper deck Midship", + "Upper deck Aftship", + "Lower deck Foreship", + "Lower deck Midship", + "Lower deck Aftship" +)) + + GLOBAL_VAR_INIT(internal_tick_usage, 0.2 * world.tick_lag) /// Global performance feature toggle flags @@ -31,7 +117,7 @@ GLOBAL_DATUM_INIT(uscm_tacmap_status, /datum/tacmap/drawing/status_tab_view, new GLOBAL_DATUM_INIT(xeno_tacmap_status, /datum/tacmap/drawing/status_tab_view/xeno, new) /// List of roles that can be setup for each gamemode -GLOBAL_LIST_INIT(gamemode_roles, list()) +GLOBAL_LIST_EMPTY(gamemode_roles) GLOBAL_VAR_INIT(minimum_exterior_lighting_alpha, 255) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 3b8ba26c07e9..b99d52086e36 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -375,7 +375,7 @@ tX = tX[1] var/shiftX = C.pixel_x / world.icon_size var/shiftY = C.pixel_y / world.icon_size - var/list/actual_view = getviewsize(C ? C.view : world_view_size) + var/list/actual_view = getviewsize(C ? C.view : GLOB.world_view_size) tX = Clamp(origin.x + text2num(tX) + shiftX - round(actual_view[1] / 2) - 1, 1, world.maxx) tY = Clamp(origin.y + text2num(tY) + shiftY - round(actual_view[2] / 2) - 1, 1, world.maxy) return locate(tX, tY, tZ) diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index c6b642974881..22a24e022a3f 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -9,7 +9,7 @@ "1:2,3:4" is the square (1,3) with pixel offsets (+2, +4); slightly right and slightly above the turf grid. Pixel offsets are used so you don't perfectly hide the turf under them, that would be crappy. - The size of the user's screen is defined by client.view (indirectly by world_view_size), in our case "15x15". + The size of the user's screen is defined by client.view (indirectly by GLOB.world_view_size), in our case "15x15". Therefore, the top right corner (except during admin shenanigans) is at "15,15" */ diff --git a/code/_onclick/human.dm b/code/_onclick/human.dm index 8f329656ef6c..b09c26ffb92f 100644 --- a/code/_onclick/human.dm +++ b/code/_onclick/human.dm @@ -64,7 +64,7 @@ /mob/living/carbon/human/UnarmedAttack(atom/A, proximity, click_parameters) - if(lying) //No attacks while laying down + if(body_position == LYING_DOWN) //No attacks while laying down return 0 var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines @@ -88,7 +88,7 @@ /atom/proc/attack_hand(mob/user) return -/mob/living/carbon/human/MouseDrop_T(atom/dropping, mob/user) +/mob/living/carbon/human/MouseDrop_T(atom/dropping, mob/living/user) if(user != src) return . = ..() @@ -153,6 +153,4 @@ target.Move(user.loc, get_dir(target.loc, user.loc)) target.update_transform(TRUE) - target.update_canmove() - diff --git a/code/_onclick/ventcrawl.dm b/code/_onclick/ventcrawl.dm index b079cffe2afe..51afbc139fdd 100644 --- a/code/_onclick/ventcrawl.dm +++ b/code/_onclick/ventcrawl.dm @@ -45,7 +45,7 @@ to_chat(src, SPAN_WARNING("You must be conscious to do this!")) return - if(lying) + if(is_mob_incapacitated()) to_chat(src, SPAN_WARNING("You can't vent crawl while you're stunned!")) return @@ -88,7 +88,7 @@ return updatehealth() - if(stat || stunned || dazed || knocked_down || lying || health < 0 || !client || !ventcrawl_carry()) + if(is_mob_incapacitated(src) || health < 0 || !client || !ventcrawl_carry()) vent_found.animate_ventcrawl_reset() return diff --git a/code/_onclick/xeno.dm b/code/_onclick/xeno.dm index adb637dfe8fa..abb76ded498b 100644 --- a/code/_onclick/xeno.dm +++ b/code/_onclick/xeno.dm @@ -3,7 +3,7 @@ */ /mob/living/carbon/xenomorph/UnarmedAttack(atom/target, proximity, click_parameters, tile_attack = FALSE, ignores_resin = FALSE) - if(lying || HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) //No attacks while laying down + if(body_position == LYING_DOWN || HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) //No attacks while laying down return FALSE var/mob/alt @@ -21,7 +21,7 @@ if (!L.is_xeno_grabbable() || L == src) //Xenos never attack themselves. continue - if (L.lying) + if (L.body_position == LYING_DOWN) alt = L continue target = L diff --git a/code/controllers/mc/admin.dm b/code/controllers/mc/admin.dm index 78eb5c5b5a5a..8c5060864747 100644 --- a/code/controllers/mc/admin.dm +++ b/code/controllers/mc/admin.dm @@ -96,8 +96,8 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick) set category = "Debug.Controllers" set name = "Debug Role Authority" - if(!RoleAuthority) + if(!GLOB.RoleAuthority) to_chat(usr, "RoleAuthority not found!") return - debug_variables(RoleAuthority) + debug_variables(GLOB.RoleAuthority) message_admins("Admin [key_name_admin(usr)] is debugging the Role Authority.") diff --git a/code/controllers/shuttle_controller.dm b/code/controllers/shuttle_controller.dm index e54d045baff4..35031cf7334f 100644 --- a/code/controllers/shuttle_controller.dm +++ b/code/controllers/shuttle_controller.dm @@ -28,12 +28,12 @@ shuttle.location = 1 shuttle.warmup_time = 1 shuttle.move_time = ELEVATOR_TRANSIT_DURATION - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/supply/dock) shuttle.area_offsite = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/supply/station) shuttle.area_station = A break @@ -41,7 +41,7 @@ shuttles["Supply"] = shuttle process_shuttles += shuttle - supply_controller.shuttle = shuttle + GLOB.supply_controller.shuttle = shuttle //---ELEVATOR---// // Elevator I @@ -50,17 +50,17 @@ shuttle.warmup_time = 10 SECONDS shuttle.recharge_time = ELEVATOR_RECHARGE - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator1/underground) shuttle.area_offsite = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator1/ground) shuttle.area_station = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator1/transit) shuttle.area_transition = A break @@ -76,17 +76,17 @@ shuttle.warmup_time = 10 SECONDS shuttle.recharge_time = ELEVATOR_RECHARGE - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator2/underground) shuttle.area_offsite = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator2/ground) shuttle.area_station = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator2/transit) shuttle.area_transition = A break @@ -102,17 +102,17 @@ shuttle.location = 0 shuttle.warmup_time = 10 SECONDS shuttle.recharge_time = ELEVATOR_RECHARGE - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator3/underground) shuttle.area_offsite = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator3/ground) shuttle.area_station = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator3/transit) shuttle.area_transition = A break @@ -127,17 +127,17 @@ shuttle.location = 0 shuttle.warmup_time = 10 SECONDS shuttle.recharge_time = ELEVATOR_RECHARGE - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator4/underground) shuttle.area_offsite = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator4/ground) shuttle.area_station = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/elevator4/transit) shuttle.area_transition = A break @@ -152,17 +152,17 @@ shuttle.location = 0 shuttle.warmup_time = 10 SECONDS shuttle.recharge_time = ELEVATOR_RECHARGE - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/tri_trans1/omega) shuttle.area_offsite = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/tri_trans1/alpha) shuttle.area_station = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/tri_trans1/away) shuttle.area_transition = A break @@ -178,17 +178,17 @@ shuttle.location = 0 shuttle.warmup_time = 10 SECONDS shuttle.recharge_time = ELEVATOR_RECHARGE - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/tri_trans2/omega) shuttle.area_offsite = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/tri_trans2/alpha) shuttle.area_station = A break - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.type == /area/shuttle/tri_trans2/away) shuttle.area_transition = A break @@ -216,7 +216,7 @@ //search for the controllers, if we have one. if(dock_controller_map.len) - for(var/obj/structure/machinery/embedded_controller/radio/C in machines) //only radio controllers are supported at the moment + for(var/obj/structure/machinery/embedded_controller/radio/C in GLOB.machines) //only radio controllers are supported at the moment if (istype(C.program, /datum/computer/file/embedded_program/docking)) if(dock_controller_map[C.id_tag]) shuttle = dock_controller_map[C.id_tag] diff --git a/code/controllers/subsystem/cellauto.dm b/code/controllers/subsystem/cellauto.dm index bcdd9d241ccf..b543ddd43c26 100644 --- a/code/controllers/subsystem/cellauto.dm +++ b/code/controllers/subsystem/cellauto.dm @@ -1,4 +1,4 @@ -var/list/cellauto_cells = list() +GLOBAL_LIST_EMPTY(cellauto_cells) SUBSYSTEM_DEF(cellauto) name = "Cellular Automata" @@ -9,12 +9,12 @@ SUBSYSTEM_DEF(cellauto) var/list/currentrun = list() /datum/controller/subsystem/cellauto/stat_entry(msg) - msg = "C: [cellauto_cells.len]" + msg = "C: [GLOB.cellauto_cells.len]" return ..() /datum/controller/subsystem/cellauto/fire(resumed = FALSE) if (!resumed) - currentrun = cellauto_cells.Copy() + currentrun = GLOB.cellauto_cells.Copy() while(currentrun.len) var/datum/automata_cell/C = currentrun[currentrun.len] diff --git a/code/controllers/subsystem/communications.dm b/code/controllers/subsystem/communications.dm index 8458436a53e5..95839b726151 100644 --- a/code/controllers/subsystem/communications.dm +++ b/code/controllers/subsystem/communications.dm @@ -66,78 +66,78 @@ Frequency range: 1200 to 1600 Radiochat range: 1441 to 1489 (most devices refuse to be tune to other frequency, even during mapmaking) */ -var/const/MIN_FREE_FREQ = 1201 // ------------------------------------------------- +#define MIN_FREE_FREQ 1201 // ------------------------------------------------- //Misc channels -var/const/YAUT_FREQ = 1205 -var/const/DUT_FREQ = 1210 -var/const/CMB_FREQ = 1220 -var/const/VAI_FREQ = 1215 -var/const/RMC_FREQ = 1216 +#define YAUT_FREQ 1205 +#define DUT_FREQ 1210 +#define CMB_FREQ 1220 +#define VAI_FREQ 1215 +#define RMC_FREQ 1216 //WY Channels (1230-1249) -var/const/WY_FREQ = 1231 -var/const/PMC_CMD_FREQ = 1232 -var/const/PMC_FREQ = 1233 -var/const/PMC_ENGI_FREQ = 1234 -var/const/PMC_MED_FREQ = 1235 -var/const/PMC_CCT_FREQ = 1236 -var/const/WY_WO_FREQ = 1239 +#define WY_FREQ 1231 +#define PMC_CMD_FREQ 1232 +#define PMC_FREQ 1233 +#define PMC_ENGI_FREQ 1234 +#define PMC_MED_FREQ 1235 +#define PMC_CCT_FREQ 1236 +#define WY_WO_FREQ 1239 //UPP Channels (1250-1269) -var/const/UPP_FREQ = 1251 -var/const/UPP_CMD_FREQ = 1252 -var/const/UPP_ENGI_FREQ = 1253 -var/const/UPP_MED_FREQ = 1254 -var/const/UPP_CCT_FREQ = 1255 -var/const/UPP_KDO_FREQ = 1259 +#define UPP_FREQ 1251 +#define UPP_CMD_FREQ 1252 +#define UPP_ENGI_FREQ 1253 +#define UPP_MED_FREQ 1254 +#define UPP_CCT_FREQ 1255 +#define UPP_KDO_FREQ 1259 //CLF Channels (1270-1289) -var/const/CLF_FREQ = 1271 -var/const/CLF_CMD_FREQ = 1272 -var/const/CLF_ENGI_FREQ = 1273 -var/const/CLF_MED_FREQ = 1274 -var/const/CLF_CCT_FREQ = 1275 +#define CLF_FREQ 1271 +#define CLF_CMD_FREQ 1272 +#define CLF_ENGI_FREQ 1273 +#define CLF_MED_FREQ 1274 +#define CLF_CCT_FREQ 1275 -var/const/MIN_FREQ = 1460 // ------------------------------------------------------ -var/const/PUB_FREQ = 1461 -var/const/MAX_FREQ = 1468 // ------------------------------------------------------ +#define MIN_FREQ 1460 // ------------------------------------------------------ +#define PUB_FREQ 1461 +#define MAX_FREQ 1468 // ------------------------------------------------------ //USCM High Command (USCM 1470-1499) -var/const/HC_FREQ = 1471 -var/const/SOF_FREQ = 1472 -var/const/PVST_FREQ = 1473 -var/const/CBRN_FREQ = 1474 +#define HC_FREQ 1471 +#define SOF_FREQ 1472 +#define PVST_FREQ 1473 +#define CBRN_FREQ 1474 //Ship department channels -var/const/SENTRY_FREQ = 1480 -var/const/COMM_FREQ = 1481 -var/const/MED_FREQ = 1482 -var/const/ENG_FREQ = 1483 -var/const/SEC_FREQ = 1484 -var/const/REQ_FREQ = 1485 -var/const/JTAC_FREQ = 1486 -var/const/INTEL_FREQ = 1487 - -var/const/DS1_FREQ = 1488 -var/const/DS2_FREQ = 1489 +#define SENTRY_FREQ 1480 +#define COMM_FREQ 1481 +#define MED_FREQ 1482 +#define ENG_FREQ 1483 +#define SEC_FREQ 1484 +#define REQ_FREQ 1485 +#define JTAC_FREQ 1486 +#define INTEL_FREQ 1487 + +#define DS1_FREQ 1488 +#define DS2_FREQ 1489 //Marine Squad channels -var/const/ALPHA_FREQ = 1491 -var/const/BRAVO_FREQ = 1492 -var/const/CHARLIE_FREQ = 1493 -var/const/DELTA_FREQ = 1494 -var/const/ECHO_FREQ = 1495 -var/const/CRYO_FREQ = 1496 +#define ALPHA_FREQ 1491 +#define BRAVO_FREQ 1492 +#define CHARLIE_FREQ 1493 +#define DELTA_FREQ 1494 +#define ECHO_FREQ 1495 +#define CRYO_FREQ 1496 //Civilian channels -var/const/COLONY_FREQ = 1469 +#define COLONY_FREQ 1469 -var/const/AI_FREQ = 1500 +#define AI_FREQ 1500 -var/const/MAX_FREE_FREQ = 1599 // ------------------------------------------------- +#define MAX_FREE_FREQ 1599 // ------------------------------------------------- -var/list/radiochannels = list( +GLOBAL_LIST_INIT(radiochannels, list( RADIO_CHANNEL_YAUTJA = YAUT_FREQ, RADIO_CHANNEL_VAI = VAI_FREQ, RADIO_CHANNEL_CMB = CMB_FREQ, @@ -191,7 +191,7 @@ var/list/radiochannels = list( RADIO_CHANNEL_CLF_ENGI = CLF_ENGI_FREQ, RADIO_CHANNEL_CLF_MED = CLF_MED_FREQ, RADIO_CHANNEL_CLF_CCT = CLF_CCT_FREQ, -) +)) // Response Teams #define ERT_FREQS list(VAI_FREQ, DUT_FREQ, YAUT_FREQ, CMB_FREQ, RMC_FREQ) @@ -217,17 +217,17 @@ var/list/radiochannels = list( //This is done for performance, so we don't send signals to lots of machines unnecessarily. //This filter is special because devices belonging to default also receive signals sent to any other filter. -var/const/RADIO_DEFAULT = "radio_default" - -var/const/RADIO_TO_AIRALARM = "radio_airalarm" //air alarms -var/const/RADIO_FROM_AIRALARM = "radio_airalarm_rcvr" //devices interested in receiving signals from air alarms -var/const/RADIO_CHAT = "radio_telecoms" -var/const/RADIO_SIGNALS = "radio_signals" -var/const/RADIO_ATMOSIA = "radio_atmos" -var/const/RADIO_NAVBEACONS = "radio_navbeacon" -var/const/RADIO_AIRLOCK = "radio_airlock" -var/const/RADIO_MULEBOT = "radio_mulebot" -var/const/RADIO_MAGNETS = "radio_magnet" +#define RADIO_DEFAULT "radio_default" + +#define RADIO_TO_AIRALARM "radio_airalarm" //air alarms +#define RADIO_FROM_AIRALARM "radio_airalarm_rcvr" //devices interested in receiving signals from air alarms +#define RADIO_CHAT "radio_telecoms" +#define RADIO_SIGNALS "radio_signals" +#define RADIO_ATMOSIA "radio_atmos" +#define RADIO_NAVBEACONS "radio_navbeacon" +#define RADIO_AIRLOCK "radio_airlock" +#define RADIO_MULEBOT "radio_mulebot" +#define RADIO_MAGNETS "radio_magnet" //callback used by objects to react to incoming radio signals /obj/proc/receive_signal(datum/signal/signal, receive_method, receive_param) diff --git a/code/controllers/subsystem/fz_transitions.dm b/code/controllers/subsystem/fz_transitions.dm index fd41ce1ccb55..d12ab1358535 100644 --- a/code/controllers/subsystem/fz_transitions.dm +++ b/code/controllers/subsystem/fz_transitions.dm @@ -1,6 +1,6 @@ -var/list/projectors = list() -var/list/clones = list() -var/list/clones_t = list() +GLOBAL_LIST_EMPTY(projectors) +GLOBAL_LIST_EMPTY(clones) +GLOBAL_LIST_EMPTY(clones_t) SUBSYSTEM_DEF(fz_transitions) name = "Z-Transitions" @@ -10,18 +10,18 @@ SUBSYSTEM_DEF(fz_transitions) flags = SS_KEEP_TIMING /datum/controller/subsystem/fz_transitions/stat_entry(msg) - msg = "P:[projectors.len]|C:[clones.len]|T:[clones_t.len]" + msg = "P:[GLOB.projectors.len]|C:[GLOB.clones.len]|T:[GLOB.clones_t.len]" return ..() /datum/controller/subsystem/fz_transitions/Initialize() for(var/obj/effect/projector/P in world) - projectors.Add(P) + GLOB.projectors.Add(P) return SS_INIT_SUCCESS /datum/controller/subsystem/fz_transitions/fire(resumed = FALSE) - for(var/obj/effect/projector/P in projectors) + for(var/obj/effect/projector/P in GLOB.projectors) if(!P || !P.loc) - projectors -= P + GLOB.projectors -= P continue if(!P.loc.clone) P.loc.create_clone(P.vector_x, P.vector_y) @@ -36,13 +36,13 @@ SUBSYSTEM_DEF(fz_transitions) O.clone.proj_y = P.vector_y - for(var/atom/movable/clone/C in clones) + for(var/atom/movable/clone/C in GLOB.clones) if(C.mstr == null || !istype(C.mstr.loc, /turf)) C.mstr.destroy_clone() //Kill clone if master has been destroyed or picked up else if(C != C.mstr) C.mstr.update_clone() //NOTE: Clone updates are also forced by player movement to reduce latency - for(var/atom/T in clones_t) + for(var/atom/T in GLOB.clones_t) if(T.clone && T.icon_state) //Just keep the icon updated for explosions etc. T.clone.icon_state = T.icon_state diff --git a/code/controllers/subsystem/hijack.dm b/code/controllers/subsystem/hijack.dm index 55b5aa75caf8..ee3e86e6095e 100644 --- a/code/controllers/subsystem/hijack.dm +++ b/code/controllers/subsystem/hijack.dm @@ -216,13 +216,13 @@ SUBSYSTEM_DEF(hijack) switch(announce) if(1) - marine_announcement("Emergency fuel replenishment at 25 percent. Lifeboat emergency early launch now available.[marine_warning_areas ? "\nTo increase speed restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) + marine_announcement("Emergency fuel replenishment is at 25 percent. Lifeboat emergency early launch is now available.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) if(2) - marine_announcement("Emergency fuel replenishment at 50 percent.[marine_warning_areas ? "\nTo increase speed restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) + marine_announcement("Emergency fuel replenishment is at 50 percent.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) if(3) - marine_announcement("Emergency fuel replenishment at 75 percent.[marine_warning_areas ? "\nTo increase speed restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) + marine_announcement("Emergency fuel replenishment is at 75 percent.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) if(4) - marine_announcement("Emergency fuel replenishment at 100 percent. Safe utilization of lifeboats now possible.", HIJACK_ANNOUNCE) + marine_announcement("Emergency fuel replenishment is at 100 percent. Safe utilization of lifeboats and pods is now possible.", HIJACK_ANNOUNCE) if(!admin_sd_blocked) addtimer(CALLBACK(src, PROC_REF(unlock_self_destruct)), 8 SECONDS) @@ -238,7 +238,7 @@ SUBSYSTEM_DEF(hijack) return "Complete" /datum/controller/subsystem/hijack/proc/get_sd_eta() - if(!sd_time_remaining) + if(sd_detonated) return "Complete" if(overloaded_generators <= 0) @@ -254,7 +254,7 @@ SUBSYSTEM_DEF(hijack) evac_status = EVACUATION_STATUS_INITIATED ai_announcement("Attention. Emergency. All personnel must evacuate immediately.", 'sound/AI/evacuate.ogg') - for(var/obj/structure/machinery/status_display/cycled_status_display in machines) + for(var/obj/structure/machinery/status_display/cycled_status_display in GLOB.machines) if(is_mainship_level(cycled_status_display.z)) cycled_status_display.set_picture("evac") for(var/obj/docking_port/mobile/crashable/escape_shuttle/shuttle in SSshuttle.mobile) @@ -269,7 +269,7 @@ SUBSYSTEM_DEF(hijack) deactivate_lifeboats() ai_announcement("Evacuation has been cancelled.", 'sound/AI/evacuate_cancelled.ogg') - for(var/obj/structure/machinery/status_display/cycled_status_display in machines) + for(var/obj/structure/machinery/status_display/cycled_status_display in GLOB.machines) if(is_mainship_level(cycled_status_display.z)) cycled_status_display.set_sec_level_picture() diff --git a/code/controllers/subsystem/influxstats.dm b/code/controllers/subsystem/influxstats.dm index 01015b83191d..066c94cc2593 100644 --- a/code/controllers/subsystem/influxstats.dm +++ b/code/controllers/subsystem/influxstats.dm @@ -104,7 +104,7 @@ SUBSYSTEM_DEF(influxstats) /datum/controller/subsystem/influxstats/proc/run_job_statistics() var/list/team_job_stats = list() - var/list/squad_job_stats = ROLES_SQUAD_ALL.Copy() + var/list/squad_job_stats = GLOB.ROLES_SQUAD_ALL.Copy() for(var/squad in squad_job_stats) squad_job_stats[squad] = list() diff --git a/code/controllers/subsystem/init/landmarks.dm b/code/controllers/subsystem/init/landmarks.dm index 59bba7c7922b..31b71c074a5d 100644 --- a/code/controllers/subsystem/init/landmarks.dm +++ b/code/controllers/subsystem/init/landmarks.dm @@ -1,4 +1,4 @@ -var/list/item_pool_landmarks = list() +GLOBAL_LIST_EMPTY(item_pool_landmarks) SUBSYSTEM_DEF(landmark_init) name = "Landmark Init" @@ -9,7 +9,7 @@ SUBSYSTEM_DEF(landmark_init) // List of all the datums we need to loop through var/list/datum/item_pool_holder/pools = list() - for (var/obj/effect/landmark/item_pool_spawner/L in item_pool_landmarks) + for (var/obj/effect/landmark/item_pool_spawner/L in GLOB.item_pool_landmarks) var/curr_pool_name = L.pool_name @@ -48,8 +48,8 @@ SUBSYSTEM_DEF(landmark_init) continue if (pool.quota > pool.turfs.len) - log_debug("Item pool [pool.pool_name] wants to spawn more items than it has landmarks for. Spawning [turfs.len] instances of [pool.type_to_spawn] instead. Code: ITEM_POOL_4") - message_admins("Item pool [pool.pool_name] wants to spawn more items than it has landmarks for. Spawning [turfs.len] instances of [pool.type_to_spawn] instead. Tell the devs. Code: ITEM_POOL_4") + log_debug("Item pool [pool.pool_name] wants to spawn more items than it has landmarks for. Spawning [pool.turfs.len] instances of [pool.type_to_spawn] instead. Code: ITEM_POOL_4") + message_admins("Item pool [pool.pool_name] wants to spawn more items than it has landmarks for. Spawning [pool.turfs.len] instances of [pool.type_to_spawn] instead. Tell the devs. Code: ITEM_POOL_4") pool.quota = pool.turfs.len // Quota times, pick a random turf, spawn an item there, then remove that turf from the list. diff --git a/code/controllers/subsystem/item_cleanup.dm b/code/controllers/subsystem/item_cleanup.dm index 35d1fc2859e9..26958eb8742b 100644 --- a/code/controllers/subsystem/item_cleanup.dm +++ b/code/controllers/subsystem/item_cleanup.dm @@ -1,4 +1,4 @@ -var/global/list/item_cleanup_list = list() +GLOBAL_LIST_EMPTY(item_cleanup_list) SUBSYSTEM_DEF(item_cleanup) name = "Item Cleanup" @@ -34,9 +34,9 @@ SUBSYSTEM_DEF(item_cleanup) break //We transfer items from the global garbage list onto the next iteration list - while(!isnull(item_cleanup_list) && item_cleanup_list.len > 0) - addToListNoDupe(items_to_clean_up, item_cleanup_list[item_cleanup_list.len]) - item_cleanup_list -= item_cleanup_list[item_cleanup_list.len] + while(!isnull(GLOB.item_cleanup_list) && GLOB.item_cleanup_list.len > 0) + addToListNoDupe(items_to_clean_up, GLOB.item_cleanup_list[GLOB.item_cleanup_list.len]) + GLOB.item_cleanup_list -= GLOB.item_cleanup_list[GLOB.item_cleanup_list.len] log_debug("item_cleanup deleted [deleted] garbage out of total [total_items]") @@ -57,9 +57,9 @@ SUBSYSTEM_DEF(item_cleanup) qdel(o) /proc/add_to_garbage(atom/a) - addToListNoDupe(item_cleanup_list, a) + addToListNoDupe(GLOB.item_cleanup_list, a) /proc/remove_from_garbage(atom/a) - item_cleanup_list -= a + GLOB.item_cleanup_list -= a if(SSitem_cleanup) SSitem_cleanup.items_to_clean_up -= a diff --git a/code/controllers/subsystem/machinery.dm b/code/controllers/subsystem/machinery.dm index 7f86689874ff..6a0f938475a1 100644 --- a/code/controllers/subsystem/machinery.dm +++ b/code/controllers/subsystem/machinery.dm @@ -1,8 +1,8 @@ -var/list/machines = list() -var/list/processing_machines = list() +GLOBAL_LIST_EMPTY(machines) +GLOBAL_LIST_EMPTY(processing_machines) -var/list/datum/powernet/powernets = list() //Holds all powernet datums in use or pooled -var/list/datum/powernet/powernets_by_name = list() //Holds all powernet datums in use or pooled +GLOBAL_LIST_EMPTY(powernets) //Holds all powernet datums in use or pooled +GLOBAL_LIST_EMPTY(powernets_by_name) //Holds all powernet datums in use or pooled SUBSYSTEM_DEF(machinery) @@ -19,12 +19,12 @@ SUBSYSTEM_DEF(machinery) return SS_INIT_SUCCESS /datum/controller/subsystem/machinery/stat_entry(msg) - msg = "M:[global.processing_machines.len]" + msg = "M:[GLOB.processing_machines.len]" return ..() /datum/controller/subsystem/machinery/fire(resumed = FALSE) if (!resumed) - currentrunmachines = processing_machines.Copy() + currentrunmachines = GLOB.processing_machines.Copy() while (currentrunmachines.len) var/obj/structure/machinery/M = currentrunmachines[currentrunmachines.len] diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index d28fe916291a..64f4b92a1edd 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -874,7 +874,7 @@ SUBSYSTEM_DEF(minimaps) if(faction == FACTION_MARINE) COOLDOWN_START(GLOB, uscm_canvas_cooldown, canvas_cooldown_time) var/mob/living/carbon/human/human_leader = user - for(var/datum/squad/current_squad in RoleAuthority.squads) + for(var/datum/squad/current_squad in GLOB.RoleAuthority.squads) current_squad.send_maptext("Tactical map update in progress...", "Tactical Map:") human_leader.visible_message(SPAN_BOLDNOTICE("Tactical map update in progress...")) playsound_client(human_leader.client, "sound/effects/sos-morse-code.ogg") diff --git a/code/controllers/subsystem/nanoui.dm b/code/controllers/subsystem/nanoui.dm index 1f33227a7fee..d89474dd50f1 100644 --- a/code/controllers/subsystem/nanoui.dm +++ b/code/controllers/subsystem/nanoui.dm @@ -1,10 +1,15 @@ SUBSYSTEM_DEF(nano) name = "Nano UI" - flags = SS_NO_INIT wait = 2 SECONDS priority = SS_PRIORITY_NANOUI runlevels = RUNLEVELS_DEFAULT|RUNLEVEL_LOBBY var/list/currentrun = list() + var/datum/nanomanager/nanomanager + +/datum/controller/subsystem/nano/New() + . = ..() + + nanomanager = new() /datum/controller/subsystem/nano/stat_entry(msg) msg = "P:[nanomanager.processing_uis.len]" diff --git a/code/controllers/subsystem/power.dm b/code/controllers/subsystem/power.dm index 16f4f2ab6127..9908a60420b2 100644 --- a/code/controllers/subsystem/power.dm +++ b/code/controllers/subsystem/power.dm @@ -1,4 +1,4 @@ -var/list/power_machines = list() +GLOBAL_LIST_EMPTY(power_machines) SUBSYSTEM_DEF(power) name = "Power" @@ -12,7 +12,7 @@ SUBSYSTEM_DEF(power) var/list/currentrun_areas = list() /datum/controller/subsystem/power/stat_entry(msg) - msg = "PN:[powernets.len]|PM:[power_machines.len]|A:[active_areas.len]" + msg = "PN:[GLOB.powernets.len]|PM:[GLOB.power_machines.len]|A:[GLOB.active_areas.len]" return ..() @@ -23,9 +23,9 @@ SUBSYSTEM_DEF(power) /datum/controller/subsystem/power/fire(resumed = FALSE) if (!resumed) - currentrun_powerents = global.powernets.Copy() - currentrun_areas = active_areas.Copy() - currentrun_power_machines = global.power_machines.Copy() + currentrun_powerents = GLOB.powernets.Copy() + currentrun_areas = GLOB.active_areas.Copy() + currentrun_power_machines = GLOB.power_machines.Copy() // First we reset the powernets. // This is done first because we want the power machinery to have acted last on the powernet between intervals. @@ -49,7 +49,7 @@ SUBSYSTEM_DEF(power) var/obj/structure/machinery/M = X if (M.process() == PROCESS_KILL) //M.inMachineList = FALSE - power_machines.Remove(M) + GLOB.power_machines.Remove(M) continue if (MC_TICK_CHECK) diff --git a/code/controllers/subsystem/reagents.dm b/code/controllers/subsystem/reagents.dm index 5a310801b191..187479509385 100644 --- a/code/controllers/subsystem/reagents.dm +++ b/code/controllers/subsystem/reagents.dm @@ -17,33 +17,33 @@ SUBSYSTEM_DEF(reagents) /datum/controller/subsystem/reagents/proc/prepare_properties() //Chemical Properties - Initialises all /datum/chem_property into a list indexed by property name var/paths = typesof(/datum/chem_property) - chemical_properties_list = list() + GLOB.chemical_properties_list = list() //Some filters - chemical_properties_list["negative"] = list() - chemical_properties_list["neutral"] = list() - chemical_properties_list["positive"] = list() - chemical_properties_list["rare"] = list() + GLOB.chemical_properties_list["negative"] = list() + GLOB.chemical_properties_list["neutral"] = list() + GLOB.chemical_properties_list["positive"] = list() + GLOB.chemical_properties_list["rare"] = list() //Save for(var/path in paths) var/datum/chem_property/prop = new path() if(!prop.name) continue - chemical_properties_list[prop.name] = prop + GLOB.chemical_properties_list[prop.name] = prop if(prop.starter) //Add a separate instance to the chemical property database var/datum/chem_property/chem = new path() chem.level = 0 - chemical_data.research_property_data += chem + GLOB.chemical_data.research_property_data += chem if(prop.rarity > PROPERTY_DISABLED) //Filters for the generator picking properties if(prop.rarity == PROPERTY_RARE || prop.rarity == PROPERTY_LEGENDARY) - chemical_properties_list["rare"][prop.name] = prop + GLOB.chemical_properties_list["rare"][prop.name] = prop else if(isNegativeProperty(prop)) - chemical_properties_list["negative"][prop.name] = prop + GLOB.chemical_properties_list["negative"][prop.name] = prop else if(isNeutralProperty(prop)) - chemical_properties_list["neutral"][prop.name] = prop + GLOB.chemical_properties_list["neutral"][prop.name] = prop else if(isPositiveProperty(prop)) - chemical_properties_list["positive"][prop.name] = prop + GLOB.chemical_properties_list["positive"][prop.name] = prop /datum/controller/subsystem/reagents/proc/prepare_reagents() //I dislike having these here but map-objects are initialised before world/New() is called. >_> @@ -51,11 +51,11 @@ SUBSYSTEM_DEF(reagents) //Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id //Generated chemicals should be initialized last, hence the substract then readd. var/list/paths = subtypesof(/datum/reagent) - typesof(/datum/reagent/generated) - subtypesof(/datum/reagent/generated) + subtypesof(/datum/reagent/generated) - chemical_reagents_list = list() + GLOB.chemical_reagents_list = list() for(var/path in paths) var/datum/reagent/chem = new path() chem.save_chemclass() - chemical_reagents_list[chem.id] = chem + GLOB.chemical_reagents_list[chem.id] = chem //Chemical Reactions - Initialises all /datum/chemical_reaction into a list // It is filtered into multiple lists within a list. @@ -63,11 +63,11 @@ SUBSYSTEM_DEF(reagents) // chemical_reaction_list["phoron"] is a list of all reactions relating to phoron var/list/regular_paths = subtypesof(/datum/chemical_reaction) - typesof(/datum/chemical_reaction/generated) var/list/generated_paths = subtypesof(/datum/chemical_reaction/generated) //Generated chemicals should be initialized last - chemical_reactions_filtered_list = list() - chemical_reactions_list = list() + GLOB.chemical_reactions_filtered_list = list() + GLOB.chemical_reactions_list = list() for(paths in list(regular_paths, generated_paths)) for(var/path in paths) var/datum/chemical_reaction/react = new path() - chemical_reactions_list[react.id] = react + GLOB.chemical_reactions_list[react.id] = react react.add_to_filtered_list() diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 972f61aa530f..2da87df90995 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -1,11 +1,11 @@ -var/global/datum/controller/shuttle_controller/shuttle_controller - SUBSYSTEM_DEF(oldshuttle) name = "Old Shuttle" wait = 5.5 SECONDS init_order = SS_INIT_SHUTTLE priority = SS_PRIORITY_SHUTTLE + var/datum/controller/shuttle_controller/shuttle_controller + /datum/controller/subsystem/oldshuttle/Initialize() if(GLOB.perf_flags & PERF_TOGGLE_SHUTTLES) can_fire = FALSE diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 88627669aa3b..0153f03565f6 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -97,7 +97,7 @@ SUBSYSTEM_DEF(ticker) if(!roundend_check_paused && mode.check_finished(force_ending) || force_ending) current_state = GAME_STATE_FINISHED - ooc_allowed = TRUE + GLOB.ooc_allowed = TRUE mode.declare_completion(force_ending) REDIS_PUBLISH("byond.round", "type" = "round-complete") flash_clients() @@ -135,8 +135,8 @@ SUBSYSTEM_DEF(ticker) REDIS_PUBLISH("byond.round", "type" = "round-start") for(var/client/C in GLOB.admins) - remove_verb(C, roundstart_mod_verbs) - admin_verbs_minor_event -= roundstart_mod_verbs + remove_verb(C, GLOB.roundstart_mod_verbs) + GLOB.admin_verbs_minor_event -= GLOB.roundstart_mod_verbs return TRUE @@ -173,14 +173,14 @@ SUBSYSTEM_DEF(ticker) if(!mode.can_start(bypass_checks)) to_chat(world, "Reverting to pre-game lobby.") QDEL_NULL(mode) - RoleAuthority.reset_roles() + GLOB.RoleAuthority.reset_roles() return FALSE CHECK_TICK if(!mode.pre_setup() && !bypass_checks) QDEL_NULL(mode) to_chat(world, "Error in pre-setup for [GLOB.master_mode]. Reverting to pre-game lobby.") - RoleAuthority.reset_roles() + GLOB.RoleAuthority.reset_roles() return FALSE CHECK_TICK @@ -194,7 +194,7 @@ SUBSYSTEM_DEF(ticker) if(CONFIG_GET(flag/autooocmute)) - ooc_allowed = FALSE + GLOB.ooc_allowed = FALSE round_start_time = world.time @@ -213,7 +213,7 @@ SUBSYSTEM_DEF(ticker) var/roles_to_roll = null if(length(mode.roles_to_roll)) roles_to_roll = mode.roles_to_roll - RoleAuthority.setup_candidates_and_roles(roles_to_roll) //Distribute jobs + GLOB.RoleAuthority.setup_candidates_and_roles(roles_to_roll) //Distribute jobs if(mode.flags_round_type & MODE_NEW_SPAWN) create_characters() // Create and equip characters else @@ -235,7 +235,7 @@ SUBSYSTEM_DEF(ticker) setup_economy() - shuttle_controller?.setup_shuttle_docks() + SSoldshuttle.shuttle_controller?.setup_shuttle_docks() PostSetup() return TRUE @@ -251,15 +251,15 @@ SUBSYSTEM_DEF(ticker) // Switch back to default automatically save_mode(CONFIG_GET(string/gamemode_default)) - if(round_statistics) - to_chat_spaced(world, html = FONT_SIZE_BIG(SPAN_ROLE_BODY("Welcome to [round_statistics.round_name]"))) + if(GLOB.round_statistics) + to_chat_spaced(world, html = FONT_SIZE_BIG(SPAN_ROLE_BODY("Welcome to [GLOB.round_statistics.round_name]"))) - supply_controller.process() //Start the supply shuttle regenerating points -- TLE + GLOB.supply_controller.process() //Start the supply shuttle regenerating points -- TLE for(var/i in GLOB.closet_list) //Set up special equipment for lockers and vendors, depending on gamemode var/obj/structure/closet/C = i INVOKE_ASYNC(C, TYPE_PROC_REF(/obj/structure/closet, select_gamemode_equipment), mode.type) - for(var/obj/structure/machinery/vending/V in machines) + for(var/obj/structure/machinery/vending/V in GLOB.machines) INVOKE_ASYNC(V, TYPE_PROC_REF(/obj/structure/machinery/vending, select_gamemode_equipment), mode.type) SEND_GLOBAL_SIGNAL(COMSIG_GLOB_POST_SETUP) @@ -376,7 +376,7 @@ SUBSYSTEM_DEF(ticker) world.Reboot(TRUE) /datum/controller/subsystem/ticker/proc/create_characters() - if(!RoleAuthority) + if(!GLOB.RoleAuthority) return for(var/mob/new_player/player in GLOB.player_list) @@ -386,7 +386,7 @@ SUBSYSTEM_DEF(ticker) INVOKE_ASYNC(src, PROC_REF(spawn_and_equip_char), player) /datum/controller/subsystem/ticker/proc/spawn_and_equip_char(mob/new_player/player) - var/datum/job/J = RoleAuthority.roles_for_mode[player.job] + var/datum/job/J = GLOB.RoleAuthority.roles_for_mode[player.job] if(J.job_options && player?.client?.prefs?.pref_special_job_options[J.title]) J.handle_job_options(player.client.prefs.pref_special_job_options[J.title]) if(J.handle_spawn_and_equip) @@ -424,7 +424,7 @@ SUBSYSTEM_DEF(ticker) if(player.job == JOB_CO) captainless = FALSE if(player.job) - RoleAuthority.equip_role(player, RoleAuthority.roles_by_name[player.job], late_join = FALSE) + GLOB.RoleAuthority.equip_role(player, GLOB.RoleAuthority.roles_by_name[player.job], late_join = FALSE) EquipCustomItems(player) if(player.client) var/client/C = player.client diff --git a/code/controllers/subsystem/weather.dm b/code/controllers/subsystem/weather.dm index 325c45fe2300..a3fdfe509a96 100644 --- a/code/controllers/subsystem/weather.dm +++ b/code/controllers/subsystem/weather.dm @@ -1,4 +1,4 @@ -var/list/weather_notify_objects = list() +GLOBAL_LIST_EMPTY(weather_notify_objects) SUBSYSTEM_DEF(weather) name = "Weather" @@ -46,7 +46,7 @@ SUBSYSTEM_DEF(weather) /datum/controller/subsystem/weather/proc/setup_weather_areas() weather_areas = list() - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.weather_enabled && map_holder.should_affect_area(A)) weather_areas += A diff --git a/code/datums/_atmos_setup.dm b/code/datums/_atmos_setup.dm index be4dc62faeff..3075e98ac464 100644 --- a/code/datums/_atmos_setup.dm +++ b/code/datums/_atmos_setup.dm @@ -14,18 +14,18 @@ #define PIPE_COLOR_YELLOW "#ffcc00" #define PIPE_COLOR_PURPLE "#5c1ec0" -var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE) +GLOBAL_LIST_INIT(pipe_colors, list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE)) /proc/pipe_color_lookup(color) - for(var/C in pipe_colors) - if(color == pipe_colors[C]) + for(var/C in GLOB.pipe_colors) + if(color == GLOB.pipe_colors[C]) return "[C]" /proc/pipe_color_check(color) if(!color) return 1 - for(var/C in pipe_colors) - if(color == pipe_colors[C]) + for(var/C in GLOB.pipe_colors) + if(color == GLOB.pipe_colors[C]) return 1 return 0 @@ -89,10 +89,10 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ var/image/I = image('icons/obj/pipes/pipes.dmi', icon_state = state) pipe_icons[cache_name] = I - for(var/pipe_color in pipe_colors) + for(var/pipe_color in GLOB.pipe_colors) I = image('icons/obj/pipes/pipes.dmi', icon_state = state) - I.color = pipe_colors[pipe_color] - pipe_icons[state + "[pipe_colors[pipe_color]]"] = I + I.color = GLOB.pipe_colors[pipe_color] + pipe_icons[state + "[GLOB.pipe_colors[pipe_color]]"] = I pipe = new ('icons/obj/pipes/heat.dmi') for(var/state in pipe.IconStates()) @@ -122,10 +122,10 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ if(findtext(state, "core") || findtext(state, "4way")) var/image/I = image('icons/obj/pipes/manifold.dmi', icon_state = state) manifold_icons[state] = I - for(var/pipe_color in pipe_colors) + for(var/pipe_color in GLOB.pipe_colors) I = image('icons/obj/pipes/manifold.dmi', icon_state = state) - I.color = pipe_colors[pipe_color] - manifold_icons[state + pipe_colors[pipe_color]] = I + I.color = GLOB.pipe_colors[pipe_color] + manifold_icons[state + GLOB.pipe_colors[pipe_color]] = I /datum/pipe_icon_manager/proc/gen_device_icons() if(!device_icons) @@ -170,13 +170,13 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ var/cache_name = state - for(var/D in cardinal) + for(var/D in GLOB.cardinals) var/image/I = image('icons/obj/pipes/pipe_underlays.dmi', icon_state = state, dir = D) underlays[cache_name + "[D]"] = I - for(var/pipe_color in pipe_colors) + for(var/pipe_color in GLOB.pipe_colors) I = image('icons/obj/pipes/pipe_underlays.dmi', icon_state = state, dir = D) - I.color = pipe_colors[pipe_color] - underlays[state + "[D]" + "[pipe_colors[pipe_color]]"] = I + I.color = GLOB.pipe_colors[pipe_color] + underlays[state + "[D]" + "[GLOB.pipe_colors[pipe_color]]"] = I /* Leaving the old icon manager code commented out for now, as we may want to rewrite the new code to cleanly @@ -202,7 +202,7 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ if(state == "") continue - for(var/D in cardinal) + for(var/D in GLOB.cardinals) var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D) switch(state) if("intact") diff --git a/code/datums/_ndatabase/code/interfaces/connection_settings.dm b/code/datums/_ndatabase/code/interfaces/connection_settings.dm index 4092ee712ba9..0c990b2b9cbc 100644 --- a/code/datums/_ndatabase/code/interfaces/connection_settings.dm +++ b/code/datums/_ndatabase/code/interfaces/connection_settings.dm @@ -33,5 +33,3 @@ if(!typestr) typestr = /datum/db/connection_settings/native return new typestr(config) - -var/global/datum/db/connection_settings/connection_settings diff --git a/code/datums/_ndatabase/subsystems/database_query_manager.dm b/code/datums/_ndatabase/subsystems/database_query_manager.dm index 7eef5842e2dd..596d55121920 100644 --- a/code/datums/_ndatabase/subsystems/database_query_manager.dm +++ b/code/datums/_ndatabase/subsystems/database_query_manager.dm @@ -19,8 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -var/datum/controller/subsystem/database_query_manager/SSdatabase - +GLOBAL_REAL(SSdatabase, /datum/controller/subsystem/database_query_manager) /datum/controller/subsystem/database_query_manager name = "Database QM" wait = 1 diff --git a/code/datums/_ndatabase/subsystems/entity_manager.dm b/code/datums/_ndatabase/subsystems/entity_manager.dm index 667f2a855563..833bc6926e09 100644 --- a/code/datums/_ndatabase/subsystems/entity_manager.dm +++ b/code/datums/_ndatabase/subsystems/entity_manager.dm @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -var/datum/controller/subsystem/entity_manager/SSentity_manager +GLOBAL_REAL(SSentity_manager, /datum/controller/subsystem/entity_manager) /datum/controller/subsystem/entity_manager name = "Entity Manager" diff --git a/code/datums/action.dm b/code/datums/action.dm index 47b302e09aac..0510a43415a7 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -187,8 +187,10 @@ I.ui_action_click(owner, holder_item) /datum/action/item_action/can_use_action() - if(ishuman(owner) && !owner.is_mob_incapacitated() && !owner.lying) - return TRUE + if(ishuman(owner) && !owner.is_mob_incapacitated()) + var/mob/living/carbon/human/human = owner + if(human.body_position == STANDING_UP) + return TRUE /datum/action/item_action/update_button_icon() button.overlays.Cut() diff --git a/code/datums/agents/tools/chloroform.dm b/code/datums/agents/tools/chloroform.dm index c6e3320688eb..b1c666ac9ec8 100644 --- a/code/datums/agents/tools/chloroform.dm +++ b/code/datums/agents/tools/chloroform.dm @@ -50,7 +50,6 @@ ADD_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT) ADD_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT) M.able_to_speak = FALSE - M.update_canmove() M.drop_inv_item_on_ground(M.wear_mask, force = TRUE) @@ -79,7 +78,6 @@ /obj/item/weapon/chloroform/proc/remove_stun(mob/living/M) animate(M, pixel_x = 0, pixel_y = 0, time = 0.2 SECONDS, easing = QUAD_EASING) M.anchored = FALSE - M.density = TRUE M.able_to_speak = TRUE M.layer = MOB_LAYER REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT) diff --git a/code/datums/agents/tools/tracker.dm b/code/datums/agents/tools/tracker.dm index 1d6d6d4801b4..2f3063afb78c 100644 --- a/code/datums/agents/tools/tracker.dm +++ b/code/datums/agents/tools/tracker.dm @@ -12,7 +12,7 @@ overlays.Cut() if(active && tracked_object) - overlays += icon(icon, "+tracker_arrow", get_dir(src, tracked_object)) + overlays += icon(icon, "+tracker_arrow", Get_Compass_Dir(src, tracked_object)) /obj/item/device/tracker/attack_self(mob/user) if(!skillcheckexplicit(user, SKILL_ANTAG, SKILL_ANTAG_AGENT)) @@ -48,12 +48,12 @@ return ..() /obj/item/device/tracker/proc/select_object(mob/user) - if(!LAZYLEN(objects_of_interest)) + if(!LAZYLEN(GLOB.objects_of_interest)) to_chat(user, SPAN_WARNING("There are nothing of interest to track.")) return var/list/object_choices = list() - for(var/obj/O in objects_of_interest) + for(var/obj/O in GLOB.objects_of_interest) var/z_level_to_compare_from = O.z if(istype(O.loc, /obj/structure/surface)) z_level_to_compare_from = O.loc.z diff --git a/code/datums/ammo/ammo.dm b/code/datums/ammo/ammo.dm index a858c6b1f5a7..9faaf299669d 100644 --- a/code/datums/ammo/ammo.dm +++ b/code/datums/ammo/ammo.dm @@ -138,7 +138,7 @@ /datum/ammo/proc/knockback(mob/living/living_mob, obj/projectile/fired_projectile, max_range = 2) if(!living_mob || living_mob == fired_projectile.firer) return - if(fired_projectile.distance_travelled > max_range || living_mob.lying) + if(fired_projectile.distance_travelled > max_range || living_mob.body_position == LYING_DOWN) return //Two tiles away or more, basically. if(living_mob.mob_size >= MOB_SIZE_BIG) @@ -180,8 +180,8 @@ else living_mob.apply_stamina_damage(fired_projectile.ammo.damage, fired_projectile.def_zone, ARMOR_BULLET) -/datum/ammo/proc/pushback(mob/target_mob, obj/projectile/fired_projectile, max_range = 2) - if(!target_mob || target_mob == fired_projectile.firer || fired_projectile.distance_travelled > max_range || target_mob.lying) +/datum/ammo/proc/pushback(mob/living/target_mob, obj/projectile/fired_projectile, max_range = 2) + if(!target_mob || target_mob == fired_projectile.firer || fired_projectile.distance_travelled > max_range || target_mob.body_position == LYING_DOWN) return if(target_mob.mob_size >= MOB_SIZE_BIG) diff --git a/code/datums/ammo/bullet/shotgun.dm b/code/datums/ammo/bullet/shotgun.dm index 4cedb8b3ee69..77e1e6401472 100644 --- a/code/datums/ammo/bullet/shotgun.dm +++ b/code/datums/ammo/bullet/shotgun.dm @@ -334,7 +334,7 @@ if(P.distance_travelled > 8) knockback(M, P, 12) - else if(!M || M == P.firer || M.lying) //These checks are included in knockback and would be redundant above. + else if(!M || M == P.firer || M.body_position == LYING_DOWN) //These checks are included in knockback and would be redundant above. return shake_camera(M, 3, 4) diff --git a/code/datums/ammo/misc.dm b/code/datums/ammo/misc.dm index bdb284753dc4..1d04692c0360 100644 --- a/code/datums/ammo/misc.dm +++ b/code/datums/ammo/misc.dm @@ -190,7 +190,7 @@ if(P.contents.len == 1) for(var/obj/item/reagent_container/food/drinks/cans/souto/S in P.contents) M.put_in_active_hand(S) - for(var/mob/O in viewers(world_view_size, P)) //find all people in view. + for(var/mob/O in viewers(GLOB.world_view_size, P)) //find all people in view. O.show_message(SPAN_DANGER("[M] catches the [S]!"), SHOW_MESSAGE_VISIBLE) //Tell them the can was caught. return //Can was caught. if(ishuman(M)) diff --git a/code/datums/ammo/xeno.dm b/code/datums/ammo/xeno.dm index 75c78298fe4f..9ecc9ebf9321 100644 --- a/code/datums/ammo/xeno.dm +++ b/code/datums/ammo/xeno.dm @@ -49,9 +49,9 @@ if(!isxeno(M)) if(insta_neuro) - if(M.knocked_down < 3) + if(M.GetKnockDownValueNotADurationDoNotUse() < 3) // If they have less than somewhere random between 4 and 6 seconds KD left and assuming it doesnt get refreshed itnernally M.adjust_effect(1 * power, WEAKEN) - return + return if(ishuman(M)) M.apply_effect(2.5, SUPERSLOW) @@ -65,7 +65,7 @@ no_clothes_neuro = TRUE if(no_clothes_neuro) - if(M.knocked_down < 5) + if(M.GetKnockDownValueNotADurationDoNotUse() < 5) // If they have less than somewhere random between 8 and 10 seconds KD left and assuming it doesnt get refreshed itnernally M.adjust_effect(1 * power, WEAKEN) // KD them a bit more M.visible_message(SPAN_DANGER("[M] falls prone.")) @@ -79,7 +79,7 @@ H.visible_message(SPAN_DANGER("[M] shrugs off the neurotoxin!")) return - if(M.knocked_down < 0.7) // apply knockdown only if current knockdown is less than 0.7 second + if(M.GetKnockDownValueNotADurationDoNotUse() < 0.7) // basically (knocked_down && prob(90)) M.apply_effect(0.7, WEAKEN) M.visible_message(SPAN_DANGER("[M] falls prone.")) diff --git a/code/datums/autocells/auto_cell.dm b/code/datums/autocells/auto_cell.dm index accc5f180119..fb679c56676e 100644 --- a/code/datums/autocells/auto_cell.dm +++ b/code/datums/autocells/auto_cell.dm @@ -37,7 +37,7 @@ in_turf = T LAZYADD(in_turf.autocells, src) - cellauto_cells += src + GLOB.cellauto_cells += src birth() @@ -48,7 +48,7 @@ LAZYREMOVE(in_turf.autocells, src) in_turf = null - cellauto_cells -= src + GLOB.cellauto_cells -= src death() @@ -88,7 +88,7 @@ // Get cardinal neighbors if(neighbor_type & NEIGHBORS_CARDINAL) - for(var/dir in cardinal) + for(var/dir in GLOB.cardinals) var/turf/T = get_step(in_turf, dir) if(QDELETED(T)) continue @@ -100,7 +100,7 @@ // Get ordinal/diagonal neighbors if(neighbor_type & NEIGHBORS_ORDINAL) - for(var/dir in diagonals) + for(var/dir in GLOB.diagonals) var/turf/T = get_step(in_turf, dir) if(QDELETED(T)) continue diff --git a/code/datums/autocells/explosion.dm b/code/datums/autocells/explosion.dm index 42e1409d595f..970e5618bae3 100644 --- a/code/datums/autocells/explosion.dm +++ b/code/datums/autocells/explosion.dm @@ -109,7 +109,7 @@ survivor.power += dying.power // Two waves travling towards each other weakens the explosion - if(survivor.direction == reverse_dir[dying.direction]) + if(survivor.direction == GLOB.reverse_dir[dying.direction]) survivor.power -= dying.power return is_stronger @@ -120,11 +120,11 @@ // If the cell is the epicenter, propagate in all directions if(isnull(direction)) - return alldirs + return GLOB.alldirs - var/dir = reflected ? reverse_dir[direction] : direction + var/dir = reflected ? GLOB.reverse_dir[direction] : direction - if(dir in cardinal) + if(dir in GLOB.cardinals) propagation_dirs += list(dir, turn(dir, 45), turn(dir, -45)) else propagation_dirs += dir @@ -180,7 +180,7 @@ for(var/dir in to_spread) // Diagonals are longer, that should be reflected in the power falloff var/dir_falloff = 1 - if(dir in diagonals) + if(dir in GLOB.diagonals) dir_falloff = 1.414 if(isnull(direction)) @@ -210,7 +210,7 @@ // Set the direction the explosion is traveling in E.direction = dir //Diagonal cells have a small delay when branching off the center. This helps the explosion look circular - if(!direction && (dir in diagonals)) + if(!direction && (dir in GLOB.diagonals)) E.delay = 1 setup_new_cell(E) diff --git a/code/datums/autocells/vomit_wave.dm b/code/datums/autocells/vomit_wave.dm index 62ea1d4c6e7e..396bf6d3e528 100644 --- a/code/datums/autocells/vomit_wave.dm +++ b/code/datums/autocells/vomit_wave.dm @@ -37,7 +37,7 @@ return // Propagate to cardinal directions - var/list/to_spread = cardinal.Copy() + var/list/to_spread = GLOB.cardinals.Copy() for(var/datum/automata_cell/vomit_wave/C in neighbors) to_spread -= get_dir(in_turf, C.in_turf) diff --git a/code/datums/components/footstep.dm b/code/datums/components/footstep.dm index ef77aaf471dc..6eaaa6e76af5 100644 --- a/code/datums/components/footstep.dm +++ b/code/datums/components/footstep.dm @@ -47,7 +47,7 @@ if(!T) return var/mob/living/parent_mob = parent - if(parent_mob.lying && (isfile(drag_sounds) || istext(drag_sounds))) + if(parent_mob.body_position == LYING_DOWN && (isfile(drag_sounds) || istext(drag_sounds))) playsound(T, drag_sounds, volume, rand(20000, 25000), range, falloff = falloff) else if(isfile(footstep_sounds) || istext(footstep_sounds)) playsound(T, footstep_sounds, volume, rand(20000, 25000), range, falloff = falloff) diff --git a/code/datums/components/weed_food.dm b/code/datums/components/weed_food.dm index 16be8665f55b..648478aa6140 100644 --- a/code/datums/components/weed_food.dm +++ b/code/datums/components/weed_food.dm @@ -260,6 +260,7 @@ merged = TRUE ADD_TRAIT(parent_mob, TRAIT_UNDENSE, XENO_WEED_TRAIT) + ADD_TRAIT(parent_mob, TRAIT_MERGED_WITH_WEEDS, XENO_WEED_TRAIT) parent_mob.anchored = TRUE parent_mob.mouse_opacity = MOUSE_OPACITY_TRANSPARENT parent_mob.plane = FLOOR_PLANE @@ -288,6 +289,7 @@ UnregisterSignal(absorbing_weeds, COMSIG_PARENT_QDELETING) absorbing_weeds = null + REMOVE_TRAIT(parent_mob, TRAIT_MERGED_WITH_WEEDS, XENO_WEED_TRAIT) parent_mob.anchored = FALSE parent_mob.mouse_opacity = MOUSE_OPACITY_ICON parent_mob.plane = GAME_PLANE diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 213a959296fb..02cbc5b2d019 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -8,16 +8,16 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) var/locked[] = list() /datum/datacore/proc/get_manifest(monochrome, OOC, nonHTML) - var/list/cic = ROLES_CIC.Copy() - var/list/auxil = ROLES_AUXIL_SUPPORT.Copy() - var/list/misc = ROLES_MISC.Copy() - var/list/mp = ROLES_POLICE.Copy() - var/list/eng = ROLES_ENGINEERING.Copy() - var/list/req = ROLES_REQUISITION.Copy() - var/list/med = ROLES_MEDICAL.Copy() - var/list/marines_by_squad = ROLES_SQUAD_ALL.Copy() + var/list/cic = GLOB.ROLES_CIC.Copy() + var/list/auxil = GLOB.ROLES_AUXIL_SUPPORT.Copy() + var/list/misc = GLOB.ROLES_MISC.Copy() + var/list/mp = GLOB.ROLES_POLICE.Copy() + var/list/eng = GLOB.ROLES_ENGINEERING.Copy() + var/list/req = GLOB.ROLES_REQUISITION.Copy() + var/list/med = GLOB.ROLES_MEDICAL.Copy() + var/list/marines_by_squad = GLOB.ROLES_SQUAD_ALL.Copy() for(var/squad_name in marines_by_squad) - marines_by_squad[squad_name] = ROLES_MARINES.Copy() + marines_by_squad[squad_name] = GLOB.ROLES_MARINES.Copy() var/list/isactive = new() // If we need not the HTML table, but list @@ -43,7 +43,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) var/has_department = FALSE for(var/department in departments) // STOP SIGNING ALL MARINES IN ALPHA! - if(department in ROLES_SQUAD_ALL) + if(department in GLOB.ROLES_SQUAD_ALL) if(squad != department) continue var/list/jobs = departments[department] @@ -83,7 +83,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) // sort mobs var/dept_flags = NO_FLAGS //Is there anybody in the department?. - var/list/squad_sublists = ROLES_SQUAD_ALL.Copy() //Are there any marines in the squad? + var/list/squad_sublists = GLOB.ROLES_SQUAD_ALL.Copy() //Are there any marines in the squad? for(var/datum/data/record/t in GLOB.data_core.general) if(t.fields["mob_faction"] != FACTION_MARINE) //we process only USCM humans @@ -107,34 +107,34 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) isactive[name] = t.fields["p_stat"] //cael - to prevent multiple appearances of a player/job combination, add a continue after each line - if(real_rank in ROLES_CIC) + if(real_rank in GLOB.ROLES_CIC) dept_flags |= FLAG_SHOW_CIC LAZYSET(cic[real_rank], name, rank) - else if(real_rank in ROLES_AUXIL_SUPPORT) + else if(real_rank in GLOB.ROLES_AUXIL_SUPPORT) dept_flags |= FLAG_SHOW_AUXIL_SUPPORT LAZYSET(auxil[real_rank], name, rank) - else if(real_rank in ROLES_MISC) + else if(real_rank in GLOB.ROLES_MISC) dept_flags |= FLAG_SHOW_MISC LAZYSET(misc[real_rank], name, rank) - else if(real_rank in ROLES_POLICE) + else if(real_rank in GLOB.ROLES_POLICE) dept_flags |= FLAG_SHOW_POLICE LAZYSET(mp[real_rank], name, rank) - else if(real_rank in ROLES_ENGINEERING) + else if(real_rank in GLOB.ROLES_ENGINEERING) dept_flags |= FLAG_SHOW_ENGINEERING LAZYSET(eng[real_rank], name, rank) - else if(real_rank in ROLES_REQUISITION) + else if(real_rank in GLOB.ROLES_REQUISITION) dept_flags |= FLAG_SHOW_REQUISITION LAZYSET(req[real_rank], name, rank) - else if(real_rank in ROLES_MEDICAL) + else if(real_rank in GLOB.ROLES_MEDICAL) dept_flags |= FLAG_SHOW_MEDICAL LAZYSET(med[real_rank], name, rank) - else if(real_rank in ROLES_MARINES) + else if(real_rank in GLOB.ROLES_MARINES) if(isnull(squad_name)) continue dept_flags |= FLAG_SHOW_MARINES squad_sublists[squad_name] = TRUE ///If it is a real squad in the USCM squad list to prevent the crew manifest from breaking - if(!(squad_name in ROLES_SQUAD_ALL)) + if(!(squad_name in GLOB.ROLES_SQUAD_ALL)) continue LAZYSET(marines_by_squad[squad_name][real_rank], name, rank) @@ -155,7 +155,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) even = !even if(dept_flags & FLAG_SHOW_MARINES) dat += "Marines" - for(var/squad_name in ROLES_SQUAD_ALL) + for(var/squad_name in GLOB.ROLES_SQUAD_ALL) if(!squad_sublists[squad_name]) continue dat += "[squad_name]" @@ -205,7 +205,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) if(!nosleep) sleep(40) - var/list/jobs_to_check = ROLES_CIC + ROLES_AUXIL_SUPPORT + ROLES_MISC + ROLES_POLICE + ROLES_ENGINEERING + ROLES_REQUISITION + ROLES_MEDICAL + ROLES_MARINES + var/list/jobs_to_check = GLOB.ROLES_CIC + GLOB.ROLES_AUXIL_SUPPORT + GLOB.ROLES_MISC + GLOB.ROLES_POLICE + GLOB.ROLES_ENGINEERING + GLOB.ROLES_REQUISITION + GLOB.ROLES_MEDICAL + GLOB.ROLES_MARINES for(var/mob/living/carbon/human/H in GLOB.human_mob_list) if(is_admin_level(H.z)) continue diff --git a/code/datums/disease.dm b/code/datums/disease.dm index d2f466ebeb39..024337c8e065 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -7,7 +7,7 @@ to null does not delete the object itself. Thank you. */ -var/list/diseases = typesof(/datum/disease) - /datum/disease +GLOBAL_LIST_INIT(diseases, typesof(/datum/disease) - /datum/disease) /datum/disease diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index ad4703ba65fe..d933b81eb620 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -9,15 +9,15 @@ #define RANDOM_STARTING_LEVEL 2 -var/list/archive_diseases = list() +GLOBAL_LIST_EMPTY(archive_diseases) // The order goes from easy to cure to hard to cure. -var/list/advance_cures = list( +GLOBAL_LIST_INIT(advance_cures, list( "nutriment", "sugar", "orangejuice", "spaceacillin", "kelotane", "ethanol", "leporazine", "lipozine", "silver", "gold", "phoron" - ) + )) /* @@ -50,10 +50,10 @@ var/list/advance_cures = list( /datum/disease/advance/New(process = 1, datum/disease/advance/D) // Setup our dictionary if it hasn't already. - if(!dictionary_symptoms.len) - for(var/symp in list_symptoms) + if(!GLOB.dictionary_symptoms.len) + for(var/symp in GLOB.list_symptoms) var/datum/symptom/S = new symp - dictionary_symptoms[S.id] = symp + GLOB.dictionary_symptoms[S.id] = symp if(!istype(D)) D = null @@ -142,7 +142,7 @@ var/list/advance_cures = list( // Generate symptoms. By default, we only choose non-deadly symptoms. var/list/possible_symptoms = list() - for(var/symp in list_symptoms) + for(var/symp in GLOB.list_symptoms) var/datum/symptom/S = new symp if(S.level <= type_level_limit) if(!HasSymptom(S)) @@ -170,13 +170,13 @@ var/list/advance_cures = list( var/list/properties = GenerateProperties() AssignProperties(properties) - if(!archive_diseases[GetDiseaseID()]) + if(!GLOB.archive_diseases[GetDiseaseID()]) if(new_name) AssignName() - archive_diseases[GetDiseaseID()] = src // So we don't infinite loop - archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1) + GLOB.archive_diseases[GetDiseaseID()] = src // So we don't infinite loop + GLOB.archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1) - var/datum/disease/advance/A = archive_diseases[GetDiseaseID()] + var/datum/disease/advance/A = GLOB.archive_diseases[GetDiseaseID()] AssignName(A.name) //Generate disease properties based on the effects. Returns an associated list. @@ -254,11 +254,11 @@ var/list/advance_cures = list( // Will generate a random cure, the less resistance the symptoms have, the harder the cure. /datum/disease/advance/proc/GenerateCure(list/properties = list()) if(properties && properties.len) - var/res = Clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len) - cure_id = advance_cures[res] + var/res = Clamp(properties["resistance"] - (symptoms.len / 2), 1, GLOB.advance_cures.len) + cure_id = GLOB.advance_cures[res] // Get the cure name from the cure_id - var/datum/reagent/D = chemical_reagents_list[cure_id] + var/datum/reagent/D = GLOB.chemical_reagents_list[cure_id] cure = D.name @@ -373,7 +373,7 @@ var/list/advance_cures = list( var/list/symptoms = list() symptoms += "Done" - symptoms += list_symptoms.Copy() + symptoms += GLOB.list_symptoms.Copy() do var/symptom = tgui_input_list(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom", symptoms) if(istext(symptom)) diff --git a/code/datums/diseases/advance/symptoms/symptoms.dm b/code/datums/diseases/advance/symptoms/symptoms.dm index 72a132cf517e..7746a03b4f89 100644 --- a/code/datums/diseases/advance/symptoms/symptoms.dm +++ b/code/datums/diseases/advance/symptoms/symptoms.dm @@ -1,9 +1,7 @@ // Symptoms are the effects that engineered advanced diseases do. -var/list/list_symptoms = typesof(/datum/symptom) - /datum/symptom -var/list/dictionary_symptoms = list() - -var/global/const/SYMPTOM_ACTIVATION_PROB = 3 +GLOBAL_LIST_INIT(list_symptoms, typesof(/datum/symptom) - /datum/symptom) +GLOBAL_LIST_EMPTY(dictionary_symptoms) /datum/symptom // Buffs/Debuffs the symptom has to the overall engineered disease. @@ -18,7 +16,7 @@ var/global/const/SYMPTOM_ACTIVATION_PROB = 3 var/id = "" /datum/symptom/New() - var/list/S = list_symptoms + var/list/S = GLOB.list_symptoms for(var/i = 1; i <= S.len; i++) if(src.type == S[i]) id = "[i]" diff --git a/code/datums/diseases/advance/symptoms/voice_change.dm b/code/datums/diseases/advance/symptoms/voice_change.dm index 7547242473db..e5af4a8eaab4 100644 --- a/code/datums/diseases/advance/symptoms/voice_change.dm +++ b/code/datums/diseases/advance/symptoms/voice_change.dm @@ -38,10 +38,10 @@ Bonus var/random_name = "" switch(H.gender) if(MALE) - random_name = pick(first_names_male) + random_name = pick(GLOB.first_names_male) else - random_name = pick(first_names_female) - random_name += " [pick(last_names)]" + random_name = pick(GLOB.first_names_female) + random_name += " [pick(GLOB.last_names)]" H.SetSpecialVoice(random_name) return diff --git a/code/datums/diseases/cold.dm b/code/datums/diseases/cold.dm index 46cd8952dda1..fd3fbc3a7d2d 100644 --- a/code/datums/diseases/cold.dm +++ b/code/datums/diseases/cold.dm @@ -20,7 +20,7 @@ cure() return */ - if(affected_mob.lying && prob(40)) //changed FROM prob(10) until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(40)) //changed FROM prob(10) until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) cure() return @@ -43,7 +43,7 @@ cure() return */ - if(affected_mob.lying && prob(25)) //changed FROM prob(5) until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(25)) //changed FROM prob(5) until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) cure() return diff --git a/code/datums/diseases/flu.dm b/code/datums/diseases/flu.dm index f2c029587616..fad0b15228b1 100644 --- a/code/datums/diseases/flu.dm +++ b/code/datums/diseases/flu.dm @@ -21,7 +21,7 @@ stage-- return */ - if(affected_mob.lying && prob(20)) //added until sleeping is fixed --Blaank + if(affected_mob.body_position == LYING_DOWN && prob(20)) //added until sleeping is fixed --Blaank to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) stage-- return @@ -46,7 +46,7 @@ stage-- return */ - if(affected_mob.lying && prob(15)) //added until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(15)) //added until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) stage-- return diff --git a/code/datums/effects/tether.dm b/code/datums/effects/tether.dm index ddaafff46489..1667d901a08a 100644 --- a/code/datums/effects/tether.dm +++ b/code/datums/effects/tether.dm @@ -52,7 +52,7 @@ var/turf/T var/dir_away = get_dir(affected_atom, A) - for (var/dir in alldirs) + for (var/dir in GLOB.alldirs) if (dir & dir_away) continue T = get_step(A, dir) diff --git a/code/datums/effects/xeno_strains/boiler_trap.dm b/code/datums/effects/xeno_strains/boiler_trap.dm index 1833b9641a9a..199505379b27 100644 --- a/code/datums/effects/xeno_strains/boiler_trap.dm +++ b/code/datums/effects/xeno_strains/boiler_trap.dm @@ -5,16 +5,16 @@ duration = null flags = INF_DURATION -/datum/effects/boiler_trap/New(atom/A, mob/from, last_dmg_source, zone) +/datum/effects/boiler_trap/New(atom/A, mob/living/from, last_dmg_source, zone) . = ..() if(!QDELETED(src)) - var/mob/M = affected_atom - ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + ADD_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) /datum/effects/boiler_trap/Destroy(force) if(ismob(affected_atom)) - var/mob/M = affected_atom - REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + REMOVE_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) return ..() /datum/effects/boiler_trap/validate_atom(atom/A) @@ -26,6 +26,6 @@ /datum/effects/boiler_trap/process_mob() . = ..() if(!.) return FALSE - var/mob/M = affected_atom - ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + ADD_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) return TRUE diff --git a/code/datums/elements/bullet_trait/incendiary.dm b/code/datums/elements/bullet_trait/incendiary.dm index 2d5d0a15f368..861e67651a53 100644 --- a/code/datums/elements/bullet_trait/incendiary.dm +++ b/code/datums/elements/bullet_trait/incendiary.dm @@ -13,7 +13,7 @@ if(ispath(reagent)) var/datum/reagent/R = reagent - burn_reagent = chemical_reagents_list[initial(R.id)] + burn_reagent = GLOB.chemical_reagents_list[initial(R.id)] else burn_reagent = reagent burn_stacks = stacks diff --git a/code/datums/elements/mouth_drop_item.dm b/code/datums/elements/mouth_drop_item.dm index 42c61bd275cc..7a546c6b3933 100644 --- a/code/datums/elements/mouth_drop_item.dm +++ b/code/datums/elements/mouth_drop_item.dm @@ -19,9 +19,9 @@ SIGNAL_HANDLER if(slot == WEAR_FACE) - I.RegisterSignal(user, COMSIG_MOB_KNOCKED_DOWN, TYPE_PROC_REF(/obj/item, drop_to_floor)) + I.RegisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION, TYPE_PROC_REF(/obj/item, drop_to_floor)) /datum/element/mouth_drop_item/proc/item_dropped(obj/item/I, mob/living/carbon/human/user) SIGNAL_HANDLER - I.UnregisterSignal(user, COMSIG_MOB_KNOCKED_DOWN) + I.UnregisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION) diff --git a/code/datums/emergency_calls/cbrn.dm b/code/datums/emergency_calls/cbrn.dm index 3a6b1c640632..cee96e10137e 100644 --- a/code/datums/emergency_calls/cbrn.dm +++ b/code/datums/emergency_calls/cbrn.dm @@ -55,7 +55,7 @@ max_medics = 0 /datum/emergency_call/cbrn/specialists/New() - var/cbrn_ship_name = "Unit [pick(nato_phonetic_alphabet)]-[rand(1, 99)]" + var/cbrn_ship_name = "Unit [pick(GLOB.nato_phonetic_alphabet)]-[rand(1, 99)]" arrival_message = "[MAIN_SHIP_NAME], CBRN [cbrn_ship_name] has been dispatched. Follow all orders provided by [cbrn_ship_name]." objectives = "You are a specialist team in [cbrn_ship_name] dispatched to quell a threat to [MAIN_SHIP_NAME]. Further orders may be provided." diff --git a/code/datums/emergency_calls/clf.dm b/code/datums/emergency_calls/clf.dm index 0a5f09e2a2f2..837ecb340dda 100644 --- a/code/datums/emergency_calls/clf.dm +++ b/code/datums/emergency_calls/clf.dm @@ -28,7 +28,7 @@ to_chat(H, SPAN_BOLD("The Dust Raiders responded with deadly force, scattering many of the colonists who attempted to fight their occupation.")) to_chat(H, SPAN_BOLD("The Dust Raiders and their flagship, the USS Alistoun eventually withdrew from the sector by the end of the year.")) to_chat(H, SPAN_BOLD("With the Neroid Sector existing in relative isolation from United America oversight for the last five years, many colonists have considered themselves free from governmental rule.")) - to_chat(H, SPAN_BOLD("The year is now [game_year].")) + to_chat(H, SPAN_BOLD("The year is now [GLOB.game_year].")) to_chat(H, SPAN_BOLD("The arrival of the USCM Battalion, the Falling Falcons, and their flagship, the [MAIN_SHIP_NAME], have reaffirmed that the United Americas considers the Neroid Sector part of their holdings.")) to_chat(H, SPAN_BOLD("It is up to you and your fellow colonists to make them realize their trespasses. This sector is no longer theirs.")) @@ -45,7 +45,7 @@ leader = H to_chat(H, SPAN_ROLE_HEADER("You are a Cell Leader of the local resistance group, the Colonial Liberation Front!")) arm_equipment(H, /datum/equipment_preset/clf/leader, TRUE, TRUE) - else if(synths < max_synths && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SYNTH) && RoleAuthority.roles_whitelist[H.ckey] & WHITELIST_SYNTHETIC) + else if(synths < max_synths && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SYNTH) && GLOB.RoleAuthority.roles_whitelist[H.ckey] & WHITELIST_SYNTHETIC) synths++ to_chat(H, SPAN_ROLE_HEADER("You are a Multi-Purpose Synthetic for the local resistance group, the Colonial Liberation Front!")) arm_equipment(H, /datum/equipment_preset/clf/synth, TRUE, TRUE) diff --git a/code/datums/emergency_calls/cmb.dm b/code/datums/emergency_calls/cmb.dm index a49c0a4ce273..5dba3ee8fc7d 100644 --- a/code/datums/emergency_calls/cmb.dm +++ b/code/datums/emergency_calls/cmb.dm @@ -35,7 +35,7 @@ leader = mob to_chat(mob, SPAN_ROLE_HEADER("You are the Colonial Marshal!")) arm_equipment(mob, /datum/equipment_preset/cmb/leader, TRUE, TRUE) - else if(synths < max_synths && HAS_FLAG(mob?.client.prefs.toggles_ert, PLAY_SYNTH) && RoleAuthority.roles_whitelist[mob.ckey] & WHITELIST_SYNTHETIC) + else if(synths < max_synths && HAS_FLAG(mob?.client.prefs.toggles_ert, PLAY_SYNTH) && GLOB.RoleAuthority.roles_whitelist[mob.ckey] & WHITELIST_SYNTHETIC) synths++ to_chat(mob, SPAN_ROLE_HEADER("You are a CMB Investigative Synthetic!")) arm_equipment(mob, /datum/equipment_preset/cmb/synth, TRUE, TRUE) diff --git a/code/datums/emergency_calls/contractor.dm b/code/datums/emergency_calls/contractor.dm index a5d6c2d7e80f..0e0c975f0d13 100644 --- a/code/datums/emergency_calls/contractor.dm +++ b/code/datums/emergency_calls/contractor.dm @@ -29,7 +29,7 @@ leader = mob to_chat(mob, SPAN_ROLE_HEADER("You are a Contractor Team Leader of Vanguard's Arrow Incorporated!")) arm_equipment(mob, /datum/equipment_preset/contractor/duty/leader, TRUE, TRUE) - else if(synths < max_synths && HAS_FLAG(mob.client.prefs.toggles_ert, PLAY_SYNTH) && RoleAuthority.roles_whitelist[mob.ckey] & WHITELIST_SYNTHETIC) + else if(synths < max_synths && HAS_FLAG(mob.client.prefs.toggles_ert, PLAY_SYNTH) && GLOB.RoleAuthority.roles_whitelist[mob.ckey] & WHITELIST_SYNTHETIC) synths++ to_chat(mob, SPAN_ROLE_HEADER("You are a Contractor Support Synthetic of Vanguard's Arrow Incorporated!")) arm_equipment(mob, /datum/equipment_preset/contractor/duty/synth, TRUE, TRUE) @@ -117,13 +117,13 @@ var/mob/living/carbon/human/H = new(spawn_loc) H.key = M.key if(H.client) - H.client.change_view(world_view_size) + H.client.change_view(GLOB.world_view_size) if(!leader && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job)) //First one spawned is always the leader. leader = H to_chat(H, SPAN_ROLE_HEADER("You are a Covert Contractor Team Leader of Vanguard's Arrow Incorporated!")) arm_equipment(H, /datum/equipment_preset/contractor/covert/leader, TRUE, TRUE) - else if(synths < max_synths && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SYNTH) && RoleAuthority.roles_whitelist[H.ckey] & WHITELIST_SYNTHETIC) + else if(synths < max_synths && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SYNTH) && GLOB.RoleAuthority.roles_whitelist[H.ckey] & WHITELIST_SYNTHETIC) synths++ to_chat(H, SPAN_ROLE_HEADER("You are a Contractor Support Synthetic of Vanguard's Arrow Incorporated!")) arm_equipment(H, /datum/equipment_preset/contractor/covert/synth, TRUE, TRUE) diff --git a/code/datums/emergency_calls/cryo_marines.dm b/code/datums/emergency_calls/cryo_marines.dm index 19f73a9843ce..4e997292f74d 100644 --- a/code/datums/emergency_calls/cryo_marines.dm +++ b/code/datums/emergency_calls/cryo_marines.dm @@ -14,7 +14,7 @@ spawn_max_amount = TRUE /datum/emergency_call/cryo_squad/spawn_candidates(quiet_launch, announce_incoming, override_spawn_loc) - var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo] + var/datum/squad/marine/cryo/cryo_squad = GLOB.RoleAuthority.squads_by_type[/datum/squad/marine/cryo] leaders = cryo_squad.num_leaders . = ..() shipwide_ai_announcement("Successfully deployed [mob_max] Foxtrot marines, of which [length(members)] are ready for duty.") @@ -43,7 +43,7 @@ break sleep(5) - var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo] + var/datum/squad/marine/cryo/cryo_squad = GLOB.RoleAuthority.squads_by_type[/datum/squad/marine/cryo] if(leaders < cryo_squad.max_leaders && (!mind || (HAS_FLAG(human.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(human.client, JOB_SQUAD_LEADER, time_required_for_job)))) leader = human leaders++ diff --git a/code/datums/emergency_calls/cryo_marines_heavy.dm b/code/datums/emergency_calls/cryo_marines_heavy.dm index f4fe3c9f2a57..2081d9564c50 100644 --- a/code/datums/emergency_calls/cryo_marines_heavy.dm +++ b/code/datums/emergency_calls/cryo_marines_heavy.dm @@ -17,7 +17,7 @@ var/leaders = 0 /datum/emergency_call/cryo_squad_equipped/spawn_candidates(quiet_launch, announce_incoming, override_spawn_loc) - var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo] + var/datum/squad/marine/cryo/cryo_squad = GLOB.RoleAuthority.squads_by_type[/datum/squad/marine/cryo] leaders = cryo_squad.num_leaders . = ..() if(length(members)) @@ -35,7 +35,7 @@ M.transfer_to(H, TRUE) sleep(5) - var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo] + var/datum/squad/marine/cryo/cryo_squad = GLOB.RoleAuthority.squads_by_type[/datum/squad/marine/cryo] if(leaders < cryo_squad.max_leaders && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job)) leader = H leaders++ diff --git a/code/datums/emergency_calls/inspection.dm b/code/datums/emergency_calls/inspection.dm index ad0200339952..2cd121093ea4 100644 --- a/code/datums/emergency_calls/inspection.dm +++ b/code/datums/emergency_calls/inspection.dm @@ -202,7 +202,7 @@ leader = mob to_chat(mob, SPAN_ROLE_HEADER("You are the Colonial Marshal!")) arm_equipment(mob, /datum/equipment_preset/cmb/leader, TRUE, TRUE) - else if(synths < max_synths && HAS_FLAG(mob?.client.prefs.toggles_ert, PLAY_SYNTH) && RoleAuthority.roles_whitelist[mob.ckey] & WHITELIST_SYNTHETIC) + else if(synths < max_synths && HAS_FLAG(mob?.client.prefs.toggles_ert, PLAY_SYNTH) && GLOB.RoleAuthority.roles_whitelist[mob.ckey] & WHITELIST_SYNTHETIC) synths++ to_chat(mob, SPAN_ROLE_HEADER("You are a CMB Investigative Synthetic!")) arm_equipment(mob, /datum/equipment_preset/cmb/synth, TRUE, TRUE) diff --git a/code/datums/emergency_calls/mercs.dm b/code/datums/emergency_calls/mercs.dm index 40210c845c6f..67e09e8992f0 100644 --- a/code/datums/emergency_calls/mercs.dm +++ b/code/datums/emergency_calls/mercs.dm @@ -11,7 +11,7 @@ /datum/emergency_call/mercs/New() . = ..() hostility = pick(75;FALSE,25;TRUE) - arrival_message = "[MAIN_SHIP_NAME], this is Freelancer shuttle [pick(alphabet_lowercase)][pick(alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." + arrival_message = "[MAIN_SHIP_NAME], this is Freelancer shuttle [pick(GLOB.alphabet_lowercase)][pick(GLOB.alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." if(hostility) objectives = "Ransack the [MAIN_SHIP_NAME] and kill anyone who gets in your way. Do what your Captain says. Ensure your survival at all costs." else @@ -25,7 +25,7 @@ /datum/emergency_call/mercs/friendly/New() . = ..() hostility = FALSE - arrival_message = "[MAIN_SHIP_NAME], this is Freelancer shuttle [pick(alphabet_lowercase)][pick(alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." + arrival_message = "[MAIN_SHIP_NAME], this is Freelancer shuttle [pick(GLOB.alphabet_lowercase)][pick(GLOB.alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." objectives = "Help the crew of the [MAIN_SHIP_NAME] in exchange for payment, and choose your payment well. Do what your Captain says. Ensure your survival at all costs." /datum/emergency_call/mercs/hostile //ditto @@ -36,7 +36,7 @@ /datum/emergency_call/mercs/hostile/New() . = ..() hostility = TRUE - arrival_message = "[MAIN_SHIP_NAME], this is Freelancer shuttle [pick(alphabet_lowercase)][pick(alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." + arrival_message = "[MAIN_SHIP_NAME], this is Freelancer shuttle [pick(GLOB.alphabet_lowercase)][pick(GLOB.alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." objectives = "Ransack the [MAIN_SHIP_NAME] and kill anyone who gets in your way. Do what your Captain says. Ensure your survival at all costs." /datum/emergency_call/mercs/print_backstory(mob/living/carbon/human/H) @@ -96,7 +96,7 @@ /datum/emergency_call/heavy_mercs/New() . = ..() hostility = pick(75;FALSE,25;TRUE) - arrival_message = "[MAIN_SHIP_NAME], this is Elite Freelancer shuttle [pick(alphabet_lowercase)][pick(alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." + arrival_message = "[MAIN_SHIP_NAME], this is Elite Freelancer shuttle [pick(GLOB.alphabet_lowercase)][pick(GLOB.alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." if(hostility) objectives = "Ransack the [MAIN_SHIP_NAME] and kill anyone who gets in your way. Do what your Captain says. Ensure your survival at all costs." else @@ -108,7 +108,7 @@ /datum/emergency_call/heavy_mercs/hostile/New() . = ..() hostility = TRUE - arrival_message = "[MAIN_SHIP_NAME], this is Elite Freelancer shuttle [pick(alphabet_lowercase)][pick(alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." + arrival_message = "[MAIN_SHIP_NAME], this is Elite Freelancer shuttle [pick(GLOB.alphabet_lowercase)][pick(GLOB.alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." objectives = "Ransack the [MAIN_SHIP_NAME] and kill anyone who gets in your way. Do what your Captain says. Ensure your survival at all costs." /datum/emergency_call/heavy_mercs/friendly @@ -117,7 +117,7 @@ /datum/emergency_call/heavy_mercs/friendly/New() . = ..() hostility = FALSE - arrival_message = "[MAIN_SHIP_NAME], this is Elite Freelancer shuttle [pick(alphabet_lowercase)][pick(alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." + arrival_message = "[MAIN_SHIP_NAME], this is Elite Freelancer shuttle [pick(GLOB.alphabet_lowercase)][pick(GLOB.alphabet_lowercase)]-[rand(1, 99)] responding to your distress call. Prepare for boarding." objectives = "Help the crew of the [MAIN_SHIP_NAME] in exchange for payment, and choose your payment well. Do what your Captain says. Ensure your survival at all costs." /datum/emergency_call/heavy_mercs/print_backstory(mob/living/carbon/human/H) diff --git a/code/datums/emergency_calls/pmc.dm b/code/datums/emergency_calls/pmc.dm index a06b0cc0c02e..2d21dc768f4a 100644 --- a/code/datums/emergency_calls/pmc.dm +++ b/code/datums/emergency_calls/pmc.dm @@ -34,7 +34,7 @@ leader = mob to_chat(mob, SPAN_ROLE_HEADER("You are a Weyland-Yutani PMC Squad Leader!")) arm_equipment(mob, /datum/equipment_preset/pmc/pmc_leader, TRUE, TRUE) - else if(synths < max_synths && HAS_FLAG(mob.client.prefs.toggles_ert, PLAY_SYNTH) && RoleAuthority.roles_whitelist[mob.ckey] & WHITELIST_SYNTHETIC) + else if(synths < max_synths && HAS_FLAG(mob.client.prefs.toggles_ert, PLAY_SYNTH) && GLOB.RoleAuthority.roles_whitelist[mob.ckey] & WHITELIST_SYNTHETIC) synths++ to_chat(mob, SPAN_ROLE_HEADER("You are a Weyland-Yutani PMC Support Synthetic!")) arm_equipment(mob, /datum/equipment_preset/pmc/synth, TRUE, TRUE) @@ -120,7 +120,7 @@ var/mob/living/carbon/human/H = new(spawn_loc) H.key = M.key if(H.client) - H.client.change_view(world_view_size) + H.client.change_view(GLOB.world_view_size) if(!leader && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job)) //First one spawned is always the leader. leader = H diff --git a/code/datums/emergency_calls/upp.dm b/code/datums/emergency_calls/upp.dm index 562dac3fe154..80ef111be3e4 100644 --- a/code/datums/emergency_calls/upp.dm +++ b/code/datums/emergency_calls/upp.dm @@ -61,7 +61,7 @@ leader = H arm_equipment(H, /datum/equipment_preset/upp/leader, TRUE, TRUE) to_chat(H, SPAN_ROLE_HEADER("You are an Officer of the Union of Progressive People, a powerful socialist state that rivals the United Americas!")) - else if(synths < max_synths && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SYNTH) && RoleAuthority.roles_whitelist[H.ckey] & WHITELIST_SYNTHETIC) + else if(synths < max_synths && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SYNTH) && GLOB.RoleAuthority.roles_whitelist[H.ckey] & WHITELIST_SYNTHETIC) synths++ to_chat(H, SPAN_ROLE_HEADER("You are a Combat Synthetic of the Union of Progressive People, a powerful socialist state that rivals the United Americas!")) arm_equipment(H, /datum/equipment_preset/upp/synth, TRUE, TRUE) diff --git a/code/datums/emergency_calls/whiskey_outpost.dm b/code/datums/emergency_calls/whiskey_outpost.dm index 436e02007c6c..5c46ace04d6c 100644 --- a/code/datums/emergency_calls/whiskey_outpost.dm +++ b/code/datums/emergency_calls/whiskey_outpost.dm @@ -51,7 +51,7 @@ sleep(10) to_chat(mob, "Objectives: [objectives]") - RoleAuthority.randomize_squad(mob) + GLOB.RoleAuthority.randomize_squad(mob) mob.sec_hud_set_ID() mob.hud_set_squad() diff --git a/code/datums/emergency_calls/xeno_cultists.dm b/code/datums/emergency_calls/xeno_cultists.dm index e5ebf089a9c2..5da5c9c17e59 100644 --- a/code/datums/emergency_calls/xeno_cultists.dm +++ b/code/datums/emergency_calls/xeno_cultists.dm @@ -25,7 +25,7 @@ leader = H to_chat(H, SPAN_ROLE_HEADER("You are the leader of this xeno cult! Bring glory to Queen Mother!")) arm_equipment(H, /datum/equipment_preset/other/xeno_cultist/leader, TRUE, TRUE) - else if(synths < max_synths && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SYNTH) && RoleAuthority.roles_whitelist[H.ckey] & WHITELIST_SYNTHETIC) + else if(synths < max_synths && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SYNTH) && GLOB.RoleAuthority.roles_whitelist[H.ckey] & WHITELIST_SYNTHETIC) synths++ to_chat(H, SPAN_ROLE_HEADER("You are the xeno cult's synthetic! Tend to the Hive and the captured hosts, make sure the Hive grows!")) arm_equipment(H, /datum/equipment_preset/synth/survivor/cultist_synth, TRUE, TRUE) diff --git a/code/datums/entities/clans.dm b/code/datums/entities/clans.dm index 8caa538e0e31..916afd18c178 100644 --- a/code/datums/entities/clans.dm +++ b/code/datums/entities/clans.dm @@ -45,8 +45,8 @@ BSQL_PROTECT_DATUM(/datum/entity/clan) /datum/entity_meta/clan_player/on_insert(datum/entity/clan_player/player) player.honor = 0 - player.clan_rank = clan_ranks_ordered[CLAN_RANK_UNBLOODED] - player.permissions = clan_ranks[CLAN_RANK_UNBLOODED].permissions + player.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_UNBLOODED] + player.permissions = GLOB.clan_ranks[CLAN_RANK_UNBLOODED].permissions player.save() diff --git a/code/datums/entities/player.dm b/code/datums/entities/player.dm index febeb1fc73a9..e5fa811002a2 100644 --- a/code/datums/entities/player.dm +++ b/code/datums/entities/player.dm @@ -93,7 +93,7 @@ BSQL_PROTECT_DATUM(/datum/entity/player) notes_add(ckey, note_text, admin.mob) else // notes_add already sends a message - message_admins("[key_name_admin(admin.mob)] has edited [ckey]'s [note_categories[note_category]] notes: [sanitize(note_text)]") + message_admins("[key_name_admin(admin.mob)] has edited [ckey]'s [GLOB.note_categories[note_category]] notes: [sanitize(note_text)]") if(!is_confidential && note_category == NOTE_ADMIN && owning_client) to_chat_immediate(owning_client, SPAN_WARNING(FONT_SIZE_LARGE("You have been noted by [key_name_admin(admin.mob, FALSE)]."))) to_chat_immediate(owning_client, SPAN_WARNING(FONT_SIZE_BIG("The note is : [sanitize(note_text)]"))) @@ -235,7 +235,7 @@ BSQL_PROTECT_DATUM(/datum/entity/player) if(job_bans[safe_rank]) continue var/old_rank = check_jobban_path(safe_rank) - jobban_keylist[old_rank][ckey] = ban_text + GLOB.jobban_keylist[old_rank][ckey] = ban_text jobban_savebanfile() add_note("Banned from [total_rank] - [ban_text]", FALSE, NOTE_ADMIN, TRUE, duration) // it is ban related note @@ -570,33 +570,33 @@ BSQL_PROTECT_DATUM(/datum/entity/player) save() /datum/entity/player/proc/migrate_bans() - if(!Banlist) // if Banlist cannot be located for some reason + if(!GLOB.Banlist) // if GLOB.Banlist cannot be located for some reason LoadBans() // try to load the bans - if(!Banlist) // uh oh, can't find bans! + if(!GLOB.Banlist) // uh oh, can't find bans! return var/reason var/expiration var/banned_by - Banlist.cd = "/base" + GLOB.Banlist.cd = "/base" - for (var/A in Banlist.dir) - Banlist.cd = "/base/[A]" + for (var/A in GLOB.Banlist.dir) + GLOB.Banlist.cd = "/base/[A]" - if(ckey != Banlist["key"]) + if(ckey != GLOB.Banlist["key"]) continue - if(Banlist["temp"]) - if (!GetExp(Banlist["minutes"])) + if(GLOB.Banlist["temp"]) + if (!GetExp(GLOB.Banlist["minutes"])) return - if(expiration > Banlist["minutes"]) + if(expiration > GLOB.Banlist["minutes"]) return // found longer ban - reason = Banlist["reason"] - banned_by = Banlist["bannedby"] - expiration = Banlist["minutes"] + reason = GLOB.Banlist["reason"] + banned_by = GLOB.Banlist["bannedby"] + expiration = GLOB.Banlist["minutes"] migrated_bans = TRUE save() @@ -619,13 +619,13 @@ BSQL_PROTECT_DATUM(/datum/entity/player) /datum/entity/player/proc/migrate_jobbans() if(!job_bans) job_bans = list() - for(var/name in RoleAuthority.roles_for_mode) + for(var/name in GLOB.RoleAuthority.roles_for_mode) var/safe_job_name = ckey(name) - if(!jobban_keylist[safe_job_name]) + if(!GLOB.jobban_keylist[safe_job_name]) continue if(!safe_job_name) continue - var/reason = jobban_keylist[safe_job_name][ckey] + var/reason = GLOB.jobban_keylist[safe_job_name][ckey] if(!reason) continue diff --git a/code/datums/entities/player_times.dm b/code/datums/entities/player_times.dm index a6304bd5d874..2bbd4a3bc39e 100644 --- a/code/datums/entities/player_times.dm +++ b/code/datums/entities/player_times.dm @@ -84,7 +84,7 @@ BSQL_PROTECT_DATUM(/datum/entity/player_time) return GLOB.always_state /datum/entity/player/proc/load_timestat_data() - if(!playtime_loaded || !RoleAuthority || LAZYACCESS(playtime_data, "loading")) // Need roleauthority to be up to see which job is xeno-related + if(!playtime_loaded || !GLOB.RoleAuthority || LAZYACCESS(playtime_data, "loading")) // Need roleauthority to be up to see which job is xeno-related return LAZYSET(playtime_data, "loading", TRUE) @@ -118,13 +118,13 @@ BSQL_PROTECT_DATUM(/datum/entity/player_time) LAZYADD(marine_playtimes, list(marine_playtime)) for(var/datum/view_record/playtime/PT in PTs) - var/isxeno = (PT.role_id in RoleAuthority.castes_by_name) + var/isxeno = (PT.role_id in GLOB.RoleAuthority.castes_by_name) var/isOther = (PT.role_id == JOB_OBSERVER) // more maybe eventually if(PT.role_id == JOB_XENOMORPH) continue // Snowflake check, will need to be removed in the future - if(!(PT.role_id in RoleAuthority.roles_by_name) && !isxeno && !isOther) + if(!(PT.role_id in GLOB.RoleAuthority.roles_by_name) && !isxeno && !isOther) continue if(isxeno) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 9e8279a843a4..205032f46a97 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -48,7 +48,7 @@ if(current) current.mind = null //remove ourself from our old body's mind variable - nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user + SSnano.nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user if(key) if(new_character.key != key) @@ -68,7 +68,7 @@ SSround_recording.recorder.update_key(new_character) if(new_character.client) new_character.client.init_verbs() - new_character.client.change_view(world_view_size) //reset view range to default. + new_character.client.change_view(GLOB.world_view_size) //reset view range to default. new_character.client.pixel_x = 0 new_character.client.pixel_y = 0 if(usr && usr.open_uis) diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index ff1263510761..e4ec3acc1410 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -1,7 +1,7 @@ /* HUD DATUMS */ //GLOBAL HUD LIST -var/list/datum/mob_hud/huds = list( +GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( MOB_HUD_SECURITY_BASIC = new /datum/mob_hud/security/basic(), MOB_HUD_SECURITY_ADVANCED = new /datum/mob_hud/security/advanced(), MOB_HUD_MEDICAL_BASIC = new /datum/mob_hud/medical/basic(), @@ -19,7 +19,7 @@ var/list/datum/mob_hud/huds = list( MOB_HUD_FACTION_PMC = new /datum/mob_hud/faction/pmc(), MOB_HUD_HUNTER = new /datum/mob_hud/hunter_hud(), MOB_HUD_HUNTER_CLAN = new /datum/mob_hud/hunter_clan() - ) + )) /datum/mob_hud var/list/mob/hudmobs = list() //list of all mobs which display this hud @@ -220,17 +220,17 @@ var/list/datum/mob_hud/huds = list( return /mob/hologram/queen/add_to_all_mob_huds() - var/datum/mob_hud/hud = huds[MOB_HUD_XENO_STATUS] + var/datum/mob_hud/hud = GLOB.huds[MOB_HUD_XENO_STATUS] hud.add_to_hud(src) /mob/living/carbon/human/add_to_all_mob_huds() - for(var/datum/mob_hud/hud in huds) + for(var/datum/mob_hud/hud in GLOB.huds) if(istype(hud, /datum/mob_hud/xeno)) //this one is xeno only continue hud.add_to_hud(src) /mob/living/carbon/xenomorph/add_to_all_mob_huds() - for(var/datum/mob_hud/hud in huds) + for(var/datum/mob_hud/hud in GLOB.huds) if(!istype(hud, /datum/mob_hud/xeno)) continue hud.add_to_hud(src) @@ -240,17 +240,17 @@ var/list/datum/mob_hud/huds = list( return /mob/hologram/queen/remove_from_all_mob_huds() - var/datum/mob_hud/hud = huds[MOB_HUD_XENO_STATUS] + var/datum/mob_hud/hud = GLOB.huds[MOB_HUD_XENO_STATUS] hud.remove_from_hud(src) /mob/living/carbon/human/remove_from_all_mob_huds() - for(var/datum/mob_hud/hud in huds) + for(var/datum/mob_hud/hud in GLOB.huds) if(istype(hud, /datum/mob_hud/xeno)) continue hud.remove_from_hud(src) /mob/living/carbon/xenomorph/remove_from_all_mob_huds() - for(var/datum/mob_hud/hud in huds) + for(var/datum/mob_hud/hud in GLOB.huds) if(istype(hud, /datum/mob_hud/xeno)) hud.remove_from_hud(src) hud.remove_hud_from(src, src) @@ -258,14 +258,14 @@ var/list/datum/mob_hud/huds = list( hud.remove_hud_from(src, src) if (xeno_hostile_hud) xeno_hostile_hud = FALSE - var/datum/mob_hud/hostile_hud = huds[MOB_HUD_XENO_HOSTILE] + var/datum/mob_hud/hostile_hud = GLOB.huds[MOB_HUD_XENO_HOSTILE] hostile_hud.remove_hud_from(src, src) /mob/proc/refresh_huds(mob/source_mob) var/mob/M = source_mob ? source_mob : src - for(var/datum/mob_hud/hud in huds) + for(var/datum/mob_hud/hud in GLOB.huds) if(M in hud.hudusers) hud.refresh_hud(src, hud.hudusers[M]) @@ -273,7 +273,7 @@ var/list/datum/mob_hud/huds = list( //called when a human changes suit sensors /mob/living/carbon/human/proc/update_suit_sensors() - var/datum/mob_hud/medical/basic/B = huds[MOB_HUD_MEDICAL_BASIC] + var/datum/mob_hud/medical/basic/B = GLOB.huds[MOB_HUD_MEDICAL_BASIC] B.update_suit_sensors(src) //called when a human changes health @@ -672,11 +672,11 @@ var/list/datum/mob_hud/huds = list( /mob/proc/hud_set_hunter() return -var/global/image/hud_icon_hunter_gear -var/global/image/hud_icon_hunter_hunted -var/global/image/hud_icon_hunter_dishonored -var/global/image/hud_icon_hunter_honored -var/global/image/hud_icon_hunter_thralled +GLOBAL_DATUM(hud_icon_hunter_gear, /image) +GLOBAL_DATUM(hud_icon_hunter_hunted, /image) +GLOBAL_DATUM(hud_icon_hunter_dishonored, /image) +GLOBAL_DATUM(hud_icon_hunter_honored, /image) +GLOBAL_DATUM(hud_icon_hunter_thralled, /image) /mob/living/carbon/hud_set_hunter() @@ -684,27 +684,27 @@ var/global/image/hud_icon_hunter_thralled holder.icon_state = "hudblank" holder.overlays.Cut() if(hunter_data.hunted) - if(!hud_icon_hunter_hunted) - hud_icon_hunter_hunted = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_hunted") - holder.overlays += hud_icon_hunter_hunted + if(!GLOB.hud_icon_hunter_hunted) + GLOB.hud_icon_hunter_hunted = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_hunted") + holder.overlays += GLOB.hud_icon_hunter_hunted if(hunter_data.dishonored) - if(!hud_icon_hunter_dishonored) - hud_icon_hunter_dishonored = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_dishonored") - holder.overlays += hud_icon_hunter_dishonored + if(!GLOB.hud_icon_hunter_dishonored) + GLOB.hud_icon_hunter_dishonored = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_dishonored") + holder.overlays += GLOB.hud_icon_hunter_dishonored else if(hunter_data.honored) - if(!hud_icon_hunter_honored) - hud_icon_hunter_honored = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_honored") - holder.overlays += hud_icon_hunter_honored + if(!GLOB.hud_icon_hunter_honored) + GLOB.hud_icon_hunter_honored = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_honored") + holder.overlays += GLOB.hud_icon_hunter_honored if(hunter_data.thralled) - if(!hud_icon_hunter_thralled) - hud_icon_hunter_thralled = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_thralled") - holder.overlays += hud_icon_hunter_thralled + if(!GLOB.hud_icon_hunter_thralled) + GLOB.hud_icon_hunter_thralled = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_thralled") + holder.overlays += GLOB.hud_icon_hunter_thralled else if(hunter_data.gear) - if(!hud_icon_hunter_gear) - hud_icon_hunter_gear = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_gear") - holder.overlays += hud_icon_hunter_gear + if(!GLOB.hud_icon_hunter_gear) + GLOB.hud_icon_hunter_gear = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_gear") + holder.overlays += GLOB.hud_icon_hunter_gear hud_list[HUNTER_HUD] = holder @@ -714,18 +714,18 @@ var/global/image/hud_icon_hunter_thralled holder.overlays.Cut() holder.pixel_x = -18 if(hunter_data.hunted) - if(!hud_icon_hunter_hunted) - hud_icon_hunter_hunted = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_hunted") - holder.overlays += hud_icon_hunter_hunted + if(!GLOB.hud_icon_hunter_hunted) + GLOB.hud_icon_hunter_hunted = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_hunted") + holder.overlays += GLOB.hud_icon_hunter_hunted if(hunter_data.dishonored) - if(!hud_icon_hunter_dishonored) - hud_icon_hunter_dishonored = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_dishonored") - holder.overlays += hud_icon_hunter_dishonored + if(!GLOB.hud_icon_hunter_dishonored) + GLOB.hud_icon_hunter_dishonored = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_dishonored") + holder.overlays += GLOB.hud_icon_hunter_dishonored else if(hunter_data.honored) - if(!hud_icon_hunter_honored) - hud_icon_hunter_honored = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_honored") - holder.overlays += hud_icon_hunter_honored + if(!GLOB.hud_icon_hunter_honored) + GLOB.hud_icon_hunter_honored = image('icons/mob/hud/hud_yautja.dmi', src, "hunter_honored") + holder.overlays += GLOB.hud_icon_hunter_honored hud_list[HUNTER_HUD] = holder @@ -733,26 +733,26 @@ var/global/image/hud_icon_hunter_thralled /mob/proc/hud_set_order() return -var/global/image/hud_icon_hudmove -var/global/image/hud_icon_hudhold -var/global/image/hud_icon_hudfocus +GLOBAL_DATUM(hud_icon_hudmove, /image) +GLOBAL_DATUM(hud_icon_hudhold, /image) +GLOBAL_DATUM(hud_icon_hudfocus, /image) // ORDER HUD /mob/living/carbon/human/hud_set_order() var/image/holder = hud_list[ORDER_HUD] holder.icon_state = "hudblank" holder.overlays.Cut() if(mobility_aura) - if(!hud_icon_hudmove) - hud_icon_hudmove = image('icons/mob/hud/marine_hud.dmi', src, "hudmove") - holder.overlays += hud_icon_hudmove + if(!GLOB.hud_icon_hudmove) + GLOB.hud_icon_hudmove = image('icons/mob/hud/marine_hud.dmi', src, "hudmove") + holder.overlays += GLOB.hud_icon_hudmove if(protection_aura) - if(!hud_icon_hudhold) - hud_icon_hudhold = image('icons/mob/hud/marine_hud.dmi', src, "hudhold") - holder.overlays += hud_icon_hudhold + if(!GLOB.hud_icon_hudhold) + GLOB.hud_icon_hudhold = image('icons/mob/hud/marine_hud.dmi', src, "hudhold") + holder.overlays += GLOB.hud_icon_hudhold if(marksman_aura) - if(!hud_icon_hudfocus) - hud_icon_hudfocus = image('icons/mob/hud/marine_hud.dmi', src, "hudfocus") - holder.overlays += hud_icon_hudfocus + if(!GLOB.hud_icon_hudfocus) + GLOB.hud_icon_hudfocus = image('icons/mob/hud/marine_hud.dmi', src, "hudfocus") + holder.overlays += GLOB.hud_icon_hudfocus hud_list[ORDER_HUD] = holder @@ -803,8 +803,6 @@ var/global/image/hud_icon_hudfocus if (tag_found) tag_holder.overlays += image('icons/mob/hud/hud.dmi', src, "prae_tag") - // Hacky, but works. Currently effects are hard to make with precise timings - var/freeze_found = HAS_TRAIT(src, TRAIT_IMMOBILIZED) && !buckled && !lying - + var/freeze_found = HAS_TRAIT(src, TRAIT_IMMOBILIZED) && body_position == STANDING_UP && !buckled // Eligible targets are unable to move but can stand and aren't buckled (eg nested) - This is to convey that they are temporarily unable to move if (freeze_found) freeze_holder.overlays += image('icons/mob/hud/hud.dmi', src, "xeno_freeze") diff --git a/code/datums/modules.dm b/code/datums/modules.dm deleted file mode 100644 index 4dd47497ffcc..000000000000 --- a/code/datums/modules.dm +++ /dev/null @@ -1,62 +0,0 @@ -// module datum. -// this is per-object instance, and shows the condition of the modules in the object -// actual modules needed is referenced through modulestypes and the object type - -/datum/module - var/status // bits set if working, 0 if broken - var/installed // bits set if installed, 0 if missing - -// moduletypes datum -// this is per-object type, and shows the modules needed for a type of object - -/datum/moduletypes - var/list/modcount = list() // assoc list of the count of modules for a type - - -var/list/modules = list( // global associative list - /obj/structure/machinery/power/apc = "card_reader,power_control,id_auth,cell_power,cell_charge") - - -/datum/module/New(obj/O) - - var/type = O.type // the type of the creating object - - var/mneed = mods.inmodlist(type) // find if this type has modules defined - - if(!mneed) // not found in module list? - qdel(src) // delete self, thus ending proc - - var/needed = mods.getbitmask(type) // get a bitmask for the number of modules in this object - status = needed - installed = needed - -/datum/moduletypes/proc/addmod(type, modtextlist) - modules += type // index by type text - modules[type] = modtextlist - -/datum/moduletypes/proc/inmodlist(type) - return type in modules - -/datum/moduletypes/proc/getbitmask(type) - var/count = modcount[type] - if(count) - return 2**count-1 - - var/modtext = modules[type] - var/num = 1 - var/pos = 1 - - while(1) - pos = findtext(modtext, ",", pos, 0) - if(!pos) - break - else - pos++ - num++ - - modcount += type - modcount[type] = num - - return 2**num-1 - - diff --git a/code/datums/origin/origin.dm b/code/datums/origin/origin.dm index 4bbd8b6505b5..46027a49941a 100644 --- a/code/datums/origin/origin.dm +++ b/code/datums/origin/origin.dm @@ -3,7 +3,7 @@ var/desc = "You were born somewhere, someplace. The area is known for doing things, you think." /datum/origin/proc/generate_human_name(gender = MALE) - return pick(gender == MALE ? first_names_male : first_names_female) + " " + pick(last_names) + return pick(gender == MALE ? GLOB.first_names_male : GLOB.first_names_female) + " " + pick(GLOB.last_names) /// Return null if the name is correct, otherwise return a string containing the error message /datum/origin/proc/validate_name(name_to_check) diff --git a/code/datums/origin/upp.dm b/code/datums/origin/upp.dm index f684410d59bf..8346657c5020 100644 --- a/code/datums/origin/upp.dm +++ b/code/datums/origin/upp.dm @@ -10,16 +10,16 @@ if(prob(40)) first_name = "[capitalize(randomly_generate_chinese_word(1))]" else - first_name = "[pick(first_names_male_upp)]" + first_name = "[pick(GLOB.first_names_male_upp)]" else if(prob(40)) first_name = "[capitalize(randomly_generate_chinese_word(1))]" else - first_name = "[pick(first_names_female_upp)]" + first_name = "[pick(GLOB.first_names_female_upp)]" if(prob(35)) last_name = "[capitalize(randomly_generate_chinese_word(pick(20;1, 80;2)))]" else - last_name = "[pick(last_names_upp)]" + last_name = "[pick(GLOB.last_names_upp)]" return first_name + " " + last_name diff --git a/code/datums/origin/uscm.dm b/code/datums/origin/uscm.dm index 8021ed3fd3a8..9608537bdf3f 100644 --- a/code/datums/origin/uscm.dm +++ b/code/datums/origin/uscm.dm @@ -28,7 +28,7 @@ desc = "You were a product of an experimental military programme that sought to breed the perfect supersoldier. In some aspects, they've succeeded." /datum/origin/uscm/aw/generate_human_name(gender = MALE) - return pick(gender == MALE ? first_names_male : first_names_female) + " A.W. " + pick(weapon_surnames) + return pick(gender == MALE ? GLOB.first_names_male : GLOB.first_names_female) + " A.W. " + pick(GLOB.weapon_surnames) /datum/origin/uscm/aw/validate_name(name_to_check) if(!findtext(name_to_check, "A.W. ")) diff --git a/code/datums/soundOutput.dm b/code/datums/soundOutput.dm index bc5ffd8efcfb..1f4512b28d59 100644 --- a/code/datums/soundOutput.dm +++ b/code/datums/soundOutput.dm @@ -152,11 +152,6 @@ adjust_volume_prefs(VOLUME_AMB, "Set the volume for ambience and soundscapes", 0) soundOutput.update_ambience(null, null, TRUE) -/client/verb/adjust_volume_admin_music() - set name = "Adjust Volume Admin MIDIs" - set category = "Preferences.Sound" - adjust_volume_prefs(VOLUME_ADM, "Set the volume for admin MIDIs", SOUND_CHANNEL_ADMIN_MIDI) - /client/verb/adjust_volume_lobby_music() set name = "Adjust Volume LobbyMusic" set category = "Preferences.Sound" diff --git a/code/datums/statistics/entities/death_stats.dm b/code/datums/statistics/entities/death_stats.dm index 35ff1769b925..76e3605c157f 100644 --- a/code/datums/statistics/entities/death_stats.dm +++ b/code/datums/statistics/entities/death_stats.dm @@ -133,8 +133,8 @@ new_death.total_damage_taken = life_damage_taken_total new_death.total_revives_done = life_revives_total - if(round_statistics) - round_statistics.track_death(new_death) + if(GLOB.round_statistics) + GLOB.round_statistics.track_death(new_death) new_death.save() new_death.detach() diff --git a/code/datums/statistics/entities/human_stats.dm b/code/datums/statistics/entities/human_stats.dm index 1e15aa1d161b..20d5a284becd 100644 --- a/code/datums/statistics/entities/human_stats.dm +++ b/code/datums/statistics/entities/human_stats.dm @@ -22,7 +22,7 @@ return ..() if(type == "Squad Roles") var/total_squad_time = 0 - for(var/squad_type in job_squad_roles) + for(var/squad_type in GLOB.job_squad_roles) var/datum/entity/player_stats/job/squad_stat = job_stats_list["[squad_type]"] if(!squad_stat) // Have not played the squad role yet continue @@ -30,7 +30,7 @@ return total_squad_time else if(type == "CIC Roles") var/total_command_time = 0 - for(var/command_type in job_command_roles) + for(var/command_type in GLOB.job_command_roles) var/datum/entity/player_stats/job/command_stat = job_stats_list["[command_type]"] if(!command_stat) // Have not played the command role yet continue @@ -122,15 +122,15 @@ S.total_rounds_played++ S.round_played = TRUE S.total_playtime += time - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.total_playtime += time /datum/entity/player_stats/human/count_personal_death(job) var/datum/entity/player_stats/job/S = setup_job_stats(job) S.total_deaths++ - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.total_deaths++ //****************** @@ -140,27 +140,27 @@ /datum/entity/player_stats/human/count_personal_human_kill(job_name, cause, job) var/datum/entity/player_stats/job/S = setup_job_stats(job) S.count_human_kill(job_name, cause) - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.count_human_kill(job_name, cause) if(cause) var/datum/entity/weapon_stats/W = setup_weapon_stats(cause) W.count_human_kill(job_name) - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(cause) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(cause) R.count_human_kill(job_name) /datum/entity/player_stats/human/count_personal_xeno_kill(caste_type, cause, job) var/datum/entity/player_stats/job/S = setup_job_stats(job) S.count_xeno_kill(caste_type, cause) - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.count_xeno_kill(caste_type, cause) if(cause) var/datum/entity/weapon_stats/W = setup_weapon_stats(cause) W.count_xeno_kill(caste_type) - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(cause) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(cause) R.count_xeno_kill(caste_type) /datum/entity/player_stats/human/count_human_kill(job_name, cause, job) @@ -169,8 +169,8 @@ if(cause) var/datum/entity/weapon_stats/W = setup_weapon_stats(cause) W.total_kills++ - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(cause) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(cause) R.total_kills++ recalculate_top_weapon() ..() @@ -181,8 +181,8 @@ if(cause) var/datum/entity/weapon_stats/W = setup_weapon_stats(cause) W.total_kills++ - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(cause) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(cause) R.total_kills++ recalculate_top_weapon() ..() @@ -194,8 +194,8 @@ /datum/entity/player_stats/human/count_personal_niche_stat(niche_name, amount = 1, job) var/datum/entity/player_stats/job/S = setup_job_stats(job) S.count_niche_stat(niche_name, amount) - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.count_niche_stat(niche_name, amount) /datum/entity/player_stats/human/count_niche_stat(niche_name, amount = 1, job, weapon) @@ -204,8 +204,8 @@ if(weapon) var/datum/entity/weapon_stats/W = setup_weapon_stats(weapon) W.count_niche_stat(niche_name, amount) - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(weapon) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(weapon) R.count_niche_stat(niche_name, amount) recalculate_top_weapon() ..() @@ -215,8 +215,8 @@ return var/datum/entity/player_stats/job/S = setup_job_stats(job, FALSE) S.steps_walked += amount - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job, FALSE) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job, FALSE) R.steps_walked += amount /mob/living/carbon/human/track_steps_walked(amount = 1) @@ -237,8 +237,8 @@ if(isnull(S.total_hits)) S.total_hits = 0 S.total_hits += amount - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(weapon) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(weapon) R.total_hits +=amount /mob/proc/track_hit(weapon, amount = 1) @@ -256,8 +256,8 @@ if(isnull(S.total_shots)) S.total_shots = 0 S.total_shots += amount - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(weapon) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(weapon) R.total_shots +=amount /datum/entity/player_stats/human/proc/count_personal_shot(job, amount = 1) @@ -267,8 +267,8 @@ if(isnull(S.total_shots)) S.total_shots = 0 S.total_shots += amount - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.total_shots += amount /mob/proc/track_shot(weapon, amount = 1) @@ -288,8 +288,8 @@ if(isnull(S.total_shots_hit)) S.total_shots_hit = 0 S.total_shots_hit += amount - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(weapon) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(weapon) R.total_shots_hit += amount /datum/entity/player_stats/human/proc/count_personal_shot_hit(job, amount = 1) @@ -299,8 +299,8 @@ if(isnull(S.total_shots_hit)) S.total_shots_hit = 0 S.total_shots_hit += amount - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.total_shots_hit += amount /mob/proc/track_shot_hit(weapon, shot_mob, amount = 1) @@ -312,13 +312,13 @@ human_stats.total_shots_hit += amount human_stats.count_weapon_shot_hit(weapon, amount) human_stats.count_personal_shot_hit(job, amount) - if(round_statistics) - round_statistics.total_projectiles_hit += amount + if(GLOB.round_statistics) + GLOB.round_statistics.total_projectiles_hit += amount if(shot_mob) if(ishuman(shot_mob)) - round_statistics.total_projectiles_hit_human += amount + GLOB.round_statistics.total_projectiles_hit_human += amount else if(isxeno(shot_mob)) - round_statistics.total_projectiles_hit_xeno += amount + GLOB.round_statistics.total_projectiles_hit_xeno += amount /datum/entity/player_stats/human/proc/count_weapon_friendly_fire(weapon, amount = 1) if(!weapon) @@ -327,8 +327,8 @@ if(isnull(S.total_friendly_fire)) S.total_friendly_fire = 0 S.total_friendly_fire += amount - if(round_statistics) - var/datum/entity/weapon_stats/R = round_statistics.setup_weapon_stats(weapon) + if(GLOB.round_statistics) + var/datum/entity/weapon_stats/R = GLOB.round_statistics.setup_weapon_stats(weapon) R.total_friendly_fire += amount /datum/entity/player_stats/human/proc/count_personal_friendly_fire(job, amount = 1) @@ -338,8 +338,8 @@ if(isnull(S.total_friendly_fire)) S.total_friendly_fire = 0 S.total_friendly_fire += amount - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.total_friendly_fire += amount /mob/proc/track_friendly_fire(weapon, amount = 1) @@ -359,8 +359,8 @@ if(isnull(S.total_revives)) S.total_revives = 0 S.total_revives += amount - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.total_revives += amount /mob/proc/track_revive(job, amount = 1) @@ -379,8 +379,8 @@ if(isnull(S.total_lives_saved)) S.total_lives_saved = 0 S.total_lives_saved += amount - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.total_lives_saved += amount /mob/proc/track_life_saved(job, amount = 1) @@ -399,8 +399,8 @@ if(isnull(S.total_screams)) S.total_screams = 0 S.total_screams += amount - if(round_statistics) - var/datum/entity/player_stats/job/R = round_statistics.setup_job_stats(job) + if(GLOB.round_statistics) + var/datum/entity/player_stats/job/R = GLOB.round_statistics.setup_job_stats(job) R.total_screams += amount /mob/proc/track_scream(job, amount = 1) diff --git a/code/datums/statistics/entities/panel_stats.dm b/code/datums/statistics/entities/panel_stats.dm index e507d5d81a8b..5cfb888b8ea1 100644 --- a/code/datums/statistics/entities/panel_stats.dm +++ b/code/datums/statistics/entities/panel_stats.dm @@ -3,9 +3,9 @@ //******************************************************* -/datum/entity/player_entity/proc/show_statistics(mob/user, datum/entity/statistic/round/viewing_round = round_statistics, update_data = FALSE) +/datum/entity/player_entity/proc/show_statistics(mob/user, datum/entity/statistic/round/viewing_round = GLOB.round_statistics, update_data = FALSE) if(update_data) - update_panel_data(round_statistics) + update_panel_data(GLOB.round_statistics) ui_interact(user) /datum/entity/player_entity/proc/ui_interact(mob/user, ui_key = "statistics", datum/nanoui/ui, force_open = 1) @@ -13,7 +13,7 @@ data["subMenu"] = subMenu data["dataMenu"] = dataMenu - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = SSnano.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if(!ui) ui = new(user, src, ui_key, "cm_stat_panel.tmpl", "Statistics", 450, 700, null, -1) @@ -31,7 +31,7 @@ if(href_list["dataMenu"]) dataMenu = href_list["dataMenu"] - nanomanager.update_uis(src) + SSnano.nanomanager.update_uis(src) /datum/entity/player_entity/proc/check_eye() return @@ -68,7 +68,7 @@ //*******************PLAYER DATA************************* //******************************************************* -/datum/entity/player_entity/proc/update_panel_data(datum/entity/statistic/round/viewing_round = round_statistics) +/datum/entity/player_entity/proc/update_panel_data(datum/entity/statistic/round/viewing_round = GLOB.round_statistics) data["current_time"] = worldtime2text() if(viewing_round) diff --git a/code/datums/statistics/entities/player_stats.dm b/code/datums/statistics/entities/player_stats.dm index d9fbd3b11e03..a8444c1a5894 100644 --- a/code/datums/statistics/entities/player_stats.dm +++ b/code/datums/statistics/entities/player_stats.dm @@ -81,10 +81,10 @@ /mob/proc/track_death_calculations() if(statistic_exempt || statistic_tracked) return - if(round_statistics) - round_statistics.recalculate_nemesis() + if(GLOB.round_statistics) + GLOB.round_statistics.recalculate_nemesis() if(mind && mind.player_entity) - mind.player_entity.update_panel_data(round_statistics) + mind.player_entity.update_panel_data(GLOB.round_statistics) statistic_tracked = TRUE //***************** diff --git a/code/datums/statistics/entities/round_stats.dm b/code/datums/statistics/entities/round_stats.dm index baed6befa912..25543dff22b1 100644 --- a/code/datums/statistics/entities/round_stats.dm +++ b/code/datums/statistics/entities/round_stats.dm @@ -84,9 +84,9 @@ if(!round_stats) var/datum/entity/mc_round/mc_round = SSentity_manager.select(/datum/entity/mc_round) var/operation_name - operation_name = "[pick(operation_titles)]" - operation_name += " [pick(operation_prefixes)]" - operation_name += "-[pick(operation_postfixes)]" + operation_name = "[pick(GLOB.operation_titles)]" + operation_name += " [pick(GLOB.operation_prefixes)]" + operation_name += "-[pick(GLOB.operation_postfixes)]" // Round stats round_stats = DB_ENTITY(/datum/entity/statistic/round) @@ -98,7 +98,7 @@ round_stats.save() // Setup the global reference - round_statistics = round_stats + GLOB.round_statistics = round_stats // Map stats var/datum/entity/statistic/map/new_map = DB_EKEY(/datum/entity/statistic/map, SSmapping.configs[GROUND_MAP].map_name) @@ -376,7 +376,7 @@ stats += "Xenos remaining: [end_of_round_xenos]\n" stats += "Hijack time: [duration2text(round_hijack_time)]\n" - stats += "[log_end]" + stats += "[GLOB.log_end]" WRITE_LOG(GLOB.round_stats, stats) @@ -396,4 +396,4 @@ if(!can_use_action()) return - owner.client.player_entity.show_statistics(owner, round_statistics, TRUE) + owner.client.player_entity.show_statistics(owner, GLOB.round_statistics, TRUE) diff --git a/code/datums/statistics/entities/xeno_stats.dm b/code/datums/statistics/entities/xeno_stats.dm index 8fff4a2e5dd3..9703c8c5e397 100644 --- a/code/datums/statistics/entities/xeno_stats.dm +++ b/code/datums/statistics/entities/xeno_stats.dm @@ -78,15 +78,15 @@ S.total_rounds_played++ S.round_played = TRUE S.total_playtime += time - if(round_statistics) - var/datum/entity/player_stats/caste/R = round_statistics.setup_caste_stats(caste) + if(GLOB.round_statistics) + var/datum/entity/player_stats/caste/R = GLOB.round_statistics.setup_caste_stats(caste) R.total_playtime += time /datum/entity/player_stats/xeno/count_personal_death(caste) var/datum/entity/player_stats/caste/S = setup_caste_stats(caste) S.total_deaths++ - if(round_statistics) - var/datum/entity/player_stats/caste/R = round_statistics.setup_caste_stats(caste) + if(GLOB.round_statistics) + var/datum/entity/player_stats/caste/R = GLOB.round_statistics.setup_caste_stats(caste) R.total_deaths++ //****************** @@ -96,16 +96,16 @@ /datum/entity/player_stats/xeno/count_personal_human_kill(job_name, cause, caste) var/datum/entity/player_stats/caste/S = setup_caste_stats(caste) S.count_human_kill(job_name, cause) - if(round_statistics) - var/datum/entity/player_stats/caste/R = round_statistics.setup_caste_stats(caste) + if(GLOB.round_statistics) + var/datum/entity/player_stats/caste/R = GLOB.round_statistics.setup_caste_stats(caste) R.count_human_kill(job_name, cause) recalculate_top_caste() /datum/entity/player_stats/xeno/count_personal_xeno_kill(caste_type, cause, caste) var/datum/entity/player_stats/caste/S = setup_caste_stats(caste) S.count_xeno_kill(caste_type, cause) - if(round_statistics) - var/datum/entity/player_stats/caste/R = round_statistics.setup_caste_stats(caste) + if(GLOB.round_statistics) + var/datum/entity/player_stats/caste/R = GLOB.round_statistics.setup_caste_stats(caste) R.count_xeno_kill(caste_type, cause) recalculate_top_caste() @@ -116,15 +116,15 @@ /datum/entity/player_stats/xeno/count_personal_niche_stat(niche_name, amount = 1, caste) var/datum/entity/player_stats/caste/S = setup_caste_stats(caste) S.count_niche_stat(niche_name, amount) - if(round_statistics) - var/datum/entity/player_stats/caste/R = round_statistics.setup_caste_stats(caste) + if(GLOB.round_statistics) + var/datum/entity/player_stats/caste/R = GLOB.round_statistics.setup_caste_stats(caste) R.count_niche_stat(niche_name, amount) /datum/entity/player_stats/xeno/proc/track_personal_abilities_used(caste, ability, amount = 1) var/datum/entity/player_stats/caste/S = setup_caste_stats(caste) S.track_personal_abilities_used(ability, amount) - if(round_statistics) - var/datum/entity/player_stats/caste/R = round_statistics.setup_caste_stats(caste) + if(GLOB.round_statistics) + var/datum/entity/player_stats/caste/R = GLOB.round_statistics.setup_caste_stats(caste) R.track_personal_abilities_used(ability, amount) /mob/living/carbon/xenomorph/proc/track_ability_usage(ability, caste, amount = 1) @@ -137,8 +137,8 @@ /datum/entity/player_stats/xeno/count_personal_steps_walked(caste, amount = 1) var/datum/entity/player_stats/caste/S = setup_caste_stats(caste) S.steps_walked += amount - if(round_statistics) - var/datum/entity/player_stats/caste/R = round_statistics.setup_caste_stats(caste) + if(GLOB.round_statistics) + var/datum/entity/player_stats/caste/R = GLOB.round_statistics.setup_caste_stats(caste) R.steps_walked += amount /mob/living/carbon/xenomorph/track_steps_walked(amount = 1) @@ -154,8 +154,8 @@ /datum/entity/player_stats/xeno/proc/count_personal_slashes(caste, amount = 1) var/datum/entity/player_stats/caste/S = setup_caste_stats(caste) S.total_hits += amount - if(round_statistics) - var/datum/entity/player_stats/caste/R = round_statistics.setup_caste_stats(caste) + if(GLOB.round_statistics) + var/datum/entity/player_stats/caste/R = GLOB.round_statistics.setup_caste_stats(caste) R.total_hits += amount /mob/living/carbon/xenomorph/proc/track_slashes(caste, amount = 1) @@ -167,5 +167,5 @@ xeno_stats.total_hits += amount if(caste_type) xeno_stats.count_personal_slashes(caste_type, amount) - if(round_statistics) - round_statistics.total_slashes += amount + if(GLOB.round_statistics) + GLOB.round_statistics.total_slashes += amount diff --git a/code/datums/statistics/random_facts/random_fact.dm b/code/datums/statistics/random_facts/random_fact.dm index 76c6e82f776d..d327bd36f4f6 100644 --- a/code/datums/statistics/random_facts/random_fact.dm +++ b/code/datums/statistics/random_facts/random_fact.dm @@ -24,8 +24,8 @@ var/datum/entity/statistic/death/death_to_report = null var/mob/mob_to_report = null - if(round_statistics && length(round_statistics.death_stats_list)) - for(var/datum/entity/statistic/death/death in round_statistics.death_stats_list) + if(GLOB.round_statistics && length(GLOB.round_statistics.death_stats_list)) + for(var/datum/entity/statistic/death/death in GLOB.round_statistics.death_stats_list) if(!check_human && !death.is_xeno) continue if(!check_xeno && death.is_xeno) diff --git a/code/datums/supply_packs/black_market.dm b/code/datums/supply_packs/black_market.dm index 1af965898548..36d890e2b3d5 100644 --- a/code/datums/supply_packs/black_market.dm +++ b/code/datums/supply_packs/black_market.dm @@ -749,8 +749,8 @@ This is where the RO can reclaim their lost honor and purchase the M44 custom, t dollar_cost = 10 containertype = /obj/structure/largecrate/black_market -/datum/supply_packs/contraband/deep_storage/xm42b_pipe - name = "10x99mm XM42B casing" +/datum/supply_packs/contraband/deep_storage/xm43e1_pipe + name = "10x99mm XM43E1 casing" contains = list(/obj/item/prop/helmetgarb/bullet_pipe) dollar_cost = 10 containertype = /obj/structure/largecrate/black_market diff --git a/code/datums/supply_packs/spec_ammo.dm b/code/datums/supply_packs/spec_ammo.dm index 7931a4d40204..e20a5de865a3 100644 --- a/code/datums/supply_packs/spec_ammo.dm +++ b/code/datums/supply_packs/spec_ammo.dm @@ -109,10 +109,10 @@ containername = "M42A Incendiary Magazine Crate" group = "Weapons Specialist Ammo" -//XM42B - Disabled during testing per request. +//XM43E1 - Disabled during testing per request. /* /datum/supply_packs/ammo_amr_marksman - name = "XM42B anti-materiel rifle marksman magazines crate (x5)" + name = "XM43E1 anti-materiel rifle marksman magazines crate (x5)" contains = list( /obj/item/ammo_magazine/sniper/anti_materiel, /obj/item/ammo_magazine/sniper/anti_materiel, @@ -122,7 +122,7 @@ ) cost = 30 containertype = /obj/structure/closet/crate/ammo - containername = "XM42B Anti-Materiel Magazine Crate" + containername = "XM43E1 Anti-Materiel Magazine Crate" group = "Specialist Ammo" */ //M4RA diff --git a/code/datums/weather/weather_map_holders/new_varadero.dm b/code/datums/weather/weather_map_holders/new_varadero.dm index 8222001f4739..6dae09711e47 100644 --- a/code/datums/weather/weather_map_holders/new_varadero.dm +++ b/code/datums/weather/weather_map_holders/new_varadero.dm @@ -16,5 +16,5 @@ return prob(PROB_WEATHER_NEW_VARADERO) /datum/weather_ss_map_holder/new_varadero/weather_warning() - for (var/obj/structure/machinery/storm_siren/WS in weather_notify_objects) + for (var/obj/structure/machinery/storm_siren/WS in GLOB.weather_notify_objects) WS.weather_warning() diff --git a/code/datums/weather/weather_map_holders/sorokyne.dm b/code/datums/weather/weather_map_holders/sorokyne.dm index db55d12cdfbe..3c27a43ce1b3 100644 --- a/code/datums/weather/weather_map_holders/sorokyne.dm +++ b/code/datums/weather/weather_map_holders/sorokyne.dm @@ -21,5 +21,5 @@ return FALSE /datum/weather_ss_map_holder/sorokyne/weather_warning() - for (var/obj/structure/machinery/weather_siren/WS in weather_notify_objects) + for (var/obj/structure/machinery/weather_siren/WS in GLOB.weather_notify_objects) WS.weather_warning() diff --git a/code/defines/procs/announcement.dm b/code/defines/procs/announcement.dm index 8e42fd1e76a8..3dd918abbc6b 100644 --- a/code/defines/procs/announcement.dm +++ b/code/defines/procs/announcement.dm @@ -93,7 +93,7 @@ if(isobserver(M) || ishuman(M) && is_mainship_level(M.z)) playsound_client(M.client, sound_to_play, M, vol = 45) - for(var/mob/living/silicon/decoy/ship_ai/AI in ai_mob_list) + for(var/mob/living/silicon/decoy/ship_ai/AI in GLOB.ai_mob_list) INVOKE_ASYNC(AI, TYPE_PROC_REF(/mob/living/silicon/decoy/ship_ai, say), message) switch(logging) @@ -106,7 +106,7 @@ if(!message) return - for(var/mob/living/silicon/decoy/ship_ai/AI in ai_mob_list) + for(var/mob/living/silicon/decoy/ship_ai/AI in GLOB.ai_mob_list) if(channel_prefix) message = "[channel_prefix][message]" INVOKE_ASYNC(AI, TYPE_PROC_REF(/mob/living/silicon/decoy/ship_ai, say), message) diff --git a/code/defines/procs/radio.dm b/code/defines/procs/radio.dm index b4914d049fc9..d99d99b24726 100644 --- a/code/defines/procs/radio.dm +++ b/code/defines/procs/radio.dm @@ -2,8 +2,8 @@ var/freq_text // the name of the channel - for(var/channel in radiochannels) - if(radiochannels[channel] == display_freq) + for(var/channel in GLOB.radiochannels) + if(GLOB.radiochannels[channel] == display_freq) freq_text = channel break diff --git a/code/game/area/almayer.dm b/code/game/area/almayer.dm index 742ae7a1addb..d9ff42f4f55c 100644 --- a/code/game/area/almayer.dm +++ b/code/game/area/almayer.dm @@ -29,12 +29,12 @@ SShijack.progress_areas[src] = power_equip /area/shuttle/almayer/elevator_maintenance/upperdeck - name = "\improper Maintenance Elevator" + name = "\improper Upper Deck Maintenance Elevator" icon_state = "shuttle" fake_zlevel = 1 /area/shuttle/almayer/elevator_maintenance/lowerdeck - name = "\improper Maintenance Elevator" + name = "\improper Lower Deck Maintenance Elevator" icon_state = "shuttle" fake_zlevel = 2 @@ -98,23 +98,23 @@ resin_construction_allowed = FALSE /area/almayer/command/securestorage - name = "\improper Secure Storage" + name = "\improper Upper Deck Secure Storage" icon_state = "corporatespace" - fake_zlevel = 2 // lowerdeck + fake_zlevel = 1 // upperdeck /area/almayer/command/computerlab - name = "\improper Computer Lab" + name = "\improper Upper Deck Computer Lab" icon_state = "ceroom" - fake_zlevel = 2 // lowerdeck + fake_zlevel = 1 // upperdeck /area/almayer/command/telecomms - name = "\improper Telecommunications" + name = "\improper Upper Deck Telecommunications" icon_state = "tcomms" fake_zlevel = 1 // upperdeck flags_area = AREA_NOTUNNEL /area/almayer/command/self_destruct - name = "\improper Self-Destruct Core Room" + name = "\improper Upper Deck Self-Destruct Core Room" icon_state = "selfdestruct" fake_zlevel = 1 // upperdeck flags_area = AREA_NOTUNNEL @@ -125,7 +125,7 @@ fake_zlevel = 1 // upperdeck /area/almayer/command/combat_correspondent - name = "\improper Combat Correspondent Office" + name = "\improper Upper Deck Combat Correspondent Office" icon_state = "selfdestruct" fake_zlevel = 1 // upperdeck @@ -133,36 +133,36 @@ minimap_color = MINIMAP_AREA_ENGI /area/almayer/engineering/upper_engineering - name = "\improper Upper Engineering" + name = "\improper Upper Deck Engineering" icon_state = "upperengineering" fake_zlevel = 1 // upperdeck /area/almayer/engineering/upper_engineering/starboard - name = "\improper Starboard Upper Engineering" + name = "\improper Upper Deck Starboard Engineering" /area/almayer/engineering/upper_engineering/port - name = "\improper Port Upper Engineering" + name = "\improper Upper Deck Port Engineering" /area/almayer/engineering/upper_engineering/notunnel flags_area = AREA_NOTUNNEL /area/almayer/engineering/ce_room - name = "\improper Chief Engineer Office" + name = "\improper Upper Deck Chief Engineer Office" icon_state = "ceroom" fake_zlevel = 1 // upperdeck /area/almayer/engineering/lower_engine_monitoring - name = "\improper Engine Reactor Monitoring" + name = "\improper Lower Deck Engine Reactor Monitoring" icon_state = "lowermonitoring" fake_zlevel = 2 // lowerdeck /area/almayer/engineering/lower_engineering - name = "\improper Engineering Lower" + name = "\improper Lower Deck Engineering" icon_state = "lowerengineering" fake_zlevel = 2 // lowerdeck /area/almayer/engineering/engineering_workshop - name = "\improper Engineering Workshop" + name = "\improper Lower Deck Engineering Workshop" icon_state = "workshop" fake_zlevel = 2 // lowerdeck @@ -180,17 +180,17 @@ hijack_evacuation_type = EVACUATION_TYPE_ADDITIVE /area/almayer/engineering/starboard_atmos - name = "\improper Atmospherics Starboard" + name = "\improper Upper Deck Starboard Atmospherics" icon_state = "starboardatmos" fake_zlevel = 1 // upperdeck /area/almayer/engineering/port_atmos - name = "\improper Atmospherics Port" + name = "\improper Upper Deck Port Atmospherics" icon_state = "portatmos" fake_zlevel = 1 // upperdeck /area/almayer/engineering/laundry - name = "\improper Laundry Room" + name = "\improper Upper Deck Laundry Room" icon_state = "laundry" fake_zlevel = 1 // upperdeck @@ -211,17 +211,17 @@ fake_zlevel = 2 // lowerdeck /area/almayer/shipboard/starboard_missiles - name = "\improper Missile Tubes Starboard" + name = "\improper Upper Deck Starboard Missile Tubes" icon_state = "starboardmissile" fake_zlevel = 1 // upperdeck /area/almayer/shipboard/port_missiles - name = "\improper Missile Tubes Port" + name = "\improper Upper Deck Port Missile Tubes" icon_state = "portmissile" fake_zlevel = 1 // upperdeck /area/almayer/shipboard/weapon_room - name = "\improper Weapon Control Room" + name = "\improper Lower Deck Weapon Control" icon_state = "weaponroom" fake_zlevel = 2 // lowerdeck @@ -229,12 +229,12 @@ flags_area = AREA_NOTUNNEL /area/almayer/shipboard/starboard_point_defense - name = "\improper Point Defense Starboard" + name = "\improper Lower Deck Starboard Point Defense" icon_state = "starboardpd" fake_zlevel = 2 // lowerdeck /area/almayer/shipboard/port_point_defense - name = "\improper Point Defense Port" + name = "\improper Lower Deck Port Point Defense" icon_state = "portpd" fake_zlevel = 2 // lowerdeck @@ -300,7 +300,7 @@ icon_state = "chiefmpoffice" /area/almayer/shipboard/sea_office - name = "\improper Senior Enlisted Advisor Office" + name = "\improper Lower Deck Senior Enlisted Advisor Office" icon_state = "chiefmpoffice" fake_zlevel = 2 // lowerdeck @@ -326,7 +326,7 @@ soundscape_interval = 50 /area/almayer/hallways/vehiclehangar - name = "\improper Vehicle Storage" + name = "\improper Lower Deck Vehicle Storage" icon_state = "exoarmor" fake_zlevel = 2 @@ -334,135 +334,136 @@ minimap_color = MINIMAP_AREA_COLONY /area/almayer/living/tankerbunks - name = "\improper Vehicle Crew Bunks" + name = "\improper Lower Deck Vehicle Crew Bunks" icon_state = "livingspace" fake_zlevel = 2 /area/almayer/living/auxiliary_officer_office - name = "\improper Auxiliary Support Officer office" + name = "\improper Lower Deck Auxiliary Support Officer office" icon_state = "livingspace" fake_zlevel = 2 /area/almayer/squads/tankdeliveries - name = "\improper Vehicle ASRS" + name = "\improper Lower Deck Vehicle ASRS" icon_state = "req" fake_zlevel = 2 /area/almayer/hallways/exoarmor - name = "\improper Vehicle Armor Storage" + name = "\improper Lower Deck Vehicle Armor Storage" icon_state = "exoarmor" fake_zlevel = 2 // lowerdeck /area/almayer/hallways/repair_bay - name = "\improper Deployment Workshop" + name = "\improper Lower Deck Deployment Workshop" icon_state = "dropshiprepair" fake_zlevel = 2 // lowerdeck /area/almayer/hallways/mission_planner - name = "\improper Dropship Central Computer Room" + name = "\improper Lower Deck Dropship Central Computer Room" icon_state = "missionplanner" fake_zlevel = 2 // lowerdeck /area/almayer/hallways/starboard_umbilical - name = "\improper Umbilical Starboard" + name = "\improper Lower Deck Starboard Umbilical Hallway" icon_state = "starboardumbilical" fake_zlevel = 2 // lowerdeck /area/almayer/hallways/port_umbilical - name = "\improper Umbilical Port" + name = "\improper Lower Deck Port Umbilical Hallway" icon_state = "portumbilical" fake_zlevel = 2 // lowerdeck /area/almayer/hallways/aft_hallway - name = "\improper Hallway Aft" + name = "\improper Upper Deck Aft Hallway" icon_state = "aft" fake_zlevel = 1 // upperdeck /area/almayer/hallways/stern_hallway - name = "\improper Hallway Stern" + name = "\improper Upper Deck Stern Hallway" icon_state = "stern" fake_zlevel = 1 // upperdeck /area/almayer/hallways/port_hallway - name = "\improper Hallway Port" + name = "\improper Lower Deck Port Hallway" icon_state = "port" fake_zlevel = 2 // lowerdeck /area/almayer/hallways/starboard_hallway - name = "\improper Hallway Starboard" + name = "\improper Lower Deck Starboard Hallway" icon_state = "starboard" fake_zlevel = 2 // lowerdeck /area/almayer/stair_clone - name = "\improper Stairs" + name = "\improper Lower Deck Stairs" icon_state = "stairs_lowerdeck" fake_zlevel = 2 // lowerdeck resin_construction_allowed = FALSE /area/almayer/stair_clone/upper + name = "\improper Upper Deck Stairs" icon_state = "stairs_upperdeck" fake_zlevel = 1 // upperdeck /area/almayer/hull/lower_hull - name = "\improper Hull Lower" + name = "\improper Lower Deck Hull" icon_state = "lowerhull" fake_zlevel = 2 // lowerdeck /area/almayer/hull/upper_hull - name = "\improper Hull Upper" + name = "\improper Upper Deck Hull" icon_state = "upperhull" fake_zlevel = 1 // upperdeck /area/almayer/hull/upper_hull/u_f_s - name = "\improper Upper Fore-Starboard Hull" + name = "\improper Upper Deck Fore-Starboard Hull" icon_state = "upperhull" /area/almayer/hull/upper_hull/u_m_s - name = "\improper Upper Midship-Starboard Hull" + name = "\improper Upper Deck Starboard-Midship Hull" icon_state = "upperhull" /area/almayer/hull/upper_hull/u_a_s - name = "\improper Upper Aft-Starboard Hull" + name = "\improper Upper Deck Starboard-Aft Hull" icon_state = "upperhull" /area/almayer/hull/upper_hull/u_f_p - name = "\improper Upper Fore-Port Hull" + name = "\improper Upper Deck Port-Fore Hull" icon_state = "upperhull" /area/almayer/hull/upper_hull/u_m_p - name = "\improper Upper Midship-Port Hull" + name = "\improper Upper Deck Port-Midship Hull" icon_state = "upperhull" /area/almayer/hull/upper_hull/u_a_p - name = "\improper Upper Aft-Port Hull" + name = "\improper Upper Deck Port-Aft Hull" icon_state = "upperhull" /area/almayer/hull/lower_hull/l_f_s - name = "\improper Lower Fore-Starboard Hull" + name = "\improper Lower Deck Starboard-Fore Hull" icon_state = "upperhull" /area/almayer/hull/lower_hull/l_m_s - name = "\improper Lower Midship-Starboard Hull" + name = "\improper Lower Deck Starboard-Midship Hull" icon_state = "upperhull" /area/almayer/hull/lower_hull/l_a_s - name = "\improper Lower Aft-Starboard Hull" + name = "\improper Lower Deck Starboard Hull" icon_state = "upperhull" /area/almayer/hull/lower_hull/l_f_p - name = "\improper Lower Fore-Port Hull" + name = "\improper Lower Deck Port-Fore Hull" icon_state = "upperhull" /area/almayer/hull/lower_hull/l_m_p - name = "\improper Lower Midship-Port Hull" + name = "\improper Lower Deck Port-Midship Hull" icon_state = "upperhull" /area/almayer/hull/lower_hull/l_a_p - name = "\improper Lower Aft-Port Hull" + name = "\improper Lower Deck Port-Aft Hull" icon_state = "upperhull" /area/almayer/living/cryo_cells - name = "\improper Cryo Cells" + name = "\improper Lower Deck Cryo Cells" icon_state = "cryo" fake_zlevel = 2 // lowerdeck @@ -472,22 +473,22 @@ fake_zlevel = 2 // lowerdeck /area/almayer/living/port_emb - name = "\improper Extended Mission Bunks" + name = "\improper Lower Deck Port Extended Mission Bunks" icon_state = "portemb" fake_zlevel = 2 // lowerdeck /area/almayer/living/starboard_emb - name = "\improper Extended Mission Bunks" + name = "\improper Lower Deck Starboard Extended Mission Bunks" icon_state = "starboardemb" fake_zlevel = 2 // lowerdeck /area/almayer/living/port_garden - name = "\improper Garden" + name = "\improper Port Garden" icon_state = "portemb" fake_zlevel = 1 // upperdeck /area/almayer/living/starboard_garden - name = "\improper Garden" + name = "\improper Starboard Garden" icon_state = "starboardemb" fake_zlevel = 1 // upperdeck @@ -502,12 +503,12 @@ fake_zlevel = 2 // lowerdeck /area/almayer/living/officer_rnr - name = "\improper Officer's Lounge" + name = "\improper Upper Deck Officer's Lounge" icon_state = "officerrnr" fake_zlevel = 1 // upperdeck /area/almayer/living/officer_study - name = "\improper Officer's Study" + name = "\improper Upper Deck Officer's Study" icon_state = "officerstudy" fake_zlevel = 1 // upperdeck @@ -522,17 +523,17 @@ fake_zlevel = 2 // lowerdeck /area/almayer/living/gym - name = "\improper Gym" + name = "\improper Lower Deck Gym" icon_state = "officerrnr" fake_zlevel = 2 // lowerdeck /area/almayer/living/cafeteria_officer - name = "\improper Officer Cafeteria" + name = "\improper Upper Deck Officer Cafeteria" icon_state = "food" fake_zlevel = 1 // upperdeck /area/almayer/living/offices - name = "\improper Conference Office" + name = "\improper Lower Deck Conference Office" icon_state = "briefing" fake_zlevel = 2 // lowerdeck @@ -560,7 +561,7 @@ fake_zlevel = 1 // upperdeck /area/almayer/living/synthcloset - name = "\improper Synthetic Storage Closet" + name = "\improper Upper Deck Synthetic Storage Closet" icon_state = "livingspace" fake_zlevel = 1 // upperdeck @@ -738,16 +739,16 @@ hijack_evacuation_type = EVACUATION_TYPE_ADDITIVE /area/almayer/lifeboat_pumps/north1 - name = "North West Lifeboat Fuel Pump" + name = "Starboard Fore Lifeboat Fuel Pump" /area/almayer/lifeboat_pumps/north2 - name = "North East Lifeboat Fuel Pump" + name = "Starboard Aft Lifeboat Fuel Pump" /area/almayer/lifeboat_pumps/south1 - name = "South West Lifeboat Fuel Pump" + name = "Port Fore Lifeboat Fuel Pump" /area/almayer/lifeboat_pumps/south2 - name = "South East Lifeboat Fuel Pump" + name = "Port Aft Lifeboat Fuel Pump" /area/almayer/command/lifeboat name = "\improper Lifeboat Docking Port" @@ -760,7 +761,7 @@ flags_area = AREA_NOTUNNEL /area/space/almayer/lifeboat_dock - name = "\improper Lifeboat Docking Port" + name = "\improper Port Lifeboat Docking" icon_state = "lifeboat" fake_zlevel = 1 // upperdeck flags_area = AREA_NOTUNNEL diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index c81da5556e24..536e29599597 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -94,8 +94,8 @@ layer = AREAS_LAYER uid = ++global_uid . = ..() - active_areas += src - all_areas += src + GLOB.active_areas += src + GLOB.all_areas += src reg_in_areas_in_z() if(is_mainship_level(z)) GLOB.ship_areas += src @@ -138,13 +138,13 @@ C.network.Remove(CAMERA_NET_POWER_ALARMS) else C.network.Add(CAMERA_NET_POWER_ALARMS) - for (var/mob/living/silicon/aiPlayer in ai_mob_list) + for (var/mob/living/silicon/aiPlayer in GLOB.ai_mob_list) if(aiPlayer.z == source.z) if (state == 1) aiPlayer.cancelAlarm("Power", src, source) else aiPlayer.triggerAlarm("Power", src, cameras, source) - for(var/obj/structure/machinery/computer/station_alert/a in machines) + for(var/obj/structure/machinery/computer/station_alert/a in GLOB.machines) if(a.z == source.z) if(state == 1) a.cancelAlarm("Power", src, source) @@ -169,9 +169,9 @@ if (danger_level < 2 && atmosalm >= 2) for(var/obj/structure/machinery/camera/C in src) C.network.Remove(CAMERA_NET_ATMOSPHERE_ALARMS) - for(var/mob/living/silicon/aiPlayer in ai_mob_list) + for(var/mob/living/silicon/aiPlayer in GLOB.ai_mob_list) aiPlayer.cancelAlarm("Atmosphere", src, src) - for(var/obj/structure/machinery/computer/station_alert/a in machines) + for(var/obj/structure/machinery/computer/station_alert/a in GLOB.machines) a.cancelAlarm("Atmosphere", src, src) if (danger_level >= 2 && atmosalm < 2) @@ -180,9 +180,9 @@ for(var/obj/structure/machinery/camera/C in src) cameras += C C.network.Add(CAMERA_NET_ATMOSPHERE_ALARMS) - for(var/mob/living/silicon/aiPlayer in ai_mob_list) + for(var/mob/living/silicon/aiPlayer in GLOB.ai_mob_list) aiPlayer.triggerAlarm("Atmosphere", src, cameras, src) - for(var/obj/structure/machinery/computer/station_alert/a in machines) + for(var/obj/structure/machinery/computer/station_alert/a in GLOB.machines) a.triggerAlarm("Atmosphere", src, cameras, src) air_doors_close() @@ -231,9 +231,9 @@ for (var/obj/structure/machinery/camera/C in src) cameras.Add(C) C.network.Add(CAMERA_NET_FIRE_ALARMS) - for (var/mob/living/silicon/ai/aiPlayer in ai_mob_list) + for (var/mob/living/silicon/ai/aiPlayer in GLOB.ai_mob_list) aiPlayer.triggerAlarm("Fire", src, cameras, src) - for (var/obj/structure/machinery/computer/station_alert/a in machines) + for (var/obj/structure/machinery/computer/station_alert/a in GLOB.machines) a.triggerAlarm("Fire", src, cameras, src) /area/proc/firereset() @@ -249,9 +249,9 @@ INVOKE_ASYNC(D, TYPE_PROC_REF(/obj/structure/machinery/door, open)) for (var/obj/structure/machinery/camera/C in src) C.network.Remove(CAMERA_NET_FIRE_ALARMS) - for (var/mob/living/silicon/ai/aiPlayer in ai_mob_list) + for (var/mob/living/silicon/ai/aiPlayer in GLOB.ai_mob_list) aiPlayer.cancelAlarm("Fire", src, src) - for (var/obj/structure/machinery/computer/station_alert/a in machines) + for (var/obj/structure/machinery/computer/station_alert/a in GLOB.machines) a.cancelAlarm("Fire", src, src) /area/proc/readyalert() diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e0590265840c..5f36b3b8b390 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -166,7 +166,7 @@ directive is properly returned. if(!time) transform = complete return - animate(src, transform = complete, time = time, easing = easing) + animate(src, transform = complete, time = time, easing = easing, flags = ANIMATION_PARALLEL) /// Upates the base_transform which will be compounded with other transforms /atom/proc/update_base_transform(matrix/new_transform, time = 0) @@ -387,11 +387,11 @@ Parameters are passed from New. var/turf/opaque_turf = loc opaque_turf.directional_opacity = ALL_CARDINALS // No need to recalculate it in this case, it's guaranteed to be on afterwards anyways. - pass_flags = pass_flags_cache[type] + pass_flags = GLOB.pass_flags_cache[type] if (isnull(pass_flags)) pass_flags = new() initialize_pass_flags(pass_flags) - pass_flags_cache[type] = pass_flags + GLOB.pass_flags_cache[type] = pass_flags else initialize_pass_flags() Decorate(mapload) @@ -418,7 +418,7 @@ Parameters are passed from New. T.appearance = src.appearance T.setDir(src.dir) - clones_t.Add(src) + GLOB.clones_t.Add(src) src.clone = T // EFFECTS diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b8a901ccf321..21f7b6b0a9be 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -281,7 +281,7 @@ C.proj_x = shift_x C.proj_y = shift_y - clones.Add(C) + GLOB.clones.Add(C) C.mstr = src //Link clone and master src.clone = C @@ -313,7 +313,7 @@ clone.set_light(0) //Kill clone light /atom/movable/proc/destroy_clone() - clones.Remove(src.clone) + GLOB.clones.Remove(src.clone) qdel(src.clone) src.clone = null diff --git a/code/game/cas_manager/datums/cas_fire_mission.dm b/code/game/cas_manager/datums/cas_fire_mission.dm index 0a04876414e7..cb43caec30bb 100644 --- a/code/game/cas_manager/datums/cas_fire_mission.dm +++ b/code/game/cas_manager/datums/cas_fire_mission.dm @@ -114,7 +114,7 @@ if(get_turf(M) == initial_turf) relative_dir = 0 else - relative_dir = get_dir(M, initial_turf) + relative_dir = Get_Compass_Dir(M, initial_turf) var/ds_identifier = "LARGE BIRD" if (M.mob_flags & KNOWS_TECHNOLOGY) @@ -132,7 +132,7 @@ if(get_turf(M) == initial_turf) relative_dir = 0 else - relative_dir = get_dir(M, initial_turf) + relative_dir = Get_Compass_Dir(M, initial_turf) var/ds_identifier = "LARGE BIRD" if (M.mob_flags & KNOWS_TECHNOLOGY) diff --git a/code/game/cas_manager/datums/cas_iff_group.dm b/code/game/cas_manager/datums/cas_iff_group.dm index f384115d7756..dc39b462c9f1 100644 --- a/code/game/cas_manager/datums/cas_iff_group.dm +++ b/code/game/cas_manager/datums/cas_iff_group.dm @@ -8,8 +8,7 @@ /datum/cas_iff_group/proc/remove_signal(datum/cas_signal/signal) cas_signals -= signal -var/global/datum/cas_iff_group/uscm_cas_group = new /datum/cas_iff_group() +GLOBAL_DATUM_INIT(uscm_cas_group, /datum/cas_iff_group, new()) +GLOBAL_DATUM_INIT(upp_cas_group, /datum/cas_iff_group, new()) -var/global/datum/cas_iff_group/upp_cas_group = new /datum/cas_iff_group() - -var/global/list/datum/cas_iff_group/cas_groups = list(FACTION_MARINE = uscm_cas_group, FACTION_UPP = upp_cas_group, FACTION_NEUTRAL = uscm_cas_group) +GLOBAL_LIST_INIT_TYPED(cas_groups, /datum/cas_iff_group, list(FACTION_MARINE = GLOB.uscm_cas_group, FACTION_UPP = GLOB.upp_cas_group, FACTION_NEUTRAL = GLOB.uscm_cas_group)) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 17a255009089..ffcfd37489af 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -100,7 +100,7 @@ Additional game mode variables. /datum/game_mode/proc/get_roles_list() - return ROLES_USCM + return GLOB.ROLES_USCM //===================================================\\ @@ -109,16 +109,16 @@ Additional game mode variables. //===================================================\\ /datum/game_mode/proc/initialize_special_clamps() - xeno_starting_num = clamp((readied_players/CONFIG_GET(number/xeno_number_divider)), xeno_required_num, INFINITY) //(n, minimum, maximum) - surv_starting_num = clamp((readied_players/CONFIG_GET(number/surv_number_divider)), 2, 8) //this doesnt run + xeno_starting_num = clamp((GLOB.readied_players/CONFIG_GET(number/xeno_number_divider)), xeno_required_num, INFINITY) //(n, minimum, maximum) + surv_starting_num = clamp((GLOB.readied_players/CONFIG_GET(number/surv_number_divider)), 2, 8) //this doesnt run marine_starting_num = GLOB.player_list.len - xeno_starting_num - surv_starting_num - for(var/datum/squad/sq in RoleAuthority.squads) + for(var/datum/squad/sq in GLOB.RoleAuthority.squads) if(sq) sq.max_engineers = engi_slot_formula(marine_starting_num) sq.max_medics = medic_slot_formula(marine_starting_num) - for(var/i in RoleAuthority.roles_by_name) - var/datum/job/J = RoleAuthority.roles_by_name[i] + for(var/i in GLOB.RoleAuthority.roles_by_name) + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[i] if(J.scaled) J.set_spawn_positions(marine_starting_num) @@ -149,7 +149,7 @@ Additional game mode variables. else if(!istype(player,/mob/dead)) continue //Otherwise we just want to grab the ghosts. - if(RoleAuthority.roles_whitelist[player.ckey] & WHITELIST_PREDATOR) //Are they whitelisted? + if(GLOB.RoleAuthority.roles_whitelist[player.ckey] & WHITELIST_PREDATOR) //Are they whitelisted? if(!player.client.prefs) player.client.prefs = new /datum/preferences(player.client) //Somehow they don't have one. @@ -176,13 +176,13 @@ Additional game mode variables. if(!pred_candidate.client) return - var/datum/job/J = RoleAuthority.roles_by_name[JOB_PREDATOR] + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[JOB_PREDATOR] if(!J) if(show_warning) to_chat(pred_candidate, SPAN_WARNING("Something went wrong!")) return - if(!(RoleAuthority.roles_whitelist[pred_candidate.ckey] & WHITELIST_PREDATOR)) + if(!(GLOB.RoleAuthority.roles_whitelist[pred_candidate.ckey] & WHITELIST_PREDATOR)) if(show_warning) to_chat(pred_candidate, SPAN_WARNING("You are not whitelisted! You may apply on the forums to be whitelisted as a predator.")) return @@ -195,9 +195,9 @@ Additional game mode variables. to_chat(pred_candidate, SPAN_WARNING("You already were a Yautja! Give someone else a chance.")) return - if(show_warning && tgui_alert(pred_candidate, "Confirm joining the hunt. You will join as \a [lowertext(J.get_whitelist_status(RoleAuthority.roles_whitelist, pred_candidate.client))] predator", "Confirmation", list("Yes", "No"), 10 SECONDS) != "Yes") + if(show_warning && tgui_alert(pred_candidate, "Confirm joining the hunt. You will join as \a [lowertext(J.get_whitelist_status(GLOB.RoleAuthority.roles_whitelist, pred_candidate.client))] predator", "Confirmation", list("Yes", "No"), 10 SECONDS) != "Yes") return - if(J.get_whitelist_status(RoleAuthority.roles_whitelist, pred_candidate.client) == WHITELIST_NORMAL) + if(J.get_whitelist_status(GLOB.RoleAuthority.roles_whitelist, pred_candidate.client) == WHITELIST_NORMAL) var/pred_max = calculate_pred_max if(pred_current_num >= pred_max) if(show_warning) to_chat(pred_candidate, SPAN_WARNING("Only [pred_max] predators may spawn this round, but Councillors and Ancients do not count.")) @@ -234,13 +234,13 @@ Additional game mode variables. pred_candidate.mind.transfer_to(new_predator, TRUE) new_predator.client = pred_candidate.client - var/datum/job/J = RoleAuthority.roles_by_name[JOB_PREDATOR] + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[JOB_PREDATOR] if(!J) qdel(new_predator) return - RoleAuthority.equip_role(new_predator, J, new_predator.loc) + GLOB.RoleAuthority.equip_role(new_predator, J, new_predator.loc) return new_predator @@ -356,21 +356,27 @@ Additional game mode variables. else available_xenos_non_ssd += cur_xeno - // Only offer buried larva if there is no queue: - // This basically means this block of code will almost never execute, because we are instead relying on the hive cores/larva pops to handle their larva - // Technically this should be after a get_alien_candidates() call to be accurate, but we are intentionally trying to not call that proc as much as possible - if(GLOB.xeno_queue_candidate_count < 1) - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!hive.hardcore && hive.stored_larva && (hive.hive_location || (world.time < XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time))) - if(SSticker.mode && (SSticker.mode.flags_round_type & MODE_RANDOM_HIVE)) - available_xenos |= "any buried larva" - LAZYADD(available_xenos["any buried larva"], hive) - else - var/larva_option = "buried larva ([hive])" - available_xenos += larva_option - available_xenos[larva_option] = list(hive) + var/datum/hive_status/hive + for(var/hivenumber in GLOB.hive_datum) + hive = GLOB.hive_datum[hivenumber] + if(hive.hardcore) + continue + if(!hive.stored_larva) + continue + // Only offer buried larva if there is no queue because we are instead relying on the hive cores/larva pops to handle their larva: + // Technically this should be after a get_alien_candidates() call to be accurate, but we are intentionally trying to not call that proc as much as possible + if(hive.hive_location && GLOB.xeno_queue_candidate_count > 0) + continue + if(!hive.hive_location && (world.time > XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time)) + continue + + if(SSticker.mode && (SSticker.mode.flags_round_type & MODE_RANDOM_HIVE)) + available_xenos |= "any buried larva" + LAZYADD(available_xenos["any buried larva"], hive) + else + var/larva_option = "buried larva ([hive])" + available_xenos += larva_option + available_xenos[larva_option] = list(hive) if(!available_xenos.len || (instant_join && !available_xenos_non_ssd.len)) if(!xeno_candidate.client || !xeno_candidate.client.prefs || !(xeno_candidate.client.prefs.be_special & BE_ALIEN_AFTER_DEATH)) @@ -591,7 +597,14 @@ Additional game mode variables. for(var/obj/effect/alien/resin/special/pylon/cycled_pylon as anything in hive.hive_structures[XENO_STRUCTURE_PYLON]) if(cycled_pylon.lesser_drone_spawns >= 1) - selection_list += "[cycled_pylon.name] at [get_area(cycled_pylon)]" + var/pylon_number = 1 + var/pylon_name = "[cycled_pylon.name] at [get_area(cycled_pylon)]" + //For renaming the pylon if we have duplicates + var/pylon_selection_name = pylon_name + while(pylon_selection_name in selection_list) + pylon_selection_name = "[pylon_name] ([pylon_number])" + pylon_number ++ + selection_list += pylon_selection_name selection_list_structure += cycled_pylon if(!length(selection_list)) @@ -642,7 +655,7 @@ Additional game mode variables. // Let the round recorder know that the key has changed SSround_recording.recorder.update_key(new_xeno) if(new_xeno.client) - new_xeno.client.change_view(world_view_size) + new_xeno.client.change_view(GLOB.world_view_size) msg_admin_niche("[new_xeno.key] has joined as [new_xeno].") if(isxeno(new_xeno)) //Dear lord @@ -909,7 +922,7 @@ Additional game mode variables. CVS.populate_product_list_and_boxes(scale) //Scale the amount of cargo points through a direct multiplier - supply_controller.points = round(supply_controller.points * scale) + GLOB.supply_controller.points = round(GLOB.supply_controller.points * scale) /datum/game_mode/proc/get_scaling_value() //We take the number of marine players, deduced from other lists, and then get a scale multiplier from it, to be used in arbitrary manners to distribute equipment @@ -951,14 +964,14 @@ Additional game mode variables. if(!joe_candidate.client) return - var/datum/job/joe_job = RoleAuthority.roles_by_name[JOB_WORKING_JOE] + var/datum/job/joe_job = GLOB.RoleAuthority.roles_by_name[JOB_WORKING_JOE] if(!joe_job) if(show_warning) to_chat(joe_candidate, SPAN_WARNING("Something went wrong!")) return - if(!(RoleAuthority.roles_whitelist[joe_candidate.ckey] & WHITELIST_JOE)) + if(!(GLOB.RoleAuthority.roles_whitelist[joe_candidate.ckey] & WHITELIST_JOE)) if(show_warning) to_chat(joe_candidate, SPAN_WARNING("You are not whitelisted! You may apply on the forums to be whitelisted as a synth.")) return @@ -969,14 +982,14 @@ Additional game mode variables. return // council doesn't count towards this conditional. - if(joe_job.get_whitelist_status(RoleAuthority.roles_whitelist, joe_candidate.client) == WHITELIST_NORMAL) + if(joe_job.get_whitelist_status(GLOB.RoleAuthority.roles_whitelist, joe_candidate.client) == WHITELIST_NORMAL) var/joe_max = joe_job.total_positions if((joe_job.current_positions >= joe_max) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) if(show_warning) to_chat(joe_candidate, SPAN_WARNING("Only [joe_max] Working Joes may spawn per round.")) return - if(!enter_allowed && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + if(!GLOB.enter_allowed && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) if(show_warning) to_chat(joe_candidate, SPAN_WARNING("There is an administrative lock from entering the game.")) return @@ -996,14 +1009,14 @@ Additional game mode variables. var/turf/spawn_point = get_turf(pick(GLOB.latejoin_by_job[JOB_WORKING_JOE])) var/mob/living/carbon/human/synthetic/new_joe = new(spawn_point) joe_candidate.mind.transfer_to(new_joe, TRUE) - var/datum/job/joe_job = RoleAuthority.roles_by_name[JOB_WORKING_JOE] + var/datum/job/joe_job = GLOB.RoleAuthority.roles_by_name[JOB_WORKING_JOE] if(!joe_job) qdel(new_joe) return // This is usually done in assign_role, a proc which is not executed in this case, since check_joe_late_join is running its own checks. joe_job.current_positions++ - RoleAuthority.equip_role(new_joe, joe_job, new_joe.loc) + GLOB.RoleAuthority.equip_role(new_joe, joe_job, new_joe.loc) GLOB.data_core.manifest_inject(new_joe) SSticker.minds += new_joe.mind return new_joe diff --git a/code/game/gamemodes/cm_process.dm b/code/game/gamemodes/cm_process.dm index 33377f7dc6fd..462f82e99cec 100644 --- a/code/game/gamemodes/cm_process.dm +++ b/code/game/gamemodes/cm_process.dm @@ -39,16 +39,16 @@ of predators), but can be added to include variant game modes (like humans vs. h /datum/game_mode/proc/declare_completion_announce_fallen_soldiers() set waitfor = 0 sleep(2 SECONDS) - fallen_list += fallen_list_cross - if(fallen_list.len) + GLOB.fallen_list += GLOB.fallen_list_cross + if(GLOB.fallen_list.len) var/dat = "
" dat += SPAN_ROUNDBODY("In Flanders fields...
") dat += SPAN_CENTERBOLD("In memoriam of our fallen soldiers:
") - for(var/i = 1 to fallen_list.len) - if(i != fallen_list.len) - dat += "[fallen_list[i]], " + for(var/i = 1 to GLOB.fallen_list.len) + if(i != GLOB.fallen_list.len) + dat += "[GLOB.fallen_list[i]], " else - dat += "[fallen_list[i]].
" + dat += "[GLOB.fallen_list[i]].
" to_world("[dat]") @@ -134,7 +134,7 @@ of predators), but can be added to include variant game modes (like humans vs. h // Open podlocks with the given ID if they aren't already opened. // DO NOT USE THIS WITH ID's CORRESPONDING TO SHUTTLES OR THEY WILL BREAK! /datum/game_mode/proc/open_podlocks(podlock_id) - for(var/obj/structure/machinery/door/poddoor/M in machines) + for(var/obj/structure/machinery/door/poddoor/M in GLOB.machines) if(M.id == podlock_id && M.density) M.open() diff --git a/code/game/gamemodes/colonialmarines/colonialmarines.dm b/code/game/gamemodes/colonialmarines/colonialmarines.dm index 7b1c695ade2b..bc5d6b69228c 100644 --- a/code/game/gamemodes/colonialmarines/colonialmarines.dm +++ b/code/game/gamemodes/colonialmarines/colonialmarines.dm @@ -29,7 +29,7 @@ to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDHEADER("The current map is - [SSmapping.configs[GROUND_MAP].map_name]!")) /datum/game_mode/colonialmarines/get_roles_list() - return ROLES_DISTRESS_SIGNAL + return GLOB.ROLES_DISTRESS_SIGNAL //////////////////////////////////////////////////////////////////////////////////////// //Temporary, until we sort this out properly. @@ -126,7 +126,7 @@ #define MONKEYS_TO_TOTAL_RATIO 1/32 /datum/game_mode/colonialmarines/proc/spawn_smallhosts() - if(!players_preassigned) + if(!GLOB.players_preassigned) return monkey_types = SSmapping.configs[GROUND_MAP].monkey_types @@ -134,7 +134,7 @@ if(!length(monkey_types)) return - var/amount_to_spawn = round(players_preassigned * MONKEYS_TO_TOTAL_RATIO) + var/amount_to_spawn = round(GLOB.players_preassigned * MONKEYS_TO_TOTAL_RATIO) for(var/i in 0 to min(amount_to_spawn, length(GLOB.monkey_spawns))) var/turf/T = get_turf(pick_n_take(GLOB.monkey_spawns)) @@ -167,7 +167,7 @@ check_ground_humans() if(next_research_allocation < world.time) - chemical_data.update_credits(chemical_data.research_allocation_amount) + GLOB.chemical_data.update_credits(GLOB.chemical_data.research_allocation_amount) next_research_allocation = world.time + research_allocation_interval if(!round_finished) @@ -205,7 +205,7 @@ to_chat(M, SPAN_XENOANNOUNCE("To my children and their Queen. I sense the large doors that trap us will open in 30 seconds.")) addtimer(CALLBACK(src, PROC_REF(open_podlocks), "map_lockdown"), 300) - if(round_should_check_for_win) + if(GLOB.round_should_check_for_win) check_win() round_checkwin = 0 @@ -353,15 +353,15 @@ if(MODE_INFESTATION_X_MAJOR) musical_track = pick('sound/theme/sad_loss1.ogg','sound/theme/sad_loss2.ogg') end_icon = "xeno_major" - if(round_statistics && round_statistics.current_map) - round_statistics.current_map.total_xeno_victories++ - round_statistics.current_map.total_xeno_majors++ + if(GLOB.round_statistics && GLOB.round_statistics.current_map) + GLOB.round_statistics.current_map.total_xeno_victories++ + GLOB.round_statistics.current_map.total_xeno_majors++ if(MODE_INFESTATION_M_MAJOR) musical_track = pick('sound/theme/winning_triumph1.ogg','sound/theme/winning_triumph2.ogg') end_icon = "marine_major" - if(round_statistics && round_statistics.current_map) - round_statistics.current_map.total_marine_victories++ - round_statistics.current_map.total_marine_majors++ + if(GLOB.round_statistics && GLOB.round_statistics.current_map) + GLOB.round_statistics.current_map.total_marine_victories++ + GLOB.round_statistics.current_map.total_marine_majors++ if(MODE_INFESTATION_X_MINOR) var/list/living_player_list = count_humans_and_xenos(get_affected_zlevels()) if(living_player_list[1] && !living_player_list[2]) // If Xeno Minor but Xenos are dead and Humans are alive, see which faction is the last standing @@ -378,28 +378,28 @@ else musical_track = pick('sound/theme/neutral_melancholy1.ogg') end_icon = "xeno_minor" - if(round_statistics && round_statistics.current_map) - round_statistics.current_map.total_xeno_victories++ + if(GLOB.round_statistics && GLOB.round_statistics.current_map) + GLOB.round_statistics.current_map.total_xeno_victories++ if(MODE_INFESTATION_M_MINOR) musical_track = pick('sound/theme/neutral_hopeful1.ogg','sound/theme/neutral_hopeful2.ogg') end_icon = "marine_minor" - if(round_statistics && round_statistics.current_map) - round_statistics.current_map.total_marine_victories++ + if(GLOB.round_statistics && GLOB.round_statistics.current_map) + GLOB.round_statistics.current_map.total_marine_victories++ if(MODE_INFESTATION_DRAW_DEATH) end_icon = "draw" musical_track = 'sound/theme/neutral_hopeful2.ogg' - if(round_statistics && round_statistics.current_map) - round_statistics.current_map.total_draws++ + if(GLOB.round_statistics && GLOB.round_statistics.current_map) + GLOB.round_statistics.current_map.total_draws++ var/sound/S = sound(musical_track, channel = SOUND_CHANNEL_LOBBY) S.status = SOUND_STREAM sound_to(world, S) - if(round_statistics) - round_statistics.game_mode = name - round_statistics.round_length = world.time - round_statistics.round_result = round_finished - round_statistics.end_round_player_population = GLOB.clients.len + if(GLOB.round_statistics) + GLOB.round_statistics.game_mode = name + GLOB.round_statistics.round_length = world.time + GLOB.round_statistics.round_result = round_finished + GLOB.round_statistics.end_round_player_population = GLOB.clients.len - round_statistics.log_round_statistics() + GLOB.round_statistics.log_round_statistics() calculate_end_statistics() show_end_statistics(end_icon) @@ -440,11 +440,11 @@ ) //organize our jobs in a readable and standard way - for(var/job in ROLES_MARINES) + for(var/job in GLOB.ROLES_MARINES) counted_humans["Squad Marines"][job] = 0 - for(var/job in ROLES_USCM - ROLES_MARINES) + for(var/job in GLOB.ROLES_USCM - GLOB.ROLES_MARINES) counted_humans["Auxiliary Marines"][job] = 0 - for(var/job in ROLES_SPECIAL) + for(var/job in GLOB.ROLES_SPECIAL) counted_humans["Non-Standard Humans"][job] = 0 var/list/counted_xenos = list() @@ -463,7 +463,7 @@ if(player_client.mob && player_client.mob.stat != DEAD) if(ishuman(player_client.mob)) if(player_client.mob.faction == FACTION_MARINE) - if(player_client.mob.job in (ROLES_MARINES)) + if(player_client.mob.job in (GLOB.ROLES_MARINES)) counted_humans["Squad Marines"][player_client.mob.job]++ else counted_humans["Auxiliary Marines"][player_client.mob.job]++ diff --git a/code/game/gamemodes/colonialmarines/huntergames.dm b/code/game/gamemodes/colonialmarines/huntergames.dm index bd5302bf7ec0..aad0f9ba5787 100644 --- a/code/game/gamemodes/colonialmarines/huntergames.dm +++ b/code/game/gamemodes/colonialmarines/huntergames.dm @@ -83,8 +83,6 @@ 100; /obj/item/clothing/suit/storage/CMB \ ) -var/waiting_for_drop_votes = 0 - //Digging through this is a pain. I'm leaving it mostly alone until a full rework takes place. /datum/game_mode/huntergames @@ -105,6 +103,8 @@ var/waiting_for_drop_votes = 0 var/ticks_passed = 0 var/drops_disabled = 0 + var/waiting_for_drop_votes = FALSE + votable = FALSE // borkeds taskbar_icon = 'icons/taskbar/gml_hgames.png' @@ -234,7 +234,7 @@ var/waiting_for_drop_votes = 0 H = new(picked) H.key = M.key - if(H.client) H.client.change_view(world_view_size) + if(H.client) H.client.change_view(GLOB.world_view_size) if(!H.mind) H.mind = new(H.key) @@ -393,8 +393,8 @@ var/waiting_for_drop_votes = 0 //Announces the end of the game with all relevant information stated// ////////////////////////////////////////////////////////////////////// /datum/game_mode/huntergames/declare_completion() - if(round_statistics) - round_statistics.track_round_end() + if(GLOB.round_statistics) + GLOB.round_statistics.track_round_end() var/mob/living/carbon/winner = null for(var/mob/living/carbon/human/Q in GLOB.alive_mob_list) @@ -415,12 +415,12 @@ var/waiting_for_drop_votes = 0 to_world("There was a winner, but they died before they could receive the prize!! Bummer.") world << 'sound/misc/sadtrombone.ogg' - if(round_statistics) - round_statistics.game_mode = name - round_statistics.round_length = world.time - round_statistics.end_round_player_population = count_humans() + if(GLOB.round_statistics) + GLOB.round_statistics.game_mode = name + GLOB.round_statistics.round_length = world.time + GLOB.round_statistics.end_round_player_population = count_humans() - round_statistics.log_round_statistics() + GLOB.round_statistics.log_round_statistics() return 1 diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm index 9b3ef1df4c15..3bc56728a7b9 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm @@ -2,7 +2,7 @@ //Global proc for checking if the game is whiskey outpost so I dont need to type if(gamemode == whiskey outpost) 50000 times /proc/Check_WO() - if(SSticker.mode == GAMEMODE_WHISKEY_OUTPOST || master_mode == GAMEMODE_WHISKEY_OUTPOST) + if(SSticker.mode == GAMEMODE_WHISKEY_OUTPOST || GLOB.master_mode == GAMEMODE_WHISKEY_OUTPOST) return 1 return 0 @@ -81,7 +81,7 @@ taskbar_icon = 'icons/taskbar/gml_wo.png' /datum/game_mode/whiskey_outpost/get_roles_list() - return ROLES_WO + return GLOB.ROLES_WO /datum/game_mode/whiskey_outpost/announce() return 1 @@ -178,7 +178,7 @@ if(checkwin_counter >= 10) //Only check win conditions every 10 ticks. if(xeno_wave == WO_MAX_WAVE && last_wave_time == 0) last_wave_time = world.time - if(!finished && round_should_check_for_win && last_wave_time != 0) + if(!finished && GLOB.round_should_check_for_win && last_wave_time != 0) check_win() checkwin_counter = 0 return 0 @@ -212,8 +212,8 @@ finished = 2 //Marine win /datum/game_mode/whiskey_outpost/proc/disablejoining() - for(var/i in RoleAuthority.roles_by_name) - var/datum/job/J = RoleAuthority.roles_by_name[i] + for(var/i in GLOB.RoleAuthority.roles_by_name) + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[i] // If the job has unlimited job slots, We set the amount of slots to the amount it has at the moment this is called if (J.spawn_positions < 0) @@ -254,8 +254,8 @@ //Announces the end of the game with all relevant information stated// ////////////////////////////////////////////////////////////////////// /datum/game_mode/whiskey_outpost/declare_completion() - if(round_statistics) - round_statistics.track_round_end() + if(GLOB.round_statistics) + GLOB.round_statistics.track_round_end() if(finished == 1) log_game("Round end result - xenos won") to_world(SPAN_ROUND_HEADER("The Xenos have succesfully defended their hive from colonization.")) @@ -263,11 +263,11 @@ to_world(SPAN_ROUNDBODY("It will be another five years before the USCM returns to the Neroid Sector, with the arrival of the 2nd 'Falling Falcons' Battalion and the USS Almayer.")) to_world(SPAN_ROUNDBODY("The xenomorph hive on LV-624 remains unthreatened until then...")) world << sound('sound/misc/Game_Over_Man.ogg') - if(round_statistics) - round_statistics.round_result = MODE_INFESTATION_X_MAJOR - if(round_statistics.current_map) - round_statistics.current_map.total_xeno_victories++ - round_statistics.current_map.total_xeno_majors++ + if(GLOB.round_statistics) + GLOB.round_statistics.round_result = MODE_INFESTATION_X_MAJOR + if(GLOB.round_statistics.current_map) + GLOB.round_statistics.current_map.total_xeno_victories++ + GLOB.round_statistics.current_map.total_xeno_majors++ else if(finished == 2) log_game("Round end result - marines won") @@ -276,26 +276,26 @@ to_world(SPAN_ROUNDBODY("Eventually, the Dust Raiders secure LV-624 and the entire Neroid Sector in 2182, pacifiying it and establishing peace in the sector for decades to come.")) to_world(SPAN_ROUNDBODY("The USS Almayer and the 2nd 'Falling Falcons' Battalion are never sent to the sector and are spared their fate in 2186.")) world << sound('sound/misc/hell_march.ogg') - if(round_statistics) - round_statistics.round_result = MODE_INFESTATION_M_MAJOR - if(round_statistics.current_map) - round_statistics.current_map.total_marine_victories++ - round_statistics.current_map.total_marine_majors++ + if(GLOB.round_statistics) + GLOB.round_statistics.round_result = MODE_INFESTATION_M_MAJOR + if(GLOB.round_statistics.current_map) + GLOB.round_statistics.current_map.total_marine_victories++ + GLOB.round_statistics.current_map.total_marine_majors++ else log_game("Round end result - no winners") to_world(SPAN_ROUND_HEADER("NOBODY WON!")) to_world(SPAN_ROUNDBODY("How? Don't ask me...")) world << 'sound/misc/sadtrombone.ogg' - if(round_statistics) - round_statistics.round_result = MODE_INFESTATION_DRAW_DEATH + if(GLOB.round_statistics) + GLOB.round_statistics.round_result = MODE_INFESTATION_DRAW_DEATH - if(round_statistics) - round_statistics.game_mode = name - round_statistics.round_length = world.time - round_statistics.end_round_player_population = GLOB.clients.len + if(GLOB.round_statistics) + GLOB.round_statistics.game_mode = name + GLOB.round_statistics.round_length = world.time + GLOB.round_statistics.end_round_player_population = GLOB.clients.len - round_statistics.log_round_statistics() + GLOB.round_statistics.log_round_statistics() round_finished = 1 @@ -511,10 +511,10 @@ unacidable = TRUE var/working = 0 -/obj/structure/machinery/wo_recycler/attack_hand(mob/user) +/obj/structure/machinery/wo_recycler/attack_hand(mob/living/user) if(inoperable(MAINT)) return - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return if(ismaintdrone(usr) || \ istype(usr, /mob/living/carbon/xenomorph)) diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm index ae272da88690..6e2738a83788 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm @@ -52,12 +52,12 @@ if(!xeno_candidate) return FALSE - if(RoleAuthority.castes_by_name[userInput]) + if(GLOB.RoleAuthority.castes_by_name[userInput]) if(!(userInput in xeno_pool)) to_chat(xeno_candidate, SPAN_WARNING("The caste type you chose was occupied by someone else.")) return FALSE var/spawn_loc = pick(xeno_spawns) - var/xeno_type = RoleAuthority.get_caste_by_text(userInput) + var/xeno_type = GLOB.RoleAuthority.get_caste_by_text(userInput) var/mob/living/carbon/xenomorph/new_xeno = new xeno_type(spawn_loc) if(new_xeno.hive.construction_allowed == NORMAL_XENO) new_xeno.hive.construction_allowed = XENO_QUEEN diff --git a/code/game/gamemodes/colonialmarines/xenovsxeno.dm b/code/game/gamemodes/colonialmarines/xenovsxeno.dm index a19c3e3582c1..a9ad48196257 100644 --- a/code/game/gamemodes/colonialmarines/xenovsxeno.dm +++ b/code/game/gamemodes/colonialmarines/xenovsxeno.dm @@ -26,9 +26,9 @@ /* Pre-pre-startup */ /datum/game_mode/xenovs/can_start() for(var/hivename in SSmapping.configs[GROUND_MAP].xvx_hives) - if(readied_players > SSmapping.configs[GROUND_MAP].xvx_hives[hivename]) + if(GLOB.readied_players > SSmapping.configs[GROUND_MAP].xvx_hives[hivename]) hives += hivename - xeno_starting_num = readied_players + xeno_starting_num = GLOB.readied_players if(!initialize_starting_xenomorph_list(hives, TRUE)) hives.Cut() return @@ -38,7 +38,7 @@ to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDHEADER("The current map is - [SSmapping.configs[GROUND_MAP].map_name]!")) /datum/game_mode/xenovs/get_roles_list() - return ROLES_XENO + return GLOB.ROLES_XENO /* Pre-setup */ /datum/game_mode/xenovs/pre_setup() @@ -91,7 +91,7 @@ initialize_post_xenomorph_list(GLOB.xeno_hive_spawns) round_time_lobby = world.time - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(!(A.is_resin_allowed)) A.is_resin_allowed = TRUE @@ -141,7 +141,6 @@ original.statistic_exempt = TRUE original.buckled = start_nest original.setDir(start_nest.dir) - original.update_canmove() start_nest.buckled_mob = original start_nest.afterbuckle(original) @@ -193,7 +192,7 @@ qdel(C) hive_cores = list() - if(round_should_check_for_win) + if(GLOB.round_should_check_for_win) check_win() round_checkwin = 0 @@ -263,12 +262,12 @@ var/sound/S = sound(musical_track, channel = SOUND_CHANNEL_LOBBY) S.status = SOUND_STREAM sound_to(world, S) - if(round_statistics) - round_statistics.game_mode = name - round_statistics.round_length = world.time - round_statistics.end_round_player_population = GLOB.clients.len + if(GLOB.round_statistics) + GLOB.round_statistics.game_mode = name + GLOB.round_statistics.round_length = world.time + GLOB.round_statistics.end_round_player_population = GLOB.clients.len - round_statistics.log_round_statistics() + GLOB.round_statistics.log_round_statistics() declare_completion_announce_xenomorphs() calculate_end_statistics() @@ -278,11 +277,11 @@ return TRUE /datum/game_mode/xenovs/announce_ending() - if(round_statistics) - round_statistics.track_round_end() + if(GLOB.round_statistics) + GLOB.round_statistics.track_round_end() log_game("Round end result: [round_finished]") to_chat_spaced(world, margin_top = 2, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDHEADER("|Round Complete|")) - to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDBODY("Thus ends the story of the battling hives on [SSmapping.configs[GROUND_MAP].map_name]. [round_finished]\nThe game-mode was: [master_mode]!\n[CONFIG_GET(string/endofroundblurb)]")) + to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDBODY("Thus ends the story of the battling hives on [SSmapping.configs[GROUND_MAP].map_name]. [round_finished]\nThe game-mode was: [GLOB.master_mode]!\n[CONFIG_GET(string/endofroundblurb)]")) // for the toolbox /datum/game_mode/xenovs/end_round_message() diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index db8f84d53f24..1039d495396b 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -3,7 +3,7 @@ /proc/carp_migration() // -- Darem //sleep(100) spawn(rand(300, 600)) //Delayed announcements to keep the crew on their toes. - marine_announcement("Unknown biological entities have been detected near [station_name], please stand-by.", "Lifesign Alert", 'sound/AI/commandreport.ogg') + marine_announcement("Unknown biological entities have been detected near [MAIN_SHIP_NAME], please stand-by.", "Lifesign Alert", 'sound/AI/commandreport.ogg') /proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights if(isEvent) @@ -13,7 +13,7 @@ return else - for(var/obj/structure/machinery/power/apc/apc in machines) + for(var/obj/structure/machinery/power/apc/apc in GLOB.machines) apc.overload_lighting() return diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index 7905c19fac41..5ebedd8fd26d 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -2,7 +2,7 @@ /proc/power_failure(announce = 1) var/ship_zlevels = SSmapping.levels_by_trait(ZTRAIT_MARINE_MAIN_SHIP) - for(var/obj/structure/machinery/power/smes/S in machines) + for(var/obj/structure/machinery/power/smes/S in GLOB.machines) if(!is_mainship_level(S.z)) continue S.last_charge = S.charge @@ -14,7 +14,7 @@ S.updateicon() S.power_change() - for(var/obj/structure/machinery/power/apc/C in machines) + for(var/obj/structure/machinery/power/apc/C in GLOB.machines) if(!is_mainship_level(C.z) && C.cell) C.cell.charge = 0 @@ -25,7 +25,7 @@ marine_announcement("Abnormal activity detected in the ship power system. As a precaution, power must be shut down for an indefinite duration.", "Critical Power Failure", 'sound/AI/poweroff.ogg') /proc/power_restore(announce = 1) - for(var/obj/structure/machinery/power/smes/S in machines) + for(var/obj/structure/machinery/power/smes/S in GLOB.machines) if(!is_mainship_level(S.z)) continue S.charge = S.capacity @@ -34,7 +34,7 @@ S.updateicon() S.power_change() - for(var/obj/structure/machinery/power/apc/C in machines) + for(var/obj/structure/machinery/power/apc/C in GLOB.machines) if(C.cell && is_mainship_level(C.z)) C.cell.charge = C.cell.maxcharge @@ -44,7 +44,7 @@ /proc/power_restore_quick(announce = 1) - for(var/obj/structure/machinery/power/smes/S in machines) + for(var/obj/structure/machinery/power/smes/S in GLOB.machines) if(!is_mainship_level(S.z)) // Ship only continue S.charge = S.capacity @@ -59,14 +59,14 @@ /proc/power_restore_everything(announce = 1) - for(var/obj/structure/machinery/power/smes/S in machines) + for(var/obj/structure/machinery/power/smes/S in GLOB.machines) S.charge = S.capacity S.output_level = S.output_level_max S.outputting = 1 S.updateicon() S.power_change() - for(var/obj/structure/machinery/power/apc/C in machines) + for(var/obj/structure/machinery/power/apc/C in GLOB.machines) if(C.cell) C.cell.charge = C.cell.maxcharge @@ -75,7 +75,7 @@ marine_announcement("Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg') /proc/power_restore_ship_reactors(announce = 1) - for(var/obj/structure/machinery/power/fusion_engine/FE in machines) + for(var/obj/structure/machinery/power/fusion_engine/FE in GLOB.machines) FE.buildstate = 0 FE.is_on = 1 FE.fusion_cell = new diff --git a/code/game/gamemodes/extended/extended.dm b/code/game/gamemodes/extended/extended.dm index f00125cc8f0f..72512a7e77ff 100644 --- a/code/game/gamemodes/extended/extended.dm +++ b/code/game/gamemodes/extended/extended.dm @@ -12,7 +12,7 @@ to_world("The current game mode is - Extended!") /datum/game_mode/extended/get_roles_list() - return ROLES_USCM + return GLOB.ROLES_USCM /datum/game_mode/extended/post_setup() initialize_post_marine_gear_list() @@ -24,7 +24,7 @@ /datum/game_mode/extended/process() . = ..() if(next_research_allocation < world.time) - chemical_data.update_credits(chemical_data.research_allocation_amount) + GLOB.chemical_data.update_credits(GLOB.chemical_data.research_allocation_amount) next_research_allocation = world.time + research_allocation_interval /datum/game_mode/extended/check_finished() @@ -39,11 +39,11 @@ var/musical_track = pick('sound/theme/neutral_hopeful1.ogg','sound/theme/neutral_hopeful2.ogg') world << musical_track - if(round_statistics) - round_statistics.game_mode = name - round_statistics.round_length = world.time - round_statistics.end_round_player_population = GLOB.clients.len - round_statistics.log_round_statistics() + if(GLOB.round_statistics) + GLOB.round_statistics.game_mode = name + GLOB.round_statistics.round_length = world.time + GLOB.round_statistics.end_round_player_population = GLOB.clients.len + GLOB.round_statistics.log_round_statistics() calculate_end_statistics() declare_completion_announce_predators() diff --git a/code/game/gamemodes/extended/extended_clash.dm b/code/game/gamemodes/extended/extended_clash.dm index 04077de2775c..e0e526d91afa 100644 --- a/code/game/gamemodes/extended/extended_clash.dm +++ b/code/game/gamemodes/extended/extended_clash.dm @@ -6,7 +6,7 @@ taskbar_icon = 'icons/taskbar/gml_hvh.png' /datum/game_mode/extended/faction_clash/get_roles_list() - return ROLES_FACTION_CLASH + return GLOB.ROLES_FACTION_CLASH /datum/game_mode/extended/faction_clash/post_setup() . = ..() diff --git a/code/game/gamemodes/extended/infection.dm b/code/game/gamemodes/extended/infection.dm index a6b909022aef..1e0032a8e6fa 100644 --- a/code/game/gamemodes/extended/infection.dm +++ b/code/game/gamemodes/extended/infection.dm @@ -15,7 +15,7 @@ to_world("Don't ahelp asking for specific details, you won't get them.") /datum/game_mode/infection/get_roles_list() - return ROLES_USCM + return GLOB.ROLES_USCM /datum/game_mode/infection/pre_setup() return ..() @@ -61,7 +61,7 @@ possible_synth_survivors -= A continue - if(RoleAuthority.roles_whitelist[ckey(A.key)] & WHITELIST_SYNTHETIC) + if(GLOB.RoleAuthority.roles_whitelist[ckey(A.key)] & WHITELIST_SYNTHETIC) if(A in possible_survivors) continue //they are already applying to be a survivor else @@ -120,11 +120,11 @@ var/musical_track = pick('sound/theme/sad_loss1.ogg','sound/theme/sad_loss2.ogg') world << musical_track - if(round_statistics) - round_statistics.game_mode = name - round_statistics.round_length = world.time - round_statistics.end_round_player_population = GLOB.clients.len - round_statistics.log_round_statistics() + if(GLOB.round_statistics) + GLOB.round_statistics.game_mode = name + GLOB.round_statistics.round_length = world.time + GLOB.round_statistics.end_round_player_population = GLOB.clients.len + GLOB.round_statistics.log_round_statistics() declare_completion_announce_xenomorphs() declare_completion_announce_predators() diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index e467631c915e..3bb8c2d80123 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -11,9 +11,9 @@ * */ -var/global/datum/entity/statistic/round/round_statistics -var/global/list/datum/entity/player_entity/player_entities = list() -var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracking_ids to tacbinos and signal flares +GLOBAL_DATUM(round_statistics, /datum/entity/statistic/round) +GLOBAL_LIST_INIT_TYPED(player_entities, /datum/entity/player_entity, list()) +GLOBAL_VAR_INIT(cas_tracking_id_increment, 0) //this var used to assign unique tracking_ids to tacbinos and signal flares /datum/game_mode var/name = "invalid" var/config_tag = null @@ -56,7 +56,7 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki if((player.client)&&(player.ready)) playerC++ - if(master_mode=="secret") + if(GLOB.master_mode=="secret") if(playerC >= required_players_secret) return 1 else @@ -129,15 +129,15 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki return /datum/game_mode/proc/announce_ending() - if(round_statistics) - round_statistics.track_round_end() + if(GLOB.round_statistics) + GLOB.round_statistics.track_round_end() log_game("Round end result: [round_finished]") to_chat_spaced(world, margin_top = 2, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDHEADER("|Round Complete|")) - to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDBODY("Thus ends the story of the brave men and women of the [MAIN_SHIP_NAME] and their struggle on [SSmapping.configs[GROUND_MAP].map_name].\nThe game-mode was: [master_mode]!\n[CONFIG_GET(string/endofroundblurb)]")) + to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDBODY("Thus ends the story of the brave men and women of the [MAIN_SHIP_NAME] and their struggle on [SSmapping.configs[GROUND_MAP].map_name].\nThe game-mode was: [GLOB.master_mode]!\n[CONFIG_GET(string/endofroundblurb)]")) /datum/game_mode/proc/declare_completion() - if(round_statistics) - round_statistics.track_round_end() + if(GLOB.round_statistics) + GLOB.round_statistics.track_round_end() var/clients = 0 var/surviving_humans = 0 var/surviving_total = 0 @@ -181,7 +181,7 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki record_playtime(M.client.player_data, M.job, type) /datum/game_mode/proc/show_end_statistics(icon_state) - round_statistics.update_panel_data() + GLOB.round_statistics.update_panel_data() for(var/mob/M in GLOB.player_list) if(M.client) give_action(M, /datum/action/show_round_statistics, null, icon_state) @@ -226,7 +226,7 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki var/list/heads = list() for(var/i in GLOB.alive_human_list) var/mob/living/carbon/human/player = i - if(player.stat!=2 && player.mind && (player.job in ROLES_COMMAND )) + if(player.stat!=2 && player.mind && (player.job in GLOB.ROLES_COMMAND )) heads += player.mind return heads @@ -237,7 +237,7 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki /datum/game_mode/proc/get_all_heads() var/list/heads = list() for(var/mob/player in GLOB.mob_list) - if(player.mind && (player.job in ROLES_COMMAND )) + if(player.mind && (player.job in GLOB.ROLES_COMMAND )) heads += player.mind return heads diff --git a/code/game/jobs/job/antag/other/pred.dm b/code/game/jobs/job/antag/other/pred.dm index a8bcec788c44..77439276d04a 100644 --- a/code/game/jobs/job/antag/other/pred.dm +++ b/code/game/jobs/job/antag/other/pred.dm @@ -41,7 +41,7 @@ player.clan_info.sync() // pause here might be problematic, we'll see. If DB dies, then we're fucked - var/rank = clan_ranks[player.clan_info.clan_rank] + var/rank = GLOB.clan_ranks[player.clan_info.clan_rank] if(!rank) return CLAN_RANK_BLOODED diff --git a/code/game/jobs/job/antag/xeno/xenomorph.dm b/code/game/jobs/job/antag/xeno/xenomorph.dm index 53b06147e28c..78b6ab7e3ab2 100644 --- a/code/game/jobs/job/antag/xeno/xenomorph.dm +++ b/code/game/jobs/job/antag/xeno/xenomorph.dm @@ -88,9 +88,8 @@ break human_to_transform.statistic_exempt = TRUE - human_to_transform.buckled = start_nest + human_to_transform.set_buckled(start_nest) human_to_transform.setDir(start_nest.dir) - human_to_transform.update_canmove() start_nest.buckled_mob = human_to_transform start_nest.afterbuckle(human_to_transform) diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 48ad372e1f33..56decd8f0c02 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -274,7 +274,7 @@ var/mob/living/carbon/human/human = M var/job_whitelist = title - var/whitelist_status = get_whitelist_status(RoleAuthority.roles_whitelist, human.client) + var/whitelist_status = get_whitelist_status(GLOB.RoleAuthority.roles_whitelist, human.client) if(whitelist_status) job_whitelist = "[title][whitelist_status]" @@ -293,9 +293,9 @@ generate_entry_conditions(human) //Do any other thing that relates to their spawn. if(flags_startup_parameters & ROLE_ADD_TO_SQUAD) //Are we a muhreen? Randomize our squad. This should go AFTER IDs. //TODO Robust this later. - RoleAuthority.randomize_squad(human) + GLOB.RoleAuthority.randomize_squad(human) - if(Check_WO() && job_squad_roles.Find(GET_DEFAULT_ROLE(human.job))) //activates self setting proc for marine headsets for WO + if(Check_WO() && GLOB.job_squad_roles.Find(GET_DEFAULT_ROLE(human.job))) //activates self setting proc for marine headsets for WO var/datum/game_mode/whiskey_outpost/WO = SSticker.mode WO.self_set_headset(human) diff --git a/code/game/jobs/job/marine/squad/engineer.dm b/code/game/jobs/job/marine/squad/engineer.dm index 1910248a61a2..a4422572f218 100644 --- a/code/game/jobs/job/marine/squad/engineer.dm +++ b/code/game/jobs/job/marine/squad/engineer.dm @@ -8,7 +8,7 @@ entry_message_body = "You have the equipment and skill to build fortifications, reroute power lines, and bunker down. Your squaddies will look to you when it comes to construction in the field of battle." /datum/job/marine/engineer/set_spawn_positions(count) - for(var/datum/squad/sq in RoleAuthority.squads) + for(var/datum/squad/sq in GLOB.RoleAuthority.squads) if(sq) sq.max_engineers = engi_slot_formula(count) @@ -21,7 +21,7 @@ total_positions_so_far = slots if(latejoin) - for(var/datum/squad/sq in RoleAuthority.squads) + for(var/datum/squad/sq in GLOB.RoleAuthority.squads) if(sq) sq.max_engineers = slots diff --git a/code/game/jobs/job/marine/squad/medic.dm b/code/game/jobs/job/marine/squad/medic.dm index 3df0a3793ca5..450d1176658f 100644 --- a/code/game/jobs/job/marine/squad/medic.dm +++ b/code/game/jobs/job/marine/squad/medic.dm @@ -8,7 +8,7 @@ entry_message_body = "You tend the wounds of your squad mates and make sure they are healthy and active. You may not be a fully-fledged doctor, but you stand between life and death when it matters." /datum/job/marine/medic/set_spawn_positions(count) - for(var/datum/squad/sq in RoleAuthority.squads) + for(var/datum/squad/sq in GLOB.RoleAuthority.squads) if(sq) sq.max_medics = medic_slot_formula(count) @@ -21,7 +21,7 @@ total_positions_so_far = slots if(latejoin) - for(var/datum/squad/sq in RoleAuthority.squads) + for(var/datum/squad/sq in GLOB.RoleAuthority.squads) if(sq) sq.max_medics = slots diff --git a/code/game/jobs/job/marine/squads.dm b/code/game/jobs/job/marine/squads.dm index d1c2640a81aa..5eac0586eb34 100644 --- a/code/game/jobs/job/marine/squads.dm +++ b/code/game/jobs/job/marine/squads.dm @@ -649,10 +649,10 @@ //Not a safe proc. Returns null if squads or jobs aren't set up. //Mostly used in the marine squad console in marine_consoles.dm. /proc/get_squad_by_name(text) - if(!RoleAuthority || RoleAuthority.squads.len == 0) + if(!GLOB.RoleAuthority || GLOB.RoleAuthority.squads.len == 0) return null var/datum/squad/S - for(S in RoleAuthority.squads) + for(S in GLOB.RoleAuthority.squads) if(S.name == text) return S return null @@ -760,7 +760,7 @@ //moved the main proc for ft management from human.dm here to make it support both examine and squad info way to edit fts /datum/squad/proc/manage_fireteams(mob/living/carbon/human/target) var/obj/item/card/id/ID = target.get_idcard() - if(!ID || !(ID.rank in ROLES_MARINES)) + if(!ID || !(ID.rank in GLOB.ROLES_MARINES)) return if(ID.rank == JOB_SQUAD_LEADER || squad_leader == target) //if SL/aSL are chosen var/choice = tgui_input_list(squad_leader, "Manage Fireteams and Team leaders.", "Fireteams Management", list("Cancel", "Unassign Fireteam 1 Leader", "Unassign Fireteam 2 Leader", "Unassign Fireteam 3 Leader", "Unassign all Team Leaders")) diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index dc9865f8d6e6..8829bf983c25 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -11,7 +11,7 @@ When a round starts, the roles are assigned based on the round, from another lis by name can be kept for things like job bans, while the round may add or remove roles as needed.If you need to equip a mob for a job, always use roles_by_path as it is an accurate account of every specific role path (with specific equipment). */ -var/global/datum/authority/branch/role/RoleAuthority +GLOBAL_DATUM(RoleAuthority, /datum/authority/branch/role) #define GET_RANDOM_JOB 0 #define BE_MARINE 1 @@ -25,11 +25,10 @@ var/global/datum/authority/branch/role/RoleAuthority #define SHIPSIDE_ROLE_WEIGHT 0.25 -var/global/players_preassigned = 0 - +GLOBAL_VAR_INIT(players_preassigned, 0) /proc/guest_jobbans(job) - return (job in ROLES_COMMAND) + return (job in GLOB.ROLES_COMMAND) /datum/authority/branch/role var/name = "Role Authority" @@ -236,7 +235,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou // Get balancing weight for the readied players. // Squad marine roles have a weight of 1, and shipside roles have a lower weight of SHIPSIDE_ROLE_WEIGHT. - players_preassigned = assign_roles(temp_roles_for_mode.Copy(), unassigned_players.Copy(), TRUE) + GLOB.players_preassigned = assign_roles(temp_roles_for_mode.Copy(), unassigned_players.Copy(), TRUE) // Even though we pass a copy of temp_roles_for_mode, job counters still change, so we reset them here. for(var/title in temp_roles_for_mode) @@ -247,28 +246,28 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou // Set the xeno starting amount based on marines assigned var/datum/job/antag/xenos/XJ = temp_roles_for_mode[JOB_XENOMORPH] if(istype(XJ)) - XJ.set_spawn_positions(players_preassigned) + XJ.set_spawn_positions(GLOB.players_preassigned) // Limit the number of SQUAD MARINE roles players can roll initially var/datum/job/SMJ = GET_MAPPED_ROLE(JOB_SQUAD_MARINE) if(istype(SMJ)) - SMJ.set_spawn_positions(players_preassigned) + SMJ.set_spawn_positions(GLOB.players_preassigned) // Set survivor starting amount based on marines assigned var/datum/job/SJ = temp_roles_for_mode[JOB_SURVIVOR] if(istype(SJ)) - SJ.set_spawn_positions(players_preassigned) + SJ.set_spawn_positions(GLOB.players_preassigned) var/datum/job/CO_surv_job = temp_roles_for_mode[JOB_CO_SURVIVOR] if(istype(CO_surv_job)) - CO_surv_job.set_spawn_positions(players_preassigned) + CO_surv_job.set_spawn_positions(GLOB.players_preassigned) if(SSnightmare.get_scenario_value("predator_round")) SSticker.mode.flags_round_type |= MODE_PREDATOR // Set predators starting amount based on marines assigned var/datum/job/PJ = temp_roles_for_mode[JOB_PREDATOR] if(istype(PJ)) - PJ.set_spawn_positions(players_preassigned) + PJ.set_spawn_positions(GLOB.players_preassigned) // Assign the roles, this time for real, respecting limits we have established. var/list/roles_left = assign_roles(temp_roles_for_mode, unassigned_players) @@ -312,13 +311,13 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou var/assigned = 0 for(var/priority in HIGH_PRIORITY to LOW_PRIORITY) // Assigning xenos first. - assigned += assign_initial_roles(priority, roles_for_mode & ROLES_XENO, unassigned_players) + assigned += assign_initial_roles(priority, roles_for_mode & GLOB.ROLES_XENO, unassigned_players) // Assigning special roles second. (survivor, predator) - assigned += assign_initial_roles(priority, roles_for_mode & (ROLES_WHITELISTED|ROLES_SPECIAL), unassigned_players) + assigned += assign_initial_roles(priority, roles_for_mode & (GLOB.ROLES_WHITELISTED|GLOB.ROLES_SPECIAL), unassigned_players) // Assigning command third. - assigned += assign_initial_roles(priority, roles_for_mode & ROLES_COMMAND, unassigned_players) + assigned += assign_initial_roles(priority, roles_for_mode & GLOB.ROLES_COMMAND, unassigned_players) // Assigning the rest - var/rest_roles_for_mode = roles_for_mode - (roles_for_mode & ROLES_XENO) - (roles_for_mode & ROLES_COMMAND) - (roles_for_mode & (ROLES_WHITELISTED|ROLES_SPECIAL)) + var/rest_roles_for_mode = roles_for_mode - (roles_for_mode & GLOB.ROLES_XENO) - (roles_for_mode & GLOB.ROLES_COMMAND) - (roles_for_mode & (GLOB.ROLES_WHITELISTED|GLOB.ROLES_SPECIAL)) if(count) assigned += assign_initial_roles(priority, rest_roles_for_mode, unassigned_players) else @@ -367,9 +366,9 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou * survivors and the number of roundstart Squad Rifleman slots. */ /datum/authority/branch/role/proc/calculate_role_weight(datum/job/J) - if(ROLES_MARINES.Find(J.title)) + if(GLOB.ROLES_MARINES.Find(J.title)) return 1 - if(ROLES_XENO.Find(J.title)) + if(GLOB.ROLES_XENO.Find(J.title)) return 1 if(J.title == JOB_SURVIVOR) return 1 @@ -436,9 +435,9 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou //here is the main reason this proc exists - to remove freed squad jobs from squad, //so latejoining person ends in the squad which's job was freed and not random one var/datum/squad/sq = null - if(job_squad_roles.Find(J.title)) + if(GLOB.job_squad_roles.Find(J.title)) var/list/squad_list = list() - for(sq in RoleAuthority.squads) + for(sq in GLOB.RoleAuthority.squads) if(sq.usable) squad_list += sq sq = null @@ -537,7 +536,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou if(new_job.flags_startup_parameters & ROLE_ADD_TO_SQUAD) //Are we a muhreen? Randomize our squad. This should go AFTER IDs. //TODO Robust this later. randomize_squad(new_human) - if(Check_WO() && job_squad_roles.Find(GET_DEFAULT_ROLE(new_human.job))) //activates self setting proc for marine headsets for WO + if(Check_WO() && GLOB.job_squad_roles.Find(GET_DEFAULT_ROLE(new_human.job))) //activates self setting proc for marine headsets for WO var/datum/game_mode/whiskey_outpost/WO = SSticker.mode WO.self_set_headset(new_human) @@ -817,7 +816,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou var/found_desired = FALSE var/found_limit = FALSE - for(var/status in whitelist_hierarchy) + for(var/status in GLOB.whitelist_hierarchy) if(status == desired_status) found_desired = TRUE break diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 05f530348029..3a4b94145ca1 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -11,10 +11,10 @@ GLOBAL_LIST_FILE_LOAD(whitelist, WHITELISTFILE) if(client.admin_holder && (client.admin_holder.rights & R_ADMIN)) return TRUE if(job == XENO_CASTE_QUEEN) - var/datum/caste_datum/C = RoleAuthority.castes_by_name[XENO_CASTE_QUEEN] + var/datum/caste_datum/C = GLOB.RoleAuthority.castes_by_name[XENO_CASTE_QUEEN] return C.can_play_caste(client) if(job == JOB_SURVIVOR) - var/datum/job/J = RoleAuthority.roles_by_path[/datum/job/civilian/survivor] + var/datum/job/J = GLOB.RoleAuthority.roles_by_path[/datum/job/civilian/survivor] return J.can_play_role(client) return TRUE @@ -42,11 +42,11 @@ GLOBAL_LIST_FILE_LOAD(alien_whitelist, "config/alienwhitelist.txt") /// returns a list of strings containing the whitelists held by a specific ckey /proc/get_whitelisted_roles(ckey) - if(RoleAuthority.roles_whitelist[ckey] & WHITELIST_PREDATOR) + if(GLOB.RoleAuthority.roles_whitelist[ckey] & WHITELIST_PREDATOR) LAZYADD(., "predator") - if(RoleAuthority.roles_whitelist[ckey] & WHITELIST_COMMANDER) + if(GLOB.RoleAuthority.roles_whitelist[ckey] & WHITELIST_COMMANDER) LAZYADD(., "commander") - if(RoleAuthority.roles_whitelist[ckey] & WHITELIST_SYNTHETIC) + if(GLOB.RoleAuthority.roles_whitelist[ckey] & WHITELIST_SYNTHETIC) LAZYADD(., "synthetic") #undef WHITELISTFILE diff --git a/code/game/machinery/ARES/ARES_interface.dm b/code/game/machinery/ARES/ARES_interface.dm index 0e45d5ee171b..aa1cd92547ec 100644 --- a/code/game/machinery/ARES/ARES_interface.dm +++ b/code/game/machinery/ARES/ARES_interface.dm @@ -78,7 +78,7 @@ data["access_text"] = "[sudo_holder ? "(SUDO)," : ""] access level [authentication], [ares_auth_to_text(authentication)]." data["access_level"] = authentication - data["alert_level"] = security_level + data["alert_level"] = GLOB.security_level data["evac_status"] = SShijack.evac_status data["worldtime"] = world.time @@ -382,7 +382,7 @@ to_chat(usr, SPAN_WARNING("It has not been long enough since the last General Quarters call!")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) return FALSE - if(security_level < SEC_LEVEL_RED) + if(GLOB.security_level < SEC_LEVEL_RED) set_security_level(SEC_LEVEL_RED, no_sound = TRUE, announce = FALSE) shipwide_ai_announcement("ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS.", MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') log_game("[key_name(usr)] has called for general quarters via ARES.") @@ -392,7 +392,7 @@ . = TRUE if("evacuation_start") - if(security_level < SEC_LEVEL_RED) + if(GLOB.security_level < SEC_LEVEL_RED) to_chat(usr, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures.")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) return FALSE @@ -423,11 +423,11 @@ to_chat(usr, SPAN_WARNING("The distress launcher is cooling down!")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) return FALSE - if(security_level == SEC_LEVEL_DELTA) + if(GLOB.security_level == SEC_LEVEL_DELTA) to_chat(usr, SPAN_WARNING("The ship is already undergoing self destruct procedures!")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) return FALSE - else if(security_level < SEC_LEVEL_RED) + if(GLOB.security_level < SEC_LEVEL_RED) to_chat(usr, SPAN_WARNING("The ship must be under red alert to launch a distress beacon!")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) return FALSE @@ -451,7 +451,7 @@ to_chat(usr, SPAN_WARNING("The ordnance request frequency is garbled, wait for reset!")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) return FALSE - if(security_level == SEC_LEVEL_DELTA || SSticker.mode.is_in_endgame) + if(GLOB.security_level == SEC_LEVEL_DELTA || SSticker.mode.is_in_endgame) to_chat(usr, SPAN_WARNING("The mission has failed catastrophically, what do you want a nuke for?!")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) return FALSE diff --git a/code/game/machinery/ARES/ARES_interface_apollo.dm b/code/game/machinery/ARES/ARES_interface_apollo.dm index 3bbc6065a88a..56283417ae05 100644 --- a/code/game/machinery/ARES/ARES_interface_apollo.dm +++ b/code/game/machinery/ARES/ARES_interface_apollo.dm @@ -70,7 +70,7 @@ data["access_text"] = "access level [authentication], [ares_auth_to_text(authentication)]." data["access_level"] = authentication - data["alert_level"] = security_level + data["alert_level"] = GLOB.security_level data["worldtime"] = world.time data["access_log"] = list() diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 9ceca3d1eb99..6a1f39ff5b45 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -90,7 +90,7 @@ GLOBAL_LIST_INIT(maintenance_categories, list( // ------ ARES Logging Procs ------ // /proc/ares_apollo_talk(broadcast_message) var/datum/language/apollo/apollo = GLOB.all_languages[LANGUAGE_APOLLO] - for(var/mob/living/silicon/decoy/ship_ai/ai in ai_mob_list) + for(var/mob/living/silicon/decoy/ship_ai/ai in GLOB.ai_mob_list) if(ai.stat == DEAD) return FALSE apollo.broadcast(ai, broadcast_message) diff --git a/code/game/machinery/ARES/apollo_pda.dm b/code/game/machinery/ARES/apollo_pda.dm index 26ec9d5120bd..8df3faf79260 100644 --- a/code/game/machinery/ARES/apollo_pda.dm +++ b/code/game/machinery/ARES/apollo_pda.dm @@ -94,7 +94,7 @@ data["access_text"] = "access level [authentication], [ares_auth_to_text(authentication)]." data["access_level"] = authentication - data["alert_level"] = security_level + data["alert_level"] = GLOB.security_level data["worldtime"] = world.time data["access_log"] = list() diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index c9092a750f73..03c013703b07 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -19,7 +19,7 @@ active_power_usage = 5 var/strapped = 0 can_buckle = TRUE - buckle_lying = TRUE + buckle_lying = 90 var/buckling_y = -4 surgery_duration_multiplier = SURGERY_SURFACE_MULT_IDEAL //Ideal surface for surgery. var/patient_exam = 0 diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index e6fc0c8de76e..88b4ab899112 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -5,9 +5,9 @@ /proc/RandomAAlarmWires() //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). var/list/AAlarmwires = list(0, 0, 0, 0, 0) - AAlarmIndexToFlag = list(0, 0, 0, 0, 0) - AAlarmIndexToWireColor = list(0, 0, 0, 0, 0) - AAlarmWireColorToIndex = list(0, 0, 0, 0, 0) + GLOB.AAlarmIndexToFlag = list(0, 0, 0, 0, 0) + GLOB.AAlarmIndexToWireColor = list(0, 0, 0, 0, 0) + GLOB.AAlarmWireColorToIndex = list(0, 0, 0, 0, 0) var/flagIndex = 1 for (var/flag=1, flag<32, flag+=flag) var/valid = 0 @@ -16,9 +16,9 @@ if (AAlarmwires[colorIndex]==0) valid = 1 AAlarmwires[colorIndex] = flag - AAlarmIndexToFlag[flagIndex] = flag - AAlarmIndexToWireColor[flagIndex] = colorIndex - AAlarmWireColorToIndex[colorIndex] = flagIndex + GLOB.AAlarmIndexToFlag[flagIndex] = flag + GLOB.AAlarmIndexToWireColor[flagIndex] = colorIndex + GLOB.AAlarmWireColorToIndex[colorIndex] = flagIndex flagIndex+=1 return AAlarmwires @@ -379,24 +379,24 @@ //HACKING// /////////// /obj/structure/machinery/alarm/proc/isWireColorCut(wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] + var/wireFlag = GLOB.AAlarmWireColorToFlag[wireColor] return ((AAlarmwires & wireFlag) == 0) /obj/structure/machinery/alarm/proc/isWireCut(wireIndex) - var/wireFlag = AAlarmIndexToFlag[wireIndex] + var/wireFlag = GLOB.AAlarmIndexToFlag[wireIndex] return ((AAlarmwires & wireFlag) == 0) /obj/structure/machinery/alarm/proc/allWiresCut() var/i = 1 while(i<=5) - if(AAlarmwires & AAlarmIndexToFlag[i]) + if(AAlarmwires & GLOB.AAlarmIndexToFlag[i]) return 0 i++ return 1 /obj/structure/machinery/alarm/proc/cut(wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - var/wireIndex = AAlarmWireColorToIndex[wireColor] + var/wireFlag = GLOB.AAlarmWireColorToFlag[wireColor] + var/wireIndex = GLOB.AAlarmWireColorToIndex[wireColor] AAlarmwires &= ~wireFlag switch(wireIndex) if(AALARM_WIRE_IDSCAN) @@ -427,8 +427,8 @@ return /obj/structure/machinery/alarm/proc/mend(wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function + var/wireFlag = GLOB.AAlarmWireColorToFlag[wireColor] + var/wireIndex = GLOB.AAlarmWireColorToIndex[wireColor] //not used in this function AAlarmwires |= wireFlag switch(wireIndex) if(AALARM_WIRE_POWER) @@ -445,7 +445,7 @@ /obj/structure/machinery/alarm/proc/pulse(wireColor) //var/wireFlag = AAlarmWireColorToFlag[wireColor] //not used in this function - var/wireIndex = AAlarmWireColorToIndex[wireColor] + var/wireIndex = GLOB.AAlarmWireColorToIndex[wireColor] switch(wireIndex) if(AALARM_WIRE_IDSCAN) //unlocks for 30 seconds, if you have a better way to hack I'm all ears locked = 0 @@ -527,7 +527,7 @@ "Black" = 5, ) for(var/wiredesc in wirecolors) - var/is_uncut = AAlarmwires & AAlarmWireColorToFlag[wirecolors[wiredesc]] + var/is_uncut = AAlarmwires & GLOB.AAlarmWireColorToFlag[wirecolors[wiredesc]] t1 += "[wiredesc] wire: " if(!is_uncut) t1 += "Mend" diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 3c2c81ff0ce7..32cb026a0b25 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -103,7 +103,7 @@ update_flag src.add_fingerprint(user) ..() - nanomanager.update_uis(src) // Update all NanoUIs attached to src + SSnano.nanomanager.update_uis(src) // Update all NanoUIs attached to src /obj/structure/machinery/portable_atmospherics/canister/attack_remote(mob/user as mob) return src.attack_hand(user) diff --git a/code/game/machinery/bio-dome_floodlights.dm b/code/game/machinery/bio-dome_floodlights.dm index a1f028a79f30..e23dbcc023f4 100644 --- a/code/game/machinery/bio-dome_floodlights.dm +++ b/code/game/machinery/bio-dome_floodlights.dm @@ -14,7 +14,7 @@ /obj/structure/machinery/hydro_floodlight_switch/Initialize(mapload, ...) . = ..() - for(var/obj/structure/machinery/hydro_floodlight/F in machines) + for(var/obj/structure/machinery/hydro_floodlight/F in GLOB.machines) floodlist += F F.fswitch = src start_processing() diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 912a6070328a..46050d2705b3 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -151,7 +151,7 @@ /turf/proc/CardinalTurfsWithAccess(obj/item/card/id/ID) var/L[] = new() - for(var/d in cardinal) + for(var/d in GLOB.cardinals) var/turf/T = get_step(src, d) if(istype(T) && !T.density) if(!LinkBlockedWithAccess(src, T, ID)) diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index e2dcf7ffb1db..c21a7a854bc3 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -37,8 +37,8 @@ should_patrol = 1 src.botcard = new(src) - if(RoleAuthority) - var/datum/job/ctequiv = RoleAuthority.roles_by_name[JOB_CARGO_TECH] + if(GLOB.RoleAuthority) + var/datum/job/ctequiv = GLOB.RoleAuthority.roles_by_name[JOB_CARGO_TECH] if(ctequiv) botcard.access = ctequiv.get_access() src.locked = 0 // Start unlocked so roboticist can set them to patrol. diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index f28a15ea1893..77e890d88d34 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -63,7 +63,7 @@ src.botcard = new /obj/item/card/id(src) if(isnull(src.botcard_access) || (src.botcard_access.len < 1)) - var/datum/job/J = RoleAuthority ? RoleAuthority.roles_by_path[/datum/job/civilian/doctor] : new /datum/job/civilian/doctor + var/datum/job/J = GLOB.RoleAuthority ? GLOB.RoleAuthority.roles_by_path[/datum/job/civilian/doctor] : new /datum/job/civilian/doctor botcard.access = J.get_access() else src.botcard.access = src.botcard_access diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index b88f8249566b..08437d35a8e3 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -70,8 +70,8 @@ /obj/structure/machinery/bot/mulebot/Initialize(mapload, ...) . = ..() botcard = new(src) - if(RoleAuthority) - var/datum/job/ctequiv = RoleAuthority.roles_by_name[JOB_CARGO_TECH] + if(GLOB.RoleAuthority) + var/datum/job/ctequiv = GLOB.RoleAuthority.roles_by_name[JOB_CARGO_TECH] if(ctequiv) botcard.access = ctequiv.get_access() cell = new(src) @@ -83,7 +83,7 @@ SSradio.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS) var/count = 0 - for(var/obj/structure/machinery/bot/mulebot/other in machines) + for(var/obj/structure/machinery/bot/mulebot/other in GLOB.machines) count++ if(!suffix) suffix = "#[count]" @@ -763,7 +763,6 @@ M.stop_pulling() M.apply_effect(8, STUN) M.apply_effect(5, WEAKEN) - M.lying = 1 ..() /obj/structure/machinery/bot/mulebot/alter_health() diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 3b2a91eea314..acb6d26bf0d5 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -81,7 +81,7 @@ icon_state = "[initial(icon_state)]emp" var/list/previous_network = network network = list() - cameranet.removeCamera(src) + GLOB.cameranet.removeCamera(src) stat |= EMPED set_light(0) triggerCameraAlarm() @@ -91,7 +91,7 @@ stat &= ~EMPED cancelCameraAlarm() if(can_use()) - cameranet.addCamera(src) + GLOB.cameranet.addCamera(src) kick_viewers() @@ -104,7 +104,7 @@ /obj/structure/machinery/camera/proc/setViewRange(num = 7) src.view_range = num - cameranet.updateVisibility(src, 0) + GLOB.cameranet.updateVisibility(src, 0) /obj/structure/machinery/camera/attack_hand(mob/living/carbon/human/user as mob) diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index 41aa7fa32707..5a0a41fdc9bf 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -40,7 +40,7 @@ if (!status || (stat & NOPOWER)) return 0 if (detectTime == -1) - for (var/mob/living/silicon/aiPlayer in ai_mob_list) + for (var/mob/living/silicon/aiPlayer in GLOB.ai_mob_list) aiPlayer.cancelAlarm("Motion", get_area(src), src) detectTime = 0 return 1 @@ -49,7 +49,7 @@ if (!status || (stat & NOPOWER)) return 0 if (!detectTime) return 0 - for (var/mob/living/silicon/aiPlayer in ai_mob_list) + for (var/mob/living/silicon/aiPlayer in GLOB.ai_mob_list) aiPlayer.triggerAlarm("Motion", get_area(src), list(src), src) detectTime = -1 return 1 diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index e5ab520cbee8..1f680ad76712 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -78,7 +78,7 @@ number = 1 var/area/A = get_area(src) if(A) - for(var/obj/structure/machinery/camera/autoname/C in machines) + for(var/obj/structure/machinery/camera/autoname/C in GLOB.machines) if(C == src) continue var/area/CA = get_area(C) if(CA.type == A.type) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 806664e012de..b9ea018ba98f 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -16,7 +16,7 @@ return var/list/L = list() - for (var/obj/structure/machinery/camera/C in cameranet.cameras) + for (var/obj/structure/machinery/camera/C in GLOB.cameranet.cameras) L.Add(C) camera_sort(L) @@ -213,9 +213,9 @@ return 0 if(isrobot(M)) var/mob/living/silicon/robot/R = M - if(!(R.camera && R.camera.can_use()) && !cameranet.checkCameraVis(M)) + if(!(R.camera && R.camera.can_use()) && !GLOB.cameranet.checkCameraVis(M)) return 0 - else if(!cameranet.checkCameraVis(M)) + else if(!GLOB.cameranet.checkCameraVis(M)) return 0 return 1 diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 08de86581518..715e9c2a86e5 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -22,7 +22,7 @@ . = ..() icon_state = "grass[pick("1","2","3","4")]" update_icon() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) if(istype(get_step(src, direction), /turf/open/floor)) var/turf/open/floor/FF = get_step(src,direction) FF.update_icon() //so siding get updated properly @@ -148,7 +148,7 @@ return M.forceMove(loc) M.apply_effect(5, WEAKEN) - for(var/obj/structure/machinery/scoreboard/X in machines) + for(var/obj/structure/machinery/scoreboard/X in GLOB.machines) if(X.id == id) X.score(side, 3)// 3 points for dunking a mob // no break, to update multiple scoreboards @@ -156,7 +156,7 @@ return else if (istype(W, /obj/item) && get_dist(src,user)<2) user.drop_inv_item_to_loc(W, loc) - for(var/obj/structure/machinery/scoreboard/X in machines) + for(var/obj/structure/machinery/scoreboard/X in GLOB.machines) if(X.id == id) X.score(side) // no break, to update multiple scoreboards @@ -170,7 +170,7 @@ return BLOCKED_MOVEMENT if(prob(50)) I.forceMove(src.loc) - for(var/obj/structure/machinery/scoreboard/X in machines) + for(var/obj/structure/machinery/scoreboard/X in GLOB.machines) if(X.id == id) X.score(side) // no break, to update multiple scoreboards diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 67e4e8ed35ab..3a809620d7e6 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -68,7 +68,6 @@ src.occupant.updatehealth() if (src.occupant.health >= 0 && src.occupant.stat == DEAD) src.occupant.set_stat(CONSCIOUS) - src.occupant.lying = 0 GLOB.dead_mob_list -= src.occupant GLOB.alive_mob_list += src.occupant occupant.reload_fullscreens() diff --git a/code/game/machinery/computer/almayer_control.dm b/code/game/machinery/computer/almayer_control.dm index fb9f7a0375d9..2b54d2e1df5b 100644 --- a/code/game/machinery/computer/almayer_control.dm +++ b/code/game/machinery/computer/almayer_control.dm @@ -72,7 +72,7 @@ var/list/data = list() var/list/messages = list() - data["alert_level"] = security_level + data["alert_level"] = GLOB.security_level data["time_request"] = cooldown_request data["time_destruct"] = cooldown_destruct @@ -116,7 +116,7 @@ // evac stuff start \\ if("evacuation_start") - if(security_level < SEC_LEVEL_RED) + if(GLOB.security_level < SEC_LEVEL_RED) to_chat(usr, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures.")) return FALSE @@ -147,7 +147,7 @@ if("change_sec_level") var/list/alert_list = list(num2seclevel(SEC_LEVEL_GREEN), num2seclevel(SEC_LEVEL_BLUE)) - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) alert_list -= num2seclevel(SEC_LEVEL_GREEN) if(SEC_LEVEL_BLUE) @@ -217,7 +217,7 @@ to_chat(usr, SPAN_WARNING("The distress beacon has recently broadcast a message. Please wait.")) return FALSE - if(security_level == SEC_LEVEL_DELTA) + if(GLOB.security_level == SEC_LEVEL_DELTA) to_chat(usr, SPAN_WARNING("The ship is already undergoing self-destruct procedures!")) return FALSE diff --git a/code/game/machinery/computer/area_air_control.dm b/code/game/machinery/computer/area_air_control.dm index 22f4211aa8ee..cd9870f175c4 100644 --- a/code/game/machinery/computer/area_air_control.dm +++ b/code/game/machinery/computer/area_air_control.dm @@ -156,7 +156,7 @@ var/turf/T = get_turf(src) if(!T.loc) return - for(var/obj/structure/machinery/portable_atmospherics/powered/scrubber/huge/scrubber in machines ) + for(var/obj/structure/machinery/portable_atmospherics/powered/scrubber/huge/scrubber in GLOB.machines ) var/turf/T2 = get_turf(scrubber) if(T2 && T2.loc) var/area/A = T2.loc diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 0fd487e2ef7c..ca8c8b2f1a34 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -40,6 +40,8 @@ instance.del_on_map_removal = FALSE if(instance.blend_mode_override) instance.blend_mode = instance.blend_mode_override + if(istype(instance, /atom/movable/screen/plane_master/lighting)) + instance.add_filter("awooga", 1, color_matrix_filter(color_matrix_from_string("#90ee90"))) instance.screen_loc = "[map_name]:CENTER" cam_plane_masters += instance @@ -226,7 +228,7 @@ // Returns the list of cameras accessible from this computer /obj/structure/machinery/computer/cameras/proc/get_available_cameras() var/list/D = list() - for(var/obj/structure/machinery/camera/C in cameranet.cameras) + for(var/obj/structure/machinery/camera/C in GLOB.cameranet.cameras) if(!C.network) stack_trace("Camera in a cameranet has no camera network") continue diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index b39f59530adc..7a51539b8888 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -98,9 +98,9 @@ if(-INFINITY to SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN //Cannot go below green. if(SEC_LEVEL_BLUE to INFINITY) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot go above blue. - var/old_level = security_level + var/old_level = GLOB.security_level set_security_level(tmp_alertlevel) - if(security_level != old_level) + if(GLOB.security_level != old_level) //Only notify the admins if an actual change happened log_game("[key_name(usr)] has changed the security level to [get_security_level()].") message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].") @@ -134,7 +134,7 @@ if("evacuation_start") if(state == STATE_EVACUATION) - if(security_level < SEC_LEVEL_DELTA) + if(GLOB.security_level < SEC_LEVEL_DELTA) to_chat(usr, SPAN_WARNING("The ship must be under delta alert in order to enact evacuation procedures.")) return FALSE @@ -185,7 +185,7 @@ to_chat(usr, SPAN_WARNING("The distress beacon has recently broadcast a message. Please wait.")) return FALSE - if(security_level == SEC_LEVEL_DELTA) + if(GLOB.security_level == SEC_LEVEL_DELTA) to_chat(usr, SPAN_WARNING("The ship is already undergoing self-destruct procedures!")) return FALSE diff --git a/code/game/machinery/computer/dropship_weapons.dm b/code/game/machinery/computer/dropship_weapons.dm index 6218bf0cdedb..fdab92ee4c13 100644 --- a/code/game/machinery/computer/dropship_weapons.dm +++ b/code/game/machinery/computer/dropship_weapons.dm @@ -97,7 +97,7 @@ if(!faction) return //no faction, no weapons - var/datum/cas_iff_group/cas_group = cas_groups[faction] + var/datum/cas_iff_group/cas_group = GLOB.cas_groups[faction] if(!cas_group) return //broken group. No fighting @@ -237,7 +237,7 @@ "firemission_step" = firemission_stat, ) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = SSnano.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) ui = new(user, src, ui_key, "dropship_weapons_console.tmpl", "Weapons Control", 800, 600) @@ -280,7 +280,7 @@ if(!faction) return //no faction, no weapons - var/datum/cas_iff_group/cas_group = cas_groups[faction] + var/datum/cas_iff_group/cas_group = GLOB.cas_groups[faction] if(!cas_group) return //broken group. No fighting @@ -490,7 +490,7 @@ if(dropship.mode != SHUTTLE_CALL) to_chat(usr, SPAN_WARNING("Shuttle has to be in orbit.")) return - var/datum/cas_iff_group/cas_group = cas_groups[faction] + var/datum/cas_iff_group/cas_group = GLOB.cas_groups[faction] var/datum/cas_signal/cas_sig for(var/X in cas_group.cas_signals) var/datum/cas_signal/LT = X @@ -588,7 +588,7 @@ to_chat(usr, SPAN_DANGER("Bug encountered, this console doesn't have a faction set, report this to a coder!")) return - var/datum/cas_iff_group/cas_group = cas_groups[faction] + var/datum/cas_iff_group/cas_group = GLOB.cas_groups[faction] if(!cas_group) to_chat(usr, SPAN_DANGER("Bug encountered, no CAS group exists for this console, report this to a coder!")) return diff --git a/code/game/machinery/computer/groundside_operations.dm b/code/game/machinery/computer/groundside_operations.dm index f2b36276c8eb..7b4c2d5df771 100644 --- a/code/game/machinery/computer/groundside_operations.dm +++ b/code/game/machinery/computer/groundside_operations.dm @@ -59,7 +59,7 @@ dat += "
[is_announcement_active ? "Make An Announcement" : "*Unavailable*"]" dat += "
Tactical Map" dat += "

" - var/datum/squad/marine/echo/echo_squad = locate() in RoleAuthority.squads + var/datum/squad/marine/echo/echo_squad = locate() in GLOB.RoleAuthority.squads if(!echo_squad.active && faction == FACTION_MARINE) dat += "
Designate Echo Squad" dat += "

" @@ -251,7 +251,7 @@ if("pick_squad") var/list/squad_list = list() - for(var/datum/squad/S in RoleAuthority.squads) + for(var/datum/squad/S in GLOB.RoleAuthority.squads) if(S.active && S.faction == faction) squad_list += S.name @@ -280,7 +280,7 @@ usr.UnregisterSignal(cam, COMSIG_PARENT_QDELETING) cam = null usr.reset_view(null) - else if(usr.client.view != world_view_size) + else if(usr.client.view != GLOB.world_view_size) to_chat(usr, SPAN_WARNING("You're too busy peering through binoculars.")) else if(cam) @@ -294,7 +294,7 @@ if(!reason) return if(alert(usr, "Confirm activation of Echo Squad for [reason]", "Confirm Activation", "Yes", "No") != "Yes") return - var/datum/squad/marine/echo/echo_squad = locate() in RoleAuthority.squads + var/datum/squad/marine/echo/echo_squad = locate() in GLOB.RoleAuthority.squads if(!echo_squad) visible_message(SPAN_BOLDNOTICE("ERROR: Unable to locate Echo Squad database.")) return diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 53efad3da877..20aa6925d0b4 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -24,7 +24,7 @@ set name = "Eject ID Card" set src in oview(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(scan) to_chat(usr, "You remove \the [scan] from \the [src].") @@ -108,7 +108,7 @@ dat += "Back" dat += "
Medical Robots:" var/bdat = null - for(var/obj/structure/machinery/bot/medbot/M in machines) + for(var/obj/structure/machinery/bot/medbot/M in GLOB.machines) if(M.z != src.z) continue //only find medibots on the same z-level as the computer var/turf/bl = get_turf(M) @@ -398,7 +398,7 @@ var/counter = 1 while(src.active2.fields[text("com_[]", counter)]) counter++ - src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]
[t1]") + src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [GLOB.game_year]
[t1]") if (href_list["del_c"]) if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])) @@ -450,7 +450,7 @@ else P.info += "Medical Record Lost!
" P.info += "" - P.info += text("

This report was printed by [] [].
The [MAIN_SHIP_NAME],[]/[], []

\n",last_user_rank,last_user_name,time2text(world.timeofday, "MM/DD"),game_year,worldtime2text()) + P.info += text("

This report was printed by [] [].
The [MAIN_SHIP_NAME],[]/[], []

\n",last_user_rank,last_user_name,time2text(world.timeofday, "MM/DD"),GLOB.game_year,worldtime2text()) src.printing = null if(href_list["print_bs"])//Prints latest body scan @@ -473,7 +473,7 @@ break else P.info += "No scan on record." - P.info += text("

This report was printed by [] [].
The [MAIN_SHIP_NAME], []/[], []

\n",last_user_rank,last_user_name,time2text(world.timeofday, "MM/DD"),game_year,worldtime2text()) + P.info += text("

This report was printed by [] [].
The [MAIN_SHIP_NAME], []/[], []

\n",last_user_rank,last_user_name,time2text(world.timeofday, "MM/DD"),GLOB.game_year,worldtime2text()) src.printing = null @@ -491,7 +491,7 @@ if(prob(10/severity)) switch(rand(1,6)) if(1) - R.fields["name"] = "[pick(pick(first_names_male), pick(first_names_female))] [pick(last_names)]" + R.fields["name"] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" if(2) R.fields["sex"] = pick("Male", "Female") if(3) diff --git a/code/game/machinery/computer/research.dm b/code/game/machinery/computer/research.dm index 2f37d9b2598a..2c8a5689b495 100644 --- a/code/game/machinery/computer/research.dm +++ b/code/game/machinery/computer/research.dm @@ -28,7 +28,7 @@ if(N.note_type == "grant") if(!N.grant) return - chemical_data.update_credits(N.grant) + GLOB.chemical_data.update_credits(N.grant) visible_message(SPAN_NOTICE("[user] scans the [N.name] on the [src], collecting the [N.grant] research credits.")) N.grant = 0 qdel(N) @@ -42,7 +42,7 @@ response = alert(usr,"Use existing or new category?","[src]","Existing","New") if(response == "Existing") var/list/pool = list() - for(var/category in chemical_data.research_documents) + for(var/category in GLOB.chemical_data.research_documents) pool += category pool = sortAssoc(pool) response = tgui_input_list(usr,"Select a category:", "Categories", pool) @@ -51,7 +51,7 @@ if(!response) response = "Misc." var/obj/item/paper/research_report/CR = P.convert_to_chem_report() - chemical_data.save_document(CR, response, CR.name) + GLOB.chemical_data.save_document(CR, response, CR.name) return //Clearance Updating if(!istype(B, /obj/item/card/id)) @@ -60,7 +60,7 @@ if(!istype(card)) visible_message(SPAN_NOTICE("[user] swipes their ID card on \the [src], but it is refused.")) return - if(card.clearance_access <= chemical_data.clearance_level || (card.clearance_access == 6 && chemical_data.clearance_level >= 5 && chemical_data.clearance_x_access)) + if(card.clearance_access <= GLOB.chemical_data.clearance_level || (card.clearance_access == 6 && GLOB.chemical_data.clearance_level >= 5 && GLOB.chemical_data.clearance_x_access)) visible_message(SPAN_NOTICE("[user] swipes the clearance card on the [src], but nothing happens.")) return if(user.real_name != card.registered_name) @@ -76,10 +76,10 @@ else give_level = card.clearance_access - chemical_data.clearance_level = give_level + GLOB.chemical_data.clearance_level = give_level if(give_x) - chemical_data.clearance_x_access = TRUE - chemical_data.reached_x_access = TRUE + GLOB.chemical_data.clearance_x_access = TRUE + GLOB.chemical_data.reached_x_access = TRUE visible_message(SPAN_NOTICE("[user] swipes their ID card on \the [src], updating the clearance to level [give_level][give_x ? "X" : ""].")) msg_admin_niche("[key_name(user)] has updated the research clearance to level [give_level][give_x ? "X" : ""].") @@ -103,12 +103,12 @@ /obj/structure/machinery/computer/research/ui_data(mob/user) var/list/data = list( - "rsc_credits" = chemical_data.rsc_credits, - "clearance_level" = chemical_data.clearance_level, - "broker_cost" = max(RESEARCH_LEVEL_INCREASE_MULTIPLIER*(chemical_data.clearance_level + 1), 1), - "research_documents" = chemical_data.research_documents, - "published_documents" = chemical_data.research_publications, - "clearance_x_access" = chemical_data.clearance_x_access, + "rsc_credits" = GLOB.chemical_data.rsc_credits, + "clearance_level" = GLOB.chemical_data.clearance_level, + "broker_cost" = max(RESEARCH_LEVEL_INCREASE_MULTIPLIER*(GLOB.chemical_data.clearance_level + 1), 1), + "research_documents" = GLOB.chemical_data.research_documents, + "published_documents" = GLOB.chemical_data.research_publications, + "clearance_x_access" = GLOB.chemical_data.clearance_x_access, "photocopier_error" = !photocopier, "printer_toner" = photocopier?.toner ) @@ -133,7 +133,7 @@ if ("read_document") var/print_type = params["print_type"] var/print_title = params["print_title"] - var/obj/item/paper/research_report/report = chemical_data.get_report(print_type, print_title) + var/obj/item/paper/research_report/report = GLOB.chemical_data.get_report(print_type, print_title) if(report) report.read_paper(user) return @@ -145,7 +145,7 @@ var/print_title = params["print_title"] photocopier.toner = max(0, photocopier.toner - 1) var/obj/item/paper/research_report/printing = new /obj/item/paper/research_report/(photocopier.loc) - var/obj/item/paper/research_report/report = chemical_data.get_report(print_type, print_title) + var/obj/item/paper/research_report/report = GLOB.chemical_data.get_report(print_type, print_title) if(report) printing.name = report.name printing.info = report.info @@ -154,16 +154,16 @@ if("broker_clearance") if(!photocopier) return - if(chemical_data.clearance_level < 5) - var/cost = max(RESEARCH_LEVEL_INCREASE_MULTIPLIER*(chemical_data.clearance_level + 1), 1) - if(cost <= chemical_data.rsc_credits) - chemical_data.update_credits(cost * -1) - chemical_data.clearance_level++ - visible_message(SPAN_NOTICE("Clearance access increased to level [chemical_data.clearance_level] for [cost] credits.")) - msg_admin_niche("[key_name(user)] traded research credits to upgrade the clearance to level [chemical_data.clearance_level].") - if(max_clearance < chemical_data.clearance_level) - chemical_data.update_income(1) //Bonus income and a paper for buying clearance instead of swiping it up - switch(chemical_data.clearance_level) + if(GLOB.chemical_data.clearance_level < 5) + var/cost = max(RESEARCH_LEVEL_INCREASE_MULTIPLIER*(GLOB.chemical_data.clearance_level + 1), 1) + if(cost <= GLOB.chemical_data.rsc_credits) + GLOB.chemical_data.update_credits(cost * -1) + GLOB.chemical_data.clearance_level++ + visible_message(SPAN_NOTICE("Clearance access increased to level [GLOB.chemical_data.clearance_level] for [cost] credits.")) + msg_admin_niche("[key_name(user)] traded research credits to upgrade the clearance to level [GLOB.chemical_data.clearance_level].") + if(max_clearance < GLOB.chemical_data.clearance_level) + GLOB.chemical_data.update_income(1) //Bonus income and a paper for buying clearance instead of swiping it up + switch(GLOB.chemical_data.clearance_level) if(2) new /obj/item/paper/research_notes/unique/tier_two/(photocopier.loc) max_clearance = 2 @@ -182,11 +182,11 @@ var/purchase_tier = FLOOR(text2num(params["purchase_document"]), 1) if(purchase_tier <= 0 || purchase_tier > 5) return - if(purchase_tier > chemical_data.clearance_level) + if(purchase_tier > GLOB.chemical_data.clearance_level) return var/purchase_cost = base_purchase_cost + purchase_tier * 2 - if(purchase_cost <= chemical_data.rsc_credits) - chemical_data.update_credits(purchase_cost * -1) + if(purchase_cost <= GLOB.chemical_data.rsc_credits) + GLOB.chemical_data.update_credits(purchase_cost * -1) var/obj/item/paper/research_notes/unique/N switch(purchase_tier) if(1) @@ -203,21 +203,21 @@ if("publish_document") var/print_type = params["print_type"] var/print_title = params["print_title"] - var/obj/item/paper/research_report/report = chemical_data.get_report(print_type, print_title) + var/obj/item/paper/research_report/report = GLOB.chemical_data.get_report(print_type, print_title) if(!report) to_chat(usr, SPAN_WARNING("Report data corrupted. Unable to transmit.")) return - chemical_data.publish_document(report, print_type, print_title) + GLOB.chemical_data.publish_document(report, print_type, print_title) if("unpublish_document") var/print_title = params["print_title"] var/print_type = params["print_type"] - chemical_data.unpublish_document(print_type, print_title) + GLOB.chemical_data.unpublish_document(print_type, print_title) if("request_clearance_x_access") var/purchase_cost = 5 - if(purchase_cost <= chemical_data.rsc_credits) - chemical_data.clearance_x_access = TRUE - chemical_data.reached_x_access = TRUE - chemical_data.update_credits(purchase_cost * -1) + if(purchase_cost <= GLOB.chemical_data.rsc_credits) + GLOB.chemical_data.clearance_x_access = TRUE + GLOB.chemical_data.reached_x_access = TRUE + GLOB.chemical_data.update_credits(purchase_cost * -1) visible_message(SPAN_NOTICE("Clearance Level X Acquired.")) playsound(loc, pick('sound/machines/computer_typing1.ogg','sound/machines/computer_typing2.ogg','sound/machines/computer_typing3.ogg'), 5, 1) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index c5a13e2c3e74..19e3ac900af6 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -51,11 +51,11 @@ dat += "[R.name] |" if(R.stat) dat += " Not Responding |" - else if (!R.canmove) + else if (HAS_TRAIT_FROM(R, TRAIT_IMMOBILIZED, HACKED_TRAIT)) dat += " Locked Down |" else dat += " Operating Normally |" - if(R.canmove && R.cell) + if(R.cell) dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |" else dat += " No Cell Installed |" @@ -70,7 +70,8 @@ if (isRemoteControlling(user)) if((user.mind.original == user)) dat += "(Hack) " - dat += "([R.canmove ? "Lockdown" : "Release"]) " + var/canmove = HAS_TRAIT_FROM(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) + dat += "([canmove ? "Lockdown" : "Release"]) " dat += "(Destroy)" dat += "
" dat += "(Return to Main Menu)
" @@ -161,20 +162,22 @@ else if (href_list["stopbot"]) if(src.allowed(usr)) var/mob/living/silicon/robot/R = locate(href_list["stopbot"]) + var/canmove = HAS_TRAIT_FROM(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) if(R && istype(R)) // Extra sancheck because of input var references - var/choice = tgui_input_list(usr, "Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?", "Hack machine", list("Confirm", "Abort")) + var/choice = tgui_input_list(usr, "Are you certain you wish to [canmove ? "lock down" : "release"] [R.name]?", "Hack machine", list("Confirm", "Abort")) if(choice == "Confirm") if(R && istype(R)) - message_admins("[key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") - log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") - R.canmove = !R.canmove + message_admins("[key_name_admin(usr)] [canmove ? "locked down" : "released"] [R.name]!") + log_game("[key_name(usr)] [canmove ? "locked down" : "released"] [R.name]!") + if(canmove) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) + else + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) if (R.lockcharge) - // R.cell.charge = R.lockcharge R.lockcharge = !R.lockcharge to_chat(R, "Your lockdown has been lifted!") else R.lockcharge = !R.lockcharge - // R.cell.charge = 0 to_chat(R, "You have been locked down!") else diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 2d9a4a1dbea4..8090f802b1d0 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -363,7 +363,7 @@ What a mess.*/ var/t1 = copytext(trim(strip_html(input("Your name and time will be added to this new comment.", "Add a comment", null, null) as message)),1,MAX_MESSAGE_LEN) if((!t1 || usr.stat || usr.is_mob_restrained() || (!in_range(src, usr) && (!ishighersilicon(usr))) || active2 != a2)) return - var/created_at = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), game_year) + var/created_at = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), GLOB.game_year) var/new_comment = list("entry" = t1, "created_by" = list("name" = "", "rank" = ""), "deleted_by" = null, "deleted_at" = null, "created_at" = created_at) if(istype(usr,/mob/living/carbon/human)) var/mob/living/carbon/human/U = usr @@ -391,7 +391,7 @@ What a mess.*/ var/mob/living/silicon/robot/U = usr deleter = "[U.name] ([U.modtype] [U.braintype])" updated_comments[href_list["del_c"]]["deleted_by"] = deleter - updated_comments[href_list["del_c"]]["deleted_at"] = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), game_year) + updated_comments[href_list["del_c"]]["deleted_at"] = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), GLOB.game_year) active2.fields["comments"] = updated_comments to_chat(usr, text("You have deleted a comment from the Security Record of [].", active2.fields["name"])) //RECORD CREATE @@ -532,7 +532,7 @@ What a mess.*/ if(prob(10/severity)) switch(rand(1,6)) if(1) - R.fields["name"] = "[pick(pick(first_names_male), pick(first_names_female))] [pick(last_names)]" + R.fields["name"] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" if(2) R.fields["sex"] = pick("Male", "Female") if(3) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 60b5aa232940..6e35d147ff38 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -355,7 +355,7 @@ What a mess.*/ if(prob(10/severity)) switch(rand(1,6)) if(1) - R.fields["name"] = "[pick(pick(first_names_male), pick(first_names_female))] [pick(last_names)]" + R.fields["name"] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" if(2) R.fields["sex"] = pick("Male", "Female") if(3) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 86bb5f79a035..58935702cb7b 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -343,13 +343,13 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li if(SKILL_SPEC_SNIPER) set_name = "Sniper Set" - if(set_name && !available_specialist_sets.Find(set_name)) - available_specialist_sets += set_name + if(set_name && !GLOB.available_specialist_sets.Find(set_name)) + GLOB.available_specialist_sets += set_name SSticker.mode.latejoin_tally-- //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for //Handle job slot/tater cleanup. - RoleAuthority.free_role(GET_MAPPED_ROLE(occupant.job), TRUE) + GLOB.RoleAuthority.free_role(GET_MAPPED_ROLE(occupant.job), TRUE) var/occupant_ref = WEAKREF(occupant) //Delete them from datacore. diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index 8b73588f1d0b..030e732ea75f 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -64,7 +64,7 @@ if(is_mainship_level(z)) // on the almayer return - shuttle.control_doors("lock", "all", force=FALSE) + shuttle.control_doors("force-lock", "all", force=FALSE) /obj/structure/machinery/door_control/proc/handle_door() for(var/obj/structure/machinery/door/airlock/D in range(range)) @@ -95,7 +95,7 @@ D.safe = 1 /obj/structure/machinery/door_control/proc/handle_pod() - for(var/obj/structure/machinery/door/poddoor/M in machines) + for(var/obj/structure/machinery/door/poddoor/M in GLOB.machines) if(M.id == id) if(M.density) INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/structure/machinery/door, open)) @@ -187,7 +187,7 @@ add_fingerprint(user) var/effective = 0 - for(var/obj/structure/machinery/door/poddoor/M in machines) + for(var/obj/structure/machinery/door/poddoor/M in GLOB.machines) if(M.id == id) effective = 1 spawn() diff --git a/code/game/machinery/door_display/door_display.dm b/code/game/machinery/door_display/door_display.dm index 7462b1f1b74d..3f0c53ada18e 100644 --- a/code/game/machinery/door_display/door_display.dm +++ b/code/game/machinery/door_display/door_display.dm @@ -31,7 +31,7 @@ get_targets() /obj/structure/machinery/door_display/proc/get_targets() - for(var/obj/structure/machinery/door/D in machines) + for(var/obj/structure/machinery/door/D in GLOB.machines) if (D.id == id) targets += D @@ -199,7 +199,7 @@ /obj/structure/machinery/door_display/research_cell/get_targets() ..() - for(var/obj/structure/machinery/flasher/F in machines) + for(var/obj/structure/machinery/flasher/F in GLOB.machines) if(F.id == id) targets += F if(has_wall_divider) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index c6d9ddf3efbd..4e362ef12fac 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -91,7 +91,7 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( else if(user.hallucination > 50 && prob(10) && operating == 0) to_chat(user, SPAN_DANGER("You feel a powerful shock course through your body!")) user.halloss += 10 - user.stunned += 10 + user.apply_effect(10, STUN) return ..(user) @@ -817,7 +817,7 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( /obj/structure/machinery/door/airlock/LateInitialize() . = ..() if(closeOtherId != null) - for(var/obj/structure/machinery/door/airlock/A in machines) + for(var/obj/structure/machinery/door/airlock/A in GLOB.machines) if(A.closeOtherId == closeOtherId && A != src) closeOther = A break @@ -833,7 +833,7 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( return /obj/structure/machinery/door/airlock/allowed(mob/M) - if(isWireCut(AIRLOCK_WIRE_IDSCAN) || (maint_all_access && check_access_list(list(ACCESS_MARINE_MAINT)))) + if(isWireCut(AIRLOCK_WIRE_IDSCAN) || (GLOB.maint_all_access && check_access_list(list(ACCESS_MARINE_MAINT)))) return TRUE return ..(M) diff --git a/code/game/machinery/doors/brig_system.dm b/code/game/machinery/doors/brig_system.dm index 58c3282abed4..56cc55828171 100644 --- a/code/game/machinery/doors/brig_system.dm +++ b/code/game/machinery/doors/brig_system.dm @@ -290,15 +290,15 @@ addtimer(CALLBACK(src, PROC_REF(search_for_components)), 20) /obj/structure/machinery/brig_cell/proc/search_for_components() - for(var/obj/structure/machinery/door/window/brigdoor/M in machines) + for(var/obj/structure/machinery/door/window/brigdoor/M in GLOB.machines) if(M.id == id) targets += M - for(var/obj/structure/machinery/flasher/F in machines) + for(var/obj/structure/machinery/flasher/F in GLOB.machines) if(F.id == id) targets += F - for(var/obj/structure/machinery/door/poddoor/almayer/locked/P in machines) + for(var/obj/structure/machinery/door/poddoor/almayer/locked/P in GLOB.machines) if(P.id == id) targets += P diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 065816567ca1..cddd67c7e2b2 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -1,7 +1,4 @@ // Door open and close constants -/var/const - CLOSED = 2 - #define FIREDOOR_MAX_PRESSURE_DIFF 25 // kPa #define FIREDOOR_MAX_TEMP 50 // °C #define FIREDOOR_MIN_TEMP 0 @@ -57,7 +54,7 @@ A.all_doors.Add(src) areas_added = list(A) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) A = get_area(get_step(src,direction)) if(istype(A) && !(A in areas_added)) A.all_doors.Add(src) @@ -135,7 +132,7 @@ "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\ "\The [src]", list("Yes", "No")) != "Yes") return - if(user.is_mob_incapacitated() || (!user.canmove && !isRemoteControlling(user)) || (get_dist(src, user) > 1 && !isRemoteControlling(user))) + if(user.is_mob_incapacitated() || (get_dist(src, user) > 1 && !isRemoteControlling(user))) to_chat(user, "Sorry, you must remain able bodied and close to \the [src] in order to use it.") return if(density && (inoperable())) //can still close without power @@ -277,7 +274,7 @@ overlays += "palert" if(dir_alerts) for(var/d=1;d<=4;d++) - var/cdir = cardinal[d] + var/cdir = GLOB.cardinals[d] for(var/i=1;i<=ALERT_STATES.len;i++) if(dir_alerts[d] & (1<<(i-1))) overlays += new/icon(icon,"alert_[ALERT_STATES[i]]", dir=cdir) diff --git a/code/game/machinery/doors/multi_tile.dm b/code/game/machinery/doors/multi_tile.dm index ca218128160d..0a179af27803 100644 --- a/code/game/machinery/doors/multi_tile.dm +++ b/code/game/machinery/doors/multi_tile.dm @@ -275,6 +275,17 @@ name = "\improper Normandy cargo door" icon = 'icons/obj/structures/doors/dropship2_cargo.dmi' +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside + width = 2 + +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside/ds1 + name = "\improper Alamo crew hatch" + icon = 'icons/obj/structures/doors/dropship1_side2.dmi' + +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside/ds2 + name = "\improper Normandy crew hatch" + icon = 'icons/obj/structures/doors/dropship2_side2.dmi' + /obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/blastdoor name = "bulkhead blast door" icon = 'icons/obj/structures/doors/almayerblastdoor.dmi' diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index b2d836ee476f..0a3b873ce385 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -240,6 +240,7 @@ /obj/structure/machinery/door/poddoor/filler_object name = "" + icon = null icon_state = "" unslashable = TRUE unacidable = TRUE diff --git a/code/game/machinery/fax_machine.dm b/code/game/machinery/fax_machine.dm index ff21671ed758..4a5c62b1f9a0 100644 --- a/code/game/machinery/fax_machine.dm +++ b/code/game/machinery/fax_machine.dm @@ -1,5 +1,5 @@ -var/list/obj/structure/machinery/faxmachine/allfaxes = list() -var/list/alldepartments = list() +GLOBAL_LIST_INIT_TYPED(allfaxes, /obj/structure/machinery/faxmachine, list()) +GLOBAL_LIST_EMPTY(alldepartments) #define DEPARTMENT_WY "Weyland-Yutani" #define DEPARTMENT_HC "USCM High Command" @@ -45,11 +45,11 @@ var/list/alldepartments = list() /obj/structure/machinery/faxmachine/Initialize(mapload, ...) . = ..() - allfaxes += src + GLOB.allfaxes += src update_departments() /obj/structure/machinery/faxmachine/Destroy() - allfaxes -= src + GLOB.allfaxes -= src . = ..() /obj/structure/machinery/faxmachine/initialize_pass_flags(datum/pass_flags_container/PF) @@ -110,7 +110,8 @@ var/list/alldepartments = list() set category = "Object" set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(usr.is_mob_incapacitated()) + return if(ishuman(usr) && scan) to_chat(usr, "You remove \the [scan] from \the [src].") @@ -125,18 +126,18 @@ var/list/alldepartments = list() return /obj/structure/machinery/faxmachine/proc/update_departments() - if( !("[department]" in alldepartments) ) //Initialize departments. This will work with multiple fax machines. - alldepartments += department - if(!(DEPARTMENT_WY in alldepartments)) - alldepartments += DEPARTMENT_WY - if(!(DEPARTMENT_HC in alldepartments)) - alldepartments += DEPARTMENT_HC - if(!(DEPARTMENT_PROVOST in alldepartments)) - alldepartments += DEPARTMENT_PROVOST - if(!(DEPARTMENT_CMB in alldepartments)) - alldepartments += DEPARTMENT_CMB - if(!(DEPARTMENT_PRESS in alldepartments)) - alldepartments += DEPARTMENT_PRESS + if( !("[department]" in GLOB.alldepartments) ) //Initialize departments. This will work with multiple fax machines. + GLOB.alldepartments += department + if(!(DEPARTMENT_WY in GLOB.alldepartments)) + GLOB.alldepartments += DEPARTMENT_WY + if(!(DEPARTMENT_HC in GLOB.alldepartments)) + GLOB.alldepartments += DEPARTMENT_HC + if(!(DEPARTMENT_PROVOST in GLOB.alldepartments)) + GLOB.alldepartments += DEPARTMENT_PROVOST + if(!(DEPARTMENT_CMB in GLOB.alldepartments)) + GLOB.alldepartments += DEPARTMENT_CMB + if(!(DEPARTMENT_PRESS in GLOB.alldepartments)) + GLOB.alldepartments += DEPARTMENT_PRESS // TGUI SHIT \\ /obj/structure/machinery/faxmachine/tgui_interact(mob/user, datum/tgui/ui) @@ -255,7 +256,7 @@ var/list/alldepartments = list() if("select") var/last_target_department = target_department - target_department = tgui_input_list(ui.user, "Which department?", "Choose a department", alldepartments) + target_department = tgui_input_list(ui.user, "Which department?", "Choose a department", GLOB.alldepartments) if(!target_department) target_department = last_target_department . = TRUE @@ -379,7 +380,7 @@ var/list/alldepartments = list() /obj/structure/machinery/faxmachine/proc/send_fax(datum/fax/faxcontents) - for(var/obj/structure/machinery/faxmachine/F in allfaxes) + for(var/obj/structure/machinery/faxmachine/F in GLOB.allfaxes) if(F != src && F.department == target_department) if(!faxcontents) return diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index dd7e0ee70150..55aef1323c4d 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -47,7 +47,7 @@ FIRE ALARM if(stat & BROKEN) icon_state = "firex" - else if(stat & NOPOWER & (security_level != SEC_LEVEL_RED)) + else if(stat & NOPOWER & (GLOB.security_level != SEC_LEVEL_RED)) icon_state = "firep" /obj/structure/machinery/firealarm/fire_act(temperature, volume) @@ -183,7 +183,7 @@ FIRE ALARM pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 if(!is_mainship_level(z)) - if(security_level) + if(GLOB.security_level) src.overlays += image('icons/obj/structures/machinery/monitors.dmi', "overlay_[get_security_level()]") else src.overlays += image('icons/obj/structures/machinery/monitors.dmi', "overlay_green") diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index cd59862a2e13..fc2cf5a6320c 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -133,7 +133,7 @@ active = 1 icon_state = "launcheract" - for(var/obj/structure/machinery/flasher/M in machines) + for(var/obj/structure/machinery/flasher/M in GLOB.machines) if(M.id == src.id) INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/structure/machinery/flasher, flash)) diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 516cdad380b1..580fea644eec 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -36,12 +36,12 @@ update_icon() -/obj/structure/machinery/floodlight/attack_hand(mob/user) +/obj/structure/machinery/floodlight/attack_hand(mob/living/user) if(!toggleable) to_chat(user, SPAN_NOTICE("[src] doesn't seem to have a switch to toggle the light.")) return - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return if(!is_valid_user(user)) diff --git a/code/game/machinery/groundmap_geothermal.dm b/code/game/machinery/groundmap_geothermal.dm index 808c717e8891..087facdbf5ee 100644 --- a/code/game/machinery/groundmap_geothermal.dm +++ b/code/game/machinery/groundmap_geothermal.dm @@ -223,7 +223,7 @@ /obj/structure/machinery/colony_floodlight_switch/LateInitialize() . = ..() - for(var/obj/structure/machinery/colony_floodlight/F in machines) + for(var/obj/structure/machinery/colony_floodlight/F in GLOB.machines) floodlist += F F.fswitch = src start_processing() diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 2f8f113ddd23..9ce3cb89bf79 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -59,12 +59,6 @@ Possible to do for anyone motivated enough: Itegrate EMP effect to disable the unit. */ - -// HOLOPAD MODE -// 0 = RANGE BASED -// 1 = AREA BASED -var/const/HOLOPAD_MODE = 0 - /obj/structure/machinery/hologram/holopad name = "\improper AI holopad" desc = "It's a floor-mounted device for projecting holographic images. It is activated remotely." @@ -167,17 +161,9 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ if(hologram)//If there is a hologram. if(master && !master.stat && master.client && master.eyeobj)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. if(!(stat & NOPOWER))//If the machine has power. - if((HOLOPAD_MODE == 0 && (get_dist(master.eyeobj, src) <= holo_range))) + if(get_dist(master.eyeobj, src) <= holo_range) return 1 - else if (HOLOPAD_MODE == 1) - - var/area/holo_area = get_area(src) - var/area/eye_area = get_area(master.eyeobj) - - if(eye_area == holo_area) - return 1 - clear_holo()//If not, we want to get rid of the hologram. return 1 diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm index 2d4182772cf3..41c63d465918 100644 --- a/code/game/machinery/holosign.dm +++ b/code/game/machinery/holosign.dm @@ -63,7 +63,7 @@ else icon_state = "light0" - for(var/obj/structure/machinery/holosign/M in machines) + for(var/obj/structure/machinery/holosign/M in GLOB.machines) if (M.id == src.id) INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/structure/machinery/holosign, toggle)) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index d5a0505fca17..6109833004d6 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -124,11 +124,11 @@ active = 1 icon_state = "launcheract" - for(var/obj/structure/machinery/sparker/M in machines) + for(var/obj/structure/machinery/sparker/M in GLOB.machines) if (M.id == src.id) INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/structure/machinery/sparker, ignite)) - for(var/obj/structure/machinery/igniter/M in machines) + for(var/obj/structure/machinery/igniter/M in GLOB.machines) if(M.id == src.id) use_power(50) M.on = !( M.on ) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index ef6c74a052cd..4b863bec043d 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -57,7 +57,7 @@ if(ishuman(usr)) var/mob/living/carbon/human/user = usr - if(user.stat || get_dist(user, src) > 1 || user.blinded || user.lying) + if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded) return if(!skillcheck(user, SKILL_SURGERY, SKILL_SURGERY_NOVICE)) @@ -179,7 +179,7 @@ if(!istype(usr, /mob/living)) return - if(usr.stat || usr.lying) + if(usr.stat || usr.is_mob_incapacitated()) return mode = !mode diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm index 08a3d5c4dfee..3fa96ca0bc3a 100644 --- a/code/game/machinery/kitchen/gibber.dm +++ b/code/game/machinery/kitchen/gibber.dm @@ -27,7 +27,7 @@ /obj/structure/machinery/gibber/autogibber/New() ..() spawn(5) - for(var/i in cardinal) + for(var/i in GLOB.cardinals) var/obj/structure/machinery/mineral/input/input_obj = locate( /obj/structure/machinery/mineral/input, get_step(loc, i) ) if(input_obj) if(isturf(input_obj.loc)) diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index 903cd06c3119..6d3e18933457 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -54,8 +54,8 @@ contents -= item if(item_quants[item.name]) item_quants[item.name] -= item - if(is_in_network() && chemical_data.shared_item_storage[item.name]) - chemical_data.shared_item_storage[item.name] -= item + if(is_in_network() && GLOB.chemical_data.shared_item_storage[item.name]) + GLOB.chemical_data.shared_item_storage[item.name] -= item qdel(item) /obj/structure/machinery/smartfridge/proc/accept_check(obj/item/O as obj) @@ -94,7 +94,7 @@ overlays.Cut() if(panel_open) overlays += image(icon, icon_panel) - nanomanager.update_uis(src) + SSnano.nanomanager.update_uis(src) return if(HAS_TRAIT(O, TRAIT_TOOL_MULTITOOL)||HAS_TRAIT(O, TRAIT_TOOL_WIRECUTTERS)) @@ -157,7 +157,7 @@ /obj/structure/machinery/smartfridge/proc/add_network_item(obj/item/O) if(is_in_network()) - add_item(chemical_data.shared_item_storage, O) + add_item(GLOB.chemical_data.shared_item_storage, O) return TRUE return FALSE @@ -232,9 +232,9 @@ var/list/networked_items = list() if(is_in_network()) - for (var/i=1 to length(chemical_data.shared_item_storage)) - var/item_index = chemical_data.shared_item_storage[i] - var/list/item_list = chemical_data.shared_item_storage[item_index] + for (var/i=1 to length(GLOB.chemical_data.shared_item_storage)) + var/item_index = GLOB.chemical_data.shared_item_storage[i] + var/list/item_list = GLOB.chemical_data.shared_item_storage[item_index] var/count = length(item_list) if(count < 1) continue @@ -295,7 +295,7 @@ var/list/target_list = item_quants if(params["isLocal"] == 0) - target_list = chemical_data.shared_item_storage + target_list = GLOB.chemical_data.shared_item_storage var/item_index = target_list[index] var/list/item_list = target_list[item_index] @@ -328,9 +328,9 @@ var/amount=params["amount"] var/source = item_quants - var/target = chemical_data.shared_item_storage + var/target = GLOB.chemical_data.shared_item_storage if(params["isLocal"] == 0) - source = chemical_data.shared_item_storage + source = GLOB.chemical_data.shared_item_storage target = item_quants var/item_index = source[index] diff --git a/code/game/machinery/line_nexter.dm b/code/game/machinery/line_nexter.dm index d736df44664a..ae1896ad8138 100644 --- a/code/game/machinery/line_nexter.dm +++ b/code/game/machinery/line_nexter.dm @@ -62,7 +62,7 @@ icon_state = "doorctrl1" add_fingerprint(user) - for(var/obj/structure/machinery/line_nexter/L in machines) + for(var/obj/structure/machinery/line_nexter/L in GLOB.machines) if(id == L.id) L.next() diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 66bf08afba8e..c5eaa14e05b5 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -128,15 +128,15 @@ Class Procs: /obj/structure/machinery/Initialize(mapload, ...) . = ..() - machines += src + GLOB.machines += src var/area/A = get_area(src) if(A) A.add_machine(src) //takes care of adding machine's power usage /obj/structure/machinery/Destroy() - machines -= src - processing_machines -= src - power_machines -= src + GLOB.machines -= src + GLOB.processing_machines -= src + GLOB.power_machines -= src var/area/A = get_area(src) if(A) A.remove_machine(src) //takes care of removing machine from power usage @@ -151,15 +151,15 @@ Class Procs: if(!machine_processing) machine_processing = 1 if(power_machine) - addToListNoDupe(power_machines, src) + addToListNoDupe(GLOB.power_machines, src) else - addToListNoDupe(processing_machines, src) + addToListNoDupe(GLOB.processing_machines, src) /obj/structure/machinery/proc/stop_processing() if(machine_processing) machine_processing = 0 - processing_machines -= src - power_machines -= src + GLOB.processing_machines -= src + GLOB.power_machines -= src /obj/structure/machinery/process()//If you dont use process or power why are you here return PROCESS_KILL @@ -229,7 +229,11 @@ Class Procs: return TRUE if(inoperable()) return 1 - if(usr.is_mob_restrained() || usr.lying || usr.stat) + if(isliving(usr)) + var/mob/living/living = usr + if(living.body_position == LYING_DOWN) // legacy. if you too find it doesn't make sense, consider removing it + return TRUE + if(usr.is_mob_restrained()) return 1 if(!is_valid_user(usr)) to_chat(usr, SPAN_DANGER("You don't have the dexterity to do this!")) @@ -251,10 +255,10 @@ Class Procs: else return src.attack_hand(user) -/obj/structure/machinery/attack_hand(mob/user as mob) +/obj/structure/machinery/attack_hand(mob/living/user as mob) if(inoperable(MAINT)) return TRUE - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return TRUE if(!is_valid_user(user)) to_chat(usr, SPAN_DANGER("You don't have the dexterity to do this!")) diff --git a/code/game/machinery/medical_pod/bodyscanner.dm b/code/game/machinery/medical_pod/bodyscanner.dm index fdcd0ceb62e6..bbc3be7d5aae 100644 --- a/code/game/machinery/medical_pod/bodyscanner.dm +++ b/code/game/machinery/medical_pod/bodyscanner.dm @@ -204,7 +204,7 @@ "toxloss" = H.getToxLoss(), "cloneloss" = H.getCloneLoss(), "brainloss" = H.getBrainLoss(), - "knocked_out" = H.knocked_out, + "knocked_out" = H.GetKnockOutValueNotADurationDoNotUse(), "bodytemp" = H.bodytemperature, "inaprovaline_amount" = H.reagents.get_reagent_amount("inaprovaline"), "dexalin_amount" = H.reagents.get_reagent_amount("dexalin"), @@ -263,7 +263,7 @@ s_class = occ["brainloss"] < 1 ? INTERFACE_GOOD : INTERFACE_BAD dat += "[SET_CLASS("  Approx. Brain Damage:", INTERFACE_PINK)] [SET_CLASS("[occ["brainloss"]]%", s_class)]

" - dat += "[SET_CLASS("Knocked Out Summary:", "#40628a")] [occ["knocked_out"]]% ([round(occ["knocked_out"] / 4)] seconds left!)
" + dat += "[SET_CLASS("Knocked Out Summary:", "#40628a")] [occ["knocked_out"]]% (approximately [round(occ["knocked_out"] / 5)] seconds left!)
" dat += "[SET_CLASS("Body Temperature:", "#40628a")] [occ["bodytemp"]-T0C]°C ([occ["bodytemp"]*1.8-459.67]°F)

" s_class = occ["blood_amount"] > 448 ? INTERFACE_OKAY : INTERFACE_BAD diff --git a/code/game/machinery/medical_pod/medical_pod.dm b/code/game/machinery/medical_pod/medical_pod.dm index b284d71ad4a7..62c8eef1f72c 100644 --- a/code/game/machinery/medical_pod/medical_pod.dm +++ b/code/game/machinery/medical_pod/medical_pod.dm @@ -155,7 +155,6 @@ if(exit_stun) occupant.apply_effect(exit_stun, STUN) //Action delay when going out - occupant.update_canmove() //Force the delay to go in action immediately occupant.visible_message(SPAN_WARNING("[occupant] pops out of \the [src]!"), SPAN_WARNING("You get out of \the [src] and get your bearings!")) diff --git a/code/game/machinery/medical_pod/sleeper.dm b/code/game/machinery/medical_pod/sleeper.dm index bf2abe246c35..fe2b698caed0 100644 --- a/code/game/machinery/medical_pod/sleeper.dm +++ b/code/game/machinery/medical_pod/sleeper.dm @@ -164,7 +164,7 @@ var/chemicals[0] for(var/re in connected.available_chemicals) - var/datum/reagent/temp = chemical_reagents_list[re] + var/datum/reagent/temp = GLOB.chemical_reagents_list[re] if(temp) var/reagent_amount = 0 var/pretty_amount @@ -365,7 +365,7 @@ if(occupant && occupant.reagents) if(occupant.reagents.get_reagent_amount(chemical) + amount <= max_chem) occupant.reagents.add_reagent(chemical, amount, , , user) - var/datum/reagent/temp = chemical_reagents_list[chemical] + var/datum/reagent/temp = GLOB.chemical_reagents_list[chemical] to_chat(user, SPAN_NOTICE("[occupant] now has [occupant.reagents.get_reagent_amount(chemical)] units of [temp.name] in \his bloodstream.")) return to_chat(user, SPAN_WARNING("There's no occupant in the sleeper or the subject has too many chemicals!")) @@ -390,8 +390,8 @@ to_chat(user, "[]\t -Respiratory Damage %: []", (occupant.getOxyLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getOxyLoss()) to_chat(user, "[]\t -Toxin Content %: []", (occupant.getToxLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getToxLoss()) to_chat(user, "[]\t -Burn Severity %: []", (occupant.getFireLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getFireLoss()) - to_chat(user, SPAN_NOTICE(" Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)")) - to_chat(user, SPAN_NOTICE(" \t [occupant.knocked_out / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)")) + to_chat(user, SPAN_NOTICE(" Expected time till occupant can safely awake: (note: These times are always inaccurate)")) + to_chat(user, SPAN_NOTICE(" \t [occupant.GetKnockOutValueNotADurationDoNotUse() / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)")) else to_chat(user, SPAN_NOTICE(" There is no one inside!")) return diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 89c9e9277f4c..9bd7e5f5e965 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -45,10 +45,9 @@ var/list/datum/feed_channel/network_channels = list() var/datum/feed_message/wanted_issue -var/datum/feed_network/news_network = new /datum/feed_network //The global news-network, which is coincidentally a global list. - -var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list that will contain reference to all newscasters in existence. +GLOBAL_DATUM_INIT(news_network, /datum/feed_network, new()) //The global news-network, which is coincidentally a global list. +GLOBAL_LIST_INIT_TYPED(allCasters, /obj/structure/machinery/newscaster, list()) //Global list that will contain reference to all newscasters in existence. /obj/structure/machinery/newscaster name = "newscaster" @@ -101,15 +100,15 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th securityCaster = 1 /obj/structure/machinery/newscaster/security_unit/New() //Constructor, ho~ - allCasters += src + GLOB.allCasters += src src.paper_remaining = 15 // Will probably change this to something better - for(var/obj/structure/machinery/newscaster/NEWSCASTER in allCasters) // Let's give it an appropriate unit number + for(var/obj/structure/machinery/newscaster/NEWSCASTER in GLOB.allCasters) // Let's give it an appropriate unit number src.unit_no++ src.update_icon() //for any custom ones on the map... ..() //I just realised the newscasters weren't in the global machines list. The superconstructor call will tend to that /obj/structure/machinery/newscaster/security_unit/Destroy() - allCasters -= src + GLOB.allCasters -= src return ..() /obj/structure/machinery/newscaster/update_icon() @@ -122,7 +121,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th src.overlays.Cut() //reset overlays - if(news_network.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message + if(GLOB.news_network.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message icon_state = "newscaster_wanted" return @@ -184,7 +183,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th if(0) dat += "Welcome to Newscasting Unit #[src.unit_no].
Interface & News networks Operational." dat += "
Property of Weyland-Yutani" - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) dat+= "
Read Wanted Issue" dat+= "

Create Feed Channel" dat+= "
View Feed Channels" @@ -194,7 +193,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+= "

Exit" if(src.securityCaster) var/wanted_already = 0 - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) wanted_already = 1 dat+="
Feed Security functions:
" @@ -204,10 +203,10 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+="

The newscaster recognises you as: [src.scanned_user]" if(1) dat+= "Station Feed Channels
" - if(!length(news_network.network_channels) ) + if(!length(GLOB.news_network.network_channels) ) dat+="No active channels found..." else - for(var/datum/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) if(CHANNEL.is_admin_channel) dat+="[CHANNEL.channel_name]
" else @@ -255,7 +254,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+="ERROR: Could not submit Feed Channel to Network.

" //var/list/existing_channels = list() //Let's get dem existing channels - OBSOLETE var/list/existing_authors = list() - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) //existing_channels += FC.channel_name //OBSOLETE if(FC.author == "\[REDACTED\]") existing_authors += FC.backup_author @@ -266,7 +265,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th if(src.channel_name=="" || src.channel_name == "\[REDACTED\]") dat+="�Invalid channel name.
" var/check = 0 - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == src.channel_name) check = 1 break @@ -276,10 +275,10 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+="�Channel author unverified.
" dat+="
Return
" if(8) - var/total_num=length(news_network.network_channels) + var/total_num=length(GLOB.news_network.network_channels) var/active_num=total_num var/message_num=0 - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(!FC.censored) message_num += length(FC.messages) //Dont forget, datum/feed_channel's var messages is a list of datum/feed_message else @@ -312,10 +311,10 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+="NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.
" dat+="Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.
" dat+="
Select Feed channel to get Stories from:
" - if(!length(news_network.network_channels)) + if(!length(GLOB.news_network.network_channels)) dat+="No feed channels found active...
" else - for(var/datum/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : null]
" dat+="
Cancel" if(11) @@ -323,10 +322,10 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+="A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's" dat+="morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed" dat+="stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.
" - if(!length(news_network.network_channels)) + if(!length(GLOB.news_network.network_channels)) dat+="No feed channels found active...
" else - for(var/datum/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : null]
" dat+="
Back" @@ -360,7 +359,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+="Wanted Issue Handler:" var/wanted_already = 0 var/end_param = 1 - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) wanted_already = 1 end_param = 2 @@ -371,7 +370,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+="Description: [src.msg]
" dat+="Attach Photo: [(src.photo ? "Photo Attached" : "No Photo")]
" if(wanted_already) - dat+="Wanted Issue created by: [news_network.wanted_issue.backup_author]
" + dat+="Wanted Issue created by: [GLOB.news_network.wanted_issue.backup_author]
" else dat+="Wanted Issue will be created under prosecutor: [src.scanned_user]
" dat+="
[(wanted_already) ? ("Edit Issue") : ("Submit")]" @@ -394,12 +393,12 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th dat+="Wanted Issue successfully deleted from Circulation
" dat+="
Return
" if(18) - dat+="-- STATIONWIDE WANTED ISSUE --
\[Submitted by: [news_network.wanted_issue.backup_author]\]
" - dat+="Criminal: [news_network.wanted_issue.author]
" - dat+="Description: [news_network.wanted_issue.body]
" + dat+="-- STATIONWIDE WANTED ISSUE --
\[Submitted by: [GLOB.news_network.wanted_issue.backup_author]\]
" + dat+="Criminal: [GLOB.news_network.wanted_issue.author]
" + dat+="Description: [GLOB.news_network.wanted_issue.body]
" dat+="Photo:: " - if(news_network.wanted_issue.img) - usr << browse_rsc(news_network.wanted_issue.img, "tmp_photow.png") + if(GLOB.news_network.wanted_issue.img) + usr << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png") dat+="
" else dat+="None" @@ -448,14 +447,14 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th else if(href_list["submit_new_channel"]) //var/list/existing_channels = list() //OBSOLETE var/list/existing_authors = list() - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) //existing_channels += FC.channel_name if(FC.author == "\[REDACTED\]") existing_authors += FC.backup_author else existing_authors +=FC.author var/check = 0 - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == src.channel_name) check = 1 break @@ -468,7 +467,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th newChannel.channel_name = src.channel_name newChannel.author = src.scanned_user newChannel.locked = c_locked - news_network.network_channels += newChannel //Adding channel to the global network + GLOB.news_network.network_channels += newChannel //Adding channel to the global network src.screen=5 src.updateUsrDialog() //src.update_icon() @@ -476,7 +475,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th else if(href_list["set_channel_receiving"]) //var/list/datum/feed_channel/available_channels = list() var/list/available_channels = list() - for(var/datum/feed_channel/F in news_network.network_channels) + for(var/datum/feed_channel/F in GLOB.news_network.network_channels) if( (!F.locked || F.author == scanned_user) && !F.censored) available_channels += F.channel_name src.channel_name = strip_html(tgui_input_list(usr, "Choose receiving Feed Channel", "Network Channel Handler", available_channels )) @@ -501,12 +500,12 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th newMsg.body = src.msg if(photo) newMsg.img = photo.img - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == src.channel_name) FC.messages += newMsg //Adding message to the network's appropriate feed_channel break src.screen=4 - for(var/obj/structure/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/structure/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.newsAlert(src.channel_name) src.updateUsrDialog() @@ -540,12 +539,12 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th else if(href_list["menu_wanted"]) var/already_wanted = 0 - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) already_wanted = 1 if(already_wanted) - src.channel_name = news_network.wanted_issue.author - src.msg = news_network.wanted_issue.body + src.channel_name = GLOB.news_network.wanted_issue.author + src.msg = GLOB.news_network.wanted_issue.body src.screen = 14 src.updateUsrDialog() @@ -575,32 +574,32 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th WANTED.backup_author = src.scanned_user //I know, a bit wacky if(photo) WANTED.img = photo.img - news_network.wanted_issue = WANTED - for(var/obj/structure/machinery/newscaster/NEWSCASTER in allCasters) + GLOB.news_network.wanted_issue = WANTED + for(var/obj/structure/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.newsAlert() NEWSCASTER.update_icon() src.screen = 15 else - if(news_network.wanted_issue.is_admin_message) + if(GLOB.news_network.wanted_issue.is_admin_message) alert("The wanted issue has been distributed by a Weyland-Yutani higherup. You cannot edit it.","Ok") return - news_network.wanted_issue.author = src.channel_name - news_network.wanted_issue.body = src.msg - news_network.wanted_issue.backup_author = src.scanned_user + GLOB.news_network.wanted_issue.author = src.channel_name + GLOB.news_network.wanted_issue.body = src.msg + GLOB.news_network.wanted_issue.backup_author = src.scanned_user if(photo) - news_network.wanted_issue.img = photo.img + GLOB.news_network.wanted_issue.img = photo.img src.screen = 19 src.updateUsrDialog() else if(href_list["cancel_wanted"]) - if(news_network.wanted_issue.is_admin_message) + if(GLOB.news_network.wanted_issue.is_admin_message) alert("The wanted issue has been distributed by a Weyland-Yutani higherup. You cannot take it down.","Ok") return var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") - news_network.wanted_issue = null - for(var/obj/structure/machinery/newscaster/NEWSCASTER in allCasters) + GLOB.news_network.wanted_issue = null + for(var/obj/structure/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.update_icon() src.screen=17 src.updateUsrDialog() @@ -915,10 +914,10 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th /obj/structure/machinery/newscaster/proc/print_paper() var/obj/item/newspaper/NEWSPAPER = new /obj/item/newspaper - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) NEWSPAPER.news_content += FC - if(news_network.wanted_issue) - NEWSPAPER.important_message = news_network.wanted_issue + if(GLOB.news_network.wanted_issue) + NEWSPAPER.important_message = GLOB.news_network.wanted_issue NEWSPAPER.forceMove(get_turf(src)) src.paper_remaining-- return @@ -930,7 +929,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th /obj/structure/machinery/newscaster/proc/newsAlert(channel) //This isn't Agouri's work, for it is ugly and vile. var/turf/T = get_turf(src) //Who the fuck uses spawn(600) anyway, jesus christ if(channel) - for(var/mob/O in hearers(world_view_size-1, T)) + for(var/mob/O in hearers(GLOB.world_view_size-1, T)) O.show_message(SPAN_NEWSCASTER("[src.name] beeps, \"Breaking news from [channel]!\""), SHOW_MESSAGE_AUDIBLE) src.alert = 1 src.update_icon() @@ -939,7 +938,7 @@ var/list/obj/structure/machinery/newscaster/allCasters = list() //Global list th src.update_icon() playsound(src.loc, 'sound/machines/twobeep.ogg', 25, 1) else - for(var/mob/O in hearers(world_view_size-1, T)) + for(var/mob/O in hearers(GLOB.world_view_size-1, T)) O.show_message(SPAN_NEWSCASTER("[src.name] beeps, \"Attention! Wanted issue distributed!\""), SHOW_MESSAGE_AUDIBLE) playsound(src.loc, 'sound/machines/warning-buzzer.ogg', 25, 1) return diff --git a/code/game/machinery/nuclearbomb.dm b/code/game/machinery/nuclearbomb.dm index 28ebbecc7552..369953788ae1 100644 --- a/code/game/machinery/nuclearbomb.dm +++ b/code/game/machinery/nuclearbomb.dm @@ -1,5 +1,4 @@ -var/bomb_set = FALSE - +GLOBAL_VAR_INIT(bomb_set, FALSE) /obj/structure/machinery/nuclearbomb name = "\improper Nuclear Fission Explosive" desc = "Nuke the entire site from orbit, it's the only way to be sure. Too bad we don't have any orbital nukes." @@ -59,7 +58,7 @@ var/bomb_set = FALSE update_minimap_icon() return PROCESS_KILL - bomb_set = TRUE //So long as there is one nuke timing, it means one nuke is armed. + GLOB.bomb_set = TRUE //So long as there is one nuke timing, it means one nuke is armed. timeleft = explosion_time - world.time if(world.time >= explosion_time) explode() @@ -90,7 +89,7 @@ var/bomb_set = FALSE return XENO_ATTACK_ACTION /obj/structure/machinery/nuclearbomb/attackby(obj/item/O as obj, mob/user as mob) - if(anchored && timing && bomb_set && HAS_TRAIT(O, TRAIT_TOOL_WIRECUTTERS)) + if(anchored && timing && GLOB.bomb_set && HAS_TRAIT(O, TRAIT_TOOL_WIRECUTTERS)) user.visible_message(SPAN_INFO("[user] begins to defuse \the [src]."), SPAN_INFO("You begin to defuse \the [src]. This will take some time...")) if(do_after(user, 150 * user.get_skill_duration_multiplier(SKILL_ENGINEER), INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE)) disable() @@ -99,7 +98,7 @@ var/bomb_set = FALSE ..() /obj/structure/machinery/nuclearbomb/attack_hand(mob/user as mob) - if(user.is_mob_incapacitated() || !user.canmove || get_dist(src, user) > 1 || isRemoteControlling(user)) + if(user.is_mob_incapacitated() || get_dist(src, user) > 1 || isRemoteControlling(user)) return if(isyautja(user)) @@ -111,7 +110,7 @@ var/bomb_set = FALSE return if(isqueen(user)) - if(timing && bomb_set) + if(timing && GLOB.bomb_set) user.visible_message(SPAN_INFO("[user] begins to defuse \the [src]."), SPAN_INFO("You begin to defuse \the [src]. This will take some time...")) if(do_after(user, 5 SECONDS, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE)) disable() @@ -196,14 +195,14 @@ var/bomb_set = FALSE timing = !timing if(timing) if(!safety) - bomb_set = TRUE + GLOB.bomb_set = TRUE explosion_time = world.time + timeleft update_minimap_icon() start_processing() announce_to_players() message_admins("\The [src] has been activated by [key_name(ui.user, 1)] [ADMIN_JMP_USER(ui.user)]") else - bomb_set = FALSE + GLOB.bomb_set = FALSE else disable() message_admins("\The [src] has been deactivated by [key_name(ui.user, 1)] [ADMIN_JMP_USER(ui.user)]") @@ -232,7 +231,7 @@ var/bomb_set = FALSE being_used = FALSE if(safety) timing = FALSE - bomb_set = FALSE + GLOB.bomb_set = FALSE . = TRUE if("toggleCommandLockout") @@ -291,7 +290,7 @@ var/bomb_set = FALSE set name = "Make Deployable" set src in oview(1) - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || being_used || timing) + if(usr.is_mob_incapacitated() || being_used || timing) return if(!ishuman(usr)) @@ -378,7 +377,7 @@ var/bomb_set = FALSE /obj/structure/machinery/nuclearbomb/proc/disable() timing = FALSE - bomb_set = FALSE + GLOB.bomb_set = FALSE timeleft = initial(timeleft) explosion_time = null announce_to_players() @@ -436,7 +435,7 @@ var/bomb_set = FALSE if(timing != -1) message_admins("\The [src] has been unexpectedly deleted at ([x],[y],[x]). [ADMIN_JMP(src)]") log_game("\The [src] has been unexpectedly deleted at ([x],[y],[x]).") - bomb_set = FALSE + GLOB.bomb_set = FALSE SSminimaps.remove_marker(src) return ..() diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index b21f73af76d6..33e6e9749e48 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -296,7 +296,7 @@ Buildable meters /obj/item/pipe/Move() . = ..() if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_SUPPLY_BENT, PIPE_SCRUBBERS_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \ - && (src.dir in cardinal)) + && (src.dir in GLOB.cardinals)) setDir(src.dir|turn(src.dir, 90)) else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE)) if(dir==2) diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index fc8815b0511f..e007ada79a0e 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -75,7 +75,7 @@ /obj/structure/machinery/pipedispenser/Topic(href, href_list) if(..()) return - if(unwrenched || !usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(unwrenched || usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "pipedispenser") return usr.set_interaction(src) @@ -150,7 +150,7 @@ Nah //Allow you to drag-drop disposal pipes into it /obj/structure/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/disposalconstruct/pipe as obj, mob/usr as mob) - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return if (!istype(pipe) || get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 ) @@ -192,7 +192,7 @@ Nah usr.set_interaction(src) src.add_fingerprint(usr) if(href_list["dmake"]) - if(unwrenched || !usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(unwrenched || usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "pipedispenser") return if(!wait) diff --git a/code/game/machinery/scoreboard.dm b/code/game/machinery/scoreboard.dm index 9b8d6402ca96..8740bed6dcfb 100644 --- a/code/game/machinery/scoreboard.dm +++ b/code/game/machinery/scoreboard.dm @@ -68,7 +68,7 @@ active = 1 icon_state = "launcheract" - for(var/obj/structure/machinery/scoreboard/X in machines) + for(var/obj/structure/machinery/scoreboard/X in GLOB.machines) if(X.id == id) X.reset_scores() diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm index e07b13f64f97..0b4574cc9fb4 100644 --- a/code/game/machinery/seed_extractor.dm +++ b/code/game/machinery/seed_extractor.dm @@ -14,10 +14,10 @@ var/datum/seed/new_seed_type if(istype(O, /obj/item/grown)) var/obj/item/grown/F = O - new_seed_type = seed_types[F.plantname] + new_seed_type = GLOB.seed_types[F.plantname] else var/obj/item/reagent_container/food/snacks/grown/F = O - new_seed_type = seed_types[F.plantname] + new_seed_type = GLOB.seed_types[F.plantname] if(new_seed_type) to_chat(user, SPAN_NOTICE("You extract some seeds from [O].")) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 79ead6321502..547dbba68e4f 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -146,7 +146,7 @@ maptext = new_text /obj/structure/machinery/status_display/proc/get_supply_shuttle_timer() - var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle + var/datum/shuttle/ferry/supply/shuttle = GLOB.supply_controller.shuttle if (!shuttle) return "Error" @@ -164,7 +164,7 @@ maptext = "" /obj/structure/machinery/status_display/proc/set_sec_level_picture() - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) set_picture("default") if(SEC_LEVEL_BLUE) diff --git a/code/game/machinery/storm_siren.dm b/code/game/machinery/storm_siren.dm index e78414cb7e5b..335115715488 100644 --- a/code/game/machinery/storm_siren.dm +++ b/code/game/machinery/storm_siren.dm @@ -11,11 +11,11 @@ health = 0 /obj/structure/machinery/storm_siren/Initialize() - weather_notify_objects += src + GLOB.weather_notify_objects += src return ..() /obj/structure/machinery/storm_siren/Destroy() - weather_notify_objects -= src + GLOB.weather_notify_objects -= src . = ..() /obj/structure/machinery/storm_siren/power_change() diff --git a/code/game/machinery/supply_display.dm b/code/game/machinery/supply_display.dm index 26117474f0fe..7317ed6435f2 100644 --- a/code/game/machinery/supply_display.dm +++ b/code/game/machinery/supply_display.dm @@ -6,7 +6,7 @@ message1 = "SUPPLY" message2 = "" - var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle + var/datum/shuttle/ferry/supply/shuttle = GLOB.supply_controller.shuttle if (!shuttle) message2 = "Error" else if(shuttle.has_arrive_time()) diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index a370356ad60b..942d70f80705 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -128,7 +128,7 @@ dat += "
Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]" if(hide) dat += "
Shadow Link: ACTIVE" - //Show additional options for certain machines. + //Show additional options for certain GLOB.machines. dat += Options_Menu() dat += "
Linked Network Entities:
    " @@ -200,7 +200,7 @@ P = user.get_active_hand() return P -// Additional Options for certain machines. Use this when you want to add an option to a specific machine. +// Additional Options for certain GLOB.machines. Use this when you want to add an option to a specific machine. // Example of how to use below. /obj/structure/machinery/telecomms/proc/Options_Menu() diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index a9c7c61bc00d..7621d55e3645 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -1,8 +1,5 @@ // ### Preset machines ### - -//var/list/freq_listening = list() USE THIS FOR NEW RELAY STUFF WHEN I GET THIS - APOPHIS - //Relay /obj/structure/machinery/telecomms/relay/preset network = "tcommsat" diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index f2eff1c23e56..6205f24c8e05 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -84,7 +84,7 @@ IN_USE used for vending/denying if(stat & NOPOWER || stat & TIPPED_OVER) //tipping off without breaking uses "_off" sprite overlays += image(icon, "[icon_state]_off") if(stat & MAINT) //if we require maintenance, then it is completely "_broken" - icon_state = "[initial(icon_state)]_broken" + overlays += image(icon, "[initial(icon_state)]_broken") if(stat & IN_REPAIR) //if someone started repairs, they unscrewed "_panel" overlays += image(icon, "[icon_state]_panel") @@ -529,7 +529,7 @@ GLOBAL_LIST_EMPTY(vending_products) vend_fail() return FALSE var/p_name = itemspec[1] - if(!available_specialist_sets.Find(p_name)) + if(!GLOB.available_specialist_sets.Find(p_name)) to_chat(user, SPAN_WARNING("That set is already taken.")) vend_fail() return FALSE @@ -560,7 +560,7 @@ GLOBAL_LIST_EMPTY(vending_products) return FALSE ID.set_assignment((user.assigned_squad ? (user.assigned_squad.name + " ") : "") + JOB_SQUAD_SPECIALIST + " ([specialist_assignment])") GLOB.data_core.manifest_modify(user.real_name, WEAKREF(user), ID.assignment) - available_specialist_sets -= p_name + GLOB.available_specialist_sets -= p_name else if(vendor_role.Find(JOB_SYNTH)) if(user.job != JOB_SYNTH) to_chat(user, SPAN_WARNING("Only USCM Synthetics may vend experimental tool tokens.")) @@ -899,7 +899,7 @@ GLOBAL_LIST_EMPTY(vending_products) if(inoperable()) return - if(user.stat || user.is_mob_restrained() || user.lying) + if(user.stat || user.is_mob_restrained()) return if(get_dist(user, src) > 1 || get_dist(src, A) > 1) diff --git a/code/game/machinery/vending/vending.dm b/code/game/machinery/vending/vending.dm index 414ab4a562e1..b6c4da03640c 100644 --- a/code/game/machinery/vending/vending.dm +++ b/code/game/machinery/vending/vending.dm @@ -343,7 +343,7 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending if (CH) // Only proceed if card contains proper account number. if(!CH.suspended) if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) - if(vendor_account) + if(GLOB.vendor_account) var/attempt_pin = tgui_input_number(usr, "Enter pin code", "Vendor transaction") var/datum/money_account/D = attempt_account_access(card.associated_account_number, attempt_pin, 2) transfer_and_vend(D) @@ -364,18 +364,18 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending //transfer the money acc.money -= transaction_amount - vendor_account.money += transaction_amount + GLOB.vendor_account.money += transaction_amount //create entries in the two account transaction logs var/datum/transaction/T = new() - T.target_name = "[vendor_account.owner_name] (via [name])" + T.target_name = "[GLOB.vendor_account.owner_name] (via [name])" T.purpose = "Purchase of [currently_vending.product_name]" if(transaction_amount > 0) T.amount = "([transaction_amount])" else T.amount = "[transaction_amount]" T.source_terminal = name - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() acc.transaction_log.Add(T) // @@ -384,9 +384,9 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending T.purpose = "Purchase of [currently_vending.product_name]" T.amount = "[transaction_amount]" T.source_terminal = name - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() - vendor_account.transaction_log.Add(T) + GLOB.vendor_account.transaction_log.Add(T) // Vend the item vend(currently_vending, usr) @@ -622,18 +622,18 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending //transfer the money user_account.money -= transaction_amount - vendor_account.money += transaction_amount + GLOB.vendor_account.money += transaction_amount //create entries in the two account transaction logs var/datum/transaction/new_transaction = new() - new_transaction.target_name = "[vendor_account.owner_name] (via [name])" + new_transaction.target_name = "[GLOB.vendor_account.owner_name] (via [name])" new_transaction.purpose = "Purchase of [currently_vending.product_name]" if(transaction_amount > 0) new_transaction.amount = "([transaction_amount])" else new_transaction.amount = "[transaction_amount]" new_transaction.source_terminal = name - new_transaction.date = current_date_string + new_transaction.date = GLOB.current_date_string new_transaction.time = worldtime2text() user_account.transaction_log.Add(new_transaction) @@ -642,9 +642,9 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending new_transaction.purpose = "Purchase of [currently_vending.product_name]" new_transaction.amount = "[transaction_amount]" new_transaction.source_terminal = name - new_transaction.date = current_date_string + new_transaction.date = GLOB.current_date_string new_transaction.time = worldtime2text() - vendor_account.transaction_log.Add(new_transaction) + GLOB.vendor_account.transaction_log.Add(new_transaction) return TRUE @@ -655,7 +655,7 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending //transfer the money cash.worth -= transaction_amount - vendor_account.money += transaction_amount + GLOB.vendor_account.money += transaction_amount //consume the cash if needed if(!cash.worth) @@ -667,9 +667,9 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending new_transaction.purpose = "Purchase of [currently_vending.product_name]" new_transaction.amount = "[transaction_amount]" new_transaction.source_terminal = name - new_transaction.date = current_date_string + new_transaction.date = GLOB.current_date_string new_transaction.time = worldtime2text() - vendor_account.transaction_log.Add(new_transaction) + GLOB.vendor_account.transaction_log.Add(new_transaction) return TRUE @@ -820,7 +820,7 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending if(inoperable()) return - if(user.stat || user.is_mob_restrained() || user.lying) + if(user.stat || user.is_mob_restrained()) return if(get_dist(user, src) > 1 || get_dist(src, A) > 1) diff --git a/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm b/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm index d352936b5434..6877c2b4b5b3 100644 --- a/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm +++ b/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm @@ -26,12 +26,12 @@ /obj/structure/machinery/cm_vending/gear/vehicle_crew/Initialize(mapload, ...) . = ..() RegisterSignal(SSdcs, COMSIG_GLOB_VEHICLE_ORDERED, PROC_REF(populate_products)) - if(!VehicleGearConsole) - VehicleGearConsole = src + if(!GLOB.VehicleGearConsole) + GLOB.VehicleGearConsole = src /obj/structure/machinery/cm_vending/gear/vehicle_crew/Destroy() UnregisterSignal(SSdcs, COMSIG_GLOB_VEHICLE_ORDERED) - VehicleGearConsole = null + GLOB.VehicleGearConsole = null return ..() /obj/structure/machinery/cm_vending/gear/vehicle_crew/get_appropriate_vend_turf(mob/living/carbon/human/H) @@ -87,9 +87,9 @@ . = list() . += ui_static_data(user) - if(supply_controller.tank_points) //we steal points from supply_controller, meh-he-he. Solely to be able to modify amount of points in vendor if needed by just changing one var. - available_points_to_display = supply_controller.tank_points - supply_controller.tank_points = 0 + if(GLOB.supply_controller.tank_points) //we steal points from GLOB.supply_controller, meh-he-he. Solely to be able to modify amount of points in vendor if needed by just changing one var. + available_points_to_display = GLOB.supply_controller.tank_points + GLOB.supply_controller.tank_points = 0 .["current_m_points"] = available_points_to_display var/list/ui_listed_products = get_listed_products(user) diff --git a/code/game/machinery/vending/vendor_types/dress.dm b/code/game/machinery/vending/vendor_types/dress.dm index aff221260d03..d49361d912a0 100644 --- a/code/game/machinery/vending/vendor_types/dress.dm +++ b/code/game/machinery/vending/vendor_types/dress.dm @@ -6,11 +6,11 @@ /obj/structure/machinery/cm_vending/clothing/dress/proc/get_listed_products_for_role(list/role_specific_uniforms) . = list() - for(var/category_type in uniform_categories) + for(var/category_type in GLOB.uniform_categories) var/display_category = FALSE - if(!uniform_categories[category_type]) + if(!GLOB.uniform_categories[category_type]) continue - for(var/category in uniform_categories[category_type]) + for(var/category in GLOB.uniform_categories[category_type]) if((category in role_specific_uniforms) && role_specific_uniforms[category]) display_category = TRUE break @@ -19,7 +19,7 @@ . += list( list(category_type, 0, null, null, null) ) - for(var/object_type in uniform_categories[category_type]) + for(var/object_type in GLOB.uniform_categories[category_type]) if(!role_specific_uniforms[object_type]) continue for(var/uniform_path in role_specific_uniforms[object_type]) @@ -52,11 +52,11 @@ if(istype(id_card)) role_specific_uniforms = id_card.uniform_sets vended_items = id_card.vended_items - for(var/category_type in uniform_categories) + for(var/category_type in GLOB.uniform_categories) var/display_category = FALSE - if(!uniform_categories[category_type]) + if(!GLOB.uniform_categories[category_type]) continue - for(var/category in uniform_categories[category_type]) + for(var/category in GLOB.uniform_categories[category_type]) if((category in role_specific_uniforms) && role_specific_uniforms[category]) display_category = TRUE break @@ -65,7 +65,7 @@ display_list += list( list(category_type, 0, null, null, null) ) - for(var/object_type in uniform_categories[category_type]) + for(var/object_type in GLOB.uniform_categories[category_type]) if(!role_specific_uniforms[object_type]) continue for(var/uniform_path in role_specific_uniforms[object_type]) @@ -134,10 +134,10 @@ to_chat(H, SPAN_WARNING("This machine isn't for you.")) return - for(var/category in uniform_categories) // Very Hacky fix + for(var/category in GLOB.uniform_categories) // Very Hacky fix if(!exploiting) break - for(var/specific_category in uniform_categories[category]) + for(var/specific_category in GLOB.uniform_categories[category]) if(!exploiting) break if(!(specific_category in id_card.uniform_sets)) diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_engineer.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_engineer.dm index 65397570511c..f11d1fd48b87 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_engineer.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_engineer.dm @@ -20,8 +20,6 @@ GLOBAL_LIST_INIT(cm_vending_gear_engi, list( list("Plasteel x10", 7, /obj/item/stack/sheet/plasteel/small_stack, null, VENDOR_ITEM_RECOMMENDED), list("Plastic Explosive", 3, /obj/item/explosive/plastic, null, VENDOR_ITEM_REGULAR), list("Breaching Charge", 5, /obj/item/explosive/plastic/breaching_charge, null, VENDOR_ITEM_RECOMMENDED), - list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), - list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), list("Sandbags x25", 10, /obj/item/stack/sandbags_empty/half, null, VENDOR_ITEM_RECOMMENDED), list("Super-Capacity Power Cell", 10, /obj/item/cell/super, null, VENDOR_ITEM_REGULAR), list("ES-11 Mobile Fuel Canister", 4, /obj/item/tool/weldpack/minitank, null, VENDOR_ITEM_REGULAR), @@ -72,6 +70,10 @@ GLOBAL_LIST_INIT(cm_vending_gear_engi, list( list("Motion Detector", 8, /obj/item/device/motiondetector, null, VENDOR_ITEM_REGULAR), list("Whistle", 3, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR), + list("BINOCULARS", 0, null, null, null), + list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), + list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), + list("HELMET OPTICS", 0, null, null, null), list("Medical Helmet Optic", 12, /obj/item/device/helmet_visor/medical, null, VENDOR_ITEM_REGULAR), diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_leader.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_leader.dm index 81c1941c3423..fc9813f9b172 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_leader.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_leader.dm @@ -23,18 +23,21 @@ GLOBAL_LIST_INIT(cm_vending_gear_leader, list( list("Machete Pouch (Full)", 4, /obj/item/storage/pouch/machete/full, null, VENDOR_ITEM_REGULAR), list("USCM Radio Telephone Pack", 5, /obj/item/storage/backpack/marine/satchel/rto, null, VENDOR_ITEM_REGULAR), list("M276 Pattern Combat Toolbelt Rig", 15, /obj/item/storage/belt/gun/utility, null, VENDOR_ITEM_REGULAR), - list("Night Vision Optic", 20, /obj/item/device/helmet_visor/night_vision, null, VENDOR_ITEM_RECOMMENDED), list("UTILITIES", 0, null, null, null), list("Whistle", 3, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR), - list("Range Finder", 3, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), - list("Laser Designator", 5, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), list("Fire Extinguisher (Portable)", 3, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR), list("Motion Detector", 5, /obj/item/device/motiondetector, null, VENDOR_ITEM_REGULAR), list("Fulton Device Stack", 5, /obj/item/stack/fulton, null, VENDOR_ITEM_REGULAR), + list("BINOCULARS", 0, null, null, null), + list("Range Finder", 3, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), + list("Laser Designator", 5, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), + list("HELMET OPTICS", 0, null, null, null), list("Welding Visor", 5, /obj/item/device/helmet_visor/welding_visor, null, VENDOR_ITEM_REGULAR), + list("Medical Helmet Optic", 4, /obj/item/device/helmet_visor/medical, null, VENDOR_ITEM_RECOMMENDED), + list("Night Vision Optic", 20, /obj/item/device/helmet_visor/night_vision, null, VENDOR_ITEM_RECOMMENDED), list("ENGINEERING SUPPLIES", 0, null, null, null), list("Insulated Gloves", 3, /obj/item/clothing/gloves/yellow, null, VENDOR_ITEM_REGULAR), @@ -74,7 +77,6 @@ GLOBAL_LIST_INIT(cm_vending_gear_leader, list( list("Injector (Tricord)", 1, /obj/item/reagent_container/hypospray/autoinjector/tricord, null, VENDOR_ITEM_REGULAR), list("Health Analyzer", 4, /obj/item/device/healthanalyzer, null, VENDOR_ITEM_REGULAR), - list("Medical Helmet Optic", 4, /obj/item/device/helmet_visor/medical, null, VENDOR_ITEM_RECOMMENDED), list("Roller Bed", 2, /obj/item/roller, null, VENDOR_ITEM_REGULAR), list("SPECIAL AMMUNITION", 0, null, null, null), diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_medic.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_medic.dm index f6b99887bbbb..21485f10c50f 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_medic.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_medic.dm @@ -81,12 +81,14 @@ GLOBAL_LIST_INIT(cm_vending_gear_medic, list( list("Welding Goggles", 3, /obj/item/clothing/glasses/welding, null, VENDOR_ITEM_REGULAR), list("UTILITIES", 0, null, null, null), - list("Range Finder", 6, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), - list("Laser Designator", 8, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), list("Fire Extinguisher (Portable)", 3, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR), list("Motion Detector", 8, /obj/item/device/motiondetector, null, VENDOR_ITEM_REGULAR), list("Whistle", 3, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR), + list("BINOCULARS", 0, null, null, null), + list("Range Finder", 6, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), + list("Laser Designator", 8, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), + list("HELMET OPTICS", 0, null, null, null), list("Welding Visor", 5, /obj/item/device/helmet_visor/welding_visor, null, VENDOR_ITEM_REGULAR), diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm index 94325b09e9eb..52418fb8940c 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm @@ -307,6 +307,7 @@ req_access = list(ACCESS_MARINE_ALPHA) req_one_access = list(ACCESS_MARINE_LEADER, ACCESS_MARINE_SPECPREP, ACCESS_MARINE_RO) hackable = TRUE + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND vend_y_offset = 1 diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_rifleman.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_rifleman.dm index 6a569638984b..2e6f78f068f5 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_rifleman.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_rifleman.dm @@ -92,13 +92,15 @@ GLOBAL_LIST_INIT(cm_vending_clothing_marine, list( list("Sandbags", 20, /obj/item/stack/sandbags_empty/half, null, VENDOR_ITEM_REGULAR), list("Roller Bed", 5, /obj/item/roller, null, VENDOR_ITEM_REGULAR), list("Fulton Device Stack", 5, /obj/item/stack/fulton, null, VENDOR_ITEM_REGULAR), - list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), - list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), list("Fire Extinguisher (Portable)", 5, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR), list("Motion Detector", 15, /obj/item/device/motiondetector, null, VENDOR_ITEM_REGULAR), list("Data Detector", 15, /obj/item/device/motiondetector/intel, null, VENDOR_ITEM_REGULAR), list("Whistle", 5, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR), + list("BINOCULARS", 0, null, null, null), + list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), + list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), + list("HELMET OPTICS", 0, null, null, null), list("Medical Helmet Optic", 15, /obj/item/device/helmet_visor/medical, null, VENDOR_ITEM_REGULAR), list("Welding Visor", 5, /obj/item/device/helmet_visor/welding_visor, null, VENDOR_ITEM_REGULAR), diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_smartgunner.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_smartgunner.dm index 41710b477769..b67d11b3f487 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_smartgunner.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_smartgunner.dm @@ -29,13 +29,15 @@ GLOBAL_LIST_INIT(cm_vending_gear_smartgun, list( list("Large General Pouch", 6, /obj/item/storage/pouch/general/large, null, VENDOR_ITEM_REGULAR), list("UTILITIES", 0, null, null, null), - list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), - list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), list("Fire Extinguisher (Portable)", 5, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR), list("Whistle", 5, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR), list("Roller Bed", 5, /obj/item/roller, null, VENDOR_ITEM_REGULAR), list("Fulton Device Stack", 5, /obj/item/stack/fulton, null, VENDOR_ITEM_REGULAR), + list("BINOCULARS", 0, null, null, null), + list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), + list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), + list("HELMET OPTICS", 0, null, null, null), list("Medical Helmet Optic", 15, /obj/item/device/helmet_visor/medical, null, VENDOR_ITEM_REGULAR), list("Welding Visor", 5, /obj/item/device/helmet_visor/welding_visor, null, VENDOR_ITEM_REGULAR), diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_tl.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_tl.dm index 7bd45cb46a60..1c86a293772e 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_tl.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_tl.dm @@ -43,7 +43,6 @@ GLOBAL_LIST_INIT(cm_vending_gear_tl, list( list("Night Vision Optic", 30, /obj/item/device/helmet_visor/night_vision, null, VENDOR_ITEM_RECOMMENDED), list("UTILITIES", 0, null, null, null), - list("Binoculars", 5, /obj/item/device/binoculars, null, VENDOR_ITEM_REGULAR), list("Motion Detector", 15, /obj/item/device/motiondetector, null, VENDOR_ITEM_RECOMMENDED), list("Plastic Explosive", 10, /obj/item/explosive/plastic, null, VENDOR_ITEM_REGULAR), list("Breaching Charge", 10, /obj/item/explosive/plastic/breaching_charge, null, VENDOR_ITEM_REGULAR), @@ -52,6 +51,9 @@ GLOBAL_LIST_INIT(cm_vending_gear_tl, list( list("Fire Extinguisher (Portable)", 5, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR), list("Whistle", 5, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR), + list("BINOCULARS", 0, null, null, null), + list("Binoculars", 5, /obj/item/device/binoculars, null, VENDOR_ITEM_REGULAR), + list("HELMET OPTICS", 0, null, null, null), list("Medical Helmet Optic", 15, /obj/item/device/helmet_visor/medical, null, VENDOR_ITEM_REGULAR), list("Welding Visor", 5, /obj/item/device/helmet_visor/welding_visor, null, VENDOR_ITEM_REGULAR), diff --git a/code/game/machinery/weather_siren.dm b/code/game/machinery/weather_siren.dm index c7752a3dccf1..7816a33391e3 100644 --- a/code/game/machinery/weather_siren.dm +++ b/code/game/machinery/weather_siren.dm @@ -11,11 +11,11 @@ health = 0 /obj/structure/machinery/weather_siren/Initialize() - weather_notify_objects += src + GLOB.weather_notify_objects += src return ..() /obj/structure/machinery/weather_siren/Destroy() - weather_notify_objects -= src + GLOB.weather_notify_objects -= src . = ..() /obj/structure/machinery/weather_siren/power_change() diff --git a/code/game/objects/effects/acid_hole.dm b/code/game/objects/effects/acid_hole.dm index 415df0e7e5a7..a4db9ef5c0e0 100644 --- a/code/game/objects/effects/acid_hole.dm +++ b/code/game/objects/effects/acid_hole.dm @@ -50,18 +50,18 @@ return XENO_NO_DELAY_ACTION /obj/effect/acid_hole/proc/expand_hole(mob/living/carbon/xenomorph/user) - if(user.action_busy || user.lying) + if(user.action_busy || user.is_mob_incapacitated()) return playsound(src, "pry", 25, 1) xeno_attack_delay(user) - if(do_after(user, 60, INTERRUPT_ALL, BUSY_ICON_GENERIC) && !QDELETED(src) && holed_wall && !user.lying && istype(holed_wall)) + if(do_after(user, 60, INTERRUPT_ALL, BUSY_ICON_GENERIC) && !QDELETED(src) && holed_wall && istype(holed_wall)) holed_wall.take_damage(rand(2000,3500)) user.emote("roar") -/obj/effect/acid_hole/proc/use_wall_hole(mob/user) +/obj/effect/acid_hole/proc/use_wall_hole(mob/living/user) - if(user.mob_size >= MOB_SIZE_BIG || user.is_mob_incapacitated() || user.lying || user.buckled || user.anchored) + if(user.mob_size >= MOB_SIZE_BIG || user.is_mob_incapacitated() || user.buckled || user.anchored) return FALSE var/mob_dir = get_dir(user, src) @@ -95,7 +95,7 @@ to_chat(user, SPAN_NOTICE("You start crawling through the hole.")) if(do_after(user, 15, INTERRUPT_NO_NEEDHAND, BUSY_ICON_GENERIC)) - if(!user.is_mob_incapacitated() && !user.lying && !user.buckled) + if(!user.is_mob_incapacitated() && !user.buckled) if (T.density) return for(var/obj/O in T) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 867c6924b39d..0b44c0bb4443 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -160,7 +160,7 @@ //damages human that comes in contact /obj/effect/xenomorph/spray/proc/apply_spray(mob/living/carbon/H, should_stun = TRUE) - if(!H.lying) + if(H.body_position == STANDING_UP) to_chat(H, SPAN_DANGER("Your feet scald and burn! Argh!")) if(ishuman(H)) H.emote("pain") @@ -264,7 +264,7 @@ else PAS.increment_stack_count(2) - if(!H.lying) + if(H.body_position == STANDING_UP) to_chat(H, SPAN_DANGER("Your feet scald and burn! Argh!")) H.emote("pain") H.last_damage_data = cause_data diff --git a/code/game/objects/effects/decals/cleanable/fuel.dm b/code/game/objects/effects/decals/cleanable/fuel.dm index 3e245f760e21..a3f5f2d4e1a7 100644 --- a/code/game/objects/effects/decals/cleanable/fuel.dm +++ b/code/game/objects/effects/decals/cleanable/fuel.dm @@ -24,7 +24,7 @@ if(amount < 5.0) return var/turf/S = loc if(!istype(S)) return - for(var/d in cardinal) + for(var/d in GLOB.cardinals) if(rand(25)) var/turf/target = get_step(src, d) var/turf/origin = get_turf(src) diff --git a/code/game/objects/effects/effect_system/chemsmoke.dm b/code/game/objects/effects/effect_system/chemsmoke.dm index eeb17f7c98d0..0c74912ceb25 100644 --- a/code/game/objects/effects/effect_system/chemsmoke.dm +++ b/code/game/objects/effects/effect_system/chemsmoke.dm @@ -195,7 +195,7 @@ chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / dist, safety = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents smoke.icon = I smoke.layer = FLY_LAYER - smoke.setDir(pick(cardinal)) + smoke.setDir(pick(GLOB.cardinals)) smoke.pixel_x = -32 + rand(-8,8) smoke.pixel_y = -32 + rand(-8,8) walk_to(smoke, T) @@ -229,7 +229,7 @@ while(pending.len) for(var/turf/current in pending) - for(var/D in cardinal) + for(var/D in GLOB.cardinals) var/turf/target = get_step(current, D) if(wallList) if(istype(target, /turf/closed/wall)) diff --git a/code/game/objects/effects/effect_system/effect_system.dm b/code/game/objects/effects/effect_system/effect_system.dm index 49342af8514f..2e2203682798 100644 --- a/code/game/objects/effects/effect_system/effect_system.dm +++ b/code/game/objects/effects/effect_system/effect_system.dm @@ -41,10 +41,10 @@ would spawn and follow the beaker, even if it is carried or thrown. // will always spawn at the items location, even if it's moved. /* Example: -var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread() -- creates new system -steam.set_up(5, 0, mob.loc) -- sets up variables -OPTIONAL: steam.attach(mob) -steam.start() -- spawns the effect + var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread() -- creates new system + steam.set_up(5, 0, mob.loc) -- sets up variables + OPTIONAL: steam.attach(mob) + steam.start() -- spawns the effect */ ///////////////////////////////////////////// /obj/effect/particle_effect/steam @@ -71,9 +71,9 @@ steam.start() -- spawns the effect var/obj/effect/particle_effect/steam/steam = new /obj/effect/particle_effect/steam(location) var/direction if(cardinals) - direction = pick(cardinal) + direction = pick(GLOB.cardinals) else - direction = pick(alldirs) + direction = pick(GLOB.alldirs) for(i=0, i0) S.spread_smoke() @@ -548,7 +548,7 @@ if(QDELETED(src)) return var/turf/U = get_turf(src) if(!U) return - for(var/i in cardinal) + for(var/i in GLOB.cardinals) if(direction && i != direction) continue var/turf/T = get_step(U, i) @@ -569,7 +569,7 @@ if(istype(A, /obj/flamer_fire)) qdel(A) - S.setDir(pick(cardinal)) + S.setDir(pick(GLOB.cardinals)) S.time_to_live = time_to_live if(S.amount>0) S.spread_smoke() diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 56c6ae45cda7..aa5e2ec400e2 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -46,7 +46,7 @@ set background = 1 var/direction = 16 - for(var/wallDir in cardinal) + for(var/wallDir in GLOB.cardinals) var/turf/newTurf = get_step(location,wallDir) if(istype(newTurf, /turf/closed/wall)) direction |= wallDir diff --git a/code/game/objects/effects/landmarks/corpsespawner.dm b/code/game/objects/effects/landmarks/corpsespawner.dm index fe338bceabfe..27a717f58ba8 100644 --- a/code/game/objects/effects/landmarks/corpsespawner.dm +++ b/code/game/objects/effects/landmarks/corpsespawner.dm @@ -135,7 +135,7 @@ /obj/effect/landmark/corpsespawner/wy/manager/burst name = "Burst Corporate Supervisor" - equip_path = /datum/equipment_preset/corpse/ua_riot/burst + equip_path = /datum/equipment_preset/corpse/wy/manager/burst ///////////Faction Specific Corpses////////////////////// diff --git a/code/game/objects/effects/landmarks/item_pool.dm b/code/game/objects/effects/landmarks/item_pool.dm index e01a6bbc3fd0..a5e628cd656b 100644 --- a/code/game/objects/effects/landmarks/item_pool.dm +++ b/code/game/objects/effects/landmarks/item_pool.dm @@ -13,10 +13,10 @@ /obj/effect/landmark/item_pool_spawner/Initialize(mapload, ...) . = ..() - item_pool_landmarks += src + GLOB.item_pool_landmarks += src /obj/effect/landmark/item_pool_spawner/Destroy() - item_pool_landmarks -= src + GLOB.item_pool_landmarks -= src . = ..() /obj/effect/landmark/item_pool_spawner/corsat_bio_lock diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index 16f30eaf0fd2..ce0fd5506cd7 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -176,17 +176,17 @@ user = _user if(squad_name) name = "[squad_name] laser" - if(user && user.faction && cas_groups[user.faction]) + if(user && user.faction && GLOB.cas_groups[user.faction]) signal = new(src) signal.name = name signal.target_id = tracking_id signal.linked_cam = new(loc, name) - cas_groups[user.faction].add_signal(signal) + GLOB.cas_groups[user.faction].add_signal(signal) /obj/effect/overlay/temp/laser_target/Destroy() if(signal) - cas_groups[user.faction].remove_signal(signal) + GLOB.cas_groups[user.faction].remove_signal(signal) if(signal.linked_cam) qdel(signal.linked_cam) signal.linked_cam = null @@ -225,7 +225,7 @@ effect_duration = 10 /obj/effect/overlay/temp/emp_sparks/New(loc) - setDir(pick(cardinal)) + setDir(pick(GLOB.cardinals)) ..() /obj/effect/overlay/temp/emp_pulse diff --git a/code/game/objects/effects/spawners/gibspawner.dm b/code/game/objects/effects/spawners/gibspawner.dm index 382b92489baa..77b69f79e86f 100644 --- a/code/game/objects/effects/spawners/gibspawner.dm +++ b/code/game/objects/effects/spawners/gibspawner.dm @@ -99,7 +99,7 @@ gibamounts = list(1,1,1) /obj/effect/spawner/gibspawner/human/Initialize(mapload, list/viruses, mob/living/ml, fleshcolor, bloodcolor) - gibdirections = list(alldirs, alldirs, list()) + gibdirections = list(GLOB.alldirs, GLOB.alldirs, list()) . = ..() /obj/effect/spawner/gibspawner/xeno @@ -107,7 +107,7 @@ gibamounts = list(1,1,1) /obj/effect/spawner/gibspawner/xeno/Initialize(mapload, list/viruses, mob/living/ml, fleshcolor, bloodcolor) - gibdirections = list(alldirs, alldirs, list()) + gibdirections = list(GLOB.alldirs, GLOB.alldirs, list()) . = ..() /obj/effect/spawner/gibspawner/robot @@ -116,6 +116,6 @@ gibamounts = list(1,1,1,1,1,1) /obj/effect/spawner/gibspawner/robot/Initialize(mapload, list/viruses, mob/living/ml, fleshcolor, bloodcolor) - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs) gibamounts[6] = pick(0,1,2) . = ..() diff --git a/code/game/objects/effects/spawners/random.dm b/code/game/objects/effects/spawners/random.dm index d302e7794f8b..388e9f289cd7 100644 --- a/code/game/objects/effects/spawners/random.dm +++ b/code/game/objects/effects/spawners/random.dm @@ -342,9 +342,9 @@ var/gunpath = pick(guns) var/ammopath if(istype(gunpath, /obj/item/weapon/gun/shotgun)) - ammopath = pick(shotgun_boxes_12g) + ammopath = pick(GLOB.shotgun_boxes_12g) else if(istype(gunpath, /obj/item/weapon/gun/launcher/grenade)) - ammopath = pick(grenade_packets) + ammopath = pick(GLOB.grenade_packets) else ammopath = guns[gunpath] spawn_weapon_on_floor(gunpath, ammopath, rand(mags_min, mags_max)) @@ -358,7 +358,7 @@ if(gunpath) gun = new gunpath(spawnloc) if(scatter) - var/direction = pick(alldirs) + var/direction = pick(GLOB.alldirs) var/turf/turf = get_step(gun, direction) if(!turf || turf.density) return @@ -368,7 +368,7 @@ ammo = new ammopath(spawnloc) if(scatter) for(i=0, iTake a closer look.", SHOW_MESSAGE_VISIBLE) @@ -850,7 +850,7 @@ cases. Override_icon_state should be a list.*/ UnregisterSignal(user, COMSIG_MOB_MOVE_OR_LOOK) //General reset in case anything goes wrong, the view will always reset to default unless zooming in. if(user.client) - user.client.change_view(world_view_size, src) + user.client.change_view(GLOB.world_view_size, src) user.client.pixel_x = 0 user.client.pixel_y = 0 @@ -920,9 +920,10 @@ cases. Override_icon_state should be a list.*/ mob_state += GLOB.slot_to_contained_sprite_shorthand[slot] return mob_state -/obj/item/proc/drop_to_floor(mob/wearer) +/obj/item/proc/drop_to_floor(mob/wearer, body_position) SIGNAL_HANDLER - wearer.drop_inv_item_on_ground(src) + if(body_position == LYING_DOWN) + wearer.drop_inv_item_on_ground(src) // item animatzionen diff --git a/code/game/objects/items/books/manuals.dm b/code/game/objects/items/books/manuals.dm index ba2a30c35c7d..0854d2ec1b06 100644 --- a/code/game/objects/items/books/manuals.dm +++ b/code/game/objects/items/books/manuals.dm @@ -1302,9 +1302,9 @@ /obj/item/book/manual/orbital_cannon_manual/New() . = ..() - LAZYADD(objects_of_interest, src) + LAZYADD(GLOB.objects_of_interest, src) /obj/item/book/manual/orbital_cannon_manual/Destroy() . = ..() - LAZYREMOVE(objects_of_interest, src) + LAZYREMOVE(GLOB.objects_of_interest, src) diff --git a/code/game/objects/items/circuitboards/computer.dm b/code/game/objects/items/circuitboards/computer.dm index 122136f6f2fa..40c66bc0fa6a 100644 --- a/code/game/objects/items/circuitboards/computer.dm +++ b/code/game/objects/items/circuitboards/computer.dm @@ -278,7 +278,7 @@ to_chat(usr, "No input found please hang up and try your call again.") return var/list/tempnetwork = splittext(input, ",") - tempnetwork = difflist(tempnetwork,RESTRICTED_CAMERA_NETWORKS,1) + tempnetwork = difflist(tempnetwork,GLOB.RESTRICTED_CAMERA_NETWORKS,1) if(tempnetwork.len < 1) to_chat(usr, "No network found please hang up and try your call again.") return diff --git a/code/game/objects/items/devices/autopsy_scanner.dm b/code/game/objects/items/devices/autopsy_scanner.dm index c4c7ec665e23..6703ead88147 100644 --- a/code/game/objects/items/devices/autopsy_scanner.dm +++ b/code/game/objects/items/devices/autopsy_scanner.dm @@ -17,12 +17,12 @@ /obj/item/device/autopsy_scanner/Initialize() . = ..() - LAZYADD(objects_of_interest, src) + LAZYADD(GLOB.objects_of_interest, src) /obj/item/device/autopsy_scanner/Destroy() . = ..() - LAZYREMOVE(objects_of_interest, src) + LAZYREMOVE(GLOB.objects_of_interest, src) /datum/autopsy_data_scanner var/weapon = null // this is the DEFINITE weapon type that was used @@ -90,7 +90,7 @@ var/scan_data = "" if(timeofdeath) - scan_data += "Time of death: [worldtime2text("hh:mm", timeofdeath)] [time2text(timeofdeath, "DDD MMM DD [game_year]")]

    " + scan_data += "Time of death: [worldtime2text("hh:mm", timeofdeath)] [time2text(timeofdeath, "DDD MMM DD [GLOB.game_year]")]

    " var/n = 1 for(var/wdata_idx in wdata) @@ -139,7 +139,7 @@ if(damaging_weapon) scan_data += "Severity: [damage_desc]
    " scan_data += "Hits by weapon: [total_hits]
    " - scan_data += "Approximate time of wound infliction: [worldtime2text("hh:mm", age)] [time2text(age, "DDD MMM DD [game_year]")]
    " + scan_data += "Approximate time of wound infliction: [worldtime2text("hh:mm", age)] [time2text(age, "DDD MMM DD [GLOB.game_year]")]
    " scan_data += "Affected limbs: [D.organ_names]
    " scan_data += "Possible weapons:
    " for(var/weapon_name in weapon_chances) @@ -174,7 +174,7 @@ M.update_inv_r_hand() /obj/item/device/autopsy_scanner/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob) - if(!istype(M) || !M.lying) + if(!istype(M) || !M.is_mob_incapacitated()) return var/table diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index 2d44ce076f30..a9b7706bcfb7 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -215,7 +215,7 @@ /obj/item/device/binoculars/range/designator/Initialize() . = ..() - tracking_id = ++cas_tracking_id_increment + tracking_id = ++GLOB.cas_tracking_id_increment /obj/item/device/binoculars/range/designator/Destroy() QDEL_NULL(laser) @@ -422,7 +422,7 @@ if(!(GLOB.character_traits[/datum/character_trait/skills/spotter] in human.traits)) to_chat(human, SPAN_WARNING("You have no idea how to use this!")) return FALSE - if(istype(human) && !human.is_mob_incapacitated() && !human.lying && (holder_item == human.r_hand || holder_item || human.l_hand)) + if(istype(human) && !human.is_mob_incapacitated() && (holder_item == human.r_hand || holder_item || human.l_hand)) return TRUE /datum/action/item_action/specialist/spotter_target/proc/use_ability(atom/targeted_atom) diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index 80a0d603282f..1549fbd3739b 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -10,7 +10,7 @@ ..() var/list/cameras = new/list() - for (var/obj/structure/machinery/camera/C in cameranet.cameras) + for (var/obj/structure/machinery/camera/C in GLOB.cameranet.cameras) if (C.bugged && C.status) cameras.Add(C) if (length(cameras) == 0) diff --git a/code/game/objects/items/devices/cictablet.dm b/code/game/objects/items/devices/cictablet.dm index 69e745da0803..3f87b2bfbea2 100644 --- a/code/game/objects/items/devices/cictablet.dm +++ b/code/game/objects/items/devices/cictablet.dm @@ -63,7 +63,7 @@ /obj/item/device/cotablet/ui_data(mob/user) var/list/data = list() - data["alert_level"] = security_level + data["alert_level"] = GLOB.security_level data["evac_status"] = SShijack.evac_status data["endtime"] = announcement_cooldown data["distresstime"] = distress_cooldown @@ -134,7 +134,7 @@ if(announcement_faction != FACTION_MARINE) return - if(security_level < SEC_LEVEL_RED) + if(GLOB.security_level < SEC_LEVEL_RED) to_chat(usr, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures.")) return FALSE @@ -155,7 +155,7 @@ if(!SSticker.mode) return FALSE //Not a game mode? - if(security_level == SEC_LEVEL_DELTA) + if(GLOB.security_level == SEC_LEVEL_DELTA) to_chat(usr, SPAN_WARNING("The ship is already undergoing self destruct procedures!")) return FALSE diff --git a/code/game/objects/items/devices/device.dm b/code/game/objects/items/devices/device.dm index d3058960233c..23fe7b86bb3a 100644 --- a/code/game/objects/items/devices/device.dm +++ b/code/game/objects/items/devices/device.dm @@ -7,7 +7,7 @@ /obj/item/device/Initialize(mapload, ...) . = ..() - serial_number = "[rand(0,9)][pick(alphabet_uppercase)][rand(0,9)][rand(0,9)][rand(0,9)][rand(0,9)][pick(alphabet_uppercase)]" + serial_number = "[rand(0,9)][pick(GLOB.alphabet_uppercase)][rand(0,9)][rand(0,9)][rand(0,9)][rand(0,9)][pick(GLOB.alphabet_uppercase)]" /obj/item/device/get_examine_text(mob/user) . = ..() diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 114964464a25..58e86998f39a 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -487,13 +487,13 @@ /obj/item/device/flashlight/flare/signal/activate_signal(mob/living/carbon/human/user) ..() - if(faction && cas_groups[faction]) + if(faction && GLOB.cas_groups[faction]) signal = new(src) - signal.target_id = ++cas_tracking_id_increment + signal.target_id = ++GLOB.cas_tracking_id_increment name = "[user.assigned_squad ? user.assigned_squad.name : "X"]-[signal.target_id] flare" signal.name = name signal.linked_cam = new(loc, name) - cas_groups[user.faction].add_signal(signal) + GLOB.cas_groups[user.faction].add_signal(signal) anchored = TRUE if(activate_message) visible_message(SPAN_DANGER("[src]'s flame reaches full strength. It's fully active now."), null, 5) @@ -513,14 +513,14 @@ /obj/item/device/flashlight/flare/signal/Destroy() STOP_PROCESSING(SSobj, src) if(signal) - cas_groups[faction].remove_signal(signal) + GLOB.cas_groups[faction].remove_signal(signal) QDEL_NULL(signal) return ..() /obj/item/device/flashlight/flare/signal/turn_off() anchored = FALSE if(signal) - cas_groups[faction].remove_signal(signal) + GLOB.cas_groups[faction].remove_signal(signal) qdel(signal) ..() @@ -549,9 +549,9 @@ turn_on() faction = FACTION_MARINE signal = new(src) - signal.target_id = ++cas_tracking_id_increment + signal.target_id = ++GLOB.cas_tracking_id_increment name += " [rand(100, 999)]" signal.name = name signal.linked_cam = new(loc, name) - cas_groups[FACTION_MARINE].add_signal(signal) + GLOB.cas_groups[FACTION_MARINE].add_signal(signal) anchored = TRUE diff --git a/code/game/objects/items/devices/helmet_visors.dm b/code/game/objects/items/devices/helmet_visors.dm index 596409c88c8b..c3c3f9597060 100644 --- a/code/game/objects/items/devices/helmet_visors.dm +++ b/code/game/objects/items/devices/helmet_visors.dm @@ -61,12 +61,12 @@ /// Called by toggle_visor() to activate the visor's effects /obj/item/device/helmet_visor/proc/activate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) - var/datum/mob_hud/current_mob_hud = huds[hud_type] + var/datum/mob_hud/current_mob_hud = GLOB.huds[hud_type] current_mob_hud.add_hud_to(user, attached_helmet) /// Called by toggle_visor() to deactivate the visor's effects /obj/item/device/helmet_visor/proc/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) - var/datum/mob_hud/current_mob_hud = huds[hud_type] + var/datum/mob_hud/current_mob_hud = GLOB.huds[hud_type] current_mob_hud.remove_hud_from(user, attached_helmet) /// Called by /obj/item/clothing/head/helmet/marine/get_examine_text(mob/user) to get extra examine text for this visor @@ -112,7 +112,7 @@ /obj/item/device/helmet_visor/medical/advanced/ui_data(mob/user) var/list/data = list( - "published_documents" = chemical_data.research_publications, + "published_documents" = GLOB.chemical_data.research_publications, "terminal_view" = FALSE ) return data @@ -140,7 +140,7 @@ if ("read_document") var/print_type = params["print_type"] var/print_title = params["print_title"] - var/obj/item/paper/research_report/report = chemical_data.get_report(print_type, print_title) + var/obj/item/paper/research_report/report = GLOB.chemical_data.get_report(print_type, print_title) if(report) report.read_paper(user) return @@ -311,14 +311,14 @@ . = ..() for(var/type in hud_type) - var/datum/mob_hud/current_mob_hud = huds[type] + var/datum/mob_hud/current_mob_hud = GLOB.huds[type] current_mob_hud.add_hud_to(user, attached_helmet) /obj/item/device/helmet_visor/night_vision/marine_raider/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) . = ..() for(var/type in hud_type) - var/datum/mob_hud/current_mob_hud = huds[type] + var/datum/mob_hud/current_mob_hud = GLOB.huds[type] current_mob_hud.remove_hud_from(user, attached_helmet) /obj/item/device/helmet_visor/night_vision/marine_raider/process(delta_time) diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index 273ced980b44..a92135b9d7ed 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -53,8 +53,8 @@ var/area/A = get_area(src) var/APC = A? A.get_apc() : null if(APC) - to_chat(user, SPAN_NOTICE("The local APC is located at [SPAN_BOLD("[get_dist(src, APC)] units [dir2text(get_dir(src, APC))]")].")) - user.balloon_alert(user, "[get_dist(src, APC)] units [dir2text(get_dir(src, APC))]") + to_chat(user, SPAN_NOTICE("The local APC is located at [SPAN_BOLD("[get_dist(src, APC)] units [dir2text(Get_Compass_Dir(src, APC))]")].")) + user.balloon_alert(user, "[get_dist(src, APC)] units [dir2text(Get_Compass_Dir(src, APC))]") else to_chat(user, SPAN_WARNING("ERROR: Could not locate local APC.")) user.balloon_alert(user, "could not locate!") diff --git a/code/game/objects/items/devices/personal_data_transmitter.dm b/code/game/objects/items/devices/personal_data_transmitter.dm index 6e8aa001cad3..98f8c60452ea 100644 --- a/code/game/objects/items/devices/personal_data_transmitter.dm +++ b/code/game/objects/items/devices/personal_data_transmitter.dm @@ -122,7 +122,7 @@ return var/dist = get_dist(self_turf, bracelet_turf) - var/direction = dir2text_short(get_dir(self_turf, bracelet_turf)) + var/direction = dir2text_short(Get_Compass_Dir(self_turf, bracelet_turf)) if(dist > 1) to_chat(user, SPAN_BOLDNOTICE("The display on \the [src] lights up: [dist]-[direction]")) else diff --git a/code/game/objects/items/devices/pinpointer.dm b/code/game/objects/items/devices/pinpointer.dm index 7ec3118ef96b..2f5d9ffe9d5f 100644 --- a/code/game/objects/items/devices/pinpointer.dm +++ b/code/game/objects/items/devices/pinpointer.dm @@ -31,7 +31,7 @@ if(!the_disk) icon_state = "pinonnull" return - setDir(get_dir(src,the_disk)) + setDir(Get_Compass_Dir(src,the_disk)) switch(get_dist(src,the_disk)) if(0) icon_state = "pinondirect" @@ -45,7 +45,7 @@ /obj/item/device/pinpointer/get_examine_text(mob/user) . = ..() - for(var/obj/structure/machinery/nuclearbomb/bomb in machines) + for(var/obj/structure/machinery/nuclearbomb/bomb in GLOB.machines) if(bomb.timing) . += "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]" @@ -80,7 +80,7 @@ if(!location) icon_state = "pinonnull" return - setDir(get_dir(src,location)) + setDir(Get_Compass_Dir(src,location)) switch(get_dist(src,location)) if(0) icon_state = "pinondirect" @@ -99,7 +99,7 @@ if(!target) icon_state = "pinonnull" return - setDir(get_dir(src,target)) + setDir(Get_Compass_Dir(src,target)) switch(get_dist(src,target)) if(0) icon_state = "pinondirect" diff --git a/code/game/objects/items/devices/pipe_painter.dm b/code/game/objects/items/devices/pipe_painter.dm index 840098cbc492..a69fe64c2565 100644 --- a/code/game/objects/items/devices/pipe_painter.dm +++ b/code/game/objects/items/devices/pipe_painter.dm @@ -9,7 +9,7 @@ /obj/item/device/pipe_painter/New() ..() modes = new() - for(var/C in pipe_colors) + for(var/C in GLOB.pipe_colors) modes += "[C]" mode = pick(modes) @@ -26,7 +26,7 @@ to_chat(user, SPAN_DANGER("You must remove the plating first.")) return - P.change_color(pipe_colors[mode]) + P.change_color(GLOB.pipe_colors[mode]) /obj/item/device/pipe_painter/attack_self(mob/user) ..() diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 0b8cbc303c06..bc97cf04fdfb 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -27,7 +27,7 @@ set category = "Object" set src in usr - if ((usr.canmove && !( usr.is_mob_restrained() ))) + if (usr.is_mob_incapacitated()) src.code = t if (!( src.code )) src.code = "beacon" diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index fb8640eeaa71..7ec941f1192b 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -59,8 +59,8 @@ verbs += /obj/item/device/radio/headset/proc/switch_tracker_target if(frequency) - for(var/cycled_channel in radiochannels) - if(radiochannels[cycled_channel] == frequency) + for(var/cycled_channel in GLOB.radiochannels) + if(GLOB.radiochannels[cycled_channel] == frequency) default_freq = cycled_channel /obj/item/device/radio/headset/Destroy() @@ -183,7 +183,7 @@ /obj/item/device/radio/headset/proc/recalculateChannels() for(var/ch_name in channels) - SSradio.remove_object(src, radiochannels[ch_name]) + SSradio.remove_object(src, GLOB.radiochannels[ch_name]) secure_radio_connections[ch_name] = null channels = list() translate_apollo = FALSE @@ -214,14 +214,14 @@ locate_setting = initial(locate_setting) for (var/ch_name in channels) - secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT) + secure_radio_connections[ch_name] = SSradio.add_object(src, GLOB.radiochannels[ch_name], RADIO_CHAT) SStgui.update_uis(src) /obj/item/device/radio/headset/set_frequency(new_frequency) ..() if(frequency) - for(var/cycled_channel in radiochannels) - if(radiochannels[cycled_channel] == frequency) + for(var/cycled_channel in GLOB.radiochannels) + if(GLOB.radiochannels[cycled_channel] == frequency) default_freq = cycled_channel /obj/item/device/radio/headset/equipped(mob/living/carbon/human/user, slot) @@ -237,7 +237,7 @@ RegisterSignal(user, COMSIG_MOB_DEATH, PROC_REF(update_minimap_icon)) RegisterSignal(user, COMSIG_HUMAN_SET_UNDEFIBBABLE, PROC_REF(update_minimap_icon)) if(headset_hud_on) - var/datum/mob_hud/H = huds[hud_type] + var/datum/mob_hud/H = GLOB.huds[hud_type] H.add_hud_to(user, src) //squad leader locator is no longer invisible on our player HUD. if(user.mind && (user.assigned_squad || misc_tracking) && user.hud_used && user.hud_used.locate_leader) @@ -256,7 +256,7 @@ COMSIG_MOB_STAT_SET_ALIVE )) if(istype(user) && user.has_item_in_ears(src)) //dropped() is called before the inventory reference is update. - var/datum/mob_hud/H = huds[hud_type] + var/datum/mob_hud/H = GLOB.huds[hud_type] H.remove_hud_from(user, src) //squad leader locator is invisible again if(user.hud_used && user.hud_used.locate_leader) @@ -288,7 +288,7 @@ if(ishuman(usr)) var/mob/living/carbon/human/user = usr if(user.has_item_in_ears(src)) //worn - var/datum/mob_hud/H = huds[hud_type] + var/datum/mob_hud/H = GLOB.huds[hud_type] if(headset_hud_on) H.add_hud_to(usr, src) if(user.mind && (misc_tracking || user.assigned_squad) && user.hud_used?.locate_leader) @@ -808,7 +808,7 @@ set_frequency(frequency) for(var/ch_name in channels) - secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT) + secure_radio_connections[ch_name] = SSradio.add_object(src, GLOB.radiochannels[ch_name], RADIO_CHAT) recalculateChannels() if(H.mind && H.hud_used && H.hud_used.locate_leader) //make SL tracker visible H.hud_used.locate_leader.alpha = 255 diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index c503edc8f94f..c628758c74e8 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -73,7 +73,7 @@ set_frequency(frequency) for (var/ch_name in channels) - secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT) + secure_radio_connections[ch_name] = SSradio.add_object(src, GLOB.radiochannels[ch_name], RADIO_CHAT) flags_atom |= USES_HEARING @@ -461,7 +461,7 @@ for(var/ch_name in channels) - SSradio.remove_object(src, radiochannels[ch_name]) + SSradio.remove_object(src, GLOB.radiochannels[ch_name]) secure_radio_connections[ch_name] = null @@ -509,7 +509,7 @@ src.channels[ch_name] += keyslot.channels[ch_name] for (var/ch_name in src.channels) - secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT) + secure_radio_connections[ch_name] = SSradio.add_object(src, GLOB.radiochannels[ch_name], RADIO_CHAT) SStgui.update_uis(src) @@ -563,11 +563,11 @@ /obj/item/device/radio/proc/config(op) for (var/ch_name in channels) - SSradio.remove_object(src, radiochannels[ch_name]) + SSradio.remove_object(src, GLOB.radiochannels[ch_name]) secure_radio_connections = new channels = op for (var/ch_name in op) - secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT) + secure_radio_connections[ch_name] = SSradio.add_object(src, GLOB.radiochannels[ch_name], RADIO_CHAT) /obj/item/device/radio/off listening = 0 diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index a4247c90a5b3..9fe3521d858b 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -261,7 +261,7 @@ audible_message(SPAN_MAROON("[icon2html(src, usr)] End of recording.")) break - var/list/heard = get_mobs_in_view(world_view_size, src) + var/list/heard = get_mobs_in_view(GLOB.world_view_size, src) langchat_speech(mytape.storedinfo[i], heard, GLOB.all_languages, skip_language_check = TRUE, additional_styles = list("langchat_small")) audible_message(SPAN_MAROON("[icon2html(src, usr)] [mytape.storedinfo[i]]"))//We want to display this properly, don't double encode diff --git a/code/game/objects/items/devices/teleportation.dm b/code/game/objects/items/devices/teleportation.dm index 72a5c970b18f..c65286969786 100644 --- a/code/game/objects/items/devices/teleportation.dm +++ b/code/game/objects/items/devices/teleportation.dm @@ -144,7 +144,7 @@ to_chat(user, SPAN_NOTICE("\The [src] is malfunctioning.")) return var/list/L = list( ) - for(var/obj/structure/machinery/teleport/hub/R in machines) + for(var/obj/structure/machinery/teleport/hub/R in GLOB.machines) var/obj/structure/machinery/computer/teleporter/com = locate(/obj/structure/machinery/computer/teleporter, locate(R.x - 2, R.y, R.z)) if (istype(com, /obj/structure/machinery/computer/teleporter) && com.locked && !com.one_time_use) if(R.icon_state == "tele1") diff --git a/code/game/objects/items/explosives/grenades/flashbang.dm b/code/game/objects/items/explosives/grenades/flashbang.dm index 365dfe26df89..50cb34668ae3 100644 --- a/code/game/objects/items/explosives/grenades/flashbang.dm +++ b/code/game/objects/items/explosives/grenades/flashbang.dm @@ -256,6 +256,7 @@ //decide how banged mob is var/bang_effect = 0 + var/lying = H.body_position == LYING_DOWN //flashbang effect depends on eye protection only, so we will process this case first //A bit dumb, but headsets don't have ear protection and even earmuffs are a fluff now @@ -264,7 +265,7 @@ if((get_dist(H, T) <= 1 || src.loc == H.loc || src.loc == H)) H.apply_damage(5, BRUTE) H.apply_damage(5, BURN) - if(H.lying) + if(lying) bang_effect = 1 else bang_effect = 2 @@ -277,13 +278,13 @@ H.apply_damage(5, BRUTE) H.apply_damage(5, BURN) - if(H.lying) + if(lying) bang_effect = 4 else bang_effect = 5 else if(get_dist(H, T) <= 5) - if(H.lying) + if(lying) bang_effect = 3 else bang_effect = 4 diff --git a/code/game/objects/items/explosives/mine.dm b/code/game/objects/items/explosives/mine.dm index 57dd23bf4e96..45478f2828f4 100644 --- a/code/game/objects/items/explosives/mine.dm +++ b/code/game/objects/items/explosives/mine.dm @@ -123,7 +123,7 @@ if(prob(75)) triggered = TRUE if(tripwire) - var/direction = reverse_dir[src.dir] + var/direction = GLOB.reverse_dir[src.dir] var/step_direction = get_step(src, direction) tripwire.forceMove(step_direction) prime() @@ -241,7 +241,7 @@ //We move the tripwire randomly in either of the four cardinal directions triggered = TRUE if(tripwire) - var/direction = pick(cardinal) + var/direction = pick(GLOB.cardinals) var/step_direction = get_step(src, direction) tripwire.forceMove(step_direction) prime() diff --git a/code/game/objects/items/frames/alarms.dm b/code/game/objects/items/frames/alarms.dm index f34b18d6825c..d665df65fc83 100644 --- a/code/game/objects/items/frames/alarms.dm +++ b/code/game/objects/items/frames/alarms.dm @@ -24,7 +24,7 @@ Code shamelessly copied from apc_frame return var/ndir = get_dir(on_wall,usr) - if (!(ndir in cardinal)) + if (!(ndir in GLOB.cardinals)) return var/turf/loc = get_turf(usr) @@ -67,7 +67,7 @@ Code shamelessly copied from apc_frame return var/ndir = get_dir(on_wall,usr) - if (!(ndir in cardinal)) + if (!(ndir in GLOB.cardinals)) return var/turf/loc = get_turf(usr) diff --git a/code/game/objects/items/frames/camera.dm b/code/game/objects/items/frames/camera.dm index e367e64e641d..59bc2844868e 100644 --- a/code/game/objects/items/frames/camera.dm +++ b/code/game/objects/items/frames/camera.dm @@ -105,9 +105,9 @@ C.auto_turn() C.network = uniquelist(tempnetwork) - tempnetwork = difflist(C.network,RESTRICTED_CAMERA_NETWORKS) + tempnetwork = difflist(C.network,GLOB.RESTRICTED_CAMERA_NETWORKS) if(!tempnetwork.len)//Camera isn't on any open network - remove its chunk from AI visibility. - cameranet.removeCamera(C) + GLOB.cameranet.removeCamera(C) C.c_tag = input diff --git a/code/game/objects/items/frames/frame.dm b/code/game/objects/items/frames/frame.dm index 9c039821cb75..06b1c14e46c8 100644 --- a/code/game/objects/items/frames/frame.dm +++ b/code/game/objects/items/frames/frame.dm @@ -23,7 +23,7 @@ if (get_dist(on_wall,usr)>1) return var/ndir = get_dir(usr,on_wall) - if (!(ndir in cardinal)) + if (!(ndir in GLOB.cardinals)) return var/turf/loc = get_turf(usr) var/area/A = get_area(loc) diff --git a/code/game/objects/items/frames/light_fixtures.dm b/code/game/objects/items/frames/light_fixtures.dm index 35f800f28fac..b52e19492cab 100644 --- a/code/game/objects/items/frames/light_fixtures.dm +++ b/code/game/objects/items/frames/light_fixtures.dm @@ -21,7 +21,7 @@ if (get_dist(on_wall,usr)>1) return var/ndir = get_dir(usr,on_wall) - if (!(ndir in cardinal)) + if (!(ndir in GLOB.cardinals)) return var/turf/loc = get_turf(usr) if (!istype(loc, /turf/open/floor)) diff --git a/code/game/objects/items/fulton.dm b/code/game/objects/items/fulton.dm index 6a0e0f933144..788613cf4c6e 100644 --- a/code/game/objects/items/fulton.dm +++ b/code/game/objects/items/fulton.dm @@ -1,7 +1,7 @@ // Fulton baloon deployment devices, used to gather and send crates, dead things, and other objective-based items into space for collection. /// A list of fultons currently airborne. -var/global/list/deployed_fultons = list() +GLOBAL_LIST_EMPTY(deployed_fultons) /obj/item/stack/fulton name = "fulton recovery device" @@ -36,7 +36,7 @@ var/global/list/deployed_fultons = list() attached_atom = null if(original_location) original_location = null - deployed_fultons -= src + GLOB.deployed_fultons -= src . = ..() /obj/item/stack/fulton/update_icon() @@ -154,7 +154,7 @@ var/global/list/deployed_fultons = list() attached_atom.forceMove(space_tile) forceMove(attached_atom) - deployed_fultons += src + GLOB.deployed_fultons += src attached_atom.overlays -= I addtimer(CALLBACK(src, PROC_REF(return_fulton), original_location), 150 SECONDS) @@ -169,11 +169,11 @@ var/global/list/deployed_fultons = list() attached_atom.anchored = FALSE playsound(attached_atom.loc,'sound/effects/bamf.ogg', 50, 1) - if(intel_system) + if(GLOB.intel_system) if (!LAZYISIN(GLOB.failed_fultons, attached_atom)) //Giving marines an objective to retrieve that fulton (so they'd know what they lost and where) var/datum/cm_objective/retrieve_item/fulton/objective = new /datum/cm_objective/retrieve_item/fulton(attached_atom) - intel_system.store_single_objective(objective) + GLOB.intel_system.store_single_objective(objective) qdel(reservation) qdel(src) diff --git a/code/game/objects/items/hoverpack.dm b/code/game/objects/items/hoverpack.dm index c2bfacd3c3ad..027b9d77f581 100644 --- a/code/game/objects/items/hoverpack.dm +++ b/code/game/objects/items/hoverpack.dm @@ -184,7 +184,7 @@ warning.forceMove(path[max_distance]) /obj/item/hoverpack/proc/can_use_hoverpack(mob/living/carbon/human/user) - if(user.is_mob_incapacitated() || user.lying) + if(user.is_mob_incapacitated()) to_chat(user, SPAN_WARNING("You're a bit too incapacitated for that.")) return FALSE @@ -204,7 +204,7 @@ /datum/action/item_action/hover/can_use_action() var/mob/living/carbon/human/H = owner - if(!H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(!H.is_mob_incapacitated() && holder_item == H.back) return TRUE /datum/action/item_action/hover/action_activate() diff --git a/code/game/objects/items/implants/implantneurostim.dm b/code/game/objects/items/implants/implantneurostim.dm index 544cf70147e2..21ee2542649b 100644 --- a/code/game/objects/items/implants/implantneurostim.dm +++ b/code/game/objects/items/implants/implantneurostim.dm @@ -63,7 +63,7 @@ var/mob_pain_msg = "Excruciating pain shoots through [part ? "your [part.display_name]" : "you"]!" M.visible_message(SPAN_DANGER("[M] convulses in pain!"), SPAN_DANGER(mob_pain_msg)) M.flash_eyes(1, TRUE) - M.stunned += 10 + M.apply_effect(10, STUN) M.apply_effect(10, WEAKEN) M.apply_damage(100, HALLOSS, part) M.apply_damage(5, BURN, part, 0, 0, src) diff --git a/code/game/objects/items/paint.dm b/code/game/objects/items/paint.dm index 9089dd228ed0..c538cbf3944f 100644 --- a/code/game/objects/items/paint.dm +++ b/code/game/objects/items/paint.dm @@ -1,6 +1,6 @@ //NEVER USE THIS IT SUX -PETETHEGOAT -var/global/list/cached_icons = list() +GLOBAL_LIST_EMPTY(cached_icons) /obj/item/reagent_container/glass/paint desc = "It's a paint bucket." diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index 35558bf01925..7860236d5d51 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -502,8 +502,8 @@ icon_state = "trimmed_wire" /obj/item/prop/helmetgarb/bullet_pipe - name = "10x99mm XM42B casing pipe" - desc = "The XM42B was an experimental weapons platform briefly fielded by the USCM and Wey-Yu PMC teams. It was manufactured by ARMAT systems at the Atlas weapons facility. Unfortunately the project had its funding pulled alongside the M5 integrated gasmask program. This spent casing has been converted into a pipe, but there is too much tar in the mouthpiece for it to be useable." + name = "10x99mm XM43E1 casing pipe" + desc = "The XM43E1 was an experimental weapons platform briefly fielded by the USCM and Wey-Yu PMC teams. It was manufactured by ARMAT systems at the Atlas weapons facility. Unfortunately the project had its funding pulled alongside the M5 integrated gasmask program. This spent casing has been converted into a pipe, but there is too much tar in the mouthpiece for it to be useable." icon_state = "bullet_pipe" /obj/item/prop/helmetgarb/chaplain_patch diff --git a/code/game/objects/items/reagent_containers/blood_pack.dm b/code/game/objects/items/reagent_containers/blood_pack.dm index 0879dcffdc68..92c68e81c9d2 100644 --- a/code/game/objects/items/reagent_containers/blood_pack.dm +++ b/code/game/objects/items/reagent_containers/blood_pack.dm @@ -163,7 +163,7 @@ if(!istype(usr, /mob/living)) return - if(usr.stat || usr.lying) + if(usr.stat || usr.is_mob_incapacitated()) return mode = !mode diff --git a/code/game/objects/items/reagent_containers/borghydro.dm b/code/game/objects/items/reagent_containers/borghydro.dm index 30a9bdbd3c65..4f1f5540988b 100644 --- a/code/game/objects/items/reagent_containers/borghydro.dm +++ b/code/game/objects/items/reagent_containers/borghydro.dm @@ -22,7 +22,7 @@ for(var/T in reagent_ids) reagent_volumes[T] = volume - var/datum/reagent/R = chemical_reagents_list[T] + var/datum/reagent/R = GLOB.chemical_reagents_list[T] reagent_names += R.name START_PROCESSING(SSobj, src) @@ -71,7 +71,7 @@ ..() var/selection = tgui_input_list(usr, "Please select a reagent:", "Reagent", reagent_ids) if(!selection) return - var/datum/reagent/R = chemical_reagents_list[selection] + var/datum/reagent/R = GLOB.chemical_reagents_list[selection] to_chat(user, SPAN_NOTICE(" Synthesizer is now producing '[R.name]'.")) mode = reagent_ids.Find(selection) playsound(src.loc, 'sound/effects/pop.ogg', 15, 0) @@ -81,6 +81,6 @@ . = ..() if (user != loc) return - var/datum/reagent/R = chemical_reagents_list[reagent_ids[mode]] + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_ids[mode]] . += SPAN_NOTICE("It is currently producing [R.name] and has [reagent_volumes[reagent_ids[mode]]] out of [volume] units left.") diff --git a/code/game/objects/items/reagent_containers/dropper.dm b/code/game/objects/items/reagent_containers/dropper.dm index eaf28f66b012..f36145e285cd 100644 --- a/code/game/objects/items/reagent_containers/dropper.dm +++ b/code/game/objects/items/reagent_containers/dropper.dm @@ -32,7 +32,7 @@ if(ismob(target)) var/time = 20 //2/3rds the time of a syringe - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(SPAN_DANGER("[user] is trying to squirt something into [target]'s eyes!"), SHOW_MESSAGE_VISIBLE) if(!do_after(user, time, INTERRUPT_ALL, BUSY_ICON_FRIENDLY, target, INTERRUPT_MOVED, BUSY_ICON_MEDICAL)) return @@ -56,7 +56,7 @@ safe_thing.create_reagents(100) trans = src.reagents.trans_to(safe_thing, amount_per_transfer_from_this) - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(SPAN_DANGER("[user] tries to squirt something into [target]'s eyes, but fails!"), SHOW_MESSAGE_VISIBLE) spawn(5) src.reagents.reaction(safe_thing, TOUCH) @@ -67,7 +67,7 @@ icon_state = "dropper[filled]" return - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(SPAN_DANGER("[user] squirts something into [target]'s eyes!"), SHOW_MESSAGE_VISIBLE) src.reagents.reaction(target, TOUCH) diff --git a/code/game/objects/items/reagent_containers/food/snacks/grown.dm b/code/game/objects/items/reagent_containers/food/snacks/grown.dm index 12a5a704f663..32423c121b61 100644 --- a/code/game/objects/items/reagent_containers/food/snacks/grown.dm +++ b/code/game/objects/items/reagent_containers/food/snacks/grown.dm @@ -30,7 +30,7 @@ /obj/item/reagent_container/food/snacks/grown/proc/update_from_seed()// Fill the object up with the appropriate reagents. if(!isnull(plantname)) - var/datum/seed/S = seed_types[plantname] + var/datum/seed/S = GLOB.seed_types[plantname] if(!S) return name = S.seed_name //Copies the name from the seed, important for renamed plants diff --git a/code/game/objects/items/reagent_containers/glass.dm b/code/game/objects/items/reagent_containers/glass.dm index df344506c72c..e2a9ba537b0d 100644 --- a/code/game/objects/items/reagent_containers/glass.dm +++ b/code/game/objects/items/reagent_containers/glass.dm @@ -389,17 +389,17 @@ . = ..() var/random_chem if(tier) - random_chem = pick(chemical_gen_classes_list[tier]) + random_chem = pick(GLOB.chemical_gen_classes_list[tier]) else - random_chem = pick( prob(3);pick(chemical_gen_classes_list["C1"]),\ - prob(5);pick(chemical_gen_classes_list["C2"]),\ - prob(7);pick(chemical_gen_classes_list["C3"]),\ - prob(10);pick(chemical_gen_classes_list["C4"]),\ - prob(15);pick(chemical_gen_classes_list["C5"]),\ - prob(25);pick(chemical_gen_classes_list["T1"]),\ - prob(15);pick(chemical_gen_classes_list["T2"]),\ - prob(10);pick(chemical_gen_classes_list["T3"]),\ - prob(5);pick(chemical_gen_classes_list["T4"]),\ + random_chem = pick( prob(3);pick(GLOB.chemical_gen_classes_list["C1"]),\ + prob(5);pick(GLOB.chemical_gen_classes_list["C2"]),\ + prob(7);pick(GLOB.chemical_gen_classes_list["C3"]),\ + prob(10);pick(GLOB.chemical_gen_classes_list["C4"]),\ + prob(15);pick(GLOB.chemical_gen_classes_list["C5"]),\ + prob(25);pick(GLOB.chemical_gen_classes_list["T1"]),\ + prob(15);pick(GLOB.chemical_gen_classes_list["T2"]),\ + prob(10);pick(GLOB.chemical_gen_classes_list["T3"]),\ + prob(5);pick(GLOB.chemical_gen_classes_list["T4"]),\ prob(15);"") if(random_chem) reagents.add_reagent(random_chem, 30) diff --git a/code/game/objects/items/reagent_containers/robodropper.dm b/code/game/objects/items/reagent_containers/robodropper.dm index 7447681f0566..694194fbef70 100644 --- a/code/game/objects/items/reagent_containers/robodropper.dm +++ b/code/game/objects/items/reagent_containers/robodropper.dm @@ -45,7 +45,7 @@ safe_thing.create_reagents(100) trans = src.reagents.trans_to(safe_thing, amount_per_transfer_from_this) - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(SPAN_DANGER("[user] tries to squirt something into [target]'s eyes, but fails!"), SHOW_MESSAGE_VISIBLE) spawn(5) src.reagents.reaction(safe_thing, TOUCH) @@ -58,7 +58,7 @@ return - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(SPAN_DANGER("[user] squirts something into [target]'s eyes!"), SHOW_MESSAGE_VISIBLE) src.reagents.reaction(target, TOUCH) diff --git a/code/game/objects/items/reagent_containers/syringes.dm b/code/game/objects/items/reagent_containers/syringes.dm index 06cbb559360c..2bb121740cef 100644 --- a/code/game/objects/items/reagent_containers/syringes.dm +++ b/code/game/objects/items/reagent_containers/syringes.dm @@ -258,20 +258,20 @@ return if (target != user && target.getarmor(target_zone, ARMOR_MELEE) > 5 && prob(50)) - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(text(SPAN_DANGER("[user] tries to stab [target] in \the [hit_area] with [src.name], but the attack is deflected by armor!")), SHOW_MESSAGE_VISIBLE) user.temp_drop_inv_item(src) qdel(src) return - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(text(SPAN_DANGER("[user] stabs [target] in \the [hit_area] with [src.name]!")), SHOW_MESSAGE_VISIBLE) if(affecting.take_damage(3)) target:UpdateDamageIcon() else - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(text(SPAN_DANGER("[user] stabs [target] with [src.name]!")), SHOW_MESSAGE_VISIBLE) target.take_limb_damage(3)// 7 is the same as crowbar punch diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index c5fa39fd100c..34debd7c60cf 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -68,7 +68,7 @@ for(var/mob/dead/observer/ghost in GLOB.observer_list) if(ghost.mind && ghost.mind.original == R) R.key = ghost.key - if(R.client) R.client.change_view(world_view_size) + if(R.client) R.client.change_view(GLOB.world_view_size) break R.set_stat(CONSCIOUS) diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 6d0736f8aeb2..7c12da0707c7 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -106,7 +106,7 @@ if(AC) to_chat(usr, SPAN_WARNING("\The [src] cannot be built here!")) return TRUE - var/list/directions = new/list(cardinal) + var/list/directions = GLOB.cardinals.Copy() var/i = 0 for (var/obj/structure/window/win in user.loc) i++ @@ -114,7 +114,7 @@ to_chat(user, SPAN_DANGER("There are too many windows in this location.")) return TRUE directions-=win.dir - if(!(win.dir in cardinal)) + if(!(win.dir in GLOB.cardinals)) to_chat(user, SPAN_DANGER("Can't let you do that.")) return TRUE diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 07345dcdc09f..2f4dd0f532ca 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -10,7 +10,7 @@ /* * Metal */ -var/global/list/datum/stack_recipe/metal_recipes = list ( \ +GLOBAL_LIST_INIT_TYPED(metal_recipes, /datum/stack_recipe, list ( \ new/datum/stack_recipe("barbed wire", /obj/item/stack/barbed_wire, 1, 1, 20, time = 1 SECONDS, skill_req = SKILL_CONSTRUCTION, skill_lvl = SKILL_CONSTRUCTION_TRAINED), \ new/datum/stack_recipe("metal barricade", /obj/structure/barricade/metal, 4, time = 2 SECONDS, one_per_turf = ONE_TYPE_PER_BORDER, on_floor = 1, skill_req = SKILL_CONSTRUCTION, skill_lvl = SKILL_CONSTRUCTION_TRAINED, min_time = 1 SECONDS), \ new/datum/stack_recipe("folding metal barricade", /obj/structure/barricade/plasteel/metal, 6, time = 3 SECONDS, one_per_turf = ONE_TYPE_PER_BORDER, on_floor = 1, skill_req = SKILL_CONSTRUCTION, skill_lvl = SKILL_CONSTRUCTION_ENGI, min_time = 1.5 SECONDS), \ @@ -54,7 +54,7 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ null, \ new/datum/stack_recipe("metal baseball bat", /obj/item/weapon/baseballbat/metal, 10, time = 20, on_floor = 1), \ null, \ -) +)) /obj/item/stack/sheet/metal name = "metal sheets" @@ -88,20 +88,20 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ /obj/item/stack/sheet/metal/cyborg /obj/item/stack/sheet/metal/Initialize(mapload, amount) - recipes = metal_recipes + recipes = GLOB.metal_recipes return ..() /* * Plasteel */ -var/global/list/datum/stack_recipe/plasteel_recipes = list ( \ +GLOBAL_LIST_INIT_TYPED(plasteel_recipes, /datum/stack_recipe, list ( \ new/datum/stack_recipe("plasteel barricade", /obj/structure/barricade/plasteel, 8, time = 4 SECONDS, one_per_turf = ONE_TYPE_PER_TURF, on_floor = 1, skill_req = SKILL_CONSTRUCTION, skill_lvl = SKILL_CONSTRUCTION_ENGI, min_time = 2 SECONDS), null, \ new/datum/stack_recipe("reinforced window frame", /obj/structure/window_frame/colony/reinforced, 5, time = 40, one_per_turf = ONE_TYPE_PER_TURF, on_floor = 1, skill_req = SKILL_CONSTRUCTION, skill_lvl = SKILL_CONSTRUCTION_ENGI), null, \ new/datum/stack_recipe("plasteel rod", /obj/item/stack/rods/plasteel, 1, 1, 30), new/datum/stack_recipe("metal crate", /obj/structure/closet/crate, 5, time = 50, one_per_turf = ONE_TYPE_PER_TURF), \ - ) + )) /obj/item/stack/sheet/plasteel name = "plasteel sheet" @@ -119,7 +119,7 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list ( \ ground_offset_y = 5 /obj/item/stack/sheet/plasteel/New(loc, amount=null) - recipes = plasteel_recipes + recipes = GLOB.plasteel_recipes return ..() @@ -141,7 +141,7 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list ( \ /* * Wood */ -var/global/list/datum/stack_recipe/wood_recipes = list ( \ +GLOBAL_LIST_INIT_TYPED(wood_recipes, /datum/stack_recipe, list ( \ new/datum/stack_recipe("pair of wooden sandals", /obj/item/clothing/shoes/sandal, 1), \ new/datum/stack_recipe("wood floor tile", /obj/item/stack/tile/wood, 1, 4, 20), \ /* @@ -156,7 +156,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \ new/datum/stack_recipe("baseball bat", /obj/item/weapon/baseballbat, 10, time = 20, on_floor = 1), \ new/datum/stack_recipe("wooden cross", /obj/structure/prop/wooden_cross, 2, time = 10, one_per_turf = ONE_TYPE_PER_TURF, on_floor = 1), \ new/datum/stack_recipe("wooden pole", /obj/item/weapon/pole, 3, time = 10, one_per_turf = ONE_TYPE_PER_TURF, on_floor = 1) \ - ) + )) /obj/item/stack/sheet/wood name = "wooden plank" @@ -184,7 +184,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \ icon_state = "sheet-wood" /obj/item/stack/sheet/wood/New(loc, amount=null) - recipes = wood_recipes + recipes = GLOB.wood_recipes return ..() /* @@ -201,7 +201,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \ /* * Cardboard */ -var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ +GLOBAL_LIST_INIT_TYPED(cardboard_recipes, /datum/stack_recipe, list ( \ new/datum/stack_recipe("box", /obj/item/storage/box), \ new/datum/stack_recipe("donut box", /obj/item/storage/donut_box/empty), \ new/datum/stack_recipe("egg box", /obj/item/storage/fancy/egg_box), \ @@ -295,7 +295,7 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ )) \ -) +)) /obj/item/stack/sheet/cardboard //BubbleWrap name = "cardboard" @@ -306,7 +306,7 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ stack_id = "cardboard" /obj/item/stack/sheet/cardboard/New(loc, amount=null) - recipes = cardboard_recipes + recipes = GLOB.cardboard_recipes return ..() /obj/item/stack/sheet/cardboard/small_stack @@ -321,9 +321,9 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ /* * Aluminum */ -var/global/list/datum/stack_recipe/aluminum_recipes = list ( \ +GLOBAL_LIST_INIT_TYPED(aluminium_recipes, /datum/stack_recipe, list ( \ new/datum/stack_recipe("flask", /obj/item/reagent_container/food/drinks/flask, 1) - ) + )) /obj/item/stack/sheet/aluminum name = "aluminum" @@ -336,9 +336,9 @@ var/global/list/datum/stack_recipe/aluminum_recipes = list ( \ /* * Copper */ -var/global/list/datum/stack_recipe/copper_recipes = list ( \ +GLOBAL_LIST_INIT_TYPED(copper_recipes, /datum/stack_recipe, list ( \ new/datum/stack_recipe("cable coil", /obj/item/stack/cable_coil, 2, 1, 20, time = 10, skill_req = SKILL_CONSTRUCTION, skill_lvl = SKILL_CONSTRUCTION_TRAINED) - ) + )) /obj/item/stack/sheet/copper name = "copper" diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 966b18fc494b..5b77b9149a53 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -767,9 +767,9 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r H.FF_hit_evade = 1000 H.allow_gun_usage = allow_gun_usage - var/datum/mob_hud/security/advanced/SA = huds[MOB_HUD_SECURITY_ADVANCED] + var/datum/mob_hud/security/advanced/SA = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] SA.remove_from_hud(H) - var/datum/mob_hud/xeno_infection/XI = huds[MOB_HUD_XENO_INFECTION] + var/datum/mob_hud/xeno_infection/XI = GLOB.huds[MOB_HUD_XENO_INFECTION] XI.remove_from_hud(H) anim(H.loc, H, 'icons/mob/mob.dmi', null, "cloak", null, H.dir) @@ -806,9 +806,9 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r H.alpha = initial(H.alpha) H.FF_hit_evade = initial(H.FF_hit_evade) - var/datum/mob_hud/security/advanced/SA = huds[MOB_HUD_SECURITY_ADVANCED] + var/datum/mob_hud/security/advanced/SA = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] SA.add_to_hud(H) - var/datum/mob_hud/xeno_infection/XI = huds[MOB_HUD_XENO_INFECTION] + var/datum/mob_hud/xeno_infection/XI = GLOB.huds[MOB_HUD_XENO_INFECTION] XI.add_to_hud(H) if(anim) @@ -842,7 +842,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r /datum/action/item_action/specialist/toggle_cloak/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(istype(H) && !H.is_mob_incapacitated() && holder_item == H.back) return TRUE /datum/action/item_action/specialist/toggle_cloak/action_activate() diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 71edc21e29f9..40953eb97395 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -648,7 +648,7 @@ /obj/item/storage/belt/shotgun/full/random/fill_preset_inventory() for(var/i = 1 to storage_slots) - var/random_shell_type = pick(shotgun_handfuls_12g) + var/random_shell_type = pick(GLOB.shotgun_handfuls_12g) new random_shell_type(src) /obj/item/storage/belt/shotgun/attackby(obj/item/W, mob/user) diff --git a/code/game/objects/items/storage/internal.dm b/code/game/objects/items/storage/internal.dm index 68bdda8d7e7b..a491df12f086 100644 --- a/code/game/objects/items/storage/internal.dm +++ b/code/game/objects/items/storage/internal.dm @@ -25,10 +25,10 @@ //Items that use internal storage have the option of calling this to emulate default storage MouseDrop behaviour. //Returns 1 if the master item's parent's MouseDrop() should be called, 0 otherwise. It's strange, but no other way of //Doing it without the ability to call another proc's parent, really. -/obj/item/storage/internal/proc/handle_mousedrop(mob/user as mob, obj/over_object as obj) +/obj/item/storage/internal/proc/handle_mousedrop(mob/living/carbon/human/user, obj/over_object as obj) if(ishuman(user)) - if(user.lying) //Can't use your inventory when lying + if(user.body_position == LYING_DOWN) //Can't use your inventory when lying //what about stuns? don't argue return if(QDELETED(master_object)) @@ -84,8 +84,8 @@ //Items that use internal storage have the option of calling this to emulate default storage attack_hand behaviour. //Returns 1 if the master item's parent's attack_hand() should be called, 0 otherwise. //It's strange, but no other way of doing it without the ability to call another proc's parent, really. -/obj/item/storage/internal/proc/handle_attack_hand(mob/user as mob, mods) - if(user.lying) +/obj/item/storage/internal/proc/handle_attack_hand(mob/living/user as mob, mods) + if(user.body_position == LYING_DOWN) // what about stuns? huh? return FALSE if(ishuman(user)) diff --git a/code/game/objects/items/storage/large_holster.dm b/code/game/objects/items/storage/large_holster.dm index 27026165fc31..76f98c423974 100644 --- a/code/game/objects/items/storage/large_holster.dm +++ b/code/game/objects/items/storage/large_holster.dm @@ -367,7 +367,7 @@ /datum/action/item_action/specialist/toggle_fuel/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(istype(H) && !H.is_mob_incapacitated() && H.body_position == STANDING_UP && holder_item == H.back) return TRUE /datum/action/item_action/specialist/toggle_fuel/action_activate() diff --git a/code/game/objects/items/storage/smartpack.dm b/code/game/objects/items/storage/smartpack.dm index 0b0fd05eac17..d012e773617b 100644 --- a/code/game/objects/items/storage/smartpack.dm +++ b/code/game/objects/items/storage/smartpack.dm @@ -223,7 +223,7 @@ user.remove_filter("synth_protective_form") -/obj/item/storage/backpack/marine/smartpack/proc/immobile_form(mob/user) +/obj/item/storage/backpack/marine/smartpack/proc/immobile_form(mob/living/user) if(activated_form) return diff --git a/code/game/objects/items/tools/experimental_tools.dm b/code/game/objects/items/tools/experimental_tools.dm index d27272881e1e..221aa279a53b 100644 --- a/code/game/objects/items/tools/experimental_tools.dm +++ b/code/game/objects/items/tools/experimental_tools.dm @@ -279,7 +279,7 @@ return if(ishuman(user)) - if(user.stat || user.blinded || user.lying) + if(user.stat || user.blinded || user.body_position == LYING_DOWN) return if(attaching) diff --git a/code/game/objects/items/toys/crayons.dm b/code/game/objects/items/toys/crayons.dm index 5bd4d05f317f..c02b59289fa1 100644 --- a/code/game/objects/items/toys/crayons.dm +++ b/code/game/objects/items/toys/crayons.dm @@ -73,7 +73,7 @@ var/drawtype = tgui_input_list(usr, "Choose what you'd like to draw.", "Crayon scribbles", list("graffiti","rune","letter")) switch(drawtype) if("letter") - drawtype = tgui_input_list(usr, "Choose the letter.", "Crayon scribbles", alphabet_lowercase) + drawtype = tgui_input_list(usr, "Choose the letter.", "Crayon scribbles", GLOB.alphabet_lowercase) to_chat(user, "You start drawing a letter on the [target.name].") if("graffiti") to_chat(user, "You start drawing graffiti on the [target.name].") diff --git a/code/game/objects/items/toys/toy_weapons.dm b/code/game/objects/items/toys/toy_weapons.dm index 9acf6f2943c3..ce32cfdb67a9 100644 --- a/code/game/objects/items/toys/toy_weapons.dm +++ b/code/game/objects/items/toys/toy_weapons.dm @@ -130,7 +130,7 @@ for(var/mob/living/M in D.loc) if(!istype(M,/mob/living)) continue if(M == user) continue - for(var/mob/O in viewers(world_view_size, D)) + for(var/mob/O in viewers(GLOB.world_view_size, D)) O.show_message(SPAN_DANGER("[M] was hit by the foam dart!"), SHOW_MESSAGE_VISIBLE) new /obj/item/toy/crossbow_ammo(M.loc) qdel(D) @@ -152,14 +152,14 @@ return else if (bullets == 0) user.apply_effect(5, WEAKEN) - for(var/mob/O in viewers(world_view_size, user)) + for(var/mob/O in viewers(GLOB.world_view_size, user)) O.show_message(SPAN_DANGER("[user] realized they were out of ammo and starting scrounging for some!"), SHOW_MESSAGE_VISIBLE) -/obj/item/toy/crossbow/attack(mob/M as mob, mob/user as mob) +/obj/item/toy/crossbow/attack(mob/living/M as mob, mob/user as mob) src.add_fingerprint(user) - if (src.bullets > 0 && M.lying) + if (src.bullets > 0 && M.body_position == LYING_DOWN) for(var/mob/O in viewers(M, null)) if(O.client) @@ -169,7 +169,7 @@ playsound(user.loc, 'sound/items/syringeproj.ogg', 15, 1) new /obj/item/toy/crossbow_ammo(M.loc) src.bullets-- - else if (M.lying && src.bullets == 0) + else if (M.body_position == LYING_DOWN && src.bullets == 0) for(var/mob/O in viewers(M, null)) if (O.client) O.show_message(SPAN_DANGER("[user] casually lines up a shot with [M]'s head, pulls the trigger, then realizes they are out of ammo and drops to the floor in search of some!"), SHOW_MESSAGE_VISIBLE, SPAN_DANGER("You hear someone fall"), SHOW_MESSAGE_AUDIBLE) diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index efa898ba9937..0baa83f8e791 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -260,7 +260,7 @@ M.apply_effect(kill_delay/15, STUN) - for (var/mob/O in hearers(world_view_size, M)) + for (var/mob/O in hearers(GLOB.world_view_size, M)) O << sound('sound/effects/Heart Beat.ogg', repeat = 1, wait = 0, volume = 100, channel = 2) //play on same channel as ambience spawn(kill_delay) O << sound(, , , , channel = 2) //cut sound diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 3fa16af05875..9d730c71970b 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -14,7 +14,8 @@ /// If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING! var/in_use = FALSE var/mob/living/buckled_mob - var/buckle_lying = FALSE //Is the mob buckled in a lying position + /// Bed-like behaviour, forces mob.lying = buckle_lying if not set to [NO_BUCKLE_LYING]. + var/buckle_lying = NO_BUCKLE_LYING var/can_buckle = FALSE /**Applied to surgery times for mobs buckled prone to it or lying on the same tile, if the surgery cares about surface conditions. The lowest multiplier of objects on the tile is used.**/ @@ -224,7 +225,7 @@ else . = ..() /obj/proc/afterbuckle(mob/M as mob) // Called after somebody buckled / unbuckled - handle_rotation() + handle_rotation() // To be removed when we have full dir support in set_buckled SEND_SIGNAL(src, COSMIG_OBJ_AFTER_BUCKLE, buckled_mob) if(!buckled_mob) UnregisterSignal(M, COMSIG_PARENT_QDELETING) @@ -235,9 +236,8 @@ /obj/proc/unbuckle() SIGNAL_HANDLER if(buckled_mob && buckled_mob.buckled == src) - buckled_mob.buckled = null + buckled_mob.set_buckled(null) buckled_mob.anchored = initial(buckled_mob.anchored) - buckled_mob.update_canmove() var/M = buckled_mob REMOVE_TRAITS_IN(buckled_mob, TRAIT_SOURCE_BUCKLE) @@ -268,7 +268,7 @@ //trying to buckle a mob /obj/proc/buckle_mob(mob/M, mob/user) - if (!ismob(M) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.lying || user.stat || buckled_mob || M.buckled || !isturf(user.loc)) + if (!ismob(M) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.stat || buckled_mob || M.buckled || !isturf(user.loc)) return if (isxeno(user)) @@ -299,20 +299,15 @@ // the actual buckling proc // Yes I know this is not style but its unreadable otherwise -/obj/proc/do_buckle(mob/target, mob/user) +/obj/proc/do_buckle(mob/living/target, mob/user) send_buckling_message(target, user) if (src && src.loc) - target.buckled = src + target.set_buckled(src) target.forceMove(src.loc) target.setDir(dir) - target.update_canmove() src.buckled_mob = target src.add_fingerprint(user) afterbuckle(target) - if(buckle_lying) // Make sure buckling to beds/nests etc only turns, and doesn't give a random offset - var/matrix/new_matrix = matrix() - new_matrix.Turn(90) - target.apply_transform(new_matrix) return TRUE /obj/proc/send_buckling_message(mob/M, mob/user) @@ -392,7 +387,7 @@ else if(LAZYISIN(item_icons, slot)) mob_icon = item_icons[slot] else - mob_icon = default_onmob_icons[slot] + mob_icon = GLOB.default_onmob_icons[slot] var/image/overlay_img diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 9b0b8cf30aae..95998d5de79a 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -150,7 +150,8 @@ for(var/mob/living/M in get_turf(src)) - if(M.lying) return //No spamming this on people. + if(HAS_TRAIT(M, TRAIT_FLOORED)) + return //No spamming this on people. M.apply_effect(5, WEAKEN) to_chat(M, SPAN_WARNING("You topple as \the [src] moves under you!")) @@ -191,7 +192,7 @@ H.updatehealth() return -/obj/structure/proc/can_touch(mob/user) +/obj/structure/proc/can_touch(mob/living/user) if(!user) return 0 if(!Adjacent(user) || !isturf(user.loc)) @@ -199,7 +200,7 @@ if(user.is_mob_restrained() || user.buckled) to_chat(user, SPAN_NOTICE("You need your hands and legs free for this.")) return 0 - if(user.is_mob_incapacitated(TRUE) || user.lying) + if(user.is_mob_incapacitated(TRUE) || user.body_position == LYING_DOWN) return 0 if(isRemoteControlling(user)) to_chat(user, SPAN_NOTICE("You need hands for this.")) diff --git a/code/game/objects/structures/barricade/deployable.dm b/code/game/objects/structures/barricade/deployable.dm index 77aa6b7e6816..0d5275f98a3d 100644 --- a/code/game/objects/structures/barricade/deployable.dm +++ b/code/game/objects/structures/barricade/deployable.dm @@ -63,7 +63,7 @@ if(!ishuman(usr)) return - if(usr.lying) + if(usr.is_mob_incapacitated()) return if(over_object == usr && Adjacent(usr)) diff --git a/code/game/objects/structures/barricade/plasteel.dm b/code/game/objects/structures/barricade/plasteel.dm index d1a42c9b61ab..85057f9a0596 100644 --- a/code/game/objects/structures/barricade/plasteel.dm +++ b/code/game/objects/structures/barricade/plasteel.dm @@ -30,7 +30,7 @@ /obj/structure/barricade/plasteel/update_icon() ..() if(linked) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) for(var/obj/structure/barricade/plasteel/cade in get_step(src, direction)) if(((dir & (NORTH|SOUTH) && get_dir(src, cade) & (EAST|WEST)) || (dir & (EAST|WEST) && get_dir(src, cade) & (NORTH|SOUTH))) && dir == cade.dir && cade.linked && cade.closed == src.closed && hasconnectionoverlay) if(closed) @@ -128,7 +128,7 @@ to_chat(user, SPAN_WARNING("The [src] has no linking points...")) return linked = !linked - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) for(var/obj/structure/barricade/plasteel/cade in get_step(src, direction)) cade.update_icon() update_icon() @@ -239,7 +239,7 @@ closed = 0 density = TRUE if(linked) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) for(var/obj/structure/barricade/plasteel/cade in get_step(src, direction)) if(((dir & (NORTH|SOUTH) && get_dir(src, cade) & (EAST|WEST)) || (dir & (EAST|WEST) && get_dir(src, cade) & (NORTH|SOUTH))) && dir == cade.dir && cade != origin && cade.linked) cade.open(src) @@ -252,7 +252,7 @@ closed = 1 density = FALSE if(linked) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) for(var/obj/structure/barricade/plasteel/cade in get_step(src, direction)) if(((dir & (NORTH|SOUTH) && get_dir(src, cade) & (EAST|WEST)) || (dir & (EAST|WEST) && get_dir(src, cade) & (NORTH|SOUTH))) && dir == cade.dir && cade != origin && cade.linked) cade.close(src) diff --git a/code/game/objects/structures/bookcase.dm b/code/game/objects/structures/bookcase.dm index becb0906e3c6..ce338de47b35 100644 --- a/code/game/objects/structures/bookcase.dm +++ b/code/game/objects/structures/bookcase.dm @@ -33,7 +33,7 @@ if(contents.len) var/obj/item/book/choice = input("Which book would you like to remove from the shelf?") as null|obj in contents if(choice) - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) return if(ishuman(user)) if(!user.get_active_hand()) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index a7394f3a7586..d6148b23b7f0 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -79,10 +79,11 @@ M.forceMove(loc) if(exit_stun) M.apply_effect(exit_stun, STUN) //Action delay when going out of a closet - M.update_canmove() //Force the delay to go in action immediately - if(!M.lying) - M.visible_message(SPAN_WARNING("[M] suddenly gets out of [src]!"), - SPAN_WARNING("You get out of [src] and get your bearings!")) + if(isliving(M)) + var/mob/living/living_M = M + if(living_M.mobility_flags & MOBILITY_MOVE) + M.visible_message(SPAN_WARNING("[M] suddenly gets out of [src]!"), + SPAN_WARNING("You get out of [src] and get your bearings!")) /obj/structure/closet/proc/open() if(opened) @@ -333,7 +334,7 @@ set category = "Object" set name = "Toggle Open" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return if(usr.loc == src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index d6b4a35b04f7..3206da86b197 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -78,7 +78,7 @@ set src in oview(1) // One square distance set category = "Object" set name = "Reset Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) src.add_fingerprint(usr) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 331cb884bd59..ba974a8e722a 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -121,7 +121,7 @@ set category = "Object" set name = "Toggle Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) diff --git a/code/game/objects/structures/crates_lockers/secure_crates.dm b/code/game/objects/structures/crates_lockers/secure_crates.dm index 28a77e0c81c0..6b025a57c78b 100644 --- a/code/game/objects/structures/crates_lockers/secure_crates.dm +++ b/code/game/objects/structures/crates_lockers/secure_crates.dm @@ -53,7 +53,7 @@ set category = "Object" set name = "Toggle Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 7b54f0447fae..e4ee4a1b662b 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -5,13 +5,15 @@ icon_state = "extinguisher" anchored = TRUE density = FALSE - var/obj/item/tool/extinguisher/has_extinguisher = new/obj/item/tool/extinguisher + var/obj/item/tool/extinguisher/has_extinguisher var/opened = 0 var/base_icon /obj/structure/extinguisher_cabinet/Initialize() . = ..() base_icon = initial(icon_state) + has_extinguisher = new /obj/item/tool/extinguisher() + has_extinguisher.forceMove(src) /obj/structure/extinguisher_cabinet/lifeboat name = "extinguisher cabinet" @@ -21,15 +23,15 @@ /obj/structure/extinguisher_cabinet/alt icon_state = "extinguisher_alt" -/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user) +/obj/structure/extinguisher_cabinet/attackby(obj/item/item, mob/user) if(isrobot(user)) return - if(istype(O, /obj/item/tool/extinguisher)) + if(istype(item, /obj/item/tool/extinguisher)) if(!has_extinguisher && opened) user.drop_held_item() - contents += O - has_extinguisher = O - to_chat(user, SPAN_NOTICE("You place [O] in [src].")) + item.forceMove(src) + has_extinguisher = item + to_chat(user, SPAN_NOTICE("You place [item] in [src].")) else opened = !opened else @@ -45,7 +47,7 @@ user.put_in_hands(has_extinguisher) to_chat(user, SPAN_NOTICE("You take [has_extinguisher] from [src].")) has_extinguisher = null - opened = 1 + opened = TRUE else opened = !opened update_icon() diff --git a/code/game/objects/structures/fence.dm b/code/game/objects/structures/fence.dm index b29c69e8af18..db24dfdfebdd 100644 --- a/code/game/objects/structures/fence.dm +++ b/code/game/objects/structures/fence.dm @@ -209,7 +209,7 @@ //This proc is used to update the icons of nearby windows. /obj/structure/fence/proc/update_nearby_icons() update_icon() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) for(var/obj/structure/fence/W in get_step(src, direction)) W.update_icon() diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index b1e950dd18f0..f1c9daa514c1 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -73,7 +73,7 @@ PLANT_CUT_MACHETE = 3 = Needs at least a machete to be cut down /obj/structure/flora/proc/spread_fire() SIGNAL_HANDLER - for(var/D in cardinal) //Spread fire + for(var/D in GLOB.cardinals) //Spread fire var/turf/T = get_step(src.loc, D) if(T) for(var/obj/structure/flora/F in T) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index f2e6b172ad88..da6d4f1a8254 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -67,8 +67,8 @@ else //wtf make your ladders properly assholes icon_state = "ladder00" -/obj/structure/ladder/attack_hand(mob/user) - if(user.stat || get_dist(user, src) > 1 || user.blinded || user.lying || user.buckled || user.anchored) return +/obj/structure/ladder/attack_hand(mob/living/user) + if(user.stat || get_dist(user, src) > 1 || user.blinded || user.body_position == LYING_DOWN || user.buckled || user.anchored) return if(busy) to_chat(user, SPAN_WARNING("Someone else is currently using [src].")) return @@ -94,7 +94,7 @@ SPAN_NOTICE("You start climbing [ladder_dir_name] [src].")) busy = TRUE if(do_after(user, 20, INTERRUPT_INCAPACITATED|INTERRUPT_OUT_OF_RANGE|INTERRUPT_RESIST, BUSY_ICON_GENERIC, src, INTERRUPT_NONE)) - if(!user.is_mob_incapacitated() && get_dist(user, src) <= 1 && !user.blinded && !user.lying && !user.buckled && !user.anchored) + if(!user.is_mob_incapacitated() && get_dist(user, src) <= 1 && !user.blinded && user.body_position != LYING_DOWN && !user.buckled && !user.anchored) visible_message(SPAN_NOTICE("[user] climbs [ladder_dir_name] [src].")) //Hack to give a visible message to the people here without duplicating user message user.visible_message(SPAN_NOTICE("[user] climbs [ladder_dir_name] [src]."), SPAN_NOTICE("You climb [ladder_dir_name] [src].")) @@ -103,9 +103,9 @@ busy = FALSE add_fingerprint(user) -/obj/structure/ladder/check_eye(mob/user) +/obj/structure/ladder/check_eye(mob/living/user) //Are we capable of looking? - if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded || user.lying || !user.client) + if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded || user.body_position == LYING_DOWN || !user.client) user.unset_interaction() //Are ladder cameras ok? @@ -140,7 +140,7 @@ //Peeking up/down /obj/structure/ladder/MouseDrop(over_object, src_location, over_location) if((over_object == usr && (in_range(src, usr)))) - if(islarva(usr) || isobserver(usr) || usr.is_mob_incapacitated() || usr.blinded || usr.lying) + if(islarva(usr) || isobserver(usr) || usr.is_mob_incapacitated() || usr.blinded) to_chat(usr, "You can't do that in your current state.") return if(is_watching) diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index d2b3d36b5920..dd427adfabb9 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -19,14 +19,14 @@ icon = 'icons/obj/structures/props/smoothlattice.dmi' icon_state = "latticeblank" updateOverlays() - for (var/dir in cardinal) + for (var/dir in GLOB.cardinals) var/obj/structure/lattice/L if(locate(/obj/structure/lattice, get_step(src, dir))) L = locate(/obj/structure/lattice, get_step(src, dir)) L.updateOverlays() /obj/structure/lattice/Destroy() - for (var/dir in cardinal) + for (var/dir in GLOB.cardinals) var/obj/structure/lattice/L if(locate(/obj/structure/lattice, get_step(src, dir))) L = locate(/obj/structure/lattice, get_step(src, dir)) @@ -73,7 +73,7 @@ var/dir_sum = 0 - for (var/direction in cardinal) + for (var/direction in GLOB.cardinals) if(locate(/obj/structure/lattice, get_step(src, direction))) dir_sum += direction else diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index b3fb2423008a..f1717f5bf0f5 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -117,9 +117,8 @@ if(user.is_mob_incapacitated()) return if(exit_stun) - user.stunned = max(user.stunned, exit_stun) //Action delay when going out of a closet (or morgue in this case) - user.update_canmove() //Force the delay to go in action immediately - if(!user.lying) + user.apply_effect(exit_stun, STUN) + if(user.mobility_flags & MOBILITY_MOVE) user.visible_message(SPAN_WARNING("[user] suddenly gets out of [src]!"), SPAN_WARNING("You get out of [src] and get your bearings!")) toggle_morgue(user) diff --git a/code/game/objects/structures/props.dm b/code/game/objects/structures/props.dm index f465e1535d68..6e6f6d5f8247 100644 --- a/code/game/objects/structures/props.dm +++ b/code/game/objects/structures/props.dm @@ -1179,7 +1179,7 @@ new_info_tag.fallen_names = list(dogtag_name) new_info_tag.fallen_assgns = list(dogtag_assign) new_info_tag.fallen_blood_types = list(dogtag_blood) - fallen_list_cross -= dogtag_name + GLOB.fallen_list_cross -= dogtag_name return ..() /obj/structure/prop/wooden_cross/attackby(obj/item/W, mob/living/user) @@ -1191,7 +1191,7 @@ dogtag_name = popleft(dog.fallen_names) dogtag_assign = popleft(dog.fallen_assgns) dogtag_blood = popleft(dog.fallen_blood_types) - fallen_list_cross += dogtag_name + GLOB.fallen_list_cross += dogtag_name update_icon() if(!length(dog.fallen_names)) qdel(dog) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index bc3b4ad7f4d0..34b0fb01e9d6 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -13,7 +13,7 @@ icon_state = "bed" icon = 'icons/obj/objects.dmi' can_buckle = TRUE - buckle_lying = TRUE + buckle_lying = 90 throwpass = TRUE debris = list(/obj/item/stack/sheet/metal) var/buildstacktype = /obj/item/stack/sheet/metal @@ -310,7 +310,7 @@ ////////////////////////////////////////////// //List of all activated medevac stretchers -var/global/list/activated_medevac_stretchers = list() +GLOBAL_LIST_EMPTY(activated_medevac_stretchers) /obj/structure/bed/medevac_stretcher name = "medevac stretcher" @@ -328,7 +328,7 @@ var/global/list/activated_medevac_stretchers = list() /obj/structure/bed/medevac_stretcher/Destroy() if(stretcher_activated) stretcher_activated = FALSE - activated_medevac_stretchers -= src + GLOB.activated_medevac_stretchers -= src if(linked_medevac) linked_medevac.linked_stretcher = null linked_medevac = null @@ -366,7 +366,7 @@ var/global/list/activated_medevac_stretchers = list() if(stretcher_activated) stretcher_activated = FALSE - activated_medevac_stretchers -= src + GLOB.activated_medevac_stretchers -= src if(linked_medevac) linked_medevac.linked_stretcher = null linked_medevac = null @@ -384,7 +384,7 @@ var/global/list/activated_medevac_stretchers = list() return stretcher_activated = TRUE - activated_medevac_stretchers += src + GLOB.activated_medevac_stretchers += src to_chat(user, SPAN_NOTICE("You activate [src]'s beacon.")) update_icon() diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 4186ae8608a9..e523906f4cfe 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -6,7 +6,7 @@ name = "chair" desc = "A rectangular metallic frame sitting on four legs with a back panel. Designed to fit the sitting position, more or less comfortably." icon_state = "chair" - buckle_lying = FALSE + buckle_lying = 0 var/propelled = FALSE //Check for fire-extinguisher-driven chairs var/can_rotate = TRUE var/picked_up_item = /obj/item/weapon/twohanded/folded_metal_chair diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 2b42e641f0cf..986ae99739aa 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -20,7 +20,7 @@ if(world.time <= l_move_time + move_delay) return // Redundant check? - if(user.is_mob_incapacitated() || user.lying) + if(user.is_mob_incapacitated()) return if(propelled) //can't manually move it mid-propelling. diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index 6375fcd13823..65bb2fd6a963 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -10,7 +10,7 @@ health = 100 layer = ABOVE_MOB_LAYER plane = GAME_PLANE - buckle_lying = FALSE + buckle_lying = 0 var/on_fire = 0 var/resisting = 0 var/resisting_ready = 0 @@ -145,7 +145,7 @@ if(!(buckled_mob && buckled_mob.buckled == src && buckled_mob != user)) return - if(user.stat || user.lying || user.is_mob_restrained()) + if(user.body_position == LYING_DOWN || user.is_mob_incapacitated()) return if(isxeno(user)) @@ -167,7 +167,7 @@ if(H.stat != DEAD) if(alert(user, "[H] is still alive and kicking! Are you sure you want to remove them from the nest?", "Confirmation", "Yes", "No") != "Yes") return - if(!buckled_mob || !user.Adjacent(H) || user.stat || user.lying || user.is_mob_restrained()) + if(!buckled_mob || !user.Adjacent(H) || user.is_mob_incapacitated(FALSE)) return if(ishuman(user)) @@ -191,7 +191,7 @@ /obj/structure/bed/nest/buckle_mob(mob/mob, mob/user) . = FALSE - if(!isliving(mob) || islarva(user) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.stat || user.lying || mob.buckled || !iscarbon(user)) + if(!isliving(mob) || islarva(user) || (get_dist(src, user) > 1) || user.is_mob_incapacitated(FALSE)) return if(isxeno(mob)) @@ -220,7 +220,7 @@ var/mob/living/carbon/human/human = null if(ishuman(mob)) human = mob - if(!human.lying) //Don't ask me why is has to be + if(human.body_position != LYING_DOWN) //Don't ask me why is has to be to_chat(user, SPAN_WARNING("[mob] is resisting, ground them.")) return @@ -242,7 +242,7 @@ return if(human) //Improperly stunned Marines won't be nested - if(!human.lying) //Don't ask me why is has to be + if(human.body_position != LYING_DOWN) //Don't ask me why is has to be to_chat(user, SPAN_WARNING("[mob] is resisting, ground them.")) return diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 8d6441293f86..df6bb5c69ecc 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -143,7 +143,7 @@ dir_sum += 128 var/table_type = 0 //stand_alone table - if((dir_sum%16) in cardinal) + if((dir_sum%16) in GLOB.cardinals) table_type = 1 //endtable dir_sum %= 16 if((dir_sum%16) in list(3, 12)) diff --git a/code/game/objects/structures/vulture_spotter.dm b/code/game/objects/structures/vulture_spotter.dm index 44efd5ce84ea..d90a1ec1615a 100644 --- a/code/game/objects/structures/vulture_spotter.dm +++ b/code/game/objects/structures/vulture_spotter.dm @@ -78,7 +78,7 @@ try_scope(user) -/obj/structure/vulture_spotter_tripod/on_set_interaction(mob/user) +/obj/structure/vulture_spotter_tripod/on_set_interaction(mob/living/user) var/obj/item/attachable/vulture_scope/scope = get_vulture_scope() scope.spotter_spotting = TRUE to_chat(scope.scope_user, SPAN_NOTICE("You notice that [scope] drifts less.")) @@ -102,13 +102,13 @@ give_action(user, /datum/action/vulture_tripod_unscope, null, null, src) set_scope_loc(user, scope) -/obj/structure/vulture_spotter_tripod/on_unset_interaction(mob/user) +/obj/structure/vulture_spotter_tripod/on_unset_interaction(mob/living/user) user.status_flags &= ~IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] looks up from [src]."),SPAN_NOTICE("You look up from [src].")) REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Vulture spotter")) user.reset_view(null) user.Move(get_step(src, reverse_direction(src.dir))) - user.client?.change_view(world_view_size, src) + user.client?.change_view(GLOB.world_view_size, src) user.setDir(dir) //set the direction of the player to the direction the gun is facing update_pixels(FALSE) remove_action(user, /datum/action/vulture_tripod_unscope) @@ -238,7 +238,7 @@ user.pixel_x = 0 user.pixel_y = 0 if(user.client) - user.client.change_view(world_view_size, src) + user.client.change_view(GLOB.world_view_size, src) user.client.pixel_x = 0 user.client.pixel_y = 0 UnregisterSignal(user.client, COMSIG_PARENT_QDELETING) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index cccc1211bfb0..60c37fcdc607 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -8,6 +8,7 @@ density = FALSE anchored = TRUE can_buckle = TRUE + buckle_lying = 0 var/open = 0 //if the lid is up var/cistern = 0 //if the cistern bit is open var/w_items = 0 //the combined w_class of all the items in the cistern diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index d0651eb5e993..61552896f6f1 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -81,7 +81,7 @@ junction = 0 if(anchored) var/turf/TU - for(var/dirn in cardinal) + for(var/dirn in GLOB.cardinals) TU = get_step(src, dirn) var/obj/structure/window/W = locate() in TU if(W && W.anchored && W.density && W.legacy_full) //Only counts anchored, non-destroyed, legacy full-tile windows. @@ -353,7 +353,7 @@ //This proc is used to update the icons of nearby windows. /obj/structure/window/proc/update_nearby_icons() update_icon() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) for(var/obj/structure/window/W in get_step(src, direction)) W.update_icon() @@ -865,7 +865,7 @@ return triggered = TRUE - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) if(direction == from_dir) continue //doesn't check backwards for(var/obj/structure/window/framed/prison/reinforced/hull/W in get_step(src,direction) ) @@ -958,7 +958,7 @@ return triggered = 1 - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) if(direction == from_dir) continue //doesn't check backwards diff --git a/code/game/sim_manager/datums/simulator.dm b/code/game/sim_manager/datums/simulator.dm index 04ddb7faa088..bf99c65ee66f 100644 --- a/code/game/sim_manager/datums/simulator.dm +++ b/code/game/sim_manager/datums/simulator.dm @@ -37,7 +37,7 @@ if(!sim_camera) to_chat(user, SPAN_WARNING("GPU damaged! Unable to start simulation.")) return - if(user.client.view != world_view_size) + if(user.client.view != GLOB.world_view_size) to_chat(user, SPAN_WARNING("You're too busy looking at something else.")) return user.reset_view(sim_camera) diff --git a/code/game/smoothwall.dm b/code/game/smoothwall.dm index eb81861a3b1f..b9284639976c 100644 --- a/code/game/smoothwall.dm +++ b/code/game/smoothwall.dm @@ -13,7 +13,7 @@ var/j //second iterator var/k //third iterator (I know, that's a lot, but I'm trying to make this modular, so bear with me) - for(i in cardinal) //For all cardinal dir turfs + for(i in GLOB.cardinals) //For all cardinal dir turfs T = get_step(src, i) if(!istype(T)) continue for(j in tiles_with) //And for all types that we tile with @@ -34,7 +34,7 @@ var/j //second iterator var/atom/k //third iterator (I know, that's a lot, but I'm trying to make this modular, so bear with me) - for(i in cardinal) //For all cardinal dir turfs + for(i in GLOB.cardinals) //For all cardinal dir turfs T = get_step(src, i) if(!istype(T)) continue for(j in tiles_with) //And for all types that we tile with @@ -61,7 +61,7 @@ var/j var/k - for(i in cardinal) + for(i in GLOB.cardinals) T = get_step(src, i) if(!istype(T)) continue for(j in tiles_with) @@ -93,7 +93,7 @@ var/j var/k - for(i in cardinal) + for(i in GLOB.cardinals) T = get_step(src, i) if(!istype(T)) continue for(j in tiles_with) @@ -227,7 +227,7 @@ var/j //second iterator var/k //third iterator (I know, that's a lot, but I'm trying to make this modular, so bear with me) - for(i in alldirs) //For all cardinal dir turfs + for(i in GLOB.alldirs) //For all cardinal dir turfs T = get_step(src, i) if(!istype(T)) continue for(j in tiles_with) //And for all types that we tile with @@ -249,7 +249,7 @@ var/j //second iterator var/k //third iterator (I know, that's a lot, but I'm trying to make this modular, so bear with me) - for(i in alldirs) //For all cardinal dir turfs + for(i in GLOB.alldirs) //For all cardinal dir turfs T = get_step(src, i) if(!istype(T)) continue for(j in tiles_with) //And for all types that we tile with diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 422a42c66541..e4e4923173bf 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -10,7 +10,7 @@ GLOBAL_LIST_EMPTY_TYPED(asrs_empty_space_tiles_list, /turf/open/floor/almayer/empty) -var/datum/controller/supply/supply_controller = new() +GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) /area/supply ceiling = CEILING_METAL @@ -113,11 +113,11 @@ var/datum/controller/supply/supply_controller = new() /obj/structure/machinery/computer/supplycomp/Initialize() . = ..() - LAZYADD(supply_controller.bound_supply_computer_list, src) + LAZYADD(GLOB.supply_controller.bound_supply_computer_list, src) /obj/structure/machinery/computer/supplycomp/Destroy() . = ..() - LAZYREMOVE(supply_controller.bound_supply_computer_list, src) + LAZYREMOVE(GLOB.supply_controller.bound_supply_computer_list, src) /obj/structure/machinery/computer/supplycomp/attackby(obj/item/hit_item, mob/user) if(istype(hit_item, /obj/item/spacecash)) @@ -127,7 +127,7 @@ var/datum/controller/supply/supply_controller = new() to_chat(user, SPAN_NOTICE("You find a small horizontal slot at the bottom of the console. You try to feed \the [slotted_cash] into it, but it rejects it! Maybe it's counterfeit?")) return to_chat(user, SPAN_NOTICE("You find a small horizontal slot at the bottom of the console. You feed \the [slotted_cash] into it..")) - supply_controller.black_market_points += slotted_cash.worth + GLOB.supply_controller.black_market_points += slotted_cash.worth qdel(slotted_cash) else to_chat(user, SPAN_NOTICE("You find a small horizontal slot at the bottom of the console. You try to feed \the [hit_item] into it, but it's seemingly blocked off from the inside.")) @@ -136,17 +136,17 @@ var/datum/controller/supply/supply_controller = new() /obj/structure/machinery/computer/supplycomp/proc/toggle_contraband(contraband_enabled = FALSE) can_order_contraband = contraband_enabled - for(var/obj/structure/machinery/computer/supplycomp/computer as anything in supply_controller.bound_supply_computer_list) + for(var/obj/structure/machinery/computer/supplycomp/computer as anything in GLOB.supply_controller.bound_supply_computer_list) if(computer.can_order_contraband) - supply_controller.black_market_enabled = TRUE + GLOB.supply_controller.black_market_enabled = TRUE return - supply_controller.black_market_enabled = FALSE + GLOB.supply_controller.black_market_enabled = FALSE //If any computers are able to order contraband, it's enabled. Otherwise, it's disabled! /// Prevents use of black market, even if it is otherwise enabled. If any computer has black market locked out, it applies across all of the currently established ones. /obj/structure/machinery/computer/supplycomp/proc/lock_black_market(market_locked = FALSE) - for(var/obj/structure/machinery/computer/supplycomp/computer as anything in supply_controller.bound_supply_computer_list) + for(var/obj/structure/machinery/computer/supplycomp/computer as anything in GLOB.supply_controller.bound_supply_computer_list) if(market_locked) computer.black_market_lockout = TRUE @@ -194,7 +194,7 @@ var/datum/controller/supply/supply_controller = new() var/list/data = list() var/list/squad_list = list() - for(var/datum/squad/current_squad in RoleAuthority.squads) + for(var/datum/squad/current_squad in GLOB.RoleAuthority.squads) if(current_squad.active && current_squad.faction == faction && current_squad.equipment_color) squad_list += list(list( "squad_name" = current_squad.name, @@ -453,7 +453,7 @@ var/datum/controller/supply/supply_controller = new() if(processing) iteration++ points += points_per_process - if(iteration >= 20 && iteration % base_random_crate_interval == 0 && supply_controller.shoppinglist.len <= 20) + if(iteration >= 20 && iteration % base_random_crate_interval == 0 && GLOB.supply_controller.shoppinglist.len <= 20) add_random_crates() crate_iteration++ sleep(processing_interval) @@ -480,18 +480,18 @@ var/datum/controller/supply/supply_controller = new() //This is a weighted pick based upon their cost. //Their cost will go up if the crate is picked /datum/controller/supply/proc/add_random_crate() - var/datum/supply_packs/C = supply_controller.pick_weighted_crate(random_supply_packs) + var/datum/supply_packs/C = GLOB.supply_controller.pick_weighted_crate(random_supply_packs) if(C == null) return C.cost = round(C.cost * ASRS_COST_MULTIPLIER) //We still do this to raise the weight //We have to create a supply order to make the system spawn it. Here we transform a crate into an order. var/datum/supply_order/supply_order = new /datum/supply_order() - supply_order.ordernum = supply_controller.ordernum + supply_order.ordernum = GLOB.supply_controller.ordernum supply_order.object = C supply_order.orderedby = "ASRS" supply_order.approvedby = "ASRS" //We add the order to the shopping list - supply_controller.shoppinglist += supply_order + GLOB.supply_controller.shoppinglist += supply_order //Here we weigh the crate based upon it's cost /datum/controller/supply/proc/pick_weighted_crate(list/cratelist) @@ -590,8 +590,8 @@ var/datum/controller/supply/supply_controller = new() if(order.object.contraband == TRUE && prob(5)) // Mendoza loaded the wrong order in. What a dunce! var/list/contraband_list - for(var/supply_name in supply_controller.supply_packs) - var/datum/supply_packs/supply_pack = supply_controller.supply_packs[supply_name] + for(var/supply_name in GLOB.supply_controller.supply_packs) + var/datum/supply_packs/supply_pack = GLOB.supply_controller.supply_packs[supply_name] if(supply_pack.contraband == FALSE) continue LAZYADD(contraband_list, supply_pack) @@ -711,10 +711,10 @@ var/datum/controller/supply/supply_controller = new() if(temp) dat = temp else - var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle + var/datum/shuttle/ferry/supply/shuttle = GLOB.supply_controller.shuttle if (shuttle) dat += {"Location: [shuttle.has_arrive_time() ? "Raising platform":shuttle.at_station() ? "Raised":"Lowered"]
    -
    Supply budget: $[supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    +
    Supply budget: $[GLOB.supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]

    \nRequest items

    View approved orders

    View requests

    @@ -735,18 +735,18 @@ var/datum/controller/supply/supply_controller = new() //all_supply_groups //Request what? last_viewed_group = "categories" - temp = "Supply budget: $[supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " + temp = "Supply budget: $[GLOB.supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " temp += "Main Menu


    " temp += "Select a category

    " - for(var/supply_group_name in supply_controller.all_supply_groups) + for(var/supply_group_name in GLOB.supply_controller.all_supply_groups) temp += "[supply_group_name]
    " else last_viewed_group = href_list["order"] - temp = "Supply budget: $[supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " + temp = "Supply budget: $[GLOB.supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " temp += "Back to all categories


    " temp += "Request from: [last_viewed_group]

    " - for(var/supply_name in supply_controller.supply_packs ) - var/datum/supply_packs/N = supply_controller.supply_packs[supply_name] + for(var/supply_name in GLOB.supply_controller.supply_packs ) + var/datum/supply_packs/N = GLOB.supply_controller.supply_packs[supply_name] if(N.contraband || N.group != last_viewed_group || !N.buyable) continue //Have to send the type instead of a reference to temp += "[supply_name] Cost: $[round(N.cost) * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " //the obj because it would get caught by the garbage @@ -757,7 +757,7 @@ var/datum/controller/supply/supply_controller = new() return //Find the correct supply_pack datum - var/datum/supply_packs/supply_pack = supply_controller.supply_packs[href_list["doorder"]] + var/datum/supply_packs/supply_pack = GLOB.supply_controller.supply_packs[href_list["doorder"]] if(!istype(supply_pack)) return if(supply_pack.contraband || !supply_pack.buyable) @@ -777,11 +777,11 @@ var/datum/controller/supply/supply_controller = new() else if(ishighersilicon(usr)) idname = usr.real_name - supply_controller.ordernum++ + GLOB.supply_controller.ordernum++ var/obj/item/paper/reqform = new /obj/item/paper(loc) reqform.name = "Requisition Form - [supply_pack.name]" - reqform.info += "

    [station_name] Supply Requisition Form


    " - reqform.info += "INDEX: #[supply_controller.ordernum]
    " + reqform.info += "

    [MAIN_SHIP_NAME] Supply Requisition Form


    " + reqform.info += "INDEX: #[GLOB.supply_controller.ordernum]
    " reqform.info += "REQUESTED BY: [idname]
    " reqform.info += "RANK: [idrank]
    " reqform.info += "REASON: [reason]
    " @@ -797,24 +797,24 @@ var/datum/controller/supply/supply_controller = new() //make our supply_order datum var/datum/supply_order/supply_order = new /datum/supply_order() - supply_order.ordernum = supply_controller.ordernum + supply_order.ordernum = GLOB.supply_controller.ordernum supply_order.object = supply_pack supply_order.orderedby = idname - supply_controller.requestlist += supply_order + GLOB.supply_controller.requestlist += supply_order temp = "Thanks for your request. The cargo team will process it as soon as possible.
    " temp += "
    Back Main Menu" else if (href_list["vieworders"]) temp = "Current approved orders:

    " - for(var/S in supply_controller.shoppinglist) + for(var/S in GLOB.supply_controller.shoppinglist) var/datum/supply_order/SO = S temp += "[SO.object.name] approved by [SO.approvedby]
    " temp += "
    OK" else if (href_list["viewrequests"]) temp = "Current requests:

    " - for(var/S in supply_controller.requestlist) + for(var/S in GLOB.supply_controller.requestlist) var/datum/supply_order/SO = S temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby]
    " temp += "
    OK" @@ -840,7 +840,7 @@ var/datum/controller/supply/supply_controller = new() if (temp) dat = temp else - var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle + var/datum/shuttle/ferry/supply/shuttle = GLOB.supply_controller.shuttle if (shuttle) dat += "\nPlatform position: " if (shuttle.has_arrive_time()) @@ -874,7 +874,7 @@ var/datum/controller/supply/supply_controller = new() dat += "
    \n
    " - dat += {"
    \nSupply budget: $[supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    \n
    + dat += {"
    \nSupply budget: $[GLOB.supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    \n
    \nOrder items
    \n
    \nView requests
    \n
    \nView orders
    \n
    @@ -886,10 +886,10 @@ var/datum/controller/supply/supply_controller = new() /obj/structure/machinery/computer/supplycomp/Topic(href, href_list) if(!is_mainship_level(z)) return - if(!supply_controller) - world.log << "## ERROR: Eek. The supply_controller controller datum is missing somehow." + if(!GLOB.supply_controller) + world.log << "## ERROR: Eek. The GLOB.supply_controller controller datum is missing somehow." return - var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle + var/datum/shuttle/ferry/supply/shuttle = GLOB.supply_controller.shuttle if (!shuttle) world.log << "## ERROR: Eek. The supply/shuttle datum is missing somehow." return @@ -927,10 +927,10 @@ var/datum/controller/supply/supply_controller = new() //all_supply_groups //Request what? last_viewed_group = "categories" - temp = "Supply budget: $[supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " + temp = "Supply budget: $[GLOB.supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " temp += "Main Menu


    " temp += "Select a category

    " - for(var/supply_group_name in supply_controller.all_supply_groups) + for(var/supply_group_name in GLOB.supply_controller.all_supply_groups) temp += "[supply_group_name]
    " if(can_order_contraband) temp += "[SPAN_DANGER("$E4RR301¿")]
    " @@ -938,14 +938,14 @@ var/datum/controller/supply/supply_controller = new() last_viewed_group = href_list["order"] if(last_viewed_group == "Black Market") handle_black_market(temp) - else if(last_viewed_group in supply_controller.contraband_supply_groups) + else if(last_viewed_group in GLOB.supply_controller.contraband_supply_groups) handle_black_market_groups() else - temp = "Supply budget: $[supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " + temp = "Supply budget: $[GLOB.supply_controller.points * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " temp += "Back to all categories


    " temp += "Request from: [last_viewed_group]

    " - for(var/supply_name in supply_controller.supply_packs ) - var/datum/supply_packs/supply_pack = supply_controller.supply_packs[supply_name] + for(var/supply_name in GLOB.supply_controller.supply_packs ) + var/datum/supply_packs/supply_pack = GLOB.supply_controller.supply_packs[supply_name] if(!is_buyable(supply_pack)) continue temp += "[supply_name] Cost: $[round(supply_pack.cost) * SUPPLY_TO_MONEY_MUPLTIPLIER]
    " //the obj because it would get caught by the garbage @@ -957,7 +957,7 @@ var/datum/controller/supply/supply_controller = new() return //Find the correct supply_pack datum - var/datum/supply_packs/supply_pack = supply_controller.supply_packs[href_list["doorder"]] + var/datum/supply_packs/supply_pack = GLOB.supply_controller.supply_packs[href_list["doorder"]] if(!istype(supply_pack)) return @@ -980,11 +980,11 @@ var/datum/controller/supply/supply_controller = new() else if(isSilicon(usr)) idname = usr.real_name - supply_controller.ordernum++ + GLOB.supply_controller.ordernum++ var/obj/item/paper/reqform = new /obj/item/paper(loc) reqform.name = "Requisition Form - [supply_pack.name]" - reqform.info += "

    [station_name] Supply Requisition Form


    " - reqform.info += "INDEX: #[supply_controller.ordernum]
    " + reqform.info += "

    [MAIN_SHIP_NAME] Supply Requisition Form


    " + reqform.info += "INDEX: #[GLOB.supply_controller.ordernum]
    " reqform.info += "REQUESTED BY: [idname]
    " reqform.info += "RANK: [idrank]
    " reqform.info += "REASON: [reason]
    " @@ -1000,10 +1000,10 @@ var/datum/controller/supply/supply_controller = new() //make our supply_order datum var/datum/supply_order/supply_order = new /datum/supply_order() - supply_order.ordernum = supply_controller.ordernum + supply_order.ordernum = GLOB.supply_controller.ordernum supply_order.object = supply_pack supply_order.orderedby = idname - supply_controller.requestlist += supply_order + GLOB.supply_controller.requestlist += supply_order temp = "Order request placed.
    " temp += "
    Back|Main Menu|Authorize Order" @@ -1016,29 +1016,29 @@ var/datum/controller/supply/supply_controller = new() temp = "Invalid Request" temp += "
    Back|Main Menu" - if(supply_controller.shoppinglist.len > 20) + if(GLOB.supply_controller.shoppinglist.len > 20) to_chat(usr, SPAN_DANGER("Current retrieval load has reached maximum capacity.")) return - for(var/i=1, i<=supply_controller.requestlist.len, i++) - var/datum/supply_order/SO = supply_controller.requestlist[i] + for(var/i=1, i<=GLOB.supply_controller.requestlist.len, i++) + var/datum/supply_order/SO = GLOB.supply_controller.requestlist[i] if(SO.ordernum == ordernum) supply_order = SO supply_pack = supply_order.object - if(supply_controller.points >= round(supply_pack.cost) && supply_controller.black_market_points >= supply_pack.dollar_cost) - supply_controller.requestlist.Cut(i,i+1) - supply_controller.points -= round(supply_pack.cost) - supply_controller.black_market_points -= round(supply_pack.dollar_cost) - if(supply_controller.black_market_heat != -1) //-1 Heat means heat is disabled - supply_controller.black_market_heat = clamp(supply_controller.black_market_heat + supply_pack.crate_heat + (supply_pack.crate_heat * rand(rand(-0.25,0),0.25)), 0, 100) // black market heat added is crate heat +- up to 25% of crate heat - supply_controller.shoppinglist += supply_order + if(GLOB.supply_controller.points >= round(supply_pack.cost) && GLOB.supply_controller.black_market_points >= supply_pack.dollar_cost) + GLOB.supply_controller.requestlist.Cut(i,i+1) + GLOB.supply_controller.points -= round(supply_pack.cost) + GLOB.supply_controller.black_market_points -= round(supply_pack.dollar_cost) + if(GLOB.supply_controller.black_market_heat != -1) //-1 Heat means heat is disabled + GLOB.supply_controller.black_market_heat = clamp(GLOB.supply_controller.black_market_heat + supply_pack.crate_heat + (supply_pack.crate_heat * rand(rand(-0.25,0),0.25)), 0, 100) // black market heat added is crate heat +- up to 25% of crate heat + GLOB.supply_controller.shoppinglist += supply_order supply_pack.cost = supply_pack.cost * SUPPLY_COST_MULTIPLIER temp = "Thank you for your order.
    " temp += "
    Back Main Menu" supply_order.approvedby = usr.name msg_admin_niche("[usr] confirmed supply order of [supply_pack.name].") - if(supply_controller.black_market_heat == 100) - supply_controller.black_market_investigation() + if(GLOB.supply_controller.black_market_heat == 100) + GLOB.supply_controller.black_market_investigation() var/pack_source = "Cargo Hold" var/pack_name = supply_pack.name if(supply_pack.dollar_cost) @@ -1053,7 +1053,7 @@ var/datum/controller/supply/supply_controller = new() else if (href_list["vieworders"]) temp = "Current approved orders:

    " - for(var/S in supply_controller.shoppinglist) + for(var/S in GLOB.supply_controller.shoppinglist) var/datum/supply_order/SO = S temp += "#[SO.ordernum] - [SO.object.name] approved by [SO.approvedby]
    "// (Cancel)
    " temp += "
    OK" @@ -1071,7 +1071,7 @@ var/datum/controller/supply/supply_controller = new() */ else if (href_list["viewrequests"]) temp = "Current requests:

    " - for(var/S in supply_controller.requestlist) + for(var/S in GLOB.supply_controller.requestlist) var/datum/supply_order/SO = S temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby] Approve Remove
    " @@ -1081,16 +1081,16 @@ var/datum/controller/supply/supply_controller = new() else if (href_list["rreq"]) var/ordernum = text2num(href_list["rreq"]) temp = "Invalid Request.
    " - for(var/i=1, i<=supply_controller.requestlist.len, i++) - var/datum/supply_order/SO = supply_controller.requestlist[i] + for(var/i=1, i<=GLOB.supply_controller.requestlist.len, i++) + var/datum/supply_order/SO = GLOB.supply_controller.requestlist[i] if(SO.ordernum == ordernum) - supply_controller.requestlist.Cut(i,i+1) + GLOB.supply_controller.requestlist.Cut(i,i+1) temp = "Request removed.
    " break temp += "
    Back Main Menu" else if (href_list["clearreq"]) - supply_controller.requestlist.Cut() + GLOB.supply_controller.requestlist.Cut() temp = "List cleared.
    " temp += "
    OK" @@ -1103,28 +1103,28 @@ var/datum/controller/supply/supply_controller = new() /obj/structure/machinery/computer/supplycomp/proc/handle_black_market() - temp = "W-Y Dollars: $[supply_controller.black_market_points]
    " + temp = "W-Y Dollars: $[GLOB.supply_controller.black_market_points]
    " temp += "Back to all categories


    " temp += SPAN_DANGER("ERR0R UNK7OWN C4T2G#!$0-


    ") if(black_market_lockout) temp += "





    Unauthorized Access Removed.
    This console is currently under CMB investigation.
    Thank you for your cooperation.
    " return temp += "KHZKNHZH#0-" - if(!supply_controller.mendoza_status) // he's daed + if(!GLOB.supply_controller.mendoza_status) // he's daed temp += "........." return handle_mendoza_dialogue() //mendoza has been in there for a while. he gets lonely sometimes temp += "[last_viewed_group]

    " - for(var/supply_group_name in supply_controller.contraband_supply_groups) + for(var/supply_group_name in GLOB.supply_controller.contraband_supply_groups) temp += "[supply_group_name]
    " /obj/structure/machinery/computer/supplycomp/proc/handle_black_market_groups() - temp = "W-Y Dollars: $[supply_controller.black_market_points]
    " + temp = "W-Y Dollars: $[GLOB.supply_controller.black_market_points]
    " temp += "Back to black market categories


    " temp += "Purchase from: [last_viewed_group]

    " - for(var/supply_name in supply_controller.supply_packs ) - var/datum/supply_packs/supply_pack = supply_controller.supply_packs[supply_name] + for(var/supply_name in GLOB.supply_controller.supply_packs ) + var/datum/supply_packs/supply_pack = GLOB.supply_controller.supply_packs[supply_name] if(!is_buyable(supply_pack)) continue temp += "[supply_name] Cost: $[round(supply_pack.dollar_cost)]
    " @@ -1185,7 +1185,7 @@ var/datum/controller/supply/supply_controller = new() return_value = movable_atom.black_market_value // so they cant sell the same thing over and over and over - return_value = POSITIVE(return_value - supply_controller.black_market_sold_items[movable_atom.type] * 0.5) + return_value = POSITIVE(return_value - GLOB.supply_controller.black_market_sold_items[movable_atom.type] * 0.5) return return_value /datum/controller/supply/proc/kill_mendoza() @@ -1348,11 +1348,11 @@ var/datum/controller/supply/supply_controller = new() new /datum/vehicle_order/apc/cmd(), ) - if(!VehicleElevatorConsole) - VehicleElevatorConsole = src + if(!GLOB.VehicleElevatorConsole) + GLOB.VehicleElevatorConsole = src /obj/structure/machinery/computer/supplycomp/vehicle/Destroy() - VehicleElevatorConsole = null + GLOB.VehicleElevatorConsole = null return ..() /obj/structure/machinery/computer/supplycomp/vehicle/attack_hand(mob/living/carbon/human/H as mob) @@ -1408,8 +1408,8 @@ var/datum/controller/supply/supply_controller = new() return if(spent) return - if(!supply_controller) - world.log << "## ERROR: Eek. The supply_controller controller datum is missing somehow." + if(!GLOB.supply_controller) + world.log << "## ERROR: Eek. The GLOB.supply_controller controller datum is missing somehow." return if (!SSshuttle.vehicle_elevator) diff --git a/code/game/turfs/auto_turf.dm b/code/game/turfs/auto_turf.dm index 45756c30bb9c..75501a1a7ecd 100644 --- a/code/game/turfs/auto_turf.dm +++ b/code/game/turfs/auto_turf.dm @@ -53,7 +53,7 @@ return bleed_layer = max(0, new_layer) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/open/T = get_step(src, direction) if(istype(T)) T.update_icon() diff --git a/code/game/turfs/floor.dm b/code/game/turfs/floor.dm index 5f99aba26c09..1be6235cd2ac 100644 --- a/code/game/turfs/floor.dm +++ b/code/game/turfs/floor.dm @@ -69,7 +69,7 @@ ..() if(is_grass_floor()) var/dir_sum = 0 - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) var/turf/T = get_step(src,direction) if(!(T.is_grass_floor())) dir_sum += direction diff --git a/code/game/turfs/floor_types.dm b/code/game/turfs/floor_types.dm index 4e47fd004f74..f957686fac22 100644 --- a/code/game/turfs/floor_types.dm +++ b/code/game/turfs/floor_types.dm @@ -203,6 +203,13 @@ icon_state = "default" plating_type = /turf/open/floor/plating/almayer +/// Admin level thunderdome floor. Doesn't get damaged by explosions and such for pristine testing +/turf/open/floor/tdome + icon = 'icons/turf/almayer.dmi' + icon_state = "plating" + plating_type = /turf/open/floor/tdome + hull_floor = TRUE + //Cargo elevator /turf/open/floor/almayer/empty name = "empty space" @@ -242,10 +249,10 @@ qdel(AM) return var/mob/living/carbon/human/thrown_human = AM - for(var/atom/computer as anything in supply_controller.bound_supply_computer_list) + for(var/atom/computer as anything in GLOB.supply_controller.bound_supply_computer_list) computer.balloon_alert_to_viewers("you hear horrifying noises coming from the elevator!") - var/area/area_shuttle = supply_controller.shuttle?.get_location_area() + var/area/area_shuttle = GLOB.supply_controller.shuttle?.get_location_area() if(!area_shuttle) return var/list/turflist = list() @@ -452,7 +459,7 @@ /turf/open/floor/grass/LateInitialize() . = ..() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) if(istype(get_step(src,direction),/turf/open/floor)) var/turf/open/floor/FF = get_step(src,direction) FF.update_icon() //so siding get updated properly @@ -497,7 +504,7 @@ if(!broken && !burnt) if(icon_state != "carpetsymbol") var/connectdir = 0 - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) if(istype(get_step(src, direction), /turf/open/floor)) var/turf/open/floor/FF = get_step(src, direction) if(FF.is_carpet_floor()) @@ -538,7 +545,7 @@ icon_state = "carpet[connectdir]-[diagonalconnect]" /turf/open/floor/carpet/make_plating() - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) if(istype(get_step(src, direction), /turf/open/floor)) var/turf/open/floor/FF = get_step(src,direction) FF.update_icon() // So siding get updated properly diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 93eb45c3b79c..72624aff99c8 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -24,7 +24,7 @@ add_cleanable_overlays() var/list/turf/open/auto_turf/auto_turf_dirs = list() - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/open/auto_turf/T = get_step(src, direction) if(!istype(T)) continue @@ -36,7 +36,7 @@ var/list/handled_dirs = list() var/list/unhandled_dirs = list() - for(var/direction in diagonals) + for(var/direction in GLOB.diagonals) var/x_dir = direction & (direction-1) var/y_dir = direction - x_dir @@ -90,7 +90,7 @@ if(!T.icon_state_before_scorching) T.icon_state_before_scorching = T.icon_state var/direction_from_neighbor_towards_src = get_dir(T, src) - var/icon/culling_mask = icon(T.icon, "[T.scorchable]_mask[turf_edgeinfo_cache[T.icon_state_before_scorching][dir2indexnum(T.dir)][dir2indexnum(direction_from_neighbor_towards_src)]]", direction_from_neighbor_towards_src) + var/icon/culling_mask = icon(T.icon, "[T.scorchable]_mask[GLOB.turf_edgeinfo_cache[T.icon_state_before_scorching][dir2indexnum(T.dir)][dir2indexnum(direction_from_neighbor_towards_src)]]", direction_from_neighbor_towards_src) edge_overlay.Blend(culling_mask, ICON_OVERLAY) edge_overlay.SwapColor(rgb(255, 0, 255, 255), rgb(0, 0, 0, 0)) overlays += edge_overlay @@ -370,16 +370,16 @@ /turf/open/gm/grass/Initialize(mapload, ...) . = ..() - if(!locate(icon_state) in turf_edgeinfo_cache) + if(!locate(icon_state) in GLOB.turf_edgeinfo_cache) switch(icon_state) if("grass1") - turf_edgeinfo_cache["grass1"] = GLOB.edgeinfo_full + GLOB.turf_edgeinfo_cache["grass1"] = GLOB.edgeinfo_full if("grass2") - turf_edgeinfo_cache["grass2"] = GLOB.edgeinfo_full + GLOB.turf_edgeinfo_cache["grass2"] = GLOB.edgeinfo_full if("grassbeach") - turf_edgeinfo_cache["grassbeach"] = GLOB.edgeinfo_edge + GLOB.turf_edgeinfo_cache["grassbeach"] = GLOB.edgeinfo_edge if("gbcorner") - turf_edgeinfo_cache["gbcorner"] = GLOB.edgeinfo_corner + GLOB.turf_edgeinfo_cache["gbcorner"] = GLOB.edgeinfo_corner /turf/open/gm/dirt2 name = "dirt" @@ -435,14 +435,14 @@ /turf/open/gm/dirtgrassborder/Initialize(mapload, ...) . = ..() - if(!locate(icon_state) in turf_edgeinfo_cache) + if(!locate(icon_state) in GLOB.turf_edgeinfo_cache) switch(icon_state) if("grassdirt_edge") - turf_edgeinfo_cache["grassdirt_edge"] = GLOB.edgeinfo_edge + GLOB.turf_edgeinfo_cache["grassdirt_edge"] = GLOB.edgeinfo_edge if("grassdirt_corner") - turf_edgeinfo_cache["grassdirt_corner"] = GLOB.edgeinfo_corner + GLOB.turf_edgeinfo_cache["grassdirt_corner"] = GLOB.edgeinfo_corner if("grassdirt_corner2") - turf_edgeinfo_cache["grassdirt_corner2"] = GLOB.edgeinfo_corner2 + GLOB.turf_edgeinfo_cache["grassdirt_corner2"] = GLOB.edgeinfo_corner2 /turf/open/gm/dirtgrassborder2 name = "grass" diff --git a/code/game/turfs/snow.dm b/code/game/turfs/snow.dm index 72b1f35d0aff..42cc9bd544c5 100644 --- a/code/game/turfs/snow.dm +++ b/code/game/turfs/snow.dm @@ -77,7 +77,7 @@ if(update_full) var/turf/open/T if(!skip_sides) - for(var/dirn in alldirs) + for(var/dirn in GLOB.alldirs) var/turf/open/snow/D = get_step(src,dirn) if(istype(D)) //Update turfs that are near us, but only once @@ -85,7 +85,7 @@ overlays.Cut() - for(var/dirn in alldirs) + for(var/dirn in GLOB.alldirs) T = get_step(src, dirn) if(istype(T)) if(bleed_layer > T.bleed_layer && T.bleed_layer < 1) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 837610d5d7fe..22fe85bdde65 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -72,9 +72,8 @@ // by default, vis_contents is inherited from the turf that was here before vis_contents.Cut() - turfs += src - if(is_ground_level(z)) - z1turfs += src + GLOB.turfs += src + assemble_baseturfs() @@ -82,11 +81,11 @@ visibilityChanged() - pass_flags = pass_flags_cache[type] + pass_flags = GLOB.pass_flags_cache[type] if (isnull(pass_flags)) pass_flags = new() initialize_pass_flags(pass_flags) - pass_flags_cache[type] = pass_flags + GLOB.pass_flags_cache[type] = pass_flags else initialize_pass_flags() diff --git a/code/game/turfs/walls/wall_icon.dm b/code/game/turfs/walls/wall_icon.dm index 9e47612964c4..2b414ca46af8 100644 --- a/code/game/turfs/walls/wall_icon.dm +++ b/code/game/turfs/walls/wall_icon.dm @@ -86,7 +86,7 @@ break if(success) - if(get_dir(src, T) in cardinal) + if(get_dir(src, T) in GLOB.cardinals) wall_dirs += get_dir(src, T) for(var/neighbor in wall_dirs) diff --git a/code/game/turfs/walls/wall_types.dm b/code/game/turfs/walls/wall_types.dm index f976da220b29..3093f8c7771a 100644 --- a/code/game/turfs/walls/wall_types.dm +++ b/code/game/turfs/walls/wall_types.dm @@ -263,15 +263,15 @@ INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen) tag = "LOBBYART" /proc/force_lobby_art(art_id) - displayed_lobby_art = art_id + GLOB.displayed_lobby_art = art_id var/turf/closed/wall/indestructible/splashscreen/SS = locate("LOBBYART") var/list/lobby_arts = CONFIG_GET(str_list/lobby_art_images) var/list/lobby_authors = CONFIG_GET(str_list/lobby_art_authors) - SS.icon_state = lobby_arts[displayed_lobby_art] - SS.desc = "Artwork by [lobby_authors[displayed_lobby_art]]" + SS.icon_state = lobby_arts[GLOB.displayed_lobby_art] + SS.desc = "Artwork by [lobby_authors[GLOB.displayed_lobby_art]]" for(var/client/C in GLOB.clients) - if(displayed_lobby_art != -1) - var/author = lobby_authors[displayed_lobby_art] + if(GLOB.displayed_lobby_art != -1) + var/author = lobby_authors[GLOB.displayed_lobby_art] if(author != "Unknown") to_chat_forced(C, SPAN_ROUNDBODY("
    This round's lobby art is brought to you by [author]
    ")) @@ -822,7 +822,7 @@ INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen) var/datum/movable_wall_group/MWG = new() MWG.add_structure(current) - for(var/dir in cardinal) + for(var/dir in GLOB.cardinals) connected = locate() in get_step(current, dir) if(connected in current_walls) if(connected.group == src) @@ -957,7 +957,7 @@ INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen) /obj/structure/alien/movable_wall/proc/update_connections(propagate = FALSE) var/list/wall_dirs = list() - for(var/dir in alldirs) + for(var/dir in GLOB.alldirs) var/obj/structure/alien/movable_wall/MW = locate() in get_step(src, dir) if(!(MW in group.walls)) continue @@ -1011,7 +1011,7 @@ INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen) /obj/structure/alien/movable_wall/proc/recalculate_structure() var/list/found_structures = list() var/current_walls = 0 - for(var/i in cardinal) + for(var/i in GLOB.cardinals) var/turf/T = get_step(src, i) var/obj/structure/alien/movable_wall/MW = locate() in T if(!MW) @@ -1068,7 +1068,7 @@ INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen) return COMPONENT_TURF_ALLOW_MOVEMENT /obj/structure/alien/movable_wall/Move(NewLoc, direct) - if(!(direct in cardinal)) + if(!(direct in GLOB.cardinals)) return group.try_move_in_direction(direct) @@ -1242,7 +1242,7 @@ INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen) . = ..() if(.) var/turf/T - for(var/i in cardinal) + for(var/i in GLOB.cardinals) T = get_step(src, i) if(!istype(T)) continue for(var/obj/structure/mineral_door/resin/R in T) diff --git a/code/game/turfs/walls/walls.dm b/code/game/turfs/walls/walls.dm index 2387a2086192..437f203c5fbb 100644 --- a/code/game/turfs/walls/walls.dm +++ b/code/game/turfs/walls/walls.dm @@ -73,7 +73,7 @@ . = ..() if(.) //successful turf change var/turf/T - for(var/i in cardinal) + for(var/i in GLOB.cardinals) T = get_step(src, i) //nearby glowshrooms updated diff --git a/code/game/verbs/discord.dm b/code/game/verbs/discord.dm index 210038084caa..2446c89aafe5 100644 --- a/code/game/verbs/discord.dm +++ b/code/game/verbs/discord.dm @@ -29,7 +29,7 @@ var/datum/entity/discord_identifier/new_identifier = DB_ENTITY(/datum/entity/discord_identifier) var/not_unique = TRUE - var/long_list = operation_postfixes + operation_prefixes + operation_titles + var/long_list = GLOB.operation_postfixes + GLOB.operation_prefixes + GLOB.operation_titles var/token while(not_unique) diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index 3c964cf4011b..2fe22ef3d4da 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -15,10 +15,10 @@ return if(!admin_holder || !(admin_holder.rights & R_MOD)) - if(!ooc_allowed) //Send to LOOC instead + if(!GLOB.ooc_allowed) //Send to LOOC instead looc(msg) return - if(!dooc_allowed && (mob.stat == DEAD || isobserver(mob))) + if(!GLOB.dooc_allowed && (mob.stat == DEAD || isobserver(mob))) to_chat(usr, SPAN_DANGER("OOC for dead mobs has been turned off.")) return if(prefs.muted & MUTE_OOC) @@ -108,10 +108,10 @@ return if(!admin_holder || !(admin_holder.rights & R_MOD)) - if(!looc_allowed) + if(!GLOB.looc_allowed) to_chat(src, SPAN_DANGER("LOOC is globally muted")) return - if(!dlooc_allowed && (mob.stat != CONSCIOUS || isobserver(mob))) + if(!GLOB.dlooc_allowed && (mob.stat != CONSCIOUS || isobserver(mob))) to_chat(usr, SPAN_DANGER("Sorry, you cannot utilize LOOC while dead or incapacitated.")) return if(prefs.muted & MUTE_OOC) @@ -150,7 +150,7 @@ if(C.prefs.toggles_chat & CHAT_LOOC) to_chat(C, "LOOC: [display_name]: [msg]") - if(mob.looc_overhead || ooc_allowed) + if(mob.looc_overhead || GLOB.ooc_allowed) var/transmit_language = isxeno(mob) ? LANGUAGE_XENOMORPH : LANGUAGE_ENGLISH mob.langchat_speech(msg, heard, GLOB.all_languages[transmit_language], "#ff47d7") diff --git a/code/game/verbs/records.dm b/code/game/verbs/records.dm index 18ed35ee6321..db420a45bc76 100644 --- a/code/game/verbs/records.dm +++ b/code/game/verbs/records.dm @@ -84,7 +84,7 @@ var/list/options = list() if(CLIENT_IS_STAFF(src)) - options = note_categories.Copy() + options = GLOB.note_categories.Copy() if(admin_holder.rights & R_PERMISSIONS) MA = TRUE else if(!isCouncil(src)) @@ -97,13 +97,13 @@ return target = ckey(target) - if(RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_COMMANDER_COUNCIL) + if(GLOB.RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_COMMANDER_COUNCIL) options |= "Commanding Officer" edit_C = TRUE - if(RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_SYNTHETIC_COUNCIL) + if(GLOB.RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_SYNTHETIC_COUNCIL) options |= "Synthetic" edit_S = TRUE - if(RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_YAUTJA_COUNCIL) + if(GLOB.RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_YAUTJA_COUNCIL) options |= "Yautja" edit_Y = TRUE @@ -116,17 +116,17 @@ if("Merit") show_other_record(NOTE_MERIT, choice, target, TRUE) if("Commanding Officer") - if(MA || (RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_COMMANDER_LEADER)) + if(MA || (GLOB.RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_COMMANDER_LEADER)) show_other_record(NOTE_COMMANDER, choice, target, TRUE, TRUE) else show_other_record(NOTE_COMMANDER, choice, target, edit_C) if("Synthetic") - if(MA || (RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_SYNTHETIC_LEADER)) + if(MA || (GLOB.RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_SYNTHETIC_LEADER)) show_other_record(NOTE_SYNTHETIC, choice, target, TRUE, TRUE) else show_other_record(NOTE_SYNTHETIC, choice, target, edit_S) if("Yautja") - if(MA || (RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_YAUTJA_LEADER)) + if(MA || (GLOB.RoleAuthority.roles_whitelist[src.ckey] & WHITELIST_YAUTJA_LEADER)) show_other_record(NOTE_YAUTJA, choice, target, TRUE, TRUE) else show_other_record(NOTE_YAUTJA, choice, target, edit_Y) diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm index 8a249d297cbe..45590c3fa006 100644 --- a/code/game/verbs/who.dm +++ b/code/game/verbs/who.dm @@ -83,7 +83,7 @@ counted_humanoids["Infected humans"]++ if(C.mob.faction == FACTION_MARINE) counted_humanoids[FACTION_MARINE]++ - if(C.mob.job in (ROLES_MARINES)) + if(C.mob.job in (GLOB.ROLES_MARINES)) counted_humanoids["USCM Marines"]++ else counted_humanoids[C.mob.faction]++ @@ -160,7 +160,7 @@ if(CONFIG_GET(flag/show_manager)) LAZYSET(mappings, "Management", R_PERMISSIONS) if(CONFIG_GET(flag/show_devs)) - LAZYSET(mappings, "Maintainers", R_PROFILER) + LAZYSET(mappings, "Maintainers", R_PROFILER) LAZYSET(mappings, "Admins", R_ADMIN) if(CONFIG_GET(flag/show_mods)) LAZYSET(mappings, "Moderators", R_MOD) diff --git a/code/game/world.dm b/code/game/world.dm index f5388ed6fd52..d8156547ef76 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -1,10 +1,8 @@ -var/world_view_size = 7 -var/lobby_view_size = 16 +GLOBAL_VAR_INIT(world_view_size, 7) +GLOBAL_VAR_INIT(lobby_view_size, 16) -var/internal_tick_usage = 0 - -var/list/reboot_sfx = file2list("config/reboot_sfx.txt") +GLOBAL_LIST_INIT(reboot_sfx, file2list("config/reboot_sfx.txt")) /world mob = /mob/new_player turf = /turf/open/space/basic @@ -18,7 +16,6 @@ var/list/reboot_sfx = file2list("config/reboot_sfx.txt") if (debug_server) LIBCALL(debug_server, "auxtools_init")() enable_debugging() - internal_tick_usage = 0.2 * world.tick_lag hub_password = "kMZy3U5jJHSiBQjr" #ifdef BYOND_TRACY @@ -49,8 +46,6 @@ var/list/reboot_sfx = file2list("config/reboot_sfx.txt") LoadBans() load_motd() load_tm_message() - load_mode() - loadShuttleInfoDatums() populate_gear_list() initialize_global_regex() @@ -67,8 +62,8 @@ var/list/reboot_sfx = file2list("config/reboot_sfx.txt") // Only do offline sleeping when the server isn't running unit tests or hosting a local dev test sleep_offline = (!running_tests && !testing_locally) - if(!RoleAuthority) - RoleAuthority = new /datum/authority/branch/role() + if(!GLOB.RoleAuthority) + GLOB.RoleAuthority = new /datum/authority/branch/role() to_world(SPAN_DANGER("\b Job setup complete")) initiate_minimap_icons() @@ -99,7 +94,7 @@ var/list/reboot_sfx = file2list("config/reboot_sfx.txt") // If the server's configured for local testing, get everything set up ASAP. // Shamelessly stolen from the test manager's host_tests() proc if(testing_locally) - master_mode = "Extended" + GLOB.master_mode = "Extended" // Wait for the game ticker to initialize while(!SSticker.initialized) @@ -109,9 +104,6 @@ var/list/reboot_sfx = file2list("config/reboot_sfx.txt") SSticker.request_start() return -var/world_topic_spam_protect_ip = "0.0.0.0" -var/world_topic_spam_protect_time = world.timeofday - /proc/start_logging() GLOB.round_id = SSentity_manager.round.id @@ -256,8 +248,8 @@ var/world_topic_spam_protect_time = world.timeofday /world/proc/send_tgs_restart() if(CONFIG_GET(string/new_round_alert_channel) && CONFIG_GET(string/new_round_alert_role_id)) - if(round_statistics) - send2chat("[round_statistics.round_name][GLOB.round_id ? " (Round [GLOB.round_id])" : ""] completed!", CONFIG_GET(string/new_round_alert_channel)) + if(GLOB.round_statistics) + send2chat("[GLOB.round_statistics.round_name][GLOB.round_id ? " (Round [GLOB.round_id])" : ""] completed!", CONFIG_GET(string/new_round_alert_channel)) if(SSmapping.next_map_configs) var/datum/map_config/next_map = SSmapping.next_map_configs[GROUND_MAP] if(next_map) @@ -267,32 +259,20 @@ var/world_topic_spam_protect_time = world.timeofday return /world/proc/send_reboot_sound() - var/reboot_sound = SAFEPICK(reboot_sfx) + var/reboot_sound = SAFEPICK(GLOB.reboot_sfx) if(reboot_sound) var/sound/reboot_sound_ref = sound(reboot_sound) for(var/client/client as anything in GLOB.clients) if(client?.prefs.toggles_sound & SOUND_REBOOT) SEND_SOUND(client, reboot_sound_ref) -/world/proc/load_mode() - var/list/Lines = file2list("data/mode.txt") - if(Lines.len) - if(Lines[1]) - master_mode = Lines[1] - log_misc("Saved mode is '[master_mode]'") - -/world/proc/save_mode(the_mode) - var/F = file("data/mode.txt") - fdel(F) - F << the_mode - /world/proc/load_motd() - join_motd = file2text("config/motd.txt") + GLOB.join_motd = file2text("config/motd.txt") /world/proc/load_tm_message() var/datum/getrev/revdata = GLOB.revdata if(revdata.testmerge.len) - current_tms = revdata.GetTestMergeInfo() + GLOB.current_tms = revdata.GetTestMergeInfo() /world/proc/update_status() //Note: Hub content is limited to 254 characters, including limited HTML/CSS. @@ -310,32 +290,10 @@ var/world_topic_spam_protect_time = world.timeofday world.status = s -#define FAILED_DB_CONNECTION_CUTOFF 1 -var/failed_db_connections = 0 -var/failed_old_db_connections = 0 - -// /hook/startup/proc/connectDB() -// if(!setup_database_connection()) -// world.log << "Your server failed to establish a connection with the feedback database." -// else -// world.log << "Feedback database connection established." -// return 1 - -var/datum/BSQL_Connection/connection -/proc/setup_database_connection() - - if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. - return 0 - - - return . - /proc/set_global_view(view_size) - world_view_size = view_size + GLOB.world_view_size = view_size for(var/client/c in GLOB.clients) - c.view = world_view_size - -#undef FAILED_DB_CONNECTION_CUTOFF + c.view = GLOB.world_view_size /proc/give_image_to_client(obj/O, icon_text) var/image/I = image(null, O) diff --git a/code/global.dm b/code/global.dm index e329cbdd00d5..6847fbd2b7fe 100644 --- a/code/global.dm +++ b/code/global.dm @@ -38,135 +38,3 @@ #define AHOLD_IS_ADMIN(ahold) (ahold && (ahold.rights & R_ADMIN)) //items that ask to be called every cycle - -////////////// -var/list/paper_tag_whitelist = list("center","p","div","span","h1","h2","h3","h4","h5","h6","hr","pre", \ - "big","small","font","i","u","b","s","sub","sup","tt","br","hr","ol","ul","li","caption","col", \ - "table","td","th","tr") - -/////////////// - -var/command_name = "Central Command" -var/station_name = "[MAIN_SHIP_NAME]" -var/game_version = "Colonial Marines" -var/game_year = 2182 - -var/going = 1 -var/master_mode = "Distress Signal" - -/// If this is anything but "secret", the secret rotation will forceably choose this mode. -var/secret_force_mode = "secret" - -var/host = null -var/ooc_allowed = 1 -var/looc_allowed = 1 -var/dsay_allowed = 1 -var/dooc_allowed = 1 -var/dlooc_allowed = 0 -var/abandon_allowed = 1 -var/enter_allowed = 1 -var/shuttle_frozen = 0 -var/shuttle_left = 0 -var/midi_playing = 0 -var/heard_midi = 0 -var/total_silenced = 0 - -var/list/admin_log = list() -var/list/asset_log = list() - -var/CELLRATE = 0.006 // multiplier for watts per tick <> cell storage (eg: 0.02 means if there is a load of 1000 watts, 20 units will be taken from a cell per second) - //It's a conversion constant. power_used*CELLRATE = charge_provided, or charge_used/CELLRATE = power_provided -var/CHARGELEVEL = 0.001 // Cap for how fast cells charge, as a percentage-per-tick (0.01 means cellcharge is capped to 1% per second) - -var/VehicleElevatorConsole -var/VehicleGearConsole - -//Spawnpoints. -var/list/fallen_list = list() -/// This is for dogtags placed on crosses- they will show up at the end-round memorial. -var/list/fallen_list_cross = list() -var/list/cardinal = list(NORTH, SOUTH, EAST, WEST) -var/list/diagonals = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) -var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) -var/list/reverse_dir = list(2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15, 32, 34, 33, 35, 40, 42, 41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21, 23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63) - -var/list/combatlog = list() -var/list/IClog = list() -var/list/OOClog = list() -var/list/adminlog = list() - -var/Debug = 0 // global debug switch - -var/datum/moduletypes/mods = new() - -var/join_motd = null -var/current_tms - -// nanomanager, the manager for Nano UIs -var/datum/nanomanager/nanomanager = new() - -var/list/BorgWireColorToFlag = RandomBorgWires() -var/list/BorgIndexToFlag -var/list/BorgIndexToWireColor -var/list/BorgWireColorToIndex -var/list/AAlarmWireColorToFlag = RandomAAlarmWires() -var/list/AAlarmIndexToFlag -var/list/AAlarmIndexToWireColor -var/list/AAlarmWireColorToIndex - -//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam -#define MAX_MESSAGE_LEN 1024 -#define MAX_EMOTE_LEN 256 -#define MAX_PAPER_MESSAGE_LEN 3072 -#define MAX_BOOK_MESSAGE_LEN 9216 -#define MAX_NAME_LEN 26 - -/// 3 minutes in the station. -#define shuttle_time_in_station 3 MINUTES -/// 10 minutes to arrive. -#define shuttle_time_to_arrive 10 MINUTES - - // MySQL configuration - -var/sqladdress = "localhost" -var/sqlport = "3306" -var/sqldb = "cmdb" -var/sqllogin = "root" -var/sqlpass = "" - - - // For FTP requests. (i.e. downloading runtime logs.) - // However it'd be ok to use for accessing attack logs and such too, which are even laggier. -var/fileaccess_timer = 0 - -// Reference list for disposal sort junctions. Filled up by sorting junction's New() -/var/list/tagger_locations = list() - -//added for Xenoarchaeology, might be useful for other stuff -var/list/alphabet_uppercase = list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z") -var/list/alphabet_lowercase = list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z") - -var/list/greek_letters = list("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omnicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega") -var/list/nato_phonetic_alphabet = list("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliett", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-Ray", "Yankee", "Zulu") - -//Used for autocall procs on ERT -var/distress_cancel = 0 -var/destroy_cancel = 0 - -// Which lobby art is on display -// This is updated by the lobby art turf when it initializes -var/displayed_lobby_art = -1 - -// Last global ID that was assigned to a mob (for round recording purposes) -var/last_mob_gid = 0 - -// be careful messing with this. the section names are hardcoded here, while defines are used everywhere else -// see the big commented block for an explanation -var/list/almayer_ship_sections = list( - "Upper deck Foreship", - "Upper deck Midship", - "Upper deck Aftship", - "Lower deck Foreship", - "Lower deck Midship", - "Lower deck Aftship" -) diff --git a/code/js/byjax.dm b/code/js/byjax.dm deleted file mode 100644 index 8e196ef013f4..000000000000 --- a/code/js/byjax.dm +++ /dev/null @@ -1,50 +0,0 @@ -//this function places received data into element with specified id. -var/const/js_byjax = {" - -function replaceContent() { - var args = Array.prototype.slice.call(arguments); - var id = args\[0\]; - var content = args\[1\]; - var callback = null; - if(args\[2\]){ - callback = args\[2\]; - if(args\[3\]){ - args = args.slice(3); - } - } - var parent = document.getElementById(id); - if(typeof(parent)!=='undefined' && parent!=null){ - parent.innerHTML = content?content:''; - } - if(callback && window\[callback\]){ - window\[callback\].apply(null,args); - } -} -"} - -/* -sends data to control_id:replaceContent - -receiver - mob -control_id - window id (for windows opened with browse(), it'll be "windowname.browser") -target_element - HTML element id -new_content - HTML content -callback - js function that will be called after the data is sent -callback_args - arguments for callback function - -Be sure to include required js functions in your page, or it'll raise an exception. -*/ -/proc/send_byjax(receiver, control_id, target_element, new_content=null, callback=null, list/callback_args=null) - if(receiver && target_element && control_id) // && winexists(receiver, control_id)) - var/list/argums = list(target_element, new_content) - if(callback) - argums += callback - if(callback_args) - argums += callback_args - argums = list2params(argums) -/* if(callback_args) - argums += "&[list2params(callback_args)]" -*/ - receiver << output(argums,"[control_id]:replaceContent") - return - diff --git a/code/js/menus.dm b/code/js/menus.dm deleted file mode 100644 index 0064522c2f81..000000000000 --- a/code/js/menus.dm +++ /dev/null @@ -1,37 +0,0 @@ -var/const/js_dropdowns = {" -function dropdowns() { - var divs = document.getElementsByTagName('div'); - var headers = new Array(); - var links = new Array(); - for(var i=0;i=0) { - elem.className = elem.className.replace('visible','hidden'); - this.className = this.className.replace('open','closed'); - this.innerHTML = this.innerHTML.replace('-','+'); - } - else { - elem.className = elem.className.replace('hidden','visible'); - this.className = this.className.replace('closed','open'); - this.innerHTML = this.innerHTML.replace('+','-'); - } - return false; - } - })(links\[i\]); - } - } -} -"} diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index bf6d8e261ab3..94f40629fc6a 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -18,7 +18,7 @@ return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.") WAIT_DB_READY - if(admin_datums[ckey] && (admin_datums[ckey].rights & R_MOD)) + if(GLOB.admin_datums[ckey] && (GLOB.admin_datums[ckey].rights & R_MOD)) return ..() if(CONFIG_GET(number/limit_players) && CONFIG_GET(number/limit_players) < GLOB.clients.len) diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm index b64b1e4682fd..7dca354129ff 100644 --- a/code/modules/admin/NewBan.dm +++ b/code/modules/admin/NewBan.dm @@ -1,75 +1,75 @@ -var/CMinutes = null -var/savefile/Banlist +GLOBAL_VAR(CMinutes) +GLOBAL_DATUM(Banlist, /savefile) /proc/CheckBan(ckey, id, address) - if(!Banlist) // if Banlist cannot be located for some reason + if(!GLOB.Banlist) // if GLOB.Banlist cannot be located for some reason LoadBans() // try to load the bans - if(!Banlist) // uh oh, can't find bans! + if(!GLOB.Banlist) // uh oh, can't find bans! return 0 // ABORT ABORT ABORT . = list() var/appeal if(CONFIG_GET(string/banappeals)) appeal = "\nFor more information on your ban, or to appeal, head to [CONFIG_GET(string/banappeals)]" - Banlist.cd = "/base" - if( "[ckey][id]" in Banlist.dir ) - Banlist.cd = "[ckey][id]" - if (Banlist["temp"]) - if (!GetExp(Banlist["minutes"])) + GLOB.Banlist.cd = "/base" + if( "[ckey][id]" in GLOB.Banlist.dir ) + GLOB.Banlist.cd = "[ckey][id]" + if (GLOB.Banlist["temp"]) + if (!GetExp(GLOB.Banlist["minutes"])) ClearTempbans() return 0 else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: [GetExp(GLOB.Banlist["minutes"])]\nBy: [GLOB.Banlist["bannedby"]][appeal]" else - Banlist.cd = "/base/[ckey][id]" - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: PERMENANT\nBy: [Banlist["bannedby"]][appeal]" + GLOB.Banlist.cd = "/base/[ckey][id]" + .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: PERMENANT\nBy: [GLOB.Banlist["bannedby"]][appeal]" .["reason"] = "ckey/id" return . else - for (var/A in Banlist.dir) - Banlist.cd = "/base/[A]" + for (var/A in GLOB.Banlist.dir) + GLOB.Banlist.cd = "/base/[A]" var/matches - if( ckey == Banlist["key"] ) + if( ckey == GLOB.Banlist["key"] ) matches += "ckey" - if( id == Banlist["id"] ) + if( id == GLOB.Banlist["id"] ) if(matches) matches += "/" matches += "id" - if( address == Banlist["ip"] ) + if( address == GLOB.Banlist["ip"] ) if(matches) matches += "/" matches += "ip" if(matches) - if(Banlist["temp"]) - if (!GetExp(Banlist["minutes"])) + if(GLOB.Banlist["temp"]) + if (!GetExp(GLOB.Banlist["minutes"])) ClearTempbans() return 0 else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: [GetExp(GLOB.Banlist["minutes"])]\nBy: [GLOB.Banlist["bannedby"]][appeal]" else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: PERMENANT\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: PERMENANT\nBy: [GLOB.Banlist["bannedby"]][appeal]" .["reason"] = matches return . return 0 /proc/UpdateTime() //No idea why i made this a proc. - CMinutes = (world.realtime / 10) / 60 + GLOB.CMinutes = (world.realtime / 10) / 60 return 1 /proc/LoadBans() - Banlist = new("data/banlist.bdb") - log_admin("Loading Banlist") + GLOB.Banlist = new("data/banlist.bdb") + log_admin("Loading GLOB.Banlist") - if (!length(Banlist.dir)) log_admin("Banlist is empty.") + if (!length(GLOB.Banlist.dir)) log_admin("GLOB.Banlist is empty.") - if (!Banlist.dir.Find("base")) - log_admin("Banlist missing base dir.") - Banlist.dir.Add("base") - Banlist.cd = "/base" - else if (Banlist.dir.Find("base")) - Banlist.cd = "/base" + if (!GLOB.Banlist.dir.Find("base")) + log_admin("GLOB.Banlist missing base dir.") + GLOB.Banlist.dir.Add("base") + GLOB.Banlist.cd = "/base" + else if (GLOB.Banlist.dir.Find("base")) + GLOB.Banlist.cd = "/base" ClearTempbans() return 1 @@ -77,64 +77,64 @@ var/savefile/Banlist /proc/ClearTempbans() UpdateTime() - Banlist.cd = "/base" - for (var/A in Banlist.dir) - Banlist.cd = "/base/[A]" - if (!Banlist["key"] || !Banlist["id"]) + GLOB.Banlist.cd = "/base" + for (var/A in GLOB.Banlist.dir) + GLOB.Banlist.cd = "/base/[A]" + if (!GLOB.Banlist["key"] || !GLOB.Banlist["id"]) RemoveBan(A) log_admin("Invalid Ban.") message_admins("Invalid Ban.") continue - if (!Banlist["temp"]) continue - if (CMinutes >= Banlist["minutes"]) RemoveBan(A) + if (!GLOB.Banlist["temp"]) continue + if (GLOB.CMinutes >= GLOB.Banlist["minutes"]) RemoveBan(A) return 1 /proc/AddBan(ckey, computerid, reason, bannedby, temp, minutes, address) - if(!Banlist) // if Banlist cannot be located for some reason + if(!GLOB.Banlist) // if GLOB.Banlist cannot be located for some reason LoadBans() // try to load the bans - if(!Banlist) // uh oh, can't find bans! + if(!GLOB.Banlist) // uh oh, can't find bans! return 0 // ABORT ABORT ABORT var/bantimestamp if (temp) UpdateTime() - bantimestamp = CMinutes + minutes + bantimestamp = GLOB.CMinutes + minutes - Banlist.cd = "/base" - if ( Banlist.dir.Find("[ckey][computerid]")) + GLOB.Banlist.cd = "/base" + if ( GLOB.Banlist.dir.Find("[ckey][computerid]")) RemoveBan("[ckey][computerid]") //have to remove dirs before processing - Banlist.dir.Add("[ckey][computerid]") - Banlist.cd = "/base/[ckey][computerid]" - Banlist["key"] << ckey - Banlist["id"] << computerid - Banlist["ip"] << address - Banlist["reason"] << reason - Banlist["bannedby"] << bannedby - Banlist["temp"] << temp + GLOB.Banlist.dir.Add("[ckey][computerid]") + GLOB.Banlist.cd = "/base/[ckey][computerid]" + GLOB.Banlist["key"] << ckey + GLOB.Banlist["id"] << computerid + GLOB.Banlist["ip"] << address + GLOB.Banlist["reason"] << reason + GLOB.Banlist["bannedby"] << bannedby + GLOB.Banlist["temp"] << temp if (temp) - Banlist["minutes"] << bantimestamp + GLOB.Banlist["minutes"] << bantimestamp return 1 /proc/RemoveBan(foldername) - if(!Banlist) // if Banlist cannot be located for some reason + if(!GLOB.Banlist) // if GLOB.Banlist cannot be located for some reason LoadBans() // try to load the bans - if(!Banlist) // uh oh, can't find bans! + if(!GLOB.Banlist) // uh oh, can't find bans! return 0 // ABORT ABORT ABORT var/key var/id - Banlist.cd = "/base/[foldername]" - Banlist["key"] >> key - Banlist["id"] >> id - Banlist.cd = "/base" + GLOB.Banlist.cd = "/base/[foldername]" + GLOB.Banlist["key"] >> key + GLOB.Banlist["id"] >> id + GLOB.Banlist.cd = "/base" - if (!Banlist.dir.Remove(foldername)) return 0 + if (!GLOB.Banlist.dir.Remove(foldername)) return 0 if(!usr) log_admin("Ban Expired: [key]") @@ -143,18 +143,18 @@ var/savefile/Banlist ban_unban_log_save("[key_name_admin(usr)] unbanned [key]") log_admin("[key_name_admin(usr)] unbanned [key]") message_admins("[key_name_admin(usr)] unbanned: [key]") - for (var/A in Banlist.dir) - Banlist.cd = "/base/[A]" - if (key == Banlist["key"] /*|| id == Banlist["id"]*/) - Banlist.cd = "/base" - Banlist.dir.Remove(A) + for (var/A in GLOB.Banlist.dir) + GLOB.Banlist.cd = "/base/[A]" + if (key == GLOB.Banlist["key"] /*|| id == GLOB.Banlist["id"]*/) + GLOB.Banlist.cd = "/base" + GLOB.Banlist.dir.Remove(A) continue return 1 /proc/GetExp(minutes as num) UpdateTime() - var/exp = minutes - CMinutes + var/exp = minutes - GLOB.CMinutes if (exp <= 0) return 0 else @@ -202,27 +202,27 @@ var/savefile/Banlist var/a = pick(1,0) var/b = pick(1,0) if(b) - Banlist.cd = "/base" - Banlist.dir.Add("trash[i]trashid[i]") - Banlist.cd = "/base/trash[i]trashid[i]" - Banlist["key"] << "trash[i]" + GLOB.Banlist.cd = "/base" + GLOB.Banlist.dir.Add("trash[i]trashid[i]") + GLOB.Banlist.cd = "/base/trash[i]trashid[i]" + GLOB.Banlist["key"] << "trash[i]" else - Banlist.cd = "/base" - Banlist.dir.Add("[last]trashid[i]") - Banlist.cd = "/base/[last]trashid[i]" - Banlist["key"] << last - Banlist["id"] << "trashid[i]" - Banlist["reason"] << "Trashban[i]." - Banlist["temp"] << a - Banlist["minutes"] << CMinutes + rand(1,2000) - Banlist["bannedby"] << "trashmin" + GLOB.Banlist.cd = "/base" + GLOB.Banlist.dir.Add("[last]trashid[i]") + GLOB.Banlist.cd = "/base/[last]trashid[i]" + GLOB.Banlist["key"] << last + GLOB.Banlist["id"] << "trashid[i]" + GLOB.Banlist["reason"] << "Trashban[i]." + GLOB.Banlist["temp"] << a + GLOB.Banlist["minutes"] << GLOB.CMinutes + rand(1,2000) + GLOB.Banlist["bannedby"] << "trashmin" last = "trash[i]" - Banlist.cd = "/base" + GLOB.Banlist.cd = "/base" /proc/ClearAllBans() - Banlist.cd = "/base" - for (var/A in Banlist.dir) + GLOB.Banlist.cd = "/base" + for (var/A in GLOB.Banlist.dir) RemoveBan(A) /client/proc/cmd_admin_do_ban(mob/M) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 38b63b94570c..fe95affaffd2 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -121,10 +121,10 @@ var/t //text to show in the window var/u //unban button href arg var/dat = "" - for(r in jobban_keylist) - L = jobban_keylist[r] + for(r in GLOB.jobban_keylist) + L = GLOB.jobban_keylist[r] for(c in L) - i = jobban_keylist[r][c] //These are already strings, as you're iterating through them. Anyway, establish jobban. + i = GLOB.jobban_keylist[r][c] //These are already strings, as you're iterating through them. Anyway, establish jobban. t = "[c] - [r] ## [i]" u = "[c] - [r]" dat += "" @@ -138,8 +138,6 @@ var/dat = {" Change Game Mode
    "} - if(master_mode == "secret") - dat += "(Force Secret Mode)
    " dat += {"
    diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index cbeb1169c807..5bb9692b0368 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -1,8 +1,8 @@ -var/list/admin_ranks = list() //list of all ranks with associated rights +GLOBAL_LIST_EMPTY(admin_ranks) //list of all ranks with associated rights //load our rank - > rights associations /proc/load_admin_ranks() - admin_ranks.Cut() + GLOB.admin_ranks.Cut() var/previous_rights = 0 @@ -46,19 +46,19 @@ var/list/admin_ranks = list() //list of all ranks with associated rights if("host") rights |= RL_HOST if("everything") rights |= RL_EVERYTHING - admin_ranks[rank] = rights + GLOB.admin_ranks[rank] = rights previous_rights = rights #ifdef TESTING var/msg = "Permission Sets Built:\n" - for(var/rank in admin_ranks) - msg += "\t[rank] - [admin_ranks[rank]]\n" + for(var/rank in GLOB.admin_ranks) + msg += "\t[rank] - [GLOB.admin_ranks[rank]]\n" testing(msg) #endif /proc/load_admins() //clear the datums references - admin_datums.Cut() + GLOB.admin_datums.Cut() for(var/client/C in GLOB.admins) C.remove_admin_verbs() C.admin_holder = null @@ -78,9 +78,9 @@ var/list/admin_ranks = list() //list of all ranks with associated rights #ifdef TESTING var/msg = "Admins Built:\n" - for(var/ckey in admin_datums) + for(var/ckey in GLOB.admin_datums) var/rank - var/datum/admins/D = admin_datums[ckey] + var/datum/admins/D = GLOB.admin_datums[ckey] if(D) rank = D.rank msg += "\t[ckey] - [rank]\n" testing(msg) @@ -115,7 +115,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights return //load permissions associated with this rank - var/rights = admin_ranks[rank] + var/rights = GLOB.admin_ranks[rank] //create the admin datum and store it for later use var/datum/admins/D = new /datum/admins(rank, rights, ckey, extra_titles) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 2032a5cba52a..b355fe914ec8 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -1,5 +1,5 @@ //admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless -var/list/admin_verbs_default = list( +GLOBAL_LIST_INIT(admin_verbs_default, list( /datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/ /client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/ /client/proc/becomelarva, /*lets you forgo your larva protection as staff member. */ @@ -71,9 +71,9 @@ var/list/admin_verbs_default = list( /client/proc/cmd_admin_say, /*staff-only ooc chat*/ /client/proc/cmd_mod_say, /* alternate way of typing asay, no different than cmd_admin_say */ /client/proc/cmd_admin_tacmaps_panel, - ) + )) -var/list/admin_verbs_admin = list( +GLOBAL_LIST_INIT(admin_verbs_admin, list( /datum/admins/proc/togglejoin, /*toggles whether people can join the current game*/ /datum/admins/proc/announce, /*priority announce something to all clients.*/ /datum/admins/proc/view_game_log, /*shows the server game log (diary) for this round*/ @@ -93,22 +93,20 @@ var/list/admin_verbs_admin = list( /client/proc/force_teleporter, /client/proc/matrix_editor, /datum/admins/proc/open_shuttlepanel -) +)) -var/list/admin_verbs_ban = list( +GLOBAL_LIST_INIT(admin_verbs_ban, list( /client/proc/unban_panel // /client/proc/jobbans // Disabled temporarily due to 15-30 second lag spikes. Don't forget the comma in the line above when uncommenting this! -) +)) -var/list/admin_verbs_sounds = list( - /client/proc/play_web_sound, - /client/proc/play_sound, - /client/proc/stop_web_sound, - /client/proc/stop_sound, +GLOBAL_LIST_INIT(admin_verbs_sounds, list( + /client/proc/play_admin_sound, + /client/proc/stop_admin_sound, /client/proc/cmd_admin_vox_panel -) +)) -var/list/admin_verbs_minor_event = list( +GLOBAL_LIST_INIT(admin_verbs_minor_event, list( /client/proc/cmd_admin_change_custom_event, /datum/admins/proc/admin_force_distress, /datum/admins/proc/admin_force_ERT_shuttle, @@ -139,9 +137,9 @@ var/list/admin_verbs_minor_event = list( /client/proc/admin_biohazard_alert, /client/proc/toggle_hardcore_perma, /client/proc/toggle_bypass_joe_restriction, -) +)) -var/list/admin_verbs_major_event = list( +GLOBAL_LIST_INIT(admin_verbs_major_event, list( /client/proc/enable_event_mob_verbs, /client/proc/cmd_admin_dress_all, /client/proc/free_all_mobs_in_view, @@ -160,16 +158,16 @@ var/list/admin_verbs_major_event = list( /client/proc/change_taskbar_icon, /client/proc/change_weather, /client/proc/admin_blurb -) +)) -var/list/admin_verbs_spawn = list( +GLOBAL_LIST_INIT(admin_verbs_spawn, list( /datum/admins/proc/spawn_atom, /client/proc/game_panel, /client/proc/create_humans, /client/proc/create_xenos -) +)) -var/list/admin_verbs_server = list( +GLOBAL_LIST_INIT(admin_verbs_server, list( /datum/admins/proc/startnow, /datum/admins/proc/restart, /datum/admins/proc/delay, @@ -183,9 +181,9 @@ var/list/admin_verbs_server = list( /client/proc/cmd_debug_del_all, /datum/admins/proc/togglejoin, /client/proc/toggle_cdn, -) +)) -var/list/admin_verbs_debug = list( +GLOBAL_LIST_INIT(admin_verbs_debug, list( /client/proc/debug_role_authority, /client/proc/cmd_debug_make_powernets, /client/proc/cmd_debug_list_processing_items, @@ -217,19 +215,19 @@ var/list/admin_verbs_debug = list( /datum/admins/proc/view_href_log, /*shows the server HREF log for this round*/ /datum/admins/proc/view_tgui_log, /*shows the server TGUI log for this round*/ /client/proc/admin_blurb, -) +)) -var/list/admin_verbs_debug_advanced = list( +GLOBAL_LIST_INIT(admin_verbs_debug_advanced, list( /client/proc/callproc_datum, /client/proc/callproc, /client/proc/SDQL2_query, -) +)) -var/list/clan_verbs = list( +GLOBAL_LIST_INIT(clan_verbs, list( /client/proc/usr_create_new_clan -) +)) -var/list/debug_verbs = list( +GLOBAL_LIST_INIT(debug_verbs, list( /client/proc/Cell, /client/proc/cmd_assume_direct_control, /client/proc/ticklag, @@ -238,22 +236,22 @@ var/list/debug_verbs = list( /client/proc/view_power_update_stats_machines, /client/proc/toggle_power_update_profiling, /client/proc/nanomapgen_DumpImage, -) +)) -var/list/admin_verbs_possess = list( +GLOBAL_LIST_INIT(admin_verbs_possess, list( /client/proc/possess, /client/proc/release -) +)) -var/list/admin_verbs_permissions = list( +GLOBAL_LIST_INIT(admin_verbs_permissions, list( /client/proc/ToRban -) +)) -var/list/admin_verbs_color = list( +GLOBAL_LIST_INIT(admin_verbs_color, list( /client/proc/set_ooc_color_self -) +)) -var/list/admin_mob_event_verbs_hideable = list( +GLOBAL_LIST_INIT(admin_mob_event_verbs_hideable, list( /client/proc/hide_event_mob_verbs, /client/proc/cmd_admin_select_mob_rank, /client/proc/cmd_admin_dress, @@ -268,10 +266,10 @@ var/list/admin_mob_event_verbs_hideable = list( /client/proc/cmd_admin_grantfullaccess, /client/proc/cmd_admin_grantallskills, /client/proc/admin_create_account -) +)) //verbs which can be hidden - needs work -var/list/admin_verbs_hideable = list( +GLOBAL_LIST_INIT(admin_verbs_hideable, list( /client/proc/release, /client/proc/possess, /client/proc/callproc_datum, @@ -290,9 +288,9 @@ var/list/admin_verbs_hideable = list( /datum/admins/proc/togglesleep, /client/proc/debug_variables, /client/proc/debug_global_variables -) +)) -var/list/admin_verbs_teleport = list( +GLOBAL_LIST_INIT(admin_verbs_teleport, list( /client/proc/teleport_panel, /*teleport panel, for jumping to things/places and getting things/places */ /client/proc/jumptocoord, /client/proc/jumptooffsetcoord, @@ -304,75 +302,75 @@ var/list/admin_verbs_teleport = list( /client/proc/Getmob, /client/proc/Getkey, /client/proc/toggle_noclip -) +)) -var/list/roundstart_mod_verbs = list( +GLOBAL_LIST_INIT(roundstart_mod_verbs, list( /client/proc/toggle_ob_spawn -) +)) /client/proc/add_admin_verbs() if(!admin_holder) return if(CLIENT_IS_STAFF(src)) - add_verb(src, admin_verbs_default) + add_verb(src, GLOB.admin_verbs_default) if(CLIENT_HAS_RIGHTS(src, R_MOD)) - add_verb(src, admin_verbs_ban) - add_verb(src, admin_verbs_teleport) + add_verb(src, GLOB.admin_verbs_ban) + add_verb(src, GLOB.admin_verbs_teleport) if(CLIENT_HAS_RIGHTS(src, R_EVENT)) - add_verb(src, admin_verbs_minor_event) + add_verb(src, GLOB.admin_verbs_minor_event) if(CLIENT_HAS_RIGHTS(src, R_ADMIN)) - add_verb(src, admin_verbs_admin) - add_verb(src, admin_verbs_major_event) + add_verb(src, GLOB.admin_verbs_admin) + add_verb(src, GLOB.admin_verbs_major_event) if(CLIENT_HAS_RIGHTS(src, R_MENTOR)) add_verb(src, /client/proc/cmd_mentor_say) add_verb(src, /datum/admins/proc/imaginary_friend) if(CLIENT_HAS_RIGHTS(src, R_BUILDMODE)) add_verb(src, /client/proc/togglebuildmodeself) if(CLIENT_HAS_RIGHTS(src, R_SERVER)) - add_verb(src, admin_verbs_server) + add_verb(src, GLOB.admin_verbs_server) if(CLIENT_HAS_RIGHTS(src, R_DEBUG)) - add_verb(src, admin_verbs_debug) + add_verb(src, GLOB.admin_verbs_debug) if(!CONFIG_GET(flag/debugparanoid) || CLIENT_HAS_RIGHTS(src, R_ADMIN)) - add_verb(src, admin_verbs_debug_advanced) // Right now it's just callproc but we can easily add others later on. + add_verb(src, GLOB.admin_verbs_debug_advanced) // Right now it's just callproc but we can easily add others later on. if(CLIENT_HAS_RIGHTS(src, R_POSSESS)) - add_verb(src, admin_verbs_possess) + add_verb(src, GLOB.admin_verbs_possess) if(CLIENT_HAS_RIGHTS(src, R_PERMISSIONS)) - add_verb(src, admin_verbs_permissions) + add_verb(src, GLOB.admin_verbs_permissions) if(CLIENT_HAS_RIGHTS(src, R_COLOR)) - add_verb(src, admin_verbs_color) + add_verb(src, GLOB.admin_verbs_color) if(CLIENT_HAS_RIGHTS(src, R_SOUNDS)) - add_verb(src, admin_verbs_sounds) + add_verb(src, GLOB.admin_verbs_sounds) if(CLIENT_HAS_RIGHTS(src, R_SPAWN)) - add_verb(src, admin_verbs_spawn) - if(RoleAuthority && (RoleAuthority.roles_whitelist[ckey] & WHITELIST_YAUTJA_LEADER)) - add_verb(src, clan_verbs) + add_verb(src, GLOB.admin_verbs_spawn) + if(GLOB.RoleAuthority && (GLOB.RoleAuthority.roles_whitelist[ckey] & WHITELIST_YAUTJA_LEADER)) + add_verb(src, GLOB.clan_verbs) /client/proc/add_admin_whitelists() if(CLIENT_IS_MENTOR(src)) - RoleAuthority.roles_whitelist[ckey] |= WHITELIST_MENTOR + GLOB.RoleAuthority.roles_whitelist[ckey] |= WHITELIST_MENTOR if(CLIENT_IS_STAFF(src)) - RoleAuthority.roles_whitelist[ckey] |= WHITELIST_JOE + GLOB.RoleAuthority.roles_whitelist[ckey] |= WHITELIST_JOE /client/proc/remove_admin_verbs() remove_verb(src, list( - admin_verbs_default, + GLOB.admin_verbs_default, /client/proc/togglebuildmodeself, - admin_verbs_admin, - admin_verbs_ban, - admin_verbs_minor_event, - admin_verbs_major_event, - admin_verbs_server, - admin_verbs_debug, - admin_verbs_debug_advanced, - admin_verbs_possess, - admin_verbs_permissions, - admin_verbs_color, - admin_verbs_sounds, - admin_verbs_spawn, - admin_verbs_teleport, - admin_mob_event_verbs_hideable, - admin_verbs_hideable, - debug_verbs, + GLOB.admin_verbs_admin, + GLOB.admin_verbs_ban, + GLOB.admin_verbs_minor_event, + GLOB.admin_verbs_major_event, + GLOB.admin_verbs_server, + GLOB.admin_verbs_debug, + GLOB.admin_verbs_debug_advanced, + GLOB.admin_verbs_possess, + GLOB.admin_verbs_permissions, + GLOB.admin_verbs_color, + GLOB.admin_verbs_sounds, + GLOB.admin_verbs_spawn, + GLOB.admin_verbs_teleport, + GLOB.admin_mob_event_verbs_hideable, + GLOB.admin_verbs_hideable, + GLOB.debug_verbs, )) /client/proc/jobbans() @@ -407,7 +405,7 @@ var/list/roundstart_mod_verbs = list( if(!check_rights(R_ADMIN)) return if(!warned_ckey || !istext(warned_ckey)) return - if(warned_ckey in admin_datums) + if(warned_ckey in GLOB.admin_datums) to_chat(usr, "Error: warn(): You can't warn admins.") return @@ -438,7 +436,7 @@ var/list/roundstart_mod_verbs = list( set name = "Give Disease (old)" set desc = "Gives a (tg-style) Disease to a mob." var/list/disease_names = list() - for(var/v in diseases) + for(var/v in GLOB.diseases) disease_names.Add(copytext("[v]", 16, 0)) var/datum/disease/D = tgui_input_list(usr, "Choose the disease to give to that guy", "ACHOO", disease_names) if(!D) return diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm index 18f06e79a66a..13c3b4664a15 100644 --- a/code/modules/admin/banjob.dm +++ b/code/modules/admin/banjob.dm @@ -7,23 +7,23 @@ won't recognize the older one, as an example. */ -var/jobban_runonce // Updates legacy bans with new info -var/jobban_keylist[0] //to store the keys & ranks +GLOBAL_VAR(jobban_runonce) // Updates legacy bans with new info +GLOBAL_LIST_EMPTY(jobban_keylist) /proc/check_jobban_path(X) . = ckey(X) - if(!islist(jobban_keylist[.])) //If it's not a list, we're in trouble. - jobban_keylist[.] = list() + if(!islist(GLOB.jobban_keylist[.])) //If it's not a list, we're in trouble. + GLOB.jobban_keylist[.] = list() /proc/jobban_fullban(mob/M, rank, reason) if (!M || !M.ckey) return rank = check_jobban_path(rank) - jobban_keylist[rank][M.ckey] = reason + GLOB.jobban_keylist[rank][M.ckey] = reason /proc/jobban_client_fullban(ckey, rank) if (!ckey || !rank) return rank = check_jobban_path(rank) - jobban_keylist[rank][ckey] = "Reason Unspecified" + GLOB.jobban_keylist[rank][ckey] = "Reason Unspecified" //returns a reason if M is banned from rank, returns 0 otherwise /proc/jobban_isbanned(mob/M, rank, datum/entity/player/P = null) @@ -49,17 +49,17 @@ var/jobban_keylist[0] //to store the keys & ranks /proc/jobban_loadbanfile() var/savefile/S=new("data/job_new.ban") - S["new_bans"] >> jobban_keylist + S["new_bans"] >> GLOB.jobban_keylist log_admin("Loading jobban_rank") - S["runonce"] >> jobban_runonce + S["runonce"] >> GLOB.jobban_runonce - if (!length(jobban_keylist)) - jobban_keylist=list() + if (!length(GLOB.jobban_keylist)) + GLOB.jobban_keylist=list() log_admin("jobban_keylist was empty") /proc/jobban_savebanfile() var/savefile/S=new("data/job_new.ban") - S["new_bans"] << jobban_keylist + S["new_bans"] << GLOB.jobban_keylist /proc/jobban_unban(mob/M, rank) jobban_remove("[M.ckey] - [ckey(rank)]") @@ -70,7 +70,7 @@ var/jobban_keylist[0] //to store the keys & ranks /proc/jobban_remove(X) var/regex/r1 = new("(.*) - (.*)") if(r1.Find(X)) - var/L[] = jobban_keylist[r1.group[2]] + var/L[] = GLOB.jobban_keylist[r1.group[2]] L.Remove(r1.group[1]) return 1 @@ -89,7 +89,7 @@ var/jobban_keylist[0] //to store the keys & ranks if(!M.ckey) //sanity to_chat(usr, "This mob has no ckey") return - if(!RoleAuthority) + if(!GLOB.RoleAuthority) to_chat(usr, "The Role Authority is not set up!") return @@ -109,31 +109,31 @@ var/jobban_keylist[0] //to store the keys & ranks WARNING!*/ //Regular jobs //Command (Blue) - jobs += generate_job_ban_list(M, P, ROLES_CIC, "CIC", "ddddff") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_CIC, "CIC", "ddddff") jobs += "
    " // SUPPORT - jobs += generate_job_ban_list(M, P, ROLES_AUXIL_SUPPORT, "Support", "ccccff") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_AUXIL_SUPPORT, "Support", "ccccff") jobs += "
    " // MPs - jobs += generate_job_ban_list(M, P, ROLES_POLICE, "Police", "ffdddd") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_POLICE, "Police", "ffdddd") jobs += "
    " //Engineering (Yellow) - jobs += generate_job_ban_list(M, P, ROLES_ENGINEERING, "Engineering", "fff5cc") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_ENGINEERING, "Engineering", "fff5cc") jobs += "
    " //Cargo (Yellow) //Copy paste, yada, yada. Hopefully Snail can rework this in the future. - jobs += generate_job_ban_list(M, P, ROLES_REQUISITION, "Requisition", "fff5cc") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_REQUISITION, "Requisition", "fff5cc") jobs += "
    " //Medical (White) - jobs += generate_job_ban_list(M, P, ROLES_MEDICAL, "Medical", "ffeef0") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_MEDICAL, "Medical", "ffeef0") jobs += "
    " //Marines - jobs += generate_job_ban_list(M, P, ROLES_MARINES, "Marines", "ffeeee") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_MARINES, "Marines", "ffeeee") jobs += "
    " // MISC - jobs += generate_job_ban_list(M, P, ROLES_MISC, "Misc", "aaee55") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_MISC, "Misc", "aaee55") jobs += "
    " // Xenos (Orange) - jobs += generate_job_ban_list(M, P, ROLES_XENO, "Xenos", "a268b1") + jobs += generate_job_ban_list(M, P, GLOB.ROLES_XENO, "Xenos", "a268b1") jobs += "
    " //Extra (Orange) var/isbanned_dept = jobban_isbanned(M, "Syndicate", P) diff --git a/code/modules/admin/create_mob.dm b/code/modules/admin/create_mob.dm index 644165be0fa0..9ac4c5f807ea 100644 --- a/code/modules/admin/create_mob.dm +++ b/code/modules/admin/create_mob.dm @@ -1,4 +1,5 @@ -/var/create_mob_html = null +/datum/admins/var/static/create_mob_html = null + /datum/admins/proc/create_mob(mob/user) if (!create_mob_html) var/mobjs = null diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm index 9d344a1f551c..3b1f978dd50a 100644 --- a/code/modules/admin/create_object.dm +++ b/code/modules/admin/create_object.dm @@ -1,4 +1,4 @@ -/var/create_object_html = null +/datum/admins/var/static/create_object_html = null /datum/admins/proc/create_object(mob/user) if (!create_object_html) diff --git a/code/modules/admin/create_turf.dm b/code/modules/admin/create_turf.dm index c87034ecfd9f..1535c303bcd9 100644 --- a/code/modules/admin/create_turf.dm +++ b/code/modules/admin/create_turf.dm @@ -1,4 +1,5 @@ -/var/create_turf_html = null +/datum/admins/var/static/create_turf_html = null + /datum/admins/proc/create_turf(mob/user) if (!create_turf_html) var/turfjs = null diff --git a/code/modules/admin/fax_templates.dm b/code/modules/admin/fax_templates.dm index 459ab675d3a3..2522acf92b3b 100644 --- a/code/modules/admin/fax_templates.dm +++ b/code/modules/admin/fax_templates.dm @@ -70,7 +70,7 @@ dat += "
    " dat += "

    [fax_header]

    " - dat += "

    [fax_subject] - [time2text(world.realtime, "DD Month")] [game_year]

    " + dat += "

    [fax_subject] - [time2text(world.realtime, "DD Month")] [GLOB.game_year]

    " dat += "
    " dat += "
    " diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index e7559f3aa4fd..e31d372743c5 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -1,4 +1,4 @@ -var/list/datum/admins/admin_datums = list() +GLOBAL_LIST_INIT_TYPED(admin_datums, /datum/admins, list()) GLOBAL_VAR_INIT(href_token, GenerateToken()) GLOBAL_PROTECT(href_token) @@ -35,7 +35,7 @@ GLOBAL_PROTECT(href_token) rank = initial_rank rights = initial_rights href_token = GenerateToken() - admin_datums[ckey] = src + GLOB.admin_datums[ckey] = src extra_titles = new_extra_titles // Letting admins edit their own permission giver is a poor idea @@ -138,8 +138,8 @@ you will have to do something like if(client.admin_holder.rights & R_ADMIN) your return TRUE /client/proc/readmin() - if(admin_datums[ckey]) - admin_datums[ckey].associate(src) + if(GLOB.admin_datums[ckey]) + GLOB.admin_datums[ckey].associate(src) return TRUE /datum/admins/proc/check_for_rights(rights_required) diff --git a/code/modules/admin/player_panel/actions/physical.dm b/code/modules/admin/player_panel/actions/physical.dm index a48f39e81a5e..eb43fe5d2aa8 100644 --- a/code/modules/admin/player_panel/actions/physical.dm +++ b/code/modules/admin/player_panel/actions/physical.dm @@ -90,15 +90,15 @@ if(SKILL_SPEC_SNIPER) set_name = "Sniper Set" - if(set_name && !available_specialist_sets.Find(set_name)) - available_specialist_sets += set_name + if(set_name && !GLOB.available_specialist_sets.Find(set_name)) + GLOB.available_specialist_sets += set_name S.forget_marine_in_squad(H) message_admins("[key_name_admin(user)] sent [key_name_admin(target)] ([H.job]) to cryogenics.") SSticker.mode.latejoin_tally-- //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for //Handle job slot/tater cleanup. - RoleAuthority.free_role(RoleAuthority.roles_for_mode[target.job], TRUE) + GLOB.RoleAuthority.free_role(GLOB.RoleAuthority.roles_for_mode[target.job], TRUE) //Delete them from datacore. var/target_ref = WEAKREF(target) @@ -200,7 +200,7 @@ /datum/player_action/set_squad/act(client/user, mob/living/carbon/human/target, list/params) var/list/squads = list() - for(var/datum/squad/S in RoleAuthority.squads) + for(var/datum/squad/S in GLOB.RoleAuthority.squads) squads[S.name] = S var/selected_squad = tgui_input_list(user, "Select a squad.", "Squad Selection", squads) diff --git a/code/modules/admin/player_panel/player_panel.dm b/code/modules/admin/player_panel/player_panel.dm index e29ea83ef5ce..bead55f994ab 100644 --- a/code/modules/admin/player_panel/player_panel.dm +++ b/code/modules/admin/player_panel/player_panel.dm @@ -389,7 +389,7 @@ dat += "Round Duration: [round(world.time / 36000)]:[add_zero(world.time / 600 % 60, 2)]:[world.time / 100 % 6][world.time / 100 % 10]
    " if(check_rights(R_DEBUG, 0)) - dat += "VV Shuttle Controller

    " + dat += "VV Shuttle Controller

    " if(check_rights(R_MOD, 0)) dat += "Evacuation Goals: " diff --git a/code/modules/admin/tabs/admin_tab.dm b/code/modules/admin/tabs/admin_tab.dm index e0a8c540ea85..cc927a62d3b0 100644 --- a/code/modules/admin/tabs/admin_tab.dm +++ b/code/modules/admin/tabs/admin_tab.dm @@ -97,7 +97,7 @@ if(body && !body.key) body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus if(body.client) - body.client.change_view(world_view_size) //reset view range to default. + body.client.change_view(GLOB.world_view_size) //reset view range to default. //re-open STUI if(new_STUI) @@ -383,7 +383,7 @@ set name = "Admin Verbs - Show" set category = "Admin" - add_verb(src, admin_verbs_hideable) + add_verb(src, GLOB.admin_verbs_hideable) remove_verb(src, /client/proc/enable_admin_verbs) if(!(admin_holder.rights & R_DEBUG)) @@ -396,7 +396,7 @@ set name = "Admin Verbs - Hide" set category = "Admin" - remove_verb(src, admin_verbs_hideable) + remove_verb(src, GLOB.admin_verbs_hideable) add_verb(src, /client/proc/enable_admin_verbs) /client/proc/strip_all_in_view() @@ -657,13 +657,13 @@ /proc/set_lz_resin_allowed(allowed = TRUE) if(allowed) - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.flags_area & AREA_UNWEEDABLE) continue A.is_resin_allowed = TRUE msg_admin_niche("Areas close to landing zones are now weedable.") else - for(var/area/A in all_areas) + for(var/area/A in GLOB.all_areas) if(A.flags_area & AREA_UNWEEDABLE) continue A.is_resin_allowed = initial(A.is_resin_allowed) diff --git a/code/modules/admin/tabs/debug_tab.dm b/code/modules/admin/tabs/debug_tab.dm index d8187abe3714..df11917f087a 100644 --- a/code/modules/admin/tabs/debug_tab.dm +++ b/code/modules/admin/tabs/debug_tab.dm @@ -5,7 +5,7 @@ if(!check_rights(R_DEBUG)) return - add_verb(src, debug_verbs) + add_verb(src, GLOB.debug_verbs) remove_verb(src, /client/proc/enable_debug_verbs) /client/proc/hide_debug_verbs() @@ -15,7 +15,7 @@ if(!check_rights(R_DEBUG)) return - remove_verb(src, debug_verbs) + remove_verb(src, GLOB.debug_verbs) add_verb(src, /client/proc/enable_debug_verbs) /client/proc/enter_tree() @@ -81,8 +81,8 @@ set name = "Reset Intel Data Tab" if(tgui_alert(src, "Clear the data tab?", "Confirm", list("Yes", "No"), 10 SECONDS) == "Yes") - for(var/datum/cm_objective/Objective in intel_system.oms.disks) - intel_system.oms.disks -= Objective + for(var/datum/cm_objective/Objective in GLOB.intel_system.oms.disks) + GLOB.intel_system.oms.disks -= Objective /client/proc/check_round_statistics() set category = "Debug" @@ -90,7 +90,7 @@ if(!check_rights(R_ADMIN|R_DEBUG)) return - debug_variables(round_statistics) + debug_variables(GLOB.round_statistics) /client/proc/cmd_admin_delete(atom/O as obj|mob|turf in world) set category = "Debug" @@ -165,10 +165,10 @@ set name = "Reload Whitelist" set category = "Debug" if(alert("Are you sure you want to do this?",, "Yes", "No") != "Yes") return - if(!check_rights(R_SERVER) || !RoleAuthority) return + if(!check_rights(R_SERVER) || !GLOB.RoleAuthority) return message_admins("[usr.ckey] manually reloaded the role whitelist.") - RoleAuthority.load_whitelist() + GLOB.RoleAuthority.load_whitelist() /client/proc/bulk_fetcher() set name = "Bulk Fetch Items" diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index fcc604c9cfa8..7a6359ccf090 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -275,12 +275,12 @@ var/points_to_add = tgui_input_real_number(usr, "Enter the amount of points to give, or a negative number to subtract. 1 point = $100.", "Points", 0) if(!points_to_add) return - else if((supply_controller.points + points_to_add) < 0) - supply_controller.points = 0 - else if((supply_controller.points + points_to_add) > 99999) - supply_controller.points = 99999 + else if((GLOB.supply_controller.points + points_to_add) < 0) + GLOB.supply_controller.points = 0 + else if((GLOB.supply_controller.points + points_to_add) > 99999) + GLOB.supply_controller.points = 99999 else - supply_controller.points += points_to_add + GLOB.supply_controller.points += points_to_add message_admins("[key_name_admin(usr)] granted requisitions [points_to_add] points.") @@ -294,11 +294,11 @@ if(!SSticker.mode || !check_rights(R_ADMIN)) return - var/req_heat_change = tgui_input_real_number(usr, "Set the new requisitions black market heat. ERT is called at 100, disabled at -1. Current Heat: [supply_controller.black_market_heat]", "Modify Req Heat", 0, 100, -1) + var/req_heat_change = tgui_input_real_number(usr, "Set the new requisitions black market heat. ERT is called at 100, disabled at -1. Current Heat: [GLOB.supply_controller.black_market_heat]", "Modify Req Heat", 0, 100, -1) if(!req_heat_change) return - supply_controller.black_market_heat = req_heat_change + GLOB.supply_controller.black_market_heat = req_heat_change message_admins("[key_name_admin(usr)] set requisitions heat to [req_heat_change].") @@ -433,12 +433,12 @@ return var/datum/supply_order/new_order = new() - new_order.ordernum = supply_controller.ordernum - supply_controller.ordernum++ - new_order.object = supply_controller.supply_packs[nuketype] + new_order.ordernum = GLOB.supply_controller.ordernum + GLOB.supply_controller.ordernum++ + new_order.object = GLOB.supply_controller.supply_packs[nuketype] new_order.orderedby = MAIN_AI_SYSTEM new_order.approvedby = MAIN_AI_SYSTEM - supply_controller.shoppinglist += new_order + GLOB.supply_controller.shoppinglist += new_order marine_announcement("A nuclear device has been supplied and will be delivered to requisitions via ASRS.", "NUCLEAR ARSENAL ACQUIRED", 'sound/misc/notice2.ogg') message_admins("[key_name_admin(usr)] admin-spawned a [encrypt] nuke.") @@ -507,7 +507,7 @@ if(!customname) customname = "[faction] Update" if(faction == FACTION_MARINE) - for(var/obj/structure/machinery/computer/almayer_control/C in machines) + for(var/obj/structure/machinery/computer/almayer_control/C in GLOB.machines) if(!(C.inoperable())) var/obj/item/paper/P = new /obj/item/paper( C.loc ) P.name = "'[customname].'" @@ -678,14 +678,14 @@ set name = "Mob Event Verbs - Show" set category = "Admin.Events" - add_verb(src, admin_mob_event_verbs_hideable) + add_verb(src, GLOB.admin_mob_event_verbs_hideable) remove_verb(src, /client/proc/enable_event_mob_verbs) /client/proc/hide_event_mob_verbs() set name = "Mob Event Verbs - Hide" set category = "Admin.Events" - remove_verb(src, admin_mob_event_verbs_hideable) + remove_verb(src, GLOB.admin_mob_event_verbs_hideable) add_verb(src, /client/proc/enable_event_mob_verbs) // ---------------------------- diff --git a/code/modules/admin/tabs/round_tab.dm b/code/modules/admin/tabs/round_tab.dm index 22ba96a2317a..39a9050053f1 100644 --- a/code/modules/admin/tabs/round_tab.dm +++ b/code/modules/admin/tabs/round_tab.dm @@ -38,9 +38,9 @@ return if(!(predator_round.flags_round_type & MODE_PREDATOR)) - var/datum/job/PJ = RoleAuthority.roles_for_mode[JOB_PREDATOR] + var/datum/job/PJ = GLOB.RoleAuthority.roles_for_mode[JOB_PREDATOR] if(istype(PJ) && !PJ.spawn_positions) - PJ.set_spawn_positions(players_preassigned) + PJ.set_spawn_positions(GLOB.players_preassigned) predator_round.flags_round_type |= MODE_PREDATOR else predator_round.flags_round_type &= ~MODE_PREDATOR @@ -58,8 +58,8 @@ var/roles[] = new var/i var/datum/job/J - for(i in RoleAuthority.roles_for_mode) //All the roles in the game. - J = RoleAuthority.roles_for_mode[i] + for(i in GLOB.RoleAuthority.roles_for_mode) //All the roles in the game. + J = GLOB.RoleAuthority.roles_for_mode[i] if(J.total_positions > 0 && J.current_positions > 0) roles += i @@ -67,7 +67,7 @@ var/role = input("This list contains all roles that have at least one slot taken.\nPlease select role slot to free.", "Free role slot") as null|anything in roles if(!role) return - RoleAuthority.free_role_admin(RoleAuthority.roles_for_mode[role], TRUE, src) + GLOB.RoleAuthority.free_role_admin(GLOB.RoleAuthority.roles_for_mode[role], TRUE, src) /client/proc/modify_slot() set name = "Adjust Job Slots" @@ -81,10 +81,10 @@ var/active_role_names = GLOB.gamemode_roles[GLOB.master_mode] if(!active_role_names) - active_role_names = ROLES_DISTRESS_SIGNAL + active_role_names = GLOB.ROLES_DISTRESS_SIGNAL for(var/role_name as anything in active_role_names) - var/datum/job/job = RoleAuthority.roles_by_name[role_name] + var/datum/job/job = GLOB.RoleAuthority.roles_by_name[role_name] if(!job) continue roles += role_name @@ -92,12 +92,12 @@ var/role = input("Please select role slot to modify", "Modify amount of slots") as null|anything in roles if(!role) return - J = RoleAuthority.roles_by_name[role] + J = GLOB.RoleAuthority.roles_by_name[role] var/tpos = J.spawn_positions var/num = tgui_input_number(src, "How many slots role [J.title] should have?\nCurrently taken slots: [J.current_positions]\nTotal amount of slots opened this round: [J.total_positions_so_far]","Number:", tpos) if(isnull(num)) return - if(!RoleAuthority.modify_role(J, num)) + if(!GLOB.RoleAuthority.modify_role(J, num)) to_chat(usr, SPAN_BOLDNOTICE("Can't set job slots to be less than amount of log-ins or you are setting amount of slots less than minimal. Free slots first.")) message_admins("[key_name(usr)] adjusted job slots of [J.title] to be [num].") diff --git a/code/modules/admin/tabs/server_tab.dm b/code/modules/admin/tabs/server_tab.dm index 84c9426dfa3f..382b08c182b5 100644 --- a/code/modules/admin/tabs/server_tab.dm +++ b/code/modules/admin/tabs/server_tab.dm @@ -21,8 +21,8 @@ set desc = "Players can still log into the server, but players won't be able to join the game as a new mob." set category = "Server" - enter_allowed = !enter_allowed - if(!enter_allowed) + GLOB.enter_allowed = !GLOB.enter_allowed + if(!GLOB.enter_allowed) to_world("New players may no longer join the game.") else to_world("New players may now join the game.") @@ -34,8 +34,8 @@ set desc = "Globally Toggles Deadchat" set category = "Server" - dsay_allowed = !dsay_allowed - if(dsay_allowed) + GLOB.dsay_allowed = !GLOB.dsay_allowed + if(GLOB.dsay_allowed) to_world("Deadchat has been globally enabled!") else to_world("Deadchat has been globally disabled!") @@ -46,8 +46,8 @@ set desc = "Globally Toggles OOC" set category = "Server" - ooc_allowed = !ooc_allowed - if(ooc_allowed) + GLOB.ooc_allowed = !GLOB.ooc_allowed + if(GLOB.ooc_allowed) to_world("The OOC channel has been globally enabled!") else to_world("The OOC channel has been globally disabled!") @@ -58,8 +58,8 @@ set desc = "Globally Toggles LOOC" set category = "Server" - looc_allowed = !looc_allowed - if(looc_allowed) + GLOB.looc_allowed = !GLOB.looc_allowed + if(GLOB.looc_allowed) to_world("The LOOC channel has been globally enabled!") else to_world("The LOOC channel has been globally disabled!") diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index d60377123c49..a0e9e8b787aa 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -50,7 +50,7 @@ if(task == "add") var/new_ckey = ckey(input(usr,"New admin's ckey","Admin ckey", null) as text|null) if(!new_ckey) return - if(new_ckey in admin_datums) + if(new_ckey in GLOB.admin_datums) to_chat(usr, "Error: Topic 'editrights': [new_ckey] is already an admin") return adm_ckey = new_ckey @@ -61,20 +61,20 @@ to_chat(usr, "Error: Topic 'editrights': No valid ckey") return - var/datum/admins/D = admin_datums[adm_ckey] + var/datum/admins/D = GLOB.admin_datums[adm_ckey] if(task == "remove") if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes") if(!D) return - admin_datums -= adm_ckey + GLOB.admin_datums -= adm_ckey D.disassociate() message_admins("[key_name_admin(usr)] removed [adm_ckey] from the admins list") else if(task == "rank") var/new_rank - if(admin_ranks.len) - new_rank = tgui_input_list(usr, "Please select a rank", "New rank", (admin_ranks|"*New Rank*")) + if(GLOB.admin_ranks.len) + new_rank = tgui_input_list(usr, "Please select a rank", "New rank", (GLOB.admin_ranks|"*New Rank*")) else new_rank = tgui_input_list(usr, "Please select a rank", "New rank", list("Game Master","Game Admin", "Trial Admin", "Admin Observer","*New Rank*")) @@ -91,15 +91,15 @@ to_chat(usr, "Error: Topic 'editrights': Invalid rank") return if(CONFIG_GET(flag/admin_legacy_system)) - if(admin_ranks.len) - if(new_rank in admin_ranks) - rights = admin_ranks[new_rank] //we typed a rank which already exists, use its rights + if(GLOB.admin_ranks.len) + if(new_rank in GLOB.admin_ranks) + rights = GLOB.admin_ranks[new_rank] //we typed a rank which already exists, use its rights else - admin_ranks[new_rank] = 0 //add the new rank to admin_ranks + GLOB.admin_ranks[new_rank] = 0 //add the new rank to admin_ranks else if(CONFIG_GET(flag/admin_legacy_system)) new_rank = ckeyEx(new_rank) - rights = admin_ranks[new_rank] //we input an existing rank, use its rights + rights = GLOB.admin_ranks[new_rank] //we input an existing rank, use its rights if(D) D.disassociate() //remove adminverbs and unlink from client @@ -238,31 +238,31 @@ var/reason var/banfolder = href_list["unbanupgradeperma"] - Banlist.cd = "/base/[banfolder]" - var/reason2 = Banlist["reason"] + GLOB.Banlist.cd = "/base/[banfolder]" + var/reason2 = GLOB.Banlist["reason"] - var/minutes = Banlist["minutes"] + var/minutes = GLOB.Banlist["minutes"] - var/banned_key = Banlist["key"] - Banlist.cd = "/base" + var/banned_key = GLOB.Banlist["key"] + GLOB.Banlist.cd = "/base" var/mins = 0 - if(minutes > CMinutes) - mins = minutes - CMinutes + if(minutes > GLOB.CMinutes) + mins = minutes - GLOB.CMinutes if(!mins) return mins = max(5255990,mins) // 10 years - minutes = CMinutes + mins + minutes = GLOB.CMinutes + mins reason = input(usr,"Reason?","reason",reason2) as message|null if(!reason) return ban_unban_log_save("[key_name(usr)] upgraded [banned_key]'s ban to a permaban. Reason: [sanitize(reason)]") message_admins("[key_name_admin(usr)] upgraded [banned_key]'s ban to a permaban. Reason: [sanitize(reason)]") - Banlist.cd = "/base/[banfolder]" - Banlist["reason"] << sanitize(reason) - Banlist["temp"] << 0 - Banlist["minutes"] << minutes - Banlist["bannedby"] << usr.ckey - Banlist.cd = "/base" + GLOB.Banlist.cd = "/base/[banfolder]" + GLOB.Banlist["reason"] << sanitize(reason) + GLOB.Banlist["temp"] << 0 + GLOB.Banlist["minutes"] << minutes + GLOB.Banlist["bannedby"] << usr.ckey + GLOB.Banlist.cd = "/base" unbanpanel() else if(href_list["unbane"]) @@ -272,36 +272,36 @@ var/reason var/banfolder = href_list["unbane"] - Banlist.cd = "/base/[banfolder]" - var/reason2 = Banlist["reason"] - var/temp = Banlist["temp"] + GLOB.Banlist.cd = "/base/[banfolder]" + var/reason2 = GLOB.Banlist["reason"] + var/temp = GLOB.Banlist["temp"] - var/minutes = Banlist["minutes"] + var/minutes = GLOB.Banlist["minutes"] - var/banned_key = Banlist["key"] - Banlist.cd = "/base" + var/banned_key = GLOB.Banlist["key"] + GLOB.Banlist.cd = "/base" var/duration var/mins = 0 - if(minutes > CMinutes) - mins = minutes - CMinutes + if(minutes > GLOB.CMinutes) + mins = minutes - GLOB.CMinutes mins = tgui_input_number(usr,"How long (in minutes)? \n 1440 = 1 day \n 4320 = 3 days \n 10080 = 7 days \n 43800 = 1 Month","Ban time", 1440, 262800, 1) if(!mins) return mins = min(525599,mins) - minutes = CMinutes + mins + minutes = GLOB.CMinutes + mins duration = GetExp(minutes) reason = input(usr,"Reason?","reason",reason2) as message|null if(!reason) return ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [sanitize(reason)] Duration: [duration]") message_admins("[key_name_admin(usr)] edited [banned_key]'s ban. Reason: [sanitize(reason)] Duration: [duration]") - Banlist.cd = "/base/[banfolder]" - Banlist["reason"] << sanitize(reason) - Banlist["temp"] << temp - Banlist["minutes"] << minutes - Banlist["bannedby"] << usr.ckey - Banlist.cd = "/base" + GLOB.Banlist.cd = "/base/[banfolder]" + GLOB.Banlist["reason"] << sanitize(reason) + GLOB.Banlist["temp"] << temp + GLOB.Banlist["minutes"] << minutes + GLOB.Banlist["bannedby"] << usr.ckey + GLOB.Banlist.cd = "/base" unbanpanel() /////////////////////////////////////new ban stuff @@ -320,7 +320,7 @@ alert("You cannot perform this action. You must be of a higher administrative rank!") return - if(!RoleAuthority) + if(!GLOB.RoleAuthority) to_chat(usr, "Role Authority has not been set up!") return @@ -333,23 +333,23 @@ var/list/joblist = list() switch(href_list["jobban3"]) if("CICdept") - joblist += get_job_titles_from_list(ROLES_COMMAND) + joblist += get_job_titles_from_list(GLOB.ROLES_COMMAND) if("Supportdept") - joblist += get_job_titles_from_list(ROLES_AUXIL_SUPPORT) + joblist += get_job_titles_from_list(GLOB.ROLES_AUXIL_SUPPORT) if("Policedept") - joblist += get_job_titles_from_list(ROLES_POLICE) + joblist += get_job_titles_from_list(GLOB.ROLES_POLICE) if("Engineeringdept") - joblist += get_job_titles_from_list(ROLES_ENGINEERING) + joblist += get_job_titles_from_list(GLOB.ROLES_ENGINEERING) if("Requisitiondept") - joblist += get_job_titles_from_list(ROLES_REQUISITION) + joblist += get_job_titles_from_list(GLOB.ROLES_REQUISITION) if("Medicaldept") - joblist += get_job_titles_from_list(ROLES_MEDICAL) + joblist += get_job_titles_from_list(GLOB.ROLES_MEDICAL) if("Marinesdept") - joblist += get_job_titles_from_list(ROLES_MARINES) + joblist += get_job_titles_from_list(GLOB.ROLES_MARINES) if("Miscdept") - joblist += get_job_titles_from_list(ROLES_MISC) + joblist += get_job_titles_from_list(GLOB.ROLES_MISC) if("Xenosdept") - joblist += get_job_titles_from_list(ROLES_XENO) + joblist += get_job_titles_from_list(GLOB.ROLES_XENO) else joblist += href_list["jobban3"] @@ -562,23 +562,9 @@ var/dat = {"What mode do you wish to play?
    "} for(var/mode in config.modes) dat += {"[config.mode_names[mode]]
    "} - dat += {"Now: [master_mode]"} + dat += {"Now: [GLOB.master_mode]"} show_browser(usr, dat, "Change Gamemode", "c_mode") - else if(href_list["f_secret"]) - if(!check_rights(R_ADMIN)) return - - if(SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) - if(master_mode != "secret") - return alert(usr, "The game mode has to be secret!", null, null, null, null) - var/dat = {"What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.
    "} - for(var/mode in config.modes) - dat += {"[config.mode_names[mode]]
    "} - dat += {"Random (default)
    "} - dat += {"Now: [secret_force_mode]"} - show_browser(usr, dat, "Change Secret Gamemode", "f_secret") - else if(href_list["c_mode2"]) if(!check_rights(R_ADMIN|R_SERVER)) return @@ -588,19 +574,6 @@ Game() // updates the main game menu SSticker.save_mode(GLOB.master_mode) - - else if(href_list["f_secret2"]) - if(!check_rights(R_ADMIN|R_SERVER)) return - - if(SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) - if(master_mode != "secret") - return alert(usr, "The game mode has to be secret!", null, null, null, null) - secret_force_mode = href_list["f_secret2"] - message_admins("[key_name_admin(usr)] set the forced secret mode as [secret_force_mode].") - Game() // updates the main game menu - .(href, list("f_secret"=1)) - else if(href_list["monkeyone"]) if(!check_rights(R_SPAWN)) return @@ -612,17 +585,6 @@ message_admins("[key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]") H.monkeyize() - else if(href_list["corgione"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locate(href_list["corgione"]) - if(!istype(H)) - to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human") - return - - message_admins("[key_name_admin(usr)] attempting to corgize [key_name_admin(H)]") - H.corgize() - else if(href_list["forcespeech"]) if(!check_rights(R_ADMIN)) return @@ -949,7 +911,7 @@ H.mind.transfer_to(M) else M.key = H.key - if(M.client) M.client.change_view(world_view_size) + if(M.client) M.client.change_view(GLOB.world_view_size) if(M.skills) qdel(M.skills) @@ -1044,7 +1006,7 @@ return if(alert("Are you sure you want to cancel this OB?",,"Yes","No") != "Yes") return - orbital_cannon_cancellation["[cancel_token]"] = null + GLOB.orbital_cannon_cancellation["[cancel_token]"] = null message_admins("[src.owner] has cancelled the orbital strike.") else if(href_list["admincancelpredsd"]) @@ -1208,7 +1170,7 @@ msg_ghost += "view message" announce_fax(msg_ghost = msg_ghost) - for(var/obj/structure/machinery/faxmachine/F in machines) + for(var/obj/structure/machinery/faxmachine/F in GLOB.machines) if(F == fax) if(!(F.inoperable())) @@ -1290,7 +1252,7 @@ msg_ghost += "view message" announce_fax( ,msg_ghost) - for(var/obj/structure/machinery/faxmachine/F in machines) + for(var/obj/structure/machinery/faxmachine/F in GLOB.machines) if(F == fax) if(!(F.inoperable())) @@ -1372,7 +1334,7 @@ announce_fax( ,msg_ghost) - for(var/obj/structure/machinery/faxmachine/F in machines) + for(var/obj/structure/machinery/faxmachine/F in GLOB.machines) if(F == fax) if(!(F.inoperable())) @@ -1454,7 +1416,7 @@ announce_fax( ,msg_ghost) - for(var/obj/structure/machinery/faxmachine/F in machines) + for(var/obj/structure/machinery/faxmachine/F in GLOB.machines) if(F == fax) if(!(F.inoperable())) @@ -1778,16 +1740,16 @@ //unanswered_distress -= ref_person if(href_list["distresscancel"]) - if(distress_cancel) + if(GLOB.distress_cancel) to_chat(usr, "The distress beacon was either canceled, or you are too late to cancel.") return log_game("[key_name_admin(usr)] has canceled the distress beacon.") message_admins("[key_name_admin(usr)] has canceled the distress beacon.") - distress_cancel = TRUE + GLOB.distress_cancel = TRUE return if(href_list["distress"]) //Distress Beacon, sends a random distress beacon when pressed - distress_cancel = FALSE + GLOB.distress_cancel = FALSE message_admins("[key_name_admin(usr)] has opted to SEND the distress beacon! Launching in 10 seconds... (CANCEL)") addtimer(CALLBACK(src, PROC_REF(accept_ert), usr, locate(href_list["distress"])), 10 SECONDS) //unanswered_distress -= ref_person @@ -1795,7 +1757,7 @@ if(href_list["distress_handheld"]) //Prepares to call and logs accepted handheld distress beacons var/mob/ref_person = href_list["distress_handheld"] var/ert_name = href_list["ert_name"] - distress_cancel = FALSE + GLOB.distress_cancel = FALSE message_admins("[key_name_admin(usr)] has opted to SEND [ert_name]! Launching in 10 seconds... (CANCEL)") addtimer(CALLBACK(src, PROC_REF(accept_handheld_ert), usr, ref_person, ert_name), 10 SECONDS) @@ -1806,10 +1768,10 @@ message_admins("[key_name_admin(usr)] has denied a distress beacon, requested by [key_name_admin(ref_person)]") if(href_list["destroyship"]) //Distress Beacon, sends a random distress beacon when pressed - destroy_cancel = FALSE + GLOB.destroy_cancel = FALSE message_admins("[key_name_admin(usr)] has opted to GRANT the self-destruct! Starting in 10 seconds... (CANCEL)") spawn(100) - if(distress_cancel) + if(GLOB.distress_cancel) return var/mob/ref_person = locate(href_list["destroyship"]) set_security_level(SEC_LEVEL_DELTA) @@ -1830,12 +1792,12 @@ //make ASRS order for nuke var/datum/supply_order/new_order = new() - new_order.ordernum = supply_controller.ordernum - supply_controller.ordernum++ - new_order.object = supply_controller.supply_packs[nuketype] + new_order.ordernum = GLOB.supply_controller.ordernum + GLOB.supply_controller.ordernum++ + new_order.object = GLOB.supply_controller.supply_packs[nuketype] new_order.orderedby = ref_person new_order.approvedby = "USCM High Command" - supply_controller.shoppinglist += new_order + GLOB.supply_controller.shoppinglist += new_order //Can no longer request a nuke GLOB.ares_datacore.nuke_available = FALSE @@ -1859,7 +1821,7 @@ message_admins("[key_name_admin(usr)] has denied self-destruct, requested by [key_name_admin(ref_person)]", 1) if(href_list["sdcancel"]) - if(destroy_cancel) + if(GLOB.destroy_cancel) to_chat(usr, "The self-destruct was already canceled.") return if(get_security_level() == "delta") @@ -1867,7 +1829,7 @@ return log_game("[key_name_admin(usr)] has canceled the self-destruct.") message_admins("[key_name_admin(usr)] has canceled the self-destruct.") - destroy_cancel = 1 + GLOB.destroy_cancel = TRUE return if(href_list["tag_datum"]) @@ -1975,18 +1937,18 @@ return /datum/admins/proc/accept_ert(mob/approver, mob/ref_person) - if(distress_cancel) + if(GLOB.distress_cancel) return - distress_cancel = TRUE + GLOB.distress_cancel = TRUE SSticker.mode.activate_distress() log_game("[key_name_admin(approver)] has sent a randomized distress beacon, requested by [key_name_admin(ref_person)]") message_admins("[key_name_admin(approver)] has sent a randomized distress beacon, requested by [key_name_admin(ref_person)]") ///Handles calling the ERT sent by handheld distress beacons /datum/admins/proc/accept_handheld_ert(mob/approver, mob/ref_person, ert_called) - if(distress_cancel) + if(GLOB.distress_cancel) return - distress_cancel = TRUE + GLOB.distress_cancel = TRUE SSticker.mode.get_specific_call("[ert_called]", TRUE, FALSE) log_game("[key_name_admin(approver)] has sent [ert_called], requested by [key_name_admin(ref_person)]") message_admins("[key_name_admin(approver)] has sent [ert_called], requested by [key_name_admin(ref_person)]") @@ -2000,7 +1962,7 @@ for(var/jobPos in roles) if(!jobPos) continue - var/datum/job/job = RoleAuthority.roles_by_name[jobPos] + var/datum/job/job = GLOB.RoleAuthority.roles_by_name[jobPos] if(!job) continue @@ -2022,7 +1984,7 @@ for(var/jobPos in roles) if(!jobPos) continue - var/datum/job/J = RoleAuthority.roles_by_name[jobPos] + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[jobPos] if(!J) continue temp += J.title diff --git a/code/modules/admin/topic/topic_chems.dm b/code/modules/admin/topic/topic_chems.dm index fe8af3b77d96..77e1c0c6d1b8 100644 --- a/code/modules/admin/topic/topic_chems.dm +++ b/code/modules/admin/topic/topic_chems.dm @@ -39,14 +39,14 @@ var/response = alert(usr,"Enter ID or select ID from list?",null, "Enter ID","Select from list") var/target if(response == "Select from list") - var/list/pool = chemical_reagents_list + var/list/pool = GLOB.chemical_reagents_list pool = sortAssoc(pool) target = tgui_input_list(usr,"Select the ID of the chemical reagent you wish to view:", "View reagent", pool) else if(response == "Enter ID") target = input(usr,"Enter the ID of the chemical reagent you wish to view:") if(!target) return - var/datum/reagent/R = chemical_reagents_list[target] + var/datum/reagent/R = GLOB.chemical_reagents_list[target] if(R) usr.client.debug_variables(R) else @@ -56,7 +56,7 @@ var/target = input(usr,"Enter the ID of the chemical reaction you wish to view:") if(!target) return - var/datum/chemical_reaction/R = chemical_reactions_list[target] + var/datum/chemical_reaction/R = GLOB.chemical_reactions_list[target] if(R) usr.client.debug_variables(R) log_admin("[key_name(usr)] is viewing the chemical reaction for [R].") @@ -67,7 +67,7 @@ var/target = input(usr,"Enter the ID of the chemical reaction you wish to syncronize. This is only necessary if you edited a reaction through the debugger (VV).") if(!target) return - var/datum/chemical_reaction/R = chemical_reactions_list[target] + var/datum/chemical_reaction/R = GLOB.chemical_reactions_list[target] if(R) R.add_to_filtered_list(TRUE) log_debug("[key_name(usr)] resyncronized [R.id]") @@ -77,7 +77,7 @@ return if("spawn_reagent") var/target = input(usr,"Enter the ID of the chemical reagent you wish to make:") - if(!chemical_reagents_list[target]) + if(!GLOB.chemical_reagents_list[target]) to_chat(usr,SPAN_WARNING("No reagent with this ID could been found.")) return var/volume = tgui_input_number(usr,"How much? An appropriate container will be selected.") @@ -88,18 +88,18 @@ return if("make_report") var/target = input(usr, "Enter the ID of the chemical reagent you wish to make a report of:") - if(!chemical_reagents_list[target]) + if(!GLOB.chemical_reagents_list[target]) to_chat(usr, SPAN_WARNING("No reagent with this ID could be found.")) return - var/datum/reagent/R = chemical_reagents_list[target] + var/datum/reagent/R = GLOB.chemical_reagents_list[target] R.print_report(loc = usr.loc, admin_spawned = TRUE) //For quickly generating a new chemical if("create_random_reagent") var/target = input(usr,"Enter the ID of the chemical reagent you wish to make:") if(!target) return - if(chemical_reagents_list[target]) + if(GLOB.chemical_reagents_list[target]) to_chat(usr,SPAN_WARNING("This ID is already in use.")) return var/tier = tgui_input_number(usr,"Enter the generation tier you wish. This will affect the number of properties (tier + 1), rarity of components and potential for good properties. Ought to be 1-4, max 10.", "Generation tier", 1, 10) @@ -116,41 +116,41 @@ R.generate_name() R.generate_stats() //Save our reagent - chemical_reagents_list[target] = R + GLOB.chemical_reagents_list[target] = R message_admins("[key_name_admin(usr)] has generated the reagent: [target].") var/response = alert(usr,"Do you want to do anything else?",null,"Generate associated reaction","View my reagent","Finish") while(response != "Finish") switch(response) if("Generate associated reaction") - if(chemical_reactions_list[target]) + if(GLOB.chemical_reactions_list[target]) to_chat(usr,SPAN_WARNING("This ID is already in use.")) return R.generate_assoc_recipe() - if(!chemical_reactions_list[target]) + if(!GLOB.chemical_reactions_list[target]) to_chat(usr,SPAN_WARNING("Something went wrong when saving the reaction. The associated reagent has been deleted.")) - chemical_reagents_list[target] -= R + GLOB.chemical_reagents_list[target] -= R return response = alert(usr,"Do you want to do anything else?",null,"View my reaction","View my reagent","Finish") if("View my reagent") - if(chemical_reagents_list[target]) - R = chemical_reagents_list[target] + if(GLOB.chemical_reagents_list[target]) + R = GLOB.chemical_reagents_list[target] usr.client.debug_variables(R) log_admin("[key_name(usr)] is viewing the chemical reaction for [R].") else to_chat(usr,SPAN_WARNING("No reagent with this ID could been found. Wait what? But I just... Contact a debugger.")) - chemical_reagents_list.Remove(target) - chemical_reactions_list.Remove("[target]") - chemical_reactions_filtered_list.Remove("[target]") + GLOB.chemical_reagents_list.Remove(target) + GLOB.chemical_reactions_list.Remove("[target]") + GLOB.chemical_reactions_filtered_list.Remove("[target]") return if("View my reaction") - if(chemical_reactions_list[target]) - var/datum/chemical_reaction/generated/G = chemical_reactions_list[target] + if(GLOB.chemical_reactions_list[target]) + var/datum/chemical_reaction/generated/G = GLOB.chemical_reactions_list[target] usr.client.debug_variables(G) else to_chat(usr,SPAN_WARNING("No reaction with this ID could been found. Wait what? But I just... Contact a debugger.")) - chemical_reagents_list.Remove(target) - chemical_reactions_list.Remove("[target]") - chemical_reactions_filtered_list.Remove("[target]") + GLOB.chemical_reagents_list.Remove(target) + GLOB.chemical_reactions_list.Remove("[target]") + GLOB.chemical_reactions_filtered_list.Remove("[target]") return else break @@ -165,7 +165,7 @@ var/target = input(usr,"Enter the ID of the chemical reagent you wish to make:") if(!target) return - if(chemical_reagents_list[target]) + if(GLOB.chemical_reagents_list[target]) to_chat(usr,SPAN_WARNING("This ID is already in use.")) return var/datum/reagent/generated/R = new /datum/reagent/generated @@ -190,7 +190,7 @@ response = alert(usr,"Select Input Type","Custom reagent [target]","Manual Input","Select","No more properties") if("Manual Input") var/input = input(usr,"Enter the name of the chemical property you wish to add:") - var/datum/chem_property/P = chemical_properties_list[input] + var/datum/chem_property/P = GLOB.chemical_properties_list[input] if(!P) to_chat(usr,SPAN_WARNING("Property not found, did you spell it right?")) response = "Specific property" @@ -199,7 +199,7 @@ R.insert_property(P.name,level) response = alert(usr,"Done. Add more?","Custom reagent [target]","Specific property","Specific number","No more properties") if("Select") - var/list/pool = chemical_properties_list + var/list/pool = GLOB.chemical_properties_list pool = sortAssoc(pool) var/P = tgui_input_list(usr,"Which property do you want?", "Property selection", pool) var/level = tgui_input_number(usr,"Choose the level (this is a strength modifier, ought to be between 1-8)", "strengthmod", 1) @@ -221,7 +221,7 @@ break R.generate_description() //Save our reagent - chemical_reagents_list[target] = R + GLOB.chemical_reagents_list[target] = R message_admins("[key_name_admin(usr)] has created a custom reagent: [target].") //See what we want to do last response = alert(usr,"Spawn container with reagent?","Custom reagent [target]","Yes","No, show me the reagent","No, I'm all done") @@ -233,14 +233,14 @@ spawn_reagent(target, volume) if("No, show me the reagent") - usr.client.debug_variables(chemical_reagents_list[target]) + usr.client.debug_variables(GLOB.chemical_reagents_list[target]) return //For creating a custom reaction if("create_custom_reaction") var/target = input(usr,"Enter the ID of the chemical reaction you wish to make:") if(!target) return - if(chemical_reactions_list[target]) + if(GLOB.chemical_reactions_list[target]) to_chat(usr,SPAN_WARNING("This ID is already in use.")) return var/datum/chemical_reaction/generated/R = new /datum/chemical_reaction/generated @@ -262,7 +262,7 @@ if("Select type") response = alert(usr,"Enter id manually or select from list?","Custom reaction [target]","Select from list","Manual input","Back") if("Select from list") - var/list/pool = chemical_reagents_list + var/list/pool = GLOB.chemical_reagents_list pool = sortAssoc(pool) component = tgui_input_list(usr,"Select:", "Create custom reaction", pool) if(!component) @@ -274,7 +274,7 @@ if(!component) response = "Select type" continue - if(!chemical_reagents_list[component]) + if(!GLOB.chemical_reagents_list[component]) to_chat(usr,SPAN_WARNING("ID not found. Try again.")) continue response = "Add" @@ -290,11 +290,11 @@ to_chat(usr,SPAN_WARNING("You need to add at least 3 components excluding catalysts. The reaction has not been saved.")) return //Save our reaction - chemical_reactions_list[target] = R + GLOB.chemical_reactions_list[target] = R R.add_to_filtered_list() - if(!chemical_reactions_list[target]) + if(!GLOB.chemical_reactions_list[target]) to_chat(usr,SPAN_WARNING("Something went wrong when saving the reaction.")) return - usr.client.debug_variables(chemical_reactions_list[target]) + usr.client.debug_variables(GLOB.chemical_reactions_list[target]) message_admins("[key_name_admin(usr)] has created a custom chemical reaction: [target].") return diff --git a/code/modules/admin/topic/topic_events.dm b/code/modules/admin/topic/topic_events.dm index c38f715d93bf..5e59ba4835f5 100644 --- a/code/modules/admin/topic/topic_events.dm +++ b/code/modules/admin/topic/topic_events.dm @@ -52,7 +52,7 @@ if("whiteout") if(alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No") != "Yes") return - for(var/obj/structure/machinery/light/L in machines) + for(var/obj/structure/machinery/light/L in GLOB.machines) L.fix() message_admins("[key_name_admin(usr)] fixed all lights") if("power") @@ -82,16 +82,16 @@ power_restore_ship_reactors() if("change_clearance") var/list/clearance_levels = list(0,1,2,3,4,5) - var/level = tgui_input_list(usr, "Select new clearance level:","Current level: [chemical_data.clearance_level]", clearance_levels) + var/level = tgui_input_list(usr, "Select new clearance level:","Current level: [GLOB.chemical_data.clearance_level]", clearance_levels) if(!level) return message_admins("[key_name_admin(usr)] changed research clearance level to [level].") - chemical_data.clearance_level = level + GLOB.chemical_data.clearance_level = level if("give_research_credits") var/amount = tgui_input_real_number(usr, "How many credits to add?") if(amount != 0) //can add negative numbers too! message_admins("[key_name_admin(usr)] added [amount] research credits.") - chemical_data.update_credits(amount) + GLOB.chemical_data.update_credits(amount) /datum/admins/proc/create_humans_list(href_list) if(SSticker?.current_state < GAME_STATE_PLAYING) @@ -272,7 +272,7 @@ if(!length(turfs)) return - var/caste_type = RoleAuthority.get_caste_by_text(xeno_caste) + var/caste_type = GLOB.RoleAuthority.get_caste_by_text(xeno_caste) var/list/xenos = list() var/mob/living/carbon/xenomorph/X diff --git a/code/modules/admin/topic/topic_teleports.dm b/code/modules/admin/topic/topic_teleports.dm index 38eefdb49257..8a5360169999 100644 --- a/code/modules/admin/topic/topic_teleports.dm +++ b/code/modules/admin/topic/topic_teleports.dm @@ -8,7 +8,7 @@ owner.jump_to_area(choice) if("jump_to_turf") - var/turf/choice = tgui_input_list(owner, "Pick a turf to jump to:", "Jump", turfs) + var/turf/choice = tgui_input_list(owner, "Pick a turf to jump to:", "Jump", GLOB.turfs) if(QDELETED(choice)) return diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 2806b8c3bad2..8a86d7282aa9 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -29,7 +29,7 @@ message_admins(WRAP_STAFF_LOG(usr, "jumped to area [get_area(usr)] ([usr.loc.x],[usr.loc.y],[usr.loc.z])."), usr.loc.x, usr.loc.y, usr.loc.z) -/client/proc/jump_to_turf(turf/T in turfs) +/client/proc/jump_to_turf(turf/T in GLOB.turfs) set name = "Jump to Turf" set category = null diff --git a/code/modules/admin/verbs/adminpanelgq.dm b/code/modules/admin/verbs/adminpanelgq.dm index 8ef1ed869661..82efd0906873 100644 --- a/code/modules/admin/verbs/adminpanelgq.dm +++ b/code/modules/admin/verbs/adminpanelgq.dm @@ -2,7 +2,7 @@ set name = "Call General Quarters" set category = "Admin.Ship" - if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA) + if(GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA) tgui_alert(src, "Security is already red or above, General Quarters cannot be called.", "Acknowledge!", list("ok."), 10 SECONDS) return FALSE diff --git a/code/modules/admin/verbs/autoreplace.dm b/code/modules/admin/verbs/autoreplace.dm index dc6ebb09db2c..b2fe04cfb4a3 100644 --- a/code/modules/admin/verbs/autoreplace.dm +++ b/code/modules/admin/verbs/autoreplace.dm @@ -1,4 +1,4 @@ -var/list/datum/decorator/manual/admin_runtime/admin_runtime_decorators = list() +GLOBAL_LIST_INIT_TYPED(admin_runtime_decorators, /datum/decorator/manual/admin_runtime, list()) /client/proc/set_autoreplacer() set category = "Admin.Events" @@ -30,9 +30,9 @@ var/list/datum/decorator/manual/admin_runtime/admin_runtime_decorators = list() if("No") return - admin_runtime_decorators.Add(SSdecorator.add_decorator(/datum/decorator/manual/admin_runtime, types, subtypes, field, value)) + GLOB.admin_runtime_decorators.Add(SSdecorator.add_decorator(/datum/decorator/manual/admin_runtime, types, subtypes, field, value)) - log_and_message_admins("[src] activated new decorator id: [admin_runtime_decorators.len] set for [hint_text] `[types]` for field `[field]` set value `[value]`") + log_and_message_admins("[src] activated new decorator id: [GLOB.admin_runtime_decorators.len] set for [hint_text] `[types]` for field `[field]` set value `[value]`") /client/proc/deactivate_autoreplacer() set category = "Admin.Events" @@ -47,7 +47,7 @@ var/list/datum/decorator/manual/admin_runtime/admin_runtime_decorators = list() if(!num_value) return - admin_runtime_decorators[num_value].enabled = FALSE + GLOB.admin_runtime_decorators[num_value].enabled = FALSE log_and_message_admins("[src] deactivated decorator id: [num_value]") diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index a7ee69469f1d..c776a12eb330 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -86,8 +86,8 @@ if(!SSticker.mode) to_chat(usr, "Mode not found?") - round_should_check_for_win = !round_should_check_for_win - if (round_should_check_for_win) + GLOB.round_should_check_for_win = !GLOB.round_should_check_for_win + if (GLOB.round_should_check_for_win) message_admins("[key_name(src)] enabled checking for round-end.") else message_admins("[key_name(src)] disabled checking for round-end.") @@ -333,17 +333,17 @@ individual_counts["[M.type]"]++ for(var/mob/M in SShuman.processable_human_list) individual_counts["[M.type]"]++ - for(var/obj/structure/machinery/M in processing_machines) + for(var/obj/structure/machinery/M in GLOB.processing_machines) individual_counts["[M.type]"]++ - for(var/datum/powernet/M in powernets) + for(var/datum/powernet/M in GLOB.powernets) individual_counts["[M.type]"]++ for(var/mob/M in SSmob.living_misc_mobs) individual_counts["[M.type]"]++ - for(var/datum/nanoui/M in nanomanager.processing_uis) + for(var/datum/nanoui/M in SSnano.nanomanager.processing_uis) individual_counts["[M.type]"]++ - for(var/datum/powernet/M in powernets) + for(var/datum/powernet/M in GLOB.powernets) individual_counts["[M.type]"]++ - for(var/datum/M in power_machines) + for(var/datum/M in GLOB.power_machines) individual_counts["[M.type]"]++ for(var/mob/M in GLOB.xeno_mob_list) individual_counts["[M.type]"]++ diff --git a/code/modules/admin/verbs/mob_verbs.dm b/code/modules/admin/verbs/mob_verbs.dm index 351d281e1881..abb43461c2fe 100644 --- a/code/modules/admin/verbs/mob_verbs.dm +++ b/code/modules/admin/verbs/mob_verbs.dm @@ -24,7 +24,7 @@ message_admins("[key_name_admin(usr)] modified [key_name(M)]'s ckey to [new_ckey]", 1) M.ckey = new_ckey - M.client?.change_view(world_view_size) + M.client?.change_view(GLOB.world_view_size) /client/proc/cmd_admin_changekey(mob/O in GLOB.mob_list) set name = "Change CKey" @@ -72,13 +72,13 @@ var/datum/mob_hud/H switch(hud_choice) if("Medical HUD") - H = huds[MOB_HUD_MEDICAL_ADVANCED] + H = GLOB.huds[MOB_HUD_MEDICAL_ADVANCED] if("Security HUD") - H = huds[MOB_HUD_SECURITY_ADVANCED] + H = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] if("Squad HUD") - H = huds[MOB_HUD_FACTION_OBSERVER] + H = GLOB.huds[MOB_HUD_FACTION_OBSERVER] if("Xeno Status HUD") - H = huds[MOB_HUD_XENO_STATUS] + H = GLOB.huds[MOB_HUD_XENO_STATUS] else return H.add_hud_to(M, HUD_SOURCE_ADMIN) @@ -220,7 +220,7 @@ "Narrating as [selected.name]") if(!message) return - var/list/heard = get_mobs_in_view(world_view_size, selected) + var/list/heard = get_mobs_in_view(GLOB.world_view_size, selected) switch(type) if(NARRATION_METHOD_SAY) diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 9d622fce501b..0763a0e10795 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -1,45 +1,83 @@ -/client/proc/play_web_sound() +/client/proc/play_admin_sound() set category = "Admin.Fun" - set name = "Play Internet Sound" + set name = "Play Admin Sound" if(!check_rights(R_SOUNDS)) return - var/ytdl = CONFIG_GET(string/invoke_youtubedl) - if(!ytdl) - to_chat(src, SPAN_BOLDWARNING("Youtube-dl was not configured, action unavailable"), confidential = TRUE) //Check config.txt for the INVOKE_YOUTUBEDL value + var/sound_mode = tgui_input_list(src, "Play a sound from which source?", "Select Source", list("Web", "Upload")) + if(!sound_mode) return - var/web_sound_input = input("Enter content URL (supported sites only)", "Play Internet Sound via youtube-dl") as text|null - if(!istext(web_sound_input) || !length(web_sound_input)) - return + var/list/data = list() + var/log_title = TRUE + var/web_sound_input + var/asset_name + var/must_send_assets = FALSE + var/announce_title = TRUE + + if(sound_mode == "Web") + var/ytdl = CONFIG_GET(string/invoke_youtubedl) + if(!ytdl) + to_chat(src, SPAN_BOLDWARNING("Youtube-dl was not configured, action unavailable"), confidential = TRUE) //Check config.txt for the INVOKE_YOUTUBEDL value + return - web_sound_input = trim(web_sound_input) + web_sound_input = input("Enter content URL (supported sites only)", "Play Internet Sound via youtube-dl") as text|null + if(!istext(web_sound_input) || !length(web_sound_input)) + return - if(findtext(web_sound_input, ":") && !findtext(web_sound_input, GLOB.is_http_protocol)) - to_chat(src, SPAN_WARNING("Non-http(s) URIs are not allowed.")) - to_chat(src, SPAN_WARNING("For youtube-dl shortcuts like ytsearch: please use the appropriate full url from the website.")) - return + web_sound_input = trim(web_sound_input) - var/web_sound_url = "" - var/list/music_extra_data = list() - var/title + if(findtext(web_sound_input, ":") && !findtext(web_sound_input, GLOB.is_http_protocol)) + to_chat(src, SPAN_WARNING("Non-http(s) URIs are not allowed.")) + to_chat(src, SPAN_WARNING("For youtube-dl shortcuts like ytsearch: please use the appropriate full url from the website.")) + return - var/list/output = world.shelleo("[ytdl] --geo-bypass --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height<=360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" --dump-single-json --no-playlist -- \"[shell_url_scrub(web_sound_input)]\"") - var/errorlevel = output[SHELLEO_ERRORLEVEL] - var/stdout = output[SHELLEO_STDOUT] - var/stderr = output[SHELLEO_STDERR] + var/list/output = world.shelleo("[ytdl] --geo-bypass --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height<=360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" --dump-single-json --no-playlist -- \"[shell_url_scrub(web_sound_input)]\"") + var/errorlevel = output[SHELLEO_ERRORLEVEL] + var/stdout = output[SHELLEO_STDOUT] + var/stderr = output[SHELLEO_STDERR] - if(errorlevel) - to_chat(src, SPAN_WARNING("Youtube-dl URL retrieval FAILED: [stderr]")) - return + if(errorlevel) + to_chat(src, SPAN_WARNING("Youtube-dl URL retrieval FAILED: [stderr]")) + return - var/list/data = list() - try - data = json_decode(stdout) - catch(var/exception/e) - to_chat(src, SPAN_WARNING("Youtube-dl JSON parsing FAILED: [e]: [stdout]")) - return + try + data = json_decode(stdout) + catch(var/exception/e) + to_chat(src, SPAN_WARNING("Youtube-dl JSON parsing FAILED: [e]: [stdout]")) + return + + else if(sound_mode == "Upload") + var/current_transport = CONFIG_GET(string/asset_transport) + if(!current_transport || current_transport == "simple") + if(tgui_alert(usr, "WARNING: Your server is using simple asset transport. Sounds will have to be sent directly to players, which may freeze the game for long durations. Are you SURE?", "Really play direct sound?", list("Yes", "No")) != "Yes") + return + must_send_assets = TRUE + + var/soundfile = input(usr, "Choose a sound file to play", "Upload Sound") as null|file + if(!soundfile) + return + + var/static/regex/only_extension = regex(@{"^.*\.([a-z0-9]{1,5})$"}, "gi") + var/extension = only_extension.Replace("[soundfile]", "$1") + if(!length(extension)) + to_chat(src, SPAN_WARNING("Invalid filename extension.")) + return + + var/static/playsound_notch = 1 + asset_name = "admin_sound_[playsound_notch++].[extension]" + SSassets.transport.register_asset(asset_name, soundfile) + message_admins("[key_name_admin(src)] uploaded admin sound '[soundfile]' to asset transport.") + + var/static/regex/remove_extension = regex(@{"\.[a-z0-9]+$"}, "gi") + data["title"] = remove_extension.Replace("[soundfile]", "") + data["url"] = SSassets.transport.get_asset_url(asset_name) + web_sound_input = "[soundfile]" + log_title = FALSE + var/title + var/web_sound_url = "" + var/list/music_extra_data = list() if(data["url"]) music_extra_data["link"] = data["url"] music_extra_data["title"] = data["title"] @@ -48,19 +86,28 @@ music_extra_data["start"] = data["start_time"] music_extra_data["end"] = data["end_time"] - if(web_sound_url && !findtext(web_sound_url, GLOB.is_http_protocol)) + if(!must_send_assets && web_sound_url && !findtext(web_sound_url, GLOB.is_http_protocol)) to_chat(src, SPAN_BOLDWARNING("BLOCKED: Content URL not using http(s) protocol"), confidential = TRUE) to_chat(src, SPAN_WARNING("The media provider returned a content URL that isn't using the HTTP or HTTPS protocol"), confidential = TRUE) return + switch(tgui_alert(src, "Show the name of this sound to the players?", "Sound Name", list("Yes","No","Cancel"))) + if("No") + music_extra_data["title"] = "Admin sound" + announce_title = FALSE + if("Cancel") + return + var/list/targets = list() var/list/sound_type_list = list( "Meme" = SOUND_ADMIN_MEME, "Atmospheric" = SOUND_ADMIN_ATMOSPHERIC ) - var/style = tgui_input_list(src, "Who do you want to play this to?", "Select Listeners", list("Globally", "Xenos", "Marines", "Ghosts", "All Inview", "Single Inview")) + + var/style = tgui_input_list(src, "Who do you want to play this to?", "Select Listeners", list("Globally", "Xenos", "Marines", "Ghosts", "All In View Range", "Single Mob")) var/sound_type = tgui_input_list(src, "What kind of sound is this?", "Select Sound Type", sound_type_list) sound_type = sound_type_list[sound_type] + switch(style) if("Globally") targets = GLOB.mob_list @@ -70,30 +117,40 @@ targets = GLOB.human_mob_list + GLOB.dead_mob_list if("Ghosts") targets = GLOB.observer_list + GLOB.dead_mob_list - if("All Inview") - targets = viewers(usr.client.view, src) - if("Single Inview") - var/mob/choice = tgui_input_list(src, "Select the mob to play to:","Select Mob", sortmobs()) + if("All In View Range") + var/list/atom/ranged_atoms = urange(usr.client.view, get_turf(usr)) + for(var/mob/receiver in ranged_atoms) + targets += receiver + if("Single Mob") + var/list/mob/all_mobs = sortmobs() + var/list/mob/all_client_mobs = list() + for(var/mob/mob in all_mobs) + if(mob.client) + all_client_mobs += mob + var/mob/choice = tgui_input_list(src, "Select the mob to play to:","Select Mob", all_client_mobs) if(QDELETED(choice)) return targets.Add(choice) else return - for(var/i in targets) - var/mob/M = i - var/client/client = M?.client - if((client?.prefs.toggles_sound & SOUND_INTERNET) && (client?.prefs.toggles_sound & sound_type)) + for(var/mob/mob as anything in targets) + var/client/client = mob?.client + if((client?.prefs?.toggles_sound & SOUND_MIDI) && (client?.prefs?.toggles_sound & sound_type)) + if(must_send_assets) + SSassets.transport.send_assets(client, asset_name) client?.tgui_panel?.play_music(web_sound_url, music_extra_data) + if(announce_title) + to_chat(client, SPAN_BOLDANNOUNCE("An admin played: [music_extra_data["title"]]"), confidential = TRUE) else client?.tgui_panel?.stop_music() - log_admin("[key_name(src)] played web sound: [web_sound_input] - [title] - [style]") - message_admins("[key_name_admin(src)] played web sound: [web_sound_input] - [title] - [style]") + log_admin("[key_name(src)] played admin sound: [web_sound_input] -[log_title ? " [title] -" : ""] [style]") + message_admins("[key_name_admin(src)] played admin sound: [web_sound_input] -[log_title ? " [title] -" : ""] [style]") -/client/proc/stop_web_sound() +/client/proc/stop_admin_sound() set category = "Admin.Fun" - set name = "Stop Internet Sounds" + set name = "Stop Admin Sounds" if(!check_rights(R_SOUNDS)) return @@ -105,86 +162,3 @@ log_admin("[key_name(src)] stopped the currently playing web sounds.") message_admins("[key_name_admin(src)] stopped the currently playing web sounds.") -/client/proc/play_sound(S as sound) - set category = "Admin.Fun" - set name = "Play Midi Sound" - if(!check_rights(R_SOUNDS)) - return - - var/freq = 1 - var/vol = tgui_input_number(src, "What volume would you like the sound to play at?", "Volume", 25, 100, 1) - if(!vol) - return - vol = clamp(vol, 1, 100) - - var/sound/admin_sound = new() - admin_sound.file = S - admin_sound.priority = 250 - admin_sound.channel = SOUND_CHANNEL_ADMIN_MIDI - admin_sound.frequency = freq - admin_sound.wait = 1 - admin_sound.repeat = FALSE - admin_sound.status = SOUND_STREAM - admin_sound.volume = vol - - var/showtitle = FALSE - var/res = alert(src, "Show the title of this song to the players?",, "Yes","No", "Cancel") - switch(res) - if("Yes") - showtitle = TRUE - if("Cancel") - return - - var/list/targets = list() - var/list/sound_type_list = list( - "Meme" = SOUND_ADMIN_MEME, - "Atmospheric" = SOUND_ADMIN_ATMOSPHERIC - ) - var/style = tgui_input_list(src, "Who do you want to play this to?", "Select Listeners", list("Globally", "Xenos", "Marines", "Ghosts", "All Inview", "Single Inview")) - var/sound_type = tgui_input_list(src, "What kind of sound is this?", "Select Sound Type", sound_type_list) - sound_type = sound_type_list[sound_type] - switch(style) - if("Globally") - targets = GLOB.mob_list - if("Xenos") - targets = GLOB.xeno_mob_list + GLOB.dead_mob_list - if("Marines") - targets = GLOB.human_mob_list + GLOB.dead_mob_list - if("Ghosts") - targets = GLOB.observer_list + GLOB.dead_mob_list - if("All Inview") - targets = viewers(usr.client.view, src) - if("Single Inview") - var/mob/choice = tgui_input_list(src, "Select the mob to play to:","Select Mob", sortmobs()) - if(QDELETED(choice)) - return - targets.Add(choice) - else - return - - for(var/items in targets) - var/mob/Mob = items - var/client/client = Mob?.client - if((client?.prefs.toggles_sound & SOUND_INTERNET) && (client?.prefs.toggles_sound & sound_type)) - admin_sound.volume = vol * client?.admin_music_volume - SEND_SOUND(Mob, admin_sound) - admin_sound.volume = vol - if(showtitle) - to_chat(client, SPAN_BOLDANNOUNCE("An admin played: [S]"), confidential = TRUE) - - log_admin("[key_name(src)] played midi sound [S] - [style]") - message_admins("[key_name_admin(src)] played midi sound [S] - [style]") - -/client/proc/stop_sound() - set category = "Admin.Fun" - set name = "Stop Midi Sounds" - - if(!check_rights(R_SOUNDS)) - return - - for(var/mob/M in GLOB.player_list) - if(M.client) - SEND_SOUND(M, sound(null)) - - log_admin("[key_name(src)] stopped midi sounds.") - message_admins("[key_name_admin(src)] stopped midi sounds.") diff --git a/code/modules/admin/verbs/select_equipment.dm b/code/modules/admin/verbs/select_equipment.dm index b684fc0d6f95..7e78652c5c35 100644 --- a/code/modules/admin/verbs/select_equipment.dm +++ b/code/modules/admin/verbs/select_equipment.dm @@ -5,7 +5,7 @@ alert("Invalid mob") return - var/rank_list = list("Custom", "Weyland-Yutani") + RoleAuthority.roles_by_name + var/rank_list = list("Custom", "Weyland-Yutani") + GLOB.RoleAuthority.roles_by_name var/newrank = tgui_input_list(usr, "Select new rank for [H]", "Change the mob's rank and skills", rank_list) if (!newrank) @@ -14,8 +14,8 @@ return var/obj/item/card/id/I = H.wear_id - if(RoleAuthority.roles_by_name[newrank]) - var/datum/job/J = RoleAuthority.roles_by_name[newrank] + if(GLOB.RoleAuthority.roles_by_name[newrank]) + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[newrank] H.comm_title = J.get_comm_title() H.set_skills(J.get_skills()) if(istype(I)) @@ -44,14 +44,14 @@ H.faction = FACTION_WY H.faction_group = FACTION_LIST_WY - var/newskillset = tgui_input_list(usr, "Select a skillset", "Skill Set", (list("Keep Skillset") +RoleAuthority.roles_by_name)) + var/newskillset = tgui_input_list(usr, "Select a skillset", "Skill Set", (list("Keep Skillset") +GLOB.RoleAuthority.roles_by_name)) if(!newskillset || newskillset == "Keep Skillset") return if(!H) return - var/datum/job/J = RoleAuthority.roles_by_name[newskillset] + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[newskillset] H.set_skills(J.get_skills()) if("Custom") @@ -88,14 +88,14 @@ new_faction = FACTION_NEUTRAL H.faction = new_faction - var/newskillset = tgui_input_list(usr, "Select a skillset", "Skill Set", RoleAuthority.roles_by_name) + var/newskillset = tgui_input_list(usr, "Select a skillset", "Skill Set", GLOB.RoleAuthority.roles_by_name) if(!newskillset) return if(!H) return - var/datum/job/J = RoleAuthority.roles_by_name[newskillset] + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[newskillset] H.set_skills(J.get_skills()) /client/proc/cmd_admin_dress(mob/M) diff --git a/code/modules/almayer/machinery.dm b/code/modules/almayer/machinery.dm index e72f4e7f9f52..74ce9a81eb88 100644 --- a/code/modules/almayer/machinery.dm +++ b/code/modules/almayer/machinery.dm @@ -205,7 +205,7 @@ var/obj/item/dogtag/D = I if(D.fallen_names) to_chat(user, SPAN_NOTICE("You add [D] to [src].")) - fallen_list += D.fallen_names + GLOB.fallen_list += D.fallen_names qdel(D) return TRUE else @@ -213,13 +213,13 @@ /obj/structure/prop/almayer/ship_memorial/get_examine_text(mob/user) . = ..() - if((isobserver(user) || ishuman(user)) && fallen_list) + if((isobserver(user) || ishuman(user)) && GLOB.fallen_list) var/faltext = "" - for(var/i = 1 to fallen_list.len) - if(i != fallen_list.len) - faltext += "[fallen_list[i]], " + for(var/i = 1 to GLOB.fallen_list.len) + if(i != GLOB.fallen_list.len) + faltext += "[GLOB.fallen_list[i]], " else - faltext += fallen_list[i] + faltext += GLOB.fallen_list[i] . += SPAN_NOTICE("To our fallen soldiers: [faltext].") /obj/structure/prop/almayer/particle_cannon diff --git a/code/modules/almayer/shakeship.dm b/code/modules/almayer/shakeship.dm index c3f359c9a77c..29d9b7a762f8 100644 --- a/code/modules/almayer/shakeship.dm +++ b/code/modules/almayer/shakeship.dm @@ -35,7 +35,7 @@ playsound_client(current_mob.client, 'sound/effects/bigboom3.ogg', 100) if(drop) - INVOKE_ASYNC(current_mob, TYPE_PROC_REF(/atom/movable, throw_atom), get_ranged_target_turf(current_mob, pick(cardinal), sstrength-5), pick(cardinal), sstrength) + INVOKE_ASYNC(current_mob, TYPE_PROC_REF(/atom/movable, throw_atom), get_ranged_target_turf(current_mob, pick(GLOB.cardinals), sstrength-5), pick(GLOB.cardinals), sstrength) to_chat(current_mob, SPAN_HIGHDANGER("YOU ARE THROWN AROUND VIOLENTLY AND HIT THE DECK WITH FULL FORCE!!")) if(current_mob.client && osound) diff --git a/code/modules/animations/animation_library.dm b/code/modules/animations/animation_library.dm index 2bbff8d4cfcd..d4fd8feeaf24 100644 --- a/code/modules/animations/animation_library.dm +++ b/code/modules/animations/animation_library.dm @@ -249,7 +249,7 @@ Can look good elsewhere as well.*/ var/pre_rappel_alpha = alpha alpha = 20 dir = WEST - canmove = FALSE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) var/matrix/initial_matrix = matrix() initial_matrix.Turn(45) apply_transform(initial_matrix) @@ -257,4 +257,4 @@ Can look good elsewhere as well.*/ var/matrix/reset_matrix = matrix() animate(src, 3, transform = reset_matrix, pixel_y = 0, alpha = pre_rappel_alpha, flags = ANIMATION_PARALLEL) sleep(3) - canmove = TRUE + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 05ad7c5a87c7..929e2d6af7b2 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -137,7 +137,7 @@ /obj/item/device/assembly/infra/Topic(href, href_list) ..() - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "infra") return diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm index fbb9e5d06ac1..cb9bb98d339d 100644 --- a/code/modules/asset_cache/asset_list_items.dm +++ b/code/modules/asset_cache/asset_list_items.dm @@ -286,7 +286,7 @@ list("SL", "hudsquad_leader"), ) - for(var/datum/squad/marine/squad in RoleAuthority.squads) + for(var/datum/squad/marine/squad in GLOB.RoleAuthority.squads) var/color = squad.equipment_color for(var/iref in icon_data) var/list/iconref = iref diff --git a/code/modules/buildmode/submodes/variable_edit.dm b/code/modules/buildmode/submodes/variable_edit.dm index da4620b157a6..7517012583da 100644 --- a/code/modules/buildmode/submodes/variable_edit.dm +++ b/code/modules/buildmode/submodes/variable_edit.dm @@ -44,7 +44,7 @@ if(TYPE_OBJ_REFERENCE) selected_value = input(usr,"Enter variable value:" ,"Value") as obj in world if(TYPE_TURF_REFERENCE) - selected_value = input(usr,"Enter variable value:" ,"Value") as turf in turfs + selected_value = input(usr,"Enter variable value:" ,"Value") as turf in GLOB.turfs #undef TYPE_TEXT #undef TYPE_NUMBER diff --git a/code/modules/clans/client.dm b/code/modules/clans/client.dm index d1f403c08300..c46adf89711a 100644 --- a/code/modules/clans/client.dm +++ b/code/modules/clans/client.dm @@ -5,12 +5,12 @@ set waitfor = FALSE . = ..() - if(RoleAuthority && (RoleAuthority.roles_whitelist[ckey] & WHITELIST_PREDATOR)) + if(GLOB.RoleAuthority && (GLOB.RoleAuthority.roles_whitelist[ckey] & WHITELIST_PREDATOR)) clan_info = GET_CLAN_PLAYER(player.id) clan_info.sync() - if(RoleAuthority.roles_whitelist[ckey] & WHITELIST_YAUTJA_LEADER) - clan_info.clan_rank = clan_ranks_ordered[CLAN_RANK_ADMIN] + if(GLOB.RoleAuthority.roles_whitelist[ckey] & WHITELIST_YAUTJA_LEADER) + clan_info.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_ADMIN] clan_info.permissions |= CLAN_PERMISSION_ALL else clan_info.permissions &= ~CLAN_PERMISSION_ADMIN_MANAGER // Only the leader can manage the ancients @@ -157,7 +157,7 @@ var/list/player = list( player_id = CP.player_id, name = CP.ckey, - rank = clan_ranks[CP.clan_rank], // rank_to_give not used here, because we need to get their visual rank, not their position + rank = GLOB.clan_ranks[CP.clan_rank], // rank_to_give not used here, because we need to get their visual rank, not their position rank_pos = rank_to_give, honor = (CP.honor? CP.honor : 0) ) @@ -166,7 +166,7 @@ data["clan_keys"] = clan_members - var/datum/nanoui/ui = nanomanager.try_update_ui(mob, mob, "clan_status_ui", null, data) + var/datum/nanoui/ui = SSnano.nanomanager.try_update_ui(mob, mob, "clan_status_ui", null, data) if(!ui) ui = new(mob, mob, "clan_status_ui", "clan_menu.tmpl", "Clan Menu", 550, 500) ui.set_initial_data(data) @@ -295,8 +295,8 @@ pl.sync() pl.clan_id = null - pl.permissions = clan_ranks[CLAN_RANK_UNBLOODED].permissions - pl.clan_rank = clan_ranks_ordered[CLAN_RANK_UNBLOODED] + pl.permissions = GLOB.clan_ranks[CLAN_RANK_UNBLOODED].permissions + pl.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_UNBLOODED] pl.save() @@ -377,16 +377,16 @@ if(input == "Remove from clan" && target.clan_id) target.clan_id = null - target.clan_rank = clan_ranks_ordered[CLAN_RANK_YOUNG] + target.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_YOUNG] to_chat(src, SPAN_NOTICE("Removed [player_name] from their clan.")) log_and_message_admins("[key_name_admin(src)] has removed [player_name] from their current clan.") else if(input == "Remove from Ancient") - target.clan_rank = clan_ranks_ordered[CLAN_RANK_YOUNG] - target.permissions = clan_ranks[CLAN_RANK_YOUNG].permissions + target.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_YOUNG] + target.permissions = GLOB.clan_ranks[CLAN_RANK_YOUNG].permissions to_chat(src, SPAN_NOTICE("Removed [player_name] from ancient.")) log_and_message_admins("[key_name_admin(src)] has removed [player_name] from ancient.") else if(input == "Make Ancient" && is_clan_manager) - target.clan_rank = clan_ranks_ordered[CLAN_RANK_ADMIN] + target.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_ADMIN] target.permissions = CLAN_PERMISSION_ADMIN_ANCIENT to_chat(src, SPAN_NOTICE("Made [player_name] an ancient.")) log_and_message_admins("[key_name_admin(src)] has made [player_name] an ancient.") @@ -397,15 +397,15 @@ target.clan_id = clans[input] if(!(target.permissions & CLAN_PERMISSION_ADMIN_ANCIENT)) - target.permissions = clan_ranks[CLAN_RANK_BLOODED].permissions - target.clan_rank = clan_ranks_ordered[CLAN_RANK_BLOODED] + target.permissions = GLOB.clan_ranks[CLAN_RANK_BLOODED].permissions + target.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_BLOODED] if(CLAN_ACTION_PLAYER_MODIFYRANK) if(!target.clan_id) to_chat(src, SPAN_WARNING("This player doesn't belong to a clan!")) return - var/list/datum/yautja_rank/ranks = clan_ranks.Copy() + var/list/datum/yautja_rank/ranks = GLOB.clan_ranks.Copy() ranks -= CLAN_RANK_ADMIN // Admin rank should not and cannot be obtained from here var/datum/yautja_rank/chosen_rank @@ -430,7 +430,7 @@ chosen_rank = ranks[input] if(chosen_rank.limit_type) - var/list/datum/view_record/clan_playerbase_view/CPV = DB_VIEW(/datum/view_record/clan_playerbase_view/, DB_AND(DB_COMP("clan_id", DB_EQUALS, target.clan_id), DB_COMP("rank", DB_EQUALS, clan_ranks_ordered[input]))) + var/list/datum/view_record/clan_playerbase_view/CPV = DB_VIEW(/datum/view_record/clan_playerbase_view/, DB_AND(DB_COMP("clan_id", DB_EQUALS, target.clan_id), DB_COMP("rank", DB_EQUALS, GLOB.clan_ranks_ordered[input]))) var/players_in_rank = CPV.len switch(chosen_rank.limit_type) @@ -453,7 +453,7 @@ if(!has_clan_permission(chosen_rank.permission_required)) // Double check return - target.clan_rank = clan_ranks_ordered[chosen_rank.name] + target.clan_rank = GLOB.clan_ranks_ordered[chosen_rank.name] target.permissions = chosen_rank.permissions log_and_message_admins("[key_name_admin(src)] has set the rank of [player_name] to [chosen_rank.name] for their clan.") to_chat(src, SPAN_NOTICE("Set [player_name]'s rank to [chosen_rank.name]")) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 7811a6c9cb5a..e1dbd1f026c1 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -318,20 +318,20 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( if(isnull(address) || (address in localhost_addresses)) var/datum/admins/admin = new("!localhost!", RL_HOST, ckey) admin.associate(src) - RoleAuthority.roles_whitelist[ckey] = WHITELIST_EVERYTHING + GLOB.RoleAuthority.roles_whitelist[ckey] = WHITELIST_EVERYTHING //Admin Authorisation - admin_holder = admin_datums[ckey] + admin_holder = GLOB.admin_datums[ckey] if(admin_holder) admin_holder.associate(src) notify_login() add_pref_verbs() //preferences datum - also holds some persistent data for the client (because we may as well keep these datums to a minimum) - prefs = preferences_datums[ckey] + prefs = GLOB.preferences_datums[ckey] if(QDELETED(prefs) || !istype(prefs)) prefs = new /datum/preferences(src) - preferences_datums[ckey] = prefs + GLOB.preferences_datums[ckey] = prefs prefs.client_reconnected(src) prefs.last_ip = address //these are gonna be used for banning prefs.last_id = computer_id //these are gonna be used for banning @@ -351,7 +351,7 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( player_details.byond_version = full_version GLOB.player_details[ckey] = player_details - view = world_view_size + view = GLOB.world_view_size . = ..() //calls mob.Login() if(SSinput.initialized) @@ -405,10 +405,6 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( CEI = GLOB.custom_event_info_list[mob.faction] CEI.show_player_event_info(src) - if( (world.address == address || !address) && !host ) - host = key - world.update_status() - connection_time = world.time winset(src, null, "command=\".configure graphics-hwmode on\"") @@ -442,7 +438,7 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( load_player_data() - view = world_view_size + view = GLOB.world_view_size SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CLIENT_LOGIN, src) @@ -534,17 +530,17 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( /proc/setup_player_entity(ckey) if(!ckey) return - if(player_entities["[ckey]"]) - return player_entities["[ckey]"] + if(GLOB.player_entities["[ckey]"]) + return GLOB.player_entities["[ckey]"] var/datum/entity/player_entity/P = new() P.ckey = ckey P.name = ckey - player_entities["[ckey]"] = P + GLOB.player_entities["[ckey]"] = P // P.setup_save(ckey) return P /proc/save_player_entities() - for(var/key_ref in player_entities) + for(var/key_ref in GLOB.player_entities) // var/datum/entity/player_entity/P = player_entities["[key_ref]"] // P.save_statistics() log_debug("STATISTICS: Statistics saving complete.") diff --git a/code/modules/client/country_flags.dm b/code/modules/client/country_flags.dm index 7d49bf836977..4955c446aea1 100644 --- a/code/modules/client/country_flags.dm +++ b/code/modules/client/country_flags.dm @@ -26,10 +26,10 @@ else //null response, ratelimited most likely. Try again in 60s addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(ip2country), ipaddr, origin), 60 SECONDS) -var/list/countries = icon_states('icons/flags.dmi') +GLOBAL_LIST_INIT(countries, icon_states('icons/flags.dmi')) /proc/country2chaticon(country_code, targets) - if(countries.Find(country_code)) + if(GLOB.countries.Find(country_code)) return "[icon2html('icons/flags.dmi', targets, country_code)]" else return "[icon2html('icons/flags.dmi', targets, "unknown")]" diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 04b82628e3c6..6c52b497f9a3 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -7,7 +7,7 @@ #define MENU_SETTINGS "settings" #define MENU_SPECIAL "special" -var/list/preferences_datums = list() +GLOBAL_LIST_EMPTY(preferences_datums) GLOBAL_LIST_INIT(stylesheets, list( "Modern" = "common.css", @@ -21,7 +21,7 @@ GLOBAL_LIST_INIT(bgstate_options, list( "whitefull" )) -var/const/MAX_SAVE_SLOTS = 10 +#define MAX_SAVE_SLOTS 10 /datum/preferences var/client/owner @@ -306,13 +306,13 @@ var/const/MAX_SAVE_SLOTS = 10 dat += "
    " dat += "Human - " dat += "Xenomorph - " - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_COMMANDER) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_COMMANDER) dat += "Commanding Officer - " - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_SYNTHETIC) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_SYNTHETIC) dat += "Synthetic - " - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_PREDATOR) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_PREDATOR) dat += "Yautja - " - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_MENTOR) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_MENTOR) dat += "Mentor - " dat += "Settings - " dat += "Special Roles" @@ -382,7 +382,7 @@ var/const/MAX_SAVE_SLOTS = 10 dat += "Underwear: [underwear]
    " dat += "Undershirt: [undershirt]
    " - dat += "Backpack Type: [backbaglist[backbag]]
    " + dat += "Backpack Type: [GLOB.backbaglist[backbag]]
    " dat += "Preferred Armor: [preferred_armor]
    " @@ -398,7 +398,7 @@ var/const/MAX_SAVE_SLOTS = 10 if(length(gear)) dat += "
    " for(var/i = 1; i <= gear.len; i++) - var/datum/gear/G = gear_datums_by_name[gear[i]] + var/datum/gear/G = GLOB.gear_datums_by_name[gear[i]] if(G) total_cost += G.cost dat += "[gear[i]] ([G.cost] points) Remove
    " @@ -482,7 +482,7 @@ var/const/MAX_SAVE_SLOTS = 10 n++ if(MENU_CO) - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_COMMANDER) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_COMMANDER) dat += "
    " dat += "

    Commander Settings:

    " dat += "Commander Whitelist Status: [commander_status]
    " @@ -492,7 +492,7 @@ var/const/MAX_SAVE_SLOTS = 10 else dat += "You do not have the whitelist for this role." if(MENU_SYNTHETIC) - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_SYNTHETIC) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_SYNTHETIC) dat += "
    " dat += "

    Synthetic Settings:

    " dat += "Synthetic Name: [synthetic_name]
    " @@ -502,7 +502,7 @@ var/const/MAX_SAVE_SLOTS = 10 else dat += "You do not have the whitelist for this role." if(MENU_YAUTJA) - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_PREDATOR) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_PREDATOR) dat += "
    " dat += "

    Yautja Information:

    " dat += "Yautja Name: [predator_name]
    " @@ -516,7 +516,7 @@ var/const/MAX_SAVE_SLOTS = 10 dat += "
    " dat += "

    Equipment Setup:

    " - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_YAUTJA_LEGACY) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_YAUTJA_LEGACY) dat += "Legacy Gear: [predator_use_legacy]
    " dat += "Translator Type: [predator_translator_type]
    " dat += "Mask Style: ([predator_mask_type])
    " @@ -540,7 +540,7 @@ var/const/MAX_SAVE_SLOTS = 10 else dat += "You do not have the whitelist for this role." if(MENU_MENTOR) - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_MENTOR) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_MENTOR) dat += "Nothing here. For now." else dat += "You do not have the whitelist for this role." @@ -586,8 +586,7 @@ var/const/MAX_SAVE_SLOTS = 10 dat += "Tooltips: [tooltips ? "Enabled" : "Disabled"]
    " dat += "tgui Window Mode: [(tgui_fancy) ? "Fancy (default)" : "Compatible (slower)"]
    " dat += "tgui Window Placement: [(tgui_lock) ? "Primary monitor" : "Free (default)"]
    " - dat += "Play Admin Midis: [(toggles_sound & SOUND_MIDI) ? "Yes" : "No"]
    " - dat += "Play Admin Internet Sounds: [(toggles_sound & SOUND_INTERNET) ? "Yes" : "No"]
    " + dat += "Play Admin Sounds: [(toggles_sound & SOUND_MIDI) ? "Yes" : "No"]
    " dat += "Toggle Meme or Atmospheric Sounds: Toggle
    " dat += "Set Eye Blur Type: Set
    " dat += "Play Lobby Music: [(toggles_sound & SOUND_LOBBY) ? "Yes" : "No"]
    " @@ -634,7 +633,7 @@ var/const/MAX_SAVE_SLOTS = 10 dat += "Spawn as Engineer: [toggles_ert & PLAY_ENGINEER ? "Yes" : "No"]
    " dat += "Spawn as Specialist: [toggles_ert & PLAY_HEAVY ? "Yes" : "No"]
    " dat += "Spawn as Smartgunner: [toggles_ert & PLAY_SMARTGUNNER ? "Yes" : "No"]
    " - if(RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_SYNTHETIC) + if(GLOB.RoleAuthority.roles_whitelist[user.ckey] & WHITELIST_SYNTHETIC) dat += "Spawn as Synth: [toggles_ert & PLAY_SYNTH ? "Yes" : "No"]
    " dat += "Spawn as Miscellaneous: [toggles_ert & PLAY_MISC ? "Yes" : "No"]
    " dat += "
    " @@ -650,7 +649,7 @@ var/const/MAX_SAVE_SLOTS = 10 //width - Screen' width. Defaults to 550 to make it look nice. //height - Screen's height. Defaults to 500 to make it look nice. /datum/preferences/proc/SetChoices(mob/user, limit = 19, list/splitJobs = list(JOB_CHIEF_REQUISITION), width = 950, height = 700) - if(!RoleAuthority) + if(!GLOB.RoleAuthority) return var/HTML = "" @@ -665,10 +664,10 @@ var/const/MAX_SAVE_SLOTS = 10 var/list/active_role_names = GLOB.gamemode_roles[GLOB.master_mode] if(!active_role_names) - active_role_names = ROLES_DISTRESS_SIGNAL + active_role_names = GLOB.ROLES_DISTRESS_SIGNAL for(var/role_name as anything in active_role_names) - var/datum/job/job = RoleAuthority.roles_by_name[role_name] + var/datum/job/job = GLOB.RoleAuthority.roles_by_name[role_name] if(!job) debug_log("Missing job for prefs: [role_name]") continue @@ -682,7 +681,7 @@ var/const/MAX_SAVE_SLOTS = 10 if(jobban_isbanned(user, job.title)) HTML += "[job.disp_title]
    " continue - else if(job.flags_startup_parameters & ROLE_WHITELISTED && !(RoleAuthority.roles_whitelist[user.ckey] & job.flags_whitelist)) + else if(job.flags_startup_parameters & ROLE_WHITELISTED && !(GLOB.RoleAuthority.roles_whitelist[user.ckey] & job.flags_whitelist)) HTML += "[job.disp_title]" continue else if(!job.can_play_role(user.client)) @@ -763,7 +762,7 @@ var/const/MAX_SAVE_SLOTS = 10 //width - Screen' width. Defaults to 550 to make it look nice. //height - Screen's height. Defaults to 500 to make it look nice. /datum/preferences/proc/set_job_slots(mob/user, limit = 19, list/splitJobs = list(JOB_CHIEF_REQUISITION), width = 950, height = 700) - if(!RoleAuthority) + if(!GLOB.RoleAuthority) return var/HTML = "" @@ -778,10 +777,10 @@ var/const/MAX_SAVE_SLOTS = 10 var/list/active_role_names = GLOB.gamemode_roles[GLOB.master_mode] if(!active_role_names) - active_role_names = ROLES_DISTRESS_SIGNAL + active_role_names = GLOB.ROLES_DISTRESS_SIGNAL for(var/role_name as anything in active_role_names) - var/datum/job/job = RoleAuthority.roles_by_name[role_name] + var/datum/job/job = GLOB.RoleAuthority.roles_by_name[role_name] if(!job) debug_log("Missing job for prefs: [role_name]") continue @@ -794,7 +793,7 @@ var/const/MAX_SAVE_SLOTS = 10 if(jobban_isbanned(user, job.title)) HTML += "[job.disp_title]" continue - else if(job.flags_startup_parameters & ROLE_WHITELISTED && !(RoleAuthority.roles_whitelist[user.ckey] & job.flags_whitelist)) + else if(job.flags_startup_parameters & ROLE_WHITELISTED && !(GLOB.RoleAuthority.roles_whitelist[user.ckey] & job.flags_whitelist)) HTML += "[job.disp_title]" continue else if(!job.can_play_role(user.client)) @@ -874,7 +873,7 @@ var/const/MAX_SAVE_SLOTS = 10 return /datum/preferences/proc/SetJob(mob/user, role, priority) - var/datum/job/job = RoleAuthority.roles_by_name[role] + var/datum/job/job = GLOB.RoleAuthority.roles_by_name[role] if(!job) close_browser(user, "mob_occupation") ShowChoices(user) @@ -891,12 +890,12 @@ var/const/MAX_SAVE_SLOTS = 10 job_preference_list[job] = NEVER_PRIORITY return - if(!RoleAuthority) + if(!GLOB.RoleAuthority) return job_preference_list = list() - for(var/role in RoleAuthority.roles_by_path) - var/datum/job/J = RoleAuthority.roles_by_path[role] + for(var/role in GLOB.RoleAuthority.roles_by_path) + var/datum/job/J = GLOB.RoleAuthority.roles_by_path[role] job_preference_list[J.title] = NEVER_PRIORITY /datum/preferences/proc/get_job_priority(J) @@ -955,12 +954,12 @@ var/const/MAX_SAVE_SLOTS = 10 /datum/preferences/proc/reset_job_slots() pref_job_slots = list() var/datum/job/J - for(var/role in RoleAuthority.roles_by_path) - J = RoleAuthority.roles_by_path[role] + for(var/role in GLOB.RoleAuthority.roles_by_path) + J = GLOB.RoleAuthority.roles_by_path[role] pref_job_slots[J.title] = JOB_SLOT_CURRENT_SLOT /datum/preferences/proc/process_link(mob/user, list/href_list) - var/whitelist_flags = RoleAuthority.roles_whitelist[user.ckey] + var/whitelist_flags = GLOB.RoleAuthority.roles_whitelist[user.ckey] switch(href_list["preference"]) if("job") @@ -1007,10 +1006,10 @@ var/const/MAX_SAVE_SLOTS = 10 if("loadout") switch(href_list["task"]) if("input") - var/gear_category = tgui_input_list(user, "Select gear category: ", "Gear to add", gear_datums_by_category) + var/gear_category = tgui_input_list(user, "Select gear category: ", "Gear to add", GLOB.gear_datums_by_category) if(!gear_category) return - var/choice = tgui_input_list(user, "Select gear to add: ", gear_category, gear_datums_by_category[gear_category]) + var/choice = tgui_input_list(user, "Select gear to add: ", gear_category, GLOB.gear_datums_by_category[gear_category]) if(!choice) return @@ -1020,10 +1019,10 @@ var/const/MAX_SAVE_SLOTS = 10 gear = list() if(gear.len) for(var/gear_name in gear) - G = gear_datums_by_name[gear_name] + G = GLOB.gear_datums_by_name[gear_name] total_cost += G?.cost - G = gear_datums_by_category[gear_category][choice] + G = GLOB.gear_datums_by_category[gear_category][choice] total_cost += G.cost if(total_cost <= MAX_GEAR_COST) gear += G.display_name @@ -1283,8 +1282,8 @@ var/const/MAX_SAVE_SLOTS = 10 return predator_caster_material = new_pred_caster_mat if("pred_cape_type") - var/datum/job/J = RoleAuthority.roles_by_name[JOB_PREDATOR] - var/whitelist_status = clan_ranks_ordered[J.get_whitelist_status(RoleAuthority.roles_whitelist, owner)] + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[JOB_PREDATOR] + var/whitelist_status = GLOB.clan_ranks_ordered[J.get_whitelist_status(GLOB.RoleAuthority.roles_whitelist, owner)] var/list/options = list("None" = "None") for(var/cape_name in GLOB.all_yautja_capes) @@ -1603,9 +1602,9 @@ var/const/MAX_SAVE_SLOTS = 10 ooccolor = new_ooccolor if("bag") - var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in backbaglist + var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in GLOB.backbaglist if(new_backbag) - backbag = backbaglist.Find(new_backbag) + backbag = GLOB.backbaglist.Find(new_backbag) if("nt_relation") var/new_relation = input(user, "Choose your relation to the Weyland-Yutani company. Note that this represents what others can find out about your character by researching your background, not what your character actually thinks.", "Character Preference") as null|anything in list("Loyal", "Supportive", "Neutral", "Skeptical", "Opposed") @@ -1621,6 +1620,8 @@ var/const/MAX_SAVE_SLOTS = 10 var/new_pref_armor = tgui_input_list(user, "Choose your character's default style of armor:", "Character Preferences", GLOB.armor_style_list) if(new_pref_armor) preferred_armor = new_pref_armor + // Update the dummy with the new armor style. + update_preview_icon() if("limbs") var/limb_name = tgui_input_list(user, "Which limb do you want to change?", list("Left Leg","Right Leg","Left Arm","Right Arm","Left Foot","Right Foot","Left Hand","Right Hand")) @@ -1706,7 +1707,7 @@ var/const/MAX_SAVE_SLOTS = 10 origin = choice if("religion") - var/choice = tgui_input_list(user, "Please choose a religion.", "Religion choice", religion_choices + "Other") + var/choice = tgui_input_list(user, "Please choose a religion.", "Religion choice", GLOB.religion_choices + "Other") if(!choice) return if(choice == "Other") @@ -1717,7 +1718,7 @@ var/const/MAX_SAVE_SLOTS = 10 religion = choice if("special_job_select") - var/datum/job/job = RoleAuthority.roles_by_name[href_list["text"]] + var/datum/job/job = GLOB.RoleAuthority.roles_by_name[href_list["text"]] if(!job) close_browser(user, "mob_occupation") ShowChoices(user) @@ -1807,11 +1808,10 @@ var/const/MAX_SAVE_SLOTS = 10 if("rand_body") be_random_body = !be_random_body - if("hear_midis") + if("hear_admin_sounds") toggles_sound ^= SOUND_MIDI - - if("hear_internet") - toggles_sound ^= SOUND_INTERNET + if(!(toggles_sound & SOUND_MIDI)) + user?.client?.tgui_panel?.stop_music() if("lobby_music") toggles_sound ^= SOUND_LOBBY @@ -2006,9 +2006,9 @@ var/const/MAX_SAVE_SLOTS = 10 var/firstspace = findtext(real_name, " ") var/name_length = length(real_name) if(!firstspace) //we need a surname - real_name += " [pick(last_names)]" + real_name += " [pick(GLOB.last_names)]" else if(firstspace == name_length) - real_name += "[pick(last_names)]" + real_name += "[pick(GLOB.last_names)]" character.real_name = real_name character.voice = real_name @@ -2209,7 +2209,7 @@ var/const/MAX_SAVE_SLOTS = 10 if (key in key_mod_buf) return - if (key in key_mods) + if (key in GLOB.key_mods) key_mod_buf.Add(key) /datum/preferences/proc/set_key_buf(client/source, key) diff --git a/code/modules/client/preferences_factions.dm b/code/modules/client/preferences_factions.dm index 6f10f9dc1df5..42041d846787 100644 --- a/code/modules/client/preferences_factions.dm +++ b/code/modules/client/preferences_factions.dm @@ -1,4 +1,4 @@ -var/global/list/religion_choices = list( +GLOBAL_LIST_INIT(religion_choices, list( RELIGION_PROTESTANT, RELIGION_CATHOLIC, RELIGION_ORTHODOX, @@ -16,4 +16,4 @@ var/global/list/religion_choices = list( RELIGION_MINOR, RELIGION_ATHEISM, RELIGION_AGNOSTICISM - ) + )) diff --git a/code/modules/client/preferences_gear.dm b/code/modules/client/preferences_gear.dm index 4b937b0135b3..8a46e60956db 100644 --- a/code/modules/client/preferences_gear.dm +++ b/code/modules/client/preferences_gear.dm @@ -1,5 +1,5 @@ -var/global/list/gear_datums_by_category = list() -var/global/list/gear_datums_by_name = list() +GLOBAL_LIST_EMPTY(gear_datums_by_category) +GLOBAL_LIST_EMPTY(gear_datums_by_name) /proc/populate_gear_list() var/datum/gear/G @@ -10,11 +10,11 @@ var/global/list/gear_datums_by_name = list() if(!G.category) log_debug("Improper gear datum: [gear_type].") continue - if(G.display_name in gear_datums_by_name) + if(G.display_name in GLOB.gear_datums_by_name) log_debug("Duplicate gear datum name: [G.display_name].") continue - LAZYSET(gear_datums_by_category[G.category], "[G.display_name] [G.cost == 1 ? "(1 point)" : "([G.cost] points)"]", G) - gear_datums_by_name[G.display_name] = G + LAZYSET(GLOB.gear_datums_by_category[G.category], "[G.display_name] [G.cost == 1 ? "(1 point)" : "([G.cost] points)"]", G) + GLOB.gear_datums_by_name[G.display_name] = G /datum/gear var/display_name // Name/index. @@ -161,6 +161,18 @@ var/global/list/gear_datums_by_name = list() display_name = "USCM balaclava, tan" path = /obj/item/clothing/mask/rebreather/scarf/tan +/datum/gear/skull_balaclava_blue + display_name = "Blue Skull Balaclava" + path = /obj/item/clothing/mask/rebreather/skull + cost = 4 //same as skull facepaint + slot = WEAR_FACE + +/datum/gear/skull_balaclava_black + display_name = "Black Skull Balaclava" + path = /obj/item/clothing/mask/rebreather/skull/black + cost = 4 + slot = WEAR_FACE + /datum/gear/headwear category = "Headwear" cost = 3 @@ -350,7 +362,7 @@ var/global/list/gear_datums_by_name = list() path = /obj/item/prop/helmetgarb/trimmed_wire /datum/gear/helmet_garb/bullet_pipe - display_name = "10x99mm XM42B casing pipe" + display_name = "10x99mm XM43E1 casing pipe" path = /obj/item/prop/helmetgarb/bullet_pipe allowed_origins = USCM_ORIGINS @@ -876,6 +888,11 @@ var/global/list/gear_datums_by_name = list() display_name = "Facepaint, black" path = /obj/item/facepaint/black +/datum/gear/skullfacepaint + display_name = "Skull Facepaint" + path = /obj/item/facepaint/skull + cost = 3 + /datum/gear/misc/facepaint_body display_name = "Fullbody paint" path = /obj/item/facepaint/sniper diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index c885e9b73af1..e80e5bd8c5ba 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -11,8 +11,8 @@ //if a file was updated, return 1 /datum/preferences/proc/savefile_update(savefile/S) if(!isnum(savefile_version) || savefile_version < SAVEFILE_VERSION_MIN) //lazily delete everything + additional files so they can be saved in the new format - for(var/ckey in preferences_datums) - var/datum/preferences/D = preferences_datums[ckey] + for(var/ckey in GLOB.preferences_datums) + var/datum/preferences/D = GLOB.preferences_datums[ckey] if(D == src) var/delpath = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/" if(delpath && fexists(delpath)) @@ -261,11 +261,11 @@ predator_h_style = sanitize_inlist(predator_h_style, GLOB.yautja_hair_styles_list, initial(predator_h_style)) predator_skin_color = sanitize_inlist(predator_skin_color, PRED_SKIN_COLOR, initial(predator_skin_color)) predator_flavor_text = predator_flavor_text ? sanitize_text(predator_flavor_text, initial(predator_flavor_text)) : initial(predator_flavor_text) - commander_status = sanitize_inlist(commander_status, whitelist_hierarchy, initial(commander_status)) + commander_status = sanitize_inlist(commander_status, GLOB.whitelist_hierarchy, initial(commander_status)) commander_sidearm = sanitize_inlist(commander_sidearm, (CO_GUNS + COUNCIL_CO_GUNS), initial(commander_sidearm)) affiliation = sanitize_inlist(affiliation, FACTION_ALLEGIANCE_USCM_COMMANDER, initial(affiliation)) - yautja_status = sanitize_inlist(yautja_status, whitelist_hierarchy + list("Elder"), initial(yautja_status)) - synth_status = sanitize_inlist(synth_status, whitelist_hierarchy, initial(synth_status)) + yautja_status = sanitize_inlist(yautja_status, GLOB.whitelist_hierarchy + list("Elder"), initial(yautja_status)) + synth_status = sanitize_inlist(synth_status, GLOB.whitelist_hierarchy, initial(synth_status)) key_bindings = sanitize_keybindings(key_bindings) remembered_key_bindings = sanitize_islist(remembered_key_bindings, null) hotkeys = sanitize_integer(hotkeys, FALSE, TRUE, TRUE) @@ -520,7 +520,7 @@ b_eyes = sanitize_integer(b_eyes, 0, 255, initial(b_eyes)) underwear = sanitize_inlist(underwear, gender == MALE ? GLOB.underwear_m : GLOB.underwear_f, initial(underwear)) undershirt = sanitize_inlist(undershirt, gender == MALE ? GLOB.undershirt_m : GLOB.undershirt_f, initial(undershirt)) - backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag)) + backbag = sanitize_integer(backbag, 1, GLOB.backbaglist.len, initial(backbag)) preferred_armor = sanitize_inlist(preferred_armor, GLOB.armor_style_list, "Random") //b_type = sanitize_text(b_type, initial(b_type)) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 6f9026a437dd..6fe334a2a0ab 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -48,25 +48,10 @@ to_chat(src, "You will [(prefs.toggles_sound & SOUND_REBOOT) ? "now" : "no longer"] hear server reboot sounds.") /client/verb/togglemidis() - set name = "Silence Current Midi" + set name = "Silence Current Admin Sound" set category = "Preferences.Sound" - set desc = "Toggles hearing sounds uploaded by admins" - // prefs.toggles_sound ^= SOUND_MIDI // Toggle on/off - // prefs.save_preferences() // We won't save the change - it'll be a temporary switch instead of permanent, but they can still make it permanent in character setup. - if(prefs.toggles_sound & SOUND_MIDI) // Not using && midi_playing here - since we can't tell how long an admin midi is, the user should always be able to turn it off at any time. - to_chat(src, SPAN_BOLDNOTICE("The currently playing midi has been silenced.")) - var/sound/break_sound = sound(null, repeat = 0, wait = 0, channel = SOUND_CHANNEL_ADMIN_MIDI) - break_sound.priority = 250 - src << break_sound //breaks the client's sound output on SOUND_CHANNEL_ADMIN_MIDI - if(src.mob.client.midi_silenced) return - if(midi_playing) - total_silenced++ - message_admins("A player has silenced the currently playing midi. Total: [total_silenced] player(s).", 1) - src.mob.client.midi_silenced = 1 - spawn(30 SECONDS) // Prevents message_admins() spam. Should match with the midi_playing_timer spawn() in playsound.dm - src.mob.client.midi_silenced = 0 - else - to_chat(src, SPAN_BOLDNOTICE("You have 'Play Admin Midis' disabled in your Character Setup, so this verb is useless to you.")) + set desc = "Stops the current admin sound. You can also use the STOP icon in the player above tgchat." + tgui_panel?.stop_music() /client/verb/togglechat() set name = "Toggle Abovehead Chat" @@ -562,7 +547,7 @@ set category = "Preferences" set desc = "Shows ghost-related preferences." - add_verb(src, ghost_prefs_verbs) + add_verb(src, GLOB.ghost_prefs_verbs) remove_verb(src, /client/proc/show_ghost_preferences) /client/proc/hide_ghost_preferences() // Hides ghost-related preferences. @@ -570,7 +555,7 @@ set category = "Preferences" set desc = "Hides ghost-related preferences." - remove_verb(src, ghost_prefs_verbs) + remove_verb(src, GLOB.ghost_prefs_verbs) add_verb(src, /client/proc/show_ghost_preferences) /client/proc/toggle_ghost_hivemind() @@ -636,21 +621,21 @@ var/datum/mob_hud/H switch(hud_choice) if("Medical HUD") - H = huds[MOB_HUD_MEDICAL_OBSERVER] + H = GLOB.huds[MOB_HUD_MEDICAL_OBSERVER] if("Security HUD") - H = huds[MOB_HUD_SECURITY_ADVANCED] + H = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] if("Squad HUD") - H = huds[MOB_HUD_FACTION_OBSERVER] + H = GLOB.huds[MOB_HUD_FACTION_OBSERVER] if("Xeno Status HUD") - H = huds[MOB_HUD_XENO_STATUS] + H = GLOB.huds[MOB_HUD_XENO_STATUS] if("Faction UPP HUD") - H = huds[MOB_HUD_FACTION_UPP] + H = GLOB.huds[MOB_HUD_FACTION_UPP] if("Faction Wey-Yu HUD") - H = huds[MOB_HUD_FACTION_WY] + H = GLOB.huds[MOB_HUD_FACTION_WY] if("Faction TWE HUD") - H = huds[MOB_HUD_FACTION_TWE] + H = GLOB.huds[MOB_HUD_FACTION_TWE] if("Faction CLF HUD") - H = huds[MOB_HUD_FACTION_CLF] + H = GLOB.huds[MOB_HUD_FACTION_CLF] observer_user.HUD_toggled[hud_choice] = prefs.observer_huds[hud_choice] if(observer_user.HUD_toggled[hud_choice]) @@ -700,7 +685,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE, GHOST_ORBIT_TRIANGLE, GH set name = "Show Combat Chat Prefs" set desc = "Shows additional chat preferences for combat and ghost messages." - add_verb(src, combat_chat_prefs_verbs) + add_verb(src, GLOB.combat_chat_prefs_verbs) remove_verb(src, /client/proc/show_combat_chat_preferences) /client/proc/hide_combat_chat_preferences() // Hides additional chat logs preferences. @@ -708,7 +693,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE, GHOST_ORBIT_TRIANGLE, GH set name = "Hide Combat Chat Prefs" set desc = "Hides additional chat preferences for combat and ghost messages." - remove_verb(src, combat_chat_prefs_verbs) + remove_verb(src, GLOB.combat_chat_prefs_verbs) add_verb(src, /client/proc/show_combat_chat_preferences) /client/proc/toggle_chat_shooting() @@ -759,16 +744,16 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE, GHOST_ORBIT_TRIANGLE, GH to_chat(src, SPAN_BOLDNOTICE("As a player, you will now [(prefs.chat_display_preferences & CHAT_TYPE_PAIN) ? "see you being in pain messages" : "never see you being in pain messages"].")) prefs.save_preferences() -var/list/combat_chat_prefs_verbs = list( +GLOBAL_LIST_INIT(combat_chat_prefs_verbs, list( /client/proc/toggle_chat_shooting, /client/proc/toggle_chat_xeno_attack, /client/proc/toggle_chat_xeno_armor, /client/proc/toggle_chat_someone_hit, /client/proc/toggle_chat_you_hit, /client/proc/toggle_chat_you_pain, - /client/proc/hide_combat_chat_preferences) + /client/proc/hide_combat_chat_preferences)) -var/list/ghost_prefs_verbs = list( +GLOBAL_LIST_INIT(ghost_prefs_verbs, list( /client/proc/toggle_ghost_ears, /client/proc/toggle_ghost_sight, /client/proc/toggle_ghost_radio, @@ -777,4 +762,4 @@ var/list/ghost_prefs_verbs = list( /client/proc/toggle_ghost_hud, /client/proc/toggle_ghost_health_scan, /client/proc/pick_ghost_orbit, - /client/proc/hide_ghost_preferences) + /client/proc/hide_ghost_preferences)) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index bd87746545d8..4eafeed6c378 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -130,12 +130,12 @@ /obj/item/clothing/ears/earmuffs/New() . = ..() - LAZYADD(objects_of_interest, src) + LAZYADD(GLOB.objects_of_interest, src) /obj/item/clothing/ears/earmuffs/Destroy() . = ..() - LAZYREMOVE(objects_of_interest, src) + LAZYREMOVE(GLOB.objects_of_interest, src) /////////////////////////////////////////////////////////////////////// diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index e4a19b7bed3e..a07e83db7381 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -13,10 +13,10 @@ var/tmp_icon_state = overlay_state? overlay_state : icon_state if(icon_override && ("[tmp_icon_state]_tie" in icon_states(icon_override))) inv_overlay = image(icon = icon_override, icon_state = "[tmp_icon_state]_tie", dir = SOUTH) - else if("[tmp_icon_state]_tie" in icon_states(default_onmob_icons[WEAR_ACCESSORY])) - inv_overlay = image(icon = default_onmob_icons[WEAR_ACCESSORY], icon_state = "[tmp_icon_state]_tie", dir = SOUTH) + else if("[tmp_icon_state]_tie" in icon_states(GLOB.default_onmob_icons[WEAR_ACCESSORY])) + inv_overlay = image(icon = GLOB.default_onmob_icons[WEAR_ACCESSORY], icon_state = "[tmp_icon_state]_tie", dir = SOUTH) else - inv_overlay = image(icon = default_onmob_icons[WEAR_ACCESSORY], icon_state = tmp_icon_state, dir = SOUTH) + inv_overlay = image(icon = GLOB.default_onmob_icons[WEAR_ACCESSORY], icon_state = tmp_icon_state, dir = SOUTH) inv_overlay.color = color return inv_overlay diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 853a07ef10a2..dae7f633f05d 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -68,7 +68,7 @@ update_clothing_icon() if(hud_type) - var/datum/mob_hud/MH = huds[hud_type] + var/datum/mob_hud/MH = GLOB.huds[hud_type] if(active) MH.add_hud_to(H, src) playsound(H, 'sound/handling/hud_on.ogg', 25, 1) @@ -94,7 +94,7 @@ to_chat(user, SPAN_WARNING("You have no idea what any of the data means and power it off before it makes you nauseated.")) else if(hud_type) - var/datum/mob_hud/MH = huds[hud_type] + var/datum/mob_hud/MH = GLOB.huds[hud_type] MH.add_hud_to(user, src) user.update_sight() ..() @@ -102,7 +102,7 @@ /obj/item/clothing/glasses/dropped(mob/living/carbon/human/user) if(hud_type && active && istype(user)) if(src == user.glasses) //dropped is called before the inventory reference is updated. - var/datum/mob_hud/H = huds[hud_type] + var/datum/mob_hud/H = GLOB.huds[hud_type] H.remove_hud_from(user, src) user.glasses = null user.update_inv_glasses() @@ -507,38 +507,40 @@ set name = "Adjust welding goggles" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) - if(active) - active = 0 - vision_impair = vision_impair_off - flags_inventory &= ~COVEREYES - flags_inv_hide &= ~HIDEEYES - flags_armor_protection &= ~BODY_FLAG_EYES - update_icon() - eye_protection = EYE_PROTECTION_NONE - to_chat(usr, "You push [src] up out of your face.") - else - active = 1 - vision_impair = vision_impair_on - flags_inventory |= COVEREYES - flags_inv_hide |= HIDEEYES - flags_armor_protection |= BODY_FLAG_EYES - update_icon() - eye_protection = initial(eye_protection) - to_chat(usr, "You flip [src] down to protect your eyes.") - - - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - if(H.glasses == src) - H.update_tint() + if(usr.is_mob_incapacitated()) + return + + if(active) + active = 0 + vision_impair = vision_impair_off + flags_inventory &= ~COVEREYES + flags_inv_hide &= ~HIDEEYES + flags_armor_protection &= ~BODY_FLAG_EYES + update_icon() + eye_protection = EYE_PROTECTION_NONE + to_chat(usr, "You push [src] up out of your face.") + else + active = 1 + vision_impair = vision_impair_on + flags_inventory |= COVEREYES + flags_inv_hide |= HIDEEYES + flags_armor_protection |= BODY_FLAG_EYES + update_icon() + eye_protection = initial(eye_protection) + to_chat(usr, "You flip [src] down to protect your eyes.") + + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.glasses == src) + H.update_tint() - update_clothing_icon() + update_clothing_icon() - for(var/X in actions) - var/datum/action/A = X - if(istype(A, /datum/action/item_action/toggle)) - A.update_button_icon() + for(var/X in actions) + var/datum/action/A = X + if(istype(A, /datum/action/item_action/toggle)) + A.update_button_icon() /obj/item/clothing/glasses/welding/superior name = "superior welding goggles" diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 1a133eee0dfe..7406e6baa754 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -36,7 +36,7 @@ return /datum/action/item_action/view_publications/can_use_action() - if(owner && !owner.is_mob_incapacitated() && !owner.lying && owner.faction != FACTION_SURVIVOR) + if(owner && !owner.is_mob_incapacitated() && owner.faction != FACTION_SURVIVOR) return TRUE /datum/action/item_action/view_publications/action_activate() @@ -48,7 +48,7 @@ /obj/item/clothing/glasses/hud/health/ui_data(mob/user) var/list/data = list( - "published_documents" = chemical_data.research_publications, + "published_documents" = GLOB.chemical_data.research_publications, "terminal_view" = FALSE ) return data @@ -74,7 +74,7 @@ if ("read_document") var/print_type = params["print_type"] var/print_title = params["print_title"] - var/obj/item/paper/research_report/report = chemical_data.get_report(print_type, print_title) + var/obj/item/paper/research_report/report = GLOB.chemical_data.get_report(print_type, print_title) if(report) report.read_paper(user) return @@ -98,7 +98,7 @@ return if(href_list["read_document"]) - var/obj/item/paper/research_report/report = chemical_data.research_documents[href_list["print_type"]][href_list["print_title"]] + var/obj/item/paper/research_report/report = GLOB.chemical_data.research_documents[href_list["print_type"]][href_list["print_title"]] if(report) report.read_paper(user) diff --git a/code/modules/clothing/glasses/night.dm b/code/modules/clothing/glasses/night.dm index 2a3780832e2a..b2b6f8406dcc 100644 --- a/code/modules/clothing/glasses/night.dm +++ b/code/modules/clothing/glasses/night.dm @@ -150,7 +150,7 @@ far_sight = FALSE if(user) if(user.client) - user.client.change_view(world_view_size, src) + user.client.change_view(GLOB.world_view_size, src) STOP_PROCESSING(SSobj, src) var/datum/action/item_action/m56_goggles/far_sight/FT = locate(/datum/action/item_action/m56_goggles/far_sight) in actions diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm index e6c8391ac0a1..15a4cf742464 100644 --- a/code/modules/clothing/gloves/miscellaneous.dm +++ b/code/modules/clothing/gloves/miscellaneous.dm @@ -88,7 +88,7 @@ playsound(loc, knockout_sound, 50, FALSE) M.show_message(FONT_SIZE_LARGE(SPAN_WARNING("KNOCKOUT!")), SHOW_MESSAGE_VISIBLE) return 1 - if (L.lying == 1 || L.stat == UNCONSCIOUS)//Can't beat 'em while they're down. + if (L.body_position == LYING_DOWN || L.stat == UNCONSCIOUS)//Can't beat 'em while they're down. to_chat(M, SPAN_WARNING("You can't box with [A], they're already down!")) return 1 M.visible_message(SPAN_DANGER("[M] [boxing_verb] [A]!")) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 102d8241754f..afc8e0a7cbba 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -45,33 +45,35 @@ set name = "Adjust welding mask" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) - if(up) - vision_impair = VISION_IMPAIR_MAX - flags_inventory |= COVEREYES|COVERMOUTH|BLOCKSHARPOBJ - flags_inv_hide |= HIDEEARS|HIDEEYES|HIDEFACE - icon_state = initial(icon_state) - eye_protection = initial(eye_protection) - to_chat(usr, "You flip the [src] down to protect your eyes.") - else - vision_impair = VISION_IMPAIR_NONE - flags_inventory &= ~(COVEREYES|COVERMOUTH|BLOCKSHARPOBJ) - flags_inv_hide &= ~(HIDEEARS|HIDEEYES|HIDEFACE) - icon_state = "[initial(icon_state)]up" - eye_protection = EYE_PROTECTION_NONE - to_chat(usr, "You push the [src] up out of your face.") - up = !up - - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - if(H.head == src) - H.update_tint() - - update_clothing_icon() //so our mob-overlays update - - for(var/X in actions) - var/datum/action/A = X - A.update_button_icon() + if(usr.is_mob_incapacitated()) + return + + if(up) + vision_impair = VISION_IMPAIR_MAX + flags_inventory |= COVEREYES|COVERMOUTH|BLOCKSHARPOBJ + flags_inv_hide |= HIDEEARS|HIDEEYES|HIDEFACE + icon_state = initial(icon_state) + eye_protection = initial(eye_protection) + to_chat(usr, "You flip the [src] down to protect your eyes.") + else + vision_impair = VISION_IMPAIR_NONE + flags_inventory &= ~(COVEREYES|COVERMOUTH|BLOCKSHARPOBJ) + flags_inv_hide &= ~(HIDEEARS|HIDEEYES|HIDEFACE) + icon_state = "[initial(icon_state)]up" + eye_protection = EYE_PROTECTION_NONE + to_chat(usr, "You push the [src] up out of your face.") + up = !up + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.head == src) + H.update_tint() + + update_clothing_icon() //so our mob-overlays update + + for(var/X in actions) + var/datum/action/A = X + A.update_button_icon() /* * Cakehat diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 76d61b4e3cc9..ffdda93f8a73 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -16,7 +16,7 @@ set name = "Adjust mask" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) if(!src.hanging) src.hanging = !src.hanging gas_transfer_coefficient = 1 //gas is now escaping to the turf and vice versa diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index f2be4eaf2062..45a3c51a6701 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -25,21 +25,21 @@ //Some simple descriptors for breaches. Global because lazy, TODO: work out a better way to do this. -var/global/list/breach_brute_descriptors = list( +GLOBAL_LIST_INIT(breach_brute_descriptors, list( "tiny puncture", "ragged tear", "large split", "huge tear", "gaping wound" - ) + )) -var/global/list/breach_burn_descriptors = list( +GLOBAL_LIST_INIT(breach_burn_descriptors, list( "small burn", "melted patch", "sizable burn", "large scorched area", "huge scorched area" - ) + )) /datum/breach/proc/update_descriptor() @@ -47,9 +47,9 @@ var/global/list/breach_burn_descriptors = list( class = max(1,min(class,5)) //Apply the correct descriptor. if(damtype == BURN) - descriptor = breach_burn_descriptors[class] + descriptor = GLOB.breach_burn_descriptors[class] else if(damtype == BRUTE) - descriptor = breach_brute_descriptors[class] + descriptor = GLOB.breach_brute_descriptors[class] //Repair a certain amount of brute or burn damage to the suit. /obj/item/clothing/suit/space/proc/repair_breaches(damtype, amount, mob/user) diff --git a/code/modules/clothing/suits/jobs.dm b/code/modules/clothing/suits/jobs.dm index a28a143f4ff0..5b97051852a6 100644 --- a/code/modules/clothing/suits/jobs.dm +++ b/code/modules/clothing/suits/jobs.dm @@ -385,7 +385,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 switch(icon_state) diff --git a/code/modules/clothing/suits/labcoat.dm b/code/modules/clothing/suits/labcoat.dm index 278ffb666bfd..1c2fb2a9f29d 100644 --- a/code/modules/clothing/suits/labcoat.dm +++ b/code/modules/clothing/suits/labcoat.dm @@ -52,7 +52,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.buttoned == TRUE) diff --git a/code/modules/clothing/suits/marine_armor.dm b/code/modules/clothing/suits/marine_armor.dm index fe37ba86eef2..e505d458e496 100644 --- a/code/modules/clothing/suits/marine_armor.dm +++ b/code/modules/clothing/suits/marine_armor.dm @@ -118,7 +118,7 @@ select_gamemode_skin(type) armor_overlays = list("lamp") //Just one for now, can add more later. if(armor_variation && mapload) - post_vendor_spawn_hook() + set_armor_style("Random") update_icon() pockets.max_w_class = SIZE_SMALL //Can contain small items AND rifle magazines. pockets.bypass_w_limit = list( @@ -149,18 +149,15 @@ /obj/item/clothing/suit/storage/marine/post_vendor_spawn_hook(mob/living/carbon/human/user) //used for randomizing/selecting a variant for armors. - var/new_look //used for the icon_state text replacement. - - if(!user?.client?.prefs) - new_look = rand(1,armor_variation) - - else if(user.client.prefs.preferred_armor == "Random") - new_look = rand(1,armor_variation) + if(!armor_variation) + return + if(user?.client?.prefs) + // Set the armor style to the user's preference. + set_armor_style(user.client.prefs.preferred_armor) else - new_look = GLOB.armor_style_list[user.client.prefs.preferred_armor] - - icon_state = replacetext(icon_state,"1","[new_look]") + // Or if that isn't possible, just pick a random one. + set_armor_style("Random") update_icon(user) /obj/item/clothing/suit/storage/marine/attack_self(mob/user) @@ -219,6 +216,27 @@ M.visible_message(SPAN_DANGER("Your programming prevents you from wearing this!")) return 0 +/** + * Updates the armor's `icon_state` to the style represented by `new_style`. + * + * Arguments: + * * new_style - The new armor style. May only be one of `GLOB.armor_style_list`'s keys, or `"Random"`. + */ +/obj/item/clothing/suit/storage/marine/proc/set_armor_style(new_style) + // Regex to match one or more digits. + var/static/regex/digits = new("\\d+") + // Integer for the new armor style's `icon_state`. + var/new_look + + if(new_style == "Random") + // The style icon states are all numbers between 1 and `armor_variation`, so this picks a random one. + new_look = rand(1, armor_variation) + else + new_look = GLOB.armor_style_list[new_style] + + // Replace the digits in the current icon state with `new_look`. (E.g. "L6" -> "L2") + icon_state = digits.Replace(icon_state, new_look) + /obj/item/clothing/suit/storage/marine/padded name = "M3 pattern padded marine armor" icon_state = "1" @@ -626,7 +644,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(!injections) @@ -905,13 +923,12 @@ H.alpha = full_camo_alpha H.FF_hit_evade = 1000 ADD_TRAIT(H, TRAIT_UNDENSE, SPECIALIST_GEAR_TRAIT) - H.density = FALSE RegisterSignal(H, COMSIG_MOB_MOVE_OR_LOOK, PROC_REF(handle_mob_move_or_look)) - var/datum/mob_hud/security/advanced/SA = huds[MOB_HUD_SECURITY_ADVANCED] + var/datum/mob_hud/security/advanced/SA = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] SA.remove_from_hud(H) - var/datum/mob_hud/xeno_infection/XI = huds[MOB_HUD_XENO_INFECTION] + var/datum/mob_hud/xeno_infection/XI = GLOB.huds[MOB_HUD_XENO_INFECTION] XI.remove_from_hud(H) anim(H.loc, H, 'icons/mob/mob.dmi', null, "cloak", null, H.dir) @@ -930,7 +947,6 @@ COMSIG_MOB_FIRED_GUN, COMSIG_MOB_FIRED_GUN_ATTACHMENT, COMSIG_MOB_DEATH, - COMSIG_MOB_POST_UPDATE_CANMOVE, COMSIG_HUMAN_EXTINGUISH, COMSIG_MOB_MOVE_OR_LOOK )) @@ -939,11 +955,10 @@ animate(H, alpha = initial(H.alpha), flags = ANIMATION_END_NOW) H.FF_hit_evade = initial(H.FF_hit_evade) REMOVE_TRAIT(H, TRAIT_UNDENSE, SPECIALIST_GEAR_TRAIT) - H.update_canmove() - var/datum/mob_hud/security/advanced/SA = huds[MOB_HUD_SECURITY_ADVANCED] + var/datum/mob_hud/security/advanced/SA = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] SA.add_to_hud(H) - var/datum/mob_hud/xeno_infection/XI = huds[MOB_HUD_XENO_INFECTION] + var/datum/mob_hud/xeno_infection/XI = GLOB.huds[MOB_HUD_XENO_INFECTION] XI.add_to_hud(H) H.visible_message(SPAN_DANGER("[H]'s camouflage fails!"), SPAN_WARNING("Your camouflage fails!"), max_distance = 4) @@ -984,7 +999,7 @@ /datum/action/item_action/specialist/prepare_position/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.wear_suit) + if(istype(H) && !H.is_mob_incapacitated() && H.body_position == STANDING_UP && holder_item == H.wear_suit) return TRUE /datum/action/item_action/specialist/prepare_position/action_activate() diff --git a/code/modules/clothing/suits/marine_coat.dm b/code/modules/clothing/suits/marine_coat.dm index 73d7e0981859..3aa43706c7d8 100644 --- a/code/modules/clothing/suits/marine_coat.dm +++ b/code/modules/clothing/suits/marine_coat.dm @@ -53,7 +53,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.buttoned == TRUE) diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 2a3cff05ee1e..b5859bb6f2d4 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -332,7 +332,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.icon_state == "suitjacket_blue_open") diff --git a/code/modules/clothing/under/under.dm b/code/modules/clothing/under/under.dm index f452628a1cb9..ebfac5216330 100644 --- a/code/modules/clothing/under/under.dm +++ b/code/modules/clothing/under/under.dm @@ -45,7 +45,7 @@ else worn_state = icon_state - var/check_icon = contained_sprite ? icon : default_onmob_icons[WEAR_BODY] + var/check_icon = contained_sprite ? icon : GLOB.default_onmob_icons[WEAR_BODY] //autodetect rollability, cuttability, and removability. if(icon_exists(check_icon, "[worn_state]_d[contained_sprite ? "_un" : ""]")) @@ -106,7 +106,7 @@ if ((flags_item & NODROP) || loc != usr) return - if (!usr.is_mob_incapacitated() && !(usr.buckled && usr.lying)) + if (!usr.is_mob_incapacitated() && !(usr.buckled)) if(over_object) switch(over_object.name) if("r_hand") @@ -259,7 +259,7 @@ else if(LAZYISIN(item_icons, WEAR_BODY)) under_icon = item_icons[WEAR_BODY] else - under_icon = default_onmob_icons[WEAR_BODY] + under_icon = GLOB.default_onmob_icons[WEAR_BODY] var/check_worn_state = "[worn_state]_d[contained_sprite ? "_un" : ""]" if(!(check_worn_state in icon_states(under_icon))) @@ -292,7 +292,7 @@ else if(LAZYISIN(item_icons, WEAR_BODY)) under_icon = item_icons[WEAR_BODY] else - under_icon = default_onmob_icons[WEAR_BODY] + under_icon = GLOB.default_onmob_icons[WEAR_BODY] var/check_worn_state = "[worn_state]_dj[contained_sprite ? "_un" : ""]" if(!(check_worn_state in icon_states(under_icon))) diff --git a/code/modules/cm_aliens/XenoStructures.dm b/code/modules/cm_aliens/XenoStructures.dm index 73ced8099427..340fabdf1973 100644 --- a/code/modules/cm_aliens/XenoStructures.dm +++ b/code/modules/cm_aliens/XenoStructures.dm @@ -160,7 +160,8 @@ /obj/effect/alien/resin/sticky/Crossed(atom/movable/AM) . = ..() var/mob/living/carbon/human/H = AM - if(istype(H) && !H.lying && !H.ally_of_hivenumber(hivenumber)) + // Wait doesn't this stack slows if you get dragged over it? What's going on here? + if(istype(H) && !H.ally_of_hivenumber(hivenumber)) H.next_move_slowdown = H.next_move_slowdown + slow_amt return . var/mob/living/carbon/xenomorph/X = AM @@ -202,7 +203,7 @@ if (hive) hivenumber = hive set_hive_data(src, hivenumber) - setDir(pick(alldirs)) + setDir(pick(GLOB.alldirs)) if(hivenumber == XENO_HIVE_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) @@ -418,18 +419,23 @@ update_icon() isSwitchingStates = 0 layer = DOOR_OPEN_LAYER - spawn(close_delay) - if(!isSwitchingStates && state == 1) - Close() + addtimer(CALLBACK(src, PROC_REF(Close)), close_delay, TIMER_UNIQUE|TIMER_OVERRIDE) + +/obj/structure/mineral_door/resin/proc/close_blocked() + for(var/turf/turf in locs) + for(var/mob/living/living_mob in turf) + if(!HAS_TRAIT(living_mob, TRAIT_MERGED_WITH_WEEDS)) + return TRUE + return FALSE /obj/structure/mineral_door/resin/Close() - if(!state || !loc) return //already closed + if(!state || !loc || isSwitchingStates) + return //already closed or changing //Can't close if someone is blocking it - for(var/turf/turf in locs) - if(locate(/mob/living) in turf) - spawn (close_delay) - Close() - return + if(close_blocked()) + addtimer(CALLBACK(src, PROC_REF(Close)), close_delay, TIMER_UNIQUE|TIMER_OVERRIDE) + return + isSwitchingStates = 1 playsound(loc, "alien_resin_move", 25) flick("[mineralType]closing",src) @@ -440,10 +446,10 @@ update_icon() isSwitchingStates = 0 layer = DOOR_CLOSED_LAYER - for(var/turf/turf in locs) - if(locate(/mob/living) in turf) - Open() - return + + if(close_blocked()) + Open() + return /obj/structure/mineral_door/resin/Dismantle(devastated = 0) qdel(src) @@ -457,7 +463,7 @@ var/turf/U = loc spawn(0) var/turf/T - for(var/i in cardinal) + for(var/i in GLOB.cardinals) T = get_step(U, i) if(!istype(T)) continue for(var/obj/structure/mineral_door/resin/R in T) @@ -490,7 +496,7 @@ //do we still have something next to us to support us? /obj/structure/mineral_door/resin/proc/check_resin_support() var/turf/T - for(var/i in cardinal) + for(var/i in GLOB.cardinals) T = get_step(src, i) if(!T) continue @@ -560,7 +566,7 @@ return FALSE burning_friendly = TRUE - else if(current_mob.lying || current_mob.is_mob_incapacitated(TRUE)) + else if(current_mob.body_position == LYING_DOWN || current_mob.is_mob_incapacitated(TRUE)) return FALSE if(!burning_friendly && current_mob.health < 0) @@ -934,9 +940,9 @@ // If the cell is the epicenter, propagate in all directions if(isnull(direction)) - return alldirs + return GLOB.alldirs - if(direction in cardinal) + if(direction in GLOB.cardinals) . += list(direction, turn(direction, 45), turn(direction, -45)) else . += direction @@ -970,7 +976,7 @@ // Set the direction the explosion is traveling in E.direction = dir - if(dir in diagonals) + if(dir in GLOB.diagonals) E.range-- switch(E.range) diff --git a/code/modules/cm_aliens/structures/egg.dm b/code/modules/cm_aliens/structures/egg.dm index c23f4f3e2b20..ce0be7c0c8a1 100644 --- a/code/modules/cm_aliens/structures/egg.dm +++ b/code/modules/cm_aliens/structures/egg.dm @@ -296,3 +296,63 @@ linked_egg.HasProximity(C) if(linked_eggmorph) linked_eggmorph.HasProximity(C) + +/* +SPECIAL EGG USED BY EGG CARRIER +*/ + +#define CARRIER_EGG_UNSUSTAINED_LIFE 1 MINUTES +#define CARRIER_EGG_MAXIMUM_LIFE 5 MINUTES + +/obj/effect/alien/egg/carrier_egg + name = "fragile egg" + desc = "It looks like a weird, fragile egg." + ///Owner of the fragile egg, must be a mob/living/carbon/xenomorph/carrier + var/mob/living/carbon/xenomorph/carrier/owner = null + ///Time that the carrier was last within refresh range of the egg (14 tiles) + var/last_refreshed = null + /// Timer holder for the maximum lifetime of the egg as defined CARRIER_EGG_MAXIMUM_LIFE + var/life_timer = null + +/obj/effect/alien/egg/carrier_egg/Initialize(mapload, hivenumber, planter = null) + . = ..() + last_refreshed = world.time + if(!planter) + //If we have no owner when created... this really shouldn't happen but start decaying the egg immediately. + start_unstoppable_decay() + else + //Die after maximum lifetime + life_timer = addtimer(CALLBACK(src, PROC_REF(start_unstoppable_decay)), CARRIER_EGG_MAXIMUM_LIFE, TIMER_STOPPABLE) + set_owner(planter) + +/obj/effect/alien/egg/carrier_egg/Destroy() + if(life_timer) + deltimer(life_timer) + //Remove reference to src in owner's behavior_delegate and set owner to null + if(owner) + var/mob/living/carbon/xenomorph/carrier/my_owner = owner + var/datum/behavior_delegate/carrier_eggsac/behavior = my_owner.behavior_delegate + behavior.eggs_sustained -= src + my_owner = null + return ..() + +/// Set the owner of the egg to the planter. +/obj/effect/alien/egg/carrier_egg/proc/set_owner(mob/living/carbon/xenomorph/carrier/planter) + var/datum/behavior_delegate/carrier_eggsac/my_delegate = planter.behavior_delegate + my_delegate.eggs_sustained += src + owner = planter + +///Check the last refreshed time and burst the egg if we're over the lifetime of the egg +/obj/effect/alien/egg/carrier_egg/proc/check_decay() + if(last_refreshed + CARRIER_EGG_UNSUSTAINED_LIFE < world.time) + start_unstoppable_decay() + +///Burst the egg without hugger release after a 10 second timer & remove the life timer. +/obj/effect/alien/egg/carrier_egg/proc/start_unstoppable_decay() + addtimer(CALLBACK(src, PROC_REF(Burst), TRUE), 10 SECONDS) + if(life_timer) + deltimer(life_timer) + +/obj/effect/alien/egg/carrier_egg/Burst(kill, instant_trigger, mob/living/carbon/xenomorph/X, is_hugger_player_controlled) + . = ..() + owner = null diff --git a/code/modules/cm_aliens/structures/fruit.dm b/code/modules/cm_aliens/structures/fruit.dm index 318bc6ba6cf2..09983c930031 100644 --- a/code/modules/cm_aliens/structures/fruit.dm +++ b/code/modules/cm_aliens/structures/fruit.dm @@ -442,7 +442,7 @@ /obj/effect/alien/resin/fruit/MouseDrop(atom/over_object) var/mob/living/carbon/xenomorph/X = over_object - if(!istype(X) || !Adjacent(X) || X != usr || X.is_mob_incapacitated() || X.lying) return ..() + if(!istype(X) || !Adjacent(X) || X != usr || X.is_mob_incapacitated() || X.body_position == LYING_DOWN) return ..() X.pickup_fruit(src) // Handles xenos picking up fruit diff --git a/code/modules/cm_aliens/structures/special/egg_morpher.dm b/code/modules/cm_aliens/structures/special/egg_morpher.dm index 1fd154eb354c..bcd0ecc03be5 100644 --- a/code/modules/cm_aliens/structures/special/egg_morpher.dm +++ b/code/modules/cm_aliens/structures/special/egg_morpher.dm @@ -147,7 +147,7 @@ if(isitem(A)) var/obj/item/item = A if(item.is_objective && item.unacidable) - item.forceMove(get_step(loc, pick(alldirs))) + item.forceMove(get_step(loc, pick(GLOB.alldirs))) item.mouse_opacity = initial(item.mouse_opacity) QDEL_NULL(captured_mob) diff --git a/code/modules/cm_aliens/structures/trap.dm b/code/modules/cm_aliens/structures/trap.dm index bc8eb7e6c7c0..d885e4d14a91 100644 --- a/code/modules/cm_aliens/structures/trap.dm +++ b/code/modules/cm_aliens/structures/trap.dm @@ -106,7 +106,7 @@ var/mob/living/carbon/human/H = AM if(issynth(H) || isyautja(H)) return - if(H.stat == DEAD || H.lying) + if(H.stat == DEAD || H.body_position == LYING_DOWN) return if(H.ally_of_hivenumber(hivenumber)) return diff --git a/code/modules/cm_aliens/structures/tunnel.dm b/code/modules/cm_aliens/structures/tunnel.dm index 185bee06c513..8c467be695b4 100644 --- a/code/modules/cm_aliens/structures/tunnel.dm +++ b/code/modules/cm_aliens/structures/tunnel.dm @@ -29,7 +29,7 @@ /obj/structure/tunnel/Initialize(mapload, h_number) . = ..() var/turf/L = get_turf(src) - tunnel_desc = L.loc.name + " ([loc.x], [loc.y]) [pick(greek_letters)]"//Default tunnel desc is the (x, y) + tunnel_desc = L.loc.name + " ([loc.x], [loc.y]) [pick(GLOB.greek_letters)]"//Default tunnel desc is the (x, y) if(h_number && GLOB.hive_datum[h_number]) hivenumber = h_number @@ -127,7 +127,7 @@ /obj/structure/tunnel/proc/pick_tunnel(mob/living/carbon/xenomorph/X) . = FALSE //For peace of mind when it comes to dealing with unintended proc failures - if(!istype(X) || X.stat || X.lying || !isfriendly(X) || !hive) + if(!istype(X) || X.is_mob_incapacitated(TRUE) || !isfriendly(X) || !hive) return FALSE if(X in contents) var/list/tunnels = list() @@ -195,7 +195,7 @@ . = attack_alien(M) /obj/structure/tunnel/attack_alien(mob/living/carbon/xenomorph/M) - if(!istype(M) || M.stat || M.lying) + if(!istype(M) || M.is_mob_incapacitated(TRUE)) return XENO_NO_DELAY_ACTION if(!isfriendly(M)) diff --git a/code/modules/cm_aliens/weeds.dm b/code/modules/cm_aliens/weeds.dm index 736d4f947450..4be1ce63ac25 100644 --- a/code/modules/cm_aliens/weeds.dm +++ b/code/modules/cm_aliens/weeds.dm @@ -216,7 +216,7 @@ return var/list/weeds = list() - for(var/dirn in cardinal) + for(var/dirn in GLOB.cardinals) var/turf/T = get_step(src, dirn) if(!istype(T)) continue @@ -282,7 +282,7 @@ if(istype(O, /obj/structure/barricade)) //cades on tile we're trying to expand to var/obj/structure/barricade/to_blocking_cade = O - if(to_blocking_cade.density && to_blocking_cade.dir == reverse_dir[direction] && to_blocking_cade.health >= (to_blocking_cade.maxhealth / 4)) + if(to_blocking_cade.density && to_blocking_cade.dir == GLOB.reverse_dir[direction] && to_blocking_cade.health >= (to_blocking_cade.maxhealth / 4)) return FALSE if(istype(O, /obj/structure/window/framed)) @@ -299,7 +299,7 @@ if(!U) U = loc if(istype(U)) - for(var/dirn in cardinal) + for(var/dirn in GLOB.cardinals) var/turf/T = get_step(U, dirn) if(!istype(T)) @@ -313,7 +313,7 @@ overlays.Cut() var/my_dir = 0 - for(var/check_dir in cardinal) + for(var/check_dir in GLOB.cardinals) var/turf/check = get_step(src, check_dir) if(!istype(check)) diff --git a/code/modules/cm_marines/Donator_Items.dm b/code/modules/cm_marines/Donator_Items.dm index e8eb3f75ae60..6d2f46490d13 100644 --- a/code/modules/cm_marines/Donator_Items.dm +++ b/code/modules/cm_marines/Donator_Items.dm @@ -23,7 +23,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -35,7 +35,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -91,7 +91,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -103,7 +103,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return diff --git a/code/modules/cm_marines/anti_air.dm b/code/modules/cm_marines/anti_air.dm index 8c8cab302e19..e867c0d64083 100644 --- a/code/modules/cm_marines/anti_air.dm +++ b/code/modules/cm_marines/anti_air.dm @@ -1,4 +1,4 @@ -var/obj/structure/anti_air_cannon/almayer_aa_cannon +GLOBAL_DATUM(almayer_aa_cannon, /obj/structure/anti_air_cannon) /obj/structure/anti_air_cannon name = "\improper IX-50 MGAD Cannon" @@ -20,14 +20,14 @@ var/obj/structure/anti_air_cannon/almayer_aa_cannon /obj/structure/anti_air_cannon/New() . = ..() - if(!almayer_aa_cannon) - almayer_aa_cannon = src + if(!GLOB.almayer_aa_cannon) + GLOB.almayer_aa_cannon = src /obj/structure/anti_air_cannon/Destroy() . = ..() - if(almayer_aa_cannon == src) - almayer_aa_cannon = null - message_admins("Reference to almayer_aa_cannon is lost!") + if(GLOB.almayer_aa_cannon == src) + GLOB.almayer_aa_cannon = null + message_admins("Reference to GLOB.almayer_aa_cannon is lost!") /obj/structure/anti_air_cannon/ex_act() return @@ -79,7 +79,7 @@ var/obj/structure/anti_air_cannon/almayer_aa_cannon data["sections"] = list() - for(var/section in almayer_ship_sections) + for(var/section in GLOB.almayer_ship_sections) data["sections"] += list(list( "section_id" = section, )) @@ -89,8 +89,8 @@ var/obj/structure/anti_air_cannon/almayer_aa_cannon /obj/structure/machinery/computer/aa_console/ui_data(mob/user) var/list/data = list() - data["disabled"] = almayer_aa_cannon.is_disabled - data["protecting_section"] = almayer_aa_cannon.protecting_section + data["disabled"] = GLOB.almayer_aa_cannon.is_disabled + data["protecting_section"] = GLOB.almayer_aa_cannon.protecting_section return data @@ -99,20 +99,20 @@ var/obj/structure/anti_air_cannon/almayer_aa_cannon if(.) return - if(!almayer_aa_cannon) + if(!GLOB.almayer_aa_cannon) return switch(action) if("protect") - almayer_aa_cannon.protecting_section = params["section_id"] - if(!(almayer_aa_cannon.protecting_section in almayer_ship_sections)) - almayer_aa_cannon.protecting_section = "" + GLOB.almayer_aa_cannon.protecting_section = params["section_id"] + if(!(GLOB.almayer_aa_cannon.protecting_section in GLOB.almayer_ship_sections)) + GLOB.almayer_aa_cannon.protecting_section = "" return - message_admins("[key_name(usr)] has set the AA to [html_encode(almayer_aa_cannon.protecting_section)].") - log_ares_antiair("[usr] Set AA to cover [html_encode(almayer_aa_cannon.protecting_section)].") + message_admins("[key_name(usr)] has set the AA to [html_encode(GLOB.almayer_aa_cannon.protecting_section)].") + log_ares_antiair("[usr] Set AA to cover [html_encode(GLOB.almayer_aa_cannon.protecting_section)].") . = TRUE if("deactivate") - almayer_aa_cannon.protecting_section = "" + GLOB.almayer_aa_cannon.protecting_section = "" message_admins("[key_name(usr)] has deactivated the AA cannon.") log_ares_antiair("[usr] Deactivated Anti Air systems.") . = TRUE diff --git a/code/modules/cm_marines/codebook.dm b/code/modules/cm_marines/codebook.dm index 11013f764538..64e74fba2c9a 100644 --- a/code/modules/cm_marines/codebook.dm +++ b/code/modules/cm_marines/codebook.dm @@ -11,10 +11,10 @@ GLOBAL_LIST_EMPTY(codebook_data) var/letter var/code_data = "
    [t] (unban)
    BANNED
    WHITELISTED
    BANNED
    WHITELISTED
    " for(var/i in 1 to 10) - letter = pick(greek_letters) + letter = pick(GLOB.greek_letters) number = rand(100,999) code_data += "" - letter = pick(greek_letters) + letter = pick(GLOB.greek_letters) number = rand(100,999) code_data += "" code_data += "
    CallResponse
    [letter]-[number][letter]-[number]
    " diff --git a/code/modules/cm_marines/dropship_ammo.dm b/code/modules/cm_marines/dropship_ammo.dm index ef59e643e4cf..53a22051299b 100644 --- a/code/modules/cm_marines/dropship_ammo.dm +++ b/code/modules/cm_marines/dropship_ammo.dm @@ -40,7 +40,7 @@ var/combat_equipment = TRUE /obj/structure/ship_ammo/attack_alien(mob/living/carbon/xenomorph/current_xenomorph) - if(unslashable) + if(unslashable) return XENO_NO_DELAY_ACTION current_xenomorph.animation_attack_on(src) playsound(src, 'sound/effects/metalhit.ogg', 25, 1) @@ -170,7 +170,7 @@ var/turf/impact_tile = pick(turf_list) sleep(1) var/datum/cause_data/cause_data = create_cause_data(initial(name), source_mob) - impact_tile.ex_act(EXPLOSION_THRESHOLD_VLOW, pick(alldirs), cause_data) + impact_tile.ex_act(EXPLOSION_THRESHOLD_VLOW, pick(GLOB.alldirs), cause_data) create_shrapnel(impact_tile,1,0,0,shrapnel_type,cause_data,FALSE,100) //simulates a bullet for(var/atom/movable/explosion_effect in impact_tile) if(iscarbon(explosion_effect)) diff --git a/code/modules/cm_marines/dropship_equipment.dm b/code/modules/cm_marines/dropship_equipment.dm index 851b91ea3e1a..b50198095aab 100644 --- a/code/modules/cm_marines/dropship_equipment.dm +++ b/code/modules/cm_marines/dropship_equipment.dm @@ -824,7 +824,7 @@ return var/list/possible_stretchers = list() - for(var/obj/structure/bed/medevac_stretcher/MS in activated_medevac_stretchers) + for(var/obj/structure/bed/medevac_stretcher/MS in GLOB.activated_medevac_stretchers) var/area/AR = get_area(MS) var/evaccee_name var/evaccee_triagecard_color @@ -1046,7 +1046,7 @@ return var/list/possible_fultons = list() - for(var/obj/item/stack/fulton/F in deployed_fultons) + for(var/obj/item/stack/fulton/F in GLOB.deployed_fultons) var/recovery_object if(F.attached_atom) recovery_object = F.attached_atom.name @@ -1148,7 +1148,7 @@ color = "#17d17a" /obj/structure/dropship_equipment/rappel_system/attack_hand(mob/living/carbon/human/user) - var/datum/cas_iff_group/cas_group = cas_groups[FACTION_MARINE] + var/datum/cas_iff_group/cas_group = GLOB.cas_groups[FACTION_MARINE] var/list/targets = cas_group.cas_signals if(!LAZYLEN(targets)) diff --git a/code/modules/cm_marines/equipment/kit_boxes.dm b/code/modules/cm_marines/equipment/kit_boxes.dm index 4a7864dbe0f5..342f9a775718 100644 --- a/code/modules/cm_marines/equipment/kit_boxes.dm +++ b/code/modules/cm_marines/equipment/kit_boxes.dm @@ -213,13 +213,13 @@ return TRUE /obj/item/spec_kit/proc/select_and_spawn(mob/living/carbon/human/user) - var/selection = tgui_input_list(user, "Pick your specialist equipment type.", "Specialist Kit Selection", available_specialist_kit_boxes) + var/selection = tgui_input_list(user, "Pick your specialist equipment type.", "Specialist Kit Selection", GLOB.available_specialist_kit_boxes) if(!selection || QDELETED(src)) return FALSE if(!skillcheckexplicit(user, SKILL_SPEC_WEAPONS, SKILL_SPEC_TRAINED) && !skillcheckexplicit(user, SKILL_SPEC_WEAPONS, SKILL_SPEC_ALL)) to_chat(user, SPAN_WARNING("You already unwrapped your [name], give this one to someone else!")) return - if(!available_specialist_kit_boxes[selection] || available_specialist_kit_boxes[selection] <= 0) + if(!GLOB.available_specialist_kit_boxes[selection] || GLOB.available_specialist_kit_boxes[selection] <= 0) to_chat(user, SPAN_WARNING("No more kits of this type may be chosen!")) return FALSE var/obj/item/card/id/ID = user.wear_id diff --git a/code/modules/cm_marines/equipment/mortar/mortars.dm b/code/modules/cm_marines/equipment/mortar/mortars.dm index 86bc3f5917c0..a4d4cfdc1bf5 100644 --- a/code/modules/cm_marines/equipment/mortar/mortars.dm +++ b/code/modules/cm_marines/equipment/mortar/mortars.dm @@ -314,7 +314,7 @@ if(get_turf(M) == target) relative_dir = 0 else - relative_dir = get_dir(M, target) + relative_dir = Get_Compass_Dir(M, target) M.show_message( \ SPAN_DANGER("A SHELL IS COMING DOWN [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), SHOW_MESSAGE_VISIBLE, \ SPAN_DANGER("YOU HEAR SOMETHING COMING DOWN [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), SHOW_MESSAGE_AUDIBLE \ @@ -324,7 +324,7 @@ if(get_turf(M) == target) relative_dir = 0 else - relative_dir = get_dir(M, target) + relative_dir = Get_Compass_Dir(M, target) M.show_message( \ SPAN_HIGHDANGER("A SHELL IS ABOUT TO IMPACT [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), SHOW_MESSAGE_VISIBLE, \ SPAN_HIGHDANGER("YOU HEAR SOMETHING VERY CLOSE COMING DOWN [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), SHOW_MESSAGE_AUDIBLE \ diff --git a/code/modules/cm_marines/m2c.dm b/code/modules/cm_marines/m2c.dm index 75c96f67176b..f61c9ef89659 100644 --- a/code/modules/cm_marines/m2c.dm +++ b/code/modules/cm_marines/m2c.dm @@ -445,7 +445,7 @@ //ATTACK WITH BOTH HANDS COMBO -/obj/structure/machinery/m56d_hmg/auto/attack_hand(mob/user) +/obj/structure/machinery/m56d_hmg/auto/attack_hand(mob/living/user) ..() var/turf/user_turf = get_turf(user) @@ -515,16 +515,13 @@ ..() ADD_TRAIT(user, TRAIT_OVERRIDE_CLICKDRAG, TRAIT_SOURCE_WEAPON) RegisterSignal(user, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(disable_interaction)) - RegisterSignal(user, COMSIG_MOB_POST_UPDATE_CANMOVE, PROC_REF(disable_canmove_interaction)) + RegisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(body_position_changed)) // DISMOUNT THE MG /obj/structure/machinery/m56d_hmg/auto/on_unset_interaction(mob/user) REMOVE_TRAIT(user, TRAIT_OVERRIDE_CLICKDRAG, TRAIT_SOURCE_WEAPON) - UnregisterSignal(user, list( - COMSIG_MOVABLE_PRE_MOVE, - COMSIG_MOB_POST_UPDATE_CANMOVE - )) + UnregisterSignal(user, COMSIG_MOVABLE_PRE_MOVE) ..() // GET ANIMATED @@ -557,7 +554,7 @@ animate(user, pixel_x=diff_x, pixel_y=diff_y, 0.4 SECONDS) else if(user.client) - user.client.change_view(world_view_size) + user.client.change_view(GLOB.world_view_size) user.client.pixel_x = 0 user.client.pixel_y = 0 @@ -598,16 +595,16 @@ to_chat(user, SPAN_NOTICE("You rotate [src], using the tripod to support your pivoting movement.")) -/obj/structure/machinery/m56d_hmg/auto/proc/disable_interaction(mob/user, NewLoc, direction) +/obj/structure/machinery/m56d_hmg/auto/proc/disable_interaction(mob/living/user, NewLoc, direction) SIGNAL_HANDLER - if(user.lying || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) + if(user.body_position != STANDING_UP || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) user.unset_interaction() -/obj/structure/machinery/m56d_hmg/auto/proc/disable_canmove_interaction(mob/user, canmove, laid_down, lying) +/obj/structure/machinery/m56d_hmg/auto/proc/body_position_changed(mob/living/user, body_position, old_body_position) SIGNAL_HANDLER - if(laid_down) + if(body_position != STANDING_UP) user.unset_interaction() /obj/structure/machinery/m56d_hmg/auto/proc/handle_rotating_gun(mob/user) diff --git a/code/modules/cm_marines/marines_consoles.dm b/code/modules/cm_marines/marines_consoles.dm index a3bea392c201..994e9f1ddcb2 100644 --- a/code/modules/cm_marines/marines_consoles.dm +++ b/code/modules/cm_marines/marines_consoles.dm @@ -199,7 +199,7 @@ if(is_centcom) new_access = get_access(ACCESS_LIST_WY_ALL) else - var/datum/job/job = RoleAuthority.roles_for_mode[target] + var/datum/job/job = GLOB.RoleAuthority.roles_for_mode[target] if(!job) visible_message("[SPAN_BOLD("[src]")] states, \"DATA ERROR: Can not find next entry in database: [target]\"") @@ -293,7 +293,7 @@ /obj/structure/machinery/computer/card/ui_static_data(mob/user) var/list/data = list() - data["station_name"] = station_name + data["station_name"] = MAIN_SHIP_NAME data["centcom_access"] = is_centcom data["manifest"] = GLOB.data_core.get_manifest(FALSE, FALSE, TRUE) @@ -303,25 +303,25 @@ else if(Check_WO()) // I am not sure about WOs departments so it may need adjustment departments = list( - CARDCON_DEPARTMENT_COMMAND = ROLES_CIC & ROLES_WO, - CARDCON_DEPARTMENT_AUXCOM = ROLES_AUXIL_SUPPORT & ROLES_WO, - CARDCON_DEPARTMENT_MISC = ROLES_MISC & ROLES_WO, - CARDCON_DEPARTMENT_SECURITY = ROLES_POLICE & ROLES_WO, - CARDCON_DEPARTMENT_ENGINEERING = ROLES_ENGINEERING & ROLES_WO, - CARDCON_DEPARTMENT_SUPPLY = ROLES_REQUISITION & ROLES_WO, - CARDCON_DEPARTMENT_MEDICAL = ROLES_MEDICAL & ROLES_WO, - CARDCON_DEPARTMENT_MARINE = ROLES_MARINES + CARDCON_DEPARTMENT_COMMAND = GLOB.ROLES_CIC & GLOB.ROLES_WO, + CARDCON_DEPARTMENT_AUXCOM = GLOB.ROLES_AUXIL_SUPPORT & GLOB.ROLES_WO, + CARDCON_DEPARTMENT_MISC = GLOB.ROLES_MISC & GLOB.ROLES_WO, + CARDCON_DEPARTMENT_SECURITY = GLOB.ROLES_POLICE & GLOB.ROLES_WO, + CARDCON_DEPARTMENT_ENGINEERING = GLOB.ROLES_ENGINEERING & GLOB.ROLES_WO, + CARDCON_DEPARTMENT_SUPPLY = GLOB.ROLES_REQUISITION & GLOB.ROLES_WO, + CARDCON_DEPARTMENT_MEDICAL = GLOB.ROLES_MEDICAL & GLOB.ROLES_WO, + CARDCON_DEPARTMENT_MARINE = GLOB.ROLES_MARINES ) else departments = list( - CARDCON_DEPARTMENT_COMMAND = ROLES_CIC - ROLES_WO, - CARDCON_DEPARTMENT_AUXCOM = ROLES_AUXIL_SUPPORT - ROLES_WO, - CARDCON_DEPARTMENT_MISC = ROLES_MISC - ROLES_WO, - CARDCON_DEPARTMENT_SECURITY = ROLES_POLICE - ROLES_WO, - CARDCON_DEPARTMENT_ENGINEERING = ROLES_ENGINEERING - ROLES_WO, - CARDCON_DEPARTMENT_SUPPLY = ROLES_REQUISITION - ROLES_WO, - CARDCON_DEPARTMENT_MEDICAL = ROLES_MEDICAL - ROLES_WO, - CARDCON_DEPARTMENT_MARINE = ROLES_MARINES + CARDCON_DEPARTMENT_COMMAND = GLOB.ROLES_CIC - GLOB.ROLES_WO, + CARDCON_DEPARTMENT_AUXCOM = GLOB.ROLES_AUXIL_SUPPORT - GLOB.ROLES_WO, + CARDCON_DEPARTMENT_MISC = GLOB.ROLES_MISC - GLOB.ROLES_WO, + CARDCON_DEPARTMENT_SECURITY = GLOB.ROLES_POLICE - GLOB.ROLES_WO, + CARDCON_DEPARTMENT_ENGINEERING = GLOB.ROLES_ENGINEERING - GLOB.ROLES_WO, + CARDCON_DEPARTMENT_SUPPLY = GLOB.ROLES_REQUISITION - GLOB.ROLES_WO, + CARDCON_DEPARTMENT_MEDICAL = GLOB.ROLES_MEDICAL - GLOB.ROLES_WO, + CARDCON_DEPARTMENT_MARINE = GLOB.ROLES_MARINES ) data["jobs"] = list() for(var/department in departments) @@ -376,7 +376,7 @@ /obj/structure/machinery/computer/card/ui_data(mob/user) var/list/data = list() - data["station_name"] = station_name + data["station_name"] = MAIN_SHIP_NAME data["authenticated"] = authenticated data["has_id"] = !!target_id_card @@ -432,7 +432,7 @@ set name = "Eject ID Card" set src in oview(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(user_id_card) user_id_card.loc = get_turf(src) @@ -498,7 +498,7 @@ set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(ishuman(usr) && ID_to_modify) to_chat(usr, "You remove \the [ID_to_modify] from \the [src].") @@ -560,7 +560,7 @@ var/datum/squad/selected = get_squad_by_name(params["name"]) if(!selected) return - if(RoleAuthority.check_squad_capacity(person_to_modify, selected)) + if(GLOB.RoleAuthority.check_squad_capacity(person_to_modify, selected)) visible_message("[SPAN_BOLD("[src]")] states, \"CAPACITY ERROR: [selected] can't have another [person_to_modify.job].\"") return TRUE if(transfer_marine_to_squad(person_to_modify, selected, person_to_modify.assigned_squad, ID_to_modify)) @@ -594,7 +594,7 @@ /obj/structure/machinery/computer/squad_changer/ui_static_data(mob/user) var/list/data = list() var/list/squads = list() - for(var/datum/squad/current_squad in RoleAuthority.squads) + for(var/datum/squad/current_squad in GLOB.RoleAuthority.squads) if(current_squad.name != "Root" && !current_squad.locked && current_squad.active && current_squad.faction == faction) var/list/squad = list(list( "name" = current_squad.name, @@ -1005,7 +1005,7 @@ GLOBAL_LIST_EMPTY_TYPED(crewmonitor, /datum/crewmonitor) RAIDER_SQUAD = 131, ) var/squad_number = 70 - for(var/squad_name in ROLES_SQUAD_ALL + "") + for(var/squad_name in GLOB.ROLES_SQUAD_ALL + "") if(!squad_name) squad_number = 120 else squad_name += " " jobs += list( diff --git a/code/modules/cm_marines/orbital_cannon.dm b/code/modules/cm_marines/orbital_cannon.dm index edcb5a836b5d..c9ec4190ce90 100644 --- a/code/modules/cm_marines/orbital_cannon.dm +++ b/code/modules/cm_marines/orbital_cannon.dm @@ -1,8 +1,8 @@ //global vars -var/obj/structure/orbital_cannon/almayer_orbital_cannon -var/list/ob_type_fuel_requirements +GLOBAL_DATUM(almayer_orbital_cannon, /obj/structure/orbital_cannon) +GLOBAL_LIST(ob_type_fuel_requirements) /obj/structure/orbital_cannon name = "\improper Orbital Cannon" @@ -30,16 +30,16 @@ var/list/ob_type_fuel_requirements /obj/structure/orbital_cannon/New() ..() - if(!almayer_orbital_cannon) - almayer_orbital_cannon = src + if(!GLOB.almayer_orbital_cannon) + GLOB.almayer_orbital_cannon = src - if(!ob_type_fuel_requirements) - ob_type_fuel_requirements = list() + if(!GLOB.ob_type_fuel_requirements) + GLOB.ob_type_fuel_requirements = list() var/list/L = list(4,5,6) var/amt for(var/i=1 to 3) amt = pick_n_take(L) - ob_type_fuel_requirements += amt + GLOB.ob_type_fuel_requirements += amt var/turf/T = locate(x+1,y+2,z) var/obj/structure/orbital_tray/O = new(T) @@ -48,9 +48,9 @@ var/list/ob_type_fuel_requirements /obj/structure/orbital_cannon/Destroy() QDEL_NULL(tray) - if(almayer_orbital_cannon == src) - almayer_orbital_cannon = null - message_admins("Reference to almayer_orbital_cannon is lost!") + if(GLOB.almayer_orbital_cannon == src) + GLOB.almayer_orbital_cannon = null + message_admins("Reference to GLOB.almayer_orbital_cannon is lost!") return ..() /obj/structure/orbital_cannon/ex_act() @@ -190,17 +190,16 @@ var/list/ob_type_fuel_requirements update_icon() -/var/global/list/orbital_cannon_cancellation = new - +GLOBAL_LIST_EMPTY(orbital_cannon_cancellation) /obj/structure/orbital_cannon/proc/get_misfuel_amount() switch(tray.warhead.warhead_kind) if("explosive") - return abs(ob_type_fuel_requirements[1] - tray.fuel_amt) + return abs(GLOB.ob_type_fuel_requirements[1] - tray.fuel_amt) if("incendiary") - return abs(ob_type_fuel_requirements[2] - tray.fuel_amt) + return abs(GLOB.ob_type_fuel_requirements[2] - tray.fuel_amt) if("cluster") - return abs(ob_type_fuel_requirements[3] - tray.fuel_amt) + return abs(GLOB.ob_type_fuel_requirements[3] - tray.fuel_amt) return 0 /obj/structure/orbital_cannon/proc/fire_ob_cannon(turf/T, mob/user, squad_behalf) @@ -389,7 +388,7 @@ var/list/ob_type_fuel_requirements playsound(target, 'sound/weapons/gun_orbital_travel.ogg', 100, 1, 75) var/cancellation_token = rand(0,32000) - orbital_cannon_cancellation["[cancellation_token]"] = src + GLOB.orbital_cannon_cancellation["[cancellation_token]"] = src message_admins(FONT_SIZE_XL("CLICK TO CANCEL THIS OB")) var/relative_dir @@ -397,7 +396,7 @@ var/list/ob_type_fuel_requirements if(get_turf(M) == target) relative_dir = 0 else - relative_dir = get_dir(M, target) + relative_dir = Get_Compass_Dir(M, target) M.show_message( \ SPAN_HIGHDANGER("The sky erupts into flames [SPAN_UNDERLINE(relative_dir ? ("to the " + dir2text(relative_dir)) : "right above you")]!"), SHOW_MESSAGE_VISIBLE, \ SPAN_HIGHDANGER("You hear a very loud sound coming from above to the [SPAN_UNDERLINE(relative_dir ? ("to the " + dir2text(relative_dir)) : "right above you")]!"), SHOW_MESSAGE_AUDIBLE \ @@ -408,7 +407,7 @@ var/list/ob_type_fuel_requirements if(get_turf(M) == target) relative_dir = 0 else - relative_dir = get_dir(M, target) + relative_dir = Get_Compass_Dir(M, target) M.show_message( \ SPAN_HIGHDANGER("The sky roars louder [SPAN_UNDERLINE(relative_dir ? ("to the " + dir2text(relative_dir)) : "right above you")]!"), SHOW_MESSAGE_VISIBLE, \ SPAN_HIGHDANGER("The sound becomes louder [SPAN_UNDERLINE(relative_dir ? ("to the " + dir2text(relative_dir)) : "right above you")]!"), SHOW_MESSAGE_AUDIBLE \ @@ -422,9 +421,9 @@ var/list/ob_type_fuel_requirements ) sleep(OB_TRAVEL_TIMING/3) - if(orbital_cannon_cancellation["[cancellation_token]"]) // the cancelling notification is in the topic + if(GLOB.orbital_cannon_cancellation["[cancellation_token]"]) // the cancelling notification is in the topic target.ceiling_debris_check(5) - orbital_cannon_cancellation["[cancellation_token]"] = null + GLOB.orbital_cannon_cancellation["[cancellation_token]"] = null return TRUE return FALSE @@ -447,7 +446,7 @@ var/list/ob_type_fuel_requirements shake_camera(user, 3, total_shake_factor, shake_frequency) user.KnockDown(rand(max_knockdown_time * distance_percent, (max_knockdown_time * distance_percent + 1))) - if(!user.knocked_down) + if(HAS_TRAIT(user, TRAIT_FLOORED)) continue to_chat(user, SPAN_WARNING("You are thrown off balance and fall to the ground!")) @@ -627,33 +626,33 @@ var/list/ob_type_fuel_requirements /obj/structure/machinery/computer/orbital_cannon_console/ui_static_data(mob/user) var/list/data = list() - data["hefuel"] = ob_type_fuel_requirements[1] - data["incfuel"] = ob_type_fuel_requirements[2] - data["clusterfuel"] = ob_type_fuel_requirements[3] + data["hefuel"] = GLOB.ob_type_fuel_requirements[1] + data["incfuel"] = GLOB.ob_type_fuel_requirements[2] + data["clusterfuel"] = GLOB.ob_type_fuel_requirements[3] - data["linkedcannon"] = almayer_orbital_cannon - data["linkedtray"] = almayer_orbital_cannon.tray + data["linkedcannon"] = GLOB.almayer_orbital_cannon + data["linkedtray"] = GLOB.almayer_orbital_cannon.tray return data /obj/structure/machinery/computer/orbital_cannon_console/ui_data(mob/user) var/list/data = list() - data["loadedtray"] = almayer_orbital_cannon.loaded_tray - data["chamberedtray"] = almayer_orbital_cannon.chambered_tray + data["loadedtray"] = GLOB.almayer_orbital_cannon.loaded_tray + data["chamberedtray"] = GLOB.almayer_orbital_cannon.chambered_tray var/warhead_name = null - if(almayer_orbital_cannon.tray.warhead) - warhead_name = almayer_orbital_cannon.tray.warhead.name + if(GLOB.almayer_orbital_cannon.tray.warhead) + warhead_name = GLOB.almayer_orbital_cannon.tray.warhead.name data["warhead"] = warhead_name - data["fuel"] = almayer_orbital_cannon.tray.fuel_amt + data["fuel"] = GLOB.almayer_orbital_cannon.tray.fuel_amt data["worldtime"] = world.time - data["nextchambertime"] = almayer_orbital_cannon.ob_chambering_cooldown - data["chamber_cooldown"] = almayer_orbital_cannon.chamber_cooldown_time + data["nextchambertime"] = GLOB.almayer_orbital_cannon.ob_chambering_cooldown + data["chamber_cooldown"] = GLOB.almayer_orbital_cannon.chamber_cooldown_time - data["disabled"] = almayer_orbital_cannon.is_disabled + data["disabled"] = GLOB.almayer_orbital_cannon.is_disabled return data @@ -664,15 +663,15 @@ var/list/ob_type_fuel_requirements switch(action) if("load_tray") - almayer_orbital_cannon.load_tray(usr) + GLOB.almayer_orbital_cannon.load_tray(usr) . = TRUE if("unload_tray") - almayer_orbital_cannon.unload_tray(usr) + GLOB.almayer_orbital_cannon.unload_tray(usr) . = TRUE if("chamber_tray") - almayer_orbital_cannon.chamber_payload(usr) + GLOB.almayer_orbital_cannon.chamber_payload(usr) . = TRUE add_fingerprint(usr) diff --git a/code/modules/cm_marines/overwatch.dm b/code/modules/cm_marines/overwatch.dm index 3cf33ebd391e..c5b296772c79 100644 --- a/code/modules/cm_marines/overwatch.dm +++ b/code/modules/cm_marines/overwatch.dm @@ -115,7 +115,7 @@ if(!current_squad) data["squad_list"] = list() - for(var/datum/squad/current_squad in RoleAuthority.squads) + for(var/datum/squad/current_squad in GLOB.RoleAuthority.squads) if(current_squad.active && !current_squad.overwatch_officer && current_squad.faction == faction && current_squad.name != "Root") data["squad_list"] += current_squad.name return data @@ -205,7 +205,7 @@ acting_sl = " (acting SL)" is_squad_leader = TRUE else if(current_turf && (current_turf.z == SL_z)) - distance = "[get_dist(marine_human, current_squad.squad_leader)] ([dir2text_short(get_dir(current_squad.squad_leader, marine_human))])" + distance = "[get_dist(marine_human, current_squad.squad_leader)] ([dir2text_short(Get_Compass_Dir(current_squad.squad_leader, marine_human))])" switch(marine_human.stat) @@ -318,8 +318,8 @@ data["can_launch_crates"] = has_supply_pad data["has_crate_loaded"] = supply_crate data["supply_cooldown"] = COOLDOWN_TIMELEFT(current_squad, next_supplydrop) - data["ob_cooldown"] = COOLDOWN_TIMELEFT(almayer_orbital_cannon, ob_firing_cooldown) - data["ob_loaded"] = almayer_orbital_cannon.chambered_tray + data["ob_cooldown"] = COOLDOWN_TIMELEFT(GLOB.almayer_orbital_cannon, ob_firing_cooldown) + data["ob_loaded"] = GLOB.almayer_orbital_cannon.chambered_tray data["operator"] = operator.name @@ -343,7 +343,7 @@ if(current_squad) return var/datum/squad/selected_squad - for(var/datum/squad/searching_squad in RoleAuthority.squads) + for(var/datum/squad/searching_squad in GLOB.RoleAuthority.squads) if(searching_squad.active && !searching_squad.overwatch_officer && searching_squad.faction == faction && searching_squad.name != "Root" && searching_squad.name == params["squad"]) selected_squad = searching_squad break @@ -456,10 +456,10 @@ return x_bomb = text2num(params["x"]) y_bomb = text2num(params["y"]) - if(almayer_orbital_cannon.is_disabled) + if(GLOB.almayer_orbital_cannon.is_disabled) to_chat(user, "[icon2html(src, usr)] [SPAN_WARNING("Orbital bombardment cannon disabled!")]") - else if(!COOLDOWN_FINISHED(almayer_orbital_cannon, ob_firing_cooldown)) - to_chat(user, "[icon2html(src, usr)] [SPAN_WARNING("Orbital bombardment cannon not yet ready to fire again! Please wait [COOLDOWN_TIMELEFT(almayer_orbital_cannon, ob_firing_cooldown)/10] seconds.")]") + else if(!COOLDOWN_FINISHED(GLOB.almayer_orbital_cannon, ob_firing_cooldown)) + to_chat(user, "[icon2html(src, usr)] [SPAN_WARNING("Orbital bombardment cannon not yet ready to fire again! Please wait [COOLDOWN_TIMELEFT(GLOB.almayer_orbital_cannon, ob_firing_cooldown)/10] seconds.")]") else handle_bombard(user) @@ -506,7 +506,7 @@ user.UnregisterSignal(cam, COMSIG_PARENT_QDELETING) cam = null user.reset_view(null) - else if(user.client.view != world_view_size) + else if(user.client.view != GLOB.world_view_size) to_chat(user, SPAN_WARNING("You're too busy peering through binoculars.")) else if(cam) @@ -631,9 +631,9 @@ var/area/ob_area = get_area(target) if(!ob_area) return - var/ob_type = almayer_orbital_cannon.tray.warhead ? almayer_orbital_cannon.tray.warhead.warhead_kind : "UNKNOWN" + var/ob_type = GLOB.almayer_orbital_cannon.tray.warhead ? GLOB.almayer_orbital_cannon.tray.warhead.warhead_kind : "UNKNOWN" - for(var/datum/squad/S in RoleAuthority.squads) + for(var/datum/squad/S in GLOB.RoleAuthority.squads) if(!S.active) continue for(var/mob/living/carbon/human/M in S.marines_list) @@ -700,7 +700,7 @@ return var/list/available_squads = list() - for(var/datum/squad/squad as anything in RoleAuthority.squads) + for(var/datum/squad/squad as anything in GLOB.RoleAuthority.squads) if(squad.active && !squad.locked && squad.faction == faction && squad.name != "Root") available_squads += squad @@ -721,7 +721,7 @@ to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("[transfer_marine] is already in [new_squad]!")]") return - if(RoleAuthority.check_squad_capacity(transfer_marine, new_squad)) + if(GLOB.RoleAuthority.check_squad_capacity(transfer_marine, new_squad)) to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("Transfer aborted. [new_squad] can't have another [transfer_marine.job].")]") return @@ -744,7 +744,7 @@ to_chat(user, "[icon2html(src, user)] [SPAN_WARNING("No squad selected!")]") return - if(!almayer_orbital_cannon.chambered_tray) + if(!GLOB.almayer_orbital_cannon.chambered_tray) to_chat(user, "[icon2html(src, user)] [SPAN_WARNING("The orbital cannon has no ammo chambered.")]") return @@ -794,8 +794,8 @@ if(!T) return - var/ob_name = lowertext(almayer_orbital_cannon.tray.warhead.name) - var/mutable_appearance/warhead_appearance = mutable_appearance(almayer_orbital_cannon.tray.warhead.icon, almayer_orbital_cannon.tray.warhead.icon_state) + var/ob_name = lowertext(GLOB.almayer_orbital_cannon.tray.warhead.name) + var/mutable_appearance/warhead_appearance = mutable_appearance(GLOB.almayer_orbital_cannon.tray.warhead.icon, GLOB.almayer_orbital_cannon.tray.warhead.icon_state) notify_ghosts(header = "Bombardment Inbound", message = "\A [ob_name] targeting [get_area(T)] has been fired!", source = T, alert_overlay = warhead_appearance, extra_large = TRUE) /// Project ARES interface log. @@ -803,7 +803,7 @@ busy = FALSE if(istype(T)) - almayer_orbital_cannon.fire_ob_cannon(T, user, current_squad) + GLOB.almayer_orbital_cannon.fire_ob_cannon(T, user, current_squad) user.count_niche_stat(STATISTICS_NICHE_OB) /obj/structure/machinery/computer/overwatch/proc/handle_supplydrop() diff --git a/code/modules/cm_marines/shuttle_backend.dm b/code/modules/cm_marines/shuttle_backend.dm index 3de169d773e5..142caa81eb8a 100644 --- a/code/modules/cm_marines/shuttle_backend.dm +++ b/code/modules/cm_marines/shuttle_backend.dm @@ -87,11 +87,6 @@ DOCUMENTATION ON HOW TO ADD A NEW SHUTTLE: Fourkhan, 6/7/19 */ -var/global/list/s_info = null - -/proc/loadShuttleInfoDatums() - s_info = list() - return 1 /proc/get_shuttle_turfs(turf/ref, list/L) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 225b85506279..8b6dde5527e2 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -839,7 +839,7 @@ to_chat(usr, SPAN_NOTICE("You are too far from the handles to man [src]!")) /obj/structure/machinery/m56d_hmg/on_set_interaction(mob/user) - RegisterSignal(user, list(COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_MOB_KNOCKED_DOWN), PROC_REF(exit_interaction)) + RegisterSignal(user, list(COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_LIVING_SET_BODY_POSITION), PROC_REF(exit_interaction)) flags_atom |= RELAY_CLICK user.status_flags |= IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] mans \the [src]."),SPAN_NOTICE("You man \the [src], locked and loaded!")) @@ -854,7 +854,7 @@ update_pixels(user) operator = user -/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/user) +/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/living/user) flags_atom &= ~RELAY_CLICK SEND_SIGNAL(src, COMSIG_GUN_INTERRUPT_FIRE) user.status_flags &= ~IMMOBILE_ACTION @@ -875,7 +875,7 @@ COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, - COMSIG_MOB_KNOCKED_DOWN, + COMSIG_LIVING_SET_BODY_POSITION, )) @@ -910,13 +910,13 @@ animate(user, pixel_x=diff_x, pixel_y=diff_y, 0.4 SECONDS) else if(user.client) - user.client.change_view(world_view_size) + user.client.change_view(GLOB.world_view_size) user.client.pixel_x = 0 user.client.pixel_y = 0 animate(user, pixel_x=user_old_x, pixel_y=user_old_y, 4, 1) -/obj/structure/machinery/m56d_hmg/check_eye(mob/user) - if(user.lying || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) +/obj/structure/machinery/m56d_hmg/check_eye(mob/living/user) + if(user.body_position != STANDING_UP || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) user.unset_interaction() /obj/structure/machinery/m56d_hmg/clicked(mob/user, list/mods) diff --git a/code/modules/cm_marines/vehicle_part_fabricator.dm b/code/modules/cm_marines/vehicle_part_fabricator.dm index ca53d368bbd6..0095ff54a2ab 100644 --- a/code/modules/cm_marines/vehicle_part_fabricator.dm +++ b/code/modules/cm_marines/vehicle_part_fabricator.dm @@ -123,13 +123,13 @@ unacidable = TRUE /obj/structure/machinery/part_fabricator/dropship/get_point_store() - return supply_controller.dropship_points + return GLOB.supply_controller.dropship_points /obj/structure/machinery/part_fabricator/dropship/add_to_point_store(number = 1) - supply_controller.dropship_points += number + GLOB.supply_controller.dropship_points += number /obj/structure/machinery/part_fabricator/dropship/spend_point_store(number = 1) - supply_controller.dropship_points -= number + GLOB.supply_controller.dropship_points -= number /obj/structure/machinery/part_fabricator/dropship/ui_static_data(mob/user) var/list/static_data = list() @@ -230,13 +230,13 @@ indestructible = TRUE /obj/structure/machinery/part_fabricator/tank/get_point_store() - return supply_controller.tank_points + return GLOB.supply_controller.tank_points /obj/structure/machinery/part_fabricator/tank/add_to_point_store(number = 1) - supply_controller.tank_points += number + GLOB.supply_controller.tank_points += number /obj/structure/machinery/part_fabricator/tank/spend_point_store(number = 1) - supply_controller.tank_points -= number + GLOB.supply_controller.tank_points -= number /obj/structure/machinery/part_fabricator/tank/ui_static_data(mob/user) var/list/static_data = list() diff --git a/code/modules/cm_phone/phone.dm b/code/modules/cm_phone/phone.dm index fd9c8aa02d44..b4f13044bc20 100644 --- a/code/modules/cm_phone/phone.dm +++ b/code/modules/cm_phone/phone.dm @@ -26,6 +26,8 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter) var/enabled = TRUE /// Whether or not the phone is receiving calls or not. Varies between on/off or forcibly on/off. var/do_not_disturb = PHONE_DND_OFF + /// The Phone_ID of the last person to call this telephone. + var/last_caller var/base_icon_state @@ -138,6 +140,7 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter) var/list/data = list() data["availability"] = do_not_disturb + data["last_caller"] = last_caller return data @@ -175,6 +178,7 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter) calling = T T.caller = src + T.last_caller = src.phone_id T.update_icon() to_chat(user, SPAN_PURPLE("[icon2html(src, user)] Dialing [calling_phone_id]..")) diff --git a/code/modules/cm_preds/falcon.dm b/code/modules/cm_preds/falcon.dm index 63c7e72ab670..dc898a2b76ba 100644 --- a/code/modules/cm_preds/falcon.dm +++ b/code/modules/cm_preds/falcon.dm @@ -85,11 +85,11 @@ PF.flags_can_pass_all = PASS_ALL /mob/hologram/falcon/add_to_all_mob_huds() - var/datum/mob_hud/hud = huds[MOB_HUD_HUNTER] + var/datum/mob_hud/hud = GLOB.huds[MOB_HUD_HUNTER] hud.add_to_hud(src) /mob/hologram/falcon/remove_from_all_mob_huds() - var/datum/mob_hud/hud = huds[MOB_HUD_HUNTER] + var/datum/mob_hud/hud = GLOB.huds[MOB_HUD_HUNTER] hud.remove_from_hud(src) /mob/hologram/falcon/med_hud_set_status() diff --git a/code/modules/cm_preds/thrall_procs.dm b/code/modules/cm_preds/thrall_procs.dm index 8ea0f2abb51a..a28f6eba2662 100644 --- a/code/modules/cm_preds/thrall_procs.dm +++ b/code/modules/cm_preds/thrall_procs.dm @@ -14,7 +14,7 @@ to_chat(wearer, SPAN_WARNING("You've already claimed your equipment.")) return - if(wearer.is_mob_incapacitated() || wearer.lying || wearer.buckled) + if(wearer.is_mob_incapacitated() || wearer.body_position == LYING_DOWN /* replace by mobility_flags */ || wearer.buckled) to_chat(wearer, SPAN_WARNING("You're not able to do that right now.")) return diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index 7173575710b1..111a95d1089c 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -106,6 +106,7 @@ /// handles decloaking only on HUNTER gloves /obj/item/clothing/gloves/yautja/proc/decloak() + SIGNAL_HANDLER return /// Called to update the minimap icon of the predator @@ -408,7 +409,7 @@ . = wristblades_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/hunter/proc/wristblades_internal(mob/living/carbon/human/caller, forced = FALSE) - if(!caller.loc || !caller.canmove || caller.stat || !ishuman(caller)) + if(!caller.loc || caller.is_mob_incapacitated() || !ishuman(caller)) return . = check_random_function(caller, forced) @@ -496,7 +497,7 @@ if(dist < closest) closest = dist closest_item = tracked_item - direction = get_dir(M,loc) + direction = Get_Compass_Dir(M,loc) areaLoc = loc for(var/mob/living/carbon/human/Y as anything in GLOB.yautja_mob_list) if(Y.stat != DEAD) @@ -513,7 +514,7 @@ var/dist = get_dist(M,Y) if(dist < closest) closest = dist - direction = get_dir(M,Y) + direction = Get_Compass_Dir(M,Y) areaLoc = loc var/output = FALSE @@ -590,9 +591,9 @@ playsound(M.loc,'sound/effects/pred_cloakon.ogg', 15, 1) animate(M, alpha = new_alpha, time = 1.5 SECONDS, easing = SINE_EASING|EASE_OUT) - var/datum/mob_hud/security/advanced/SA = huds[MOB_HUD_SECURITY_ADVANCED] + var/datum/mob_hud/security/advanced/SA = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] SA.remove_from_hud(M) - var/datum/mob_hud/xeno_infection/XI = huds[MOB_HUD_XENO_INFECTION] + var/datum/mob_hud/xeno_infection/XI = GLOB.huds[MOB_HUD_XENO_INFECTION] XI.remove_from_hud(M) anim(M.loc,M,'icons/mob/mob.dmi',,"cloak",,M.dir) @@ -632,9 +633,9 @@ user.see_invisible = initial(user.see_invisible) cloak_timer = world.time + (DECLOAK_STANDARD / 2) - var/datum/mob_hud/security/advanced/SA = huds[MOB_HUD_SECURITY_ADVANCED] + var/datum/mob_hud/security/advanced/SA = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] SA.add_to_hud(user) - var/datum/mob_hud/xeno_infection/XI = huds[MOB_HUD_XENO_INFECTION] + var/datum/mob_hud/xeno_infection/XI = GLOB.huds[MOB_HUD_XENO_INFECTION] XI.add_to_hud(user) anim(user.loc, user, 'icons/mob/mob.dmi', null, "uncloak", null, user.dir) @@ -648,7 +649,7 @@ . = caster_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/hunter/proc/caster_internal(mob/living/carbon/human/caller, forced = FALSE) - if(!caller.loc || !caller.canmove || caller.stat || !ishuman(caller)) + if(!caller.loc || caller.is_mob_incapacitated() || !ishuman(caller)) return . = check_random_function(caller, forced) diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index ae27809a3ec7..7e8e661e8a5e 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -172,7 +172,7 @@ STOP_PROCESSING(SSobj, src) if(istype(user) && user.wear_mask == src) //inventory reference is only cleared after dropped(). for(var/listed_hud in mask_huds) - var/datum/mob_hud/H = huds[listed_hud] + var/datum/mob_hud/H = GLOB.huds[listed_hud] H.remove_hud_from(user, src) var/obj/item/visor = user.glasses if(visor) //make your hud fuck off @@ -187,7 +187,7 @@ if(slot == WEAR_FACE) START_PROCESSING(SSobj, src) for(var/listed_hud in mask_huds) - var/datum/mob_hud/H = huds[listed_hud] + var/datum/mob_hud/H = GLOB.huds[listed_hud] H.add_hud_to(user, src) if(current_goggles) var/obj/item/clothing/gloves/yautja/bracer = user.gloves diff --git a/code/modules/cm_preds/yaut_procs.dm b/code/modules/cm_preds/yaut_procs.dm index 32d532da72a0..728e548dfd2f 100644 --- a/code/modules/cm_preds/yaut_procs.dm +++ b/code/modules/cm_preds/yaut_procs.dm @@ -48,7 +48,7 @@ set name = "Butcher" set desc = "Butcher a corpse you're standing on for its tasty meats." - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) return var/list/choices = list() @@ -77,7 +77,7 @@ to_chat(src, SPAN_WARNING("This tiny worm is not even worth using your tools on.")) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) return if(issynth(T)) @@ -236,7 +236,7 @@ to_chat(src, SPAN_WARNING("You've already claimed your equipment.")) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, SPAN_WARNING("You're not able to do that right now.")) return diff --git a/code/modules/cm_tech/droppod/gear_access_point.dm b/code/modules/cm_tech/droppod/gear_access_point.dm index b581764e2d3b..608fd33e18f4 100644 --- a/code/modules/cm_tech/droppod/gear_access_point.dm +++ b/code/modules/cm_tech/droppod/gear_access_point.dm @@ -43,9 +43,9 @@ return /obj/structure/techpod_vendor/proc/get_access_permission(mob/living/carbon/human/user) - if(SSticker.mode == GAMEMODE_WHISKEY_OUTPOST || master_mode == GAMEMODE_WHISKEY_OUTPOST) //all WO has lifted access restrictions + if(SSticker.mode == GAMEMODE_WHISKEY_OUTPOST || GLOB.master_mode == GAMEMODE_WHISKEY_OUTPOST) //all WO has lifted access restrictions return TRUE - else if(SSticker.mode == "Distress Signal" || master_mode == "Distress Signal") + else if(SSticker.mode == "Distress Signal" || GLOB.master_mode == "Distress Signal") if(access_settings_override) //everyone allowed to grab stuff return TRUE else if(user.get_target_lock(faction_requirement)) //only it's faction group allowed diff --git a/code/modules/cm_tech/hologram.dm b/code/modules/cm_tech/hologram.dm index 5c0e986f45b2..3509c0a73a7d 100644 --- a/code/modules/cm_tech/hologram.dm +++ b/code/modules/cm_tech/hologram.dm @@ -5,7 +5,6 @@ GLOBAL_LIST_EMPTY_TYPED(hologram_list, /mob/hologram) desc = "It seems to be a visual projection of someone" //jinkies! icon = 'icons/mob/mob.dmi' icon_state = "hologram" - canmove = TRUE blinded = FALSE invisibility = INVISIBILITY_OBSERVER diff --git a/code/modules/cm_tech/implements/stims.dm b/code/modules/cm_tech/implements/stims.dm index 7b0f74457a7f..f7307e2ef99b 100644 --- a/code/modules/cm_tech/implements/stims.dm +++ b/code/modules/cm_tech/implements/stims.dm @@ -47,7 +47,7 @@ return icon_state = "stimpack" - var/datum/reagent/R = chemical_reagents_list[chemname] + var/datum/reagent/R = GLOB.chemical_reagents_list[chemname] if(!R) return diff --git a/code/modules/cm_tech/implements/tank.dm b/code/modules/cm_tech/implements/tank.dm index ae7dfc580e38..ec1b81e9f675 100644 --- a/code/modules/cm_tech/implements/tank.dm +++ b/code/modules/cm_tech/implements/tank.dm @@ -31,8 +31,8 @@ /obj/item/vehicle_coupon/proc/redeem_vehicle(mob/user) SHOULD_NOT_SLEEP(TRUE) . = FALSE - var/obj/structure/machinery/computer/supplycomp/vehicle/comp = VehicleElevatorConsole - var/obj/structure/machinery/cm_vending/gear/vehicle_crew/gearcomp = VehicleGearConsole + var/obj/structure/machinery/computer/supplycomp/vehicle/comp = GLOB.VehicleElevatorConsole + var/obj/structure/machinery/cm_vending/gear/vehicle_crew/gearcomp = GLOB.VehicleGearConsole if(!comp || !gearcomp) return diff --git a/code/modules/cm_tech/research_memories.dm b/code/modules/cm_tech/research_memories.dm index d46a52b8b47a..4d84a762c719 100644 --- a/code/modules/cm_tech/research_memories.dm +++ b/code/modules/cm_tech/research_memories.dm @@ -14,8 +14,8 @@ clue_category["name"] = "Analyze Chemicals" clue_category["icon"] = "scroll" clue_category["clues"] = list() - for (var/chemid in chemical_data.chemical_not_completed_objective_list) - clue_category["clues"] += list(chemical_data.get_tgui_data(chemid)) + for (var/chemid in GLOB.chemical_data.chemical_not_completed_objective_list) + clue_category["clues"] += list(GLOB.chemical_data.get_tgui_data(chemid)) clue_categories += list(clue_category) return clue_categories @@ -51,7 +51,7 @@ "Analyze Chemicals", SSobjectives.statistics["chemicals_completed"], FALSE, - chemical_data.rsc_credits, + GLOB.chemical_data.rsc_credits, "white" )) @@ -60,9 +60,9 @@ /datum/research_objective_memory_interface/ui_data(mob/user) . = list() - .["research_credits"] = chemical_data.rsc_credits - var/clearance = "[chemical_data.clearance_level]" - if(chemical_data.clearance_x_access) + .["research_credits"] = GLOB.chemical_data.rsc_credits + var/clearance = "[GLOB.chemical_data.clearance_level]" + if(GLOB.chemical_data.clearance_x_access) clearance +="X" .["clearance"] = clearance .["objectives"] = get_objectives(user) diff --git a/code/modules/cm_tech/techs/marine/tier1/points.dm b/code/modules/cm_tech/techs/marine/tier1/points.dm index 739b82fa1504..d6bb5bace6fc 100644 --- a/code/modules/cm_tech/techs/marine/tier1/points.dm +++ b/code/modules/cm_tech/techs/marine/tier1/points.dm @@ -24,7 +24,7 @@ /datum/tech/repeatable/req_points/on_unlock() . = ..() - supply_controller.points += points_to_give * get_tech_scaling_value() + GLOB.supply_controller.points += points_to_give * get_tech_scaling_value() /datum/tech/repeatable/dropship_points name = "Dropship Budget Increase" @@ -44,4 +44,4 @@ /datum/tech/repeatable/dropship_points/on_unlock() . = ..() - supply_controller.dropship_points += points_to_give + GLOB.supply_controller.dropship_points += points_to_give diff --git a/code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm b/code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm index 2ab2c2541e68..d4f2ce6fc0ef 100644 --- a/code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm +++ b/code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm @@ -17,12 +17,12 @@ return var/datum/supply_order/O = new /datum/supply_order() - O.ordernum = supply_controller.ordernum - supply_controller.ordernum++ - O.object = supply_controller.supply_packs[type_to_give] + O.ordernum = GLOB.supply_controller.ordernum + GLOB.supply_controller.ordernum++ + O.object = GLOB.supply_controller.supply_packs[type_to_give] O.orderedby = MAIN_AI_SYSTEM - supply_controller.shoppinglist += O + GLOB.supply_controller.shoppinglist += O /datum/tech/repeatable/ob/he name = "Additional OB projectiles - HE" diff --git a/code/modules/cm_tech/techs/marine/tier4/nuke.dm b/code/modules/cm_tech/techs/marine/tier4/nuke.dm index f970f37a3fab..46ffb4a94193 100644 --- a/code/modules/cm_tech/techs/marine/tier4/nuke.dm +++ b/code/modules/cm_tech/techs/marine/tier4/nuke.dm @@ -21,13 +21,13 @@ . = ..() var/datum/supply_order/new_order = new() - new_order.ordernum = supply_controller.ordernum - supply_controller.ordernum++ - new_order.object = supply_controller.supply_packs["Encrypted Operational Nuke"] + new_order.ordernum = GLOB.supply_controller.ordernum + GLOB.supply_controller.ordernum++ + new_order.object = GLOB.supply_controller.supply_packs["Encrypted Operational Nuke"] new_order.orderedby = MAIN_AI_SYSTEM new_order.approvedby = MAIN_AI_SYSTEM - supply_controller.shoppinglist += new_order + GLOB.supply_controller.shoppinglist += new_order /datum/tech/nuke/can_unlock(mob/unlocking_mob) . = ..() @@ -36,7 +36,7 @@ return if(ROUND_TIME < NUKE_UNLOCK_TIME) - to_chat(unlocking_mob, SPAN_WARNING("You cannot purchase this node before [NUKE_UNLOCK_TIME / (1 MINUTES)] minutes into the operation.")) + to_chat(unlocking_mob, SPAN_WARNING("You cannot purchase this node before [Ceiling((NUKE_UNLOCK_TIME + SSticker.round_start_time) / (1 MINUTES))] minutes into the operation.")) return FALSE return TRUE diff --git a/code/modules/cm_tech/trees/marine.dm b/code/modules/cm_tech/trees/marine.dm index 8a805647e060..55e82882b848 100644 --- a/code/modules/cm_tech/trees/marine.dm +++ b/code/modules/cm_tech/trees/marine.dm @@ -161,7 +161,7 @@ GLOBAL_LIST_EMPTY(tech_controls_marine) if(!powered()) to_chat(user, SPAN_WARNING("This computer has no power!")) return FALSE - if(!intel_system) + if(!GLOB.intel_system) to_chat(user, SPAN_WARNING("The computer doesn't seem to be connected to anything...")) return FALSE if(user.action_busy) diff --git a/code/modules/defenses/defenses.dm b/code/modules/defenses/defenses.dm index 099b41aee72b..633b51801e27 100644 --- a/code/modules/defenses/defenses.dm +++ b/code/modules/defenses/defenses.dm @@ -408,9 +408,9 @@ damaged_action(damage) if(stat == DEFENSE_DAMAGED) - density = FALSE + set_density(FALSE) else - density = initial(density) + set_density(initial(density)) update_icon() diff --git a/code/modules/desert_dam/filtration/consoles.dm b/code/modules/desert_dam/filtration/consoles.dm index 8c2814fafde7..277b2485ed23 100644 --- a/code/modules/desert_dam/filtration/consoles.dm +++ b/code/modules/desert_dam/filtration/consoles.dm @@ -1,4 +1,4 @@ -var/global/river_activated = FALSE +GLOBAL_VAR_INIT(river_activated, FALSE) /obj/structure/machinery/filtration/console name = "console" @@ -62,7 +62,7 @@ var/global/river_activated = FALSE /obj/structure/machinery/filtration/console/ui_data(mob/user) var/list/data = list() - data["filt_on"] = river_activated + data["filt_on"] = GLOB.river_activated return data @@ -73,7 +73,7 @@ var/global/river_activated = FALSE switch(action) if("activate_filt") - river_activated = TRUE + GLOB.river_activated = TRUE /obj/structure/machinery/filtration/console/attack_hand(mob/user) . = ..() diff --git a/code/modules/desert_dam/filtration/filtration.dm b/code/modules/desert_dam/filtration/filtration.dm index 6c079f3dcd60..c289ae878bad 100644 --- a/code/modules/desert_dam/filtration/filtration.dm +++ b/code/modules/desert_dam/filtration/filtration.dm @@ -47,18 +47,6 @@ Global river status var, maybe Each var depends on others -var/global/riverend_west = 0 -var/global/riverend_north = 0 -var/global/river_central = 0 -var/global/cannal = 0 -var/global/dam_underpass = 0 -var/global/south_river = 0 -var/global/south_filtration = 0 -var/global/east_river = 0 -var/global/east_filtration = 0 -var/global/south_riverstart = 0 -var/global/east_riverstart = 0 - /proc/filtration_check() if(east_filtration) @@ -198,7 +186,7 @@ var/global/east_riverstart = 0 M.apply_damage(0.5,BURN) else var/dam_amount = 3 - if(M.lying) + if(M.body_position == LYING_DOWN) M.apply_damage(dam_amount,BURN) M.apply_damage(dam_amount,BURN) M.apply_damage(dam_amount,BURN) @@ -219,7 +207,7 @@ var/global/east_riverstart = 0 if(dispersing || !toxic) return - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) if(direction == from_dir) continue //doesn't check backwards var/effective_spread_delay @@ -303,7 +291,7 @@ var/global/east_riverstart = 0 //var/area/A = get_area(src) //A.ambience_exterior = 'sound/ambience/ambiatm1.ogg' - for(var/obj/structure/machinery/dispersal_initiator/M in machines) + for(var/obj/structure/machinery/dispersal_initiator/M in GLOB.machines) if (M.id == src.id) M.initiate() diff --git a/code/modules/desert_dam/motion_sensor/sensortower.dm b/code/modules/desert_dam/motion_sensor/sensortower.dm index 4ef11c32245d..50aeede45f66 100644 --- a/code/modules/desert_dam/motion_sensor/sensortower.dm +++ b/code/modules/desert_dam/motion_sensor/sensortower.dm @@ -211,7 +211,7 @@ if(do_after(M, 40, INTERRUPT_ALL, BUSY_ICON_HOSTILE)) if(M.loc != cur_loc) return XENO_NO_DELAY_ACTION //Make sure we're still there - if(M.lying) + if(M.is_mob_incapacitated()) return XENO_NO_DELAY_ACTION if(buildstate == SENSORTOWER_BUILDSTATE_BLOWTORCH) return XENO_NO_DELAY_ACTION @@ -233,6 +233,25 @@ ..() update_icon() +/* Decreases the buildstate of the sensor tower and switches it off if affected by any explosion. +Higher severity explosion will damage the sensor tower more +*/ +/obj/structure/machinery/sensortower/ex_act(severity) + if(buildstate == SENSORTOWER_BUILDSTATE_WRENCH) + return + switch(severity) + if(0 to EXPLOSION_THRESHOLD_LOW) + buildstate += 1 + if(EXPLOSION_THRESHOLD_LOW to EXPLOSION_THRESHOLD_MEDIUM) + buildstate = clamp(buildstate + 2, SENSORTOWER_BUILDSTATE_WORKING, SENSORTOWER_BUILDSTATE_WRENCH) + if(EXPLOSION_THRESHOLD_HIGH to INFINITY) + buildstate = 3 + if(is_on) + is_on = FALSE + cur_tick = 0 + stop_processing() + update_icon() + #undef SENSORTOWER_BUILDSTATE_WORKING #undef SENSORTOWER_BUILDSTATE_BLOWTORCH #undef SENSORTOWER_BUILDSTATE_WIRECUTTERS diff --git a/code/modules/droppod/container_droppod.dm b/code/modules/droppod/container_droppod.dm index 270f15011c5c..a9432933fa90 100644 --- a/code/modules/droppod/container_droppod.dm +++ b/code/modules/droppod/container_droppod.dm @@ -126,7 +126,7 @@ . = ..() if(loc) collect_objects(loc.contents) - density = TRUE + set_density(TRUE) /obj/structure/droppod/container/proc/collect_objects(list/L) for(var/atom/movable/A in L) diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index 2e9142dcef91..1345164fcf34 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -37,7 +37,7 @@ log transactions /obj/structure/machinery/atm/New() ..() - machine_id = "[station_name] RT #[num_financial_terminals++]" + machine_id = "[MAIN_SHIP_NAME] RT #[GLOB.num_financial_terminals++]" spark_system = new /datum/effect_system/spark_spread spark_system.set_up(5, 0, src) spark_system.attach(src) @@ -79,7 +79,7 @@ log transactions T.purpose = "Credit deposit" T.amount = I:worth T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() authenticated_account.transaction_log.Add(T) @@ -212,7 +212,7 @@ log transactions T.target_name = "Account #[target_account_number]" T.purpose = transfer_purpose T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() T.amount = "([transfer_amount])" authenticated_account.transaction_log.Add(T) @@ -254,7 +254,7 @@ log transactions T.target_name = failed_account.owner_name T.purpose = "Unauthorised login attempt" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() failed_account.transaction_log.Add(T) else @@ -275,7 +275,7 @@ log transactions T.target_name = authenticated_account.owner_name T.purpose = "Remote terminal access" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() authenticated_account.transaction_log.Add(T) @@ -307,7 +307,7 @@ log transactions T.purpose = "Credit withdrawal" T.amount = "([amount])" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() authenticated_account.transaction_log.Add(T) withdrawal_timer = world.time + 20 @@ -338,7 +338,7 @@ log transactions T.purpose = "Credit withdrawal" T.amount = "([amount])" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() authenticated_account.transaction_log.Add(T) withdrawal_timer = world.time + 20 @@ -353,7 +353,7 @@ log transactions R.info += "Account holder: [authenticated_account.owner_name]
    " R.info += "Account number: [authenticated_account.account_number]
    " R.info += "Balance: $[authenticated_account.money]
    " - R.info += "Date and time: [worldtime2text()], [current_date_string]

    " + R.info += "Date and time: [worldtime2text()], [GLOB.current_date_string]

    " R.info += "Service terminal ID: [machine_id]
    " //stamp the paper @@ -376,7 +376,7 @@ log transactions R.info = "Transaction logs
    " R.info += "Account holder: [authenticated_account.owner_name]
    " R.info += "Account number: [authenticated_account.account_number]
    " - R.info += "Date and time: [worldtime2text()], [current_date_string]

    " + R.info += "Date and time: [worldtime2text()], [GLOB.current_date_string]

    " R.info += "Service terminal ID: [machine_id]
    " R.info += "" R.info += "" @@ -443,7 +443,7 @@ log transactions T.target_name = authenticated_account.owner_name T.purpose = "Remote terminal access" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() authenticated_account.transaction_log.Add(T) @@ -465,7 +465,7 @@ log transactions set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(ishuman(usr) && held_card) to_chat(usr, "You remove \the [held_card] from \the [src].") diff --git a/code/modules/economy/Accounts.dm b/code/modules/economy/Accounts.dm index 7e5bf22041a0..0a5a0b8f3cc8 100644 --- a/code/modules/economy/Accounts.dm +++ b/code/modules/economy/Accounts.dm @@ -32,7 +32,7 @@ T.purpose = "Account creation" T.amount = starting_funds * id_paygrade.pay_multiplier //set a random date, time and location some time over the past few decades - T.date = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [game_year - rand(0, 10)]" + T.date = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [GLOB.game_year - rand(0, 10)]" T.time = "[rand(0,24)]:[rand(11,59)]" T.source_terminal = "Weyland-Yutani Terminal #[rand(111,1111)]" for(var/attempt in 1 to 100) // Make up to 100 attempts to get a unique account number @@ -41,12 +41,12 @@ break // Account number is unique! //add the account M.transaction_log.Add(T) - all_money_accounts.Add(M) + GLOB.all_money_accounts.Add(M) return M /proc/charge_to_account(attempt_account_number, source_name, purpose, terminal_id, amount) - for(var/datum/money_account/D in all_money_accounts) + for(var/datum/money_account/D in GLOB.all_money_accounts) if(D.account_number == attempt_account_number && !D.suspended) D.money += amount @@ -58,7 +58,7 @@ T.amount = "([amount])" else T.amount = "[amount]" - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() T.source_terminal = terminal_id D.transaction_log.Add(T) @@ -70,13 +70,13 @@ //this returns the first account datum that matches the supplied accnum/pin combination, it returns null if the combination did not match any account /proc/attempt_account_access(attempt_account_number, attempt_pin_number, security_level_passed = 0) - for(var/datum/money_account/D in all_money_accounts) + for(var/datum/money_account/D in GLOB.all_money_accounts) if(D.account_number == attempt_account_number) if( D.security_level <= security_level_passed && (!D.security_level || D.remote_access_pin == attempt_pin_number) ) return D break /proc/get_account(account_number) - for(var/datum/money_account/D in all_money_accounts) + for(var/datum/money_account/D in GLOB.all_money_accounts) if(D.account_number == account_number) return D diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm index a5b36fd0bf3e..ca73c2efb84f 100644 --- a/code/modules/economy/EFTPOS.dm +++ b/code/modules/economy/EFTPOS.dm @@ -13,7 +13,7 @@ /obj/item/device/eftpos/Initialize() . = ..() - machine_id = "[station_name] EFTPOS #[num_financial_terminals++]" + machine_id = "[MAIN_SHIP_NAME] EFTPOS #[GLOB.num_financial_terminals++]" access_code = rand(1111,111111) spawn(0) print_reference() @@ -59,7 +59,7 @@ //by default, connect to the station account //the user of the EFTPOS device can change the target account though, and no-one will be the wiser (except whoever's being charged) - linked_account = station_account + linked_account = GLOB.station_account /obj/item/device/eftpos/proc/print_reference() var/obj/item/paper/R = new(src.loc) @@ -136,7 +136,7 @@ T.purpose = (transaction_purpose ? transaction_purpose : "None supplied.") T.amount = transaction_amount T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() linked_account.transaction_log.Add(T) else @@ -257,7 +257,7 @@ else T.amount = "[transaction_amount]" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() D.transaction_log.Add(T) // @@ -266,7 +266,7 @@ T.purpose = transaction_purpose T.amount = "[transaction_amount]" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = worldtime2text() linked_account.transaction_log.Add(T) else diff --git a/code/modules/economy/TradeDestinations.dm b/code/modules/economy/TradeDestinations.dm index ff01dc89d242..94ead45bf13e 100644 --- a/code/modules/economy/TradeDestinations.dm +++ b/code/modules/economy/TradeDestinations.dm @@ -1,6 +1,6 @@ -var/list/weighted_randomevent_locations = list() -var/list/weighted_mundaneevent_locations = list() +GLOBAL_LIST_EMPTY(weighted_randomevent_locations) +GLOBAL_LIST_EMPTY(weighted_mundaneevent_locations) /datum/trade_destination var/name = "" diff --git a/code/modules/economy/economy_misc.dm b/code/modules/economy/economy_misc.dm index 75a10a8ee199..a5f061e1a727 100644 --- a/code/modules/economy/economy_misc.dm +++ b/code/modules/economy/economy_misc.dm @@ -62,17 +62,17 @@ //Destroyers are medium sized vessels, often used for escorting larger ships but able to go toe-to-toe with them if need be. //Frigates are medium sized vessels, often used for escorting larger ships. They will rapidly find themselves outclassed if forced to face heavy warships head on. -var/global/current_date_string +GLOBAL_VAR(current_date_string) -var/global/datum/money_account/vendor_account -var/global/datum/money_account/station_account -var/global/list/datum/money_account/department_accounts = list() -var/global/num_financial_terminals = 1 -var/global/list/all_money_accounts = list() -var/global/economy_init = 0 +GLOBAL_DATUM(vendor_account, /datum/money_account) +GLOBAL_DATUM(station_account, /datum/money_account) +GLOBAL_LIST_INIT_TYPED(department_accounts, /datum/money_account, list()) +GLOBAL_VAR_INIT(num_financial_terminals, 1) +GLOBAL_LIST_EMPTY(all_money_accounts) +GLOBAL_VAR_INIT(economy_init, FALSE) /proc/setup_economy() - if(economy_init) + if(GLOB.economy_init) return 2 var/datum/feed_channel/newChannel = new /datum/feed_channel @@ -80,48 +80,48 @@ var/global/economy_init = 0 newChannel.author = "Automated Announcement Listing" newChannel.locked = 1 newChannel.is_admin_channel = 1 - news_network.network_channels += newChannel + GLOB.news_network.network_channels += newChannel newChannel = new /datum/feed_channel newChannel.channel_name = "Nyx Daily" newChannel.author = "CentComm Minister of Information" newChannel.locked = 1 newChannel.is_admin_channel = 1 - news_network.network_channels += newChannel + GLOB.news_network.network_channels += newChannel newChannel = new /datum/feed_channel newChannel.channel_name = "The Gibson Gazette" newChannel.author = "Editor Mike Hammers" newChannel.locked = 1 newChannel.is_admin_channel = 1 - news_network.network_channels += newChannel + GLOB.news_network.network_channels += newChannel for(var/loc_type in typesof(/datum/trade_destination) - /datum/trade_destination) var/datum/trade_destination/D = new loc_type - weighted_randomevent_locations[D] = D.viable_random_events.len - weighted_mundaneevent_locations[D] = D.viable_mundane_events.len + GLOB.weighted_randomevent_locations[D] = D.viable_random_events.len + GLOB.weighted_mundaneevent_locations[D] = D.viable_mundane_events.len create_station_account() create_department_account("Vendor") - vendor_account = department_accounts["Vendor"] + GLOB.vendor_account = GLOB.department_accounts["Vendor"] - current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [game_year]" + GLOB.current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [GLOB.game_year]" - economy_init = 1 + GLOB.economy_init = TRUE return 1 /proc/create_station_account() - if(!station_account) - station_account = new() - station_account.owner_name = "[station_name] Station Account" - station_account.account_number = rand(111111, 999999) - station_account.remote_access_pin = rand(1111, 111111) - station_account.money = 75000 + if(!GLOB.station_account) + GLOB.station_account = new() + GLOB.station_account.owner_name = "[MAIN_SHIP_NAME] Station Account" + GLOB.station_account.account_number = rand(111111, 999999) + GLOB.station_account.remote_access_pin = rand(1111, 111111) + GLOB.station_account.money = 75000 //create an entry in the account transaction log for when it was created var/datum/transaction/T = new() - T.target_name = station_account.owner_name + T.target_name = GLOB.station_account.owner_name T.purpose = "Account creation" T.amount = 75000 T.date = "2nd April, 2555" @@ -129,8 +129,8 @@ var/global/economy_init = 0 T.source_terminal = "Biesel GalaxyNet Terminal #277" //add the account - station_account.transaction_log.Add(T) - all_money_accounts.Add(station_account) + GLOB.station_account.transaction_log.Add(T) + GLOB.all_money_accounts.Add(GLOB.station_account) /proc/create_department_account(department) var/datum/money_account/department_account = new() @@ -150,6 +150,6 @@ var/global/economy_init = 0 //add the account department_account.transaction_log.Add(T) - all_money_accounts.Add(department_account) + GLOB.all_money_accounts.Add(department_account) - department_accounts[department] = department_account + GLOB.department_accounts[department] = department_account diff --git a/code/modules/events/comms_blackout.dm b/code/modules/events/comms_blackout.dm index 76a871205067..ea7ad9c84b78 100644 --- a/code/modules/events/comms_blackout.dm +++ b/code/modules/events/comms_blackout.dm @@ -2,7 +2,7 @@ if(!silent) marine_announcement("Ionic radiation flare detected from nearby star. Imminent telecommunication failu*3mga;b4;'1v�-BZZZT", "Problem Detected", 'sound/misc/interference.ogg') else // AIs will always know if there's a comm blackout, rogue AIs could then lie about comm blackouts in the future while they shutdown comms - for(var/mob/living/silicon/ai/A in ai_mob_list) + for(var/mob/living/silicon/ai/A in GLOB.ai_mob_list) to_chat(A, "
    ") to_chat(A, SPAN_WARNING("Ionic radiation flare detected from nearby star. Imminent telecommunication failu*3mga;b4;'1v�-BZZZT")) to_chat(A, "
    ") diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 9503eee267e0..e62ad15a649e 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -21,7 +21,7 @@ for(var/i = rand(1,4),i > 0, i--) to_chat(src, SPAN_NOTICE("... [pick(POSSIBLE_DREAM_TOPICS)] ...")) sleep(rand(40,70)) - if(knocked_out <= 0) + if(!stat) dreaming = 0 return dreaming = 0 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index c7b1d65c7da2..ceff47b5b63c 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -95,7 +95,7 @@ Gunshots/explosions/opening doors/less rare audio (done) //to_chat(src, "Danger Flash") if(!halimage) var/list/possible_points = list() - for(var/turf/open/floor/F in view(src,world_view_size)) + for(var/turf/open/floor/F in view(src,GLOB.world_view_size)) possible_points += F if(possible_points.len) var/turf/open/floor/target = pick(possible_points) @@ -159,7 +159,7 @@ Gunshots/explosions/opening doors/less rare audio (done) //to_chat(src, "Danger Flash") if(!halbody) var/list/possible_points = list() - for(var/turf/open/floor/F in view(src,world_view_size)) + for(var/turf/open/floor/F in view(src,GLOB.world_view_size)) possible_points += F if(possible_points.len) var/turf/open/floor/target = pick(possible_points) @@ -249,7 +249,7 @@ Gunshots/explosions/opening doors/less rare audio (done) /obj/effect/fake_attacker/attackby(obj/item/P as obj, mob/user as mob) step_away(src,my_target,2) - for(var/mob/M in oviewers(world_view_size,my_target)) + for(var/mob/M in oviewers(GLOB.world_view_size,my_target)) to_chat(M, SPAN_WARNING("[my_target] flails around wildly.")) my_target.show_message(SPAN_DANGER("[src] has been attacked by [my_target] "), SHOW_MESSAGE_VISIBLE) //Lazy. @@ -262,7 +262,7 @@ Gunshots/explosions/opening doors/less rare audio (done) if(M == my_target) step_away(src,my_target,2) if(prob(30)) - for(var/mob/O in oviewers(world_view_size , my_target)) + for(var/mob/O in oviewers(GLOB.world_view_size , my_target)) to_chat(O, SPAN_DANGER("[my_target] stumbles around.")) /obj/effect/fake_attacker/New() @@ -341,9 +341,9 @@ Gunshots/explosions/opening doors/less rare audio (done) QDEL_IN(O, 30 SECONDS) return -var/list/non_fakeattack_weapons = list(/obj/item/device/aicard,\ +GLOBAL_LIST_INIT(non_fakeattack_weapons, list(/obj/item/device/aicard,\ /obj/item/clothing/shoes/magboots, /obj/item/disk/nuclear,\ - /obj/item/clothing/suit/space/uscm, /obj/item/tank) + /obj/item/clothing/suit/space/uscm, /obj/item/tank)) /proc/fake_attack(mob/living/target) // var/list/possible_clones = new/list() @@ -351,7 +351,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/device/aicard,\ var/clone_weapon = null for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) - if(H.stat || H.lying) continue + if(H.stat) continue // possible_clones += H clone = H break //changed the code a bit. Less randomised, but less work to do. Should be ok, world.contents aren't stored in any particular order. @@ -363,11 +363,11 @@ var/list/non_fakeattack_weapons = list(/obj/item/device/aicard,\ //var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(outside_range(target)) var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(target.loc) if(clone.l_hand) - if(!(locate(clone.l_hand) in non_fakeattack_weapons)) + if(!(locate(clone.l_hand) in GLOB.non_fakeattack_weapons)) clone_weapon = clone.l_hand.name F.weap = clone.l_hand else if (clone.r_hand) - if(!(locate(clone.r_hand) in non_fakeattack_weapons)) + if(!(locate(clone.r_hand) in GLOB.non_fakeattack_weapons)) clone_weapon = clone.r_hand.name F.weap = clone.r_hand diff --git a/code/modules/gear_presets/_select_equipment.dm b/code/modules/gear_presets/_select_equipment.dm index 39f832ea8ca8..5a5ecea2d03d 100644 --- a/code/modules/gear_presets/_select_equipment.dm +++ b/code/modules/gear_presets/_select_equipment.dm @@ -87,7 +87,7 @@ new_human.gender = pick(60;MALE,40;FEMALE) var/datum/preferences/A = new() A.randomize_appearance(new_human) - var/random_name = capitalize(pick(new_human.gender == MALE ? first_names_male : first_names_female)) + " " + capitalize(pick(last_names)) + var/random_name = capitalize(pick(new_human.gender == MALE ? GLOB.first_names_male : GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) new_human.change_real_name(new_human, random_name) new_human.age = rand(21,45) @@ -155,8 +155,8 @@ load_status(new_human, mob_client) load_vanity(new_human, mob_client) load_traits(new_human, mob_client) - if(round_statistics && count_participant) - round_statistics.track_new_participant(faction) + if(GLOB.round_statistics && count_participant) + GLOB.round_statistics.track_new_participant(faction) new_human.assigned_equipment_preset = src @@ -172,7 +172,7 @@ if(!new_human.client || !new_human.client.prefs || !new_human.client.prefs.gear) return//We want to equip them with custom stuff second, after they are equipped with everything else. for(var/gear_name in new_human.client.prefs.gear) - var/datum/gear/current_gear = gear_datums_by_name[gear_name] + var/datum/gear/current_gear = GLOB.gear_datums_by_name[gear_name] if(current_gear) if(current_gear.allowed_roles && !(assignment in current_gear.allowed_roles)) to_chat(new_human, SPAN_WARNING("Custom gear [current_gear.display_name] cannot be equipped: Invalid Role")) @@ -461,16 +461,16 @@ return 1 -var/list/rebel_shotguns = list( +GLOBAL_LIST_INIT(rebel_shotguns, list( /obj/item/weapon/gun/shotgun/double = /obj/item/ammo_magazine/handful/shotgun/buckshot, /obj/item/weapon/gun/shotgun/double/with_stock = /obj/item/ammo_magazine/handful/shotgun/flechette, /obj/item/weapon/gun/shotgun/pump/dual_tube/cmb = /obj/item/ammo_magazine/handful/shotgun/incendiary, /obj/item/weapon/gun/shotgun/pump/dual_tube/cmb = /obj/item/ammo_magazine/handful/shotgun/incendiary, /obj/item/weapon/gun/shotgun/double/sawn = /obj/item/ammo_magazine/handful/shotgun/incendiary, /obj/item/weapon/gun/shotgun/double/sawn = /obj/item/ammo_magazine/handful/shotgun/buckshot - ) + )) -var/list/rebel_smgs = list( +GLOBAL_LIST_INIT(rebel_smgs, list( /obj/item/weapon/gun/smg/pps43 = /obj/item/ammo_magazine/smg/pps43, /obj/item/weapon/gun/smg/mp27 = /obj/item/ammo_magazine/smg/mp27, /obj/item/weapon/gun/smg/mp5 = /obj/item/ammo_magazine/smg/mp5, @@ -478,9 +478,9 @@ var/list/rebel_smgs = list( /obj/item/weapon/gun/smg/mac15 = /obj/item/ammo_magazine/smg/mac15, /obj/item/weapon/gun/smg/uzi = /obj/item/ammo_magazine/smg/uzi, /obj/item/weapon/gun/smg/fp9000 = /obj/item/ammo_magazine/smg/fp9000 - ) + )) -var/list/rebel_rifles = list( +GLOBAL_LIST_INIT(rebel_rifles, list( /obj/item/weapon/gun/rifle/mar40 = /obj/item/ammo_magazine/rifle/mar40, /obj/item/weapon/gun/rifle/mar40 = /obj/item/ammo_magazine/rifle/mar40, /obj/item/weapon/gun/rifle/mar40/carbine = /obj/item/ammo_magazine/rifle/mar40, @@ -490,13 +490,13 @@ var/list/rebel_rifles = list( /obj/item/weapon/gun/rifle/ar10 = /obj/item/ammo_magazine/rifle/ar10, /obj/item/weapon/gun/rifle/l42a/abr40 = /obj/item/ammo_magazine/rifle/l42a/abr40, /obj/item/weapon/gun/rifle/l42a/abr40 = /obj/item/ammo_magazine/rifle/l42a/abr40, - ) + )) /datum/equipment_preset/proc/spawn_rebel_smg(atom/M, ammo_amount = 12) if(!M) return - var/gunpath = pick(rebel_smgs) - var/ammopath = rebel_smgs[gunpath] + var/gunpath = pick(GLOB.rebel_smgs) + var/ammopath = GLOB.rebel_smgs[gunpath] spawn_weapon(gunpath, ammopath, M, ammo_amount) @@ -505,8 +505,8 @@ var/list/rebel_rifles = list( /datum/equipment_preset/proc/spawn_rebel_shotgun(atom/M, ammo_amount = 12) if(!M) return - var/gunpath = pick(rebel_shotguns) - var/ammopath = rebel_shotguns[gunpath] + var/gunpath = pick(GLOB.rebel_shotguns) + var/ammopath = GLOB.rebel_shotguns[gunpath] spawn_weapon(gunpath, ammopath, M, ammo_amount) @@ -515,8 +515,8 @@ var/list/rebel_rifles = list( /datum/equipment_preset/proc/spawn_rebel_rifle(atom/M, ammo_amount = 12) if(!M) return - var/gunpath = pick(rebel_rifles) - var/ammopath = rebel_rifles[gunpath] + var/gunpath = pick(GLOB.rebel_rifles) + var/ammopath = GLOB.rebel_rifles[gunpath] spawn_weapon(gunpath, ammopath, M, ammo_amount) @@ -575,10 +575,10 @@ var/list/rebel_rifles = list( if(!M) return var/list/merc_shotguns = list( - /obj/item/weapon/gun/shotgun/merc = pick(shotgun_handfuls_12g), - /obj/item/weapon/gun/shotgun/combat = pick(shotgun_handfuls_12g), - /obj/item/weapon/gun/shotgun/double/with_stock = pick(shotgun_handfuls_12g), - /obj/item/weapon/gun/shotgun/pump/dual_tube/cmb = pick(shotgun_handfuls_12g)) + /obj/item/weapon/gun/shotgun/merc = pick(GLOB.shotgun_handfuls_12g), + /obj/item/weapon/gun/shotgun/combat = pick(GLOB.shotgun_handfuls_12g), + /obj/item/weapon/gun/shotgun/double/with_stock = pick(GLOB.shotgun_handfuls_12g), + /obj/item/weapon/gun/shotgun/pump/dual_tube/cmb = pick(GLOB.shotgun_handfuls_12g)) var/gunpath = pick(merc_shotguns) var/ammopath = merc_shotguns[gunpath] @@ -610,9 +610,9 @@ var/list/rebel_rifles = list( /obj/item/weapon/gun/rifle/m41a/elite = /obj/item/ammo_magazine/rifle/ap) var/list/elite_merc_shotguns = list( - /obj/item/weapon/gun/shotgun/merc = pick(shotgun_handfuls_12g), - /obj/item/weapon/gun/shotgun/combat = pick(shotgun_handfuls_12g), - /obj/item/weapon/gun/shotgun/type23 = pick(shotgun_handfuls_8g)) + /obj/item/weapon/gun/shotgun/merc = pick(GLOB.shotgun_handfuls_12g), + /obj/item/weapon/gun/shotgun/combat = pick(GLOB.shotgun_handfuls_12g), + /obj/item/weapon/gun/shotgun/type23 = pick(GLOB.shotgun_handfuls_8g)) if(prob(shotgun_chance)) var/gunpath = pick(elite_merc_shotguns) diff --git a/code/modules/gear_presets/agents.dm b/code/modules/gear_presets/agents.dm index dcf2a367b677..b51e623a198c 100644 --- a/code/modules/gear_presets/agents.dm +++ b/code/modules/gear_presets/agents.dm @@ -115,7 +115,7 @@ A.randomize_appearance(new_human) var/random_name if(new_human.gender == MALE) - random_name = "[pick(first_names_male_dutch)] [pick(last_names_clf)]" + random_name = "[pick(GLOB.first_names_male_dutch)] [pick(GLOB.last_names_clf)]" new_human.f_style = "Shaved" new_human.change_real_name(new_human, random_name) diff --git a/code/modules/gear_presets/clf.dm b/code/modules/gear_presets/clf.dm index 9afc89ab65c6..62cbeb9edd29 100644 --- a/code/modules/gear_presets/clf.dm +++ b/code/modules/gear_presets/clf.dm @@ -21,18 +21,18 @@ if(prob(40)) first_name = "[capitalize(randomly_generate_japanese_word(rand(1, 3)))]" else - first_name = "[pick(first_names_male_clf)]" + first_name = "[pick(GLOB.first_names_male_clf)]" new_human.f_style = pick("3 O'clock Shadow", "3 O'clock Moustache", "5 O'clock Shadow", "5 O'clock Moustache") else if(prob(40)) first_name = "[capitalize(randomly_generate_japanese_word(rand(1, 3)))]" else - first_name = "[pick(first_names_female_clf)]" + first_name = "[pick(GLOB.first_names_female_clf)]" //surname if(prob(35)) last_name = "[capitalize(randomly_generate_japanese_word(rand(1, 4)))]" else - last_name = "[pick(last_names_clf)]" + last_name = "[pick(GLOB.last_names_clf)]" //put them together random_name = "[first_name] [last_name]" new_human.change_real_name(new_human, random_name) @@ -723,9 +723,9 @@ if(prob(10)) random_name = "[capitalize(randomly_generate_japanese_word(rand(2, 3)))]" else if(new_human.gender == MALE) - random_name = "[pick(first_names_male_clf)]" + random_name = "[pick(GLOB.first_names_male_clf)]" else - random_name = "[pick(first_names_female_clf)]" + random_name = "[pick(GLOB.first_names_female_clf)]" if(new_human.gender == MALE) new_human.f_style = "5 O'clock Shadow" diff --git a/code/modules/gear_presets/cmb.dm b/code/modules/gear_presets/cmb.dm index 578681979115..2dd2c531d787 100644 --- a/code/modules/gear_presets/cmb.dm +++ b/code/modules/gear_presets/cmb.dm @@ -17,7 +17,7 @@ var/datum/preferences/A = new() A.randomize_appearance(new_human) var/random_name - random_name = capitalize(pick(new_human.gender == MALE ? first_names_male : first_names_female)) + " " + capitalize(pick(last_names)) + random_name = capitalize(pick(new_human.gender == MALE ? GLOB.first_names_male : GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) new_human.change_real_name(new_human, random_name) new_human.name = new_human.real_name new_human.age = rand(22,45) @@ -214,9 +214,9 @@ A.randomize_appearance(new_human) var/random_name if(new_human.gender == MALE) - random_name = "[pick(first_names_male)]" + random_name = "[pick(GLOB.first_names_male)]" else - random_name = "[pick(first_names_female)]" + random_name = "[pick(GLOB.first_names_female)]" if(new_human.gender == MALE) new_human.f_style = pick("3 O'clock Shadow", "3 O'clock Moustache", "5 O'clock Shadow", "5 O'clock Moustache") diff --git a/code/modules/gear_presets/contractor.dm b/code/modules/gear_presets/contractor.dm index c849092570cc..ea77fe4a4d0f 100644 --- a/code/modules/gear_presets/contractor.dm +++ b/code/modules/gear_presets/contractor.dm @@ -19,7 +19,7 @@ var/datum/preferences/A = new() A.randomize_appearance(new_human) var/random_name - random_name = capitalize(pick(new_human.gender == MALE ? first_names_male : first_names_female)) + " " + capitalize(pick(last_names)) + random_name = capitalize(pick(new_human.gender == MALE ? GLOB.first_names_male : GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) new_human.change_real_name(new_human, random_name) new_human.name = new_human.real_name new_human.age = rand(22,45) @@ -367,9 +367,9 @@ A.randomize_appearance(new_human) var/random_name if(new_human.gender == MALE) - random_name = "[pick(first_names_male)]" + random_name = "[pick(GLOB.first_names_male)]" else - random_name = "[pick(first_names_female)]" + random_name = "[pick(GLOB.first_names_female)]" if(new_human.gender == MALE) new_human.f_style = pick("3 O'clock Shadow", "3 O'clock Moustache", "5 O'clock Shadow", "5 O'clock Moustache") @@ -753,9 +753,9 @@ A.randomize_appearance(new_human) var/random_name if(new_human.gender == MALE) - random_name = "[pick(first_names_male)]" + random_name = "[pick(GLOB.first_names_male)]" else - random_name = "[pick(first_names_female)]" + random_name = "[pick(GLOB.first_names_female)]" if(new_human.gender == MALE) new_human.f_style = pick("3 O'clock Shadow", "3 O'clock Moustache", "5 O'clock Shadow", "5 O'clock Moustache") diff --git a/code/modules/gear_presets/corpses.dm b/code/modules/gear_presets/corpses.dm index 70f4e2206002..de24f1f84ff3 100644 --- a/code/modules/gear_presets/corpses.dm +++ b/code/modules/gear_presets/corpses.dm @@ -39,7 +39,6 @@ if(nest) new_human.buckled = nest new_human.setDir(nest.dir) - new_human.update_canmove() nest.buckled_mob = new_human nest.afterbuckle(new_human) new_human.spawned_corpse = TRUE diff --git a/code/modules/gear_presets/dust_raider.dm b/code/modules/gear_presets/dust_raider.dm index e6464d56085e..1d979ed66a5f 100644 --- a/code/modules/gear_presets/dust_raider.dm +++ b/code/modules/gear_presets/dust_raider.dm @@ -10,7 +10,7 @@ var/datum/preferences/A = new() A.randomize_appearance(new_human) var/random_name - random_name = capitalize(pick(new_human.gender == MALE ? first_names_male : first_names_female)) + " " + capitalize(pick(last_names)) + random_name = capitalize(pick(new_human.gender == MALE ? GLOB.first_names_male : GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) new_human.change_real_name(new_human, random_name) new_human.name = new_human.real_name new_human.age = rand(21,45) diff --git a/code/modules/gear_presets/dutch.dm b/code/modules/gear_presets/dutch.dm index c83e8384f57a..2844eef68a96 100644 --- a/code/modules/gear_presets/dutch.dm +++ b/code/modules/gear_presets/dutch.dm @@ -19,10 +19,10 @@ human.randomize_appearance(new_human) var/random_name if(new_human.gender == MALE) - random_name = "[pick(first_names_male_dutch)] [pick(last_names)]" + random_name = "[pick(GLOB.first_names_male_dutch)] [pick(GLOB.last_names)]" new_human.f_style = "5 O'clock Shadow" else - random_name = "[pick(first_names_female_dutch)] [pick(last_names)]" + random_name = "[pick(GLOB.first_names_female_dutch)] [pick(GLOB.last_names)]" new_human.change_real_name(new_human, random_name) new_human.age = rand(25,35) diff --git a/code/modules/gear_presets/fun.dm b/code/modules/gear_presets/fun.dm index 23350768a692..8bbe686b5cea 100644 --- a/code/modules/gear_presets/fun.dm +++ b/code/modules/gear_presets/fun.dm @@ -433,7 +433,7 @@ new_human.age = rand(1, 40) /datum/equipment_preset/fun/monkey/proc/get_random_name(mob/living/carbon/human/new_human) - return pick(monkey_names) + return pick(GLOB.monkey_names) /datum/equipment_preset/fun/monkey/marine name = "Fun - Monkey Marine" @@ -460,7 +460,7 @@ paygrade = "UE1" /datum/equipment_preset/fun/monkey/soldier/get_random_name(mob/living/carbon/human/new_human) - return new_human.gender == MALE ? pick(first_names_male_upp) : pick(first_names_female_upp) + return new_human.gender == MALE ? pick(GLOB.first_names_male_upp) : pick(GLOB.first_names_female_upp) /datum/equipment_preset/fun/monkey/soldier/load_gear(mob/living/carbon/human/new_human) new_human.equip_to_slot_or_del(new /obj/item/clothing/under/marine/veteran/UPP(new_human), WEAR_BODY) diff --git a/code/modules/gear_presets/other.dm b/code/modules/gear_presets/other.dm index 0308c8d9e3cb..6a9fa4d6f55a 100644 --- a/code/modules/gear_presets/other.dm +++ b/code/modules/gear_presets/other.dm @@ -46,10 +46,10 @@ A.randomize_appearance(new_human) var/random_name if(new_human.gender == MALE) - random_name = "[pick(first_names_male_colonist)] [pick(last_names_colonist)]" + random_name = "[pick(GLOB.first_names_male_colonist)] [pick(GLOB.last_names_colonist)]" new_human.f_style = "5 O'clock Shadow" else - random_name = "[pick(first_names_female_colonist)] [pick(last_names_colonist)]" + random_name = "[pick(GLOB.first_names_female_colonist)] [pick(GLOB.last_names_colonist)]" new_human.change_real_name(new_human, random_name) new_human.age = rand(20,45) new_human.r_hair = 25 @@ -105,7 +105,7 @@ new_human.equip_to_slot_or_del(new /obj/item/storage/belt/shotgun, WEAR_WAIST) new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/explosive/C4, WEAR_R_STORE) new_human.equip_to_slot_or_del(new /obj/item/tool/crowbar, WEAR_IN_BACK) - spawn_weapon(/obj/item/weapon/gun/shotgun/type23, pick(shotgun_handfuls_8g), new_human, 0, 14) //shotgunner mini-spec + spawn_weapon(/obj/item/weapon/gun/shotgun/type23, pick(GLOB.shotgun_handfuls_8g), new_human, 0, 14) //shotgunner mini-spec new_human.equip_to_slot_or_del(new /obj/item/explosive/grenade/high_explosive/stick, WEAR_IN_BACK) new_human.equip_to_slot_or_del(new /obj/item/explosive/grenade/high_explosive/stick, WEAR_IN_BACK) new_human.equip_to_slot_or_del(new /obj/item/explosive/grenade/high_explosive/stick, WEAR_IN_BACK) @@ -255,10 +255,10 @@ A.randomize_appearance(new_human) var/random_name if(new_human.gender == MALE) - random_name = "[pick(first_names_male_colonist)] [pick(last_names_colonist)]" + random_name = "[pick(GLOB.first_names_male_colonist)] [pick(GLOB.last_names_colonist)]" new_human.f_style = "5 O'clock Shadow" else - random_name = "[pick(first_names_female_colonist)] [pick(last_names_colonist)]" + random_name = "[pick(GLOB.first_names_female_colonist)] [pick(GLOB.last_names_colonist)]" new_human.change_real_name(new_human, random_name) new_human.age = rand(20,45) new_human.r_hair = rand(15,35) @@ -551,9 +551,9 @@ A.randomize_appearance(new_human) var/random_name if(new_human.gender == MALE) - random_name = "[pick(first_names_male)] [pick(last_names)]" + random_name = "[pick(GLOB.first_names_male)] [pick(GLOB.last_names)]" else - random_name = "[pick(first_names_female)] [pick(last_names)]" + random_name = "[pick(GLOB.first_names_female)] [pick(GLOB.last_names)]" new_human.change_real_name(new_human, random_name) new_human.age = rand(17,45) @@ -641,7 +641,7 @@ new_human.gender = pick(MALE, FEMALE) var/datum/preferences/A = new A.randomize_appearance(new_human) - var/random_name = capitalize(pick(new_human.gender == MALE ? first_names_male : first_names_female)) + " " + capitalize(pick(last_names)) + var/random_name = capitalize(pick(new_human.gender == MALE ? GLOB.first_names_male : GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) new_human.change_real_name(new_human, random_name) new_human.age = rand(21,45) @@ -681,7 +681,7 @@ new_human.gender = pick(MALE, FEMALE) var/datum/preferences/A = new A.randomize_appearance(new_human) - var/random_name = capitalize(pick(new_human.gender == MALE ? first_names_male_gladiator : first_names_female_gladiator)) + var/random_name = capitalize(pick(new_human.gender == MALE ? GLOB.first_names_male_gladiator : GLOB.first_names_female_gladiator)) new_human.change_real_name(new_human, random_name) new_human.age = rand(21,45) @@ -806,7 +806,7 @@ var/list/huds_to_add = list(MOB_HUD_XENO_INFECTION, MOB_HUD_XENO_STATUS) for(var/hud_to_add in huds_to_add) - var/datum/mob_hud/hud = huds[hud_to_add] + var/datum/mob_hud/hud = GLOB.huds[hud_to_add] hud.add_hud_to(new_human, new_human) var/list/actions_to_add = subtypesof(/datum/action/human_action/activable/cult) diff --git a/code/modules/gear_presets/pmc.dm b/code/modules/gear_presets/pmc.dm index 1ec17a1a561d..9571859b0f0f 100644 --- a/code/modules/gear_presets/pmc.dm +++ b/code/modules/gear_presets/pmc.dm @@ -26,17 +26,17 @@ if(prob(10)) first_name = "[capitalize(randomly_generate_japanese_word(rand(2, 3)))]" else - first_name = "[pick(first_names_male_pmc)]" + first_name = "[pick(GLOB.first_names_male_pmc)]" new_human.f_style = "5 O'clock Shadow" else if(prob(10)) first_name = "[capitalize(randomly_generate_japanese_word(rand(2, 3)))]" else - first_name = "[pick(first_names_female_pmc)]" + first_name = "[pick(GLOB.first_names_female_pmc)]" if(prob(25)) last_name = "[capitalize(randomly_generate_japanese_word(rand(2, 4)))]" else - last_name = "[pick(last_names_pmc)]" + last_name = "[pick(GLOB.last_names_pmc)]" random_name = "[first_name] [last_name]" new_human.change_real_name(new_human, random_name) new_human.age = rand(25,35) @@ -1860,9 +1860,9 @@ list("POUCHES (CHOOSE 2)", 0, null, null, null), if(prob(10)) random_name = "[capitalize(randomly_generate_japanese_word(rand(2, 3)))]" else if(new_human.gender == MALE) - random_name = "[pick(first_names_male_pmc)]" + random_name = "[pick(GLOB.first_names_male_pmc)]" else - random_name = "[pick(first_names_female_pmc)]" + random_name = "[pick(GLOB.first_names_female_pmc)]" if(new_human.gender == MALE) new_human.f_style = "5 O'clock Shadow" diff --git a/code/modules/gear_presets/royal_marines.dm b/code/modules/gear_presets/royal_marines.dm index c990f19fdb27..90361a24cc57 100644 --- a/code/modules/gear_presets/royal_marines.dm +++ b/code/modules/gear_presets/royal_marines.dm @@ -24,11 +24,11 @@ new_human.b_eyes = colors[eye_color][3] idtype = /obj/item/card/id/dogtag if(new_human.gender == MALE) - random_name = "[pick(first_names_male)] [pick(last_names)]" + random_name = "[pick(GLOB.first_names_male)] [pick(GLOB.last_names)]" new_human.h_style = pick("Crewcut", "Shaved Head", "Buzzcut", "Undercut", "Side Undercut", "Pvt. Joker", "Marine Fade", "Low Fade", "Medium Fade", "High Fade", "No Fade", "Coffee House Cut", "Flat Top",) new_human.f_style = pick("5 O'clock Shadow", "Shaved", "Full Beard", "3 O'clock Moustache", "5 O'clock Shadow", "5 O'clock Moustache", "7 O'clock Shadow", "7 O'clock Moustache",) else - random_name = "[pick(first_names_female)] [pick(last_names)]" + random_name = "[pick(GLOB.first_names_female)] [pick(GLOB.last_names)]" new_human.h_style = pick("Ponytail 1", "Ponytail 2", "Ponytail 3", "Ponytail 4", "Pvt. Redding", "Pvt. Clarison", "Cpl. Dietrich", "Pvt. Vasquez", "Marine Bun", "Marine Bun 2", "Marine Flat Top",) new_human.change_real_name(new_human, random_name) new_human.age = rand(20,45) diff --git a/code/modules/gear_presets/survivors/survivors.dm b/code/modules/gear_presets/survivors/survivors.dm index 6d7036635b1c..7a346fe1edd6 100644 --- a/code/modules/gear_presets/survivors/survivors.dm +++ b/code/modules/gear_presets/survivors/survivors.dm @@ -22,7 +22,7 @@ new_human.gender = pick(MALE, FEMALE) var/datum/preferences/A = new A.randomize_appearance(new_human) - var/random_name = capitalize(pick(new_human.gender == MALE ? first_names_male : first_names_female)) + " " + capitalize(pick(last_names)) + var/random_name = capitalize(pick(new_human.gender == MALE ? GLOB.first_names_male : GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) new_human.change_real_name(new_human, random_name) new_human.age = rand(21,45) @@ -339,7 +339,7 @@ Everything bellow is a parent used as a base for one or multiple maps. present in xenomorph.dm file -var/list/survivor_types = list( +GLOBAL_LIST_INIT(survivor_types, list() /datum/equipment_preset/survivor/scientist, /datum/equipment_preset/survivor/doctor, /datum/equipment_preset/survivor/security, diff --git a/code/modules/gear_presets/synths.dm b/code/modules/gear_presets/synths.dm index 9ac7950b7246..651a324003bc 100644 --- a/code/modules/gear_presets/synths.dm +++ b/code/modules/gear_presets/synths.dm @@ -668,11 +668,11 @@ var/datum/preferences/A = new() A.randomize_appearance(new_human) if(new_human.gender == MALE) - first_name = "[pick(first_names_male_colonist)]" + first_name = "[pick(GLOB.first_names_male_colonist)]" else - first_name ="[pick(first_names_female_colonist)]" + first_name ="[pick(GLOB.first_names_female_colonist)]" - last_name ="[pick(last_names_colonist)]" + last_name ="[pick(GLOB.last_names_colonist)]" random_name = "[first_name] [last_name]" new_human.change_real_name(new_human, random_name) var/static/list/colors = list("BLACK" = list(15, 15, 25), "BROWN" = list(102, 51, 0), "AUBURN" = list(139, 62, 19)) diff --git a/code/modules/gear_presets/upp.dm b/code/modules/gear_presets/upp.dm index 6406cf5301f2..5a2c09b63b85 100644 --- a/code/modules/gear_presets/upp.dm +++ b/code/modules/gear_presets/upp.dm @@ -21,18 +21,18 @@ if(prob(40)) first_name = "[capitalize(randomly_generate_chinese_word(1))]" else - first_name = "[pick(first_names_male_upp)]" + first_name = "[pick(GLOB.first_names_male_upp)]" new_human.f_style = pick("3 O'clock Shadow", "3 O'clock Moustache", "5 O'clock Shadow", "5 O'clock Moustache") else if(prob(40)) first_name = "[capitalize(randomly_generate_chinese_word(1))]" else - first_name = "[pick(first_names_female_upp)]" + first_name = "[pick(GLOB.first_names_female_upp)]" //surname if(prob(35)) last_name = "[capitalize(randomly_generate_chinese_word(pick(20;1, 80;2)))]" else - last_name = "[pick(last_names_upp)]" + last_name = "[pick(GLOB.last_names_upp)]" //put them together random_name = "[first_name] [last_name]" @@ -2603,9 +2603,9 @@ if(prob(10)) random_name = "[capitalize(randomly_generate_chinese_word(2))]" else if(new_human.gender == MALE) - random_name = "[pick(first_names_male_upp)]" + random_name = "[pick(GLOB.first_names_male_upp)]" else - random_name = "[pick(first_names_female_upp)]" + random_name = "[pick(GLOB.first_names_female_upp)]" if(new_human.gender == MALE) new_human.f_style = pick("3 O'clock Shadow", "3 O'clock Moustache", "5 O'clock Shadow", "5 O'clock Moustache") diff --git a/code/modules/gear_presets/uscm.dm b/code/modules/gear_presets/uscm.dm index 573b8a87342d..bb3cf26e2dee 100644 --- a/code/modules/gear_presets/uscm.dm +++ b/code/modules/gear_presets/uscm.dm @@ -860,7 +860,7 @@ uses_special_name = TRUE /datum/equipment_preset/uscm/marsoc/covert/load_name(mob/living/carbon/human/new_human, randomise) new_human.gender = MALE - new_human.change_real_name(new_human, "[pick(nato_phonetic_alphabet)]") + new_human.change_real_name(new_human, "[pick(GLOB.nato_phonetic_alphabet)]") new_human.age = rand(20,30) /datum/equipment_preset/uscm/marsoc/covert/load_rank(mob/living/carbon/human/new_human) return "O" @@ -888,7 +888,7 @@ uses_special_name = TRUE /datum/equipment_preset/uscm/marsoc/sl/covert/load_name(mob/living/carbon/human/new_human, randomise) new_human.gender = MALE - new_human.change_real_name(new_human, "[pick(nato_phonetic_alphabet)]") + new_human.change_real_name(new_human, "[pick(GLOB.nato_phonetic_alphabet)]") new_human.age = rand(20,30) /datum/equipment_preset/uscm/marsoc/sl/covert/load_rank(mob/living/carbon/human/new_human) return "O" diff --git a/code/modules/gear_presets/whiteout.dm b/code/modules/gear_presets/whiteout.dm index 2028148c8181..0f367b57e9e2 100644 --- a/code/modules/gear_presets/whiteout.dm +++ b/code/modules/gear_presets/whiteout.dm @@ -27,9 +27,9 @@ //A.randomize_appearance(mob) var/random_name if(new_human.gender == MALE) - random_name = "[pick(greek_letters)]" + random_name = "[pick(GLOB.greek_letters)]" else - random_name = "[pick(greek_letters)]" + random_name = "[pick(GLOB.greek_letters)]" new_human.change_real_name(new_human, random_name) new_human.age = rand(17,45) diff --git a/code/modules/gear_presets/wy_goons.dm b/code/modules/gear_presets/wy_goons.dm index 5160f0bf319a..1be8cb990255 100644 --- a/code/modules/gear_presets/wy_goons.dm +++ b/code/modules/gear_presets/wy_goons.dm @@ -22,11 +22,11 @@ var/last_name //gender checks if(new_human.gender == MALE) - first_name = "[pick(first_names_male_pmc)]" + first_name = "[pick(GLOB.first_names_male_pmc)]" new_human.f_style = pick("3 O'clock Shadow", "3 O'clock Moustache", "5 O'clock Shadow", "5 O'clock Moustache") else - first_name = "[pick(first_names_female_pmc)]" - last_name = "[pick(last_names_pmc)]" + first_name = "[pick(GLOB.first_names_female_pmc)]" + last_name = "[pick(GLOB.last_names_pmc)]" random_name = "[first_name] [last_name]" new_human.change_real_name(new_human, random_name) diff --git a/code/modules/holidays/halloween/decorators.dm b/code/modules/holidays/halloween/decorators.dm index b25d6ff6b957..6575ed5ba665 100644 --- a/code/modules/holidays/halloween/decorators.dm +++ b/code/modules/holidays/halloween/decorators.dm @@ -90,7 +90,7 @@ // Skip this if this corner is result of a door connection (mostly for Almayer shutters) var/valid = TRUE - for(var/a_cardinal in cardinal) + for(var/a_cardinal in GLOB.cardinals) var/cardinal_dir = diag & a_cardinal if(!a_cardinal) // We check cardinals contributing to that diagonal continue diff --git a/code/modules/hydroponics/grown_inedible.dm b/code/modules/hydroponics/grown_inedible.dm index 38ff3ea26528..e47ad43acaf1 100644 --- a/code/modules/hydroponics/grown_inedible.dm +++ b/code/modules/hydroponics/grown_inedible.dm @@ -15,7 +15,7 @@ // Fill the object up with the appropriate reagents. if(!isnull(plantname)) - var/datum/seed/S = seed_types[plantname] + var/datum/seed/S = GLOB.seed_types[plantname] if(!S || !S.chems) return diff --git a/code/modules/hydroponics/hydro_tools.dm b/code/modules/hydroponics/hydro_tools.dm index cc4ef0daf7f3..b7e3d8bb84c5 100644 --- a/code/modules/hydroponics/hydro_tools.dm +++ b/code/modules/hydroponics/hydro_tools.dm @@ -19,11 +19,11 @@ return ..() else if(istype(target,/obj/item/reagent_container/food/snacks/grown)) var/obj/item/reagent_container/food/snacks/grown/G = target - grown_seed = seed_types[G.plantname] + grown_seed = GLOB.seed_types[G.plantname] grown_reagents = G.reagents else if(istype(target,/obj/item/grown)) var/obj/item/grown/G = target - grown_seed = seed_types[G.plantname] + grown_seed = GLOB.seed_types[G.plantname] grown_reagents = G.reagents else if(istype(target,/obj/item/seeds)) var/obj/item/seeds/S = target diff --git a/code/modules/hydroponics/hydro_tray.dm b/code/modules/hydroponics/hydro_tray.dm index 4d175c5a6f1f..d3a086d96e04 100644 --- a/code/modules/hydroponics/hydro_tray.dm +++ b/code/modules/hydroponics/hydro_tray.dm @@ -426,7 +426,7 @@ //Remove the seed if something is already planted. if(seed) seed = null - seed = seed_types[pick(list("mushrooms","plumphelmet","harebells","poppies","grass","weeds"))] + seed = GLOB.seed_types[pick(list("mushrooms","plumphelmet","harebells","poppies","grass","weeds"))] if(!seed) return //Weed does not exist, someone fucked up. dead = 0 @@ -456,7 +456,7 @@ // We need to make sure we're not modifying one of the global seed datums. // If it's not in the global list, then no products of the line have been // harvested yet and it's safe to assume it's restricted to this tray. - if(!isnull(seed_types[seed.name])) + if(!isnull(GLOB.seed_types[seed.name])) seed = seed.diverge() seed.mutate(severity,get_turf(src)) @@ -481,8 +481,8 @@ var/previous_plant = seed.display_name var/newseed = seed.get_mutant_variant() - if(newseed in seed_types) - seed = seed_types[newseed] + if(newseed in GLOB.seed_types) + seed = GLOB.seed_types[newseed] else return diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index 2aff95eb1fcc..04339f77c9bc 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -1,5 +1,5 @@ -var/global/list/seed_types = list() // A list of all seed data. -var/global/list/gene_tag_masks = list() // Gene obfuscation for delicious trial and error goodness. +GLOBAL_LIST_EMPTY(seed_types) // A list of all seed data. +GLOBAL_LIST_EMPTY(gene_tag_masks) // Gene obfuscation for delicious trial and error goodness. // Debug for testing seed genes. /client/proc/show_plant_genes() @@ -9,12 +9,12 @@ var/global/list/gene_tag_masks = list() // Gene obfuscation for delicious tria if(!admin_holder) return - if(!gene_tag_masks) + if(!GLOB.gene_tag_masks) to_chat(usr, "Gene masks not set.") return - for(var/mask in gene_tag_masks) - to_chat(usr, "[mask]: [gene_tag_masks[mask]]") + for(var/mask in GLOB.gene_tag_masks) + to_chat(usr, "[mask]: [GLOB.gene_tag_masks[mask]]") // Predefined/roundstart varieties use a string key to make it // easier to grab the new variety when mutating. Post-roundstart @@ -26,8 +26,8 @@ var/global/list/gene_tag_masks = list() // Gene obfuscation for delicious tria // Populate the global seed datum list. for(var/type in typesof(/datum/seed)-/datum/seed) var/datum/seed/S = new type - seed_types[S.name] = S - S.uid = "[seed_types.len]" + GLOB.seed_types[S.name] = S + S.uid = "[GLOB.seed_types.len]" S.roundstart = 1 // Make sure any seed packets that were mapped in are updated @@ -54,7 +54,7 @@ var/global/list/gene_tag_masks = list() // Gene obfuscation for delicious tria used_masks += gene_mask gene_tags -= gene_tag - gene_tag_masks[gene_tag] = gene_mask + GLOB.gene_tag_masks[gene_tag] = gene_mask /datum/plantgene var/genetype // Label used when applying trait. @@ -379,12 +379,12 @@ var/global/list/gene_tag_masks = list() // Gene obfuscation for delicious tria else source_turf.visible_message(SPAN_NOTICE("\The [display_name]'s flowers wither and fall off.")) else //New chems! (20% chance) - var/new_chem = list(pick( prob(10);pick(chemical_gen_classes_list["C1"]),\ - prob(15);pick(chemical_gen_classes_list["C2"]),\ - prob(25);pick(chemical_gen_classes_list["C3"]),\ - prob(30);pick(chemical_gen_classes_list["C4"]),\ - prob(15);pick(chemical_gen_classes_list["T1"]),\ - prob(5);pick(chemical_gen_classes_list["T2"])) = list(1,rand(1,2))) + var/new_chem = list(pick( prob(10);pick(GLOB.chemical_gen_classes_list["C1"]),\ + prob(15);pick(GLOB.chemical_gen_classes_list["C2"]),\ + prob(25);pick(GLOB.chemical_gen_classes_list["C3"]),\ + prob(30);pick(GLOB.chemical_gen_classes_list["C4"]),\ + prob(15);pick(GLOB.chemical_gen_classes_list["T1"]),\ + prob(5);pick(GLOB.chemical_gen_classes_list["T2"])) = list(1,rand(1,2))) chems += new_chem @@ -580,10 +580,10 @@ var/global/list/gene_tag_masks = list() // Gene obfuscation for delicious tria to_chat(user, "You [harvest_sample ? "take a sample" : "harvest"] from the [display_name].") //This may be a new line. Update the global if it is. - if(name == "new line" || !(name in seed_types)) - uid = seed_types.len + 1 + if(name == "new line" || !(name in GLOB.seed_types)) + uid = GLOB.seed_types.len + 1 name = "[uid]" - seed_types[name] = src + GLOB.seed_types[name] = src if(harvest_sample) var/obj/item/seeds/seeds = new(get_turf(user)) diff --git a/code/modules/hydroponics/seed_machines/seed_editor.dm b/code/modules/hydroponics/seed_machines/seed_editor.dm index 2e89a9c7fb10..37e25fb3508a 100644 --- a/code/modules/hydroponics/seed_machines/seed_editor.dm +++ b/code/modules/hydroponics/seed_machines/seed_editor.dm @@ -21,7 +21,7 @@ data["sourceName"] = loaded_disk.genesource for(var/datum/plantgene/P in loaded_disk.genes) - locus.Add("[gene_tag_masks[P.genetype]]") + locus.Add("[GLOB.gene_tag_masks[P.genetype]]") data["locus"] = locus else @@ -56,7 +56,7 @@ if(!loaded_disk || !seed) return - if(!isnull(seed_types[seed.seed.name])) + if(!isnull(GLOB.seed_types[seed.seed.name])) seed.seed = seed.seed.diverge(1) seed.seed_type = seed.seed.name seed.update_seed() diff --git a/code/modules/hydroponics/seed_machines/seed_extractor.dm b/code/modules/hydroponics/seed_machines/seed_extractor.dm index 4f8867596c76..58d11e7990fc 100644 --- a/code/modules/hydroponics/seed_machines/seed_extractor.dm +++ b/code/modules/hydroponics/seed_machines/seed_extractor.dm @@ -16,10 +16,10 @@ var/list/data = list() var/list/geneMasks = list() - for(var/gene_tag in gene_tag_masks) + for(var/gene_tag in GLOB.gene_tag_masks) var/list/genedata = list(list( "tag" = gene_tag, - "mask" = gene_tag_masks[gene_tag] + "mask" = GLOB.gene_tag_masks[gene_tag] )) geneMasks += genedata @@ -89,8 +89,8 @@ if(!genetics.roundstart) loaded_disk.genesource += " (variety #[genetics.uid])" - loaded_disk.name += " ([gene_tag_masks[params["gene"]]], #[genetics.uid])" - loaded_disk.desc += " The label reads \'gene [gene_tag_masks[params["gene"]]], sampled from [genetics.display_name]\'." + loaded_disk.name += " ([GLOB.gene_tag_masks[params["gene"]]], #[genetics.uid])" + loaded_disk.desc += " The label reads \'gene [GLOB.gene_tag_masks[params["gene"]]], sampled from [genetics.display_name]\'." playsound(loc, 'sound/machines/fax.ogg', 15, 1) eject_disk() diff --git a/code/modules/hydroponics/seed_machines/seed_machines.dm b/code/modules/hydroponics/seed_machines/seed_machines.dm index 501118465ecf..ad3fbed4625f 100644 --- a/code/modules/hydroponics/seed_machines/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines/seed_machines.dm @@ -30,10 +30,10 @@ return seed.forceMove(get_turf(src)) - if(seed.seed.name == "new line" || isnull(seed_types[seed.seed.name])) - seed.seed.uid = seed_types.len + 1 + if(seed.seed.name == "new line" || isnull(GLOB.seed_types[seed.seed.name])) + seed.seed.uid = GLOB.seed_types.len + 1 seed.seed.name = "[seed.seed.uid]" - seed_types[seed.seed.name] = seed.seed + GLOB.seed_types[seed.seed.name] = seed.seed seed.update_seed() playsound(src, 'sound/machines/terminal_eject.ogg', 25, TRUE) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index ca203dcc1ada..1895389abb07 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -50,8 +50,8 @@ //Grabs the appropriate seed datum from the global list. /obj/item/seeds/proc/update_seed() - if(!seed && seed_type && !isnull(seed_types) && seed_types[seed_type]) - seed = seed_types[seed_type] + if(!seed && seed_type && !isnull(GLOB.seed_types) && GLOB.seed_types[seed_type]) + seed = GLOB.seed_types[seed_type] update_appearance() //Updates strings and icon appropriately based on seed datum. diff --git a/code/modules/hydroponics/vines.dm b/code/modules/hydroponics/vines.dm index 14091a1d29bb..bfca73e8d01b 100644 --- a/code/modules/hydroponics/vines.dm +++ b/code/modules/hydroponics/vines.dm @@ -124,7 +124,6 @@ if(V && (V.stat != DEAD) && (V.buckled != src)) // If mob exists and is not dead or captured. V.buckled = src V.forceMove(src.loc) - V.update_canmove() src.buckled_mob = V to_chat(V, SPAN_DANGER("The vines [pick("wind", "tangle", "tighten")] around you!")) @@ -193,7 +192,7 @@ overlays += flower_overlay /obj/effect/plantsegment/proc/spread() - var/direction = pick(cardinal) + var/direction = pick(GLOB.cardinals) var/step = get_step(src,direction) if(istype(step,/turf/open/floor)) var/turf/open/floor/F = step diff --git a/code/modules/maptext_alerts/text_blurbs.dm b/code/modules/maptext_alerts/text_blurbs.dm index c942543f88df..297b02aff3a3 100644 --- a/code/modules/maptext_alerts/text_blurbs.dm +++ b/code/modules/maptext_alerts/text_blurbs.dm @@ -5,7 +5,7 @@ set waitfor = 0 var/areaname = replacetext(A.name, "\improper", "") //The \improper flickers "ÿ" briefly - var/text = "[worldtime2text("hhmm")], [time2text(REALTIMEOFDAY, "DD-MMM-[game_year]")]\n[station_name], [areaname]" + var/text = "[worldtime2text("hhmm")], [time2text(REALTIMEOFDAY, "DD-MMM-[GLOB.game_year]")]\n[MAIN_SHIP_NAME], [areaname]" show_blurb(targets, duration, text, TRUE) @@ -14,13 +14,13 @@ exempt_ztraits = trait or list of traits of zlevels where any marines don't see shouldn't see the ship marines' drop message. Ex. ZTRAIT_GROUND by default. unit = the unit the marines are from. FF, Dust Raiders etc. Military crew see this. base = the base the marines are staging from. The ship, Whiskey Outpost etc. Noncombat crew see this.**/ -/proc/show_blurb_uscm(list/exempt_ztraits = ZTRAIT_GROUND, unit = "2nd Bat. 'Falling Falcons'", base = station_name) +/proc/show_blurb_uscm(list/exempt_ztraits = ZTRAIT_GROUND, unit = "2nd Bat. 'Falling Falcons'", base = MAIN_SHIP_NAME) if(!islist(exempt_ztraits)) exempt_ztraits = list(exempt_ztraits) var/list/exempt_zlevels = SSmapping.levels_by_any_trait(exempt_ztraits) - var/base_text = "[uppertext(round_statistics.round_name)]\n\ - [worldtime2text("hhmm hrs")], [uppertext(time2text(REALTIMEOFDAY, "DD-MMM-[game_year]"))]\n\ + var/base_text = "[uppertext(GLOB.round_statistics.round_name)]\n\ + [worldtime2text("hhmm hrs")], [uppertext(time2text(REALTIMEOFDAY, "DD-MMM-[GLOB.game_year]"))]\n\ [SSmapping.configs[GROUND_MAP].map_name]" var/list/post_text = list("combat" = "\n[unit]", diff --git a/code/modules/mob/camera/imaginary_friend.dm b/code/modules/mob/camera/imaginary_friend.dm index 0be51ede324a..4e7be80056de 100644 --- a/code/modules/mob/camera/imaginary_friend.dm +++ b/code/modules/mob/camera/imaginary_friend.dm @@ -150,21 +150,21 @@ var/datum/mob_hud/hud switch(hud_choice) if("Medical HUD") - hud = huds[MOB_HUD_MEDICAL_OBSERVER] + hud = GLOB.huds[MOB_HUD_MEDICAL_OBSERVER] if("Security HUD") - hud = huds[MOB_HUD_SECURITY_ADVANCED] + hud = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] if("Squad HUD") - hud = huds[MOB_HUD_FACTION_OBSERVER] + hud = GLOB.huds[MOB_HUD_FACTION_OBSERVER] if("Xeno Status HUD") - hud = huds[MOB_HUD_XENO_STATUS] + hud = GLOB.huds[MOB_HUD_XENO_STATUS] if("Faction UPP HUD") - hud = huds[MOB_HUD_FACTION_UPP] + hud = GLOB.huds[MOB_HUD_FACTION_UPP] if("Faction Wey-Yu HUD") - hud = huds[MOB_HUD_FACTION_WY] + hud = GLOB.huds[MOB_HUD_FACTION_WY] if("Faction TWE HUD") - hud = huds[MOB_HUD_FACTION_TWE] + hud = GLOB.huds[MOB_HUD_FACTION_TWE] if("Faction CLF HUD") - hud = huds[MOB_HUD_FACTION_CLF] + hud = GLOB.huds[MOB_HUD_FACTION_CLF] if(hud_choice in current_huds) hud.remove_hud_from(src, src) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index a68a67cfdf53..887313eb4db9 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -25,7 +25,6 @@ icon = 'icons/mob/mob.dmi' icon_state = "ghost" density = FALSE - canmove = TRUE blinded = FALSE anchored = TRUE // don't get pushed around invisibility = INVISIBILITY_OBSERVER @@ -80,6 +79,9 @@ GLOB.observer_list += src + // Ghosts don't move, they teleport via a special case in mob code + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) + var/turf/spawn_turf if(ismob(body)) spawn_turf = get_turf(body) //Where is the body located? @@ -117,7 +119,7 @@ forceMove(spawn_turf) if(!name) //To prevent nameless ghosts - name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + name = capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) if(name == "Unknown") if(body) name = body.real_name @@ -392,28 +394,28 @@ if(HUD_toggled[i]) switch(i) if("Medical HUD") - H = huds[MOB_HUD_MEDICAL_OBSERVER] + H = GLOB.huds[MOB_HUD_MEDICAL_OBSERVER] H.add_hud_to(src, src) if("Security HUD") - H = huds[MOB_HUD_SECURITY_ADVANCED] + H = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] H.add_hud_to(src, src) if("Squad HUD") - H = huds[MOB_HUD_FACTION_OBSERVER] + H = GLOB.huds[MOB_HUD_FACTION_OBSERVER] H.add_hud_to(src, src) if("Xeno Status HUD") - H = huds[MOB_HUD_XENO_STATUS] + H = GLOB.huds[MOB_HUD_XENO_STATUS] H.add_hud_to(src, src) if("Faction UPP HUD") - H = huds[MOB_HUD_FACTION_UPP] + H = GLOB.huds[MOB_HUD_FACTION_UPP] H.add_hud_to(src, src) if("Faction Wey-Yu HUD") - H = huds[MOB_HUD_FACTION_WY] + H = GLOB.huds[MOB_HUD_FACTION_WY] H.add_hud_to(src, src) if("Faction TWE HUD") - H = huds[MOB_HUD_FACTION_TWE] + H = GLOB.huds[MOB_HUD_FACTION_TWE] H.add_hud_to(src, src) if("Faction CLF HUD") - H = huds[MOB_HUD_FACTION_CLF] + H = GLOB.huds[MOB_HUD_FACTION_CLF] H.add_hud_to(src, src) see_invisible = INVISIBILITY_OBSERVER @@ -472,20 +474,20 @@ Works together with spawning an observer, noted above. if(!can_reenter_corpse) away_timer = 300 //They'll never come back, so we can max out the timer right away. - if(round_statistics) - round_statistics.update_panel_data() + if(GLOB.round_statistics) + GLOB.round_statistics.update_panel_data() track_death_calculations() //This needs to be done before mind is nullified if(ghost.mind) ghost.mind.original = ghost else if(ghost.mind && ghost.mind.player_entity) //Use else here because track_death_calculations() already calls this. - ghost.mind.player_entity.update_panel_data(round_statistics) + ghost.mind.player_entity.update_panel_data(GLOB.round_statistics) ghost.mind.original = src mind = null if(ghost.client) ghost.client.init_verbs() - ghost.client.change_view(world_view_size) //reset view range to default + ghost.client.change_view(GLOB.world_view_size) //reset view range to default ghost.client.pixel_x = 0 //recenters our view ghost.client.pixel_y = 0 ghost.set_lighting_alpha_from_pref(ghost.client) @@ -522,7 +524,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/living/proc/do_ghost() if(stat == DEAD) if(mind && mind.player_entity) - mind.player_entity.update_panel_data(round_statistics) + mind.player_entity.update_panel_data(GLOB.round_statistics) ghostize(TRUE) else var/list/options = list("Ghost", "Stay in body") @@ -829,8 +831,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set category = "Ghost.Settings" if(client) - if(client.view != world_view_size) - client.change_view(world_view_size) + if(client.view != GLOB.world_view_size) + client.change_view(GLOB.world_view_size) else client.change_view(14) @@ -1147,7 +1149,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(src, SPAN_INFO("Wrong game mode. You have to be observing a Hunter Games round.")) return - if(!waiting_for_drop_votes) + var/datum/game_mode/huntergames/mode = SSticker.mode + + if(!mode.waiting_for_drop_votes) to_chat(src, SPAN_INFO("There's no drop vote currently in progress. Wait for a supply drop to be announced!")) return @@ -1191,8 +1195,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "View Kill Feed" set desc = "View global kill statistics tied to the game." - if(round_statistics) - round_statistics.show_kill_feed(src) + if(GLOB.round_statistics) + GLOB.round_statistics.show_kill_feed(src) /mob/dead/observer/get_status_tab_items() . = ..() @@ -1280,7 +1284,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!key_to_use) return - if(!(RoleAuthority.roles_whitelist[key_to_use] & WHITELIST_PREDATOR)) + if(!(GLOB.RoleAuthority.roles_whitelist[key_to_use] & WHITELIST_PREDATOR)) return if(!SSticker.mode) diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index 33af36991e17..b9a972bda5c2 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -21,7 +21,7 @@ if(!client) return - if(speaker && !speaker.client && client.prefs.toggles_chat & CHAT_GHOSTEARS && speaker.z == z && get_dist(speaker, src) <= world_view_size) + if(speaker && !speaker.client && client.prefs.toggles_chat & CHAT_GHOSTEARS && speaker.z == z && get_dist(speaker, src) <= GLOB.world_view_size) //Does the speaker have a client? It's either random stuff that observers won't care about (Experiment 97B says, 'EHEHEHEHEHEHEHE') //Or someone snoring. So we make it where they won't hear it. return @@ -52,10 +52,10 @@ var/mob/hologram/queen/queen_eye = speaker?.client?.eye if(istype(queen_eye)) track += "(E) " - if(client && client.prefs && client.prefs.toggles_chat & CHAT_GHOSTEARS && speaker.z == z && get_dist(speaker, src) <= world_view_size) + if(client && client.prefs && client.prefs.toggles_chat & CHAT_GHOSTEARS && speaker.z == z && get_dist(speaker, src) <= GLOB.world_view_size) message = "[message]" to_chat(src, "[comm_paygrade][speaker_name][alt_name] [track][verb], \"[message]\"") - if (speech_sound && (get_dist(speaker, src) <= world_view_size && src.z == speaker.z)) + if (speech_sound && (get_dist(speaker, src) <= GLOB.world_view_size && src.z == speaker.z)) var/turf/source = speaker? get_turf(speaker) : get_turf(src) playsound_client(client, speech_sound, source, sound_vol) diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 6c825ec50994..8aea59b96a81 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -57,13 +57,11 @@ set_stat(DEAD) - update_canmove() - dizziness = 0 jitteriness = 0 if(client) - client.change_view(world_view_size) //just so we never get stuck with a large view somehow + client.change_view(GLOB.world_view_size) //just so we never get stuck with a large view somehow if(s_active) //Close inventory screens. s_active.storage_close(src) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index ca5639c36cd0..c66d096c6c68 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -12,7 +12,7 @@ //non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet. if (language && (language.flags & NONVERBAL)) - if (!speaker || (src.sdisabilities & DISABILITY_BLIND || src.blinded) || !(speaker.z == z && get_dist(speaker, src) <= world_view_size)) + if (!speaker || (src.sdisabilities & DISABILITY_BLIND || src.blinded) || !(speaker.z == z && get_dist(speaker, src) <= GLOB.world_view_size)) message = language.scramble(message) if(!say_understands(speaker,language)) @@ -47,7 +47,7 @@ to_chat(src, SPAN_LOCALSAY("[comm_paygrade][speaker_name][alt_name] talks but you cannot hear them.")) else to_chat(src, SPAN_LOCALSAY("[comm_paygrade][speaker_name][alt_name] [verb], \"[message]\"")) - if (speech_sound && (get_dist(speaker, src) <= world_view_size && src.z == speaker.z)) + if (speech_sound && (get_dist(speaker, src) <= GLOB.world_view_size && src.z == speaker.z)) var/turf/source = speaker? get_turf(speaker) : get_turf(src) playsound_client(src.client, speech_sound, source, sound_vol, GET_RANDOM_FREQ) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 5ce40810e0b2..d71a908d627a 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -29,8 +29,6 @@ //Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_l_hand(obj/item/W) - if(lying) - return FALSE if(!istype(W)) return FALSE if(!l_hand) @@ -48,8 +46,6 @@ //Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_r_hand(obj/item/W) - if(lying) - return FALSE if(!istype(W)) return FALSE if(!r_hand) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index ab3ce823c68e..dea179e6ad48 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -2,80 +2,6 @@ BLOOD SYSTEM */ -/mob/living/proc/handle_blood() - return - -// Takes care blood loss and regeneration -/mob/living/carbon/human/handle_blood() - if(NO_BLOOD in species.flags) - return - - if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood. - //Blood regeneration if there is some space - if(blood_volume < max_blood && nutrition >= 1) - blood_volume += 0.1 // regenerate blood VERY slowly - nutrition -= 0.25 - else if(blood_volume > max_blood) - blood_volume -= 0.1 // The reverse in case we've gotten too much blood in our body - if(blood_volume > limit_blood) - blood_volume = limit_blood // This should never happen, but lets make sure - - var/b_volume = blood_volume - - // Damaged heart virtually reduces the blood volume, as the blood isn't - // being pumped properly anymore. - if(species && species.has_organ["heart"]) - var/datum/internal_organ/heart/heart = internal_organs_by_name["heart"] - if(!heart) - b_volume = 0 - else if(chem_effect_flags & CHEM_EFFECT_ORGAN_STASIS) - b_volume *= 1 - else if(heart.damage >= heart.organ_status >= ORGAN_BRUISED) - b_volume *= Clamp(100 - (2 * heart.damage), 30, 100) / 100 - - //Effects of bloodloss - if(b_volume <= BLOOD_VOLUME_SAFE) - /// The blood volume turned into a %, with BLOOD_VOLUME_NORMAL being 100% - var/blood_percentage = b_volume / (BLOOD_VOLUME_NORMAL / 100) - /// How much oxyloss will there be from the next time blood processes - var/additional_oxyloss = (100 - blood_percentage) / 5 - /// The limit of the oxyloss gained, ignoring oxyloss from the switch statement - var/maximum_oxyloss = Clamp((100 - blood_percentage) / 2, oxyloss, 100) - if(oxyloss < maximum_oxyloss) - oxyloss += round(max(additional_oxyloss, 0)) - - switch(b_volume) - if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE) - if(prob(1)) - var/word = pick("dizzy","woozy","faint") - to_chat(src, SPAN_DANGER("You feel [word].")) - if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY) - if(eye_blurry < 50) - AdjustEyeBlur(6) - oxyloss += 3 - if(prob(15)) - apply_effect(rand(1,3), PARALYZE) - var/word = pick("dizzy","woozy","faint") - to_chat(src, SPAN_DANGER("You feel very [word].")) - if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD) - if(eye_blurry < 50) - AdjustEyeBlur(6) - oxyloss += 8 - toxloss += 3 - if(prob(15)) - apply_effect(rand(1,3), PARALYZE) - var/word = pick("dizzy","woozy","faint") - to_chat(src, SPAN_DANGER("You feel extremely [word].")) - if(0 to BLOOD_VOLUME_SURVIVE) - death(create_cause_data("blood loss")) - -// Xeno blood regeneration -/mob/living/carbon/xenomorph/handle_blood() - if(stat != DEAD) //Only living xenos regenerate blood - //Blood regeneration if there is some space - if(blood_volume < max_blood) - blood_volume = min(blood_volume + 1, max_blood) - //Makes a blood drop, leaking amt units of blood from the mob /mob/living/carbon/proc/drip(amt) if(!blood_volume) @@ -91,7 +17,7 @@ /mob/living/carbon/human/drip(amt) if(in_stasis) // stasis now stops bloodloss return - if(NO_BLOOD in species.flags) + if((species.flags & NO_BLOOD) && !(species.flags & IS_SYNTHETIC)) return ..() @@ -272,7 +198,7 @@ return "xenoblood" /mob/living/carbon/human/get_blood_id() - if((NO_BLOOD in species.flags)) + if(species.flags & NO_BLOOD) return if(special_blood) return special_blood diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index 60fe422c0e4b..b815fe4e3621 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -41,15 +41,6 @@ return 1 return ..() - -/mob/living/brain/update_canmove() - canmove = FALSE - return canmove - - - - - /mob/living/brain/update_sight() if (stat == DEAD) sight |= SEE_TURFS @@ -76,5 +67,5 @@ set desc = "Relinquish your sentience and visit the land of the past." if(mind && mind.player_entity) - mind.player_entity.update_panel_data(round_statistics) + mind.player_entity.update_panel_data(GLOB.round_statistics) ghostize(TRUE) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index c8925239c33b..4f1b4f193275 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -67,4 +67,4 @@ brainmob.mind.transfer_to(target) else target.key = brainmob.key - if(target.client) target.client.change_view(world_view_size) + if(target.client) target.client.change_view(GLOB.world_view_size) diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index 82cbb155b516..7f84b6466144 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -18,7 +18,6 @@ //Status updates, death etc. handle_regular_status_updates() - update_canmove() if(client) handle_regular_hud_updates() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0d33503bcef4..b63ce0174a22 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -74,7 +74,7 @@ /mob/living/carbon/ex_act(severity, direction, datum/cause_data/cause_data) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER if(severity >= 30) @@ -260,19 +260,24 @@ /mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) if(src == M) return - var/t_him = "it" - if(gender == MALE) - t_him = "him" - else if(gender == FEMALE) - t_him = "her" - if(lying || sleeping) + var/t_him = p_them() + + var/shake_action + if(stat == DEAD || HAS_TRAIT(src, TRAIT_INCAPACITATED) || sleeping) // incap implies also unconscious or knockedout + shake_action = "wake [t_him] up!" + else if(HAS_TRAIT(src, TRAIT_FLOORED)) + shake_action = "get [t_him] up!" + + if(shake_action) // We are incapacitated in some fashion if(client) sleeping = max(0,sleeping-5) - if(sleeping == 0) - resting = 0 - update_canmove() - M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to wake [t_him] up!"), \ - SPAN_NOTICE("You shake [src] trying to wake [t_him] up!"), null, 4) + M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to [shake_action]"), \ + SPAN_NOTICE("You shake [src] trying to [shake_action]"), null, 4) + + else if(body_position == LYING_DOWN) // We're just chilling on the ground, let us be + M.visible_message(SPAN_NOTICE("[M] stares and waves impatiently at [src] lying on the ground."), \ + SPAN_NOTICE("You stare and wave at [src] just lying on the ground."), null, 4) + else var/mob/living/carbon/human/H = M if(istype(H)) @@ -452,19 +457,19 @@ /mob/living/carbon/slip(slip_source_name, stun_level, weaken_level, run_only, override_noslip, slide_steps) set waitfor = 0 if(buckled) return FALSE //can't slip while buckled - if(lying) return FALSE //can't slip if already lying down. + if(body_position != STANDING_UP) return FALSE //can't slip if already lying down. stop_pulling() to_chat(src, SPAN_WARNING("You slipped on \the [slip_source_name? slip_source_name : "floor"]!")) playsound(src.loc, 'sound/misc/slip.ogg', 25, 1) apply_effect(stun_level, STUN) apply_effect(weaken_level, WEAKEN) . = TRUE - if(slide_steps && lying)//lying check to make sure we downed the mob + if(slide_steps && HAS_TRAIT(src, TRAIT_FLOORED))//lying check to make sure we downed the mob var/slide_dir = dir for(var/i=1, i<=slide_steps, i++) step(src, slide_dir) sleep(2) - if(!lying) + if(!HAS_TRAIT(src, TRAIT_FLOORED)) // just watch this break in the most horrible way possible break @@ -518,3 +523,17 @@ . += SPAN_GREEN("[src] was thralled by [src.hunter_data.thralled_set.real_name] for '[src.hunter_data.thralled_reason]'.") else if(src.hunter_data.gear) . += SPAN_RED("[src] was marked as carrying gear by [src.hunter_data.gear_set].") + + +/mob/living/carbon/on_lying_down(new_lying_angle) + . = ..() + if(!buckled || buckled.buckle_lying != 0) + lying_angle_on_lying_down(new_lying_angle) + + +/// Special carbon interaction on lying down, to transform its sprite by a rotation. +/mob/living/carbon/proc/lying_angle_on_lying_down(new_lying_angle) + if(!new_lying_angle) + set_lying_angle(pick(90, 270)) + else + set_lying_angle(new_lying_angle) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 5cac9db53cc6..6ff2a96b72f0 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -1,5 +1,6 @@ /mob/living/carbon gender = MALE + mobility_flags = MOBILITY_FLAGS_CARBON_DEFAULT var/list/stomach_contents = list() var/life_tick = 0 // The amount of life ticks that have processed on this mob. diff --git a/code/modules/mob/living/carbon/carbon_helpers.dm b/code/modules/mob/living/carbon/carbon_helpers.dm index 92d049b977bc..4d3c7b9144b6 100644 --- a/code/modules/mob/living/carbon/carbon_helpers.dm +++ b/code/modules/mob/living/carbon/carbon_helpers.dm @@ -18,7 +18,7 @@ var/view_rating = view_change_sources[view_source] if(highest_view < view_rating) highest_view = view_rating - if(source && new_size != world_view_size) + if(source && new_size != GLOB.world_view_size) LAZYSET(view_change_sources, source, new_size) if(new_size < highest_view) new_size = highest_view diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index c493559ff0d8..3f88d6beccb1 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -28,7 +28,7 @@ I = giver.r_hand if(!istype(I) || (I.flags_item & (DELONDROP|NODROP|ITEM_ABSTRACT))) return - if(lying) + if(body_position == LYING_DOWN) // replace by mobiilty_flags probably to_chat(giver, SPAN_WARNING("[src] can't hold that while lying down.")) return if(r_hand && l_hand) @@ -47,7 +47,7 @@ to_chat(giver, SPAN_WARNING("You need to keep the item in your active hand.")) to_chat(src, SPAN_WARNING("[giver] seem to have given up on giving [I] to you.")) return - if(lying) + if(body_position == LYING_DOWN) to_chat(src, SPAN_WARNING("You can't hold that while lying down.")) to_chat(giver, SPAN_WARNING("[src] can't hold that while lying down.")) return diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 19810893694a..5890a44f4168 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -82,8 +82,8 @@ last_living_human = null break last_living_human = cur_human - if(last_living_human && (last_qm_callout + 2 MINUTES) < world.time) - last_qm_callout = world.time + if(last_living_human && (GLOB.last_qm_callout + 2 MINUTES) < world.time) + GLOB.last_qm_callout = world.time // Tell the xenos where the human is. xeno_announcement("I sense the last tallhost hiding in [get_area(last_living_human)].", XENO_HIVE_NORMAL, SPAN_ANNOUNCEMENT_HEADER_BLUE("[QUEEN_MOTHER_ANNOUNCE]")) // Tell the human he is the last guy. diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 228504195e52..62fbd1da09fa 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -532,16 +532,16 @@ switch(hudtype) if("security") if(skillcheck(passed_human, SKILL_POLICE, SKILL_POLICE_SKILLED)) - var/datum/mob_hud/sec_hud = huds[MOB_HUD_SECURITY_ADVANCED] + var/datum/mob_hud/sec_hud = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] if(locate(passed_mob) in sec_hud.hudusers) return TRUE if("medical") if(skillcheck(passed_human, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC)) - var/datum/mob_hud/med_hud = huds[MOB_HUD_MEDICAL_ADVANCED] + var/datum/mob_hud/med_hud = GLOB.huds[MOB_HUD_MEDICAL_ADVANCED] if(locate(passed_mob) in med_hud.hudusers) return TRUE if("squadleader") - var/datum/mob_hud/faction_hud = huds[MOB_HUD_FACTION_USCM] + var/datum/mob_hud/faction_hud = GLOB.huds[MOB_HUD_FACTION_USCM] if(passed_human.mind && passed_human.assigned_squad && passed_human.assigned_squad.squad_leader == passed_human && locate(passed_mob) in faction_hud.hudusers) return TRUE else diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 95fd393d12b5..6170aec3031c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -106,7 +106,7 @@ . += "Primary LZ: [SSticker.mode.active_lz.loc.loc.name]" if(faction == FACTION_MARINE & !isnull(SSticker) && !isnull(SSticker.mode)) - . += "Operation Name: [round_statistics.round_name]" + . += "Operation Name: [GLOB.round_statistics.round_name]" if(assigned_squad) if(assigned_squad.overwatch_officer) @@ -133,7 +133,7 @@ . += "Self Destruct Status: [SShijack.get_sd_eta()]" /mob/living/carbon/human/ex_act(severity, direction, datum/cause_data/cause_data) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER @@ -172,6 +172,7 @@ var/obj/item/item1 = get_active_hand() var/obj/item/item2 = get_inactive_hand() apply_effect(round(knockdown_minus_armor), WEAKEN) + apply_effect(round(knockdown_minus_armor), STUN) // Remove this to let people crawl after an explosion. Funny but perhaps not desirable. var/knockout_value = damage * 0.1 var/knockout_minus_armor = min(knockout_value * bomb_armor_mult * 0.5, 0.5 SECONDS) // the KO time is halved from the knockdown timer. basically same stun time, you just spend less time KO'd. apply_effect(round(knockout_minus_armor), PARALYZE) @@ -687,7 +688,7 @@ var/t1 = copytext(trim(strip_html(input("Your name and time will be added to this new comment.", "Add a comment", null, null) as message)), 1, MAX_MESSAGE_LEN) if(!(t1) || usr.stat || usr.is_mob_restrained()) return - var/created_at = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), game_year) + var/created_at = text("[]  []  []", time2text(world.realtime, "MMM DD"), time2text(world.time, "[worldtime2text()]:ss"), GLOB.game_year) var/new_comment = list("entry" = t1, "created_by" = list("name" = "", "rank" = ""), "deleted_by" = null, "deleted_at" = null, "created_at" = created_at) if(istype(usr,/mob/living/carbon/human)) var/mob/living/carbon/human/U = usr @@ -816,10 +817,10 @@ counter++ if(istype(usr,/mob/living/carbon/human)) var/mob/living/carbon/human/U = usr - R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]
    [t1]") + R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [GLOB.game_year]
    [t1]") if(istype(usr,/mob/living/silicon/robot)) var/mob/living/silicon/robot/U = usr - R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]
    [t1]") + R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [GLOB.game_year]
    [t1]") if(href_list["medholocard"]) if(!skillcheck(usr, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC)) @@ -1052,7 +1053,7 @@ /mob/living/carbon/human/proc/handle_embedded_objects() - if((stat == DEAD) || lying || buckled) // Shouldnt be needed, but better safe than sorry + if((stat == DEAD) || body_position || buckled) // Shouldnt be needed, but better safe than sorry return for(var/obj/item/W in embedded_items) @@ -1330,7 +1331,7 @@ else if(C.z != src.z || get_dist(src,C) < 1) hud_used.locate_leader.icon_state = "trackondirect_lz" else - hud_used.locate_leader.setDir(get_dir(src,C)) + hud_used.locate_leader.setDir(Get_Compass_Dir(src,C)) hud_used.locate_leader.icon_state = "trackon_lz" return if(TRACKER_FTL) @@ -1345,13 +1346,13 @@ H = GLOB.marine_leaders[JOB_XO] tracking_suffix = "_xo" if(TRACKER_CL) - var/datum/job/civilian/liaison/liaison_job = RoleAuthority.roles_for_mode[JOB_CORPORATE_LIAISON] + var/datum/job/civilian/liaison/liaison_job = GLOB.RoleAuthority.roles_for_mode[JOB_CORPORATE_LIAISON] if(liaison_job?.active_liaison) H = liaison_job.active_liaison tracking_suffix = "_cl" else if(tracker_setting in squad_leader_trackers) - var/datum/squad/S = RoleAuthority.squads_by_type[squad_leader_trackers[tracker_setting]] + var/datum/squad/S = GLOB.RoleAuthority.squads_by_type[squad_leader_trackers[tracker_setting]] H = S.squad_leader tracking_suffix = tracker_setting @@ -1360,11 +1361,11 @@ if(H.z != src.z || get_dist(src,H) < 1 || src == H) hud_used.locate_leader.icon_state = "trackondirect[tracking_suffix]" else - hud_used.locate_leader.setDir(get_dir(src,H)) + hud_used.locate_leader.setDir(Get_Compass_Dir(src,H)) hud_used.locate_leader.icon_state = "trackon[tracking_suffix]" /mob/living/carbon/proc/locate_nearest_nuke() - if(!bomb_set) return + if(!GLOB.bomb_set) return var/obj/structure/machinery/nuclearbomb/N for(var/obj/structure/machinery/nuclearbomb/bomb in world) if(!istype(N) || N.z != src.z ) @@ -1378,7 +1379,7 @@ if(get_dist(src,N) < 1) hud_used.locate_nuke.icon_state = "nuke_trackondirect" else - hud_used.locate_nuke.setDir(get_dir(src,N)) + hud_used.locate_nuke.setDir(Get_Compass_Dir(src,N)) hud_used.locate_nuke.icon_state = "nuke_trackon" diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index 027e279e2983..b5a401bc5649 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -455,9 +455,7 @@ CULT return to_chat(chosen, SPAN_HIGHDANGER("You feel a dangerous presence in the back of your head. You find yourself unable to move!")) - ADD_TRAIT(chosen, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Cultist Stun")) - chosen.update_canmove() chosen.update_xeno_hostile_hud() @@ -558,7 +556,7 @@ CULT H.cancel_camera() H.reset_view() - H.client.change_view(world_view_size, target) + H.client.change_view(GLOB.world_view_size, target) H.client.pixel_x = 0 H.client.pixel_y = 0 @@ -590,7 +588,7 @@ CULT remove_from(H) H.unset_interaction() - H.client.change_view(world_view_size, target) + H.client.change_view(GLOB.world_view_size, target) H.client.pixel_x = 0 H.client.pixel_y = 0 H.reset_view() diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 805b3d7e1744..2bb113d67739 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -206,12 +206,11 @@ w_uniform.add_fingerprint(M) - if(lying || sleeping) + if(body_position == LYING_DOWN || sleeping) if(client) sleeping = max(0,src.sleeping-5) if(!sleeping) - resting = 0 - update_canmove() + set_resting(FALSE) M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to wake [t_him] up!"), \ SPAN_NOTICE("You shake [src] trying to wake [t_him] up!"), null, 4) else if(stunned) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 5c685cc3acac..90a4d7bca4ab 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -372,7 +372,7 @@ This function restores all limbs. /mob/living/carbon/human/get_limb(zone) RETURN_TYPE(/obj/limb) zone = check_zone(zone) - return (locate(limb_types_by_name[zone]) in limbs) + return (locate(GLOB.limb_types_by_name[zone]) in limbs) /mob/living/carbon/human/apply_armoured_damage(damage = 0, armour_type = ARMOR_MELEE, damage_type = BRUTE, def_zone = null, penetration = 0, armour_break_pr_pen = 0, armour_break_flat = 0) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index f3f58b859e25..4e4d65e485ef 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -44,7 +44,7 @@ Contains most of the procs that are called when a mob is attacked by something //If you don't specify a bodypart, it checks ALL your bodyparts for protection, and averages out the values for(var/X in limbs) var/obj/limb/E = X - var/weight = organ_rel_size[E.name] + var/weight = GLOB.organ_rel_size[E.name] armorval += getarmor_organ(E, type) * weight total += weight return (armorval/max(total, 1)) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 4416ba74fda3..dd25a13538af 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -1,5 +1,6 @@ /mob/living/carbon/human light_system = MOVABLE_LIGHT + rotate_on_lying = TRUE //Hair color and style var/r_hair = 0 var/g_hair = 0 @@ -176,8 +177,8 @@ var/total_marine_playtime = 0 - for(var/job in RoleAuthority.roles_by_name) - var/datum/job/J = RoleAuthority.roles_by_name[job] + for(var/job in GLOB.RoleAuthority.roles_by_name) + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[job] if(istype(J, /datum/job/antag)) continue diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index c4690c03068f..08ddd11da5b3 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -219,14 +219,6 @@ return 0 - -/mob/living/carbon/human/has_legs() - . = 0 - if(has_limb("r_foot") && has_limb("r_leg")) - .++ - if(has_limb("l_foot") && has_limb("l_leg")) - .++ - /mob/living/carbon/human/proc/disable_special_flags() status_flags |= CANPUSH anchored = FALSE diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 1a906dfa5c11..1803e289114e 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -108,7 +108,7 @@ //Do we have a working jetpack if(istype(back, /obj/item/tank/jetpack)) var/obj/item/tank/jetpack/J = back - if(((!check_drift) || (check_drift && J.stabilization_on)) && (!lying) && (J.allow_thrust(0.01, src))) + if(((!check_drift) || (check_drift && J.stabilization_on)) && (body_position == STANDING_UP) && (J.allow_thrust(0.01, src))) inertia_dir = 0 return 1 // if(!check_drift && J.allow_thrust(0.01, src)) @@ -140,3 +140,10 @@ prob_slip = round(prob_slip) return(prob_slip) + +/// Updates [TRAIT_FLOORED] based on whether the mob has appropriate limbs to stand or not +/mob/living/carbon/human/proc/update_leg_status() + if((has_limb("r_foot") && has_limb("r_leg")) || (has_limb("l_foot") && has_limb("l_leg"))) + REMOVE_TRAIT(src, TRAIT_FLOORED, BODY_TRAIT) + else + ADD_TRAIT(src, TRAIT_FLOORED, BODY_TRAIT) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index fded3d5e3f77..be1c7833c5c1 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -82,8 +82,6 @@ //Status updates, death etc. handle_regular_status_updates() //Optimized a bit - update_canmove() - handle_regular_hud_updates() pulse = handle_pulse() diff --git a/code/modules/mob/living/carbon/human/life/handle_disabilities.dm b/code/modules/mob/living/carbon/human/life/handle_disabilities.dm index 9ab234212108..77358ca45b89 100644 --- a/code/modules/mob/living/carbon/human/life/handle_disabilities.dm +++ b/code/modules/mob/living/carbon/human/life/handle_disabilities.dm @@ -3,7 +3,7 @@ /mob/living/carbon/human/proc/handle_disabilities() if(disabilities & EPILEPSY) - if((prob(1) && knocked_out < 1)) + if(prob(1) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) visible_message(SPAN_DANGER("\The [src] starts having a seizure!"), \ SPAN_DANGER("You start having a seizure!"), null, 5) apply_effect(10, PARALYZE) @@ -11,14 +11,14 @@ return if(disabilities & COUGHING) - if((prob(5) && knocked_out <= 1)) + if(prob(5) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) drop_held_item() INVOKE_ASYNC(src, PROC_REF(emote), "cough") return if(disabilities & TOURETTES) speech_problem_flag = TRUE - if((prob(10) && knocked_out <= 1)) + if((prob(10) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT))) apply_effect(10, STUN) spawn() switch(rand(1, 3)) @@ -56,6 +56,6 @@ to_chat(src, SPAN_DANGER("Your hand won't respond properly, you drop what you're holding.")) drop_held_item() if(10 to 12) - if(getBrainLoss() >= 50 && !lying) + if(getBrainLoss() >= 50 && body_position == STANDING_UP) to_chat(src, SPAN_DANGER("Your legs won't respond properly, you fall down.")) resting = 1 diff --git a/code/modules/mob/living/carbon/human/life/handle_organs.dm b/code/modules/mob/living/carbon/human/life/handle_organs.dm index 2c978f2295ed..706e8567a50c 100644 --- a/code/modules/mob/living/carbon/human/life/handle_organs.dm +++ b/code/modules/mob/living/carbon/human/life/handle_organs.dm @@ -16,7 +16,7 @@ else E.process() - if(!lying && world.time - l_move_time < 15) + if(body_position == STANDING_UP && world.time - l_move_time < 15) // Moving around with fractured ribs won't do you any good if(E.is_broken() && E.internal_organs && prob(15)) var/datum/internal_organ/I = pick(E.internal_organs) @@ -32,7 +32,7 @@ custom_pain("You feel broken bones cutting at you in your [E.display_name]!", 1) pain.apply_pain(damage * 1.5) - if(!lying && !buckled && prob(2)) + if(body_position == STANDING_UP && !buckled && prob(2)) var/left_leg_crippled = FALSE var/right_leg_crippled = FALSE diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm index 5c951a8112bf..41554f056744 100644 --- a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm +++ b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm @@ -1,6 +1,6 @@ //Refer to life.dm for caller -/mob/living/carbon/human/handle_regular_status_updates(regular_update = TRUE) +/mob/living/carbon/human/handle_regular_status_updates(regular_update = TRUE) // you're next, evil proc --fira if(status_flags & GODMODE) return 0 @@ -53,9 +53,8 @@ if(!already_in_crit) new /datum/effects/crit/human(src) - if(knocked_out) + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) blinded = TRUE - set_stat(UNCONSCIOUS) if(regular_update && halloss > 0) apply_damage(-3, HALLOSS) else if(sleeping) diff --git a/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm b/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm index 9d257da720b9..16d9955395b0 100644 --- a/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm +++ b/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm @@ -4,6 +4,9 @@ //Handle side effects from stasis switch(in_stasis) if(STASIS_IN_BAG) + // I hate whoever wrote this and statuses with a passion knocked_down = knocked_down? --knocked_down : knocked_down + 10 //knocked_down set. + if(knocked_down <= 0) + knocked_down_callback() if(STASIS_IN_CRYO_CELL) if(sleeping < 10) sleeping += 10 //Puts the mob to sleep indefinitely. diff --git a/code/modules/mob/living/carbon/human/life/life_helpers.dm b/code/modules/mob/living/carbon/human/life/life_helpers.dm index fedeaf9fd48c..25f020a9f8b6 100644 --- a/code/modules/mob/living/carbon/human/life/life_helpers.dm +++ b/code/modules/mob/living/carbon/human/life/life_helpers.dm @@ -25,33 +25,6 @@ pressure_adjustment_coefficient = min(1, max(pressure_adjustment_coefficient, 0)) //So it isn't less than 0 or larger than 1. return pressure_adjustment_coefficient -//Calculate how much of the enviroment pressure-difference affects the human. -/mob/living/carbon/human/calculate_affecting_pressure(pressure) - var/pressure_difference - - //First get the absolute pressure difference. - if(pressure < ONE_ATMOSPHERE) //We are in an underpressure. - pressure_difference = ONE_ATMOSPHERE - pressure - - else //We are in an overpressure or standard atmosphere. - pressure_difference = pressure - ONE_ATMOSPHERE - - if(pressure_difference < 5) //If the difference is small, don't bother calculating the fraction. - pressure_difference = 0 - - else - //Otherwise calculate how much of that absolute pressure difference affects us, can be 0 to 1 (equals 0% to 100%). - //This is our relative difference. - pressure_difference *= get_pressure_weakness() - - //The difference is always positive to avoid extra calculations. - //Apply the relative difference on a standard atmosphere to get the final result. - //The return value will be the adjusted_pressure of the human that is the basis of pressure warnings and damage. - if(pressure < ONE_ATMOSPHERE) - return ONE_ATMOSPHERE - pressure_difference - else - return ONE_ATMOSPHERE + pressure_difference - /mob/living/carbon/human/proc/stabilize_body_temperature() @@ -320,9 +293,7 @@ emote("gasp") regenerate_icons() reload_fullscreens() - update_canmove() flash_eyes() apply_effect(10, EYE_BLUR) apply_effect(10, PARALYZE) - update_canmove() updatehealth() //One more time, so it doesn't show the target as dead on HUDs diff --git a/code/modules/mob/living/carbon/human/powers/human_powers.dm b/code/modules/mob/living/carbon/human/powers/human_powers.dm index 10b13225b314..be7848b2a936 100644 --- a/code/modules/mob/living/carbon/human/powers/human_powers.dm +++ b/code/modules/mob/living/carbon/human/powers/human_powers.dm @@ -9,7 +9,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || buckled) to_chat(src, "You cannot tackle someone in your current state.") return @@ -27,7 +27,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || buckled) to_chat(src, "You cannot tackle in your current state.") return @@ -56,7 +56,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, "You cannot leap in your current state.") return @@ -74,7 +74,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, "You cannot leap in your current state.") return @@ -110,7 +110,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated(TRUE) || lying) + if(is_mob_incapacitated() || body_position != STANDING_UP) to_chat(src, SPAN_DANGER("You cannot do that in your current state.")) return @@ -193,13 +193,46 @@ /mob/living/verb/lay_down() set name = "Rest" set category = "IC" + set_resting(!resting, FALSE, TRUE) - if(!resting) - apply_effect(1, WEAKEN) //so that the mob immediately falls over - - resting = !resting +///Proc to hook behavior to the change of value in the resting variable. +/mob/living/proc/set_resting(new_resting, silent = TRUE, instant = FALSE) + if(!(mobility_flags & MOBILITY_REST)) + return + if(new_resting == resting) + return + if(!COOLDOWN_FINISHED(src, rest_cooldown)) + to_chat(src, SPAN_WARNING("You can't 'rest' that fast. Take a breather!")) + return + COOLDOWN_START(src, rest_cooldown, 1 SECONDS) + + . = resting + resting = new_resting + if(new_resting) + if(body_position == LYING_DOWN) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now try to stay lying down on the floor.")) + else if(HAS_TRAIT(src, TRAIT_FORCED_STANDING) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING)) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now lay down as soon as you are able to.")) + else + if(!silent) + to_chat(src, SPAN_NOTICE("You lay down.")) + set_lying_down() + else + if(body_position == STANDING_UP) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now try to remain standing up.")) + else if(HAS_TRAIT(src, TRAIT_FLOORED) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING)) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now stand up as soon as you are able to.")) + else + if(!silent) + to_chat(src, SPAN_NOTICE("You stand up.")) + get_up(instant) - to_chat(src, SPAN_NOTICE("You are now [resting ? "resting." : "getting up."]")) +// SEND_SIGNAL(src, COMSIG_LIVING_RESTING, new_resting, silent, instant) +// update_resting() // HUD icons /mob/living/carbon/human/proc/toggle_inherent_nightvison() set category = "Synthetic" @@ -231,9 +264,9 @@ var/chosen_HUD = 1 switch(hud_choice) if("Medical HUD") - H = huds[MOB_HUD_MEDICAL_ADVANCED] + H = GLOB.huds[MOB_HUD_MEDICAL_ADVANCED] if("Security HUD") - H = huds[MOB_HUD_SECURITY_ADVANCED] + H = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] chosen_HUD = 2 else return diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 28e45dcb2f5e..b31604d2cdd6 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -15,7 +15,7 @@ if(current_channel == " " || current_channel == ":" || current_channel == ".") i-- break - .["modes"] += department_radio_keys[":[current_channel]"] + .["modes"] += GLOB.department_radio_keys[":[current_channel]"] .["message_and_language"] = copytext(message, i+1) var/multibroadcast_cooldown = 0 for(var/obj/item/device/radio/headset/headset in list(wear_l_ear, wear_r_ear)) @@ -31,9 +31,9 @@ if(length(message) >= 2 && (message[1] == "." || message[1] == ":" || message[1] == "#")) var/channel_prefix = copytext(message, 1, 3) - if(channel_prefix in department_radio_keys) + if(channel_prefix in GLOB.department_radio_keys) .["message_and_language"] = copytext(message, 3) - .["modes"] += department_radio_keys[channel_prefix] + .["modes"] += GLOB.department_radio_keys[channel_prefix] return .["message_and_language"] = message @@ -57,7 +57,7 @@ var/verb = "says" var/alt_name = "" - var/message_range = world_view_size + var/message_range = GLOB.world_view_size var/italics = 0 if(!able_to_speak) diff --git a/code/modules/mob/living/carbon/human/species/human.dm b/code/modules/mob/living/carbon/human/species/human.dm index 6a59e97af867..add78365a350 100644 --- a/code/modules/mob/living/carbon/human/species/human.dm +++ b/code/modules/mob/living/carbon/human/species/human.dm @@ -1,3 +1,85 @@ +// handles all blood related problems for humans and synthetics, moved from blood.dm +/mob/living/proc/handle_blood() + return + +// Takes care blood loss and regeneration +/mob/living/carbon/human/handle_blood() + if((species.flags & NO_BLOOD) && !(species.flags & IS_SYNTHETIC)) + return + + if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood. + //Blood regeneration if there is some space + if(blood_volume < max_blood && nutrition >= 1) + blood_volume += 0.1 // regenerate blood VERY slowly + nutrition -= 0.25 + else if(blood_volume > max_blood) + blood_volume -= 0.1 // The reverse in case we've gotten too much blood in our body + if(blood_volume > limit_blood) + blood_volume = limit_blood // This should never happen, but lets make sure + + var/b_volume = blood_volume + + // Damaged heart virtually reduces the blood volume, as the blood isn't + // being pumped properly anymore. + if(species && species.has_organ["heart"]) + var/datum/internal_organ/heart/heart = internal_organs_by_name["heart"] + if(!heart) + b_volume = 0 + else if(chem_effect_flags & CHEM_EFFECT_ORGAN_STASIS) + b_volume *= 1 + else if(heart.damage >= heart.organ_status >= ORGAN_BRUISED) + b_volume *= Clamp(100 - (2 * heart.damage), 30, 100) / 100 + + //Effects of bloodloss + if(b_volume <= BLOOD_VOLUME_SAFE) + /// The blood volume turned into a %, with BLOOD_VOLUME_NORMAL being 100% + var/blood_percentage = b_volume / (BLOOD_VOLUME_NORMAL / 100) + /// How much oxyloss will there be from the next time blood processes + var/additional_oxyloss = (100 - blood_percentage) / 5 + /// The limit of the oxyloss gained, ignoring oxyloss from the switch statement + var/maximum_oxyloss = Clamp((100 - blood_percentage) / 2, oxyloss, 100) + if(oxyloss < maximum_oxyloss) + oxyloss += round(max(additional_oxyloss, 0)) + + switch(b_volume) + if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE) + if(species.flags & IS_SYNTHETIC) + if(prob(1)) + to_chat(src, SPAN_DANGER("Subdermal damage detected in critical region. Operational impact minimal. Diagnosis queued for maintenance cycle.")) + else + if(prob(1)) + var/word = pick("dizzy","woozy","faint") + to_chat(src, SPAN_DANGER("You feel [word].")) + if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY) + if(species.flags & IS_SYNTHETIC) + if(prob(3)) + apply_effect(rand(1, 2), WEAKEN) + to_chat(src, SPAN_DANGER("Internal power cell fault detected.\nSeek nearest recharging station.")) + else + if(eye_blurry < 50) + AdjustEyeBlur(6) + oxyloss += 3 + if(prob(15)) + apply_effect(rand(1,3), PARALYZE) + var/word = pick("dizzy","woozy","faint") + to_chat(src, SPAN_DANGER("You feel very [word].")) + if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD) + if(species.flags & IS_SYNTHETIC) + if(prob(5)) + apply_effect(rand(1, 2), PARALYZE) + to_chat(src, SPAN_DANGER("Critical power cell failure detected.\nSeek recharging station immediately.")) + else + if(eye_blurry < 50) + AdjustEyeBlur(6) + oxyloss += 8 + toxloss += 3 + if(prob(15)) + apply_effect(rand(1, 3), PARALYZE) + var/word = pick("dizzy", "woozy", "faint") + to_chat(src, SPAN_DANGER("You feel extremely [word].")) + if(0 to BLOOD_VOLUME_SURVIVE) + death(create_cause_data(species.flags & IS_SYNTHETIC ? "power failure" : "blood loss")) + /datum/species/human group = SPECIES_HUMAN name = "Human" diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm index 6c774432e776..8e8d2443293d 100644 --- a/code/modules/mob/living/carbon/human/species/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/monkey.dm @@ -46,8 +46,8 @@ /datum/species/monkey/handle_npc(mob/living/carbon/human/H) if(H.stat != CONSCIOUS) return - if(prob(33) && isturf(H.loc) && !H.pulledby && !H.lying && !H.is_mob_restrained()) //won't move if being pulled - step(H, pick(cardinal)) + if(prob(33) && isturf(H.loc) && !H.pulledby && (H.mobility_flags & MOBILITY_MOVE) && !H.is_mob_restrained()) //won't move if being pulled + step(H, pick(GLOB.cardinals)) var/obj/held = H.get_active_hand() if(held && prob(1)) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 3f415d8d3007..397a478a2779 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -166,6 +166,13 @@ for(var/datum/internal_organ/I in H.internal_organs) I.mechanize() + // We just deleted the legs so they fell down. + // Update again now that the legs are back so they can stand properly during rest of species code and before outside updates kick in. + // I hate this code. + H.update_leg_status() + // While we're deep in shitcode we also force instant transition so this nonsense isn't visually noticeable + H.update_transform(instant_update = TRUE) + /datum/species/proc/initialize_pain(mob/living/carbon/human/H) if(pain_type) QDEL_NULL(H.pain) @@ -179,12 +186,7 @@ /datum/species/proc/hug(mob/living/carbon/human/H, mob/living/carbon/target, target_zone = "chest") if(H.flags_emote) return - var/t_him = "them" - switch(target.gender) - if(MALE) - t_him = "him" - if(FEMALE) - t_him = "her" + var/t_him = target.p_them() if(target_zone == "head") attempt_rock_paper_scissors(H, target) @@ -195,6 +197,9 @@ else if(target_zone in list("l_hand", "r_hand")) attempt_fist_bump(H, target) return + else if(H.body_position == LYING_DOWN) // Keep other interactions above lying check for maximum awkwardness potential + H.visible_message(SPAN_NOTICE("[H] waves at [target] to make [t_him] feel better!"), \ + SPAN_NOTICE("You wave at [target] to make [t_him] feel better!"), null, 4) else if(target_zone == "groin") H.visible_message(SPAN_NOTICE("[H] hugs [target] to make [t_him] feel better!"), \ SPAN_NOTICE("You hug [target] to make [t_him] feel better!"), null, 4) @@ -470,7 +475,7 @@ /datum/species/proc/handle_blood_splatter(mob/living/carbon/human/human, splatter_dir) var/color_override if(human.special_blood) - var/datum/reagent/D = chemical_reagents_list[human.special_blood] + var/datum/reagent/D = GLOB.chemical_reagents_list[human.special_blood] if(D) color_override = D.color diff --git a/code/modules/mob/living/carbon/human/species/yautja/_species.dm b/code/modules/mob/living/carbon/human/species/yautja/_species.dm index f8ecb3e0591b..f8937279d8b9 100644 --- a/code/modules/mob/living/carbon/human/species/yautja/_species.dm +++ b/code/modules/mob/living/carbon/human/species/yautja/_species.dm @@ -161,7 +161,7 @@ /datum/species/yautja/post_species_loss(mob/living/carbon/human/H) ..() - var/datum/mob_hud/medical/advanced/A = huds[MOB_HUD_MEDICAL_ADVANCED] + var/datum/mob_hud/medical/advanced/A = GLOB.huds[MOB_HUD_MEDICAL_ADVANCED] A.add_to_hud(H) H.blood_type = pick("A+","A-","B+","B-","O-","O+","AB+","AB-") H.h_style = "Bald" diff --git a/code/modules/mob/living/carbon/human/species/yautja/yautja_sound.dm b/code/modules/mob/living/carbon/human/species/yautja/yautja_sound.dm index a6a9a659f215..afd138fec2bb 100644 --- a/code/modules/mob/living/carbon/human/species/yautja/yautja_sound.dm +++ b/code/modules/mob/living/carbon/human/species/yautja/yautja_sound.dm @@ -65,6 +65,6 @@ return for(var/mob/current_mob as anything in get_mobs_in_z_level_range(get_turf(user), 18) - user) - var/relative_dir = get_dir(current_mob, user) + var/relative_dir = Get_Compass_Dir(current_mob, user) var/final_dir = dir2text(relative_dir) to_chat(current_mob, SPAN_HIGHDANGER("You hear a loud roar coming from [final_dir ? "the [final_dir]" : "nearby"]!")) diff --git a/code/modules/mob/living/carbon/human/species/zombie.dm b/code/modules/mob/living/carbon/human/species/zombie.dm index 5fa928a67f36..76b1c3928659 100644 --- a/code/modules/mob/living/carbon/human/species/zombie.dm +++ b/code/modules/mob/living/carbon/human/species/zombie.dm @@ -53,9 +53,6 @@ if(zombie.glasses) zombie.drop_inv_item_on_ground(zombie.glasses, FALSE, TRUE) if(zombie.wear_mask) zombie.drop_inv_item_on_ground(zombie.wear_mask, FALSE, TRUE) - if(zombie.lying) - zombie.lying = FALSE - var/obj/item/weapon/zombie_claws/ZC = new(zombie) ZC.icon_state = "claw_r" zombie.equip_to_slot_or_del(ZC, WEAR_R_HAND, TRUE) @@ -67,7 +64,7 @@ D = zombie.AddDisease(new /datum/disease/black_goo()) D.stage = 5 - var/datum/mob_hud/Hu = huds[MOB_HUD_MEDICAL_OBSERVER] + var/datum/mob_hud/Hu = GLOB.huds[MOB_HUD_MEDICAL_OBSERVER] Hu.add_hud_to(zombie, zombie) return ..() @@ -76,7 +73,7 @@ /datum/species/zombie/post_species_loss(mob/living/carbon/human/zombie) ..() remove_from_revive(zombie) - var/datum/mob_hud/Hu = huds[MOB_HUD_MEDICAL_OBSERVER] + var/datum/mob_hud/Hu = GLOB.huds[MOB_HUD_MEDICAL_OBSERVER] Hu.remove_hud_from(zombie, zombie) @@ -116,7 +113,7 @@ /datum/species/zombie/proc/revive_from_death(mob/living/carbon/human/zombie) if(zombie && zombie.loc && zombie.stat == DEAD) zombie.revive(TRUE) - zombie.stunned = 4 + zombie.apply_effect(4, STUN) zombie.make_jittery(500) zombie.visible_message(SPAN_WARNING("[zombie] rises from the ground!")) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 1dcefec9b63b..c7427384f0a4 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -4,8 +4,8 @@ TODO: Proper documentation icon_key is [species.race_key][g][husk][fat][hulk][skeleton][ethnicity] */ -var/global/list/human_icon_cache = list() -var/global/list/tail_icon_cache = list() +GLOBAL_LIST_EMPTY(human_icon_cache) +GLOBAL_LIST_EMPTY(tail_icon_cache) /proc/overlay_image(icon, icon_state, color, flags) var/image/ret = image(icon,icon_state) @@ -19,7 +19,7 @@ var/global/list/tail_icon_cache = list() Global associative list for caching uniform masks. Each index is just 0 or 1 for not removed and removed (as in previously delimbed). */ -var/global/list/uniform_mask_cache = list() +GLOBAL_LIST_EMPTY(uniform_mask_cache) /////////////////////// //UPDATE_ICONS SYSTEM// @@ -89,25 +89,6 @@ There are several things that need to be remembered: overlays -= I overlays_standing[cache_index] = null - -/mob/living/carbon/human/update_transform(force = FALSE) - if(lying == lying_prev && !force) - return - lying_prev = lying - var/matrix/new_matrix = matrix() - if(lying) - if(pulledby && pulledby.grab_level >= GRAB_CARRY) - new_matrix.Turn(90) - else - if(prob(50)) - new_matrix.Turn(90) - else - new_matrix.Turn(270) - new_matrix.Translate(rand(-10,10), rand(-10,10)) - apply_transform(new_matrix) - else - apply_transform(new_matrix) - /mob/living/carbon/human/UpdateDamageIcon() for(var/obj/limb/O in limbs) if(!(O.status & LIMB_DESTROYED)) @@ -131,6 +112,8 @@ There are several things that need to be remembered: //BASE MOB SPRITE /mob/living/carbon/human/proc/update_body() + update_leg_status() // Not icon ops, but placed here due to lack of a non-icons update_body + appearance_flags |= KEEP_TOGETHER // sanity update_damage_overlays() @@ -699,11 +682,11 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, /mob/living/carbon/human/proc/get_tail_icon() var/icon_key = "[species.race_key][r_skin][g_skin][b_skin][r_hair][g_hair][b_hair]" - var/icon/tail_icon = tail_icon_cache[icon_key] + var/icon/tail_icon = GLOB.tail_icon_cache[icon_key] if(!tail_icon) //generate a new one tail_icon = icon('icons/effects/species.dmi', "[species.get_tail(src)]") - tail_icon_cache[icon_key] = tail_icon + GLOB.tail_icon_cache[icon_key] = tail_icon return tail_icon @@ -807,3 +790,11 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, /mob/living/carbon/human/on_immobilized_trait_loss(datum/source) . = ..() update_xeno_hostile_hud() + +/mob/living/carbon/human/on_floored_trait_gain(datum/source) + . = ..() + update_xeno_hostile_hud() + +/mob/living/carbon/human/on_floored_trait_loss(datum/source) + . = ..() + update_xeno_hostile_hud() diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index cc76999358a2..e08a71f81e12 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -4,8 +4,3 @@ /mob/living/carbon/proc/remove_overlay(cache_index) return - -/mob/living/carbon/update_transform() - if(lying != lying_prev ) - lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again - update_icons() diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index d253d8bc0771..0d522c142f36 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -102,7 +102,7 @@ switch(stage) if(2) if(prob(4)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("[affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -123,7 +123,7 @@ else if(prob(2)) affected_mob.emote("[pick("sneeze", "cough")]") if(prob(5)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("\The [affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -139,7 +139,7 @@ if(prob(50)) affected_mob.emote("scream") if(prob(6)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("[affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -260,7 +260,7 @@ new_xeno.key = picked.key if(new_xeno.client) - new_xeno.client.change_view(world_view_size) + new_xeno.client.change_view(GLOB.world_view_size) if(new_xeno.client.prefs?.toggles_flashing & FLASH_POOLSPAWN) window_flash(new_xeno.client) @@ -295,7 +295,7 @@ return victim.chestburst = TRUE to_chat(src, SPAN_DANGER("You start bursting out of [victim]'s chest!")) - if(victim.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) victim.apply_effect(20, DAZE) victim.visible_message(SPAN_DANGER("\The [victim] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something ripping up your insides!")) @@ -336,17 +336,17 @@ victim.attack_log += "\[[time_stamp()]\] Was chestbursted in [get_area_name(larva_embryo)] at X[victim.x], Y[victim.y], Z[victim.z]. The larva was [key_name(larva_embryo)]." if(burstcount) - step(larva_embryo, pick(cardinal)) + step(larva_embryo, pick(GLOB.cardinals)) - if(round_statistics) - round_statistics.total_larva_burst++ + if(GLOB.round_statistics) + GLOB.round_statistics.total_larva_burst++ GLOB.larva_burst_by_hive[hive] = (GLOB.larva_burst_by_hive[hive] || 0) + 1 burstcount++ if(!larva_embryo.ckey && larva_embryo.burrowable && loc && is_ground_level(loc.z) && (locate(/obj/structure/bed/nest) in loc) && hive.living_xeno_queen && hive.living_xeno_queen.z == loc.z) larva_embryo.visible_message(SPAN_XENODANGER("[larva_embryo] quickly burrows into the ground.")) - if(round_statistics && !larva_embryo.statistic_exempt) - round_statistics.track_new_participant(faction, -1) // keep stats sane + if(GLOB.round_statistics && !larva_embryo.statistic_exempt) + GLOB.round_statistics.track_new_participant(faction, -1) // keep stats sane hive.stored_larva++ hive.hive_ui.update_burrowed_larva() qdel(larva_embryo) diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index 332f8d1778dd..63aa7b09a633 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -82,7 +82,7 @@ var/mob/living/carbon/xenomorph/M = null - M = RoleAuthority.get_caste_by_text(castepick) + M = GLOB.RoleAuthority.get_caste_by_text(castepick) if(isnull(M)) to_chat(usr, SPAN_WARNING("[castepick] is not a valid caste! If you're seeing this message, tell a coder!")) @@ -148,7 +148,7 @@ else new_xeno.key = src.key if(new_xeno.client) - new_xeno.client.change_view(world_view_size) + new_xeno.client.change_view(GLOB.world_view_size) //Regenerate the new mob's name now that our player is inside new_xeno.generate_name() @@ -182,8 +182,8 @@ if (new_xeno.client) new_xeno.client.mouse_pointer_icon = initial(new_xeno.client.mouse_pointer_icon) - if(new_xeno.mind && round_statistics) - round_statistics.track_new_participant(new_xeno.faction, -1) //so an evolved xeno doesn't count as two. + if(new_xeno.mind && GLOB.round_statistics) + GLOB.round_statistics.track_new_participant(new_xeno.faction, -1) //so an evolved xeno doesn't count as two. SSround_recording.recorder.track_player(new_xeno) /mob/living/carbon/xenomorph/proc/evolve_checks() @@ -336,7 +336,7 @@ else new_xeno.key = key if(new_xeno.client) - new_xeno.client.change_view(world_view_size) + new_xeno.client.change_view(GLOB.world_view_size) new_xeno.client.pixel_x = 0 new_xeno.client.pixel_y = 0 @@ -347,8 +347,8 @@ new_xeno.visible_message(SPAN_XENODANGER("A [new_xeno.caste.caste_type] emerges from the husk of \the [src]."), \ SPAN_XENODANGER("You regress into your previous form.")) - if(round_statistics && !new_xeno.statistic_exempt) - round_statistics.track_new_participant(faction, -1) //so an evolved xeno doesn't count as two. + if(GLOB.round_statistics && !new_xeno.statistic_exempt) + GLOB.round_statistics.track_new_participant(faction, -1) //so an evolved xeno doesn't count as two. SSround_recording.recorder.track_player(new_xeno) src.transfer_observers_to(new_xeno) diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm index 26003affa2df..3ed4bf036e12 100644 --- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm @@ -116,8 +116,8 @@ attack_hand(user)//Not a carrier, or already full? Just pick it up. return XENO_NO_DELAY_ACTION -/obj/item/clothing/mask/facehugger/attack(mob/M, mob/user) - if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.lying || M.buckled && !isyautja(M))) +/obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user) + if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled && !isyautja(M))) to_chat(user, SPAN_WARNING("The facehugger refuses to attach.")) ..() return @@ -130,7 +130,7 @@ if(!do_after(user, 2 SECONDS, INTERRUPT_ALL, BUSY_ICON_HOSTILE, M, INTERRUPT_MOVED, BUSY_ICON_HOSTILE)) return - if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.lying || M.buckled)) + if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled)) return attach(M) @@ -329,8 +329,8 @@ else target.visible_message(SPAN_DANGER("[src] violates [target]'s face!")) - if(round_statistics && ishuman(target)) - round_statistics.total_huggers_applied++ + if(GLOB.round_statistics && ishuman(target)) + GLOB.round_statistics.total_huggers_applied++ /obj/item/clothing/mask/facehugger/proc/go_active() if(stat == DEAD) @@ -523,9 +523,9 @@ /datum/species/yautja/handle_hugger_attachment(mob/living/carbon/human/target, obj/item/clothing/mask/facehugger/hugger) var/catch_chance = 50 - if(target.dir == reverse_dir[hugger.dir]) + if(target.dir == GLOB.reverse_dir[hugger.dir]) catch_chance += 20 - if(target.lying) + if(target.body_position == LYING_DOWN) catch_chance -= 50 catch_chance -= ((target.maxHealth - target.health) / 3) if(target.get_active_hand()) diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index 0645d5fcba90..84eceb028349 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -150,7 +150,7 @@ //A simple handler for checking your state. Used in pretty much all the procs. /mob/living/carbon/xenomorph/proc/check_state(permissive = FALSE) if(!permissive) - if(is_mob_incapacitated() || lying || buckled || evolving || !isturf(loc)) + if(is_mob_incapacitated() || body_position == LYING_DOWN || buckled || evolving || !isturf(loc)) to_chat(src, SPAN_WARNING("You cannot do this in your current state.")) return FALSE else if(caste_type != XENO_CASTE_QUEEN && observed_xeno) @@ -319,7 +319,6 @@ if (pounceAction.freeze_self) if(pounceAction.freeze_play_sound) playsound(loc, rand(0, 100) < 95 ? 'sound/voice/alien_pounce.ogg' : 'sound/voice/alien_pounce2.ogg', 25, 1) - canmove = FALSE ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) pounceAction.freeze_timer_id = addtimer(CALLBACK(src, PROC_REF(unfreeze_pounce)), pounceAction.freeze_time, TIMER_STOPPABLE) pounceAction.additional_effects(M) @@ -536,81 +535,9 @@ if(client) client.mouse_pointer_icon = initial(client.mouse_pointer_icon) // Reset our mouse pointer when we no longer have an action queued. -// Called when pulling something and attacking yourself with the pull -/mob/living/carbon/xenomorph/proc/pull_power(mob/M) - if(iswarrior(src) && !ripping_limb && M.stat != DEAD) - if(M.status_flags & XENO_HOST) - to_chat(src, SPAN_XENOWARNING("This would harm the embryo!")) - return - ripping_limb = TRUE - if(rip_limb(M)) - stop_pulling() - ripping_limb = FALSE - - -// Warrior Rip Limb - called by pull_power() -/mob/living/carbon/xenomorph/proc/rip_limb(mob/M) - if(!istype(M, /mob/living/carbon/human)) - return FALSE - - if(action_busy) //can't stack the attempts - return FALSE - - var/mob/living/carbon/human/H = M - var/obj/limb/L = H.get_limb(check_zone(zone_selected)) - - if(can_not_harm(H)) - to_chat(src, SPAN_XENOWARNING("You can't harm this host!")) - return - - if(!L || L.body_part == BODY_FLAG_CHEST || L.body_part == BODY_FLAG_GROIN || (L.status & LIMB_DESTROYED)) //Only limbs and head. - to_chat(src, SPAN_XENOWARNING("You can't rip off that limb.")) - return FALSE - var/limb_time = rand(40,60) - - if(L.body_part == BODY_FLAG_HEAD) - limb_time = rand(90,110) - - visible_message(SPAN_XENOWARNING("[src] begins pulling on [M]'s [L.display_name] with incredible strength!"), \ - SPAN_XENOWARNING("You begin to pull on [M]'s [L.display_name] with incredible strength!")) - - if(!do_after(src, limb_time, INTERRUPT_ALL|INTERRUPT_DIFF_SELECT_ZONE, BUSY_ICON_HOSTILE) || M.stat == DEAD) - to_chat(src, SPAN_NOTICE("You stop ripping off the limb.")) - return FALSE - - if(L.status & LIMB_DESTROYED) - return FALSE - - if(L.status & (LIMB_ROBOT|LIMB_SYNTHSKIN)) - L.take_damage(rand(30,40), 0, 0) // just do more damage - visible_message(SPAN_XENOWARNING("You hear [M]'s [L.display_name] being pulled beyond its load limits!"), \ - SPAN_XENOWARNING("[M]'s [L.display_name] begins to tear apart!")) - else - visible_message(SPAN_XENOWARNING("You hear the bones in [M]'s [L.display_name] snap with a sickening crunch!"), \ - SPAN_XENOWARNING("[M]'s [L.display_name] bones snap with a satisfying crunch!")) - L.take_damage(rand(15,25), 0, 0) - L.fracture(100) - M.last_damage_data = create_cause_data(initial(caste_type), src) - src.attack_log += text("\[[time_stamp()]\] ripped the [L.display_name] off of [M.name] ([M.ckey]) 1/2 progress") - M.attack_log += text("\[[time_stamp()]\] had their [L.display_name] ripped off by [src.name] ([src.ckey]) 1/2 progress") - log_attack("[src.name] ([src.ckey]) ripped the [L.display_name] off of [M.name] ([M.ckey]) 1/2 progress") - - if(!do_after(src, limb_time, INTERRUPT_ALL|INTERRUPT_DIFF_SELECT_ZONE, BUSY_ICON_HOSTILE) || M.stat == DEAD || iszombie(M)) - to_chat(src, SPAN_NOTICE("You stop ripping off the limb.")) - return FALSE - - if(L.status & LIMB_DESTROYED) - return FALSE - - visible_message(SPAN_XENOWARNING("[src] rips [M]'s [L.display_name] away from \his body!"), \ - SPAN_XENOWARNING("[M]'s [L.display_name] rips away from \his body!")) - src.attack_log += text("\[[time_stamp()]\] ripped the [L.display_name] off of [M.name] ([M.ckey]) 2/2 progress") - M.attack_log += text("\[[time_stamp()]\] had their [L.display_name] ripped off by [src.name] ([src.ckey]) 2/2 progress") - log_attack("[src.name] ([src.ckey]) ripped the [L.display_name] off of [M.name] ([M.ckey]) 2/2 progress") - - L.droplimb(0, 0, initial(name)) - - return TRUE +/// Called when pulling something and attacking yourself wth the pull (Z hotkey) override for caste specific behaviour +/mob/living/carbon/xenomorph/proc/pull_power(mob/mob) + return // Vent Crawl /mob/living/carbon/xenomorph/proc/vent_crawl() @@ -628,7 +555,7 @@ if(!TC) TC = new(tackle_min + tackle_min_offset, tackle_max + tackle_max_offset, tackle_chance*tackle_mult) LAZYSET(tackle_counter, M, TC) - RegisterSignal(M, COMSIG_MOB_KNOCKED_DOWN, PROC_REF(tackle_handle_lying_changed)) + RegisterSignal(M, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(tackle_handle_lying_changed)) if (TC.tackle_reset_id) deltimer(TC.tackle_reset_id) @@ -640,8 +567,11 @@ else reset_tackle(M) -/mob/living/carbon/xenomorph/proc/tackle_handle_lying_changed(mob/M) +/mob/living/carbon/xenomorph/proc/tackle_handle_lying_changed(mob/living/M, body_position) SIGNAL_HANDLER + if(body_position != LYING_DOWN) + return + // Infected mobs do not have their tackle counter reset if // they get knocked down or get up from a knockdown if(M.status_flags & XENO_HOST) @@ -654,7 +584,7 @@ if (TC) qdel(TC) LAZYREMOVE(tackle_counter, M) - UnregisterSignal(M, COMSIG_MOB_KNOCKED_DOWN) + UnregisterSignal(M, COMSIG_LIVING_SET_BODY_POSITION) /mob/living/carbon/xenomorph/burn_skin(burn_amount) @@ -779,3 +709,6 @@ SSminimaps.remove_marker(src) add_minimap_marker() + +/mob/living/carbon/xenomorph/lying_angle_on_lying_down(new_lying_angle) + return // Do not rotate xenos around on the floor, their sprite is already top-down'ish diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 7beaaab8a04e..cf3be6de9086 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -489,8 +489,8 @@ var/selected_caste = GLOB.xeno_datum_list[caste_type]?.type hive.used_slots[selected_caste]++ - if(round_statistics && !statistic_exempt) - round_statistics.track_new_participant(faction, 1) + if(GLOB.round_statistics && !statistic_exempt) + GLOB.round_statistics.track_new_participant(faction, 1) generate_name() // This can happen if a xeno gets made before the game starts @@ -789,7 +789,7 @@ //and display them add_to_all_mob_huds() - var/datum/mob_hud/MH = huds[MOB_HUD_XENO_INFECTION] + var/datum/mob_hud/MH = GLOB.huds[MOB_HUD_XENO_INFECTION] MH.add_hud_to(src, src) @@ -1078,7 +1078,7 @@ /mob/living/carbon/xenomorph/handle_blood_splatter(splatter_dir, duration) var/color_override if(special_blood) - var/datum/reagent/D = chemical_reagents_list[special_blood] + var/datum/reagent/D = GLOB.chemical_reagents_list[special_blood] if(D) color_override = D.color new /obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter(loc, splatter_dir, duration, color_override) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm index 6ce6de84a086..35024d7304af 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm @@ -165,7 +165,6 @@ return REMOVE_TRAIT(H, TRAIT_IMMOBILIZED, trait_source) - H.update_canmove() if(ishuman(H)) var/mob/living/carbon/human/T = H @@ -220,7 +219,7 @@ /mob/living/carbon/xenomorph/proc/zoom_out() if(!client) return - client.change_view(world_view_size) + client.change_view(GLOB.world_view_size) client.pixel_x = 0 client.pixel_y = 0 is_zoomed = 0 diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm index 8b8e3f9c86a3..6a2071fafc3b 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm @@ -37,18 +37,14 @@ to_chat(src, SPAN_XENOWARNING("You burrow yourself into the ground.")) invisibility = 101 anchored = TRUE - density = FALSE if(caste.fire_immunity == FIRE_IMMUNITY_NONE) RegisterSignal(src, COMSIG_LIVING_PREIGNITION, PROC_REF(fire_immune)) RegisterSignal(src, list( COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, ), PROC_REF(flamer_crossed_immune)) - ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Burrow")) - ADD_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) - ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_ABILITY("Burrow")) + add_traits(list(TRAIT_ABILITY_BURROWED, TRAIT_UNDENSE, TRAIT_IMMOBILIZED), TRAIT_SOURCE_ABILITY("Burrow")) playsound(src.loc, 'sound/effects/burrowing_b.ogg', 25) - update_canmove() update_icons() addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS)) burrow_timer = world.time + 90 // How long we can be burrowed @@ -74,19 +70,15 @@ COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, )) - REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Burrow")) - REMOVE_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) - REMOVE_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_ABILITY("Burrow")) + remove_traits(list(TRAIT_ABILITY_BURROWED, TRAIT_UNDENSE, TRAIT_IMMOBILIZED), TRAIT_SOURCE_ABILITY("Burrow")) invisibility = FALSE anchored = FALSE - density = TRUE playsound(loc, 'sound/effects/burrowoff.ogg', 25) for(var/mob/living/carbon/mob in loc) if(!can_not_harm(mob)) mob.apply_effect(2, WEAKEN) addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS)) - update_canmove() update_icons() /mob/living/carbon/xenomorph/proc/do_burrow_cooldown() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm index 6405428de7cb..63051a94efa9 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm @@ -120,6 +120,10 @@ var/momentum = 0 +/datum/action/xeno_action/onclick/charger_charge/proc/handle_position_change(mob/living/carbon/xenomorph/xeno, body_position) + SIGNAL_HANDLER + if(body_position == LYING_DOWN) + handle_movement(xeno) /datum/action/xeno_action/onclick/charger_charge/proc/handle_movement(mob/living/carbon/xenomorph/Xeno, atom/oldloc, dir, forced) SIGNAL_HANDLER @@ -178,7 +182,7 @@ playsound(Xeno, 'sound/effects/alien_footstep_charge1.ogg', 50) for(var/mob/living/carbon/human/Mob in Xeno.loc) - if(Mob.lying && Mob.stat != DEAD) + if(Mob.body_position == LYING_DOWN && Mob.stat != DEAD) Xeno.visible_message(SPAN_DANGER("[Xeno] runs [Mob] over!"), SPAN_DANGER("You run [Mob] over!") ) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm index ce4a631e281f..34a9a4833fec 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm @@ -252,7 +252,7 @@ to_chat(Xeno, SPAN_XENONOTICE("You will [will_charge] charge when moving.")) if(activated) RegisterSignal(Xeno, COMSIG_MOVABLE_MOVED, PROC_REF(handle_movement)) - RegisterSignal(Xeno, COMSIG_MOB_KNOCKED_DOWN, PROC_REF(handle_movement)) + RegisterSignal(Xeno, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(handle_position_change)) RegisterSignal(Xeno, COMSIG_ATOM_DIR_CHANGE, PROC_REF(handle_dir_change)) RegisterSignal(Xeno, COMSIG_XENO_RECALCULATE_SPEED, PROC_REF(update_speed)) RegisterSignal(Xeno, COMSIG_XENO_STOP_MOMENTUM, PROC_REF(stop_momentum)) @@ -264,7 +264,7 @@ stop_momentum() UnregisterSignal(Xeno, list( COMSIG_MOVABLE_MOVED, - COMSIG_MOB_KNOCKED_DOWN, + COMSIG_LIVING_SET_BODY_POSITION, COMSIG_ATOM_DIR_CHANGE, COMSIG_XENO_RECALCULATE_SPEED, COMSIG_MOVABLE_ENTERED_RIVER, diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm index bbb202fef3c2..0709f2b17717 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm @@ -51,7 +51,7 @@ if(!check_and_use_plasma_owner()) return - if(fendy.fortify && !fendy.mutation_type == DEFENDER_STEELCREST) + if(fendy.fortify && !(fendy.mutation_type == DEFENDER_STEELCREST)) to_chat(fendy, SPAN_XENOWARNING("You cannot use headbutt while fortified.")) return @@ -220,7 +220,6 @@ ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Fortify")) X.anchored = TRUE X.small_explosives_stun = FALSE - X.update_canmove() RegisterSignal(owner, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE, PROC_REF(check_directional_armor)) X.mob_size = MOB_SIZE_IMMOBILE //knockback immune X.mob_flags &= ~SQUEEZE_UNDER_VEHICLES @@ -242,7 +241,6 @@ UnregisterSignal(owner, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE) X.mob_size = MOB_SIZE_XENO //no longer knockback immune X.mob_flags |= SQUEEZE_UNDER_VEHICLES - X.update_canmove() X.update_icons() X.fortify = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm index 5e3ab3b0afd9..00a7ceaba97e 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -252,7 +252,6 @@ return var/mob/living/carbon/xenomorph/X = owner REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) - X.update_canmove() deltimer(freeze_timer_id) freeze_timer_id = TIMER_ID_NULL to_chat(X, SPAN_XENONOTICE("Slashing frenzies you! You feel free to move immediately!")) @@ -285,7 +284,7 @@ /datum/action/xeno_action/onclick/toggle_long_range/can_use_action() var/mob/living/carbon/xenomorph/xeno = owner - if(xeno && !xeno.is_mob_incapacitated() && !xeno.lying && !xeno.buckled) + if(xeno && !xeno.is_mob_incapacitated() && !xeno.buckled) return TRUE /datum/action/xeno_action/onclick/toggle_long_range/give_to(mob/living/living_mob) @@ -542,6 +541,14 @@ hide_from(owner) +/datum/action/xeno_action/onclick/tacmap/can_use_action() + if(!owner) + return FALSE + var/mob/living/carbon/xenomorph/xeno = owner + if(xeno.is_mob_incapacitated() || xeno.dazed) + return FALSE + return TRUE + /datum/action/xeno_action/onclick/tacmap/use_ability(atom/target) var/mob/living/carbon/xenomorph/xeno = owner xeno.xeno_tacmap() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index 270ddbdfcc82..94c0110fc68f 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -413,7 +413,6 @@ if (!windup_interruptable) ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = TRUE - X.update_canmove() pre_windup_effects() if (!do_after(X, windup_duration, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE)) @@ -421,14 +420,12 @@ if (!windup_interruptable) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = FALSE - X.update_canmove() post_windup_effects(interrupted = TRUE) return if (!windup_interruptable) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = FALSE - X.update_canmove() post_windup_effects() X.visible_message(SPAN_XENOWARNING("\The [X] [ability_name][findtext(ability_name, "e", -1) || findtext(ability_name, "p", -1) ? "s" : "es"] at [A]!"), SPAN_XENOWARNING("You [ability_name] at [A]!")) @@ -849,7 +846,7 @@ for(var/mob/living/L in T) to_chat(L, SPAN_XENOHIGHDANGER("You see a massive ball of acid flying towards you!")) - for(var/dirn in alldirs) + for(var/dirn in GLOB.alldirs) recursive_spread(get_step(T, dirn), dist_left - 1, orig_depth) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm index 8c39228e3567..02e7fd814453 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm @@ -18,7 +18,7 @@ /datum/action/xeno_action/active_toggle/toggle_speed/can_use_action() var/mob/living/carbon/xenomorph/hivelord/xeno = owner - if(xeno && !xeno.is_mob_incapacitated() && !xeno.lying && !xeno.buckled) + if(xeno && !xeno.is_mob_incapacitated() && xeno.body_position == STANDING_UP && !xeno.buckled) // do we rly need standing up? return TRUE /datum/action/xeno_action/active_toggle/toggle_speed/give_to(mob/living/living_mob) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm index 13734a5b9cf4..0c2b226cb268 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm @@ -268,7 +268,7 @@ if(xeno.can_not_harm(target_carbon)) return - if(!(target_carbon.knocked_out || target_carbon.stat == UNCONSCIOUS)) //called knocked out because for some reason .stat seems to have a delay . + if(!(HAS_TRAIT(target_carbon, TRAIT_KNOCKEDOUT) || target_carbon.stat == UNCONSCIOUS)) //called knocked out because for some reason .stat seems to have a delay . to_chat(xeno, SPAN_XENOHIGHDANGER("You can only headbite an unconscious, adjacent target!")) return diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm index 0d7a86c58318..85a9ee8f054b 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm @@ -174,9 +174,7 @@ var/root_duration = buffed ? root_duration_buffed : root_duration_unbuffed vanguard_user.visible_message(SPAN_XENODANGER("[vanguard_user] slams [target_atom] into the ground!"), SPAN_XENOHIGHDANGER("You slam [target_atom] into the ground!")) - ADD_TRAIT(target_carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Cleave")) - target_carbon.update_canmove() if (ishuman(target_carbon)) var/mob/living/carbon/human/Hu = target_carbon @@ -234,16 +232,16 @@ xeno_attack_delay(stabbing_xeno) return ..() -/datum/action/xeno_action/activable/prae_abduct/use_ability(atom/A) - var/mob/living/carbon/xenomorph/X = owner +/datum/action/xeno_action/activable/prae_abduct/use_ability(atom/atom) + var/mob/living/carbon/xenomorph/xeno = owner - if(!A || A.layer >= FLY_LAYER || !isturf(X.loc)) + if(!atom || atom.layer >= FLY_LAYER || !isturf(xeno.loc)) return - if(!action_cooldown_check() || X.action_busy) + if(!action_cooldown_check() || xeno.action_busy) return - if(!X.check_state()) + if(!xeno.check_state()) return if(!check_plasma_owner()) @@ -252,13 +250,13 @@ // Build our turflist var/list/turf/turflist = list() var/list/telegraph_atom_list = list() - var/facing = get_dir(X, A) - var/turf/T = X.loc - var/turf/temp = X.loc - for(var/x in 0 to max_distance) - temp = get_step(T, facing) - if(facing in diagonals) // check if it goes through corners - var/reverse_face = reverse_dir[facing] + var/facing = get_dir(xeno, atom) + var/turf/turf = xeno.loc + var/turf/temp = xeno.loc + for(var/distance in 0 to max_distance) + temp = get_step(turf, facing) + if(facing in GLOB.diagonals) // check if it goes through corners + var/reverse_face = GLOB.reverse_dir[facing] var/turf/back_left = get_step(temp, turn(reverse_face, 45)) var/turf/back_right = get_step(temp, turn(reverse_face, -45)) if((!back_left || back_left.density) && (!back_right || back_right.density)) @@ -267,103 +265,98 @@ break var/blocked = FALSE - for(var/obj/structure/S in temp) - if(S.opacity || ((istype(S, /obj/structure/barricade) || istype(S, /obj/structure/girder) && S.density || istype(S, /obj/structure/machinery/door)) && S.density)) + for(var/obj/structure/structure in temp) + if(structure.opacity || ((istype(structure, /obj/structure/barricade) || istype(structure, /obj/structure/girder) && structure.density || istype(structure, /obj/structure/machinery/door)) && structure.density)) blocked = TRUE break if(blocked) break - T = temp + turf = temp - if (T in turflist) + if (turf in turflist) break - turflist += T - facing = get_dir(T, A) - telegraph_atom_list += new /obj/effect/xenomorph/xeno_telegraph/brown/abduct_hook(T, windup) + turflist += turf + facing = get_dir(turf, atom) + telegraph_atom_list += new /obj/effect/xenomorph/xeno_telegraph/brown/abduct_hook(turf, windup) if(!length(turflist)) - to_chat(X, SPAN_XENOWARNING("You don't have any room to do your abduction!")) + to_chat(xeno, SPAN_XENOWARNING("You don't have any room to do your abduction!")) return - X.visible_message(SPAN_XENODANGER("\The [X]'s segmented tail starts coiling..."), SPAN_XENODANGER("You begin coiling your tail, aiming towards \the [A]...")) - X.emote("roar") + xeno.visible_message(SPAN_XENODANGER("\The [xeno]'s segmented tail starts coiling..."), SPAN_XENODANGER("You begin coiling your tail, aiming towards \the [atom]...")) + xeno.emote("roar") - var/throw_target_turf = get_step(X.loc, facing) + var/throw_target_turf = get_step(xeno.loc, facing) - ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - X.update_canmove() - if(!do_after(X, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) - to_chat(X, SPAN_XENOWARNING("You relax your tail.")) + ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) + if(!do_after(xeno, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) + to_chat(xeno, SPAN_XENOWARNING("You relax your tail.")) apply_cooldown() - for (var/obj/effect/xenomorph/xeno_telegraph/XT in telegraph_atom_list) - telegraph_atom_list -= XT - qdel(XT) + for (var/obj/effect/xenomorph/xeno_telegraph/xenotelegraph in telegraph_atom_list) + telegraph_atom_list -= xenotelegraph + qdel(xenotelegraph) - REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - X.update_canmove() + REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) return if(!check_and_use_plasma_owner()) return - REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - X.update_canmove() + REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - playsound(get_turf(X), 'sound/effects/bang.ogg', 25, 0) - X.visible_message(SPAN_XENODANGER("\The [X] suddenly uncoils its tail, firing it towards [A]!"), SPAN_XENODANGER("You uncoil your tail, sending it out towards \the [A]!")) + playsound(get_turf(xeno), 'sound/effects/bang.ogg', 25, 0) + xeno.visible_message(SPAN_XENODANGER("\The [xeno] suddenly uncoils its tail, firing it towards [atom]!"), SPAN_XENODANGER("You uncoil your tail, sending it out towards \the [atom]!")) var/list/targets = list() for (var/turf/target_turf in turflist) - for (var/mob/living/carbon/H in target_turf) - if(!isxeno_human(H) || X.can_not_harm(H) || H.is_dead() || H.is_mob_incapacitated(TRUE)) + for (var/mob/living/carbon/target in target_turf) + if(!isxeno_human(target) || xeno.can_not_harm(target) || target.is_dead() || target.is_mob_incapacitated(TRUE) || target.mob_size >= MOB_SIZE_BIG) continue - targets += H + targets += target if (LAZYLEN(targets) == 1) - X.balloon_alert(X, "your tail catches and slows one target!", text_color = "#51a16c") + xeno.balloon_alert(xeno, "your tail catches and slows one target!", text_color = "#51a16c") else if (LAZYLEN(targets) == 2) - X.balloon_alert(X, "your tail catches and roots two targets!", text_color = "#51a16c") + xeno.balloon_alert(xeno, "your tail catches and roots two targets!", text_color = "#51a16c") else if (LAZYLEN(targets) >= 3) - X.balloon_alert(X, "your tail catches and stuns [LAZYLEN(targets)] targets!", text_color = "#51a16c") + xeno.balloon_alert(xeno, "your tail catches and stuns [LAZYLEN(targets)] targets!", text_color = "#51a16c") - for (var/mob/living/carbon/H in targets) - X.visible_message(SPAN_XENODANGER("\The [X]'s hooked tail coils itself around [H]!"), SPAN_XENODANGER("Your hooked tail coils itself around [H]!")) + for (var/mob/living/carbon/target in targets) + xeno.visible_message(SPAN_XENODANGER("\The [xeno]'s hooked tail coils itself around [target]!"), SPAN_XENODANGER("Your hooked tail coils itself around [target]!")) - H.apply_effect(0.2, WEAKEN) + target.apply_effect(0.2, WEAKEN) if (LAZYLEN(targets) == 1) - new /datum/effects/xeno_slow(H, X, , ,25) - H.apply_effect(1, SLOW) + new /datum/effects/xeno_slow(target, xeno, , ,25) + target.apply_effect(1, SLOW) else if (LAZYLEN(targets) == 2) - - ADD_TRAIT(H, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - H.update_canmove() - if (ishuman(H)) - var/mob/living/carbon/human/Hu = H - Hu.update_xeno_hostile_hud() - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), H), get_xeno_stun_duration(H, 25)) - to_chat(H, SPAN_XENOHIGHDANGER("[X] has pinned you to the ground! You cannot move!")) - - H.set_effect(2, DAZE) + ADD_TRAIT(target, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) + if (ishuman(target)) + var/mob/living/carbon/human/target_human = target + target_human.update_xeno_hostile_hud() + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target, TRAIT_SOURCE_ABILITY("Abduct")), get_xeno_stun_duration(target, 25)) + to_chat(target, SPAN_XENOHIGHDANGER("[xeno] has pinned you to the ground! You cannot move!")) + + target.set_effect(2, DAZE) else if (LAZYLEN(targets) >= 3) - H.apply_effect(get_xeno_stun_duration(H, 1.3), WEAKEN) - to_chat(H, SPAN_XENOHIGHDANGER("You are slammed into the other victims of [X]!")) + target.apply_effect(get_xeno_stun_duration(target, 1.3), WEAKEN) + to_chat(target, SPAN_XENOHIGHDANGER("You are slammed into the other victims of [xeno]!")) - shake_camera(H, 10, 1) + shake_camera(target, 10, 1) - var/obj/effect/beam/tail_beam = X.beam(H, "oppressor_tail", 'icons/effects/beam.dmi', 0.5 SECONDS, 8) + var/obj/effect/beam/tail_beam = xeno.beam(target, "oppressor_tail", 'icons/effects/beam.dmi', 0.5 SECONDS, 8) var/image/tail_image = image('icons/effects/status_effects.dmi', "hooked") - H.overlays += tail_image + target.overlays += tail_image - H.throw_atom(throw_target_turf, get_dist(throw_target_turf, H)-1, SPEED_VERY_FAST) + target.throw_atom(throw_target_turf, get_dist(throw_target_turf, target)-1, SPEED_VERY_FAST) qdel(tail_beam) // hook beam catches target, throws them back, is deleted (throw_atom has sleeps), then hook beam catches another target, repeat - addtimer(CALLBACK(src, /datum/action/xeno_action/activable/prae_abduct/proc/remove_tail_overlay, H, tail_image), 0.5 SECONDS) //needed so it can actually be seen as it gets deleted too quickly otherwise. + addtimer(CALLBACK(src, /datum/action/xeno_action/activable/prae_abduct/proc/remove_tail_overlay, target, tail_image), 0.5 SECONDS) //needed so it can actually be seen as it gets deleted too quickly otherwise. apply_cooldown() return ..() @@ -409,10 +402,9 @@ oppressor_user.animation_attack_on(target_carbon) oppressor_user.flick_attack_overlay(target_carbon, "punch") - if (HAS_TRAIT(target_carbon, TRAIT_IMMOBILIZED) || target_carbon.slowed || target_carbon.knocked_down) + if (!(target_carbon.mobility_flags & MOBILITY_MOVE) || !(target_carbon.mobility_flags & MOBILITY_STAND) || target_carbon.slowed) target_carbon.apply_damage(get_xeno_damage_slash(target_carbon, damage), BRUTE, target_limb? target_limb.name : "chest") ADD_TRAIT(target_carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Oppressor Punch")) - target_carbon.update_canmove() if (ishuman(target_carbon)) var/mob/living/carbon/human/Hu = target_carbon @@ -973,8 +965,8 @@ var/turf/temp = X.loc for(var/x in 0 to max_distance) temp = get_step(T, facing) - if(facing in diagonals) // check if it goes through corners - var/reverse_face = reverse_dir[facing] + if(facing in GLOB.diagonals) // check if it goes through corners + var/reverse_face = GLOB.reverse_dir[facing] var/turf/back_left = get_step(temp, turn(reverse_face, 45)) var/turf/back_right = get_step(temp, turn(reverse_face, -45)) if((!back_left || back_left.density) && (!back_right || back_right.density)) @@ -1013,7 +1005,6 @@ throw_target_turf = behind_turf ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() if(windup) if(!do_after(X, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) to_chat(X, SPAN_XENOWARNING("You cancel your retrieve.")) @@ -1024,12 +1015,10 @@ qdel(XT) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() return REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() playsound(get_turf(X), 'sound/effects/bang.ogg', 25, 0) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm index a26cc922c528..3c475743c0bf 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm @@ -79,7 +79,6 @@ for(var/mob/living/carbon/carbon in oview(round(behavior.kills * 0.5 + 2), xeno)) if(!xeno.can_not_harm(carbon) && carbon.stat != DEAD) ADD_TRAIT(carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Smash")) - carbon.update_canmove() if (ishuman(carbon)) var/mob/living/carbon/human/human = carbon @@ -126,7 +125,6 @@ return ADD_TRAIT(carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) - carbon.update_canmove() if (ishuman(carbon)) var/mob/living/carbon/human/human = carbon @@ -136,7 +134,6 @@ ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) xeno.anchored = TRUE - xeno.update_canmove() if (do_after(xeno, activation_delay, INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE)) xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] rips open the guts of [carbon]!"), SPAN_XENOHIGHDANGER("You rip open the guts of [carbon]!")) @@ -154,9 +151,6 @@ REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) xeno.anchored = FALSE unroot_human(carbon, TRAIT_SOURCE_ABILITY("Devastate")) - xeno.update_canmove() - - unroot_human(carbon) xeno.visible_message(SPAN_XENODANGER("[xeno] rapidly slices into [carbon]!")) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm index 23da1ce65903..65769eac9cdf 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm @@ -102,7 +102,7 @@ else new_xeno.key = target_xeno.key if(new_xeno.client) - new_xeno.client.change_view(world_view_size) + new_xeno.client.change_view(GLOB.world_view_size) new_xeno.client.pixel_x = 0 new_xeno.client.pixel_y = 0 @@ -125,8 +125,8 @@ target_xeno.transfer_observers_to(new_xeno) - if(round_statistics && !new_xeno.statistic_exempt) - round_statistics.track_new_participant(target_xeno.faction, -1) //so an evolved xeno doesn't count as two. + if(GLOB.round_statistics && !new_xeno.statistic_exempt) + GLOB.round_statistics.track_new_participant(target_xeno.faction, -1) //so an evolved xeno doesn't count as two. SSround_recording.recorder.stop_tracking(target_xeno) SSround_recording.recorder.track_player(new_xeno) qdel(target_xeno) @@ -537,7 +537,7 @@ return var/obj/effect/alien/weeds/node/node - for(var/direction in cardinal) + for(var/direction in GLOB.cardinals) var/turf/weed_turf = get_step(T, direction) var/obj/effect/alien/weeds/W = locate() in weed_turf if(W && W.hivenumber == X.hivenumber && W.parent && !W.hibernate && !LinkBlocked(W, weed_turf, T)) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm index a6c8067660dc..22f119faf234 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm @@ -170,8 +170,9 @@ for (var/step in 0 to 3) temp = get_step(turf, facing) - if(facing in diagonals) // check if it goes through corners - var/reverse_face = reverse_dir[facing] + if(facing in GLOB.diagonals) // check if it goes through corners + var/reverse_face = GLOB.reverse_dir[facing] + var/turf/back_left = get_step(temp, turn(reverse_face, 45)) var/turf/back_right = get_step(temp, turn(reverse_face, -45)) if((!back_left || back_left.density) && (!back_right || back_right.density)) @@ -387,7 +388,6 @@ ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate")) xeno.anchored = TRUE - xeno.update_canmove() if (do_after(xeno, (activation_delay - windup_reduction), INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE)) xeno.emote("roar") @@ -432,7 +432,6 @@ REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate")) xeno.anchored = FALSE - xeno.update_canmove() return ..() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_abilities.dm index bd6e2bb8d08b..5127ca6fe4ed 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_abilities.dm @@ -1,17 +1,3 @@ -// toggle agility -/datum/action/xeno_action/onclick/toggle_agility - name = "Toggle Agility" - action_icon_state = "agility_on" - ability_name = "toggle agility" - macro_path = /datum/action/xeno_action/verb/verb_toggle_agility - action_type = XENO_ACTION_CLICK - xeno_cooldown = 10 - -/datum/action/xeno_action/onclick/toggle_agility/can_use_action() - var/mob/living/carbon/xenomorph/X = owner - if(X && !X.buckled && !X.is_mob_incapacitated()) - return TRUE - // Warrior Fling /datum/action/xeno_action/activable/fling name = "Fling" @@ -28,7 +14,6 @@ var/weaken_power = 0.5 var/slowdown = 2 - // Warrior Lunge /datum/action/xeno_action/activable/lunge name = "Lunge" @@ -44,8 +29,6 @@ var/click_miss_cooldown = 15 var/twitch_message_cooldown = 0 //apparently this is necessary for a tiny code that makes the lunge message on cooldown not be spammable, doesn't need to be big so 5 will do. -// Warrior Agility - /datum/action/xeno_action/activable/warrior_punch name = "Punch" action_icon_state = "punch" @@ -60,27 +43,3 @@ var/base_punch_damage_synth = 30 var/base_punch_damage_pred = 25 var/damage_variance = 5 - -/datum/action/xeno_action/activable/uppercut - name = "Uppercut" - action_icon_state = "rav_clothesline" - ability_name = "uppercut" - macro_path = /datum/action/xeno_action/verb/verb_uppercut - action_type = XENO_ACTION_CLICK - ability_primacy = XENO_PRIMARY_ACTION_3 - xeno_cooldown = 100 - var/base_damage = 15 - var/base_knockback = 40 - var/base_knockdown = 0.25 - var/knockout_power = 11 // 11 seconds - var/base_healthgain = 5 // in percents of health per ko point - -/datum/action/xeno_action/activable/jab - name = "Jab" - action_icon_state = "pounce" - ability_name = "jab" - macro_path = /datum/action/xeno_action/verb/verb_jab - action_type = XENO_ACTION_CLICK - ability_primacy = XENO_PRIMARY_ACTION_2 - xeno_cooldown = 40 - diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_macros.dm b/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_macros.dm index 09a24c079fd0..63d97bb69aa2 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_macros.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_macros.dm @@ -19,24 +19,3 @@ set hidden = TRUE var/action_name = "Punch" handle_xeno_macro(src, action_name) - -/datum/action/xeno_action/verb/verb_jab() - set category = "Alien" - set name = "Jab" - set hidden = TRUE - var/action_name = "Jab" - handle_xeno_macro(src, action_name) - -/datum/action/xeno_action/verb/verb_uppercut() - set category = "Alien" - set name = "Uppercut" - set hidden = TRUE - var/action_name = "Uppercut" - handle_xeno_macro(src, action_name) - -/datum/action/xeno_action/verb/verb_toggle_agility() - set category = "Alien" - set name = "Toggle Agility" - set hidden = TRUE - var/action_name = "Toggle Agility" - handle_xeno_macro(src, action_name) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_powers.dm index 1ba675f5e6d6..cde2e3432e7b 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_powers.dm @@ -1,28 +1,28 @@ -/datum/action/xeno_action/activable/lunge/use_ability(atom/A) - var/mob/living/carbon/xenomorph/X = owner +/datum/action/xeno_action/activable/lunge/use_ability(atom/affected_atom) + var/mob/living/carbon/xenomorph/xeno = owner if (!action_cooldown_check()) if(twitch_message_cooldown < world.time ) - X.visible_message(SPAN_XENOWARNING("\The [X]'s claws twitch."), SPAN_XENOWARNING("Your claws twitch as you try to lunge but lack the strength. Wait a moment to try again.")) + xeno.visible_message(SPAN_XENOWARNING("[xeno]'s claws twitch."), SPAN_XENOWARNING("Your claws twitch as you try to lunge but lack the strength. Wait a moment to try again.")) twitch_message_cooldown = world.time + 5 SECONDS return //this gives a little feedback on why your lunge didn't hit other than the lunge button going grey. Plus, it might spook marines that almost got lunged if they know why the message appeared, and extra spookiness is always good. - if (!A) + if (!affected_atom) return - if (!isturf(X.loc)) - to_chat(X, SPAN_XENOWARNING("You can't lunge from here!")) + if (!isturf(xeno.loc)) + to_chat(xeno, SPAN_XENOWARNING("You can't lunge from here!")) return - if (!X.check_state() || X.agility) + if (!xeno.check_state() || xeno.agility) return - if(X.can_not_harm(A) || !ismob(A)) + if(xeno.can_not_harm(affected_atom) || !ismob(affected_atom)) apply_cooldown_override(click_miss_cooldown) return - var/mob/living/carbon/H = A - if(H.stat == DEAD) + var/mob/living/carbon/carbon = affected_atom + if(carbon.stat == DEAD) return if (!check_and_use_plasma_owner()) @@ -31,165 +31,150 @@ apply_cooldown() ..() - X.visible_message(SPAN_XENOWARNING("\The [X] lunges towards [H]!"), SPAN_XENOWARNING("You lunge at [H]!")) + xeno.visible_message(SPAN_XENOWARNING("[xeno] lunges towards [carbon]!"), SPAN_XENOWARNING("You lunge at [carbon]!")) - X.throw_atom(get_step_towards(A, X), grab_range, SPEED_FAST, X) + xeno.throw_atom(get_step_towards(affected_atom, xeno), grab_range, SPEED_FAST, xeno) - if (X.Adjacent(H)) - X.start_pulling(H,1) + if (xeno.Adjacent(carbon)) + xeno.start_pulling(carbon,1) else - X.visible_message(SPAN_XENOWARNING("\The [X]'s claws twitch."), SPAN_XENOWARNING("Your claws twitch as you lunge but are unable to grab onto your target. Wait a moment to try again.")) + xeno.visible_message(SPAN_XENOWARNING("[xeno]'s claws twitch."), SPAN_XENOWARNING("Your claws twitch as you lunge but are unable to grab onto your target. Wait a moment to try again.")) return TRUE -/datum/action/xeno_action/onclick/toggle_agility/use_ability(atom/A) - var/mob/living/carbon/xenomorph/X = owner +/datum/action/xeno_action/activable/fling/use_ability(atom/affected_atom) + var/mob/living/carbon/xenomorph/xeno = owner if (!action_cooldown_check()) return - if (!X.check_state(1)) + if (!isxeno_human(affected_atom) || xeno.can_not_harm(affected_atom)) return - X.agility = !X.agility - if (X.agility) - to_chat(X, SPAN_XENOWARNING("You lower yourself to all fours.")) - else - to_chat(X, SPAN_XENOWARNING("You raise yourself to stand on two feet.")) - X.update_icons() - - apply_cooldown() - return ..() - -/datum/action/xeno_action/activable/fling/use_ability(atom/target_atom) - var/mob/living/carbon/xenomorph/woyer = owner - - if (!action_cooldown_check()) + if (!xeno.check_state() || xeno.agility) return - if (!isxeno_human(target_atom) || woyer.can_not_harm(target_atom)) + if (!xeno.Adjacent(affected_atom)) return - if (!woyer.check_state() || woyer.agility) + var/mob/living/carbon/carbon = affected_atom + if(carbon.stat == DEAD) return - if (!woyer.Adjacent(target_atom)) + if(HAS_TRAIT(carbon, TRAIT_NESTED)) return - var/mob/living/carbon/carbone = target_atom - if(carbone.stat == DEAD) return - if(HAS_TRAIT(carbone, TRAIT_NESTED)) - return - - if(carbone == woyer.pulling) - woyer.stop_pulling() + if(carbon == xeno.pulling) + xeno.stop_pulling() - if(carbone.mob_size >= MOB_SIZE_BIG) - to_chat(woyer, SPAN_XENOWARNING("[carbone] is too big for you to fling!")) + if(carbon.mob_size >= MOB_SIZE_BIG) + to_chat(xeno, SPAN_XENOWARNING("[carbon] is too big for you to fling!")) return if (!check_and_use_plasma_owner()) return - woyer.visible_message(SPAN_XENOWARNING("\The [woyer] effortlessly flings [carbone] to the side!"), SPAN_XENOWARNING("You effortlessly fling [carbone] to the side!")) - playsound(carbone,'sound/weapons/alien_claw_block.ogg', 75, 1) + xeno.visible_message(SPAN_XENOWARNING("[xeno] effortlessly flings [carbon] to the side!"), SPAN_XENOWARNING("You effortlessly fling [carbon] to the side!")) + playsound(carbon,'sound/weapons/alien_claw_block.ogg', 75, 1) if(stun_power) - carbone.apply_effect(get_xeno_stun_duration(carbone, stun_power), STUN) + carbon.apply_effect(get_xeno_stun_duration(carbon, stun_power), STUN) if(weaken_power) - carbone.apply_effect(weaken_power, WEAKEN) + carbon.apply_effect(weaken_power, WEAKEN) if(slowdown) - if(carbone.slowed < slowdown) - carbone.apply_effect(slowdown, SLOW) - carbone.last_damage_data = create_cause_data(initial(woyer.caste_type), woyer) - shake_camera(carbone, 2, 1) + if(carbon.slowed < slowdown) + carbon.apply_effect(slowdown, SLOW) + carbon.last_damage_data = create_cause_data(initial(xeno.caste_type), xeno) + shake_camera(carbon, 2, 1) - var/facing = get_dir(woyer, carbone) - var/turf/throw_turf = woyer.loc - var/turf/temp = woyer.loc + var/facing = get_dir(xeno, carbon) + var/turf/throw_turf = xeno.loc + var/turf/temp = xeno.loc - for (var/x in 0 to fling_distance-1) + for (var/step in 0 to fling_distance-1) temp = get_step(throw_turf, facing) if (!temp) break throw_turf = temp // Hmm today I will kill a marine while looking away from them - woyer.face_atom(carbone) - woyer.animation_attack_on(carbone) - woyer.flick_attack_overlay(carbone, "disarm") - carbone.throw_atom(throw_turf, fling_distance, SPEED_VERY_FAST, woyer, TRUE) + xeno.face_atom(carbon) + xeno.animation_attack_on(carbon) + xeno.flick_attack_overlay(carbon, "disarm") + carbon.throw_atom(throw_turf, fling_distance, SPEED_VERY_FAST, xeno, TRUE) apply_cooldown() return ..() -/datum/action/xeno_action/activable/warrior_punch/use_ability(atom/target_atom) - var/mob/living/carbon/xenomorph/woyer = owner +/datum/action/xeno_action/activable/warrior_punch/use_ability(atom/affected_atom) + var/mob/living/carbon/xenomorph/xeno = owner if (!action_cooldown_check()) return - if (!isxeno_human(target_atom) || woyer.can_not_harm(target_atom)) + if (!isxeno_human(affected_atom) || xeno.can_not_harm(affected_atom)) return - if (!woyer.check_state() || woyer.agility) + if (!xeno.check_state() || xeno.agility) return - var/distance = get_dist(woyer, target_atom) + var/distance = get_dist(xeno, affected_atom) if (distance > 2) return - var/mob/living/carbon/carbone = target_atom + var/mob/living/carbon/carbon = affected_atom - if (!woyer.Adjacent(carbone)) + if (!xeno.Adjacent(carbon)) return - if(carbone.stat == DEAD) return - if(HAS_TRAIT(carbone, TRAIT_NESTED)) return - - var/obj/limb/target_limb = carbone.get_limb(check_zone(woyer.zone_selected)) + if(carbon.stat == DEAD) + return + if(HAS_TRAIT(carbon, TRAIT_NESTED)) + return - if (ishuman(carbone) && (!target_limb || (target_limb.status & LIMB_DESTROYED))) - target_limb = carbone.get_limb("chest") + var/obj/limb/target_limb = carbon.get_limb(check_zone(xeno.zone_selected)) + if (ishuman(carbon) && (!target_limb || (target_limb.status & LIMB_DESTROYED))) + target_limb = carbon.get_limb("chest") if (!check_and_use_plasma_owner()) return - carbone.last_damage_data = create_cause_data(initial(woyer.caste_type), woyer) + carbon.last_damage_data = create_cause_data(initial(xeno.caste_type), xeno) - woyer.visible_message(SPAN_XENOWARNING("\The [woyer] hits [carbone] in the [target_limb? target_limb.display_name : "chest"] with a devastatingly powerful punch!"), \ - SPAN_XENOWARNING("You hit [carbone] in the [target_limb? target_limb.display_name : "chest"] with a devastatingly powerful punch!")) - var/S = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg') - playsound(carbone,S, 50, 1) - do_base_warrior_punch(carbone, target_limb) + xeno.visible_message(SPAN_XENOWARNING("[xeno] hits [carbon] in the [target_limb ? target_limb.display_name : "chest"] with a devastatingly powerful punch!"), \ + SPAN_XENOWARNING("You hit [carbon] in the [target_limb ? target_limb.display_name : "chest"] with a devastatingly powerful punch!")) + var/sound = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg') + playsound(carbon, sound, 50, 1) + do_base_warrior_punch(carbon, target_limb) apply_cooldown() return ..() -/datum/action/xeno_action/activable/warrior_punch/proc/do_base_warrior_punch(mob/living/carbon/carbone, obj/limb/target_limb) - var/mob/living/carbon/xenomorph/woyer = owner +/datum/action/xeno_action/activable/warrior_punch/proc/do_base_warrior_punch(mob/living/carbon/carbon, obj/limb/target_limb) + var/mob/living/carbon/xenomorph/xeno = owner var/damage = rand(base_damage, base_damage + damage_variance) - if(ishuman(carbone)) + if(ishuman(carbon)) if((target_limb.status & LIMB_SPLINTED) && !(target_limb.status & LIMB_SPLINTED_INDESTRUCTIBLE)) //If they have it splinted, the splint won't hold. target_limb.status &= ~LIMB_SPLINTED - playsound(get_turf(carbone), 'sound/items/splintbreaks.ogg', 20) - to_chat(carbone, SPAN_DANGER("The splint on your [target_limb.display_name] comes apart!")) - carbone.pain.apply_pain(PAIN_BONE_BREAK_SPLINTED) + playsound(get_turf(carbon), 'sound/items/splintbreaks.ogg', 20) + to_chat(carbon, SPAN_DANGER("The splint on your [target_limb.display_name] comes apart!")) + carbon.pain.apply_pain(PAIN_BONE_BREAK_SPLINTED) + + if(ishuman_strict(carbon)) + carbon.apply_effect(3, SLOW) - if(ishuman_strict(carbone)) - carbone.apply_effect(3, SLOW) - if(isyautja(carbone)) + if(isyautja(carbon)) damage = rand(base_punch_damage_pred, base_punch_damage_pred + damage_variance) else if(target_limb.status & (LIMB_ROBOT|LIMB_SYNTHSKIN)) damage = rand(base_punch_damage_synth, base_punch_damage_synth + damage_variance) - carbone.apply_armoured_damage(get_xeno_damage_slash(carbone, damage), ARMOR_MELEE, BRUTE, target_limb? target_limb.name : "chest") + carbon.apply_armoured_damage(get_xeno_damage_slash(carbon, damage), ARMOR_MELEE, BRUTE, target_limb ? target_limb.name : "chest") // Hmm today I will kill a marine while looking away from them - woyer.face_atom(carbone) - woyer.animation_attack_on(carbone) - woyer.flick_attack_overlay(carbone, "punch") - shake_camera(carbone, 2, 1) - step_away(carbone, woyer, 2) + xeno.face_atom(carbon) + xeno.animation_attack_on(carbon) + xeno.flick_attack_overlay(carbon, "punch") + shake_camera(carbon, 2, 1) + step_away(carbon, xeno, 2) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm b/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm index f4d4628e41f2..11b8f0db0075 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm @@ -63,15 +63,15 @@ if(!owner) return var/mob/living/carbon/xenomorph/X = owner - if (ability_name && round_statistics) - round_statistics.track_ability_usage(ability_name) + if (ability_name && GLOB.round_statistics) + GLOB.round_statistics.track_ability_usage(ability_name) X.track_ability_usage(ability_name, X.caste_type) /datum/action/xeno_action/can_use_action() if(!owner) return FALSE var/mob/living/carbon/xenomorph/X = owner - if(X && !X.is_mob_incapacitated() && !X.dazed && !X.lying && !X.buckled && X.plasma_stored >= plasma_cost) + if(X && !X.is_mob_incapacitated() && !X.dazed && X.body_position == STANDING_UP && !X.buckled && X.plasma_stored >= plasma_cost) return TRUE /datum/action/xeno_action/give_to(mob/living/L) diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index 649a1c98ce6c..0ad84fc49e42 100644 --- a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm +++ b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm @@ -209,7 +209,7 @@ SPAN_DANGER("You tackle down [src]!"), null, 5, CHAT_TYPE_XENO_COMBAT) else playsound(loc, 'sound/weapons/alien_claw_swipe.ogg', 25, 1) - if (knocked_down) + if (HAS_TRAIT(src, TRAIT_FLOORED)) M.visible_message(SPAN_DANGER("[M] tries to tackle [src], but they are already down!"), \ SPAN_DANGER("You try to tackle [src], but they are already down!"), null, 5, CHAT_TYPE_XENO_COMBAT) else @@ -555,7 +555,7 @@ if(M.action_busy) return XENO_NO_DELAY_ACTION - if(M.lying) + if(M.is_mob_incapacitated() || M.body_position != STANDING_UP) return XENO_NO_DELAY_ACTION var/delay @@ -574,7 +574,7 @@ if(do_after(M, delay, INTERRUPT_ALL, BUSY_ICON_HOSTILE)) if(M.loc != cur_loc) return XENO_NO_DELAY_ACTION //Make sure we're still there - if(M.lying) + if(M.is_mob_incapacitated() || M.body_position != STANDING_UP) return XENO_NO_DELAY_ACTION if(locked) to_chat(M, SPAN_WARNING("[src] is bolted down tight.")) @@ -767,9 +767,9 @@ to_chat(M, SPAN_XENONOTICE("You interact with the machine and disable remote control.")) xeno_message(SPAN_XENOANNOUNCE("[message]"),3,M.hivenumber) last_locked = world.time - if(almayer_orbital_cannon) - almayer_orbital_cannon.is_disabled = TRUE - addtimer(CALLBACK(almayer_orbital_cannon, .obj/structure/orbital_cannon/proc/enable), 10 MINUTES, TIMER_UNIQUE) + if(GLOB.almayer_orbital_cannon) + GLOB.almayer_orbital_cannon.is_disabled = TRUE + addtimer(CALLBACK(GLOB.almayer_orbital_cannon, TYPE_PROC_REF(/obj/structure/orbital_cannon, enable)), 10 MINUTES, TIMER_UNIQUE) queen_locked = 1 /datum/shuttle/ferry/marine/proc/door_override(mob/living/carbon/xenomorph/M, shuttle_tag) @@ -783,17 +783,17 @@ if(shuttle_tag == DROPSHIP_NORMANDY) ship_id = "sh_dropship2" - for(var/obj/structure/machinery/door/airlock/dropship_hatch/D in machines) + for(var/obj/structure/machinery/door/airlock/dropship_hatch/D in GLOB.machines) if(D.id == ship_id) D.unlock() var/obj/structure/machinery/door/airlock/multi_tile/almayer/reardoor switch(ship_id) if("sh_dropship1") - for(var/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/ds1/D in machines) + for(var/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/ds1/D in GLOB.machines) reardoor = D if("sh_dropship2") - for(var/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/ds2/D in machines) + for(var/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/ds2/D in GLOB.machines) reardoor = D if(!reardoor) CRASH("Shuttle crashed trying to override invalid rear door with shuttle id [ship_id]") diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm index e7118164cf07..ee882bc14fdf 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm @@ -84,13 +84,6 @@ . = ..() sight |= SEE_TURFS -/mob/living/carbon/xenomorph/burrower/update_canmove() - . = ..() - if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) - density = FALSE - canmove = FALSE - return canmove - /mob/living/carbon/xenomorph/burrower/ex_act(severity) if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm index c13555cba12c..07f161f4c6f7 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -117,8 +117,8 @@ for(var/i in hugger_image_index) if(stat == DEAD) hugger_overlays_icon.overlays += icon(icon, "clinger_[i] Knocked Down") - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) hugger_overlays_icon.overlays += icon(icon, "clinger_[i] Sleeping") else hugger_overlays_icon.overlays +=icon(icon, "clinger_[i] Knocked Down") @@ -162,8 +162,8 @@ i = 1 if(stat != DEAD) - if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) eggsac_overlays_icon.overlays += icon(icon, "eggsac_[i] Sleeping") else eggsac_overlays_icon.overlays +=icon(icon, "eggsac_[i] Knocked Down") diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm index c9ceaaa85cfb..3e01cc2af139 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm @@ -70,7 +70,7 @@ if(stat == DEAD) return ..() - if(!lying && !(mutation_type == FACEHUGGER_WATCHER) && !(locate(/obj/effect/alien/weeds) in get_turf(src))) + if(body_position == STANDING_UP && !(mutation_type == FACEHUGGER_WATCHER) && !(locate(/obj/effect/alien/weeds) in get_turf(src))) adjustBruteLoss(1) return ..() @@ -86,8 +86,8 @@ if(stat == DEAD) icon_state = "[mutation_type] [caste.caste_type] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[mutation_type] [caste.caste_type] Sleeping" else icon_state = "[mutation_type] [caste.caste_type] Knocked Down" @@ -110,8 +110,8 @@ if(!caste) return FALSE - if(lying) //No attacks while laying down - return FALSE + if(body_position == LYING_DOWN) //No attacks while laying down + return FALSE // Yoooo replace this by a mobility_flag for attacks or something if(istype(A, /obj/effect/alien/resin/special/eggmorph)) var/obj/effect/alien/resin/special/eggmorph/morpher = A @@ -130,7 +130,7 @@ if(ishuman(A)) var/mob/living/carbon/human/human = A - if(!human.lying) + if(human.body_position != LYING_DOWN) to_chat(src, SPAN_WARNING("You can't reach \the [human], they need to be lying down.")) return if(!can_hug(human, hivenumber)) @@ -139,7 +139,7 @@ visible_message(SPAN_WARNING("\The [src] starts climbing onto \the [human]'s face..."), SPAN_XENONOTICE("You start climbing onto \the [human]'s face...")) if(!do_after(src, FACEHUGGER_WINDUP_DURATION, INTERRUPT_ALL, BUSY_ICON_HOSTILE, human, INTERRUPT_MOVED, BUSY_ICON_HOSTILE)) return - if(!human.lying) + if(human.body_position != LYING_DOWN) to_chat(src, SPAN_WARNING("You can't reach \the [human], they need to be lying down.")) return if(!can_hug(human, hivenumber)) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm index 82d80752ec54..816e6020c30f 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm @@ -130,8 +130,8 @@ else if(handcuffed || legcuffed) icon_state = "[state_override || state]Larva Cuff" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[state_override || state]Larva Sleeping" else icon_state = "[state_override || state]Larva Stunned" @@ -155,7 +155,7 @@ if(!caste) return FALSE - if(lying) //No attacks while laying down + if(body_position) //No attacks while laying down return FALSE A.attack_larva(src) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index 1c7ba8503d4d..a34913b2ff5c 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -102,7 +102,7 @@ if (!isxeno_human(target_carbon)) return - if (target_carbon.knocked_down) + if (HAS_TRAIT(target_carbon, TRAIT_FLOORED)) new /datum/effects/xeno_slow(target_carbon, bound_xeno, null, null, get_xeno_stun_duration(target_carbon, slash_slow_duration)) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index b83b33e2eee5..e6f4dfae8a44 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -791,6 +791,9 @@ if(ovipositor) return //sanity check ovipositor = TRUE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, OVIPOSITOR_TRAIT) + set_body_position(STANDING_UP) + set_resting(FALSE) set_resin_build_order(GLOB.resin_build_order_ovipositor) // This needs to occur before we update the abilities so we can update the choose resin icon for(var/datum/action/xeno_action/action in actions) @@ -843,7 +846,6 @@ egg_planting_range = 3 anchored = TRUE resting = FALSE - update_canmove() update_icons() bubble_icon_x_offset = 32 bubble_icon_y_offset = 32 @@ -871,6 +873,7 @@ if(!ovipositor) return ovipositor = FALSE + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, OVIPOSITOR_TRAIT) update_icons() bubble_icon_x_offset = initial(bubble_icon_x_offset) bubble_icon_y_offset = initial(bubble_icon_y_offset) @@ -899,7 +902,6 @@ ovi_ability.apply_cooldown() break anchored = FALSE - update_canmove() for(var/mob/living/carbon/xenomorph/L in hive.xeno_leader_list) L.handle_xeno_leader_pheromones() @@ -909,14 +911,6 @@ SEND_SIGNAL(src, COMSIG_QUEEN_DISMOUNT_OVIPOSITOR, instant_dismount) -/mob/living/carbon/xenomorph/queen/update_canmove() - . = ..() - if(ovipositor) - lying = FALSE - density = TRUE - canmove = FALSE - return canmove - /mob/living/carbon/xenomorph/queen/handle_special_state() if(ovipositor) return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm index 7c8edace81e4..d3d34af98908 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm @@ -72,41 +72,41 @@ lunged.set_effect(0, WEAKEN) return ..() -/mob/living/carbon/xenomorph/warrior/start_pulling(atom/movable/AM, lunge) - if (!check_state() || agility) +/mob/living/carbon/xenomorph/warrior/start_pulling(atom/movable/movable_atom, lunge) + if (!check_state()) return FALSE - if(!isliving(AM)) + if(!isliving(movable_atom)) return FALSE - var/mob/living/L = AM - var/should_neckgrab = !(src.can_not_harm(L)) && lunge + var/mob/living/living_mob = movable_atom + var/should_neckgrab = !(src.can_not_harm(living_mob)) && lunge - if(!QDELETED(L) && !QDELETED(L.pulledby) && L != src ) //override pull of other mobs - visible_message(SPAN_WARNING("[src] has broken [L.pulledby]'s grip on [L]!"), null, null, 5) - L.pulledby.stop_pulling() + if(!QDELETED(living_mob) && !QDELETED(living_mob.pulledby) && living_mob != src ) //override pull of other mobs + visible_message(SPAN_WARNING("[src] has broken [living_mob.pulledby]'s grip on [living_mob]!"), null, null, 5) + living_mob.pulledby.stop_pulling() - . = ..(L, lunge, should_neckgrab) + . = ..(living_mob, lunge, should_neckgrab) if(.) //successful pull - if(isxeno(L)) - var/mob/living/carbon/xenomorph/X = L - if(X.tier >= 2) // Tier 2 castes or higher immune to warrior grab stuns - return . - - if(should_neckgrab && L.mob_size < MOB_SIZE_BIG) - L.drop_held_items() - L.apply_effect(get_xeno_stun_duration(L, 2), WEAKEN) - L.pulledby = src - visible_message(SPAN_XENOWARNING("\The [src] grabs [L] by the throat!"), \ - SPAN_XENOWARNING("You grab [L] by the throat!")) + if(isxeno(living_mob)) + var/mob/living/carbon/xenomorph/xeno = living_mob + if(xeno.tier >= 2) // Tier 2 castes or higher immune to warrior grab stuns + return + + if(should_neckgrab && living_mob.mob_size < MOB_SIZE_BIG) + living_mob.drop_held_items() + living_mob.apply_effect(get_xeno_stun_duration(living_mob, 2), WEAKEN) + living_mob.pulledby = src + visible_message(SPAN_XENOWARNING("[src] grabs [living_mob] by the throat!"), \ + SPAN_XENOWARNING("You grab [living_mob] by the throat!")) lunging = TRUE - addtimer(CALLBACK(src, PROC_REF(stop_lunging)), get_xeno_stun_duration(L, 2) SECONDS + 1 SECONDS) + addtimer(CALLBACK(src, PROC_REF(stop_lunging)), get_xeno_stun_duration(living_mob, 2) SECONDS + 1 SECONDS) /mob/living/carbon/xenomorph/warrior/proc/stop_lunging(world_time) lunging = FALSE -/mob/living/carbon/xenomorph/warrior/hitby(atom/movable/AM) - if(ishuman(AM)) +/mob/living/carbon/xenomorph/warrior/hitby(atom/movable/movable_atom) + if(ishuman(movable_atom)) return ..() @@ -120,7 +120,7 @@ var/color = "#6c6f24" var/emote_cooldown = 0 -/datum/behavior_delegate/warrior_base/melee_attack_additional_effects_target(mob/living/carbon/A) +/datum/behavior_delegate/warrior_base/melee_attack_additional_effects_target(mob/living/carbon/carbon) ..() if(SEND_SIGNAL(bound_xeno, COMSIG_XENO_PRE_HEAL) & COMPONENT_CANCEL_XENO_HEAL) @@ -156,3 +156,82 @@ /datum/behavior_delegate/warrior_base/proc/lifesteal_lock() bound_xeno.remove_filter("empower_rage") + + +/// Warrior specific behaviour for increasing pull power, limb rip. +/mob/living/carbon/xenomorph/warrior/pull_power(mob/mob) + if(!ripping_limb && mob.stat != DEAD) + if(mob.status_flags & XENO_HOST) + to_chat(src, SPAN_XENOWARNING("This would harm the embryo!")) + return + ripping_limb = TRUE + if(rip_limb(mob)) + stop_pulling() + ripping_limb = FALSE + + +/// Warrior Rip Limb - called by pull_power() +/mob/living/carbon/xenomorph/warrior/proc/rip_limb(mob/mob) + if(!istype(mob, /mob/living/carbon/human)) + return FALSE + + if(action_busy) //can't stack the attempts + return FALSE + + var/mob/living/carbon/human/human = mob + var/obj/limb/limb = human.get_limb(check_zone(zone_selected)) + + if(can_not_harm(human)) + to_chat(src, SPAN_XENOWARNING("You can't harm this host!")) + return + + if(!limb || limb.body_part == BODY_FLAG_CHEST || limb.body_part == BODY_FLAG_GROIN || (limb.status & LIMB_DESTROYED)) //Only limbs and head. + to_chat(src, SPAN_XENOWARNING("You can't rip off that limb.")) + return FALSE + var/limb_time = rand(40,60) + + if(limb.body_part == BODY_FLAG_HEAD) + limb_time = rand(90,110) + + visible_message(SPAN_XENOWARNING("[src] begins pulling on [mob]'s [limb.display_name] with incredible strength!"), \ + SPAN_XENOWARNING("You begin to pull on [mob]'s [limb.display_name] with incredible strength!")) + + if(!do_after(src, limb_time, INTERRUPT_ALL|INTERRUPT_DIFF_SELECT_ZONE, BUSY_ICON_HOSTILE) || mob.stat == DEAD || mob.status_flags & XENO_HOST) + to_chat(src, SPAN_NOTICE("You stop ripping off the limb.")) + if(mob.status_flags & XENO_HOST) + to_chat(src, SPAN_NOTICE("You detect an embryo inside [mob] which overwhelms your instinct to rip.")) + return FALSE + + if(limb.status & LIMB_DESTROYED) + return FALSE + + if(limb.status & (LIMB_ROBOT|LIMB_SYNTHSKIN)) + limb.take_damage(rand(30,40), 0, 0) // just do more damage + visible_message(SPAN_XENOWARNING("You hear [mob]'s [limb.display_name] being pulled beyond its load limits!"), \ + SPAN_XENOWARNING("[mob]'s [limb.display_name] begins to tear apart!")) + else + visible_message(SPAN_XENOWARNING("You hear the bones in [mob]'s [limb.display_name] snap with a sickening crunch!"), \ + SPAN_XENOWARNING("[mob]'s [limb.display_name] bones snap with a satisfying crunch!")) + limb.take_damage(rand(15,25), 0, 0) + limb.fracture(100) + mob.last_damage_data = create_cause_data(initial(caste_type), src) + src.attack_log += text("\[[time_stamp()]\] ripped the [limb.display_name] off of [mob.name] ([mob.ckey]) 1/2 progress") + mob.attack_log += text("\[[time_stamp()]\] had their [limb.display_name] ripped off by [src.name] ([src.ckey]) 1/2 progress") + log_attack("[src.name] ([src.ckey]) ripped the [limb.display_name] off of [mob.name] ([mob.ckey]) 1/2 progress") + + if(!do_after(src, limb_time, INTERRUPT_ALL|INTERRUPT_DIFF_SELECT_ZONE, BUSY_ICON_HOSTILE) || mob.stat == DEAD || iszombie(mob)) + to_chat(src, SPAN_NOTICE("You stop ripping off the limb.")) + return FALSE + + if(limb.status & LIMB_DESTROYED) + return FALSE + + visible_message(SPAN_XENOWARNING("[src] rips [mob]'s [limb.display_name] away from their body!"), \ + SPAN_XENOWARNING("[mob]'s [limb.display_name] rips away from their body!")) + src.attack_log += text("\[[time_stamp()]\] ripped the [limb.display_name] off of [mob.name] ([mob.ckey]) 2/2 progress") + mob.attack_log += text("\[[time_stamp()]\] had their [limb.display_name] ripped off by [src.name] ([src.ckey]) 2/2 progress") + log_attack("[src.name] ([src.ckey]) ripped the [limb.display_name] off of [mob.name] ([mob.ckey]) 2/2 progress") + + limb.droplimb(0, 0, initial(name)) + + return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm b/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm index 48bf0d95ddcf..9ca4cdc52474 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm @@ -95,3 +95,11 @@ if (PF) PF.flags_pass = PASS_MOB_IS_XENO|PASS_MOB_THRU_XENO PF.flags_can_pass_all = PASS_MOB_IS_XENO|PASS_MOB_THRU_XENO + +/mob/living/carbon/xenomorph/lesser_drone/ghostize(can_reenter_corpse = FALSE, aghosted = FALSE) + . = ..() + if(. && !aghosted && !QDELETED(src)) + gib() + +/mob/living/carbon/xenomorph/lesser_drone/handle_ghost_message() + return diff --git a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm index 51ceee153368..b6ceb2043458 100644 --- a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm @@ -36,7 +36,7 @@ /mob/living/carbon/xenomorph/ex_act(severity, direction, datum/cause_data/cause_data, pierce=0) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER if(severity >= 30) diff --git a/code/modules/mob/living/carbon/xenomorph/death.dm b/code/modules/mob/living/carbon/xenomorph/death.dm index 0374b21c6f36..1f7d02f98c7d 100644 --- a/code/modules/mob/living/carbon/xenomorph/death.dm +++ b/code/modules/mob/living/carbon/xenomorph/death.dm @@ -116,11 +116,11 @@ hive.remove_xeno(src) // Finding the last xeno for anti-delay. if(SSticker.mode && SSticker.current_state != GAME_STATE_FINISHED) - if((last_ares_callout + 2 MINUTES) > world.time) + if((GLOB.last_ares_callout + 2 MINUTES) > world.time) return if(hive.hivenumber == XENO_HIVE_NORMAL && (LAZYLEN(hive.totalXenos) == 1)) var/mob/living/carbon/xenomorph/X = LAZYACCESS(hive.totalXenos, 1) - last_ares_callout = world.time + GLOB.last_ares_callout = world.time // Tell the marines where the last one is. var/name = "[MAIN_AI_SYSTEM] Bioscan Status" var/input = "Bioscan complete.\n\nSensors indicate one remaining unknown lifeform signature in [get_area(X)]." diff --git a/code/modules/mob/living/carbon/xenomorph/egg_item.dm b/code/modules/mob/living/carbon/xenomorph/egg_item.dm index 77c5548d9f9f..05d456d0025d 100644 --- a/code/modules/mob/living/carbon/xenomorph/egg_item.dm +++ b/code/modules/mob/living/carbon/xenomorph/egg_item.dm @@ -98,7 +98,7 @@ to_chat(user, SPAN_XENOWARNING("[src] must be planted on [lowertext(hive.prefix)]weeds.")) return - if(!hive_weeds) + if(!hive_weeds && user.mutation_type != CARRIER_EGGSAC) to_chat(user, SPAN_XENOWARNING("[src] can only be planted on [lowertext(hive.prefix)]hive weeds.")) return @@ -117,9 +117,16 @@ return for(var/obj/effect/alien/weeds/weed in T) - if(weed.weed_strength >= WEED_LEVEL_HIVE) + if(weed.weed_strength >= WEED_LEVEL_HIVE || user.mutation_type == CARRIER_EGGSAC) user.use_plasma(30) - var/obj/effect/alien/egg/newegg = new /obj/effect/alien/egg(T, hivenumber) + var/obj/effect/alien/egg/newegg + if(weed.weed_strength >= WEED_LEVEL_HIVE) + newegg = new /obj/effect/alien/egg(T, hivenumber) + else if(weed.weed_strength == WEED_LEVEL_STANDARD) + newegg = new /obj/effect/alien/egg/carrier_egg(T,hivenumber, user) + else + to_chat(user, SPAN_XENOWARNING("[src] can't be planted on these weeds.")) + return newegg.flags_embryo = flags_embryo diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index 65839e9c8caf..f794c051dbff 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -10,7 +10,8 @@ ..() - if(is_zoomed && (stat || lying)) + // replace this by signals or trait signals + if(is_zoomed && (stat || body_position == LYING_DOWN)) zoom_out() if(stat != DEAD) //Stop if dead. Performance boost @@ -23,7 +24,6 @@ handle_regular_status_updates() handle_stomach_contents() handle_overwatch() // For new Xeno hivewide overwatch - Fourk, 6/24/19 - update_canmove() update_icons() handle_luminosity() handle_blood() @@ -187,9 +187,8 @@ ear_damage = 0 SetEyeBlind(0) - if(knocked_out) //If they're down, make sure they are actually down. + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) //If they're down, make sure they are actually down. blinded = TRUE - set_stat(UNCONSCIOUS) if(regular_update && halloss > 0) apply_damage(-3, HALLOSS) else if(sleeping) @@ -342,7 +341,7 @@ Make sure their actual health updates immediately.*/ if(recovery_aura) plasma_stored += round(plasma_gain * plasma_max / 100 * recovery_aura/4) //Divided by four because it gets massive fast. 1 is equivalent to weed regen! Only the strongest pheromones should bypass weeds if(health < maxHealth && !hardcore && is_hive_living(hive) && last_hit_time + caste.heal_delay_time <= world.time) - if(lying || resting) + if(body_position == LYING_DOWN || resting) if(health < 0) //Unconscious heal_wounds(caste.heal_knocked_out * regeneration_multiplier, recoveryActual) //Healing is much slower. Warding pheromones make up for the rest if you're curious else @@ -455,7 +454,7 @@ Make sure their actual health updates immediately.*/ var/area/A = get_area(loc) var/area/QA = get_area(tracking_atom.loc) if(A.fake_zlevel == QA.fake_zlevel) - QL.setDir(get_dir(src, tracking_atom)) + QL.setDir(Get_Compass_Dir(src, tracking_atom)) QL.icon_state = "trackon" else QL.icon_state = "trackondirect" @@ -484,7 +483,7 @@ Make sure their actual health updates immediately.*/ ML.overlays |= image('icons/mob/hud/xeno_markers.dmi', "all_direction") return else if(A.fake_zlevel == MA.fake_zlevel) //normal tracking - ML.setDir(get_dir(src, tracked_marker_turf)) + ML.setDir(Get_Compass_Dir(src, tracked_marker_turf)) ML.overlays |= image(tracked_marker.seenMeaning, "pixel_y" = 0) ML.overlays |= image('icons/mob/hud/xeno_markers.dmi', "center_glow") ML.overlays |= image('icons/mob/hud/xeno_markers.dmi', "direction") @@ -536,8 +535,6 @@ Make sure their actual health updates immediately.*/ if(layer != initial(layer)) //Unhide layer = initial(layer) recalculate_move_delay = TRUE - if(!lying) - update_canmove() /mob/living/carbon/xenomorph/proc/handle_luminosity() var/new_luminosity = 0 @@ -583,16 +580,14 @@ Make sure their actual health updates immediately.*/ return superslowed /mob/living/carbon/xenomorph/handle_knocked_down() - if(knocked_down) + if(HAS_TRAIT(src, TRAIT_FLOORED)) adjust_effect(life_knockdown_reduction, WEAKEN, EFFECT_FLAG_LIFE) knocked_down_callback_check() - return knocked_down /mob/living/carbon/xenomorph/handle_knocked_out() - if(knocked_out) + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) adjust_effect(life_knockout_reduction, PARALYZE, EFFECT_FLAG_LIFE) knocked_out_callback_check() - return knocked_out //Returns TRUE if xeno is on weeds //Returns TRUE if xeno is off weeds AND doesn't need weeds for healing AND is not on Almayer UNLESS Queen is also on Almayer (aka - no solo Lurker Almayer hero) diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm index 524571fc0dfd..3d032da2fe36 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm @@ -1,6 +1,6 @@ /datum/xeno_mutator/eggsac name = "STRAIN: Carrier - Eggsac" - description = "In exchange for your ability to store huggers and place traps, you gain larger plasma stores, strong pheromones, and the ability to lay eggs by using your plasma stores. In addition, you can now carry twelve eggs at once and can place eggs one pace further than normal" + description = "In exchange for your ability to store huggers and place traps, you gain larger plasma stores, strong pheromones, and the ability to lay eggs by using your plasma stores. In addition, you can now carry twelve eggs at once and can place eggs one pace further than normal. \n\nYou can also place a small number of fragile eggs on normal weeds. These eggs have a lifetime of five minutes while you remain within 14 tiles. Or one minute if you leave this range." flavor_description = "An egg is always an adventure; the next one may be different." cost = MUTATOR_COST_EXPENSIVE individual_only = TRUE @@ -15,6 +15,7 @@ /datum/action/xeno_action/active_toggle/generate_egg, /datum/action/xeno_action/activable/retrieve_egg, // readding it so it gets at the end of the ability list ) + behavior_delegate_type = /datum/behavior_delegate/carrier_eggsac keystone = TRUE /datum/xeno_mutator/eggsac/apply_mutator(datum/mutator_set/individual_mutators/mutator_set) @@ -40,8 +41,57 @@ carrier.update_eggsac_overlays() carrier.eggs_max = 12 carrier.egg_planting_range = 2 + apply_behavior_holder(carrier) return TRUE +#define EGGSAC_OFF_WEED_EGGCAP 4 +#define EGGSAC_EGG_SUSTAIN_DISTANCE 14 + +/datum/behavior_delegate/carrier_eggsac + name = "Eggsac Carrier Behavior Delegate" + ///List of /obj/effect/alien/egg/carrier_egg sustained by the carrier on normal weeds + var/list/eggs_sustained = list() + ///Total number of eggs which can be sustained defined as EGGSAC_OFF_WEED_EGGCAP + var/egg_sustain_cap = EGGSAC_OFF_WEED_EGGCAP + ///Distance from the egg that the carrier can go before it stops sustaining it + var/sustain_distance = EGGSAC_EGG_SUSTAIN_DISTANCE + +/datum/behavior_delegate/carrier_eggsac/append_to_stat() + . = list() + . += "Eggs sustained: [length(eggs_sustained)] / [egg_sustain_cap]" + +/datum/behavior_delegate/carrier_eggsac/on_life() + if(length(eggs_sustained) > egg_sustain_cap) + var/obj/effect/alien/egg/carrier_egg/my_egg = eggs_sustained[1] + remove_egg_owner(my_egg) + my_egg.start_unstoppable_decay() + to_chat(bound_xeno, SPAN_XENOWARNING("You can only sustain [egg_sustain_cap] eggs off hive weeds! Your oldest placed egg is decaying rapidly.")) + + for(var/obj/effect/alien/egg/carrier_egg/my_egg as anything in eggs_sustained) + //Get the distance from us to our sustained egg + if(get_dist(bound_xeno, my_egg) <= sustain_distance) + my_egg.last_refreshed = world.time + else + my_egg.check_decay() + +///Remove owner of egg +/datum/behavior_delegate/carrier_eggsac/proc/remove_egg_owner(obj/effect/alien/egg/carrier_egg/egg) + if(!egg.owner || egg.owner != bound_xeno) + return + eggs_sustained -= egg + egg.owner = null + +/datum/behavior_delegate/carrier_eggsac/handle_death(mob/M) + for(var/obj/effect/alien/egg/carrier_egg/my_egg as anything in eggs_sustained) + remove_egg_owner(my_egg) + my_egg.start_unstoppable_decay() + +///Remove all references to src in eggs_sustained +/datum/behavior_delegate/carrier_eggsac/Destroy() + for(var/obj/effect/alien/egg/carrier_egg/my_egg as anything in eggs_sustained) + my_egg.owner = null + return ..() + /datum/action/xeno_action/active_toggle/generate_egg name = "Generate Eggs (50)" action_icon_state = "lay_egg" @@ -77,3 +127,6 @@ xeno.eggs_cur++ to_chat(xeno, SPAN_XENONOTICE("You generate a egg. Now sheltering: [xeno.eggs_cur] / [xeno.eggs_max].")) xeno.update_icons() + +#undef EGGSAC_OFF_WEED_EGGCAP +#undef EGGSAC_EGG_SUSTAIN_DISTANCE diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm index f7daee71df38..1fc746829acd 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm @@ -82,7 +82,7 @@ return /datum/behavior_delegate/crusher_charger/on_update_icons() - if(HAS_TRAIT(bound_xeno, TRAIT_CHARGING) && !bound_xeno.lying) + if(HAS_TRAIT(bound_xeno, TRAIT_CHARGING) && bound_xeno.body_position == STANDING_UP) bound_xeno.icon_state = "[bound_xeno.mutation_icon_state || bound_xeno.mutation_type] Crusher Charging" return TRUE @@ -385,8 +385,8 @@ if(HAS_TRAIT(src, TRAIT_CHARGING)) apply_effect(2, WEAKEN) xeno.apply_effect(2, WEAKEN) - src.throw_atom(pick(cardinal),1,3,xeno,TRUE) - xeno.throw_atom(pick(cardinal),1,3,xeno,TRUE) + src.throw_atom(pick(GLOB.cardinals),1,3,xeno,TRUE) + xeno.throw_atom(pick(GLOB.cardinals),1,3,xeno,TRUE) charger_ability.stop_momentum() // We assume the other crusher'sparks handle_charge_collision() kicks in and stuns us too. playsound(get_turf(xeno), 'sound/effects/bang.ogg', 25, 0) return diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm index 303e1c94692d..c11f0e11f399 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm @@ -379,8 +379,8 @@ if(bound_xeno.stat == DEAD) fruit_sac_overlay_icon.icon_state = "Gardener Drone Dead" - else if(bound_xeno.lying) - if((bound_xeno.resting || bound_xeno.sleeping) && (!bound_xeno.knocked_down && !bound_xeno.knocked_out && bound_xeno.health > 0)) + else if(bound_xeno.body_position == LYING_DOWN) + if(!HAS_TRAIT(bound_xeno, TRAIT_INCAPACITATED) && !HAS_TRAIT(bound_xeno, TRAIT_FLOORED)) fruit_sac_overlay_icon.icon_state = "Gardener Drone Sleeping" else fruit_sac_overlay_icon.icon_state = "Gardener Drone Knocked Down" diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm index 5caab38529e6..2e562ceac6a9 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm @@ -160,8 +160,8 @@ if(bound_xeno.stat == DEAD) salve_applied_icon.icon_state = "Healer Drone Dead" - else if(bound_xeno.lying) - if((bound_xeno.resting || bound_xeno.sleeping) && (!bound_xeno.knocked_down && !bound_xeno.knocked_out && bound_xeno.health > 0)) + else if(bound_xeno.body_position == LYING_DOWN) + if(!HAS_TRAIT(bound_xeno, TRAIT_INCAPACITATED) && !HAS_TRAIT(bound_xeno, TRAIT_FLOORED)) salve_applied_icon.icon_state = "Healer Drone Sleeping" else salve_applied_icon.icon_state = "Healer Drone Knocked Down" diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm index ecb0e1eff51e..4beaedf8d6a8 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm @@ -52,14 +52,12 @@ var/tearing_damage = 15 /datum/behavior_delegate/oppressor_praetorian/melee_attack_additional_effects_target(mob/living/carbon/target_carbon) - if(target_carbon.stat == DEAD) return - if(!(target_carbon.knocked_down || HAS_TRAIT(target_carbon, TRAIT_IMMOBILIZED) || target_carbon.slowed)) - return + // impaired in some capacity + if(!(target_carbon.mobility_flags & MOBILITY_STAND) || !(target_carbon.mobility_flags & MOBILITY_MOVE) || target_carbon.slowed) + target_carbon.apply_armoured_damage(get_xeno_damage_slash(target_carbon, tearing_damage), ARMOR_MELEE, BRUTE, bound_xeno.zone_selected ? bound_xeno.zone_selected : "chest") + target_carbon.visible_message(SPAN_DANGER("[bound_xeno] tears into [target_carbon]!")) + playsound(bound_xeno, 'sound/weapons/alien_tail_attack.ogg', 25, TRUE) - target_carbon.apply_armoured_damage(get_xeno_damage_slash(target_carbon, tearing_damage), ARMOR_MELEE, BRUTE, bound_xeno.zone_selected ? bound_xeno.zone_selected : "chest") - target_carbon.visible_message(SPAN_DANGER("[bound_xeno] tears into [target_carbon]!")) - playsound(bound_xeno, 'sound/weapons/alien_tail_attack.ogg', 25, TRUE) - return diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm index 630edf26d353..490e5ca36cba 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm @@ -87,7 +87,7 @@ if(embryo?.stage >= 4) //very late stage hugged in case the runner unnests them return - if(target_mob.lying) + if(target_mob.body_position == LYING_DOWN) modify_acid(acid_slash_regen_lying) return modify_acid(acid_slash_regen_standing) diff --git a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm index 3bfb4e355416..793ed45bcb13 100644 --- a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm +++ b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm @@ -196,7 +196,7 @@ GLOBAL_VAR_INIT(resin_lz_allowed, FALSE) return FALSE var/wall_support = FALSE - for(var/D in cardinal) + for(var/D in GLOB.cardinals) var/turf/CT = get_step(T, D) if(CT) if(CT.density) diff --git a/code/modules/mob/living/carbon/xenomorph/say.dm b/code/modules/mob/living/carbon/xenomorph/say.dm index d1832d10b6fe..a2413b766505 100644 --- a/code/modules/mob/living/carbon/xenomorph/say.dm +++ b/code/modules/mob/living/carbon/xenomorph/say.dm @@ -1,7 +1,7 @@ /mob/living/carbon/xenomorph/say(message) var/verb = "says" var/forced = 0 - var/message_range = world_view_size + var/message_range = GLOB.world_view_size if(client) if(client.prefs.muted & MUTE_IC) diff --git a/code/modules/mob/living/carbon/xenomorph/update_icons.dm b/code/modules/mob/living/carbon/xenomorph/update_icons.dm index 2eb86ac0470e..e576b23e2855 100644 --- a/code/modules/mob/living/carbon/xenomorph/update_icons.dm +++ b/code/modules/mob/living/carbon/xenomorph/update_icons.dm @@ -69,8 +69,8 @@ icon_state = "[mutation_caste_state] Dead" if(!(icon_state in icon_states(icon_xeno))) icon_state = "Normal [caste.caste_type] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[mutation_caste_state] Sleeping" if(!(icon_state in icon_states(icon_xeno))) icon_state = "Normal [caste.caste_type] Sleeping" @@ -93,6 +93,28 @@ update_inv_resource() update_icons() +/* CRUTCH ZONE - Update icons when relevant status happen - Ideally do this properly and for everything, then kill update_icons() someday */ +// set_body_position is needed on addition of floored start/stop because we can be switching between resting and knockeddown +/mob/living/carbon/xenomorph/set_body_position(new_value) + . = ..() + if(. != new_value) + update_icons() // Snowflake handler for xeno resting icons + +/mob/living/carbon/xenomorph/on_floored_start() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_floored_end() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_incapacitated_trait_gain() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_incapacitated_trait_loss() + . = ..() + update_icons() + +/* ^^^^^^^^^^^^^^ End Icon updates */ + /mob/living/carbon/xenomorph/update_inv_pockets() var/datum/custom_hud/alien/ui_datum = GLOB.custom_huds_list[HUD_ALIEN] if(l_store) @@ -142,8 +164,8 @@ var/state_modifier = "" if(stat == DEAD) state_modifier = " Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) state_modifier = " Sleeping" else state_modifier = " Knocked Down" @@ -237,7 +259,7 @@ if(on_fire && fire_reagent) var/image/I if(mob_size >= MOB_SIZE_BIG) - if((!initial(pixel_y) || lying) && !resting && !sleeping) + if((!initial(pixel_y) || body_position != LYING_DOWN)) // what's that pixel_y doing here??? I = image("icon"='icons/mob/xenos/overlay_effects64x64.dmi', "icon_state"="alien_fire", "layer"=-X_FIRE_LAYER) else I = image("icon"='icons/mob/xenos/overlay_effects64x64.dmi', "icon_state"="alien_fire_lying", "layer"=-X_FIRE_LAYER) @@ -278,8 +300,8 @@ if(health > HEALTH_THRESHOLD_DEAD) if(health_threshold > 3) wound_icon_holder.icon_state = "none" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) wound_icon_holder.icon_state = "[caste.caste_type]_rest_[health_threshold]" else wound_icon_holder.icon_state = "[caste.caste_type]_downed_[health_threshold]" @@ -300,7 +322,7 @@ /atom/movable/vis_obj/xeno_pack/Initialize(mapload, mob/living/carbon/source) . = ..() if(source) - icon = default_xeno_onmob_icons[source.type] + icon = GLOB.default_xeno_onmob_icons[source.type] //Xeno Overlays Indexes////////// #undef X_BACK_LAYER diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm index 79f73631c7b1..810c8f58666b 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm @@ -166,7 +166,7 @@ var/total_xeno_playtime = 0 - for(var/caste in RoleAuthority.castes_by_name) + for(var/caste in GLOB.RoleAuthority.castes_by_name) total_xeno_playtime += get_job_playtime(src, caste) total_xeno_playtime += get_job_playtime(src, JOB_XENOMORPH) @@ -187,7 +187,7 @@ var/list/drone_evo_castes = list(XENO_CASTE_DRONE, XENO_CASTE_CARRIER, XENO_CASTE_BURROWER, XENO_CASTE_HIVELORD, XENO_CASTE_QUEEN) - for(var/caste in RoleAuthority.castes_by_name) + for(var/caste in GLOB.RoleAuthority.castes_by_name) if(!(caste in drone_evo_castes)) continue total_drone_playtime += get_job_playtime(src, caste) @@ -198,8 +198,8 @@ /client/proc/get_total_t3_playtime() var/total_t3_playtime = 0 var/datum/caste_datum/caste - for(var/caste_name in RoleAuthority.castes_by_name) - caste = RoleAuthority.castes_by_name[caste_name] + for(var/caste_name in GLOB.RoleAuthority.castes_by_name) + caste = GLOB.RoleAuthority.castes_by_name[caste_name] if(caste.tier < 3) continue total_t3_playtime += get_job_playtime(src, caste_name) @@ -945,12 +945,12 @@ for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) continue - var/datum/job/job = RoleAuthority.roles_for_mode[current_human.job] + var/datum/job/job = GLOB.RoleAuthority.roles_for_mode[current_human.job] if(!job) continue var/turf/turf = get_turf(current_human) if(is_mainship_level(turf?.z)) - shipside_humans_weighted_count += RoleAuthority.calculate_role_weight(job) + shipside_humans_weighted_count += GLOB.RoleAuthority.calculate_role_weight(job) hijack_burrowed_surge = TRUE hijack_burrowed_left = max(n_ceil(shipside_humans_weighted_count * 0.5) - xenos_count, 5) hivecore_cooldown = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_verbs.dm b/code/modules/mob/living/carbon/xenomorph/xeno_verbs.dm index 94218b224e2d..dd722f62df63 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_verbs.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_verbs.dm @@ -81,7 +81,7 @@ set desc = "Toggles the health and plasma HUD appearing above Xenomorphs." set category = "Alien" - var/datum/mob_hud/H = huds[MOB_HUD_XENO_STATUS] + var/datum/mob_hud/H = GLOB.huds[MOB_HUD_XENO_STATUS] if (xeno_mobhud) H.remove_hud_from(usr, usr) else @@ -94,7 +94,7 @@ set desc = "Toggles the HUD that renders various negative status effects inflicted on humans." set category = "Alien" - var/datum/mob_hud/H = huds[MOB_HUD_XENO_HOSTILE] + var/datum/mob_hud/H = GLOB.huds[MOB_HUD_XENO_HOSTILE] if (xeno_hostile_hud) H.remove_hud_from(usr, usr) else diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm index d7edd02893b3..696eaa3f0120 100644 --- a/code/modules/mob/living/init_signals.dm +++ b/code/modules/mob/living/init_signals.dm @@ -1,21 +1,91 @@ /// Called on [/mob/living/Initialize(mapload)], for the mob to register to relevant signals. /mob/living/proc/register_init_signals() + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_KNOCKEDOUT), PROC_REF(on_knockedout_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_KNOCKEDOUT), PROC_REF(on_knockedout_trait_loss)) RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_gain)) RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_INCAPACITATED), PROC_REF(on_incapacitated_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_INCAPACITATED), PROC_REF(on_incapacitated_trait_loss)) + RegisterSignal(src, list(SIGNAL_ADDTRAIT(TRAIT_UNDENSE), SIGNAL_REMOVETRAIT(TRAIT_UNDENSE)), PROC_REF(undense_changed)) +/// Called when [TRAIT_KNOCKEDOUT] is added to the mob. +/mob/living/proc/on_knockedout_trait_gain(datum/source) + SIGNAL_HANDLER + if(stat < UNCONSCIOUS) + set_stat(UNCONSCIOUS) + +/// Called when [TRAIT_KNOCKEDOUT] is removed from the mob. +/mob/living/proc/on_knockedout_trait_loss(datum/source) + SIGNAL_HANDLER + if(stat <= UNCONSCIOUS) + update_stat() + /// Called when [TRAIT_IMMOBILIZED] is added to the mob. /mob/living/proc/on_immobilized_trait_gain(datum/source) SIGNAL_HANDLER -// mobility_flags &= ~MOBILITY_MOVE - update_canmove() + mobility_flags &= ~MOBILITY_MOVE /// Called when [TRAIT_IMMOBILIZED] is removed from the mob. /mob/living/proc/on_immobilized_trait_loss(datum/source) SIGNAL_HANDLER -// mobility_flags |= MOBILITY_MOVE - update_canmove() + mobility_flags |= MOBILITY_MOVE + +/// Called when [TRAIT_FLOORED] is added to the mob. +/mob/living/proc/on_floored_trait_gain(datum/source) + SIGNAL_HANDLER + if(buckled && buckled.buckle_lying != NO_BUCKLE_LYING) + return // Handled by the buckle. + if(HAS_TRAIT(src, TRAIT_FORCED_STANDING)) + return // Don't go horizontal if mob has forced standing trait. + mobility_flags &= ~MOBILITY_STAND + on_floored_start() + + +/// Called when [TRAIT_FLOORED] is removed from the mob. +/mob/living/proc/on_floored_trait_loss(datum/source) + SIGNAL_HANDLER + mobility_flags |= MOBILITY_STAND + on_floored_end() + +/// Called when [TRAIT_FORCED_STANDING] is added to the mob. +/mob/living/proc/on_forced_standing_trait_gain(datum/source) + SIGNAL_HANDLER + + set_body_position(STANDING_UP) + set_lying_angle(0) + +/// Called when [TRAIT_FORCED_STANDING] is removed from the mob. +/mob/living/proc/on_forced_standing_trait_loss(datum/source) + SIGNAL_HANDLER + + if(HAS_TRAIT(src, TRAIT_FLOORED)) + on_fall() + set_lying_down() + else if(resting) + set_lying_down() + +/// Called when [TRAIT_INCAPACITATED] is added to the mob. +/mob/living/proc/on_incapacitated_trait_gain(datum/source) + SIGNAL_HANDLER + //add_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), TRAIT_INCAPACITATED) + //update_appearance() + return + +/// Called when [TRAIT_INCAPACITATED] is removed from the mob. +/mob/living/proc/on_incapacitated_trait_loss(datum/source) + SIGNAL_HANDLER + //remove_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), TRAIT_INCAPACITATED) + //update_appearance() + return /// Called when [TRAIT_UNDENSE] is gained or lost /mob/living/proc/undense_changed(datum/source) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 9f01b8037e0f..6205c4f919a4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -34,11 +34,6 @@ QDEL_NULL(stamina) QDEL_NULL(hallucinations) -//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually -//affects them once clothing is factored in. ~Errorage -/mob/living/proc/calculate_affecting_pressure(pressure) - return - /mob/living/proc/initialize_pain() pain = new /datum/pain(src) @@ -151,6 +146,8 @@ return /mob/living/Move(NewLoc, direct) + if(lying_angle != 0) + lying_angle_on_movement(direct) if (buckled && buckled.loc != NewLoc) //not updating position if (!buckled.anchored) return buckled.Move(NewLoc, direct) @@ -454,16 +451,170 @@ for(var/h in src.hud_possible) src.clone.hud_list[h].icon_state = src.hud_list[h].icon_state +// Note that this might CLASH with handle_regular_status_updates until it is ELIMINATED +// and everything is switched from updates to signaling - due to not accounting for all cases. +// If this proc causes issues you can probably disable it until then. +/mob/living/carbon/update_stat() + if(stat != DEAD) + if(health <= HEALTH_THRESHOLD_DEAD) + death() + return + else if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) + set_stat(UNCONSCIOUS) + else + set_stat(CONSCIOUS) + /mob/living/set_stat(new_stat) . = ..() if(isnull(.)) return - switch(.) + + switch(.) //Previous stat. + if(CONSCIOUS) + if(stat >= UNCONSCIOUS) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) + add_traits(list(/*TRAIT_HANDS_BLOCKED, */ TRAIT_INCAPACITATED, TRAIT_FLOORED), STAT_TRAIT) + if(UNCONSCIOUS) + if(stat >= UNCONSCIOUS) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) //adding trait sources should come before removing to avoid unnecessary updates if(DEAD) SEND_SIGNAL(src, COMSIG_MOB_STAT_SET_ALIVE) - switch(stat) +// remove_from_dead_mob_list() +// add_to_alive_mob_list() + + switch(stat) //Current stat. + if(CONSCIOUS) + if(. >= UNCONSCIOUS) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) + remove_traits(list(/*TRAIT_HANDS_BLOCKED, */ TRAIT_INCAPACITATED, TRAIT_FLOORED, /*TRAIT_CRITICAL_CONDITION*/), STAT_TRAIT) + if(UNCONSCIOUS) + if(. >= UNCONSCIOUS) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) if(DEAD) SEND_SIGNAL(src, COMSIG_MOB_STAT_SET_DEAD) +// REMOVE_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT) +// remove_from_alive_mob_list() +// add_to_dead_mob_list() + +/** + * Changes the inclination angle of a mob, used by humans and others to differentiate between standing up and prone positions. + * + * In BYOND-angles 0 is NORTH, 90 is EAST, 180 is SOUTH and 270 is WEST. + * This usually means that 0 is standing up, 90 and 270 are horizontal positions to right and left respectively, and 180 is upside-down. + * Mobs that do now follow these conventions due to unusual sprites should require a special handling or redefinition of this proc, due to the density and layer changes. + * The return of this proc is the previous value of the modified lying_angle if a change was successful (might include zero), or null if no change was made. + */ +/mob/living/proc/set_lying_angle(new_lying, on_movement = FALSE) + if(new_lying == lying_angle) + return + . = lying_angle + lying_angle = new_lying + if(lying_angle != lying_prev) + update_transform(instant_update = on_movement) // Don't use transition for eg. crawling movement, because we already have the movement glide + lying_prev = lying_angle + +///Called by mob Move() when the lying_angle is different than zero, to better visually simulate crawling. +/mob/living/proc/lying_angle_on_movement(direct) + if(direct & EAST) + set_lying_angle(90, on_movement = TRUE) + else if(direct & WEST) + set_lying_angle(270, on_movement = TRUE) + +///Reports the event of the change in value of the buckled variable. +/mob/living/proc/set_buckled(new_buckled) + if(new_buckled == buckled) + return + SEND_SIGNAL(src, COMSIG_LIVING_SET_BUCKLED, new_buckled) + . = buckled + buckled = new_buckled + if(buckled) +// if(!HAS_TRAIT(buckled, TRAIT_NO_IMMOBILIZE)) +// ADD_TRAIT(src, TRAIT_IMMOBILIZED, BUCKLED_TRAIT) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, BUCKLED_TRAIT) + switch(buckled.buckle_lying) + if(NO_BUCKLE_LYING) // The buckle doesn't force a lying angle. + REMOVE_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + if(0) // Forcing to a standing position. + REMOVE_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + set_body_position(STANDING_UP) + set_lying_angle(0) + else // Forcing to a lying position. + ADD_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + set_body_position(LYING_DOWN) + set_lying_angle(buckled.buckle_lying) + else + remove_traits(list(TRAIT_IMMOBILIZED, TRAIT_FLOORED), BUCKLED_TRAIT) + if(.) // We unbuckled from something. + //var/atom/movable/old_buckled = . + var/obj/old_buckled = . // /tg/ code has buckling defined on /atom/movable - consider refactoring this sometime + if(old_buckled.buckle_lying == 0 && (resting || HAS_TRAIT(src, TRAIT_FLOORED))) // The buckle forced us to stay up (like a chair) + set_lying_down() // We want to rest or are otherwise floored, so let's drop on the ground. + +/mob/living/proc/get_up(instant = FALSE) // arg ignored +// set waitfor = FALSE +// if(!instant && !do_after(src, 1 SECONDS, src, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM), extra_checks = CALLBACK(src, TYPE_PROC_REF(/mob/living, rest_checks_callback)), interaction_key = DOAFTER_SOURCE_GETTING_UP)) +// return + if(resting || body_position == STANDING_UP || HAS_TRAIT(src, TRAIT_FLOORED)) + return + set_body_position(STANDING_UP) + set_lying_angle(0) + +/// Change the [body_position] to [LYING_DOWN] and update associated behavior. +/mob/living/proc/set_lying_down(new_lying_angle) + set_body_position(LYING_DOWN) + +/// Proc to append behavior related to lying down. +/mob/living/proc/on_lying_down(new_lying_angle) +// if(layer == initial(layer)) //to avoid things like hiding larvas. +// layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs + add_traits(list(/*TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED,*/ TRAIT_UNDENSE), LYING_DOWN_TRAIT) + if(HAS_TRAIT(src, TRAIT_FLOORED) && !(dir & (NORTH|SOUTH))) + setDir(pick(NORTH, SOUTH)) // We are and look helpless. +// if(rotate_on_lying) +// body_position_pixel_y_offset = PIXEL_Y_OFFSET_LYING + + // CM legacy canmove procs, replace this with signal procs probably + drop_l_hand() + drop_r_hand() + add_temp_pass_flags(PASS_MOB_THRU) + //so mob lying always appear behind standing mobs, but dead ones appear behind living ones + if(pulledby && pulledby.grab_level == GRAB_CARRY) + layer = ABOVE_MOB_LAYER + else if (stat == DEAD) + layer = LYING_DEAD_MOB_LAYER // Dead mobs should layer under living ones + else if(layer == initial(layer)) //to avoid things like hiding larvas. + layer = LYING_LIVING_MOB_LAYER + +/// Called when mob changes from a standing position into a prone while lacking the ability to stand up at the moment. +/mob/living/proc/on_fall() + return + +/// Changes the value of the [living/body_position] variable. Call this before set_lying_angle() +/mob/living/proc/set_body_position(new_value) + if(body_position == new_value) + return + if((new_value == LYING_DOWN) && !(mobility_flags & MOBILITY_LIEDOWN)) + return + . = body_position + body_position = new_value + SEND_SIGNAL(src, COMSIG_LIVING_SET_BODY_POSITION, new_value, .) + if(new_value == LYING_DOWN) // From standing to lying down. + on_lying_down() + else // From lying down to standing up. + on_standing_up() + +/// Proc to append behavior related to lying down. +/mob/living/proc/on_standing_up() + //if(layer == LYING_MOB_LAYER) + // layer = initial(layer) + remove_traits(list(/*TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED,*/ TRAIT_UNDENSE), LYING_DOWN_TRAIT) + // Make sure it doesn't go out of the southern bounds of the tile when standing. + //body_position_pixel_y_offset = get_pixel_y_offset_standing(current_size) + // CM stuff below + remove_temp_pass_flags(PASS_MOB_THRU) + if(layer == LYING_DEAD_MOB_LAYER || layer == LYING_LIVING_MOB_LAYER) + layer = initial(layer) + /// Uses presence of [TRAIT_UNDENSE] to figure out what is the correct density state for the mob. Triggered by trait signal. /mob/living/proc/update_density() @@ -471,3 +622,40 @@ set_density(FALSE) else set_density(TRUE) + +/// Proc to append behavior to the condition of being floored. Called when the condition starts. +/mob/living/proc/on_floored_start() + if(body_position == STANDING_UP) //force them on the ground + set_body_position(LYING_DOWN) + set_lying_angle(pick(90, 270), on_movement = TRUE) +// on_fall() + + +/// Proc to append behavior to the condition of being floored. Called when the condition ends. +/mob/living/proc/on_floored_end() + if(!resting) + get_up() + + +/mob/living/update_transform(instant_update = FALSE) + var/visual_angle = lying_angle + if(!rotate_on_lying) + return + var/matrix/base = matrix() + if(pulledby && pulledby.grab_level >= GRAB_CARRY) + visual_angle = 90 // CM code - for fireman carry + if(instant_update) + apply_transform(base.Turn(visual_angle)) + else + apply_transform(base.Turn(visual_angle), UPDATE_TRANSFORM_ANIMATION_TIME) + + +// legacy procs +/mob/living/put_in_l_hand(obj/item/W) + if(body_position == LYING_DOWN) + return + return ..() +/mob/living/put_in_r_hand(obj/item/W) + if(body_position == LYING_DOWN) + return + return ..() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 97d71fcb4e8e..ce4634a102fc 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -14,6 +14,18 @@ var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot. var/halloss = 0 //Hallucination damage. 'Fake' damage obtained through hallucinating or the holodeck. Sleeping should cause it to wear off. + // please don't use these + VAR_PROTECTED/knocked_out = 0 + VAR_PROTECTED/knocked_down = 0 + VAR_PROTECTED/stunned = 0 + var/dazed = 0 + var/slowed = 0 // X_SLOW_AMOUNT + var/superslowed = 0 // X_SUPERSLOW_AMOUNT + var/sleeping = 0 + + /// Cooldown for manually toggling resting to avoid spamming + COOLDOWN_DECLARE(rest_cooldown) + var/hallucination = 0 //Directly affects how long a mob will hallucinate for var/list/atom/hallucinations = list() //A list of hallucinated people that try to attack the mob. See /obj/effect/fake_attacker in hallucinations.dm @@ -99,7 +111,6 @@ var/current_weather_effect_type - var/slash_verb = "attack" var/slashes_verb = "attacks" @@ -111,10 +122,15 @@ /// This is what the value is changed to when the mob dies. Actual BMV definition in atom/movable. var/dead_black_market_value = 0 - var/dazed = 0 - var/knocked_out = 0 - var/stunned = 0 - var/knocked_down = 0 - var/slowed = 0 // X_SLOW_AMOUNT - var/superslowed = 0 // X_SUPERSLOW_AMOUNT - var/sleeping = 0 + /// Variable to track the body position of a mob, regardgless of the actual angle of rotation (usually matching it, but not necessarily). + var/body_position = STANDING_UP + /// Number of degrees of rotation of a mob. 0 means no rotation, up-side facing NORTH. 90 means up-side rotated to face EAST, and so on. + VAR_PROTECTED/lying_angle = 0 + /// Value of lying lying_angle before last change. TODO: Remove the need for this. + var/lying_prev = 0 + /// Does the mob rotate when lying + var/rotate_on_lying = FALSE + + /// Flags that determine the potential of a mob to perform certain actions. Do not change this directly. + var/mobility_flags = MOBILITY_FLAGS_DEFAULT + diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 3a96400ade6a..e4c9659db827 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -86,6 +86,7 @@ VAR_PROTECTED/stun_timer = TIMER_ID_NULL /mob/living/proc/stun_callback() + REMOVE_TRAIT(src, TRAIT_INCAPACITATED, STUNNED_TRAIT) stunned = 0 handle_regular_status_updates(FALSE) if(stun_timer != TIMER_ID_NULL) @@ -93,9 +94,14 @@ stun_timer = TIMER_ID_NULL /mob/living/proc/stun_callback_check() + if(stunned) + ADD_TRAIT(src, TRAIT_INCAPACITATED, STUNNED_TRAIT) if(stunned && stunned < recovery_constant) stun_timer = addtimer(CALLBACK(src, PROC_REF(stun_callback)), (stunned/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) return + if(!stunned) // Force reset since the timer wasn't called + stun_callback() + return if(stun_timer != TIMER_ID_NULL) deltimer(stun_timer) @@ -172,15 +178,23 @@ VAR_PRIVATE/knocked_down_timer /mob/living/proc/knocked_down_callback() + remove_traits(list(TRAIT_FLOORED, TRAIT_INCAPACITATED), KNOCKEDDOWN_TRAIT) knocked_down = 0 handle_regular_status_updates(FALSE) knocked_down_timer = null /mob/living/proc/knocked_down_callback_check() + if(knocked_down) + add_traits(list(TRAIT_FLOORED, TRAIT_INCAPACITATED), KNOCKEDDOWN_TRAIT) + if(knocked_down && knocked_down < recovery_constant) knocked_down_timer = addtimer(CALLBACK(src, PROC_REF(knocked_down_callback)), (knocked_down/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) // times whatever amount we have per tick return + if(!knocked_down) // Force reset since the timer wasn't called + knocked_down_callback() + return + if(knocked_down_timer) deltimer(knocked_down_timer) knocked_down_timer = null @@ -192,11 +206,14 @@ return /mob/living/proc/knocked_out_callback() + REMOVE_TRAIT(src, TRAIT_KNOCKEDOUT, KNOCKEDOUT_TRAIT) knocked_out = 0 handle_regular_status_updates(FALSE) knocked_out_timer = null /mob/living/proc/knocked_out_callback_check() + if(knocked_out) + ADD_TRAIT(src, TRAIT_KNOCKEDOUT, KNOCKEDOUT_TRAIT) if(knocked_out && knocked_out < recovery_constant) knocked_out_timer = addtimer(CALLBACK(src, PROC_REF(knocked_out_callback)), (knocked_out/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) // times whatever amount we have per tick return @@ -219,7 +236,6 @@ knocked_down_callback_check() return - /mob/living/proc/SetKnockDown(amount) if(status_flags & CANKNOCKDOWN) knocked_down = max(amount,0) @@ -362,12 +378,6 @@ to_chat(src, SPAN_WARNING("You start hearing things again!")) SEND_SIGNAL(src, COMSIG_MOB_REGAINED_HEARING) - - - - - - // heal ONE limb, organ gets randomly selected from damaged ones. /mob/living/proc/heal_limb_damage(brute, burn) apply_damage(-brute, BRUTE) @@ -491,14 +501,13 @@ return if(stat >= UNCONSCIOUS) return + face_dir(direction) return ..() -/mob/living/is_laid_down() - if(knocked_down || knocked_out) - return TRUE - return ..() - -/mob/living/is_mob_incapacitated(ignore_restrained) - if(stunned || knocked_down || knocked_out) - return TRUE - return ..() +// Transition handlers. do NOT use this. I mean seriously don't. It's broken. Players love their broken behaviors. +/mob/living/proc/GetStunValueNotADurationDoNotUse() + return stunned +/mob/living/proc/GetKnockDownValueNotADurationDoNotUse() + return knocked_down +/mob/living/proc/GetKnockOutValueNotADurationDoNotUse() + return knocked_out diff --git a/code/modules/mob/living/living_helpers.dm b/code/modules/mob/living/living_helpers.dm index 7650995f102c..8d5a469c1b4d 100644 --- a/code/modules/mob/living/living_helpers.dm +++ b/code/modules/mob/living/living_helpers.dm @@ -23,7 +23,7 @@ return if(!direction) - direction = pick(alldirs) + direction = pick(GLOB.alldirs) var/turf/target_turf = get_turf(src) var/turf/temporary_turf = get_turf(src) diff --git a/code/modules/mob/living/living_verbs.dm b/code/modules/mob/living/living_verbs.dm index 77b996ff6bb0..45f5a25fce2c 100644 --- a/code/modules/mob/living/living_verbs.dm +++ b/code/modules/mob/living/living_verbs.dm @@ -163,7 +163,7 @@ return //breaking out of handcuffs & putting out fires - if(canmove && !knocked_down) + if(!is_mob_incapacitated(TRUE)) if(on_fire) resist_fire() @@ -179,7 +179,7 @@ if(!iscarbon(src)) return var/mob/living/carbon/C = src - if((C.handcuffed || C.legcuffed) && C.canmove && (C.last_special <= world.time)) + if((C.handcuffed || C.legcuffed) && (C.mobility_flags & MOBILITY_MOVE) && (C.last_special <= world.time)) resist_restraints() /mob/living/proc/resist_buckle() diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 45eb43c91773..36ae23587a28 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -1,4 +1,4 @@ -var/list/department_radio_keys = list( +GLOBAL_LIST_INIT(department_radio_keys, list( ":i" = RADIO_CHANNEL_INTERCOM, ".i" = RADIO_CHANNEL_INTERCOM, "#i" = RADIO_CHANNEL_INTERCOM, ":h" = RADIO_CHANNEL_DEPARTMENT, ".h" = RADIO_CHANNEL_DEPARTMENT, "#h" = RADIO_CHANNEL_DEPARTMENT, ":w" = RADIO_MODE_WHISPER, ".w" = RADIO_MODE_WHISPER, "#w" = RADIO_MODE_WHISPER, @@ -49,18 +49,18 @@ var/list/department_radio_keys = list( ":K" = SQUAD_SOF, ".K" = SQUAD_SOF, "#K" = RADIO_CHANNEL_WY_WO, ":Q" = RADIO_CHANNEL_ROYAL_MARINE, ".Q" = RADIO_CHANNEL_ROYAL_MARINE, ":R" = RADIO_CHANNEL_PROVOST, ".R" = RADIO_CHANNEL_PROVOST, "#R" = RADIO_CHANNEL_PROVOST, -) +)) /proc/channel_to_prefix(channel) var/channel_key - for(var/key in department_radio_keys) - if(department_radio_keys[key] == channel) + for(var/key in GLOB.department_radio_keys) + if(GLOB.department_radio_keys[key] == channel) channel_key = key break return channel_key /proc/prefix_to_channel(prefix) - return department_radio_keys[prefix] + return GLOB.department_radio_keys[prefix] ///Shows custom speech bubbles for screaming, *warcry etc. /mob/living/proc/show_speech_bubble(bubble_name, bubble_type = bubble_icon) @@ -76,7 +76,7 @@ var/list/department_radio_keys = list( /mob/living/proc/remove_speech_bubble(mutable_appearance/speech_bubble, list_of_mobs) overlays -= speech_bubble -/mob/living/say(message, datum/language/speaking = null, verb="says", alt_name="", italics=0, message_range = world_view_size, sound/speech_sound, sound_vol, nolog = 0, message_mode = null, bubble_type = bubble_icon) +/mob/living/say(message, datum/language/speaking = null, verb="says", alt_name="", italics=0, message_range = GLOB.world_view_size, sound/speech_sound, sound_vol, nolog = 0, message_mode = null, bubble_type = bubble_icon) var/turf/T if(SEND_SIGNAL(src, COMSIG_LIVING_SPEAK, message, speaking, verb, alt_name, italics, message_range, speech_sound, sound_vol, nolog, message_mode) & COMPONENT_OVERRIDE_SPEAK) return diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index cf734a09ae0d..6782e3174579 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1,8 +1,8 @@ #define AI_CHECK_WIRELESS 1 #define AI_CHECK_RADIO 2 -var/list/ai_list = list() -var/list/ai_verbs_default = list( +GLOBAL_LIST_EMPTY(ai_list) +GLOBAL_LIST_INIT(ai_verbs_default, list( /mob/living/silicon/ai/proc/ai_alerts, /mob/living/silicon/ai/proc/ai_announcement, // /mob/living/silicon/ai/proc/ai_recall_shuttle, @@ -17,7 +17,7 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/proc/pick_icon, /mob/living/silicon/ai/proc/sensor_mode, /mob/living/silicon/ai/proc/toggle_acceleration -) +)) //mob/living/silicon/ai/proc/ai_hologram_change, @@ -30,7 +30,7 @@ var/list/ai_verbs_default = list( /proc/AutoUpdateAI(obj/subject) var/is_in_use = 0 if (subject!=null) - for(var/A in ai_list) + for(var/A in GLOB.ai_list) var/mob/living/silicon/ai/M = A if ((M.client && M.interactee == subject)) is_in_use = 1 @@ -82,17 +82,17 @@ var/list/ai_verbs_default = list( var/datum/announcement/priority/announcement /mob/living/silicon/ai/proc/add_ai_verbs() - add_verb(src, ai_verbs_default) + add_verb(src, GLOB.ai_verbs_default) /mob/living/silicon/ai/proc/remove_ai_verbs() - remove_verb(src, ai_verbs_default) + remove_verb(src, GLOB.ai_verbs_default) /mob/living/silicon/ai/New(loc, obj/item/device/mmi/B, safety = 0) - var/list/possibleNames = ai_names + var/list/possibleNames = GLOB.ai_names var/pickedName = null while(!pickedName) - pickedName = pick(ai_names) + pickedName = pick(GLOB.ai_names) for (var/mob/living/silicon/ai/A in GLOB.mob_list) if (A.real_name == pickedName && possibleNames.len > 1) //fixing the theoretically possible infinite loop possibleNames -= pickedName @@ -101,8 +101,8 @@ var/list/ai_verbs_default = list( // aiPDA = new/obj/item/device/pda/ai(src) SetName(pickedName) anchored = TRUE - canmove = 0 - density = TRUE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) + set_density(TRUE) forceMove(loc) holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) @@ -143,12 +143,12 @@ var/list/ai_verbs_default = list( spawn(5) new /obj/structure/machinery/ai_powersupply(src) - ai_list += src + GLOB.ai_list += src ..() return /mob/living/silicon/ai/Destroy() - ai_list -= src + GLOB.ai_list -= src QDEL_NULL(aiMulti) if(aiRadio) aiRadio.myAi = null @@ -315,7 +315,7 @@ var/list/ai_verbs_default = list( unset_interaction() src << browse(null, t1) if (href_list["switchcamera"]) - switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras + switchCamera(locate(href_list["switchcamera"])) in GLOB.cameranet.cameras if (href_list["showalerts"]) ai_alerts() //Carn: holopad requests @@ -422,11 +422,11 @@ var/list/ai_verbs_default = list( var/mob/living/silicon/ai/U = usr - for (var/obj/structure/machinery/camera/C in cameranet.cameras) + for (var/obj/structure/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use()) continue - var/list/tempnetwork = difflist(C.network,RESTRICTED_CAMERA_NETWORKS,1) + var/list/tempnetwork = difflist(C.network,GLOB.RESTRICTED_CAMERA_NETWORKS,1) if(tempnetwork.len) for(var/i in tempnetwork) cameralist[i] = i @@ -440,7 +440,7 @@ var/list/ai_verbs_default = list( if(isnull(network)) network = old_network // If nothing is selected else - for(var/obj/structure/machinery/camera/C in cameranet.cameras) + for(var/obj/structure/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use()) continue if(network in C.network) @@ -458,7 +458,7 @@ var/list/ai_verbs_default = list( var/list/ai_emotions = list("Very Happy", "Happy", "Neutral", "Unsure", "Confused", "Surprised", "Sad", "Upset", "Angry", "Awesome", "BSOD", "Blank", "Problems?", "Facepalm", "Friend Computer") var/emote = tgui_input_list(usr, "Please, select a status!", "AI Status", ai_emotions) - for (var/obj/structure/machinery/M in machines) //change status + for (var/obj/structure/machinery/M in GLOB.machines) //change status if(istype(M, /obj/structure/machinery/ai_status_display)) var/obj/structure/machinery/ai_status_display/AISD = M AISD.emotion = emote diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index 19a6267518c3..1555fc9c2b7b 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -13,7 +13,7 @@ if(explosive) addtimer(CALLBACK(src, PROC_REF(explosion), src.loc, 3, 6, 12, 15), 10) - for(var/obj/structure/machinery/ai_status_display/O in machines) + for(var/obj/structure/machinery/ai_status_display/O in GLOB.machines) spawn( 0 ) O.mode = 2 if (istype(loc, /obj/item/device/aicard)) diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index d6eb167e1677..808ad653b73c 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -2,7 +2,7 @@ // // The datum containing all the chunks. -var/datum/cameranet/cameranet = new() +GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new()) /datum/cameranet // The cameras on the map, no matter if they work or not. Updated in obj/structure/machinery/camera/New() and Dispose(). @@ -142,7 +142,7 @@ var/datum/cameranet/cameranet = new() /turf/verb/view_chunk() set src in world - if(cameranet.chunkGenerated(x, y, z)) - var/datum/camerachunk/chunk = cameranet.getCameraChunk(x, y, z) + if(GLOB.cameranet.chunkGenerated(x, y, z)) + var/datum/camerachunk/chunk = GLOB.cameranet.getCameraChunk(x, y, z) usr.client.debug_variables(chunk) */ diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 5fe03ffa272c..22e2bf05aa2c 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -30,7 +30,7 @@ T = get_turf(T) forceMove(T) - cameranet.visibility(src) + GLOB.cameranet.visibility(src) if(ai.client) ai.client.eye = src //Holopad diff --git a/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm b/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm index a7109f491740..7ecaab1c3e79 100644 --- a/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm +++ b/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm @@ -9,47 +9,47 @@ /turf/proc/visibilityChanged() if(z && SSatoms.initialized != INITIALIZATION_INSSATOMS) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) /obj/structure/machinery/door/poddoor/shutters/open() if(z && SSatoms.initialized != INITIALIZATION_INSSATOMS) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) . = ..() /obj/structure/machinery/door/poddoor/shutters/close() if(z && SSatoms.initialized != INITIALIZATION_INSSATOMS) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) . = ..() /obj/structure/machinery/door/poddoor/shutters/Destroy() if(z && SSatoms.initialized != INITIALIZATION_INSSATOMS) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) . = ..() // STRUCTURES /obj/structure/Destroy(force) if(z && SSatoms.initialized != INITIALIZATION_INSSATOMS) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) . = ..() /obj/structure/Initialize(mapload, ...) . = ..() if(z && SSatoms.initialized != INITIALIZATION_INSSATOMS) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) // EFFECTS /obj/effect/Destroy() if(z && SSatoms.initialized != INITIALIZATION_INSSATOMS) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) . = ..() /obj/effect/Initialize(mapload, ...) . = ..() if(z && SSatoms.initialized != INITIALIZATION_INSSATOMS) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) @@ -68,7 +68,7 @@ updating = 1 spawn(BORG_CAMERA_BUFFER) if(oldLoc != src.loc) - cameranet.updatePortableCamera(src.camera) + GLOB.cameranet.updatePortableCamera(src.camera) updating = 0 /mob/living/carbon/human/var/updating = 0 @@ -85,7 +85,7 @@ updating = TRUE spawn(BORG_CAMERA_BUFFER) if (oldLoc != loc) - cameranet.updatePortableCamera(H.camera) + GLOB.cameranet.updatePortableCamera(H.camera) updating = FALSE // CAMERA @@ -95,23 +95,23 @@ /obj/structure/machinery/camera/toggle_cam_status(mob/user, silent) ..() if(can_use()) - cameranet.addCamera(src) + GLOB.cameranet.addCamera(src) else set_light(0) - cameranet.removeCamera(src) + GLOB.cameranet.removeCamera(src) /obj/structure/machinery/camera/Initialize() . = ..() - cameranet.cameras += src //Camera must be added to global list of all cameras no matter what... - var/list/open_networks = difflist(network,RESTRICTED_CAMERA_NETWORKS) //...but if all of camera's networks are restricted, it only works for specific camera consoles. + GLOB.cameranet.cameras += src //Camera must be added to global list of all cameras no matter what... + var/list/open_networks = difflist(network,GLOB.RESTRICTED_CAMERA_NETWORKS) //...but if all of camera's networks are restricted, it only works for specific camera consoles. if(open_networks.len) //If there is at least one open network, chunk is available for AI usage. - cameranet.addCamera(src) + GLOB.cameranet.addCamera(src) /obj/structure/machinery/camera/Destroy() - cameranet.cameras -= src - var/list/open_networks = difflist(network,RESTRICTED_CAMERA_NETWORKS) + GLOB.cameranet.cameras -= src + var/list/open_networks = difflist(network,GLOB.RESTRICTED_CAMERA_NETWORKS) if(open_networks.len) - cameranet.removeCamera(src) + GLOB.cameranet.removeCamera(src) . = ..() //#undef BORG_CAMERA_BUFFER diff --git a/code/modules/mob/living/silicon/ai/login.dm b/code/modules/mob/living/silicon/ai/login.dm index 91bcd76b2eb5..7a8d6ba9585f 100644 --- a/code/modules/mob/living/silicon/ai/login.dm +++ b/code/modules/mob/living/silicon/ai/login.dm @@ -3,7 +3,7 @@ regenerate_icons() if(stat != DEAD) - for(var/obj/structure/machinery/ai_status_display/O in machines) //change status + for(var/obj/structure/machinery/ai_status_display/O in GLOB.machines) //change status O.mode = 1 O.emotion = "Neutral" src.view_core() diff --git a/code/modules/mob/living/silicon/ai/logout.dm b/code/modules/mob/living/silicon/ai/logout.dm index efc03f575ec8..62964915c33a 100644 --- a/code/modules/mob/living/silicon/ai/logout.dm +++ b/code/modules/mob/living/silicon/ai/logout.dm @@ -1,6 +1,6 @@ /mob/living/silicon/ai/Logout() ..() - for(var/obj/structure/machinery/ai_status_display/O in machines) //change status + for(var/obj/structure/machinery/ai_status_display/O in GLOB.machines) //change status O.mode = 0 if(!isturf(loc)) if (client) diff --git a/code/modules/mob/living/silicon/decoy/decoy.dm b/code/modules/mob/living/silicon/decoy/decoy.dm index b625b19b172d..bc7271554352 100644 --- a/code/modules/mob/living/silicon/decoy/decoy.dm +++ b/code/modules/mob/living/silicon/decoy/decoy.dm @@ -4,7 +4,6 @@ icon = 'icons/obj/structures/machinery/ai.dmi' icon_state = "hydra" anchored = TRUE - canmove = 0 density = TRUE //Do not want to see past it. bound_height = 64 //putting this in so we can't walk through our machine. bound_width = 96 @@ -21,13 +20,14 @@ name = MAIN_AI_SYSTEM desc = "This is the artificial intelligence system for the [MAIN_SHIP_NAME]. Like many other military-grade AI systems, this one was manufactured by Weyland-Yutani." ai_headset = new(src) - ai_mob_list += src + GLOB.ai_mob_list += src real_name = MAIN_AI_SYSTEM + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) /mob/living/silicon/decoy/ship_ai/Destroy() QDEL_NULL(ai_headset) #ifdef UNIT_TESTS - ai_mob_list -= src // Or should we always remove them? + GLOB.ai_mob_list -= src // Or should we always remove them? #endif return ..() @@ -76,7 +76,7 @@ if(length(message) >= 2) var/channel_prefix = copytext(message, 1 ,3) - channel_prefix = department_radio_keys[channel_prefix] + channel_prefix = GLOB.department_radio_keys[channel_prefix] if(channel_prefix) return channel_prefix diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 1fa07ae0bc85..6bb01661fbd5 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -182,7 +182,7 @@ /mob/living/silicon/robot/drone/proc/transfer_personality(client/player) if(!player) return - player.change_view(world_view_size) + player.change_view(GLOB.world_view_size) src.ckey = player.ckey if(player.mob && player.mob.mind) @@ -236,7 +236,7 @@ spawn(0) var/newname - newname = tgui_input_list(src,"You are drone. Pick a name, no duplicates allowed.", "Drone name pick", greek_letters) + newname = tgui_input_list(src,"You are drone. Pick a name, no duplicates allowed.", "Drone name pick", GLOB.greek_letters) if(custom_name) return diff --git a/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm b/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm index 7909ff05f603..261e6ffc7623 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm @@ -4,7 +4,7 @@ set desc = "Tag yourself for delivery through the disposals system." set category = "Drone" - var/new_tag = tgui_input_list(usr, "Select the desired destination.", "Set Mail Tag", null, tagger_locations) + var/new_tag = tgui_input_list(usr, "Select the desired destination.", "Set Mail Tag", null, GLOB.tagger_locations) if(!new_tag) mail_destination = "" diff --git a/code/modules/mob/living/silicon/robot/drone/drone_console.dm b/code/modules/mob/living/silicon/robot/drone/drone_console.dm index 2be09d46da9f..2433720d23c1 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_console.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_console.dm @@ -55,7 +55,7 @@ if (href_list["setarea"]) //Probably should consider using another list, but this one will do. - var/t_area = tgui_input_list(usr, "Select the area to ping.", "Set Target Area", null, tagger_locations) + var/t_area = tgui_input_list(usr, "Select the area to ping.", "Set Target Area", null, GLOB.tagger_locations) if(!t_area) return diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index b0230bba5dba..b4a6e59e52e2 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -18,7 +18,6 @@ use_power() process_killswitch() process_locks() - update_canmove() /mob/living/silicon/robot/proc/clamp_values() @@ -79,14 +78,14 @@ death() if (stat != DEAD) //Alive. - if (knocked_out || stunned || knocked_down || !has_power) //Stunned etc. + if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || HAS_TRAIT(src, TRAIT_INCAPACITATED) || !has_power) //Stunned etc. set_stat(UNCONSCIOUS) if(regular_update) - if (src.stunned > 0) + if (HAS_TRAIT(src, TRAIT_INCAPACITATED)) adjust_effect(-1, STUN) - if (src.knocked_down > 0) + if (HAS_TRAIT(src, TRAIT_FLOORED)) adjust_effect(-1, WEAKEN) - if (src.knocked_out > 0) + if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) adjust_effect(-1, PARALYZE) src.blinded = TRUE else @@ -113,8 +112,6 @@ src.ear_damage -= 0.05 src.ear_damage = max(src.ear_damage, 0) - src.density = !( src.lying ) - if ((src.sdisabilities & DISABILITY_BLIND)) src.blinded = TRUE if ((src.sdisabilities & DISABILITY_DEAF)) @@ -271,8 +268,3 @@ to_chat(src, SPAN_DANGER("Weapon Lock Timed Out!")) weapon_lock = 0 weaponlock_time = 120 - -/mob/living/silicon/robot/update_canmove() - if(knocked_out || stunned || knocked_down || buckled || lockcharge || !is_component_functioning("actuator")) canmove = 0 - else canmove = 1 - return canmove diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 4ad29179daec..888b484fab06 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1,6 +1,6 @@ -var/list/robot_verbs_default = list( +GLOBAL_LIST_INIT(robot_verbs_default, list( /mob/living/silicon/robot/proc/sensor_mode -) +)) #define CYBORG_POWER_USAGE_MULTIPLIER 2.5 // Multiplier for amount of power cyborgs use. @@ -840,7 +840,7 @@ var/list/robot_verbs_default = list( cleaned_item.clean_blood() else if(istype(A, /mob/living/carbon/human)) var/mob/living/carbon/human/cleaned_human = A - if(cleaned_human.lying) + if(cleaned_human.body_position == LYING_DOWN) if(cleaned_human.head) cleaned_human.head.clean_blood() cleaned_human.update_inv_head(0) @@ -866,12 +866,12 @@ var/list/robot_verbs_default = list( src.connected_ai = null lawupdate = 0 lockcharge = 0 - canmove = 1 + //canmove = 1 // Yes this will probably break something, whatevver it is scrambledcodes = 1 //Disconnect it's camera so it's not so easily tracked. if(src.camera) src.camera.network = list() - cameranet.removeCamera(src.camera) + GLOB.cameranet.removeCamera(src.camera) /mob/living/silicon/robot/proc/ResetSecurityCodes() @@ -933,10 +933,10 @@ var/list/robot_verbs_default = list( toggle_sensor_mode() /mob/living/silicon/robot/proc/add_robot_verbs() - add_verb(src, robot_verbs_default) + add_verb(src, GLOB.robot_verbs_default) /mob/living/silicon/robot/proc/remove_robot_verbs() - remove_verb(src, robot_verbs_default) + remove_verb(src, GLOB.robot_verbs_default) // Uses power from cyborg's cell. Returns 1 on success or 0 on failure. // Properly converts using CELLRATE now! Amount is in Joules. diff --git a/code/modules/mob/living/silicon/robot/wires.dm b/code/modules/mob/living/silicon/robot/wires.dm index ea09fe5985a4..62d05abe6e13 100644 --- a/code/modules/mob/living/silicon/robot/wires.dm +++ b/code/modules/mob/living/silicon/robot/wires.dm @@ -7,9 +7,9 @@ /proc/RandomBorgWires() //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). var/list/Borgwires = list(0, 0, 0, 0, 0) - BorgIndexToFlag = list(0, 0, 0, 0, 0) - BorgIndexToWireColor = list(0, 0, 0, 0, 0) - BorgWireColorToIndex = list(0, 0, 0, 0, 0) + GLOB.BorgIndexToFlag = list(0, 0, 0, 0, 0) + GLOB.BorgIndexToWireColor = list(0, 0, 0, 0, 0) + GLOB.BorgWireColorToIndex = list(0, 0, 0, 0, 0) var/flagIndex = 1 //I think it's easier to read this way, also doesn't rely on the random number generator to land on a new wire. var/list/colorIndexList = list(BORG_WIRE_LAWCHECK, BORG_WIRE_MAIN_POWER1, BORG_WIRE_MAIN_POWER2, BORG_WIRE_AI_CONTROL, BORG_WIRE_CAMERA) @@ -17,25 +17,25 @@ var/colorIndex = pick(colorIndexList) if (Borgwires[colorIndex]==0) Borgwires[colorIndex] = flag - BorgIndexToFlag[flagIndex] = flag - BorgIndexToWireColor[flagIndex] = colorIndex - BorgWireColorToIndex[colorIndex] = flagIndex + GLOB.BorgIndexToFlag[flagIndex] = flag + GLOB.BorgIndexToWireColor[flagIndex] = colorIndex + GLOB.BorgWireColorToIndex[colorIndex] = flagIndex colorIndexList -= colorIndex // Shortens the list. //world.log << "Flag: [flag], CIndex: [colorIndex], FIndex: [flagIndex]" flagIndex+=1 return Borgwires /mob/living/silicon/robot/proc/isWireColorCut(wireColor) - var/wireFlag = BorgWireColorToFlag[wireColor] + var/wireFlag = GLOB.BorgWireColorToFlag[wireColor] return ((src.borgwires & wireFlag) == 0) /mob/living/silicon/robot/proc/isWireCut(wireIndex) - var/wireFlag = BorgIndexToFlag[wireIndex] + var/wireFlag = GLOB.BorgIndexToFlag[wireIndex] return ((src.borgwires & wireFlag) == 0) /mob/living/silicon/robot/proc/cut(wireColor) - var/wireFlag = BorgWireColorToFlag[wireColor] - var/wireIndex = BorgWireColorToIndex[wireColor] + var/wireFlag = GLOB.BorgWireColorToFlag[wireColor] + var/wireIndex = GLOB.BorgWireColorToIndex[wireColor] borgwires &= ~wireFlag switch(wireIndex) if(BORG_WIRE_LAWCHECK) //Cut the law wire, and the borg will no longer receive law updates from its AI @@ -52,8 +52,8 @@ src.interact(usr) /mob/living/silicon/robot/proc/mend(wireColor) - var/wireFlag = BorgWireColorToFlag[wireColor] - var/wireIndex = BorgWireColorToIndex[wireColor] + var/wireFlag = GLOB.BorgWireColorToFlag[wireColor] + var/wireIndex = GLOB.BorgWireColorToIndex[wireColor] borgwires |= wireFlag switch(wireIndex) if(BORG_WIRE_LAWCHECK) //turns law updates back on assuming the borg hasn't been emagged @@ -67,7 +67,7 @@ /mob/living/silicon/robot/proc/pulse(wireColor) - var/wireIndex = BorgWireColorToIndex[wireColor] + var/wireIndex = GLOB.BorgWireColorToIndex[wireColor] switch(wireIndex) if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh if (src.lawupdate) @@ -96,7 +96,7 @@ "Blue" = 5, ) for(var/wiredesc in Borgwires) - var/is_uncut = src.borgwires & BorgWireColorToFlag[Borgwires[wiredesc]] + var/is_uncut = src.borgwires & GLOB.BorgWireColorToFlag[Borgwires[wiredesc]] t1 += "[wiredesc] wire: " if(!is_uncut) t1 += "Mend" diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 1638b0fb7fbe..7f95e3d695b5 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -148,12 +148,12 @@ var/HUD_nbr = 1 switch(hud_choice) if("Medical HUD") - H = huds[MOB_HUD_MEDICAL_OBSERVER] + H = GLOB.huds[MOB_HUD_MEDICAL_OBSERVER] if("Security HUD") - H = huds[MOB_HUD_SECURITY_ADVANCED] + H = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] HUD_nbr = 2 if("Squad HUD") - H = huds[MOB_HUD_FACTION_USCM] + H = GLOB.huds[MOB_HUD_FACTION_USCM] HUD_nbr = 3 else return diff --git a/code/modules/mob/living/simple_animal/bat.dm b/code/modules/mob/living/simple_animal/bat.dm index a95d97be6e1a..eea7998bda67 100644 --- a/code/modules/mob/living/simple_animal/bat.dm +++ b/code/modules/mob/living/simple_animal/bat.dm @@ -27,4 +27,3 @@ set_stat(CONSCIOUS) icon_state = "bat" wander = 1 - canmove = 1 diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index c10d4f8327a0..268825288198 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -209,8 +209,8 @@ new /mob/living/simple_animal/chicken(src.loc) qdel(src) -var/const/MAX_CHICKENS = 50 -var/global/chicken_count = 0 +GLOBAL_VAR_INIT(MAX_CHICKENS, 50) +GLOBAL_VAR_INIT(chicken_count, 0) /mob/living/simple_animal/chicken name = "\improper chicken" @@ -244,7 +244,7 @@ var/global/chicken_count = 0 icon_dead = "chicken_[body_color]_dead" pixel_x = rand(-6, 6) pixel_y = rand(0, 10) - chicken_count++ + GLOB.chicken_count++ /mob/living/simple_animal/chicken/initialize_pass_flags(datum/pass_flags_container/PF) ..() @@ -253,7 +253,7 @@ var/global/chicken_count = 0 /mob/living/simple_animal/chicken/death() ..() - chicken_count-- + GLOB.chicken_count-- if(last_damage_data) var/mob/user = last_damage_data.resolve_mob() if(user) @@ -282,7 +282,7 @@ var/global/chicken_count = 0 var/obj/item/reagent_container/food/snacks/egg/E = new(get_turf(src)) E.pixel_x = rand(-6,6) E.pixel_y = rand(-6,6) - if(chicken_count < MAX_CHICKENS && prob(10)) + if(GLOB.chicken_count < GLOB.MAX_CHICKENS && prob(10)) START_PROCESSING(SSobj, E) /obj/item/reagent_container/food/snacks/egg/var/amount_grown = 0 diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index fa93399683d8..11064634d498 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -46,7 +46,6 @@ set_stat(CONSCIOUS) icon_state = "mouse_[body_color]" wander = 1 - canmove = 1 else if(prob(5)) INVOKE_ASYNC(src, PROC_REF(emote), "snuffles") diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index f693574349d7..1e1c15d173b7 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -138,7 +138,7 @@ src.mind = M.brainmob.mind src.mind.key = M.brainmob.key src.ckey = M.brainmob.ckey - if(client) client.change_view(world_view_size) + if(client) client.change_view(GLOB.world_view_size) src.name = "Spider-bot ([M.brainmob.name])" /mob/living/simple_animal/spiderbot/proc/explode(cause = "exploding") //When emagged. diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 5e56b0204777..6e8d0b8a2867 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -63,19 +63,19 @@ icon_living = "Normal [caste_name] Running" icon_dead = "Normal [caste_name] Dead" -/mob/living/simple_animal/hostile/alien/update_transform() - if(lying != lying_prev) - lying_prev = lying +/mob/living/simple_animal/hostile/alien/update_transform(instant_update = FALSE) + // TODO: Move all this mess outside of update_transform if(stat == DEAD) icon_state = "Normal [caste_name] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "Normal [caste_name] Sleeping" else icon_state = "Normal [caste_name] Knocked Down" else icon_state = "Normal [caste_name] Running" update_wounds() + return ..() /mob/living/simple_animal/hostile/alien/evaluate_target(mob/living/carbon/target) . = ..() @@ -114,8 +114,8 @@ if(health > HEALTH_THRESHOLD_DEAD) if(health_threshold > 3) wound_icon_holder.icon_state = "none" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) wound_icon_holder.icon_state = "[caste_name]_rest_[health_threshold]" else wound_icon_holder.icon_state = "[caste_name]_downed_[health_threshold]" diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index b47b14f0d1d5..5a5791eb8311 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -125,7 +125,7 @@ if(client) return 0 - if(!stat && canmove) + if(!stat && mobility_flags & MOBILITY_MOVE) switch(stance) if(HOSTILE_STANCE_IDLE) target_mob = FindTarget() @@ -145,9 +145,9 @@ /mob/living/simple_animal/hostile/proc/DestroySurroundings() if(prob(break_stuff_probability)) - for(var/dir in cardinal) // North, South, East, West + for(var/dir in GLOB.cardinals) // North, South, East, West for(var/obj/structure/window/obstacle in get_step(src, dir)) - if(obstacle.dir == reverse_dir[dir]) // So that windows get smashed in the right order + if(obstacle.dir == GLOB.reverse_dir[dir]) // So that windows get smashed in the right order obstacle.attack_animal(src) return var/obj/structure/obstacle = locate(/obj/structure, get_step(src, dir)) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 0f15bd1d8f7b..d1b140305d60 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -54,7 +54,7 @@ var/parrot_sleep_dur = 25 //Same as above, this is the var that physically counts down var/parrot_dam_zone = list("chest", "head", "l_arm", "l_leg", "r_arm", "r_leg") //For humans, select a bodypart to attack - var/parrot_speed = 5 //"Delay in machines ticks between movement." according to byond. Yeah, that's BS but it does directly affect movement. Higher number = slower. + var/parrot_speed = 5 //"Delay in GLOB.machines ticks between movement." according to byond. Yeah, that's BS but it does directly affect movement. Higher number = slower. var/parrot_been_shot = 0 //Parrots get a speed bonus after being shot. This will deincrement every Life() and at 0 the parrot will return to regular speed. var/list/speech_buffer = list() @@ -127,7 +127,7 @@ /mob/living/simple_animal/parrot/Topic(href, href_list) //Can the usr physically do this? - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) return //Is the usr's mob type able to do this? @@ -146,7 +146,7 @@ ears.forceMove(src.loc) ears = null for(var/possible_phrase in speak) - if(copytext(possible_phrase,1,3) in department_radio_keys) + if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys) possible_phrase = copytext(possible_phrase,3,length(possible_phrase)) else to_chat(usr, SPAN_DANGER("There is nothing to remove from its [remove_from].")) @@ -284,7 +284,7 @@ if(client || stat) return //Lets not force players or dead/incap parrots to move - if(!isturf(src.loc) || !canmove || buckled) + if(!isturf(src.loc) || !(mobility_flags & MOBILITY_MOVE) || buckled) return //If it can't move, dont let it move. (The buckled check probably isn't necessary thanks to canmove) @@ -332,7 +332,7 @@ if(prob(50)) useradio = 1 - if(copytext(possible_phrase,1,3) in department_radio_keys) + if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys) possible_phrase = "[useradio?pick(available_channels):""] [copytext(possible_phrase,3,length(possible_phrase)+1)]" //crop out the channel prefix else possible_phrase = "[useradio?pick(available_channels):""] [possible_phrase]" @@ -341,7 +341,7 @@ else //If we have no headset or channels to use, dont try to use any! for(var/possible_phrase in speak) - if(copytext(possible_phrase,1,3) in department_radio_keys) + if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys) possible_phrase = "[copytext(possible_phrase,3,length(possible_phrase)+1)]" //crop out the channel prefix newspeak.Add(possible_phrase) speak = newspeak @@ -363,7 +363,7 @@ //Wander around aimlessly. This will help keep the loops from searches down //and possibly move the mob into a new are in view of something they can use if(prob(90)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinals)) return if(!held_item && !parrot_perch) //If we've got nothing to do... look for something to do. @@ -713,7 +713,7 @@ if(length(message) >= 2) var/channel_prefix = copytext(message, 1 ,3) - message_mode = department_radio_keys[channel_prefix] + message_mode = GLOB.department_radio_keys[channel_prefix] if(copytext(message,1,2) == ":") var/positioncut = 3 @@ -722,7 +722,7 @@ message = capitalize(trim_left(message)) if(message_mode) - if(message_mode in radiochannels) + if(message_mode in GLOB.radiochannels) if(ears && istype(ears,/obj/item/device/radio)) ears.talk_into(src,message, message_mode, verb, null) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 8b1cc1e26be2..3d3a4b491950 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -81,8 +81,8 @@ GLOB.dead_mob_list -= src GLOB.alive_mob_list += src set_stat(CONSCIOUS) - lying = 0 - density = TRUE +// lying = 0 +// density = TRUE reload_fullscreens() return 0 @@ -96,15 +96,14 @@ handle_stunned() handle_knocked_down(TRUE) handle_knocked_out(TRUE) - update_canmove() //Movement if(!client && !stop_automated_movement && wander && !anchored) - if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc. + if(isturf(src.loc) && !resting && !buckled && (mobility_flags & MOBILITY_MOVE)) //This is so it only moves if it's not inside a closet, gentics machine, etc. turns_since_move++ if(turns_since_move >= turns_per_move) if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled - var/move_dir = pick(cardinal) + var/move_dir = pick(GLOB.cardinals) Move(get_step(src, move_dir )) setDir(move_dir) turns_since_move = 0 @@ -361,10 +360,17 @@ ..(message, null, verb, nolog = !ckey) //if the animal has a ckey then it will log the message -/mob/living/simple_animal/update_canmove() +/mob/living/simple_animal/on_immobilized_trait_gain(datum/source) . = ..() - if(!canmove) - stop_moving() + stop_moving() + +/mob/living/simple_animal/on_knockedout_trait_gain(datum/source) + . = ..() + stop_moving() + +/mob/living/simple_animal/on_incapacitated_trait_gain(datum/source) + . = ..() + stop_moving() /mob/living/simple_animal/proc/stop_moving() walk_to(src, 0) // stops us dead in our tracks diff --git a/code/modules/mob/living/simple_animal/slug.dm b/code/modules/mob/living/simple_animal/slug.dm index e09d2c715e54..3f2ceb57b838 100644 --- a/code/modules/mob/living/simple_animal/slug.dm +++ b/code/modules/mob/living/simple_animal/slug.dm @@ -33,7 +33,6 @@ set_stat(CONSCIOUS) icon_state = "slug_movement" wander = 1 - canmove = 1 /mob/living/simple_animal/alien_slug/Initialize() . = ..() diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 3f65e01e917c..839645f1084c 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -1,6 +1,6 @@ /mob/Logout() SEND_SIGNAL(src, COMSIG_MOB_LOGOUT) - nanomanager.user_logout(src) // this is used to clean up (remove) this user's Nano UIs + SSnano.nanomanager.user_logout(src) // this is used to clean up (remove) this user's Nano UIs if(interactee) unset_interaction() GLOB.player_list -= src diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 26139af07eb6..c256f05e74b4 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -54,8 +54,8 @@ if(!faction_group) faction_group = list(faction) - last_mob_gid++ - gid = last_mob_gid + GLOB.last_mob_gid++ + gid = GLOB.last_mob_gid GLOB.mob_list += src if(stat == DEAD) @@ -454,7 +454,7 @@ if(!Adjacent(usr)) return if(!ishuman(M) && !ismonkey(M)) return if(!ishuman(src) && !ismonkey(src)) return - if(M.lying || M.is_mob_incapacitated()) + if(M.is_mob_incapacitated()) return if(M.pulling == src && (M.a_intent & INTENT_GRAB) && M.grab_level == GRAB_AGGRESSIVE) return @@ -693,71 +693,15 @@ note dizziness decrements automatically in the mob's Life() proc. // facing verbs /mob/proc/canface() - if(!canmove) return 0 if(client.moving) return 0 if(stat==2) return 0 if(anchored) return 0 if(monkeyizing) return 0 if(is_mob_restrained()) return 0 + if(HAS_TRAIT(src, TRAIT_INCAPACITATED)) // We allow rotation if simply floored + return FALSE return 1 -//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. -/mob/proc/update_canmove() - var/laid_down = is_laid_down() - - if(laid_down) - lying = TRUE - flags_atom &= ~DIRLOCK - else - lying = FALSE - if(buckled) - if(buckled.buckle_lying) - lying = TRUE - flags_atom &= ~DIRLOCK - else - lying = FALSE - - canmove = !HAS_TRAIT(src, TRAIT_IMMOBILIZED) - - if(isliving(src)) // Temporary I SWEAR. This whole proc is going down - var/mob/living/living = src - if(living.stunned) - canmove = FALSE - - if(!can_crawl && lying) - canmove = FALSE - - if(lying_prev != lying) - if(lying) - ADD_TRAIT(src, TRAIT_UNDENSE, LYING_TRAIT) - add_temp_pass_flags(PASS_MOB_THRU) - drop_l_hand() - drop_r_hand() - SEND_SIGNAL(src, COMSIG_MOB_KNOCKED_DOWN) - else - REMOVE_TRAIT(src, TRAIT_UNDENSE, LYING_TRAIT) - SEND_SIGNAL(src, COMSIG_MOB_GETTING_UP) - remove_temp_pass_flags(PASS_MOB_THRU) - update_transform() - - if(lying) - //so mob lying always appear behind standing mobs, but dead ones appear behind living ones - if(pulledby && pulledby.grab_level == GRAB_CARRY) - layer = ABOVE_MOB_LAYER - else if (stat == DEAD) - layer = LYING_DEAD_MOB_LAYER // Dead mobs should layer under living ones - else if(layer == initial(layer)) //to avoid things like hiding larvas. - layer = LYING_LIVING_MOB_LAYER - else if(layer == LYING_DEAD_MOB_LAYER || layer == LYING_LIVING_MOB_LAYER) - layer = initial(layer) - - SEND_SIGNAL(src, COMSIG_MOB_POST_UPDATE_CANMOVE, canmove, laid_down, lying) - - return canmove - -/mob/proc/is_laid_down() - return (stat || !has_legs() || resting || (status_flags & FAKEDEATH) || (pulledby && pulledby.grab_level >= GRAB_AGGRESSIVE)) - /mob/proc/face_dir(ndir, specific_dir) if(!canface()) return 0 if(dir != ndir) @@ -924,13 +868,13 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/living/proc/handle_knocked_down(bypass_client_check = FALSE) if(knocked_down && (bypass_client_check || client)) - knocked_down = max(knocked_down-1,0) //before you get mad Rockdtben: I done this so update_canmove isn't called multiple times + knocked_down = max(knocked_down-1,0) knocked_down_callback_check() return knocked_down /mob/living/proc/handle_knocked_out(bypass_client_check = FALSE) if(knocked_out && (bypass_client_check || client)) - knocked_out = max(knocked_out-1,0) //before you get mad Rockdtben: I done this so update_canmove isn't called multiple times + knocked_out = max(knocked_out-1,0) knocked_out_callback_check() return knocked_out @@ -1123,6 +1067,9 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/set_stat(new_stat) if(new_stat == stat) return - . = stat //old stat + . = stat stat = new_stat SEND_SIGNAL(src, COMSIG_MOB_STATCHANGE, new_stat, .) + +/mob/proc/update_stat() + return diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index dc107e1bd190..f0e5bc48a855 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -87,9 +87,6 @@ var/exploit_record = "" var/gibbing = FALSE - var/lying = FALSE - var/lying_prev = 0 - var/canmove = 1 var/lastpuke = 0 unacidable = FALSE var/mob_size = MOB_SIZE_HUMAN diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index a234c5962f72..071728195e3f 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -83,21 +83,21 @@ if(GRAB_AGGRESSIVE) progress_aggressive(user, victim) -/obj/item/grab/proc/progress_passive(mob/living/carbon/human/user, mob/victim) + if(user.grab_level >= GRAB_AGGRESSIVE) + ADD_TRAIT(victim, TRAIT_FLOORED, CHOKEHOLD_TRAIT) + +/obj/item/grab/proc/progress_passive(mob/living/carbon/human/user, mob/living/victim) user.grab_level = GRAB_AGGRESSIVE playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) user.visible_message(SPAN_WARNING("[user] has grabbed [victim] aggressively!"), null, null, 5) - victim.update_canmove() -/obj/item/grab/proc/progress_aggressive(mob/living/carbon/human/user, mob/victim) +/obj/item/grab/proc/progress_aggressive(mob/living/carbon/human/user, mob/living/victim) user.grab_level = GRAB_CHOKE playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) user.visible_message(SPAN_WARNING("[user] holds [victim] by the neck and starts choking them!"), null, null, 5) victim.Move(user.loc, get_dir(victim.loc, user.loc)) victim.update_transform(TRUE) - victim.update_canmove() - /obj/item/grab/attack(mob/living/M, mob/living/user) if(M == grabbed_thing) attack_self(user) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4b8aadfad85b..5d1baac3a534 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -29,7 +29,7 @@ //TODO: Integrate defence zones and targeting body parts with the actual organ system, move these into organ definitions. /// The base miss chance for the different defence zones -var/list/global/base_miss_chance = list( +GLOBAL_LIST_INIT(base_miss_chance, list( "head" = 10, "chest" = 0, "groin" = 5, @@ -43,11 +43,11 @@ var/list/global/base_miss_chance = list( "r_foot" = 40, "eyes" = 20, "mouth" = 15, -) +)) //Used to weight organs when an organ is hit randomly (i.e. not a directed, aimed attack). //Also used to weight the protection value that armor provides for covering that body part when calculating protection from full-body effects. -var/list/global/organ_rel_size = list( +GLOBAL_LIST_INIT(organ_rel_size, list( "head" = 15, "chest" = 70, "groin" = 30, @@ -61,10 +61,10 @@ var/list/global/organ_rel_size = list( "r_foot" = 10, "eyes" = 5, "mouth" = 15, -) +)) // This is much faster than a string comparison -var/global/list/limb_types_by_name = list( +GLOBAL_LIST_INIT(limb_types_by_name, list( "head" = /obj/limb/head, "chest" = /obj/limb/chest, "groin" = /obj/limb/groin, @@ -76,7 +76,7 @@ var/global/list/limb_types_by_name = list( "r_hand" = /obj/limb/hand/r_hand, "l_foot" = /obj/limb/foot/l_foot, "r_foot" = /obj/limb/foot/r_foot, -) +)) /proc/check_zone(zone) if(!zone) @@ -99,17 +99,17 @@ var/global/list/limb_types_by_name = list( var/rand_zone = zone while (rand_zone == zone) rand_zone = pick ( - organ_rel_size["head"]; "head", - organ_rel_size["chest"]; "chest", - organ_rel_size["groin"]; "groin", - organ_rel_size["l_arm"]; "l_arm", - organ_rel_size["r_arm"]; "r_arm", - organ_rel_size["l_leg"]; "l_leg", - organ_rel_size["r_leg"]; "r_leg", - organ_rel_size["l_hand"]; "l_hand", - organ_rel_size["r_hand"]; "r_hand", - organ_rel_size["l_foot"]; "l_foot", - organ_rel_size["r_foot"]; "r_foot", + GLOB.organ_rel_size["head"]; "head", + GLOB.organ_rel_size["chest"]; "chest", + GLOB.organ_rel_size["groin"]; "groin", + GLOB.organ_rel_size["l_arm"]; "l_arm", + GLOB.organ_rel_size["r_arm"]; "r_arm", + GLOB.organ_rel_size["l_leg"]; "l_leg", + GLOB.organ_rel_size["r_leg"]; "r_leg", + GLOB.organ_rel_size["l_hand"]; "l_hand", + GLOB.organ_rel_size["r_hand"]; "r_hand", + GLOB.organ_rel_size["l_foot"]; "l_foot", + GLOB.organ_rel_size["r_foot"]; "r_foot", ) return rand_zone @@ -311,14 +311,11 @@ var/global/list/limb_types_by_name = list( /mob/proc/is_mob_restrained() return +/// Returns if the mob is incapacitated and unable to perform general actions /mob/proc/is_mob_incapacitated(ignore_restrained) - return (stat || (!ignore_restrained && is_mob_restrained()) || status_flags & FAKEDEATH) - - -//returns how many non-destroyed legs the mob has (currently only useful for humans) -/mob/proc/has_legs() - return 2 - + // note that stat includes knockout via unconscious + // TODO: re-re-re-figure out if we need TRAIT_FLOORED here or using TRAIT_INCAPACITATED only is acceptable deviance from legacy behavior + return (stat || (!ignore_restrained && is_mob_restrained()) || (status_flags & FAKEDEATH) || HAS_TRAIT(src, TRAIT_INCAPACITATED)) /mob/proc/get_eye_protection() return EYE_PROTECTION_NONE @@ -480,7 +477,7 @@ var/global/list/limb_types_by_name = list( set name = "Pick Up" set category = "Object" - if(!canmove || stat || is_mob_restrained() || !Adjacent(pickupify)) + if(is_mob_incapacitated() || !Adjacent(pickupify)) return if(world.time <= next_move) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 64253fbac5df..65489944211a 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -95,7 +95,13 @@ mob.next_delay_update = world.time + mob.next_delay_delay /client/Move(n, direct) - if(world.time < next_movement || (mob.lying && mob.crawling)) + var/mob/living/living_mob + if(isliving(mob)) + living_mob = mob + + if(world.time < next_movement) + return + if(living_mob && living_mob.body_position == LYING_DOWN && mob.crawling) return next_move_dir_add = 0 @@ -134,7 +140,17 @@ if(!isliving(mob)) return mob.Move(n, direct) - if(!mob.canmove || mob.is_mob_incapacitated(TRUE) || (mob.lying && !mob.can_crawl)) + if(mob.is_mob_incapacitated(TRUE)) + return + + if(mob.buckled) + // Handle buckled relay before mobility because buckling inherently immobilizes + // This means you can (try to) move with a cargo tug or powerloader while immobilized, which i think makes sense + return mob.buckled.relaymove(mob, direct) + + if(!(living_mob.mobility_flags & MOBILITY_MOVE)) + return + if(living_mob.body_position == LYING_DOWN && !living_mob.can_crawl) return //Check if you are being grabbed and if so attemps to break it @@ -150,9 +166,6 @@ next_movement = world.time + MINIMAL_MOVEMENT_INTERVAL return - if(mob.buckled) - return mob.buckled.relaymove(mob, direct) - if(!mob.z)//Inside an object, tell it we moved var/atom/O = mob.loc if(!O) @@ -172,7 +185,7 @@ //We are now going to move moving = TRUE mob.move_intentionally = TRUE - if(mob.lying) + if(living_mob && living_mob.body_position == LYING_DOWN) //check for them not being a limbless blob (only humans have limbs) if(ishuman(mob)) var/mob/living/carbon/human/human = mob @@ -195,7 +208,7 @@ return mob.crawling = FALSE if(mob.confused) - mob.Move(get_step(mob, pick(cardinal))) + mob.Move(get_step(mob, pick(GLOB.cardinals))) else . = ..() diff --git a/code/modules/mob/mob_verbs.dm b/code/modules/mob/mob_verbs.dm index 114547188d3c..a941dfc51090 100644 --- a/code/modules/mob/mob_verbs.dm +++ b/code/modules/mob/mob_verbs.dm @@ -98,7 +98,8 @@ if(length(mind.memory) < 4000) mind.store_memory(msg) else - message_admins("[key_name(usr)] auto-slept for attempting to exceed mob memory limit.]", loc.x, loc.y, loc.z) + message_admins("[key_name(usr)] warned for attempting to exceed mob memory limit.]", loc.x, loc.y, loc.z) + to_chat(src, "You have exceeded the maximum memory limit. Sorry!") else to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.") @@ -154,7 +155,7 @@ return M.key = key - if(M.client) M.client.change_view(world_view_size) + if(M.client) M.client.change_view(GLOB.world_view_size) // M.Login() //wat return @@ -221,6 +222,7 @@ set category = "IC" if(pulling) + REMOVE_TRAIT(pulling, TRAIT_FLOORED, CHOKEHOLD_TRAIT) var/mob/M = pulling pulling.pulledby = null pulling = null @@ -243,4 +245,3 @@ //so we must undo it here so the victim can move right away M.client.next_movement = world.time M.update_transform(TRUE) - M.update_canmove() diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 9ff317260ccf..4b25d7a2ae39 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -25,14 +25,14 @@ client.playtitlemusic() // To show them the full lobby art. This fixes itself on a mind transfer so no worries there. - client.change_view(lobby_view_size) + client.change_view(GLOB.lobby_view_size) // Credit the lobby art author - if(displayed_lobby_art != -1) + if(GLOB.displayed_lobby_art != -1) var/list/lobby_authors = CONFIG_GET(str_list/lobby_art_authors) - var/author = lobby_authors[displayed_lobby_art] + var/author = lobby_authors[GLOB.displayed_lobby_art] if(author != "Unknown") to_chat(src, SPAN_ROUNDBODY("
    This round's lobby art is brought to you by [author]
    ")) - if(join_motd) - to_chat(src, "
    [join_motd]
    ") - if(current_tms) - to_chat(src, SPAN_BOLDANNOUNCE(current_tms)) + if(GLOB.join_motd) + to_chat(src, "
    [GLOB.join_motd]
    ") + if(GLOB.current_tms) + to_chat(src, SPAN_BOLDANNOUNCE(GLOB.current_tms)) diff --git a/code/modules/mob/new_player/logout.dm b/code/modules/mob/new_player/logout.dm index 11589f59ee34..4f9a45f5667e 100644 --- a/code/modules/mob/new_player/logout.dm +++ b/code/modules/mob/new_player/logout.dm @@ -1,6 +1,6 @@ /mob/new_player/Logout() if(ready) - readied_players-- + GLOB.readied_players-- ready = FALSE . = ..() if(!spawning)//Here so that if they are spawning and log out, the other procs can play out and they will have a mob to come back to. diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index cebe265a673c..2034202144b2 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -6,7 +6,6 @@ invisibility = 101 density = FALSE - canmove = FALSE anchored = TRUE universal_speak = TRUE stat = DEAD @@ -15,10 +14,11 @@ . = ..() GLOB.new_player_list += src GLOB.dead_mob_list -= src + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) /mob/new_player/Destroy() if(ready) - readied_players-- + GLOB.readied_players-- GLOB.new_player_list -= src return ..() @@ -97,14 +97,14 @@ if("ready") if( (SSticker.current_state <= GAME_STATE_PREGAME) && !ready) // Make sure we don't ready up after the round has started ready = TRUE - readied_players++ + GLOB.readied_players++ new_player_panel_proc() if("unready") if((SSticker.current_state <= GAME_STATE_PREGAME) && ready) // Make sure we don't ready up after the round has started ready = FALSE - readied_players-- + GLOB.readied_players-- new_player_panel_proc() @@ -145,7 +145,7 @@ mind.transfer_to(observer, TRUE) if(observer.client) - observer.client.change_view(world_view_size) + observer.client.change_view(GLOB.world_view_size) observer.set_huds_from_prefs() @@ -207,7 +207,7 @@ if("SelectedJob") - if(!enter_allowed) + if(!GLOB.enter_allowed) to_chat(usr, SPAN_WARNING("There is an administrative lock on entering the game! (The dropship likely crashed into the Almayer. This should take at most 20 minutes.)")) return @@ -228,16 +228,16 @@ new_player_panel() /mob/new_player/proc/AttemptLateSpawn(rank) - var/datum/job/player_rank = RoleAuthority.roles_for_mode[rank] + var/datum/job/player_rank = GLOB.RoleAuthority.roles_for_mode[rank] if (src != usr) return if(SSticker.current_state != GAME_STATE_PLAYING) to_chat(usr, SPAN_WARNING("The round is either not ready, or has already finished!")) return - if(!enter_allowed) + if(!GLOB.enter_allowed) to_chat(usr, SPAN_WARNING("There is an administrative lock on entering the game! (The dropship likely crashed into the Almayer. This should take at most 20 minutes.)")) return - if(!RoleAuthority.assign_role(src, player_rank, 1)) + if(!GLOB.RoleAuthority.assign_role(src, player_rank, 1)) to_chat(src, alert("[rank] is not available. Please try another.")) return @@ -245,18 +245,18 @@ close_spawn_windows() var/mob/living/carbon/human/character = create_character(TRUE) //creates the human and transfers vars and mind - RoleAuthority.equip_role(character, player_rank, late_join = TRUE) + GLOB.RoleAuthority.equip_role(character, player_rank, late_join = TRUE) EquipCustomItems(character) - if((security_level > SEC_LEVEL_BLUE || SShijack.hijack_status) && player_rank.gets_emergency_kit) + if((GLOB.security_level > SEC_LEVEL_BLUE || SShijack.hijack_status) && player_rank.gets_emergency_kit) to_chat(character, SPAN_HIGHDANGER("As you stagger out of hypersleep, the sleep bay blares: '[SShijack.evac_status ? "VESSEL UNDERGOING EVACUATION PROCEDURES, SELF DEFENSE KIT PROVIDED" : "VESSEL IN HEIGHTENED ALERT STATUS, SELF DEFENSE KIT PROVIDED"]'.")) character.put_in_hands(new /obj/item/storage/box/kit/cryo_self_defense(character.loc)) GLOB.data_core.manifest_inject(character) SSticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn - SSticker.mode.latejoin_tally += RoleAuthority.calculate_role_weight(player_rank) + SSticker.mode.latejoin_tally += GLOB.RoleAuthority.calculate_role_weight(player_rank) - for(var/datum/squad/sq in RoleAuthority.squads) + for(var/datum/squad/sq in GLOB.RoleAuthority.squads) if(sq) sq.max_engineers = engi_slot_formula(GLOB.clients.len) sq.max_medics = medic_slot_formula(GLOB.clients.len) @@ -303,44 +303,44 @@ dat += "Choose from the following open positions:
    " var/roles_show = FLAG_SHOW_ALL_JOBS - for(var/i in RoleAuthority.roles_for_mode) - var/datum/job/J = RoleAuthority.roles_for_mode[i] - if(!RoleAuthority.check_role_entry(src, J, TRUE)) + for(var/i in GLOB.RoleAuthority.roles_for_mode) + var/datum/job/J = GLOB.RoleAuthority.roles_for_mode[i] + if(!GLOB.RoleAuthority.check_role_entry(src, J, TRUE)) continue var/active = 0 // Only players with the job assigned and AFK for less than 10 minutes count as active for(var/mob/M in GLOB.player_list) if(M.client && M.job == J.title) active++ - if(roles_show & FLAG_SHOW_CIC && ROLES_CIC.Find(J.title)) + if(roles_show & FLAG_SHOW_CIC && GLOB.ROLES_CIC.Find(J.title)) dat += "Command:
    " roles_show ^= FLAG_SHOW_CIC - else if(roles_show & FLAG_SHOW_AUXIL_SUPPORT && ROLES_AUXIL_SUPPORT.Find(J.title)) + else if(roles_show & FLAG_SHOW_AUXIL_SUPPORT && GLOB.ROLES_AUXIL_SUPPORT.Find(J.title)) dat += "
    Auxiliary Combat Support:
    " roles_show ^= FLAG_SHOW_AUXIL_SUPPORT - else if(roles_show & FLAG_SHOW_MISC && ROLES_MISC.Find(J.title)) + else if(roles_show & FLAG_SHOW_MISC && GLOB.ROLES_MISC.Find(J.title)) dat += "
    Other:
    " roles_show ^= FLAG_SHOW_MISC - else if(roles_show & FLAG_SHOW_POLICE && ROLES_POLICE.Find(J.title)) + else if(roles_show & FLAG_SHOW_POLICE && GLOB.ROLES_POLICE.Find(J.title)) dat += "
    Military Police:
    " roles_show ^= FLAG_SHOW_POLICE - else if(roles_show & FLAG_SHOW_ENGINEERING && ROLES_ENGINEERING.Find(J.title)) + else if(roles_show & FLAG_SHOW_ENGINEERING && GLOB.ROLES_ENGINEERING.Find(J.title)) dat += "
    Engineering:
    " roles_show ^= FLAG_SHOW_ENGINEERING - else if(roles_show & FLAG_SHOW_REQUISITION && ROLES_REQUISITION.Find(J.title)) + else if(roles_show & FLAG_SHOW_REQUISITION && GLOB.ROLES_REQUISITION.Find(J.title)) dat += "
    Requisitions:
    " roles_show ^= FLAG_SHOW_REQUISITION - else if(roles_show & FLAG_SHOW_MEDICAL && ROLES_MEDICAL.Find(J.title)) + else if(roles_show & FLAG_SHOW_MEDICAL && GLOB.ROLES_MEDICAL.Find(J.title)) dat += "
    Medbay:
    " roles_show ^= FLAG_SHOW_MEDICAL - else if(roles_show & FLAG_SHOW_MARINES && ROLES_MARINES.Find(J.title)) + else if(roles_show & FLAG_SHOW_MARINES && GLOB.ROLES_MARINES.Find(J.title)) dat += "
    Squad Riflemen:
    " roles_show ^= FLAG_SHOW_MARINES @@ -393,7 +393,7 @@ INVOKE_ASYNC(new_character, TYPE_PROC_REF(/mob/living/carbon/human, update_hair)) new_character.key = key //Manually transfer the key to log them in - new_character.client?.change_view(world_view_size) + new_character.client?.change_view(GLOB.world_view_size) return new_character diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index fb4dbac3c160..a4525e16a6c6 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -198,6 +198,16 @@ arm_equipment(preview_dummy, J, FALSE, FALSE, owner, show_job_gear) + // If the dummy was equipped with marine armor. + var/jacket = preview_dummy.get_item_by_slot(WEAR_JACKET) + if(istype(jacket, /obj/item/clothing/suit/storage/marine)) + var/obj/item/clothing/suit/storage/marine/armor = jacket + // If the armor has different sprite variants. + if(armor.armor_variation) + // Set its `icon_state` to the style the player picked as their 'Preferred Armor'. + armor.set_armor_style(preferred_armor) + armor.update_icon(preview_dummy) + if(isnull(preview_front)) preview_front = new() owner.add_to_screen(preview_front) @@ -237,9 +247,9 @@ if(JOB_SQUAD_TEAM_LEADER) return /datum/equipment_preset/uscm/tl_equipped if(JOB_CO) - if(length(RoleAuthority.roles_whitelist)) - var/datum/job/J = RoleAuthority.roles_by_name[JOB_CO] - return J.gear_preset_whitelist["[JOB_CO][J.get_whitelist_status(RoleAuthority.roles_whitelist, owner)]"] + if(length(GLOB.RoleAuthority.roles_whitelist)) + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[JOB_CO] + return J.gear_preset_whitelist["[JOB_CO][J.get_whitelist_status(GLOB.RoleAuthority.roles_whitelist, owner)]"] return /datum/equipment_preset/uscm_ship/commander if(JOB_SO) return /datum/equipment_preset/uscm_ship/so @@ -258,9 +268,9 @@ if(JOB_COMBAT_REPORTER) return /datum/equipment_preset/uscm_ship/reporter if(JOB_SYNTH) - if(length(RoleAuthority.roles_whitelist)) - var/datum/job/J = RoleAuthority.roles_by_name[JOB_SYNTH] - return J.gear_preset_whitelist["[JOB_SYNTH][J.get_whitelist_status(RoleAuthority.roles_whitelist, owner)]"] + if(length(GLOB.RoleAuthority.roles_whitelist)) + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[JOB_SYNTH] + return J.gear_preset_whitelist["[JOB_SYNTH][J.get_whitelist_status(GLOB.RoleAuthority.roles_whitelist, owner)]"] return /datum/equipment_preset/synth/uscm if(JOB_WORKING_JOE) return /datum/equipment_preset/synth/working_joe @@ -307,9 +317,9 @@ return pick(SSmapping.configs[GROUND_MAP].CO_survivor_types) return /datum/equipment_preset/uscm_ship/commander if(JOB_PREDATOR) - if(length(RoleAuthority.roles_whitelist)) - var/datum/job/J = RoleAuthority.roles_by_name[JOB_PREDATOR] - return J.gear_preset_whitelist["[JOB_PREDATOR][J.get_whitelist_status(RoleAuthority.roles_whitelist, owner)]"] + if(length(GLOB.RoleAuthority.roles_whitelist)) + var/datum/job/J = GLOB.RoleAuthority.roles_by_name[JOB_PREDATOR] + return J.gear_preset_whitelist["[JOB_PREDATOR][J.get_whitelist_status(GLOB.RoleAuthority.roles_whitelist, owner)]"] return /datum/equipment_preset/yautja/blooded return /datum/equipment_preset/uscm/private_equipped diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 8cd5b148a161..032888f26709 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -66,7 +66,7 @@ return if(!src.client.admin_holder || !(client.admin_holder.rights & R_MOD)) - if(!dsay_allowed) + if(!GLOB.dsay_allowed) to_chat(src, SPAN_DANGER("Deadchat is globally muted")) return @@ -174,7 +174,7 @@ for it but just ignore it. if(length(message) >= 2) var/channel_prefix = copytext(message, 1 ,3) - return department_radio_keys[channel_prefix] + return GLOB.department_radio_keys[channel_prefix] return null diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index dcb478d0fc7c..6dda93e4d9c2 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -7,8 +7,8 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 - stunned = 1 + anchored = TRUE + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -68,7 +68,7 @@ for(var/obj/item/W in src) drop_inv_item_on_ground(W) monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 return ..() @@ -85,7 +85,7 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -108,7 +108,7 @@ O.mind.original = O else O.key = key - if(O.client) O.client.change_view(world_view_size) + if(O.client) O.client.change_view(GLOB.world_view_size) O.forceMove(loc) O.job = "Cyborg" @@ -131,7 +131,7 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -180,34 +180,12 @@ new_xeno.a_intent = INTENT_HARM new_xeno.key = key - if(new_xeno.client) new_xeno.client.change_view(world_view_size) + if(new_xeno.client) new_xeno.client.change_view(GLOB.world_view_size) to_chat(new_xeno, "You are now an alien.") qdel(src) return -/mob/living/carbon/human/proc/corgize() - if (monkeyizing) - return - for(var/obj/item/W in src) - drop_inv_item_on_ground(W) - regenerate_icons() - monkeyizing = 1 - canmove = 0 - icon = null - invisibility = 101 - for(var/t in limbs) //this really should not be necessary - qdel(t) - - var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (loc) - new_corgi.a_intent = INTENT_HARM - new_corgi.key = key - if(new_corgi.client) new_corgi.client.change_view(world_view_size) - - to_chat(new_corgi, "You are now a Corgi. Yap Yap!") - qdel(src) - return - /mob/living/carbon/human/Animalize() var/list/mobtypes = typesof(/mob/living/simple_animal) @@ -224,7 +202,7 @@ regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 @@ -234,7 +212,7 @@ var/mob/new_mob = new mobpath(src.loc) new_mob.key = key - if(new_mob.client) new_mob.client.change_view(world_view_size) + if(new_mob.client) new_mob.client.change_view(GLOB.world_view_size) new_mob.a_intent = INTENT_HARM @@ -254,7 +232,7 @@ var/mob/new_mob = new mobpath(src.loc) new_mob.key = key - if(new_mob.client) new_mob.client.change_view(world_view_size) + if(new_mob.client) new_mob.client.change_view(GLOB.world_view_size) new_mob.a_intent = INTENT_HARM to_chat(new_mob, "You feel more... animalistic") diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index ce01931f5daf..46a30b313bb8 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -105,7 +105,7 @@ nanoui is used to open and update nano browser uis */ /datum/nanoui/Destroy() if(user) - nanomanager.ui_closed(src) + SSnano.nanomanager.ui_closed(src) close_browser(user, "[window_id]") user = null @@ -177,9 +177,13 @@ nanoui is used to open and update nano browser uis close() return + var/mob/living/living_user + if(isliving(user)) + living_user = user + if ((allowed_user_stat > -1) && (user.stat > allowed_user_stat)) set_status(STATUS_DISABLED, push_update) // no updates, completely disabled (red visibility) - else if (user.is_mob_restrained() || user.lying) + else if (user.is_mob_restrained() || (living_user && living_user.body_position == LYING_DOWN)) set_status(STATUS_UPDATE, push_update) // update only (orange visibility) else if (!(src_object in view(4, user))) // If the src object is not in visable, set status to 0 set_status(STATUS_DISABLED, push_update) // interactive (green visibility) @@ -440,7 +444,7 @@ nanoui is used to open and update nano browser uis winset(user, "mapwindow.map", "focus=true") // return keyboard focus to map on_close_winset() //onclose(user, window_id) - nanomanager.ui_opened(src) + SSnano.nanomanager.ui_opened(src) /** * Close this UI @@ -449,7 +453,7 @@ nanoui is used to open and update nano browser uis */ /datum/nanoui/proc/close() is_auto_updating = 0 - nanomanager.ui_closed(src) + SSnano.nanomanager.ui_closed(src) close_browser(user, "[window_id]") qdel(src) @@ -516,7 +520,7 @@ nanoui is used to open and update nano browser uis map_update = 1 if ((src_object && src_object.Topic(href, href_list)) || map_update) - nanomanager.update_uis(src_object) // update all UIs attached to src_object + SSnano.nanomanager.update_uis(src_object) // update all UIs attached to src_object /** * Process this UI, updating the entire UI or just the status (aka visibility) diff --git a/code/modules/objectives/data_retrieval.dm b/code/modules/objectives/data_retrieval.dm index 01689a18d081..f66c578f48fb 100644 --- a/code/modules/objectives/data_retrieval.dm +++ b/code/modules/objectives/data_retrieval.dm @@ -14,7 +14,7 @@ /datum/cm_objective/retrieve_data/New() . = ..() - decryption_password = "[pick(alphabet_uppercase)][rand(100,999)][pick(alphabet_uppercase)][rand(10,99)]" + decryption_password = "[pick(GLOB.alphabet_uppercase)][rand(100,999)][pick(GLOB.alphabet_uppercase)][rand(10,99)]" /datum/cm_objective/retrieve_data/pre_round_start() SSobjectives.statistics["data_retrieval_total_instances"]++ @@ -208,7 +208,7 @@ disk_color = "Bloodied blue" display_color = "#5296e3" - label = "[pick(greek_letters)]-[rand(100,999)]" + label = "[pick(GLOB.greek_letters)]-[rand(100,999)]" name = "[disk_color] computer disk [label]" objective = new /datum/cm_objective/retrieve_data/disk(src) retrieve_objective = new /datum/cm_objective/retrieve_item/document(src) @@ -237,7 +237,7 @@ /obj/structure/machinery/computer/objective/Initialize() . = ..() - label = "[pick(greek_letters)]-[rand(100,999)]" + label = "[pick(GLOB.greek_letters)]-[rand(100,999)]" name = "data terminal [label]" objective = new /datum/cm_objective/retrieve_data/terminal(src) diff --git a/code/modules/objectives/documents.dm b/code/modules/objectives/documents.dm index 5c6041a406c2..8562f1985e7f 100644 --- a/code/modules/objectives/documents.dm +++ b/code/modules/objectives/documents.dm @@ -129,7 +129,7 @@ /obj/item/document_objective/Initialize(mapload, ...) . = ..() - label = "[pick(alphabet_uppercase)][rand(100,999)]" + label = "[pick(GLOB.alphabet_uppercase)][rand(100,999)]" objective = new objective_type(src) retrieve_objective = new /datum/cm_objective/retrieve_item/document(src) LAZYADD(objective.enables_objectives, retrieve_objective) diff --git a/code/modules/objectives/objective_memory_storage.dm b/code/modules/objectives/objective_memory_storage.dm index 08dfc8cdb2c2..161c78d4d1ba 100644 --- a/code/modules/objectives/objective_memory_storage.dm +++ b/code/modules/objectives/objective_memory_storage.dm @@ -77,26 +77,26 @@ /datum/objective_memory_storage/proc/synchronize_objectives() clean_objectives() - if(!intel_system || !intel_system.oms) + if(!GLOB.intel_system || !GLOB.intel_system.oms) return - intel_system.oms.clean_objectives() + GLOB.intel_system.oms.clean_objectives() - for(var/datum/cm_objective/O in intel_system.oms.folders) + for(var/datum/cm_objective/O in GLOB.intel_system.oms.folders) addToListNoDupe(folders, O) - for(var/datum/cm_objective/O in intel_system.oms.progress_reports) + for(var/datum/cm_objective/O in GLOB.intel_system.oms.progress_reports) addToListNoDupe(progress_reports, O) - for(var/datum/cm_objective/O in intel_system.oms.technical_manuals) + for(var/datum/cm_objective/O in GLOB.intel_system.oms.technical_manuals) addToListNoDupe(technical_manuals, O) - for(var/datum/cm_objective/O in intel_system.oms.terminals) + for(var/datum/cm_objective/O in GLOB.intel_system.oms.terminals) addToListNoDupe(terminals, O) - for(var/datum/cm_objective/O in intel_system.oms.disks) + for(var/datum/cm_objective/O in GLOB.intel_system.oms.disks) addToListNoDupe(disks, O) - for(var/datum/cm_objective/O in intel_system.oms.retrieve_items) + for(var/datum/cm_objective/O in GLOB.intel_system.oms.retrieve_items) addToListNoDupe(retrieve_items, O) - for(var/datum/cm_objective/O in intel_system.oms.other) + for(var/datum/cm_objective/O in GLOB.intel_system.oms.other) addToListNoDupe(other, O) -var/global/datum/intel_system/intel_system = new() +GLOBAL_DATUM_INIT(intel_system, /datum/intel_system, new()) /datum/intel_system var/datum/objective_memory_storage/oms = new() @@ -127,7 +127,7 @@ var/global/datum/intel_system/intel_system = new() if(!powered()) to_chat(user, SPAN_WARNING("This computer has no power!")) return FALSE - if(!intel_system) + if(!GLOB.intel_system) to_chat(user, SPAN_WARNING("The computer doesn't seem to be connected to anything...")) return FALSE if(user.action_busy) @@ -197,9 +197,9 @@ var/global/datum/intel_system/intel_system = new() return TRUE /obj/structure/machinery/computer/intel/proc/transfer_intel(mob/living/user, datum/cm_objective/O) - if(!intel_system || !intel_system.oms) + if(!GLOB.intel_system || !GLOB.intel_system.oms) return 0 - if(intel_system.oms.has_objective(O)) + if(GLOB.intel_system.oms.has_objective(O)) return 0 if(user.action_busy) return 0 @@ -215,7 +215,7 @@ var/global/datum/intel_system/intel_system = new() return -1 to_chat(user, SPAN_NOTICE("...something about \"[clue]\"...")) - intel_system.store_single_objective(O) + GLOB.intel_system.store_single_objective(O) return 1 // -------------------------------------------- @@ -236,7 +236,7 @@ var/global/datum/intel_system/intel_system = new() if(!powered()) to_chat(user, SPAN_WARNING("This computer has no power!")) return FALSE - if(!intel_system) + if(!GLOB.intel_system) to_chat(user, SPAN_WARNING("The computer doesn't seem to be connected to anything...")) return FALSE if(user.action_busy) diff --git a/code/modules/objectives/power_objectives.dm b/code/modules/objectives/power_objectives.dm index ecd192caa32e..8f18af9337ea 100644 --- a/code/modules/objectives/power_objectives.dm +++ b/code/modules/objectives/power_objectives.dm @@ -16,7 +16,7 @@ /datum/cm_objective/power/pre_round_start() if(uses_smes) - for(var/obj/structure/machinery/power/smes/colony_smes in machines) + for(var/obj/structure/machinery/power/smes/colony_smes in GLOB.machines) if(!is_ground_level(colony_smes.loc.z)) continue LAZYADD(power_objects, colony_smes) diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index fd81c25bec9f..8df96650ac50 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -945,7 +945,7 @@ This function completely restores a damaged organ to perfect condition. if(organ) //Throw organs around - var/lol = pick(cardinal) + var/lol = pick(GLOB.cardinals) step(organ,lol) owner.update_body() //Among other things, this calls update_icon() and updates our visuals. diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 751dbe5bf7cd..258132a112e1 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -227,10 +227,10 @@ t = replacetext(t, "\[large\]", "") t = replacetext(t, "\[/large\]", "") t = replacetext(t, "\[sign\]", "[user ? user.real_name : "Anonymous"]") - t = replacetext(t, "\[date\]", "[time2text(REALTIMEOFDAY, "Day DD Month [game_year]")]") - t = replacetext(t, "\[shortdate\]", "[time2text(REALTIMEOFDAY, "DD/MM/[game_year]")]") + t = replacetext(t, "\[date\]", "[time2text(REALTIMEOFDAY, "Day DD Month [GLOB.game_year]")]") + t = replacetext(t, "\[shortdate\]", "[time2text(REALTIMEOFDAY, "DD/MM/[GLOB.game_year]")]") t = replacetext(t, "\[time\]", "[worldtime2text("hh:mm")]") - t = replacetext(t, "\[date+time\]", "[worldtime2text("hh:mm")], [time2text(REALTIMEOFDAY, "Day DD Month [game_year]")]") + t = replacetext(t, "\[date+time\]", "[worldtime2text("hh:mm")], [time2text(REALTIMEOFDAY, "Day DD Month [GLOB.game_year]")]") t = replacetext(t, "\[field\]", "") t = replacetext(t, "\[h1\]", "

    ") @@ -666,34 +666,34 @@ if(!C) var/random_chem if(tier) - random_chem = pick(chemical_gen_classes_list[tier]) + random_chem = pick(GLOB.chemical_gen_classes_list[tier]) else if(note_type == "test") - random_chem = pick(chemical_gen_classes_list["T4"]) + random_chem = pick(GLOB.chemical_gen_classes_list["T4"]) else - random_chem = pick( prob(55);pick(chemical_gen_classes_list["T2"]), - prob(30);pick(chemical_gen_classes_list["T3"]), - prob(15);pick(chemical_gen_classes_list["T4"])) + random_chem = pick( prob(55);pick(GLOB.chemical_gen_classes_list["T2"]), + prob(30);pick(GLOB.chemical_gen_classes_list["T3"]), + prob(15);pick(GLOB.chemical_gen_classes_list["T4"])) if(!random_chem) - random_chem = pick(chemical_gen_classes_list["T1"]) - C = chemical_reagents_list["[random_chem]"] + random_chem = pick(GLOB.chemical_gen_classes_list["T1"]) + C = GLOB.chemical_reagents_list["[random_chem]"] var/datum/asset/asset = get_asset_datum(/datum/asset/simple/paper) var/txt = "

    Official Weyland-Yutani Document
    Experiment Notes

    " switch(note_type) if("synthesis") - var/datum/chemical_reaction/G = chemical_reactions_list[C.id] + var/datum/chemical_reaction/G = GLOB.chemical_reactions_list[C.id] name = "Synthesis of [C.name]" icon_state = "paper_wy_partial_report" txt += "[name]

    " txt += "During experiment [pick("C","Q","V","W","X","Y","Z")][rand(100,999)][pick("a","b","c")] the theorized compound identified as [C.name], was successfully synthesized using the following formula:
    \n
    \n" for(var/I in G.required_reagents) - var/datum/reagent/R = chemical_reagents_list["[I]"] + var/datum/reagent/R = GLOB.chemical_reagents_list["[I]"] var/U = G.required_reagents[I] txt += " - [U] [R.name]
    \n" if(G.required_catalysts && G.required_catalysts.len) txt += "
    \nWhile using the following catalysts:
    \n
    \n" for(var/I in G.required_catalysts) - var/datum/reagent/R = chemical_reagents_list["[I]"] + var/datum/reagent/R = GLOB.chemical_reagents_list["[I]"] var/U = G.required_catalysts[I] txt += " - [U] [R.name]
    \n" if(full_report) @@ -770,16 +770,16 @@ /obj/item/paper/research_notes/unique/Initialize() //Each one of these get a new unique chem var/datum/reagent/generated/C = new /datum/reagent/generated - C.id = "tau-[length(chemical_gen_classes_list["tau"])]" + C.id = "tau-[length(GLOB.chemical_gen_classes_list["tau"])]" C.generate_name() C.chemclass = CHEM_CLASS_RARE if(gen_tier) C.gen_tier = gen_tier else - C.gen_tier = chemical_data.clearance_level + C.gen_tier = GLOB.chemical_data.clearance_level C.generate_stats() - chemical_gen_classes_list["tau"] += C.id //Because each unique_vended should be unique, we do not save the chemclass anywhere but in the tau list - chemical_reagents_list[C.id] = C + GLOB.chemical_gen_classes_list["tau"] += C.id //Because each unique_vended should be unique, we do not save the chemclass anywhere but in the tau list + GLOB.chemical_reagents_list[C.id] = C C.generate_assoc_recipe() data = C msg_admin_niche("New reagent with id [C.id], name [C.name], level [C.gen_tier], generated and printed at [loc] [ADMIN_JMP(loc)].") @@ -803,7 +803,7 @@ info += "ID: [S.name]

    \n" info += "Database Details:
    \n" if(S.chemclass >= CHEM_CLASS_ULTRA) - if(chemical_data.clearance_level >= S.gen_tier || info_only) + if(GLOB.chemical_data.clearance_level >= S.gen_tier || info_only) info += "The following information relating to [S.name] is restricted with a level [S.gen_tier] clearance classification.
    " info += "[S.description]\n" info += "
    Overdoses at: [S.overdose] units\n" @@ -813,7 +813,7 @@ else info += "CLASSIFIED: Clearance level [S.gen_tier] required to read the database entry.
    \n" icon_state = "paper_wy_partial_report" - else if(S.chemclass == CHEM_CLASS_SPECIAL && !chemical_data.clearance_x_access && !info_only) + else if(S.chemclass == CHEM_CLASS_SPECIAL && !GLOB.chemical_data.clearance_x_access && !info_only) info += "CLASSIFIED: Clearance level X required to read the database entry.
    \n" icon_state = "paper_wy_partial_report" else if(S.description) @@ -825,14 +825,14 @@ else info += "No details on this reagent could be found in the database.
    \n" icon_state = "paper_wy_synthesis" - if(S.chemclass >= CHEM_CLASS_SPECIAL && !chemical_data.chemical_identified_list[S.id] && !info_only) + if(S.chemclass >= CHEM_CLASS_SPECIAL && !GLOB.chemical_data.chemical_identified_list[S.id] && !info_only) info += "
    Saved emission spectrum of [S.name] to the database.
    \n" info += "
    Composition Details:
    \n" - if(chemical_reactions_list[S.id]) - var/datum/chemical_reaction/C = chemical_reactions_list[S.id] + if(GLOB.chemical_reactions_list[S.id]) + var/datum/chemical_reaction/C = GLOB.chemical_reactions_list[S.id] for(var/I in C.required_reagents) - var/datum/reagent/R = chemical_reagents_list["[I]"] - if(R.chemclass >= CHEM_CLASS_SPECIAL && !chemical_data.chemical_identified_list[R.id] && !info_only) + var/datum/reagent/R = GLOB.chemical_reagents_list["[I]"] + if(R.chemclass >= CHEM_CLASS_SPECIAL && !GLOB.chemical_data.chemical_identified_list[R.id] && !info_only) info += " - Unknown emission spectrum
    \n" completed = FALSE else @@ -842,14 +842,14 @@ if(C.required_catalysts.len) info += "
    Reaction would require the following catalysts:
    \n" for(var/I in C.required_catalysts) - var/datum/reagent/R = chemical_reagents_list["[I]"] - if(R.chemclass >= CHEM_CLASS_SPECIAL && !chemical_data.chemical_identified_list[R.id] && !info_only) + var/datum/reagent/R = GLOB.chemical_reagents_list["[I]"] + if(R.chemclass >= CHEM_CLASS_SPECIAL && !GLOB.chemical_data.chemical_identified_list[R.id] && !info_only) info += " - Unknown emission spectrum
    \n" completed = FALSE else var/U = C.required_catalysts[I] info += " - [U] [R.name]
    \n" - else if(chemical_gen_classes_list["C1"].Find(S.id)) + else if(GLOB.chemical_gen_classes_list["C1"].Find(S.id)) info += " - [S.name]
    \n" else info += "ERROR: Unable to analyze emission spectrum of sample." //A reaction to make this doesn't exist, so this is our IC excuse @@ -860,7 +860,7 @@ else if(!S.properties) //Safety for empty reagents completed = FALSE - if(S.chemclass == CHEM_CLASS_SPECIAL && chemical_data.clearance_x_access) + if(S.chemclass == CHEM_CLASS_SPECIAL && GLOB.chemical_data.clearance_x_access) completed = TRUE data = S diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index dbd490792e8f..cebb4ad613b0 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -213,7 +213,7 @@ // Check if we're looking at a mob that's lying down if(istype(cur_atom, /mob/living)) var/mob/living/cur_mob = cur_atom - if(!isxeno(cur_mob) && cur_mob.lying) //xenos don't use icon rotatin for lying. + if(!isxeno(cur_mob) && cur_mob.body_position == LYING_DOWN) //xenos don't use icon rotatin for lying. cur_icon.BecomeLying() // Calculate where we are relative to the center of the photo @@ -288,7 +288,7 @@ /obj/item/device/camera/proc/captureimage(atom/target, mob/user, flag) var/mob_descriptions = "" var/radius = (size-1)*0.5 - var/list/turf/turfs = RANGE_TURFS(radius, target) & view(world_view_size + radius, user.client) + var/list/turf/turfs = RANGE_TURFS(radius, target) & view(GLOB.world_view_size + radius, user.client) for(var/turf/the_turf as anything in turfs) mob_descriptions = get_mob_descriptions(the_turf, mob_descriptions) var/datum/picture/the_picture = createpicture(target, user, turfs, mob_descriptions, flag) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 731ad78caa5b..dd0327e3821d 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1000,7 +1000,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( SEND_SIGNAL(user, COMSIG_MOB_APC_POWER_PULSE, src) addtimer(VARSET_CALLBACK(src, shorted, FALSE), 2 MINUTES) -/obj/structure/machinery/power/apc/proc/can_use(mob/user as mob, loud = 0) //used by attack_hand() and Topic() +/obj/structure/machinery/power/apc/proc/can_use(mob/living/user as mob, loud = 0) //used by attack_hand() and Topic() if(user.client && user.client.remote_control) return TRUE @@ -1011,12 +1011,12 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( return 0 if(!(ishuman(user) || isRemoteControlling(user))) to_chat(user, SPAN_WARNING("You don't have the dexterity to use [src]!")) - nanomanager.close_user_uis(user, src) + SSnano.nanomanager.close_user_uis(user, src) return 0 if(user.is_mob_restrained()) to_chat(user, SPAN_WARNING("You must have free hands to use [src].")) return 0 - if(user.lying) + if(user.body_position == LYING_DOWN) to_chat(user, SPAN_WARNING("You can't reach [src]!")) return 0 autoflag = 5 @@ -1024,11 +1024,11 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( if(aidisabled) if(!loud) to_chat(user, SPAN_WARNING("[src] has AI control disabled!")) - nanomanager.close_user_uis(user, src) + SSnano.nanomanager.close_user_uis(user, src) return 0 else if((!in_range(src, user) || !istype(src.loc, /turf))) - nanomanager.close_user_uis(user, src) + SSnano.nanomanager.close_user_uis(user, src) return 0 var/mob/living/carbon/human/H = user diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index bee3e0aac8c2..00e6b92eab8f 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -81,13 +81,13 @@ if(has_power || !src.needs_power) if(machine_processing) if(stat & NOPOWER) - addToListNoDupe(processing_machines, src) // power interupted us, start processing again + addToListNoDupe(GLOB.processing_machines, src) // power interupted us, start processing again stat &= ~NOPOWER src.update_use_power(USE_POWER_IDLE) else if(machine_processing) - processing_machines -= src // no power, can't process. + GLOB.processing_machines -= src // no power, can't process. stat |= NOPOWER src.update_use_power(USE_POWER_NONE) @@ -97,19 +97,19 @@ // rebuild all power networks from scratch /proc/makepowernets() - for(var/datum/powernet/PN in powernets) + for(var/datum/powernet/PN in GLOB.powernets) del(PN) //not qdel on purpose, powernet is still using del. - powernets.Cut() + GLOB.powernets.Cut() - for(var/area/A in all_areas) - if(powernets_by_name[A.powernet_name]) + for(var/area/A in GLOB.all_areas) + if(GLOB.powernets_by_name[A.powernet_name]) continue var/datum/powernet/PN = new() PN.powernet_name = A.powernet_name - powernets += PN - powernets_by_name[A.powernet_name] = PN + GLOB.powernets += PN + GLOB.powernets_by_name[A.powernet_name] = PN - for(var/obj/structure/machinery/power/M in machines) + for(var/obj/structure/machinery/power/M in GLOB.machines) M.connect_to_network() return 1 @@ -222,7 +222,7 @@ var/cdir - for(var/card in cardinal) + for(var/card in GLOB.cardinals) var/turf/T = get_step(loc,card) cdir = get_dir(T,loc) @@ -250,7 +250,7 @@ var/area/A = get_area(src) if(!A) return 0 - var/datum/powernet/PN = powernets_by_name[A.powernet_name] + var/datum/powernet/PN = GLOB.powernets_by_name[A.powernet_name] if(!PN) return 0 powernet = PN diff --git a/code/modules/power/profiling.dm b/code/modules/power/profiling.dm index 21c8e2a63538..b4b67b8c8543 100644 --- a/code/modules/power/profiling.dm +++ b/code/modules/power/profiling.dm @@ -1,29 +1,27 @@ -datum +GLOBAL_VAR_INIT(enable_power_update_profiling, FALSE) -var/global/enable_power_update_profiling = 0 - -var/global/power_profiled_time = 0 -var/global/power_last_profile_time = 0 -var/global/list/power_update_requests_by_machine = list() -var/global/list/power_update_requests_by_area = list() +GLOBAL_VAR_INIT(power_profiled_time, 0) +GLOBAL_VAR_INIT(power_last_profile_time, 0) +GLOBAL_LIST_EMPTY(power_update_requests_by_machine) +GLOBAL_LIST_EMPTY(power_update_requests_by_area) /proc/log_power_update_request(area/A, obj/structure/machinery/M) - if (!enable_power_update_profiling) + if (!GLOB.enable_power_update_profiling) return var/machine_type = "[M.type]" - if (machine_type in power_update_requests_by_machine) - power_update_requests_by_machine[machine_type]++ + if (machine_type in GLOB.power_update_requests_by_machine) + GLOB.power_update_requests_by_machine[machine_type]++ else - power_update_requests_by_machine[machine_type] = 1 + GLOB.power_update_requests_by_machine[machine_type] = 1 - if (A.name in power_update_requests_by_area) - power_update_requests_by_area[A.name]++ + if (A.name in GLOB.power_update_requests_by_area) + GLOB.power_update_requests_by_area[A.name]++ else - power_update_requests_by_area[A.name] = 1 + GLOB.power_update_requests_by_area[A.name] = 1 - power_profiled_time += (world.time - power_last_profile_time) - power_last_profile_time = world.time + GLOB.power_profiled_time += (world.time - GLOB.power_last_profile_time) + GLOB.power_last_profile_time = world.time /client/proc/toggle_power_update_profiling() set name = "Toggle Area Power Update Profiling" @@ -31,14 +29,14 @@ var/global/list/power_update_requests_by_area = list() set category = "Debug.Profiling" if(!check_rights(R_DEBUG)) return if(!ishost(usr) || alert("Are you sure you want to do this?",, "Yes", "No") != "Yes") return - if(enable_power_update_profiling) - enable_power_update_profiling = 0 + if(GLOB.enable_power_update_profiling) + GLOB.enable_power_update_profiling = 0 to_chat(usr, "Area power update profiling disabled.") message_admins("[key_name(src)] toggled area power update profiling off.") else - enable_power_update_profiling = 1 - power_last_profile_time = world.time + GLOB.enable_power_update_profiling = 1 + GLOB.power_last_profile_time = world.time to_chat(usr, "Area power update profiling enabled.") message_admins("[key_name(src)] toggled area power update profiling on.") @@ -52,9 +50,9 @@ var/global/list/power_update_requests_by_area = list() if(!check_rights(R_DEBUG)) return - to_chat(usr, "Total profiling time: [power_profiled_time] ticks") - for (var/M in power_update_requests_by_machine) - to_chat(usr, "[M] = [power_update_requests_by_machine[M]]") + to_chat(usr, "Total profiling time: [GLOB.power_profiled_time] ticks") + for (var/M in GLOB.power_update_requests_by_machine) + to_chat(usr, "[M] = [GLOB.power_update_requests_by_machine[M]]") /client/proc/view_power_update_stats_area() set name = "View Area Power Update Statistics By Area" @@ -63,7 +61,7 @@ var/global/list/power_update_requests_by_area = list() if(!check_rights(R_DEBUG)) return - to_chat(usr, "Total profiling time: [power_profiled_time] ticks") - to_chat(usr, "Total profiling time: [power_profiled_time] ticks") - for (var/A in power_update_requests_by_area) - to_chat(usr, "[A] = [power_update_requests_by_area[A]]") + to_chat(usr, "Total profiling time: [GLOB.power_profiled_time] ticks") + to_chat(usr, "Total profiling time: [GLOB.power_profiled_time] ticks") + for (var/A in GLOB.power_update_requests_by_area) + to_chat(usr, "[A] = [GLOB.power_update_requests_by_area[A]]") diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 0e469a7fe577..7cf72ce1cb81 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -46,7 +46,7 @@ connect_to_network() dir_loop: - for(var/d in cardinal) + for(var/d in GLOB.cardinals) var/turf/T = get_step(src, d) for(var/obj/structure/machinery/power/terminal/term in T) if(term && term.dir == turn(d, 180)) diff --git a/code/modules/projectiles/ammo_boxes/grenade_packets.dm b/code/modules/projectiles/ammo_boxes/grenade_packets.dm index 83c222a0a128..5546fe3bc520 100644 --- a/code/modules/projectiles/ammo_boxes/grenade_packets.dm +++ b/code/modules/projectiles/ammo_boxes/grenade_packets.dm @@ -25,7 +25,7 @@ for(var/i in 1 to storage_slots) new content_type(src) -var/list/grenade_packets = list( +GLOBAL_LIST_INIT(grenade_packets, list( /obj/item/storage/box/packet/high_explosive, /obj/item/storage/box/packet/baton_slug, /obj/item/storage/box/packet/flare, @@ -37,7 +37,7 @@ var/list/grenade_packets = list( /obj/item/storage/box/packet/m15, /obj/item/storage/box/packet/airburst_he, /obj/item/storage/box/packet/airburst_incen - ) + )) /obj/item/storage/box/packet/high_explosive name = "\improper HEDP grenade packet" diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 4767f443506b..8d7ab1532ade 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -1400,7 +1400,7 @@ and you're good to go. var/damage_buff = BASE_BULLET_DAMAGE_MULT //if target is lying or unconscious - add damage bonus - if(attacked_mob.lying == TRUE || attacked_mob.stat == UNCONSCIOUS) + if(!(attacked_mob.mobility_flags & MOBILITY_STAND) || attacked_mob.stat == UNCONSCIOUS) damage_buff += BULLET_DAMAGE_MULT_TIER_4 projectile_to_fire.damage *= damage_buff //Multiply the damage for point blank. if(bullets_fired == 1) //First shot gives the PB message. @@ -1424,7 +1424,7 @@ and you're good to go. projectile_to_fire.give_bullet_traits(BP) if(bullets_fired > 1) BP.original = attacked_mob //original == the original target of the projectile. If the target is downed and this isn't set, the projectile will try to fly over it. Of course, it isn't going anywhere, but it's the principle of the thing. Very embarrassing. - if(!BP.handle_mob(attacked_mob) && attacked_mob.lying) //This is the 'handle impact' proc for a flying projectile, including hit RNG, on_hit_mob and bullet_act. If it misses, it doesn't go anywhere. We'll pretend it slams into the ground or punches a hole in the ceiling, because trying to make it bypass the xeno or shoot from the tile beyond it is probably more spaghet than my life is worth. + if(!BP.handle_mob(attacked_mob) && attacked_mob.body_position == LYING_DOWN) //This is the 'handle impact' proc for a flying projectile, including hit RNG, on_hit_mob and bullet_act. If it misses, it doesn't go anywhere. We'll pretend it slams into the ground or punches a hole in the ceiling, because trying to make it bypass the xeno or shoot from the tile beyond it is probably more spaghet than my life is worth. if(BP.ammo.sound_bounce) playsound(attacked_mob.loc, BP.ammo.sound_bounce, 35, 1) attacked_mob.visible_message(SPAN_AVOIDHARM("[BP] slams into [get_turf(attacked_mob)]!"), //Managing to miss an immobile target flat on the ground deserves some recognition, don't you think? @@ -1437,7 +1437,7 @@ and you're good to go. if(bullets_fired > 1) projectile_to_fire.original = attacked_mob - if(!projectile_to_fire.handle_mob(attacked_mob) && attacked_mob.lying) + if(!projectile_to_fire.handle_mob(attacked_mob) && attacked_mob.body_position == LYING_DOWN) if(projectile_to_fire.ammo.sound_bounce) playsound(attacked_mob.loc, projectile_to_fire.ammo.sound_bounce, 35, 1) attacked_mob.visible_message(SPAN_AVOIDHARM("[projectile_to_fire] slams into [get_turf(attacked_mob)]!"), diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 20781639a579..9f0ddd04fc11 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -495,6 +495,20 @@ Defined in conflicts.dm of the #defines folder. accuracy_mod = HIT_ACCURACY_MULT_TIER_3 scatter_mod = -SCATTER_AMOUNT_TIER_8 +/obj/item/attachable/pmc_sniperbarrel + name = "sniper barrel" + icon = 'icons/obj/items/weapons/guns/attachments/barrel.dmi' + icon_state = "pmc_sniperbarrel" + desc = "A heavy barrel. CANNOT BE REMOVED." + slot = "muzzle" + flags_attach_features = NO_FLAGS + hud_offset_mod = -3 + +/obj/item/attachable/pmc_sniperbarrel/New() + ..() + accuracy_mod = HIT_ACCURACY_MULT_TIER_3 + scatter_mod = -SCATTER_AMOUNT_TIER_8 + /obj/item/attachable/sniperbarrel/vulture name = "\improper M707 barrel" icon_state = "vulture_barrel" @@ -1283,7 +1297,7 @@ Defined in conflicts.dm of the #defines folder. switch(action) if("adjust_dir") var/direction = params["offset_dir"] - if(!(direction in alldirs) || !scoping || !scope_user) + if(!(direction in GLOB.alldirs) || !scoping || !scope_user) return var/mob/scoper = scope_user.resolve() @@ -1300,7 +1314,7 @@ Defined in conflicts.dm of the #defines folder. if("adjust_position") var/direction = params["position_dir"] - if(!(direction in alldirs) || !scoping || !scope_user) + if(!(direction in GLOB.alldirs) || !scoping || !scope_user) return var/mob/scoper = scope_user.resolve() @@ -1367,7 +1381,7 @@ Defined in conflicts.dm of the #defines folder. return TRUE /obj/item/attachable/vulture_scope/proc/get_offset_dirs() - var/list/possible_dirs = alldirs.Copy() + var/list/possible_dirs = GLOB.alldirs.Copy() if(scope_offset_x >= scope_drift_max) possible_dirs -= list(NORTHEAST, EAST, SOUTHEAST) else if(scope_offset_x <= -scope_drift_max) @@ -1384,7 +1398,7 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/vulture_scope/proc/get_adjust_dirs() if(!scoping) return list() - var/list/possible_dirs = alldirs.Copy() + var/list/possible_dirs = GLOB.alldirs.Copy() var/turf/current_turf = get_turf(src) var/turf/scope_tile = locate(scope_x, scope_y, current_turf.z) var/mob/scoper = scope_user.resolve() @@ -2671,7 +2685,7 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/attached_gun/grenade/unique_action(mob/user) if(!ishuman(usr)) return - if(!user.canmove || user.stat || user.is_mob_restrained() || !user.loc || !isturf(usr.loc)) + if(user.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(user, SPAN_WARNING("Not right now.")) return diff --git a/code/modules/projectiles/gun_helpers.dm b/code/modules/projectiles/gun_helpers.dm index ba5f8e491590..8e73124a8b92 100644 --- a/code/modules/projectiles/gun_helpers.dm +++ b/code/modules/projectiles/gun_helpers.dm @@ -462,7 +462,7 @@ DEFINES in setup.dm, referenced here. /obj/item/weapon/gun/proc/get_active_firearm(mob/user, restrictive = TRUE) if(!ishuman(usr)) return - if(!user.canmove || user.stat || user.is_mob_restrained() || !user.loc || !isturf(usr.loc)) + if(user.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(user, SPAN_WARNING("Not right now.")) return diff --git a/code/modules/projectiles/guns/boltaction.dm b/code/modules/projectiles/guns/boltaction.dm index c18e45e38d3e..d21cb5b87254 100644 --- a/code/modules/projectiles/guns/boltaction.dm +++ b/code/modules/projectiles/guns/boltaction.dm @@ -214,7 +214,7 @@ return . for(var/mob/current_mob as anything in get_mobs_in_z_level_range(get_turf(user), fire_message_range) - user) - var/relative_dir = get_dir(current_mob, user) + var/relative_dir = Get_Compass_Dir(current_mob, user) var/final_dir = dir2text(relative_dir) to_chat(current_mob, SPAN_HIGHDANGER("You hear a massive boom coming from [final_dir ? "the [final_dir]" : "nearby"]!")) if(current_mob.client) diff --git a/code/modules/projectiles/guns/flamer/flamer.dm b/code/modules/projectiles/guns/flamer/flamer.dm index 0089df506d2d..0e56efe7ab5d 100644 --- a/code/modules/projectiles/guns/flamer/flamer.dm +++ b/code/modules/projectiles/guns/flamer/flamer.dm @@ -732,7 +732,7 @@ GLOBAL_LIST_EMPTY(flamer_particles) if(target.density) return - for(var/spread_direction in alldirs) + for(var/spread_direction in GLOB.alldirs) var/spread_power = remaining_distance @@ -778,7 +778,7 @@ GLOBAL_LIST_EMPTY(flamer_particles) fire_reag.burncolor = f_color new/obj/flamer_fire(target, cause_data, fire_reag) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/spread_power = range switch(direction) if(NORTH,SOUTH,EAST,WEST) diff --git a/code/modules/projectiles/guns/flamer/flameshape.dm b/code/modules/projectiles/guns/flamer/flameshape.dm index f5a0699067e4..ae6c2dec0a67 100644 --- a/code/modules/projectiles/guns/flamer/flameshape.dm +++ b/code/modules/projectiles/guns/flamer/flameshape.dm @@ -28,7 +28,7 @@ /datum/flameshape/default/handle_fire_spread(obj/flamer_fire/F, fire_spread_amount, burn_dam, fuel_pressure = 1) var/turf/T var/turf/source_turf = get_turf(F.loc) - for(var/dirn in cardinal) + for(var/dirn in GLOB.cardinals) T = get_step(source_turf, dirn) if(istype(T, /turf/open/space)) continue @@ -64,7 +64,7 @@ id = FLAMESHAPE_STAR /datum/flameshape/star/proc/dirs_to_use() - return alldirs + return GLOB.alldirs /datum/flameshape/star/handle_fire_spread(obj/flamer_fire/F, fire_spread_amount, burn_dam, fuel_pressure = 1) fire_spread_amount = Floor(fire_spread_amount * 1.5) // branch 'length' @@ -102,9 +102,9 @@ /datum/flameshape/star/minor/dirs_to_use() if(prob(50)) - return cardinal + return GLOB.cardinals else - return diagonals + return GLOB.diagonals /datum/flameshape/line name = "Line" diff --git a/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm b/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm index 6d998002134c..356d0e6c3b48 100644 --- a/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm +++ b/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm @@ -190,7 +190,7 @@ smoke.start() playsound(src, 'sound/weapons/gun_rocketlauncher.ogg', 100, TRUE, 10) for(var/mob/living/carbon/C in backblast_loc) - if(!C.lying && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff + if(C.body_position == STANDING_UP && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff C.apply_damage(15, BRUTE) //The shockwave hurts, quite a bit. It can knock unarmored targets unconscious in real life C.apply_effect(4, STUN) //For good measure C.apply_effect(6, STUTTER) @@ -362,7 +362,7 @@ smoke.start() playsound(src, 'sound/weapons/gun_rocketlauncher.ogg', 100, TRUE, 10) for(var/mob/living/carbon/C in backblast_loc) - if(!C.lying && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff + if(C.body_position == STANDING_UP && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff C.apply_damage(15, BRUTE) //The shockwave hurts, quite a bit. It can knock unarmored targets unconscious in real life C.apply_effect(4, STUN) //For good measure C.apply_effect(6, STUTTER) diff --git a/code/modules/projectiles/guns/specialist/sniper.dm b/code/modules/projectiles/guns/specialist/sniper.dm index 1e72a425387b..0cd9d8dd16c8 100644 --- a/code/modules/projectiles/guns/specialist/sniper.dm +++ b/code/modules/projectiles/guns/specialist/sniper.dm @@ -75,7 +75,7 @@ /datum/action/item_action/specialist/aimed_shot/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && (holder_item == H.r_hand || holder_item || H.l_hand)) + if(istype(H) && !H.is_mob_incapacitated() && (holder_item == H.r_hand || holder_item || H.l_hand)) return TRUE /datum/action/item_action/specialist/aimed_shot/proc/use_ability(atom/A) @@ -337,12 +337,12 @@ damage_mult = BASE_BULLET_DAMAGE_MULT recoil = RECOIL_AMOUNT_TIER_5 -/obj/item/weapon/gun/rifle/sniper/xm43e1 +/obj/item/weapon/gun/rifle/sniper/XM43E1 name = "\improper XM43E1 experimental anti-materiel rifle" desc = "An experimental anti-materiel rifle produced by Armat Systems, recently reacquired from the deep storage of an abandoned prototyping facility. This one in particular is currently undergoing field testing. Chambered in 10x99mm Caseless." icon = 'icons/obj/items/weapons/guns/guns_by_faction/uscm.dmi' - icon_state = "xm42b" - item_state = "xm42b" + icon_state = "xm43e1" + item_state = "xm43e1" unacidable = TRUE indestructible = 1 @@ -353,12 +353,12 @@ zoomdevicename = "scope" attachable_allowed = list(/obj/item/attachable/bipod) flags_gun_features = GUN_AUTO_EJECTOR|GUN_SPECIALIST|GUN_WIELDED_FIRING_ONLY|GUN_AMMO_COUNTER - starting_attachment_types = list(/obj/item/attachable/sniperbarrel) + starting_attachment_types = list(/obj/item/attachable/pmc_sniperbarrel) sniper_beam_type = /obj/effect/ebeam/laser/intense sniper_beam_icon = "laser_beam_intense" sniper_lockon_icon = "sniper_lockon_intense" -/obj/item/weapon/gun/rifle/sniper/XM42B/handle_starting_attachment() +/obj/item/weapon/gun/rifle/sniper/XM43E1/handle_starting_attachment() ..() var/obj/item/attachable/scope/variable_zoom/S = new(src) S.icon_state = "pmcscope" @@ -368,11 +368,11 @@ update_attachable(S.slot) -/obj/item/weapon/gun/rifle/sniper/XM42B/set_gun_attachment_offsets() +/obj/item/weapon/gun/rifle/sniper/XM43E1/set_gun_attachment_offsets() attachable_offset = list("muzzle_x" = 32, "muzzle_y" = 18,"rail_x" = 15, "rail_y" = 19, "under_x" = 20, "under_y" = 15, "stock_x" = 20, "stock_y" = 15) -/obj/item/weapon/gun/rifle/sniper/XM42B/set_gun_config_values() +/obj/item/weapon/gun/rifle/sniper/XM43E1/set_gun_config_values() ..() set_fire_delay(FIRE_DELAY_TIER_6 * 6 )//Big boy damage, but it takes a lot of time to fire a shot. //Kaga: Adjusted from 56 (Tier 4, 7*8) -> 30 (Tier 6, 5*6) ticks. 95 really wasn't big-boy damage anymore, although I updated it to 125 to remain consistent with the other 10x99mm caliber weapon (M42C). Now takes only twice as long as the M42A. @@ -382,7 +382,7 @@ damage_mult = BASE_BULLET_DAMAGE_MULT recoil = RECOIL_AMOUNT_TIER_1 -/obj/item/weapon/gun/rifle/sniper/XM42B/set_bullet_traits() +/obj/item/weapon/gun/rifle/sniper/XM43E1/set_bullet_traits() LAZYADD(traits_to_give, list( BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff), BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_penetrating), @@ -415,7 +415,7 @@ force = 17 zoomdevicename = "scope" flags_gun_features = GUN_AUTO_EJECTOR|GUN_WY_RESTRICTED|GUN_SPECIALIST|GUN_WIELDED_FIRING_ONLY|GUN_AMMO_COUNTER - starting_attachment_types = list(/obj/item/attachable/sniperbarrel) + starting_attachment_types = list(/obj/item/attachable/pmc_sniperbarrel) sniper_beam_type = /obj/effect/ebeam/laser/intense sniper_beam_icon = "laser_beam_intense" sniper_lockon_icon = "sniper_lockon_intense" @@ -450,7 +450,7 @@ . = ..() if(.) var/mob/living/carbon/human/PMC_sniper = user - if(PMC_sniper.lying == 0 && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/smartgunner/veteran/pmc) && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/veteran)) + if(PMC_sniper.body_position == STANDING_UP && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/smartgunner/veteran/pmc) && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/veteran)) PMC_sniper.visible_message(SPAN_WARNING("[PMC_sniper] is blown backwards from the recoil of the [src.name]!"),SPAN_HIGHDANGER("You are knocked prone by the blowback!")) step(PMC_sniper,turn(PMC_sniper.dir,180)) PMC_sniper.apply_effect(5, WEAKEN) diff --git a/code/modules/projectiles/magazines/shotguns.dm b/code/modules/projectiles/magazines/shotguns.dm index 24e482549dac..9f137b1c2316 100644 --- a/code/modules/projectiles/magazines/shotguns.dm +++ b/code/modules/projectiles/magazines/shotguns.dm @@ -8,11 +8,11 @@ you're looking back on the different shotgun projectiles available. In short of one type of shotgun ammo, but I think it helps in referencing it. ~N */ -var/list/shotgun_boxes_12g = list( +GLOBAL_LIST_INIT(shotgun_boxes_12g, list( /obj/item/ammo_magazine/shotgun/buckshot, /obj/item/ammo_magazine/shotgun/flechette, /obj/item/ammo_magazine/shotgun/slugs - ) + )) /obj/item/ammo_magazine/shotgun name = "box of shotgun slugs" @@ -151,21 +151,21 @@ also doesn't really matter. You can only reload them with handfuls. Handfuls of shotgun rounds. For spawning directly on mobs in roundstart, ERTs, etc */ -var/list/shotgun_handfuls_8g = list( +GLOBAL_LIST_INIT(shotgun_handfuls_8g, list( /obj/item/ammo_magazine/handful/shotgun/heavy/slug, /obj/item/ammo_magazine/handful/shotgun/heavy/buckshot, /obj/item/ammo_magazine/handful/shotgun/heavy/flechette, /obj/item/ammo_magazine/handful/shotgun/heavy/dragonsbreath - ) + )) -var/list/shotgun_handfuls_12g = list( +GLOBAL_LIST_INIT(shotgun_handfuls_12g, list( /obj/item/ammo_magazine/handful/shotgun/slug, /obj/item/ammo_magazine/handful/shotgun/buckshot, /obj/item/ammo_magazine/handful/shotgun/flechette, /obj/item/ammo_magazine/handful/shotgun/incendiary, /obj/item/ammo_magazine/handful/shotgun/buckshot/incendiary, /obj/item/ammo_magazine/handful/shotgun/beanbag - ) + )) /obj/item/ammo_magazine/handful/shotgun name = "handful of shotgun slugs (12g)" diff --git a/code/modules/projectiles/magazines/specialist.dm b/code/modules/projectiles/magazines/specialist.dm index 821273247f66..761e77305254 100644 --- a/code/modules/projectiles/magazines/specialist.dm +++ b/code/modules/projectiles/magazines/specialist.dm @@ -27,14 +27,14 @@ default_ammo = /datum/ammo/bullet/sniper/flak ammo_band_color = AMMO_BAND_COLOR_IMPACT -//M42B Magazine +//XM43E1 Magazine /obj/item/ammo_magazine/sniper/anti_materiel - name = "\improper XM42B marksman magazine (10x99mm)" + name = "\improper XM43E1 marksman magazine (10x99mm)" desc = "A magazine of caseless 10x99mm anti-materiel rounds." max_rounds = 8 caliber = "10x99mm" default_ammo = /datum/ammo/bullet/sniper/anti_materiel - gun_type = /obj/item/weapon/gun/rifle/sniper/XM42B + gun_type = /obj/item/weapon/gun/rifle/sniper/XM43E1 //M42C magazine diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index adb97e3a1c43..7de8f12fc546 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -193,10 +193,10 @@ setDir(get_dir(loc, target_turf)) var/ammo_flags = ammo.flags_ammo_behavior | projectile_override_flags - if(round_statistics && ammo_flags & AMMO_BALLISTIC) - round_statistics.total_projectiles_fired++ + if(GLOB.round_statistics && ammo_flags & AMMO_BALLISTIC) + GLOB.round_statistics.total_projectiles_fired++ if(ammo.bonus_projectiles_amount) - round_statistics.total_projectiles_fired += ammo.bonus_projectiles_amount + GLOB.round_statistics.total_projectiles_fired += ammo.bonus_projectiles_amount if(firer && ismob(firer) && weapon_cause_data) var/mob/M = firer M.track_shot(weapon_cause_data.cause_name) @@ -466,7 +466,7 @@ def_zone = rand_zone() // Other targets do the same roll with penalty - a near hit will hit but redirected to another limb - else if(!isxeno(L) && hit_roll > hit_chance - 20 - base_miss_chance[def_zone]) + else if(!isxeno(L) && hit_roll > hit_chance - 20 - GLOB.base_miss_chance[def_zone]) def_zone = rand_zone() else @@ -478,7 +478,7 @@ // simply to avoid them from resetting target to chest every time they want to shoot a xeno if(!direct_hit || !isxeno(L)) // For normal people or direct hits we apply the limb accuracy penalty - hit_chance -= base_miss_chance[def_zone] + hit_chance -= GLOB.base_miss_chance[def_zone] // else for direct hits on xenos, we skip it, pretending it's a chest shot with zero penalty #if DEBUG_HIT_CHANCE @@ -517,7 +517,7 @@ X.behavior_delegate.on_hitby_projectile(ammo) . = TRUE - else if(!L.lying) + else if(L.body_position != LYING_DOWN) animatation_displace_reset(L) if(ammo.sound_miss) playsound_client(L.client, ammo.sound_miss, get_turf(L), 75, TRUE) L.visible_message(SPAN_AVOIDHARM("[src] misses [L]!"), @@ -766,8 +766,8 @@ //mobs use get_projectile_hit_chance instead of get_projectile_hit_boolean /mob/living/proc/get_projectile_hit_chance(obj/projectile/P) - if(lying && src != P.original) - return FALSE + if((body_position == LYING_DOWN || HAS_TRAIT(src, TRAIT_NESTED)) && src != P.original) + return FALSE // Snowflake check for xeno nests, because we want bullets to fly through even though they're standing in it var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags if(ammo_flags & AMMO_XENO) if((status_flags & XENO_HOST) && HAS_TRAIT(src, TRAIT_NESTED)) @@ -775,7 +775,7 @@ . = P.get_effective_accuracy() - if(lying && stat) + if(body_position == LYING_DOWN && stat) . += 15 //Bonus hit against unconscious people. if(isliving(P.firer)) @@ -1185,7 +1185,7 @@ var/area/A = get_area(src) if(ishuman(firingMob) && ishuman(src) && faction == firingMob.faction && !A?.statistic_exempt) //One human shot another, be worried about it but do everything basically the same //special_role should be null or an empty string if done correctly if(!istype(P.ammo, /datum/ammo/energy/taser)) - round_statistics.total_friendly_fire_instances++ + GLOB.round_statistics.total_friendly_fire_instances++ var/ff_msg = "[key_name(firingMob)] shot [key_name(src)] with \a [P.name] in [get_area(firingMob)] [ADMIN_JMP(firingMob)] [ADMIN_PM(firingMob)]" var/ff_living = TRUE if(src.stat == DEAD) diff --git a/code/modules/reagents/Chemistry-Generator.dm b/code/modules/reagents/Chemistry-Generator.dm index bb8f69b714b2..b2e6402d4b06 100644 --- a/code/modules/reagents/Chemistry-Generator.dm +++ b/code/modules/reagents/Chemistry-Generator.dm @@ -75,56 +75,56 @@ if(my_chemid) //Do we want a specific chem? chem_id = my_chemid else if(class) //do we want a specific class? - chem_id = pick(chemical_gen_classes_list["C[class]"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C[class]"]) else var/roll = rand(0,100) switch(tier) if(0) - chem_id = pick(chemical_gen_classes_list["C"])//If tier is 0, we can add any classed chemical + chem_id = pick(GLOB.chemical_gen_classes_list["C"])//If tier is 0, we can add any classed chemical if(1) if(roll<=35) - chem_id = pick(chemical_gen_classes_list["C1"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C1"]) else if(roll<=65) - chem_id = pick(chemical_gen_classes_list["C2"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C2"]) else if(roll<=85) - chem_id = pick(chemical_gen_classes_list["C3"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C3"]) else - chem_id = pick(chemical_gen_classes_list["C4"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C4"]) if(2) if(roll<=30) - chem_id = pick(chemical_gen_classes_list["C1"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C1"]) else if(roll<=55) - chem_id = pick(chemical_gen_classes_list["C2"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C2"]) else if(roll<=70) - chem_id = pick(chemical_gen_classes_list["C3"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C3"]) else - chem_id = pick(chemical_gen_classes_list["C4"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C4"]) if(3) if(roll<=10) - chem_id = pick(chemical_gen_classes_list["C1"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C1"]) else if(roll<=30) - chem_id = pick(chemical_gen_classes_list["C2"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C2"]) else if(roll<=50) - chem_id = pick(chemical_gen_classes_list["C3"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C3"]) else if(roll<=70) - chem_id = pick(chemical_gen_classes_list["C4"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C4"]) else - chem_id = pick(chemical_gen_classes_list["C5"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C5"]) else if(!required_reagents || is_catalyst)//first component is more likely to be special in chems tier 4 or higher, catalysts are always special in tier 4 or higher if (prob(50)) - chem_id = pick(chemical_gen_classes_list["C5"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C5"]) else - chem_id = pick(chemical_gen_classes_list["C4"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C4"]) else if(roll<=15) - chem_id = pick(chemical_gen_classes_list["C2"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C2"]) else if(roll<=40) - chem_id = pick(chemical_gen_classes_list["C3"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C3"]) else if(roll<=65) - chem_id = pick(chemical_gen_classes_list["C4"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C4"]) else - chem_id = pick(chemical_gen_classes_list["C5"]) + chem_id = pick(GLOB.chemical_gen_classes_list["C5"]) //if we are already using this reagent, try again if(required_reagents && required_reagents.Find(chem_id)) @@ -169,7 +169,7 @@ while(!gen_name) gen_name = addtext(pick(prefix),pick(wordroot),pick(suffix)) //Make sure this name is not already used - for(var/datum/reagent/R in chemical_reagents_list) + for(var/datum/reagent/R in GLOB.chemical_reagents_list) if(R.name == gen_name)//if we are already using this name, try again gen_name = "" //set name @@ -249,58 +249,58 @@ var/property var/roll = rand(1,100) if(make_rare) - property = pick(chemical_properties_list["rare"]) + property = pick(GLOB.chemical_properties_list["rare"]) //Pick the property by value and roll else if(value_offset > 0) //Balance the value of our chemical - property = pick(chemical_properties_list["positive"]) + property = pick(GLOB.chemical_properties_list["positive"]) else if(value_offset < 0) if(roll <= gen_tier*10) - property = pick(chemical_properties_list["negative"]) + property = pick(GLOB.chemical_properties_list["negative"]) else - property = pick(chemical_properties_list["neutral"]) + property = pick(GLOB.chemical_properties_list["neutral"]) else switch(gen_tier) if(1) if(roll<=20) - property = pick(chemical_properties_list["negative"]) + property = pick(GLOB.chemical_properties_list["negative"]) else if (roll<=50) - property = pick(chemical_properties_list["neutral"]) + property = pick(GLOB.chemical_properties_list["neutral"]) else - property = pick(chemical_properties_list["positive"]) + property = pick(GLOB.chemical_properties_list["positive"]) if(2) if(roll<=25) - property = pick(chemical_properties_list["negative"]) + property = pick(GLOB.chemical_properties_list["negative"]) else if (roll<=45) - property = pick(chemical_properties_list["neutral"]) + property = pick(GLOB.chemical_properties_list["neutral"]) else - property = pick(chemical_properties_list["positive"]) + property = pick(GLOB.chemical_properties_list["positive"]) if(3) if(roll<=15) - property = pick(chemical_properties_list["negative"]) + property = pick(GLOB.chemical_properties_list["negative"]) else if (roll<=40) - property = pick(chemical_properties_list["neutral"]) + property = pick(GLOB.chemical_properties_list["neutral"]) else - property = pick(chemical_properties_list["positive"]) + property = pick(GLOB.chemical_properties_list["positive"]) else if(roll<=15) - property = pick(chemical_properties_list["negative"]) + property = pick(GLOB.chemical_properties_list["negative"]) else if (roll<=40) - property = pick(chemical_properties_list["neutral"]) + property = pick(GLOB.chemical_properties_list["neutral"]) else - property = pick(chemical_properties_list["positive"]) + property = pick(GLOB.chemical_properties_list["positive"]) if(track_added_properties) //Generated effects are more unique for lower-tier chemicals, but not higher-tier ones var/property_checks = 0 while(!check_generated_properties(property) && property_checks < 4) property_checks++ - if(LAZYISIN(chemical_properties_list["negative"], property)) - property = pick(chemical_properties_list["negative"]) - else if(LAZYISIN(chemical_properties_list["neutral"], property)) - property = pick(chemical_properties_list["neutral"]) + if(LAZYISIN(GLOB.chemical_properties_list["negative"], property)) + property = pick(GLOB.chemical_properties_list["negative"]) + else if(LAZYISIN(GLOB.chemical_properties_list["neutral"], property)) + property = pick(GLOB.chemical_properties_list["neutral"]) else - property = pick(chemical_properties_list["positive"]) + property = pick(GLOB.chemical_properties_list["positive"]) - var/datum/chem_property/P = chemical_properties_list[property] + var/datum/chem_property/P = GLOB.chemical_properties_list[property] //Calculate what our chemical value is with our level var/new_value @@ -389,7 +389,7 @@ return FALSE break //Insert the property - var/datum/chem_property/P = chemical_properties_list[property] + var/datum/chem_property/P = GLOB.chemical_properties_list[property] P = new P.type() P.level = level P.holder = src @@ -397,7 +397,7 @@ //Special case: If it's a catalyst property, add it nonetheless. if(initial_property && initial_property != property) - P = chemical_properties_list[initial_property] + P = GLOB.chemical_properties_list[initial_property] if(P.category & PROPERTY_TYPE_CATALYST) P = new P.type() P.level = level @@ -425,22 +425,22 @@ C.gen_tier = gen_tier if(!C.generate_recipe(complexity)) return //Generating a recipe failed, so return null - chemical_reactions_list[C.id] = C + GLOB.chemical_reactions_list[C.id] = C C.add_to_filtered_list() return C //Returns false if a property has been generated in a previous reagent and all properties of that category haven't been generated yet. /datum/reagent/proc/check_generated_properties(datum/chem_property/P) - if(LAZYISIN(chemical_properties_list["positive"], P)) - if(LAZYISIN(GLOB.generated_properties["positive"], P) && LAZYLEN(GLOB.generated_properties["positive"]) < LAZYLEN(chemical_properties_list["positive"])) + if(LAZYISIN(GLOB.chemical_properties_list["positive"], P)) + if(LAZYISIN(GLOB.generated_properties["positive"], P) && LAZYLEN(GLOB.generated_properties["positive"]) < LAZYLEN(GLOB.chemical_properties_list["positive"])) return FALSE GLOB.generated_properties["positive"] += P - else if(LAZYISIN(chemical_properties_list["negative"], P)) - if(LAZYISIN(GLOB.generated_properties["negative"], P) && LAZYLEN(GLOB.generated_properties["negative"]) < LAZYLEN(chemical_properties_list["negative"])) + else if(LAZYISIN(GLOB.chemical_properties_list["negative"], P)) + if(LAZYISIN(GLOB.generated_properties["negative"], P) && LAZYLEN(GLOB.generated_properties["negative"]) < LAZYLEN(GLOB.chemical_properties_list["negative"])) return FALSE GLOB.generated_properties["negative"] += P - else if(LAZYISIN(chemical_properties_list["neutral"], P)) - if(LAZYISIN(GLOB.generated_properties["neutral"], P) && LAZYLEN(GLOB.generated_properties["neutral"]) < LAZYLEN(chemical_properties_list["neutral"])) + else if(LAZYISIN(GLOB.chemical_properties_list["neutral"], P)) + if(LAZYISIN(GLOB.generated_properties["neutral"], P) && LAZYLEN(GLOB.generated_properties["neutral"]) < LAZYLEN(GLOB.chemical_properties_list["neutral"])) return FALSE GLOB.generated_properties["neutral"] += P return TRUE diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 2c08e9f4e693..dcb949424bdf 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -25,7 +25,7 @@ maximum_volume = maximum #ifdef UNIT_TESTS - if(!chemical_reagents_list || !chemical_reactions_filtered_list || !chemical_properties_list) + if(!GLOB.chemical_reagents_list || !GLOB.chemical_reactions_filtered_list || !GLOB.chemical_properties_list) CRASH("Chemistry reagents are not set up!") #endif @@ -240,7 +240,7 @@ O.volume += R.volume qdel(R) break - for(var/reaction in chemical_reactions_filtered_list[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id + for(var/reaction in GLOB.chemical_reactions_filtered_list[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id if(!reaction) continue @@ -417,10 +417,10 @@ handle_reactions() return FALSE - var/datum/reagent/D = chemical_reagents_list[reagent] + var/datum/reagent/D = GLOB.chemical_reagents_list[reagent] if(D) if(!istype(D, /datum/reagent)) - CRASH("Not REAGENT - [reagent] - chemical_reagents_list[reagent]") + CRASH("Not REAGENT - [reagent] - GLOB.chemical_reagents_list[reagent]") var/datum/reagent/R = new D.type() if(D.type == /datum/reagent/generated) diff --git a/code/modules/reagents/Chemistry-Reactions.dm b/code/modules/reagents/Chemistry-Reactions.dm index 1d9c03f9e923..7a8f0b21158a 100644 --- a/code/modules/reagents/Chemistry-Reactions.dm +++ b/code/modules/reagents/Chemistry-Reactions.dm @@ -22,15 +22,15 @@ /datum/chemical_reaction/proc/add_to_filtered_list(reset = FALSE) if(reset) - for(var/R in chemical_reactions_filtered_list) - LAZYREMOVE(chemical_reactions_filtered_list[R], src) + for(var/R in GLOB.chemical_reactions_filtered_list) + LAZYREMOVE(GLOB.chemical_reactions_filtered_list[R], src) for(var/R in required_reagents) - LAZYADD(chemical_reactions_filtered_list[R], src) + LAZYADD(GLOB.chemical_reactions_filtered_list[R], src) /datum/chemical_reaction/proc/check_duplicate() for(var/R in required_reagents) - if(chemical_reactions_filtered_list[R]) - for(var/reaction in chemical_reactions_filtered_list[R])//We filter the chemical_reactions_filtered_list so we don't have to search through as much + if(GLOB.chemical_reactions_filtered_list[R]) + for(var/reaction in GLOB.chemical_reactions_filtered_list[R])//We filter the GLOB.chemical_reactions_filtered_list so we don't have to search through as much var/datum/chemical_reaction/C = reaction var/matches = 0 for(var/B in required_reagents) @@ -43,7 +43,7 @@ // To prevent such a situation, if ALL reagent inside a reaction are medical chemicals, the recipe is considered flawed. /datum/chemical_reaction/proc/check_reaction_uses_all_default_medical() for(var/R in required_reagents) - var/datum/reagent/M = chemical_reagents_list[R] + var/datum/reagent/M = GLOB.chemical_reagents_list[R] if(!(initial(M.flags) & REAGENT_TYPE_MEDICAL)) return FALSE return TRUE diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 7f659c54c40d..6d36765146ed 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -267,37 +267,37 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) if(chemclass && !(flags & REAGENT_NO_GENERATION)) switch(chemclass) if(CHEM_CLASS_BASIC) - chemical_gen_classes_list["C1"] += id + GLOB.chemical_gen_classes_list["C1"] += id if(CHEM_CLASS_COMMON) - chemical_gen_classes_list["C2"] += id + GLOB.chemical_gen_classes_list["C2"] += id if(CHEM_CLASS_UNCOMMON) - chemical_gen_classes_list["C3"] += id + GLOB.chemical_gen_classes_list["C3"] += id if(CHEM_CLASS_RARE) - chemical_gen_classes_list["C4"] += id + GLOB.chemical_gen_classes_list["C4"] += id if(CHEM_CLASS_SPECIAL) - chemical_gen_classes_list["C5"] += id - chemical_data.add_chemical_objective(src) + GLOB.chemical_gen_classes_list["C5"] += id + GLOB.chemical_data.add_chemical_objective(src) if(CHEM_CLASS_ULTRA) - chemical_gen_classes_list["C6"] += id - chemical_data.add_chemical_objective(src) - chemical_gen_classes_list["C"] += id + GLOB.chemical_gen_classes_list["C6"] += id + GLOB.chemical_data.add_chemical_objective(src) + GLOB.chemical_gen_classes_list["C"] += id if(gen_tier) switch(gen_tier) if(1) - chemical_gen_classes_list["T1"] += id + GLOB.chemical_gen_classes_list["T1"] += id if(2) - chemical_gen_classes_list["T2"] += id + GLOB.chemical_gen_classes_list["T2"] += id if(3) - chemical_gen_classes_list["T3"] += id + GLOB.chemical_gen_classes_list["T3"] += id if(4) - chemical_gen_classes_list["T4"] += id + GLOB.chemical_gen_classes_list["T4"] += id if(5) - chemical_gen_classes_list["T5"] += id + GLOB.chemical_gen_classes_list["T5"] += id /datum/reagent/proc/properties_to_datums() #ifdef UNIT_TESTS - if(!chemical_properties_list) + if(!GLOB.chemical_properties_list) CRASH("Chemistry reagents are not set up!") #endif @@ -306,7 +306,7 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) if(istype(prop, /datum/chem_property)) new_properties += prop continue - var/datum/chem_property/chem = chemical_properties_list[prop] + var/datum/chem_property/chem = GLOB.chemical_properties_list[prop] if(chem) chem = new chem.type() chem.level = properties[prop] diff --git a/code/modules/reagents/chemical_research/Chemical-Research.dm b/code/modules/reagents/chemical_research/Chemical-Research.dm index 0b1152154dc3..e66cb474df50 100644 --- a/code/modules/reagents/chemical_research/Chemical-Research.dm +++ b/code/modules/reagents/chemical_research/Chemical-Research.dm @@ -1,4 +1,4 @@ -var/global/datum/chemical_data/chemical_data = new /datum/chemical_data +GLOBAL_DATUM_INIT(chemical_data, /datum/chemical_data, new) /datum/chemical_data var/rsc_credits = 0 @@ -38,7 +38,7 @@ var/global/datum/chemical_data/chemical_data = new /datum/chemical_data /datum/chemical_data/proc/get_report(doc_type, doc_title) var/obj/item/paper/research_report/report = null - for(var/document_data in chemical_data.research_documents[doc_type]) + for(var/document_data in GLOB.chemical_data.research_documents[doc_type]) if(document_data["document_title"] == doc_title) report = document_data["document"] break @@ -92,7 +92,7 @@ var/global/datum/chemical_data/chemical_data = new /datum/chemical_data if(LAZYLEN(property_names)) has_new_properties = TRUE for(var/name in property_names) - var/datum/chem_property/ref = chemical_properties_list[name] + var/datum/chem_property/ref = GLOB.chemical_properties_list[name] var/datum/chem_property/P = new ref.type P.level = 0 research_property_data += P @@ -146,7 +146,7 @@ var/global/datum/chemical_data/chemical_data = new /datum/chemical_data chemical_not_completed_objective_list[chem.id] = chem.objective_value /datum/chemical_data/proc/get_tgui_data(chemid) - var/datum/reagent/chem = chemical_reagents_list[chemid] + var/datum/reagent/chem = GLOB.chemical_reagents_list[chemid] if(!chem) error("Invalid chemid [chemid]") return diff --git a/code/modules/reagents/chemical_research/generated_reagents.dm b/code/modules/reagents/chemical_research/generated_reagents.dm index 6eaa664b6d7e..a21d74e26f8a 100644 --- a/code/modules/reagents/chemical_research/generated_reagents.dm +++ b/code/modules/reagents/chemical_research/generated_reagents.dm @@ -16,21 +16,21 @@ //Generate stats if(!id) //So we can initiate a new datum without generating it return - if(!chemical_reagents_list[id]) + if(!GLOB.chemical_reagents_list[id]) generate_name() generate_stats() - chemical_reagents_list[id] = src - make_alike(chemical_reagents_list[id]) + GLOB.chemical_reagents_list[id] = src + make_alike(GLOB.chemical_reagents_list[id]) recalculate_variables() /datum/chemical_reaction/generated/New() //Generate recipe if(!id) //So we can initiate a new datum without generating it return - if(!chemical_reactions_list[id]) + if(!GLOB.chemical_reactions_list[id]) generate_recipe() - chemical_reactions_list[id] = src - make_alike(chemical_reactions_list[id]) + GLOB.chemical_reactions_list[id] = src + make_alike(GLOB.chemical_reactions_list[id]) /////////Tier 1 /datum/chemical_reaction/generated/alpha diff --git a/code/modules/reagents/chemistry_machinery/acid_harness.dm b/code/modules/reagents/chemistry_machinery/acid_harness.dm index ae54474c3aed..52a1a5f13bd7 100644 --- a/code/modules/reagents/chemistry_machinery/acid_harness.dm +++ b/code/modules/reagents/chemistry_machinery/acid_harness.dm @@ -443,7 +443,7 @@ else if(inject_conditions & ACID_SCAN_CONDITION_DEFIB && vitals_scan < ACID_VITALS_DEAD && last_vitals_scan & ACID_SCAN_CONDITION_DEATH) condition_scan |= ACID_SCAN_CONDITION_DEFIB //If we were previously dead and are now alive, we assume we got defibbed - if(inject_conditions & ACID_SCAN_CONDITION_CONCUSSION && (user.knocked_down || user.knocked_out)) + if(inject_conditions & ACID_SCAN_CONDITION_CONCUSSION && (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || HAS_TRAIT(src, TRAIT_FLOORED))) condition_scan |= ACID_SCAN_CONDITION_CONCUSSION if(inject_conditions & ACID_SCAN_CONDITION_INTOXICATION && (user.dazed || user.slowed || user.confused || user.drowsyness || user.dizziness || user.druggy)) diff --git a/code/modules/reagents/chemistry_machinery/chem_dispenser.dm b/code/modules/reagents/chemistry_machinery/chem_dispenser.dm index 6778bdd3c72b..85ed21543127 100644 --- a/code/modules/reagents/chemistry_machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry_machinery/chem_dispenser.dm @@ -59,7 +59,7 @@ /obj/structure/machinery/chem_dispenser/process() if(!chem_storage) - chem_storage = chemical_data.connect_chem_storage(network) + chem_storage = GLOB.chemical_data.connect_chem_storage(network) /obj/structure/machinery/chem_dispenser/Initialize() . = ..() @@ -68,7 +68,7 @@ /obj/structure/machinery/chem_dispenser/Destroy() if(!chem_storage) - chem_storage = chemical_data.disconnect_chem_storage(network) + chem_storage = GLOB.chemical_data.disconnect_chem_storage(network) return ..() /obj/structure/machinery/chem_dispenser/ex_act(severity) @@ -155,7 +155,7 @@ var/list/chemicals = list() for(var/re in dispensable_reagents) - var/datum/reagent/temp = chemical_reagents_list[re] + var/datum/reagent/temp = GLOB.chemical_reagents_list[re] if(temp) var/chemname = temp.name chemicals.Add(list(list("title" = chemname, "id" = temp.id))) diff --git a/code/modules/reagents/chemistry_machinery/chem_simulator.dm b/code/modules/reagents/chemistry_machinery/chem_simulator.dm index 2c8602b0dab7..1debbc56b495 100644 --- a/code/modules/reagents/chemistry_machinery/chem_simulator.dm +++ b/code/modules/reagents/chemistry_machinery/chem_simulator.dm @@ -62,7 +62,7 @@ ..() if(inoperable()) icon_state = "modifier_off" - nanomanager.update_uis(src) // update all UIs attached to src + SSnano.nanomanager.update_uis(src) // update all UIs attached to src /obj/structure/machinery/chem_simulator/attackby(obj/item/B, mob/living/user) if(!skillcheck(user, SKILL_RESEARCH, SKILL_RESEARCH_TRAINED)) @@ -93,7 +93,7 @@ to_chat(user, SPAN_NOTICE("You insert [B] into the [src].")) flick("[icon_state]_reading",src) update_costs() - nanomanager.update_uis(src) // update all UIs attached to src + SSnano.nanomanager.update_uis(src) // update all UIs attached to src /obj/structure/machinery/chem_simulator/attack_hand(mob/user as mob) if(inoperable()) @@ -105,7 +105,7 @@ /obj/structure/machinery/chem_simulator/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) var/list/data = list( - "rsc_credits" = chemical_data.rsc_credits, + "rsc_credits" = GLOB.chemical_data.rsc_credits, "target" = target, "reference" = reference, "mode" = mode, @@ -122,7 +122,7 @@ if(simulating == SIMULATION_STAGE_FINAL) for(var/reagent_id in recipe_targets) - var/datum/reagent/R = chemical_reagents_list[reagent_id] + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id] var/list/id_name[0] id_name["[R.id]"] = R.name data["recipe_targets"] += id_name @@ -134,7 +134,7 @@ //List of all available properties data["property_data_list"] = list() - for(var/datum/chem_property/P in chemical_data.research_property_data) + for(var/datum/chem_property/P in GLOB.chemical_data.research_property_data) data["property_codings"][P.name] = P.code if(template_filter && !check_bitflag(P.category, template_filter)) continue @@ -182,7 +182,7 @@ else data["reference_info"] = "" - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = SSnano.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if(!ui) ui = new(user, src, ui_key, "chem_simulator.tmpl", "Synthesis Simulator", 800, 550) ui.set_initial_data(data) @@ -198,7 +198,7 @@ if(user.stat || user.is_mob_restrained() || !in_range(src, user)) return - if(mode == MODE_CREATE && chemical_data.has_new_properties) + if(mode == MODE_CREATE && GLOB.chemical_data.has_new_properties) update_costs() if(href_list["simulate"] && ready) @@ -252,7 +252,7 @@ return if(mode == MODE_CREATE) var/target_name = href_list["set_target"] - for(var/datum/chem_property/P in chemical_data.research_property_data) + for(var/datum/chem_property/P in GLOB.chemical_data.research_property_data) if(P.name == target_name) if(target_property && target_property.name == target_name) //Toggle the property @@ -294,15 +294,15 @@ newname = reject_bad_name(newname, TRUE, 20, FALSE) if(isnull(newname)) to_chat(user, "Bad name.") - else if(chemical_reagents_list[newname]) + else if(GLOB.chemical_reagents_list[newname]) to_chat(user, "Name already taken.") else creation_name = newname else if(href_list["set_level"] && target_property) var/level_to_set = 1 - if(chemical_data.clearance_level <= 2) + if(GLOB.chemical_data.clearance_level <= 2) level_to_set = tgui_input_list(usr, "Set target level for [target_property.name]:","[src]", list(1,2,3,4)) - else if(chemical_data.clearance_level <= 4) + else if(GLOB.chemical_data.clearance_level <= 4) level_to_set = tgui_input_list(usr, "Set target level for [target_property.name]:","[src]", list(1,2,3,4,5,6,7,8)) else level_to_set = tgui_input_list(usr, "Set target level for [target_property.name]:","[src]", list(1,2,3,4,5,6,7,8,9,10)) @@ -350,7 +350,7 @@ calculate_creation_cost() ready = check_ready() playsound(loc, pick('sound/machines/computer_typing1.ogg','sound/machines/computer_typing2.ogg','sound/machines/computer_typing3.ogg'), 5, 1) - nanomanager.update_uis(src) + SSnano.nanomanager.update_uis(src) /obj/structure/machinery/chem_simulator/process() if(inoperable()) @@ -384,7 +384,7 @@ C.name = C.id if(C.id in simulations) //We've already simulated this before, so we don't need to continue - C = chemical_reagents_list[C.id] + C = GLOB.chemical_reagents_list[C.id] print(C.id) status_bar = "SIMULATION COMPLETE" simulating = SIMULATION_STAGE_OFF @@ -398,13 +398,13 @@ else ready = check_ready() stop_processing() - nanomanager.update_uis(src) + SSnano.nanomanager.update_uis(src) /obj/structure/machinery/chem_simulator/proc/update_costs() property_costs = list() var/only_positive = TRUE if(mode == MODE_CREATE) - for(var/datum/chem_property/P in chemical_data.research_property_data) + for(var/datum/chem_property/P in GLOB.chemical_data.research_property_data) property_costs[P.name] = max(abs(P.value), 1) else if(target && target.data && target.completed) for(var/datum/chem_property/P in target.data.properties) @@ -431,7 +431,7 @@ if(only_positive) for(var/P in property_costs) property_costs[P] = property_costs[P] + 1 - chemical_data.has_new_properties = FALSE + GLOB.chemical_data.has_new_properties = FALSE //Here the cost for creating a chemical is calculated. If you're looking to rebalance create mode, this is where you do it /obj/structure/machinery/chem_simulator/proc/calculate_creation_cost() @@ -468,7 +468,7 @@ new_od_level = max(new_od_level - 5, 5) /obj/structure/machinery/chem_simulator/proc/prepare_recipe_options() - var/datum/chemical_reaction/generated/O = chemical_reactions_list[target.data.id] + var/datum/chemical_reaction/generated/O = GLOB.chemical_reactions_list[target.data.id] if(!O) //If it doesn't have a recipe, go immediately to finalizing, which will then generate a new associated recipe return FALSE recipe_targets = list() //reset @@ -481,7 +481,7 @@ if(LAZYLEN(R.required_reagents) > 2) LAZYREMOVE(R.required_reagents, pick(R.required_reagents)) var/new_component_id = R.add_component(tier = max(min(target.data.chemclass, CHEM_CLASS_COMMON), target.data.gen_tier, 1)) - var/datum/reagent/new_component = chemical_reagents_list[new_component_id] + var/datum/reagent/new_component = GLOB.chemical_reagents_list[new_component_id] //Make sure we don't have an identical reaction and that the component is identified if(R.check_duplicate() || R.check_reaction_uses_all_default_medical() || new_component.chemclass >= CHEM_CLASS_SPECIAL) R.required_reagents = old_reaction.Copy() @@ -512,27 +512,27 @@ status_bar = "TARGET CAN NOT BE ALTERED" return FALSE //Safety check in case of irregular papers - var/datum/chemical_reaction/C = chemical_reactions_list[target.data.id] + var/datum/chemical_reaction/C = GLOB.chemical_reactions_list[target.data.id] if(C) for(var/component in C.required_reagents) - var/datum/reagent/R = chemical_reagents_list[component] - if(R && R.chemclass >= CHEM_CLASS_SPECIAL && !chemical_data.chemical_identified_list[R.id]) + var/datum/reagent/R = GLOB.chemical_reagents_list[component] + if(R && R.chemclass >= CHEM_CLASS_SPECIAL && !GLOB.chemical_data.chemical_identified_list[R.id]) status_bar = "UNREGISTERED COMPONENTS DETECTED" return FALSE for(var/catalyst in C.required_catalysts) - var/datum/reagent/R = chemical_reagents_list[catalyst] - if(R && R.chemclass >= CHEM_CLASS_SPECIAL && !chemical_data.chemical_identified_list[R.id]) + var/datum/reagent/R = GLOB.chemical_reagents_list[catalyst] + if(R && R.chemclass >= CHEM_CLASS_SPECIAL && !GLOB.chemical_data.chemical_identified_list[R.id]) status_bar = "UNREGISTERED CATALYSTS DETECTED" return FALSE if(target_property) - if(property_costs[target_property.name] > chemical_data.rsc_credits) + if(property_costs[target_property.name] > GLOB.chemical_data.rsc_credits) status_bar = "INSUFFICIENT FUNDS" return FALSE if(target_property.category & PROPERTY_TYPE_UNADJUSTABLE) status_bar = "TARGET PROPERTY CAN NOT BE SIMULATED" return FALSE if(mode == MODE_AMPLIFY) - if(target_property.level >= chemical_data.clearance_level*TECHTREE_LEVEL_MULTIPLIER + 2 && chemical_data.clearance_level < 5) + if(target_property.level >= GLOB.chemical_data.clearance_level*TECHTREE_LEVEL_MULTIPLIER + 2 && GLOB.chemical_data.clearance_level < 5) status_bar = "CLEARANCE INSUFFICIENT FOR AMPLIFICATION" return FALSE if(target && length(target.data.properties) < 2) @@ -560,7 +560,7 @@ if(LAZYLEN(creation_name) < 2) status_bar = "NAME NOT SET" return FALSE - if(creation_cost > chemical_data.rsc_credits) + if(creation_cost > GLOB.chemical_data.rsc_credits) status_bar = "INSUFFICIENT FUNDS" return FALSE else if(!target) @@ -575,18 +575,18 @@ flick("[icon_state]_printing",src) sleep(10) var/obj/item/paper/research_report/report = new /obj/item/paper/research_report/(loc) - var/datum/reagent/D = chemical_reagents_list[id] + var/datum/reagent/D = GLOB.chemical_reagents_list[id] var/datum/asset/asset = get_asset_datum(/datum/asset/simple/paper) report.name = "Simulation result for [D.name]" report.info += "

    Official Company Document
    Simulated Synthesis Report

    Result for [D.name]

    " report.generate(D) - report.info += "

    This report was automatically printed by the Synthesis Simulator.
    The [MAIN_SHIP_NAME], [time2text(world.timeofday, "MM/DD")]/[game_year], [worldtime2text()]

    \n" + report.info += "

    This report was automatically printed by the Synthesis Simulator.
    The [MAIN_SHIP_NAME], [time2text(world.timeofday, "MM/DD")]/[GLOB.game_year], [worldtime2text()]

    \n" playsound(loc, 'sound/machines/twobeep.ogg', 15, 1) if(is_new) - chemical_data.save_document(report, "Synthesis Simulations", report.name) + GLOB.chemical_data.save_document(report, "Synthesis Simulations", report.name) /obj/structure/machinery/chem_simulator/proc/encode_reagent(datum/reagent/C) - var/datum/reagent/O = chemical_reagents_list[C.original_id] //So make the new name based on the Original + var/datum/reagent/O = GLOB.chemical_reagents_list[C.original_id] //So make the new name based on the Original var/suffix = " " for(var/datum/chem_property/P in C.properties) suffix += P.code+"[P.level]" @@ -661,7 +661,7 @@ R.gen_tier = C.gen_tier if(mode != MODE_CREATE) - assoc_R = chemical_reactions_list[target.data.id] + assoc_R = GLOB.chemical_reactions_list[target.data.id] if(!assoc_R) //no associated recipe found if(mode == MODE_CREATE) assoc_R = C.generate_assoc_recipe(creation_complexity) @@ -690,25 +690,25 @@ //Pay if(mode == MODE_CREATE) - chemical_data.update_credits(creation_cost * -1) + GLOB.chemical_data.update_credits(creation_cost * -1) else - chemical_data.update_credits(property_costs[target_property.name] * -1) + GLOB.chemical_data.update_credits(property_costs[target_property.name] * -1) //Refund 1 credit if a rare or rarer target was added - var/datum/reagent/component = chemical_reagents_list[recipe_target] + var/datum/reagent/component = GLOB.chemical_reagents_list[recipe_target] if(component && component.chemclass >= CHEM_CLASS_RARE) - chemical_data.update_credits(1) + GLOB.chemical_data.update_credits(1) //Save the reagent C.generate_description() C.chemclass = CHEM_CLASS_RARE //So that we can always scan this in the future, don't generate defcon, and don't get a loop of making credits - chemical_reagents_list[C.id] = C + GLOB.chemical_reagents_list[C.id] = C LAZYADD(simulations, C.id) //Remember we've simulated this //Save the reaction R.id = C.id R.result = C.id - chemical_reactions_list[R.id] = R + GLOB.chemical_reactions_list[R.id] = R R.add_to_filtered_list() status_bar = "SIMULATION COMPLETE" print(C.id, TRUE) diff --git a/code/modules/reagents/chemistry_machinery/chem_storage.dm b/code/modules/reagents/chemistry_machinery/chem_storage.dm index 3a05201dea25..692daef7864f 100644 --- a/code/modules/reagents/chemistry_machinery/chem_storage.dm +++ b/code/modules/reagents/chemistry_machinery/chem_storage.dm @@ -31,11 +31,11 @@ /obj/structure/machinery/chem_storage/Initialize() . = ..() - chemical_data.add_chem_storage(src) + GLOB.chemical_data.add_chem_storage(src) start_processing() /obj/structure/machinery/chem_storage/Destroy() - chemical_data.remove_chem_storage(src) + GLOB.chemical_data.remove_chem_storage(src) return ..() /obj/structure/machinery/chem_storage/get_examine_text(mob/user) diff --git a/code/modules/reagents/chemistry_machinery/pandemic.dm b/code/modules/reagents/chemistry_machinery/pandemic.dm index c9e34f79609e..5cd7f6584705 100644 --- a/code/modules/reagents/chemistry_machinery/pandemic.dm +++ b/code/modules/reagents/chemistry_machinery/pandemic.dm @@ -59,10 +59,10 @@ if(B) var/datum/disease/D = null if(!vaccine_type) - D = archive_diseases[path] + D = GLOB.archive_diseases[path] vaccine_type = path else - if(vaccine_type in diseases) + if(vaccine_type in GLOB.diseases) D = new vaccine_type(0, null) if(D) @@ -90,11 +90,11 @@ B.icon_state = "bottle3" var/datum/disease/D = null if(!virus_type) - var/datum/disease/advance/A = archive_diseases[href_list["create_virus_culture"]] + var/datum/disease/advance/A = GLOB.archive_diseases[href_list["create_virus_culture"]] if(A) D = new A.type(0, A) else - if(virus_type in diseases) // Make sure this is a disease + if(virus_type in GLOB.diseases) // Make sure this is a disease D = new virus_type(0, null) var/list/data = list("viruses"=list(D)) var/name = strip_html(input(user,"Name:","Name the culture",D.name)) @@ -129,8 +129,8 @@ if(user.stat || user.is_mob_restrained()) return if(!in_range(src, user)) return var/id = href_list["name_disease"] - if(archive_diseases[id]) - var/datum/disease/advance/A = archive_diseases[id] + if(GLOB.archive_diseases[id]) + var/datum/disease/advance/A = GLOB.archive_diseases[id] A.AssignName(new_name) for(var/datum/disease/advance/AD in SSdisease.all_diseases) AD.Refresh() @@ -184,7 +184,7 @@ if(istype(D, /datum/disease/advance)) var/datum/disease/advance/A = D - D = archive_diseases[A.GetDiseaseID()] + D = GLOB.archive_diseases[A.GetDiseaseID()] disease_creation = A.GetDiseaseID() if(D.name == "Unknown") dat += "Name Disease
    " @@ -216,7 +216,7 @@ var/disease_name = "Unknown" if(!ispath(type)) - var/datum/disease/advance/A = archive_diseases[type] + var/datum/disease/advance/A = GLOB.archive_diseases[type] if(A) disease_name = A.name else diff --git a/code/modules/reagents/chemistry_machinery/reagent_analyzer.dm b/code/modules/reagents/chemistry_machinery/reagent_analyzer.dm index dc1f72ec41c7..de059de46436 100644 --- a/code/modules/reagents/chemistry_machinery/reagent_analyzer.dm +++ b/code/modules/reagents/chemistry_machinery/reagent_analyzer.dm @@ -89,27 +89,27 @@ var/datum/reagent/S = sample.reagents.reagent_list[1] S.print_report(report = report, sample_number = sample_number) sample.name = "vial ([S.name])" - chemical_data.save_document(report, "XRF Scans", "[sample_number] - [report.name]") + GLOB.chemical_data.save_document(report, "XRF Scans", "[sample_number] - [report.name]") if(S.chemclass < CHEM_CLASS_SPECIAL || (S.chemclass >= CHEM_CLASS_SPECIAL && report.completed)) - chemical_data.save_new_properties(S.properties) - if(S.chemclass >= CHEM_CLASS_SPECIAL && !chemical_data.chemical_identified_list[S.id]) + GLOB.chemical_data.save_new_properties(S.properties) + if(S.chemclass >= CHEM_CLASS_SPECIAL && !GLOB.chemical_data.chemical_identified_list[S.id]) if(last_used) last_used.count_niche_stat(STATISTICS_NICHE_CHEMS) var/datum/chem_property/P = S.get_property(PROPERTY_DNA_DISINTEGRATING) if(P) - if(chemical_data.clearance_level >= S.gen_tier) + if(GLOB.chemical_data.clearance_level >= S.gen_tier) P.trigger() else return - chemical_data.complete_chemical(S) + GLOB.chemical_data.complete_chemical(S) else var/datum/asset/asset = get_asset_datum(/datum/asset/simple/paper) report.name = "Analysis of ERROR" report.info += "

    Official Weyland-Yutani Document
    Reagent Analysis Print

    Analysis ERROR

    " report.info += "Result:
    Analysis failed for sample #[sample_number].

    \n" report.info += "Reason for error:
    [reason]
    \n" - report.info += "

    This report was automatically printed by the A-XRF Scanner.
    The [MAIN_SHIP_NAME], [time2text(world.timeofday, "MM/DD")]/[game_year], [worldtime2text()]

    \n" + report.info += "

    This report was automatically printed by the A-XRF Scanner.
    The [MAIN_SHIP_NAME], [time2text(world.timeofday, "MM/DD")]/[GLOB.game_year], [worldtime2text()]

    \n" /datum/reagent/proc/print_report(turf/loc, obj/item/paper/research_report/report, admin_spawned = FALSE, sample_number = 0) if(!report) diff --git a/code/modules/reagents/chemistry_properties/prop_neutral.dm b/code/modules/reagents/chemistry_properties/prop_neutral.dm index d420623879ce..3048b12ee296 100644 --- a/code/modules/reagents/chemistry_properties/prop_neutral.dm +++ b/code/modules/reagents/chemistry_properties/prop_neutral.dm @@ -199,8 +199,8 @@ M.druggy = min(M.druggy + 0.5 * potency * delta_time, potency * 10) /datum/chem_property/neutral/hallucinogenic/process_overdose(mob/living/M, potency = 1, delta_time) - if(isturf(M.loc) && !istype(M.loc, /turf/open/space) && M.canmove && !M.is_mob_restrained()) - step(M, pick(cardinal)) + if(isturf(M.loc) && !istype(M.loc, /turf/open/space) && (M.mobility_flags & MOBILITY_MOVE) && !M.is_mob_restrained()) + step(M, pick(GLOB.cardinals)) M.hallucination += 10 M.make_jittery(5) diff --git a/code/modules/reagents/chemistry_properties/prop_positive.dm b/code/modules/reagents/chemistry_properties/prop_positive.dm index 971051e9bf88..8bf7eadc5d77 100644 --- a/code/modules/reagents/chemistry_properties/prop_positive.dm +++ b/code/modules/reagents/chemistry_properties/prop_positive.dm @@ -455,7 +455,7 @@ if(prob(10 * delta_time)) to_chat(M, SPAN_WARNING("You feel like you have the worst brain freeze ever!")) M.apply_effect(20, PARALYZE) - M.stunned = max(M.stunned,21) + M.apply_effect(20, STUN) /datum/chem_property/positive/neurocryogenic/process_overdose(mob/living/M, potency = 1, delta_time) M.bodytemperature = max(M.bodytemperature - 2.5 * potency * delta_time,0) diff --git a/code/modules/reagents/chemistry_properties/prop_special.dm b/code/modules/reagents/chemistry_properties/prop_special.dm index cec04ca66616..52354f0d6b01 100644 --- a/code/modules/reagents/chemistry_properties/prop_special.dm +++ b/code/modules/reagents/chemistry_properties/prop_special.dm @@ -97,7 +97,7 @@ /datum/chem_property/special/DNA_Disintegrating/trigger() SSticker.mode.get_specific_call("Weyland-Yutani Goon (Chemical Investigation Squad)", TRUE, FALSE, holder.name) - chemical_data.update_credits(10) + GLOB.chemical_data.update_credits(10) message_admins("The research department has discovered DNA_Disintegrating in [holder.name] adding 10 bonus tech points.") var/datum/techtree/tree = GET_TREE(TREE_MARINE) tree.add_points(10) diff --git a/code/modules/reagents/chemistry_reagents/drink.dm b/code/modules/reagents/chemistry_reagents/drink.dm index 3bd7336c32b6..66ce0844556b 100644 --- a/code/modules/reagents/chemistry_reagents/drink.dm +++ b/code/modules/reagents/chemistry_reagents/drink.dm @@ -555,7 +555,8 @@ /datum/reagent/neurotoxin/on_mob_life(mob/living/carbon/M) . = ..() if(!.) return - M.knocked_down = max(M.knocked_down, 3) + if(!HAS_TRAIT(src, TRAIT_FLOORED)) + M.apply_effect(5, WEAKEN) if(!data) data = 1 data++ M.dizziness +=6 diff --git a/code/modules/reagents/chemistry_reagents/toxin.dm b/code/modules/reagents/chemistry_reagents/toxin.dm index 6ffd14ea8ae3..d9be565a85b2 100644 --- a/code/modules/reagents/chemistry_reagents/toxin.dm +++ b/code/modules/reagents/chemistry_reagents/toxin.dm @@ -113,6 +113,7 @@ if(!. || deleted) return M.status_flags |= FAKEDEATH + ADD_TRAIT(M, TRAIT_IMMOBILIZED, FAKEDEATH_TRAIT) M.apply_damage(0.5*REM, OXY) M.apply_effect(2, WEAKEN) M.silent = max(M.silent, 10) @@ -125,6 +126,7 @@ var/mob/living/holder_mob = . holder_mob.status_flags &= ~FAKEDEATH + REMOVE_TRAIT(holder_mob, TRAIT_IMMOBILIZED, FAKEDEATH_TRAIT) /datum/reagent/toxin/mindbreaker name = "Mindbreaker Toxin" diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index b4b4f68ed99d..4c60a9e345e0 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -112,7 +112,7 @@ // attack with hand, move pulled object onto conveyor /obj/structure/machinery/conveyor/attack_hand(mob/user as mob) - if ((!( user.canmove ) || user.is_mob_restrained() || !( user.pulling ))) + if (( user.is_mob_incapacitated() || !( user.pulling ))) return if (user.pulling.anchored) return @@ -197,7 +197,7 @@ /obj/structure/machinery/conveyor_switch/LateInitialize() . = ..() conveyors = list() - for(var/obj/structure/machinery/conveyor/C in machines) + for(var/obj/structure/machinery/conveyor/C in GLOB.machines) if(C.id == id) conveyors += C start_processing() @@ -246,7 +246,7 @@ update() // find any switches with same id as this one, and set their positions to match us - for(var/obj/structure/machinery/conveyor_switch/S in machines) + for(var/obj/structure/machinery/conveyor_switch/S in GLOB.machines) if(S.id == src.id) S.position = position S.update() @@ -266,7 +266,7 @@ update() // find any switches with same id as this one, and set their positions to match us - for(var/obj/structure/machinery/conveyor_switch/S in machines) + for(var/obj/structure/machinery/conveyor_switch/S in GLOB.machines) if(S.id == src.id) S.position = position S.update() diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index b2afd77d4aed..1522f0100c4e 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -222,7 +222,7 @@ ///Attempt to move while inside /obj/structure/machinery/disposal/relaymove(mob/living/user) - if(user.stat || user.stunned || user.knocked_down || flushing) + if(user.is_mob_incapacitated(TRUE) || flushing) return FALSE if(user.loc == src) go_out(user) @@ -234,9 +234,8 @@ user.client.eye = user.client.mob user.client.perspective = MOB_PERSPECTIVE user.forceMove(loc) - user.stunned = max(user.stunned, 2) //Action delay when going out of a bin - user.update_canmove() //Force the delay to go in action immediately - if(!user.lying) + user.apply_effect(2, STUN) + if(user.mobility_flags & MOBILITY_MOVE) user.visible_message(SPAN_WARNING("[user] suddenly climbs out of [src]!"), SPAN_WARNING("You climb out of [src] and get your bearings!")) update() @@ -305,8 +304,7 @@ if(isliving(AM)) var/mob/living/living = AM living.Stun(2) - living.update_canmove() //Force the delay to go in action immediately - if(!living.lying) + if(living.body_position == STANDING_UP) living.visible_message(SPAN_WARNING("[living] is suddenly pushed out of [src]!"), SPAN_WARNING("You get pushed out of [src] and get your bearings!")) update() @@ -746,7 +744,7 @@ //Remains : set to leave broken pipe pieces in place /obj/structure/disposalpipe/deconstruct(disassembled = TRUE) if(disassembled) - for(var/D in cardinal) + for(var/D in GLOB.cardinals) if(D & dpdir) var/obj/structure/disposalpipe/broken/P = new(loc) P.setDir(D) @@ -1096,7 +1094,8 @@ /obj/structure/disposalpipe/tagger/Initialize(mapload, ...) . = ..() dpdir = dir|turn(dir, 180) - if(sort_tag) tagger_locations |= sort_tag + if(sort_tag) + GLOB.tagger_locations |= sort_tag updatename() updatedesc() update() @@ -1152,7 +1151,8 @@ /obj/structure/disposalpipe/sortjunction/Initialize(mapload, ...) . = ..() - if(sortType) tagger_locations |= sortType + if(sortType) + GLOB.tagger_locations |= sortType updatedir() updatename() @@ -1457,7 +1457,7 @@ if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() INVOKE_ASYNC(streak(dirs)) @@ -1466,7 +1466,7 @@ if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() INVOKE_ASYNC(streak(dirs)) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index e8ac568140bc..ec1c8c245f2b 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -337,8 +337,8 @@ var/dat = "

    TagMaster 2.3

    " dat += "

    " - for(var/i = 1, i <= tagger_locations.len, i++) - dat += "" + for(var/i = 1, i <= GLOB.tagger_locations.len, i++) + dat += "" if (i%4==0) dat += "" @@ -357,7 +357,7 @@ if(.) return src.add_fingerprint(usr) - if(href_list["nextTag"] && (href_list["nextTag"] in tagger_locations)) + if(href_list["nextTag"] && (href_list["nextTag"] in GLOB.tagger_locations)) src.currTag = href_list["nextTag"] openwindow(usr) diff --git a/code/modules/round_recording/round_recorder.dm b/code/modules/round_recording/round_recorder.dm index 677b32bba1d2..8748b995aa6c 100644 --- a/code/modules/round_recording/round_recorder.dm +++ b/code/modules/round_recording/round_recorder.dm @@ -31,8 +31,8 @@ game_start = time2text(world.realtime, "DD.MM.YYYY@hh:mm:ss") map = SSmapping.configs[GROUND_MAP].map_name - gamemode = master_mode - round_name = round_statistics.name + gamemode = GLOB.master_mode + round_name = GLOB.round_statistics.name // Record the end time of the game and export the game history /datum/round_recorder/proc/end_game() diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index 9d6d862bfc3c..4b7cdd69a449 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -108,7 +108,7 @@ /obj/structure/machinery/keycard_auth/proc/broadcast_request() icon_state = "auth_on" - for(var/obj/structure/machinery/keycard_auth/KA in machines) + for(var/obj/structure/machinery/keycard_auth/KA in GLOB.machines) if(KA == src || KA.channel != channel) continue KA.reset() INVOKE_ASYNC(KA, TYPE_PROC_REF(/obj/structure/machinery/keycard_auth, receive_request), src) @@ -149,14 +149,14 @@ if(CONFIG_GET(flag/ert_admin_call_only)) return 1 return SSticker.mode && SSticker.mode.ert_disabled -var/global/maint_all_access = 1 +GLOBAL_VAR_INIT(maint_all_access, TRUE) /proc/make_maint_all_access() - maint_all_access = 1 + GLOB.maint_all_access = TRUE ai_announcement("The maintenance access requirement has been removed on all airlocks.") /proc/revoke_maint_all_access() - maint_all_access = 0 + GLOB.maint_all_access = FALSE ai_announcement("The maintenance access requirement has been added on all airlocks.") // Keycard reader at the CORSAT locks @@ -209,7 +209,7 @@ var/global/maint_all_access = 1 /obj/structure/machinery/keycard_auth/lockdown/broadcast_request() icon_state = "auth_on" - for(var/obj/structure/machinery/keycard_auth/lockdown/KA in machines) + for(var/obj/structure/machinery/keycard_auth/lockdown/KA in GLOB.machines) if(KA == src || KA.channel != channel) continue KA.reset() @@ -249,7 +249,7 @@ var/global/maint_all_access = 1 /obj/structure/machinery/keycard_auth/lockdown/proc/timed_countdown(timeleft = 0) if(!timeleft) - for(var/obj/structure/machinery/door/poddoor/M in machines) + for(var/obj/structure/machinery/door/poddoor/M in GLOB.machines) if(M.id == podlock_id && M.density) INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/structure/machinery/door, open)) return diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index 8221b8771c88..b6577a2fcbfa 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -1,51 +1,44 @@ -/var/security_level = 0 -//0 = code green -//1 = code blue -//2 = code red -//3 = code delta - -//config.alert_desc_blue_downto - +GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN) /proc/set_security_level(level, no_sound = FALSE, announce = TRUE, log = ARES_LOG_SECURITY) - if(level != security_level) + if(level != GLOB.security_level) SEND_GLOBAL_SIGNAL(COMSIG_GLOB_SECURITY_LEVEL_CHANGED, level) //Will not be announced if you try to set to the same level as it already is - if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != security_level) + if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level) switch(level) if(SEC_LEVEL_GREEN) if(announce) ai_announcement("Attention: Security level lowered to GREEN - all clear.", no_sound ? null : 'sound/AI/code_green.ogg', log) - security_level = SEC_LEVEL_GREEN + GLOB.security_level = SEC_LEVEL_GREEN if(SEC_LEVEL_BLUE) - if(security_level < SEC_LEVEL_BLUE) + if(GLOB.security_level < SEC_LEVEL_BLUE) if(announce) ai_announcement("Attention: Security level elevated to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_elevated.ogg', log) else if(announce) ai_announcement("Attention: Security level lowered to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_lowered.ogg', log) - security_level = SEC_LEVEL_BLUE + GLOB.security_level = SEC_LEVEL_BLUE if(SEC_LEVEL_RED) - if(security_level < SEC_LEVEL_RED) + if(GLOB.security_level < SEC_LEVEL_RED) if(announce) ai_announcement("Attention: Security level elevated to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_elevated.ogg', log) else if(announce) ai_announcement("Attention: Security level lowered to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_lowered.ogg', log) - security_level = SEC_LEVEL_RED + GLOB.security_level = SEC_LEVEL_RED if(SEC_LEVEL_DELTA) if(announce) var/name = "SELF-DESTRUCT SYSTEMS ACTIVE" var/input = "DANGER, THE EMERGENCY DESTRUCT SYSTEM IS NOW ACTIVATED. PROCEED TO THE SELF-DESTRUCT CHAMBER FOR CONTROL ROD INSERTION." marine_announcement(input, name, 'sound/AI/selfdestruct_short.ogg', logging = log) - security_level = SEC_LEVEL_DELTA + GLOB.security_level = SEC_LEVEL_DELTA /proc/get_security_level() - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) return "green" if(SEC_LEVEL_BLUE) diff --git a/code/modules/shuttle/computers/dropship_computer.dm b/code/modules/shuttle/computers/dropship_computer.dm index d72e0871af72..6774d81e590d 100644 --- a/code/modules/shuttle/computers/dropship_computer.dm +++ b/code/modules/shuttle/computers/dropship_computer.dm @@ -217,9 +217,9 @@ dropship.control_doors("unlock", "all", TRUE) dropship_control_lost = TRUE door_control_cooldown = addtimer(CALLBACK(src, PROC_REF(remove_door_lock)), SHUTTLE_LOCK_COOLDOWN, TIMER_STOPPABLE) - if(almayer_orbital_cannon) - almayer_orbital_cannon.is_disabled = TRUE - addtimer(CALLBACK(almayer_orbital_cannon, TYPE_PROC_REF(/obj/structure/orbital_cannon, enable)), 10 MINUTES, TIMER_UNIQUE) + if(GLOB.almayer_orbital_cannon) + GLOB.almayer_orbital_cannon.is_disabled = TRUE + addtimer(CALLBACK(GLOB.almayer_orbital_cannon, TYPE_PROC_REF(/obj/structure/orbital_cannon, enable)), 10 MINUTES, TIMER_UNIQUE) if(!GLOB.resin_lz_allowed) set_lz_resin_allowed(TRUE) @@ -251,7 +251,7 @@ // select crash location var/turf/source_turf = get_turf(src) var/obj/docking_port/mobile/marine_dropship/dropship = SSshuttle.getShuttle(shuttleId) - var/result = tgui_input_list(user, "Where to 'land'?", "Dropship Hijack", almayer_ship_sections , timeout = 10 SECONDS) + var/result = tgui_input_list(user, "Where to 'land'?", "Dropship Hijack", GLOB.almayer_ship_sections , timeout = 10 SECONDS) if(!result) return if(!user.Adjacent(source_turf) && !force) @@ -270,6 +270,9 @@ hijack.fire() GLOB.alt_ctrl_disabled = TRUE + dropship.alarm_sound_loop.stop() + dropship.playing_launch_announcement_alarm = FALSE + marine_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY) log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.") diff --git a/code/modules/shuttle/dropship_hijack.dm b/code/modules/shuttle/dropship_hijack.dm index 36bc879ace46..809601c815f2 100644 --- a/code/modules/shuttle/dropship_hijack.dm +++ b/code/modules/shuttle/dropship_hijack.dm @@ -10,7 +10,7 @@ /datum/dropship_hijack/almayer/proc/crash_landing() //break APCs - for(var/obj/structure/machinery/power/apc/A in machines) + for(var/obj/structure/machinery/power/apc/A in GLOB.machines) if(A.z != crash_site.z) continue if(prob(A.crash_break_probability)) @@ -66,7 +66,7 @@ var/explosion_alive = TRUE while(explosion_alive) explosion_alive = FALSE - for(var/datum/automata_cell/explosion/E in cellauto_cells) + for(var/datum/automata_cell/explosion/E in GLOB.cellauto_cells) if(E.explosion_cause_data && E.explosion_cause_data.cause_name == "dropship crash") explosion_alive = TRUE break @@ -80,8 +80,8 @@ return FALSE shuttle.callTime = DROPSHIP_CRASH_TRANSIT_DURATION * GLOB.ship_alt SSshuttle.moveShuttle(shuttle.id, crash_site.id, TRUE) - if(round_statistics) - round_statistics.track_hijack() + if(GLOB.round_statistics) + GLOB.round_statistics.track_hijack() return TRUE /datum/dropship_hijack/almayer/proc/target_crash_site(ship_section) @@ -115,8 +115,8 @@ return // if the AA site matches target site - if(target_ship_section == almayer_aa_cannon.protecting_section) - var/list/remaining_crash_sites = almayer_ship_sections.Copy() + if(target_ship_section == GLOB.almayer_aa_cannon.protecting_section) + var/list/remaining_crash_sites = GLOB.almayer_ship_sections.Copy() remaining_crash_sites -= target_ship_section var/new_target_ship_section = pick(remaining_crash_sites) var/turf/target = get_crashsite_turf(new_target_ship_section) @@ -173,7 +173,7 @@ playsound_z(SSmapping.levels_by_any_trait(list(ZTRAIT_MARINE_MAIN_SHIP)), 'sound/effects/dropship_crash.ogg', volume = 75) /datum/dropship_hijack/almayer/proc/disable_latejoin() - enter_allowed = FALSE + GLOB.enter_allowed = FALSE /datum/dropship_hijack/almayer/proc/get_crashsite_turf(ship_section) var/list/turfs = list() diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index d834822e884a..5fe3a7989898 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -184,11 +184,11 @@ All ShuttleMove procs go here . = ..() if(. & MOVE_AREA) . |= MOVE_CONTENTS - cameranet.removeCamera(src) + GLOB.cameranet.removeCamera(src) /obj/structure/machinery/camera/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) . = ..() - cameranet.addCamera(src) + GLOB.cameranet.addCamera(src) /obj/structure/machinery/atmospherics/pipe/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) . = ..() diff --git a/code/modules/shuttle/shuttles/crashable/crashable.dm b/code/modules/shuttle/shuttles/crashable/crashable.dm index de1c5cc8e4fb..f07be5f0c93a 100644 --- a/code/modules/shuttle/shuttles/crashable/crashable.dm +++ b/code/modules/shuttle/shuttles/crashable/crashable.dm @@ -26,7 +26,7 @@ found_turf.ChangeTurf(/turf/open/floor) for(var/mob/current_mob as anything in get_mobs_in_z_level_range(destination.return_center_turf(), 18)) - var/relative_dir = get_dir(current_mob, destination.return_center_turf()) + var/relative_dir = Get_Compass_Dir(current_mob, destination.return_center_turf()) var/final_dir = dir2text(relative_dir) to_chat(current_mob, SPAN_HIGHDANGER("You hear something crashing down from above [final_dir ? "to the [final_dir]" : "nearby"]!")) diff --git a/code/modules/shuttle/vehicle_elevator.dm b/code/modules/shuttle/vehicle_elevator.dm index c9a051a261c5..d2e102933fd8 100644 --- a/code/modules/shuttle/vehicle_elevator.dm +++ b/code/modules/shuttle/vehicle_elevator.dm @@ -20,10 +20,10 @@ /obj/docking_port/mobile/vehicle_elevator/register() . = ..() SSshuttle.vehicle_elevator = src - for(var/obj/structure/machinery/gear/G in machines) + for(var/obj/structure/machinery/gear/G in GLOB.machines) if(G.id == "vehicle_elevator_gears") gears += G - for(var/obj/structure/machinery/door/poddoor/railing/R in machines) + for(var/obj/structure/machinery/door/poddoor/railing/R in GLOB.machines) if(R.id == "vehicle_elevator_railing") railings += R diff --git a/code/modules/shuttles/marine_ferry.dm b/code/modules/shuttles/marine_ferry.dm index 79988bbb8da3..c23d2d689ed6 100644 --- a/code/modules/shuttles/marine_ferry.dm +++ b/code/modules/shuttles/marine_ferry.dm @@ -73,13 +73,6 @@ control.visible_message(SPAN_WARNING(fail_flavortext)) return //Kill it so as not to repeat -/datum/shuttle/ferry/marine/proc/load_datums() - if(!(info_tag in s_info)) - message_admins(SPAN_WARNING("Error with shuttles: Shuttle tag does not exist. Code: MSD10.\n WARNING: DROPSHIP LAUNCH WILL PROBABLY FAIL")) - - var/list/L = s_info[info_tag] - info_datums = L.Copy() - /datum/shuttle/ferry/marine/proc/set_automated_launch(bool_v) automated_launch = bool_v if(bool_v) @@ -343,17 +336,17 @@ var/target_section = crash_target_section if(isnull(target_section)) - var/list/potential_crash_sections = almayer_ship_sections.Copy() - potential_crash_sections -= almayer_aa_cannon.protecting_section + var/list/potential_crash_sections = GLOB.almayer_ship_sections.Copy() + potential_crash_sections -= GLOB.almayer_aa_cannon.protecting_section target_section = pick(potential_crash_sections) - var/turf/T_trg = pick(shuttle_controller.locs_crash[target_section]) + var/turf/T_trg = pick(SSoldshuttle.shuttle_controller.locs_crash[target_section]) for(var/X in equipments) var/obj/structure/dropship_equipment/E = X if(istype(E, /obj/structure/dropship_equipment/adv_comp/docking)) var/list/crash_turfs = list() - for(var/turf/TU in shuttle_controller.locs_crash[target_section]) + for(var/turf/TU in SSoldshuttle.shuttle_controller.locs_crash[target_section]) if(istype(get_area(TU), /area/almayer/hallways/hangar)) crash_turfs += TU if(crash_turfs.len) T_trg = pick(crash_turfs) @@ -363,7 +356,7 @@ if(!istype(T_src) || !istype(T_int) || !istype(T_trg)) message_admins(SPAN_WARNING("Error with shuttles: Reference turfs not correctly instantiated. Code: MSD04.\n WARNING: DROPSHIP LAUNCH WILL FAIL")) - shuttle_controller.locs_crash[target_section] -= T_trg + SSoldshuttle.shuttle_controller.locs_crash[target_section] -= T_trg //END: Heavy lifting backend @@ -440,12 +433,12 @@ sleep(85) - if(security_level < SEC_LEVEL_RED) //automatically set security level to red. + if(GLOB.security_level < SEC_LEVEL_RED) //automatically set security level to red. set_security_level(SEC_LEVEL_RED, TRUE) shake_cameras(turfs_int) //shake for 1.5 seconds before crash, 0.5 after - for(var/obj/structure/machinery/power/apc/A in machines) //break APCs + for(var/obj/structure/machinery/power/apc/A in GLOB.machines) //break APCs if(A.z != T_trg.z) continue if(prob(A.crash_break_probability)) A.overload_lighting() @@ -477,7 +470,7 @@ var/explosion_alive = TRUE while(explosion_alive) explosion_alive = FALSE - for(var/datum/automata_cell/explosion/E in cellauto_cells) + for(var/datum/automata_cell/explosion/E in GLOB.cellauto_cells) if(E.explosion_cause_data && E.explosion_cause_data.cause_name == "dropship crash") explosion_alive = TRUE break @@ -520,15 +513,15 @@ open_doors_crashed(turfs_trg) //And now open the doors - for (var/obj/structure/machinery/door_display/research_cell/d in machines) + for (var/obj/structure/machinery/door_display/research_cell/d in GLOB.machines) if(is_mainship_level(d.z) || is_reserved_level(d.z)) d.ion_act() //Breaking xenos out of containment //Stolen from events.dm. WARNING: This code is old as hell - for (var/obj/structure/machinery/power/apc/APC in machines) + for (var/obj/structure/machinery/power/apc/APC in GLOB.machines) if(is_mainship_level(APC.z) || is_reserved_level(APC.z)) APC.ion_act() - for (var/obj/structure/machinery/power/smes/SMES in machines) + for (var/obj/structure/machinery/power/smes/SMES in GLOB.machines) if(is_mainship_level(SMES.z) || is_reserved_level(SMES.z)) SMES.ion_act() @@ -545,7 +538,7 @@ colonial_marines.add_current_round_status_to_end_results("Hijack") /datum/shuttle/ferry/marine/proc/disable_latejoin() - enter_allowed = FALSE + GLOB.enter_allowed = FALSE /datum/shuttle/ferry/marine/short_jump() diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm index dccdfad920f4..96cc72970f3b 100644 --- a/code/modules/shuttles/shuttle_console.dm +++ b/code/modules/shuttles/shuttle_console.dm @@ -33,7 +33,7 @@ GLOBAL_LIST_EMPTY(shuttle_controls) return ..() /obj/structure/machinery/computer/shuttle_control/proc/get_shuttle() - var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag] + var/datum/shuttle/ferry/shuttle = SSoldshuttle.shuttle_controller.shuttles[shuttle_tag] if(shuttle_datum) shuttle = shuttle_datum @@ -82,8 +82,6 @@ GLOBAL_LIST_EMPTY(shuttle_controls) user.visible_message(SPAN_NOTICE("[user] starts to type on the [src]."), SPAN_NOTICE("You try to take back the control over the shuttle. It will take around 3 minutes.")) if(do_after(user, 3 MINUTES, INTERRUPT_ALL, BUSY_ICON_FRIENDLY)) - if(user.lying) - return 0 shuttle.last_locked = world.time shuttle.queen_locked = 0 shuttle.last_door_override = world.time @@ -203,7 +201,7 @@ GLOBAL_LIST_EMPTY(shuttle_controls) "auto_time_cdown" = automated_launch_time_left, ) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = SSnano.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) ui = new(user, src, ui_key, shuttle.iselevator? "elevator_control_console.tmpl" : "shuttle_control_console.tmpl", shuttle.iselevator? "Elevator Control" : "Shuttle Control", 550, 500) @@ -262,7 +260,7 @@ GLOBAL_LIST_EMPTY(shuttle_controls) return // Allow the queen to choose the ship section to crash into - var/crash_target = tgui_input_list(usr, "Choose a ship section to target","Hijack", almayer_ship_sections + list("Cancel")) + var/crash_target = tgui_input_list(usr, "Choose a ship section to target","Hijack", GLOB.almayer_ship_sections + list("Cancel")) if(crash_target == "Cancel") return @@ -280,16 +278,16 @@ GLOBAL_LIST_EMPTY(shuttle_controls) shuttle1.true_crash_target_section = crash_target // If the AA is protecting the target area, pick any other section to crash into at random - if(almayer_aa_cannon.protecting_section == crash_target) - var/list/potential_crash_sections = almayer_ship_sections.Copy() - potential_crash_sections -= almayer_aa_cannon.protecting_section + if(GLOB.almayer_aa_cannon.protecting_section == crash_target) + var/list/potential_crash_sections = GLOB.almayer_ship_sections.Copy() + potential_crash_sections -= GLOB.almayer_aa_cannon.protecting_section crash_target = pick(potential_crash_sections) shuttle1.crash_target_section = crash_target shuttle1.transit_gun_mission = 0 - if(round_statistics) - round_statistics.track_hijack() + if(GLOB.round_statistics) + GLOB.round_statistics.track_hijack() marine_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY) shuttle.alerts_allowed-- @@ -308,16 +306,16 @@ GLOBAL_LIST_EMPTY(shuttle_controls) if(Q.hive) addtimer(CALLBACK(Q.hive, TYPE_PROC_REF(/datum/hive_status, abandon_on_hijack)), DROPSHIP_WARMUP_TIME + 5 SECONDS, TIMER_UNIQUE) //+ 5 seconds catch standing in doorways - if(bomb_set) + if(GLOB.bomb_set) for(var/obj/structure/machinery/nuclearbomb/bomb in world) bomb.end_round = FALSE - if(almayer_orbital_cannon) - almayer_orbital_cannon.is_disabled = TRUE - addtimer(CALLBACK(almayer_orbital_cannon, TYPE_PROC_REF(/obj/structure/orbital_cannon, enable)), 10 MINUTES, TIMER_UNIQUE) + if(GLOB.almayer_orbital_cannon) + GLOB.almayer_orbital_cannon.is_disabled = TRUE + addtimer(CALLBACK(GLOB.almayer_orbital_cannon, TYPE_PROC_REF(/obj/structure/orbital_cannon, enable)), 10 MINUTES, TIMER_UNIQUE) - if(almayer_aa_cannon) - almayer_aa_cannon.is_disabled = TRUE + if(GLOB.almayer_aa_cannon) + GLOB.almayer_aa_cannon.is_disabled = TRUE else if(shuttle.require_link) use_power(4080) diff --git a/code/modules/shuttles/shuttle_supply.dm b/code/modules/shuttles/shuttle_supply.dm index 67da9ff4311e..7eb7b96eb2e8 100644 --- a/code/modules/shuttles/shuttle_supply.dm +++ b/code/modules/shuttles/shuttle_supply.dm @@ -77,7 +77,7 @@ lower_railings() return else //at centcom - supply_controller.buy() + GLOB.supply_controller.buy() //We pretend it's a long_jump by making the shuttle stay at centcom for the "in-transit" period. var/area/away_area = get_location_area(away_location) @@ -137,14 +137,14 @@ recharging = 0 /datum/shuttle/ferry/supply/proc/handle_sell() - supply_controller.sell() + GLOB.supply_controller.sell() // returns 1 if the supply shuttle should be prevented from moving because it contains forbidden atoms /datum/shuttle/ferry/supply/proc/forbidden_atoms_check() if (!at_station()) return 0 //if badmins want to send mobs or a nuke on the supply shuttle from centcom we don't care - return supply_controller.forbidden_atoms_check(get_location_area()) + return GLOB.supply_controller.forbidden_atoms_check(get_location_area()) /datum/shuttle/ferry/supply/proc/at_station() return (!location) @@ -155,7 +155,7 @@ /datum/shuttle/ferry/supply/proc/raise_railings() var/effective = 0 - for(var/obj/structure/machinery/door/poddoor/M in machines) + for(var/obj/structure/machinery/door/poddoor/M in GLOB.machines) if(M.id == railing_id && !M.density) effective = 1 spawn() @@ -165,7 +165,7 @@ /datum/shuttle/ferry/supply/proc/lower_railings() var/effective = 0 - for(var/obj/structure/machinery/door/poddoor/M in machines) + for(var/obj/structure/machinery/door/poddoor/M in GLOB.machines) if(M.id == railing_id && M.density) effective = 1 INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/structure/machinery/door, open)) @@ -173,14 +173,14 @@ playsound(locate(Elevator_x,Elevator_y,Elevator_z), 'sound/machines/elevator_openclose.ogg', 50, 0) /datum/shuttle/ferry/supply/proc/start_gears(direction = 1) - for(var/obj/structure/machinery/gear/M in machines) + for(var/obj/structure/machinery/gear/M in GLOB.machines) if(M.id == gear_id) spawn() M.icon_state = "gear_moving" M.setDir(direction) /datum/shuttle/ferry/supply/proc/stop_gears() - for(var/obj/structure/machinery/gear/M in machines) + for(var/obj/structure/machinery/gear/M in GLOB.machines) if(M.id == gear_id) spawn() M.icon_state = "gear" diff --git a/code/modules/sorokyne/sorokyne_cold_water.dm b/code/modules/sorokyne/sorokyne_cold_water.dm index adf7e3de6228..345014a1e460 100644 --- a/code/modules/sorokyne/sorokyne_cold_water.dm +++ b/code/modules/sorokyne/sorokyne_cold_water.dm @@ -48,13 +48,13 @@ var/dam_amount = COLD_WATER_DAMAGE if(issynth(M) || isyautja(M)) dam_amount -= 0.5 - if(M.lying) - M.apply_damage(5*dam_amount,BURN) - else + if(M.body_position == STANDING_UP) M.apply_damage(dam_amount,BURN,"l_leg") M.apply_damage(dam_amount,BURN,"l_foot") M.apply_damage(dam_amount,BURN,"r_leg") M.apply_damage(dam_amount,BURN,"r_foot") + else + M.apply_damage(5*dam_amount,BURN) if (ishuman(M)) if (M.bodytemperature > MINIMUM_TEMP) diff --git a/code/modules/surgery/surgery_initiator.dm b/code/modules/surgery/surgery_initiator.dm index 8b7506c9b7b8..706b28d0e94e 100644 --- a/code/modules/surgery/surgery_initiator.dm +++ b/code/modules/surgery/surgery_initiator.dm @@ -43,7 +43,7 @@ continue //Lying and self-surgery checks. - if(surgeryloop.lying_required && !target.lying) + if(surgeryloop.lying_required && target.body_position != LYING_DOWN) continue if(!surgeryloop.self_operable && target == user) continue @@ -134,7 +134,7 @@ [target_zone == "r_hand"||target_zone == "l_hand" ? "hand":"arm"] you're using!")) return TRUE - if(surgeryinstance.lying_required && !target.lying) + if(surgeryinstance.lying_required && target.body_position != LYING_DOWN) return TRUE if(surgery_limb) diff --git a/code/modules/surgery/surgery_procedure.dm b/code/modules/surgery/surgery_procedure.dm index 1e11516a8079..8620c557eb4b 100644 --- a/code/modules/surgery/surgery_procedure.dm +++ b/code/modules/surgery/surgery_procedure.dm @@ -90,7 +90,7 @@ to_chat(user, SPAN_WARNING("You can't operate on [target], \he is being carried by [target.pulledby]!")) return FALSE - if(lying_required && !target.lying) + if(lying_required && target.body_position != LYING_DOWN) to_chat(user, SPAN_WARNING("[user == target ? "You need" : "[target] needs"] to be lying down for this operation!")) return FALSE diff --git a/code/modules/tgui/status_composers.dm b/code/modules/tgui/status_composers.dm index 6d7b5897863e..ba1b29d8152e 100644 --- a/code/modules/tgui/status_composers.dm +++ b/code/modules/tgui/status_composers.dm @@ -56,17 +56,6 @@ /mob/living/silicon/proc/get_ui_access(atom/source) return UI_INTERACTIVE // Ubiquitous networking. Do not abuse. -/// Returns UI_INTERACTIVE if the user is conscious and lying down. -/// Returns UI_UPDATE otherwise. -/proc/ui_status_user_is_conscious_and_lying_down(mob/user) - if (!isliving(user)) - return UI_UPDATE - - var/mob/living/living_user = user - return (living_user.lying && living_user.stat == CONSCIOUS) \ - ? UI_INTERACTIVE \ - : UI_UPDATE - /// Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. /// Return UI_CLOSE otherwise. /proc/ui_status_user_strictly_adjacent(mob/user, atom/target) diff --git a/code/modules/tgui_panel/audio.dm b/code/modules/tgui_panel/audio.dm index 680696159943..d66421df5348 100644 --- a/code/modules/tgui_panel/audio.dm +++ b/code/modules/tgui_panel/audio.dm @@ -3,8 +3,6 @@ * SPDX-License-Identifier: MIT */ -/// Admin music volume, from 0 to 1. -/client/var/admin_music_volume = 1 /** * public @@ -22,8 +20,9 @@ /datum/tgui_panel/proc/play_music(url, extra_data) if(!is_ready()) return - if(!findtext(url, GLOB.is_http_protocol)) - return + // Commented to allow playing via simple asset transport. Just check when calling. +// if(!findtext(url, GLOB.is_http_protocol)) +// return var/list/payload = list() if(length(extra_data) > 0) for(var/key in extra_data) diff --git a/code/modules/tgui_panel/tgui_panel.dm b/code/modules/tgui_panel/tgui_panel.dm index 9fb8b02b0196..f33f190d80e0 100644 --- a/code/modules/tgui_panel/tgui_panel.dm +++ b/code/modules/tgui_panel/tgui_panel.dm @@ -85,9 +85,10 @@ ), )) return TRUE - if(type == "audio/setAdminMusicVolume") - client.admin_music_volume = payload["volume"] - return TRUE +// Deprecated due to removal of old sound play commands +// if(type == "audio/setAdminMusicVolume") +// client.admin_music_volume = payload["volume"] +// return TRUE if(type == "telemetry") analyze_telemetry(payload) return TRUE diff --git a/code/modules/vehicles/apc/apc_command.dm b/code/modules/vehicles/apc/apc_command.dm index ace9df2b2a25..e0862ae4f2ab 100644 --- a/code/modules/vehicles/apc/apc_command.dm +++ b/code/modules/vehicles/apc/apc_command.dm @@ -184,9 +184,9 @@ //stole my own code from techpod_vendor /obj/vehicle/multitile/apc/command/proc/get_access_permission(mob/living/carbon/human/user) - if(SSticker.mode == GAMEMODE_WHISKEY_OUTPOST || master_mode == GAMEMODE_WHISKEY_OUTPOST) + if(SSticker.mode == GAMEMODE_WHISKEY_OUTPOST || GLOB.master_mode == GAMEMODE_WHISKEY_OUTPOST) return TRUE - else if(SSticker.mode == "Distress Signal" || master_mode == "Distress Signal") + else if(SSticker.mode == "Distress Signal" || GLOB.master_mode == "Distress Signal") if(techpod_access_settings_override) return TRUE else if(user.get_target_lock(techpod_faction_requirement)) diff --git a/code/modules/vehicles/hardpoints/hardpoint.dm b/code/modules/vehicles/hardpoints/hardpoint.dm index ee49ebc0ab57..5963b0b4e36b 100644 --- a/code/modules/vehicles/hardpoints/hardpoint.dm +++ b/code/modules/vehicles/hardpoints/hardpoint.dm @@ -536,7 +536,7 @@ next_use = world.time + cooldown * owner.misc_multipliers["cooldown"] if(!prob((accuracy * 100) / owner.misc_multipliers["accuracy"])) - A = get_step(get_turf(A), pick(cardinal)) + A = get_step(get_turf(A), pick(GLOB.cardinals)) if(LAZYLEN(activation_sounds)) playsound(get_turf(src), pick(activation_sounds), 60, 1) diff --git a/code/modules/vehicles/hardpoints/primary/dual_cannon.dm b/code/modules/vehicles/hardpoints/primary/dual_cannon.dm index 763bfb69842d..ad57e20e8456 100644 --- a/code/modules/vehicles/hardpoints/primary/dual_cannon.dm +++ b/code/modules/vehicles/hardpoints/primary/dual_cannon.dm @@ -48,7 +48,7 @@ for(var/bullets_fired = 1, bullets_fired <= burst_amount, bullets_fired++) var/atom/T = A if(!prob((accuracy * 100) / owner.misc_multipliers["accuracy"])) - T = get_step(get_turf(A), pick(cardinal)) + T = get_step(get_turf(A), pick(GLOB.cardinals)) if(LAZYLEN(activation_sounds)) playsound(get_turf(src), pick(activation_sounds), 60, 1) fire_projectile(user, T) diff --git a/code/modules/vehicles/hardpoints/primary/minigun.dm b/code/modules/vehicles/hardpoints/primary/minigun.dm index c6158f1a3b2c..a6e44d2dbf2c 100644 --- a/code/modules/vehicles/hardpoints/primary/minigun.dm +++ b/code/modules/vehicles/hardpoints/primary/minigun.dm @@ -64,7 +64,7 @@ for(var/i = 1; i <= t; i++) var/atom/T = A if(!prob((accuracy * 100) / owner.misc_multipliers["accuracy"])) - T = get_step(get_turf(T), pick(cardinal)) + T = get_step(get_turf(T), pick(GLOB.cardinals)) fire_projectile(user, T) if(ammo.current_rounds <= 0) break diff --git a/code/modules/vehicles/hardpoints/secondary/cupola.dm b/code/modules/vehicles/hardpoints/secondary/cupola.dm index f1f8f23435c2..3c329e135855 100644 --- a/code/modules/vehicles/hardpoints/secondary/cupola.dm +++ b/code/modules/vehicles/hardpoints/secondary/cupola.dm @@ -40,7 +40,7 @@ for(var/bullets_fired = 1, bullets_fired <= burst_amount, bullets_fired++) var/atom/T = A if(!prob((accuracy * 100) / owner.misc_multipliers["accuracy"])) - T = get_step(get_turf(A), pick(cardinal)) + T = get_step(get_turf(A), pick(GLOB.cardinals)) if(LAZYLEN(activation_sounds)) playsound(get_turf(src), pick(activation_sounds), 60, 1) fire_projectile(user, T) diff --git a/code/modules/vehicles/hardpoints/secondary/frontal_cannon.dm b/code/modules/vehicles/hardpoints/secondary/frontal_cannon.dm index 4d454bed12a4..a4d7370935fe 100644 --- a/code/modules/vehicles/hardpoints/secondary/frontal_cannon.dm +++ b/code/modules/vehicles/hardpoints/secondary/frontal_cannon.dm @@ -47,7 +47,7 @@ for(var/bullets_fired = 1, bullets_fired <= burst_amount, bullets_fired++) var/atom/T = A if(!prob((accuracy * 100) / owner.misc_multipliers["accuracy"])) - T = get_step(get_turf(A), pick(cardinal)) + T = get_step(get_turf(A), pick(GLOB.cardinals)) if(LAZYLEN(activation_sounds)) playsound(get_turf(src), pick(activation_sounds), 60, 1) fire_projectile(user, T) diff --git a/code/modules/vehicles/hardpoints/special/firing_port_weapon.dm b/code/modules/vehicles/hardpoints/special/firing_port_weapon.dm index 9310556ee94f..b6f3daed9f4e 100644 --- a/code/modules/vehicles/hardpoints/special/firing_port_weapon.dm +++ b/code/modules/vehicles/hardpoints/special/firing_port_weapon.dm @@ -131,7 +131,7 @@ for(var/bullets_fired = 1, bullets_fired <= burst_amount, bullets_fired++) var/atom/T = A if(!prob((accuracy * 100) / owner.misc_multipliers["accuracy"])) - T = get_step(get_turf(A), pick(cardinal)) + T = get_step(get_turf(A), pick(GLOB.cardinals)) if(LAZYLEN(activation_sounds)) playsound(get_turf(src), pick(activation_sounds), 60, 1) fire_projectile(user, T) diff --git a/code/modules/vehicles/hardpoints/support/artillery.dm b/code/modules/vehicles/hardpoints/support/artillery.dm index 441817107e7c..aacb83fcf383 100644 --- a/code/modules/vehicles/hardpoints/support/artillery.dm +++ b/code/modules/vehicles/hardpoints/support/artillery.dm @@ -57,7 +57,7 @@ continue var/mob/user = C.seats[seat] if(!user.client) continue - user.client.change_view(world_view_size, owner) + user.client.change_view(GLOB.world_view_size, owner) user.client.pixel_x = 0 user.client.pixel_y = 0 is_active = FALSE diff --git a/code/modules/vehicles/interior/interactable/seats.dm b/code/modules/vehicles/interior/interactable/seats.dm index 3f3058d0572f..ea961bc72593 100644 --- a/code/modules/vehicles/interior/interactable/seats.dm +++ b/code/modules/vehicles/interior/interactable/seats.dm @@ -43,7 +43,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.change_view(world_view_size, vehicle) + M.client.change_view(GLOB.world_view_size, vehicle) M.client.pixel_x = 0 M.client.pixel_y = 0 M.reset_view() @@ -177,7 +177,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.change_view(world_view_size, vehicle) + M.client.change_view(GLOB.world_view_size, vehicle) M.client.pixel_x = 0 M.client.pixel_y = 0 else @@ -255,7 +255,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.change_view(world_view_size, vehicle) + M.client.change_view(GLOB.world_view_size, vehicle) M.client.pixel_x = 0 M.client.pixel_y = 0 M.reset_view() @@ -388,17 +388,6 @@ handle_rotation() -/obj/structure/bed/chair/vehicle/unbuckle() - if(buckled_mob && buckled_mob.buckled == src) - buckled_mob.buckled = null - buckled_mob.anchored = initial(buckled_mob.anchored) - buckled_mob.update_canmove() - - var/M = buckled_mob - buckled_mob = null - - afterbuckle(M) - //attack handling /obj/structure/bed/chair/vehicle/attack_alien(mob/living/user) diff --git a/code/modules/vehicles/multitile/multitile_bump.dm b/code/modules/vehicles/multitile/multitile_bump.dm index 1f9e7897b0d3..48706805948f 100644 --- a/code/modules/vehicles/multitile/multitile_bump.dm +++ b/code/modules/vehicles/multitile/multitile_bump.dm @@ -639,7 +639,7 @@ //Check what dir they should be facing to be looking directly at the vehicle else if(dir_between == dir) //front hit (facing the vehicle) blocked = TRUE - else if(dir_between == reverse_dir[dir]) // rear hit (facing directly away from the vehicle) + else if(dir_between == GLOB.reverse_dir[dir]) // rear hit (facing directly away from the vehicle) takes_damage = TRUE //side hit else if(caste.caste_type == XENO_CASTE_QUEEN) // queen blocks even with sides diff --git a/code/modules/vehicles/tank/tank.dm b/code/modules/vehicles/tank/tank.dm index fd953b04100a..147e359471df 100644 --- a/code/modules/vehicles/tank/tank.dm +++ b/code/modules/vehicles/tank/tank.dm @@ -157,7 +157,7 @@ if(!T) return FALSE - if(direction == reverse_dir[T.dir] || direction == T.dir) + if(direction == GLOB.reverse_dir[T.dir] || direction == T.dir) return FALSE T.user_rotation(user, turning_angle(T.dir, direction)) diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm index 92358a1e0f27..cbad4535df72 100644 --- a/code/modules/vehicles/train.dm +++ b/code/modules/vehicles/train.dm @@ -54,8 +54,8 @@ //------------------------------------------- -/obj/vehicle/train/MouseDrop_T(atom/movable/C, mob/user as mob) - if(user.buckled || user.stat || user.is_mob_restrained() || !Adjacent(user) || !user.Adjacent(C) || !istype(C) || (user == C && !user.canmove)) +/obj/vehicle/train/MouseDrop_T(atom/movable/C, mob/living/user as mob) + if(user.buckled || user.stat || user.is_mob_restrained() || !Adjacent(user) || !user.Adjacent(C) || !istype(C) || (user == C && !(user.mobility_flags & MOBILITY_MOVE))) return if(istype(C,/obj/vehicle/train)) latch(C, user) @@ -71,7 +71,7 @@ if(!istype(usr, /mob/living/carbon/human)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !Adjacent(usr)) + if(usr.is_mob_incapacitated() || !Adjacent(usr)) return unattach(usr) diff --git a/code/modules/vehicles/van/van.dm b/code/modules/vehicles/van/van.dm index fdb2f397bb2e..c4aa64360ec0 100644 --- a/code/modules/vehicles/van/van.dm +++ b/code/modules/vehicles/van/van.dm @@ -92,13 +92,13 @@ if(mover in mobs_under) //can't collide with the thing you're buckled to return NO_BLOCKED_MOVEMENT - if(ismob(mover)) - var/mob/M = mover + if(isliving(mover)) + var/mob/living/M = mover if(M.mob_flags & SQUEEZE_UNDER_VEHICLES) add_under_van(M) return NO_BLOCKED_MOVEMENT - if(M.lying) + if(M.body_position == LYING_DOWN) return NO_BLOCKED_MOVEMENT if(M.mob_size >= MOB_SIZE_IMMOBILE && next_push < world.time) diff --git a/code/names.dm b/code/names.dm deleted file mode 100644 index 0961d12f7d45..000000000000 --- a/code/names.dm +++ /dev/null @@ -1,39 +0,0 @@ -var/list/ai_names = file2list("strings/ai.txt") -var/list/first_names_male = file2list("strings/first_male.txt") -var/list/first_names_female = file2list("strings/first_female.txt") -var/list/last_names = file2list("strings/last.txt") -var/list/clown_names = file2list("strings/clown.txt") -var/list/operation_titles = file2list("strings/operation_title.txt") -var/list/operation_prefixes = file2list("strings/operation_prefix.txt") -var/list/operation_postfixes = file2list("strings/operation_postfix.txt") - -var/list/verbs = file2list("strings/verbs.txt") -//loaded on startup because of " -//would include in rsc if ' was used - - -var/list/first_names_male_clf = list("Alan","Jack","Bil","Jonathan","John","Shiro","Gareth","Clark","Sam", "Lionel", "Aaron", "Charlie", "Scott", "Winston", "Aidan", "Ellis", "Mason", "Wesley", "Nicholas", "Calvin", "Nishikawa", "Hiroto", "Chiba", "Ouchi", "Furuse", "Takagi", "Oba", "Kishimoto") -var/list/first_names_female_clf = list("Emma", "Adelynn", "Mary", "Halie", "Chelsea", "Lexie", "Arya", "Alicia", "Selah", "Amber", "Heather", "Myra", "Heidi", "Charlotte", "Oliva", "Lydia", "Tia", "Riko", "Ari", "Machida", "Ueki", "Mihara", "Noda") -var/list/last_names_clf = list("Hawkins","Rickshaw","Elliot","Billard","Cooper","Fox", "Barlow", "Barrows", "Stewart", "Morgan", "Green", "Stone", "Burr", "Hunt", "Yuko", "Gesshin", "Takanibu", "Tetsuzan", "Tomomi", "Bokkai", "Takesi") - -var/list/first_names_male_colonist = list("Alan","Jack","Bil","Jonathan","John","Shiro","Gareth","Clark","Sam", "Lionel", "Aaron", "Charlie", "Scott", "Winston", "Aidan", "Ellis", "Mason", "Wesley", "Nicholas", "Calvin", "Nishikawa", "Hiroto", "Chiba", "Ouchi", "Furuse", "Takagi", "Oba", "Kishimoto") -var/list/first_names_female_colonist = list("Emma", "Adelynn", "Mary", "Halie", "Chelsea", "Lexie", "Arya", "Alicia", "Selah", "Amber", "Heather", "Myra", "Heidi", "Charlotte", "Ashley", "Raven", "Tori", "Anne", "Madison", "Oliva", "Lydia", "Tia", "Riko", "Ari", "Machida", "Ueki", "Mihara", "Noda") -var/list/last_names_colonist = list("Hawkins","Rickshaw","Elliot","Billard","Cooper","Fox", "Barlow", "Barrows", "Stewart", "Morgan", "Green", "Stone", "Titan", "Crowe", "Krantz", "Pathillo", "Driggers", "Burr", "Hunt", "Yuko", "Gesshin", "Takanibu", "Tetsuzan", "Tomomi", "Bokkai", "Takesi") - -var/list/first_names_male_upp = list("Badai","Mongkeemur","Alexei","Andrei","Artyom","Viktor","Xiangai","Ivan","Choban","Oleg", "Dayan", "Taghi", "Batu", "Arik", "Orda", "Ghazan", "Bala", "Gao", "Zhan", "Ren", "Hou", "Xue", "Serafim", "Luca", "Su", "György", "István", "Mihály", "Vladimir", "Aleksandr", "Fyodor", "Bhodar", "Qazem", "Łukasz", "Miłogost", "Radogost", "Uniegost", "Hostirad", "Hostimil", "Hostisvit", "Lubgost", "Gościsław", "Vseslav", "Bohuměr", "Bronisław", "Česćiměr", "Dobysław", "Horisław", "Jaroměr", "Mirosław", "Mječisław", "Radoměr", "Stanij", "Stanisław", "Wjeleměr", "Wójsław") -var/list/first_names_female_upp = list("Altani","Cirina","Anastasiya","Saran","Wei","Oksana","Ren","Svena","Tatyana","Yaroslava", "Izabella", "Kata", "Krisztina", "Miruna", "Flori", "Lucia", "Anica", "Li", "Yimu", "Alona", "Hsiau-Li", "Xiaoling", "Erhong", "Baśka", "Angela", "Angelina", "Angja", "Ankica", "Biljana", "Bisera", "Bistra", "Blaga", "Blagica", "Blagorodna", "Verka", "Vladica", "Denica", "Živka", "Zlata", "Jagoda", "Letka", "Ljupka", "Mila", "Mirjana", "Mirka", "Rada", "Radmila", "Slavica", "Slavka", "Snežana", "Stojna", "Ubavka", "Jaromir", "Mscëwòj", "Subisłôw", "Swiãtopôłk", "Ji-Sun", "Chaeyong", "Chaewon", "Saerom", "Seoyeong", "Jiheon", "Hayoung") -var/list/last_names_upp = list("Azarov","Bogdanov","Barsukov","Golovin","Davydov","Khan","Noica","Barbu","Zhukov","Ivanov","Mihai","Kasputin","Belov", "Belova","Melnikov", "Vasilevsky", "Aleksander", "Halkovich", "Stanislaw", "Proca", "Zaituc", "Arcos", "Kubat", "Kral", "Volf", "Xun", "Jia", "Bachoń", "Wang", "Ji", "Xiang", "Zhang", "Mei", "Ma", "Kim", "Yi", "Ri", "Pak", "Chong", "Baek", "Kwon", "Hwang", "Roh", "Lee", "Song") - -var/list/first_names_male_pmc = list("Owen","Luka","Nelson","Branson", "Tyson", "Leo", "Bryant", "Kobe", "Rohan", "Riley", "Aidan", "Watase","Egawa", "Hisakawa", "Koide", "Remy", "Martial", "Magnus", "Heiko", "Lennard") -var/list/first_names_female_pmc = list("Madison","Jessica","Anna","Juliet", "Olivia", "Lea", "Diane", "Kaori", "Beatrice", "Riley", "Amy", "Natsue","Yumi", "Aiko", "Fujiko", "Jennifer", "Ashley", "Mary", "Hitomi", "Lisa") -var/list/last_names_pmc = list("Bates","Shaw","Hansen","Black", "Chambers", "Hall", "Gibson", "Weiss", "Waller", "Burton", "Bakin", "Rohan", "Naomichi", "Yakumo", "Yosai", "Gallagher", "Hiles", "Bourdon", "Strassman", "Palau") - -var/list/first_names_male_gladiator = list("Augustus", "Maximus", "Octavius", "Septimus", "Titus", "Brutus", "Caesar", "Justinian") -var/list/first_names_female_gladiator = list("Aelia", "Aquila", "Caecilia", "Camilla", "Claudia", "Flavia", "Martina", "Theodora") - -var/list/first_names_male_dutch = list("Raymond", "Jesse", "Jack", "John", "Sam", "Aaron", "Charlie", "Ellis", "Nick", "Francis", "Louis") -var/list/first_names_female_dutch = list("Chelsea", "Mira", "Jessica", "Catherine", "Eliza", "Emma", "Ashley", "Annie", "Alicia", "Miranda", "Ellen") - -var/list/monkey_names = list("Abu", "Aldo", "Bear", "Bingo", "Clyde", "Crystal", "Gordo", "George", "Koko", "Marcel", "Nim", "Rafiki", "Spike", "Banana", "Boots", "Bubbles", "Smiley", "Winston") - -var/list/weapon_surnames = list("Adze", "Axe", "Bagh Nakha", "Bo", "Bola", "Bow", "Bowman", "Cannon", "Carbine", "Cestus", "Club", "Culverin", "Dagger", "Dao", "Derringer", "Dha", "Dussack", "Emeici", "Falchion", "Fan", "Flyssa", "Gauntlet", "Hammer", "Halberd", "Harquebus", "Hatchet", "Hwando", "Katar", "Kampilan", "Knuckles", "Lance", "Lancer", "Larim", "Maduvu", "Mace", "Maru", "Mauser", "Messer", "Mine", "Mubucae", "Nyepel", "Onager", "Pata", "Pike", "Ram", "Saber", "Seax", "Shamsir", "Sickle", "Sling", "Spear", "Spears", "Staff", "Sword", "Tekko") diff --git a/colonialmarines.dme b/colonialmarines.dme index eba358c4cef6..8656c70d6f18 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -17,7 +17,6 @@ #include "code\_experiments.dm" #include "code\_macros.dm" #include "code\global.dm" -#include "code\names.dm" #include "code\span_macros.dm" #include "code\stylesheet.dm" #include "code\__DEFINES\__game.dm" @@ -145,6 +144,7 @@ #include "code\__HELPERS\#maths.dm" #include "code\__HELPERS\_lists.dm" #include "code\__HELPERS\_time.dm" +#include "code\__HELPERS\animations.dm" #include "code\__HELPERS\chat.dm" #include "code\__HELPERS\cmp.dm" #include "code\__HELPERS\datums.dm" @@ -166,6 +166,7 @@ #include "code\__HELPERS\qdel.dm" #include "code\__HELPERS\sanitize_values.dm" #include "code\__HELPERS\shell.dm" +#include "code\__HELPERS\status_effects.dm" #include "code\__HELPERS\text.dm" #include "code\__HELPERS\traits.dm" #include "code\__HELPERS\type2type.dm" @@ -180,10 +181,12 @@ #include "code\_globalvars\misc.dm" #include "code\_globalvars\regexes.dm" #include "code\_globalvars\tgui.dm" +#include "code\_globalvars\lists\clans.dm" #include "code\_globalvars\lists\client.dm" #include "code\_globalvars\lists\keybindings.dm" #include "code\_globalvars\lists\mapping_globals.dm" #include "code\_globalvars\lists\mobs.dm" +#include "code\_globalvars\lists\names.dm" #include "code\_globalvars\lists\object_lists.dm" #include "code\_onclick\adjacent.dm" #include "code\_onclick\ai.dm" @@ -327,7 +330,6 @@ #include "code\datums\mind.dm" #include "code\datums\mixed.dm" #include "code\datums\mob_hud.dm" -#include "code\datums\modules.dm" #include "code\datums\movement_detector.dm" #include "code\datums\mutable_appearance.dm" #include "code\datums\quadtree.dm" @@ -1342,8 +1344,6 @@ #include "code\game\verbs\preferences.dm" #include "code\game\verbs\records.dm" #include "code\game\verbs\who.dm" -#include "code\js\byjax.dm" -#include "code\js\menus.dm" #include "code\modules\trigger.dm" #include "code\modules\admin\admin.dm" #include "code\modules\admin\admin_ranks.dm" diff --git a/html/changelogs/AutoChangeLog-pr-4716.yml b/html/changelogs/AutoChangeLog-pr-4716.yml new file mode 100644 index 000000000000..76dacd7a72ca --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-4716.yml @@ -0,0 +1,5 @@ +author: "Birdtalon" +delete-after: True +changes: + - rscadd: "Eggsac carrier can now place eggs on normal weeds to a maximum of 4 eggs." + - rscadd: "Eggsac carrier eggs on normal weeds have an expiry date." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-4827.yml b/html/changelogs/AutoChangeLog-pr-4827.yml deleted file mode 100644 index b95ce40e4607..000000000000 --- a/html/changelogs/AutoChangeLog-pr-4827.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "LC4492" -delete-after: True -changes: - - maptweak: "Changes to the CO office: The bathroom now faces into the CO's bedroom, and not to his main office. Victory cabinet have been moved to the Officer's mess because of logical issues. Extra-detail to the office, including an exclusive stamp, table flags and others. The safe is now inside the CO's bedroom, and not in his office. The energy APC is now inside the CO's bedroom, and not in his office. Jones finally have a BED again, or something like that. Other minor changes to objects, such the addition of a cane, a box of glasses for serving guests, etc." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-4828.yml b/html/changelogs/AutoChangeLog-pr-4828.yml new file mode 100644 index 000000000000..133404e587a6 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-4828.yml @@ -0,0 +1,7 @@ +author: "fira" +delete-after: True +changes: + - code_imp: "Ported basic /tg/ Status Backend." + - rscadd: "Human transform changes such as lying down, knock down, buckling, are now animated." + - bugfix: "Some statuses will now take effect immediately instead of waiting for a life tick, notably Resting." + - balance: "Many interaction requirements were changed to eg. fail upon stuns rather than if lying down." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-4944.yml b/html/changelogs/AutoChangeLog-pr-4944.yml deleted file mode 100644 index 0c8af20f86c8..000000000000 --- a/html/changelogs/AutoChangeLog-pr-4944.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Steelpoint" -delete-after: True -changes: - - maptweak: "Secure Storage on LV-624 has been broken open, making it far less defendable but easier to access." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-4953.yml b/html/changelogs/AutoChangeLog-pr-4953.yml deleted file mode 100644 index 4dd8c48e8206..000000000000 --- a/html/changelogs/AutoChangeLog-pr-4953.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Drathek" -delete-after: True -changes: - - bugfix: "Tweaked larva queue spawning: Now spawns as many larva as possible each cycle rather than one." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-5042.yml b/html/changelogs/AutoChangeLog-pr-5042.yml new file mode 100644 index 000000000000..ff4fbf2ac464 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5042.yml @@ -0,0 +1,4 @@ +author: "stalkerino" +delete-after: True +changes: + - rscadd: "readds skull facepaint and skull balaclava (blue and black)" \ No newline at end of file diff --git a/html/changelogs/archive/2023-11.yml b/html/changelogs/archive/2023-11.yml index 66eaccb86d87..8fc0ce518efb 100644 --- a/html/changelogs/archive/2023-11.yml +++ b/html/changelogs/archive/2023-11.yml @@ -279,3 +279,112 @@ game hislittlecuzingames: - rscadd: Launch Announcement Alarm for dropships to notify ground forces of departure. +2023-11-23: + Birdtalon: + - rscdel: Lesser drones die upon ghosting and are not offered to observers. + - rscadd: Explosion handling logic to experimental sensor tower. + - bugfix: Explosions no longer delete experimental sensor tower. + - bugfix: Pylons now differentiated in the input list with a (1) if in the same + area. + Drathek: + - bugfix: Resin doors will now close on dead mobs that are merged with weeds (currently + only human). + - bugfix: Resin doors will now restart their closing timer each open making the + delay to close consistent. + - code_imp: Added a TRAIT_MERGED_WITH_WEEDS that is set whenever the mob is currently + merged with weeds. + - bugfix: 'Fixed buried larva spawn grace period at start of round if there is a + queue: Now join as xeno when there''s a queue will only prevent buried larva + spawns if there is no core.' + - bugfix: 'Tweaked larva queue spawning: Now spawns as many larva as possible each + cycle rather than one.' + LC4492: + - maptweak: 'Changes to the CO office: The bathroom now faces into the CO''s bedroom, + and not to his main office. Victory cabinet have been moved to the Officer''s + mess because of logical issues. Extra-detail to the office, including an exclusive + stamp, table flags and others. The safe is now inside the CO''s bedroom, and + not in his office. The energy APC is now inside the CO''s bedroom, and not in + his office. Jones finally have a BED again, or something like that. Other minor + changes to objects, such the addition of a cane, a box of glasses for serving + guests, etc.' + QuickLode: + - rscadd: Damage to Synthetic's internal causes debuffs, eventual powercell failure.(death) + - bugfix: Synthetic's should no longer lose blood. + - code_imp: moves blood proc to human.dm from blood.dm with above changes. + SortieEnMer: + - qol: Match Unlock Time in Nuke Timelock Message with Nuke Techtree Description + Steelpoint: + - maptweak: Secure Storage on LV-624 has been broken open, making it far less defendable + but easier to access. + fira: + - bugfix: The Thunderdome floor is now explosion-proof. + - balance: Default Web Music Player volume is now 20% down from 50%. It was found + too effective against new players. + - admin: '"Play Internet Sound" is now "Play Admin Sound" and optionally allow to + hide the track name.' + - admin: '"Play Admin Sound" can now be used with uploaded tracks, which use CDN + delivery and the in-chat music player, granting players more control over them.' + - admin: Removed "Play Midi Sound". + ihatethisengine: + - balance: Oppressor no longer can abduct big xenos. + zzzmike: + - qol: ARES hijack announcement specifies that pods will not crash at 100% fuel + - qol: Location name standardization. So, North is now Starboard. This is already + how it is for everything except pumps. +2023-11-25: + BadAtThisGame302: + - bugfix: fixed corporate supervisor burst corpse landmark + Birdtalon: + - bugfix: Fixes defender headbutt bug while fortified. + - bugfix: Lifeboats fire extinguisher runtime. + Doubleumc: + - imageadd: 2-wide dropship side doors + - maptweak: changed dropship side doors to a lone doublewide door + - qol: directions in trackers and messages are more accurate + HeresKozmos: + - bugfix: fixed a nonsensical window facing a solid rock wall + - rscadd: Added pizza and pizza cutter to Req + - rscdel: Deleted a random kepler crisps bag + - bugfix: deleted random raised edges from inside rock wall + Releasethesea: + - bugfix: fixes the XM43E1s name (previously named XM42B) and sprite, fixes the + M42C and XM43E1s barrel, correctly names several items relating to the XM43E1 + SabreML: + - ui: Tweaked the colour of the 'Maintainer' category in staffwho. + ihatethisengine: + - rscadd: Locking down dropship's doors closes them before locking. + realforest2001: + - rscadd: Telephones now list the last attempted caller, above the DND button. +2023-11-26: + Birdtalon: + - code_imp: Replaces single letter vars removes redundant abilitiesin warrior code. + - bugfix: Warriors can no longer behead caps if they start limb ripping before embryo + is inserted. + - code_imp: Refactors warrior limb proc to the warrior class. + Huffie56: + - rscadd: Added a new section to role squad vendors called binoculars except specialist. + - qol: moved NVG and medical hud into helmet optics section for SL and just NVG + for TL + Nanu308: + - rscdel: Removed the Pizza Cutter. +2023-11-27: + Birdtalon: + - bugfix: "Fixes vendor sprites not updating icon when fully repaired\n/\U0001F191" + - bugfix: Fix lesser drone crash on getting gibbed. + Doubleumc: + - bugfix: CORSAT poddoors no longer have extra sprites overlaid on them + - maptweak: CORSAT LZs can be used by shuttles + HeresKozmos: + - rscadd: Added eight new tunnels to Sorokyne + - rscdel: Removed the original five tunnels on Sorokyne + SabreML: + - rscadd: Made the character preview in the character creation menu show the 'Preferred + Armor' setting. + - bugfix: Fixed 'Padded' armour being replaced by the user's armour style preference + when vended. + - qol: Made the squad prep attachments vendors vend items into the user's hands. + Zonespace27: + - bugfix: The Self Destruct timer in the status panel will now stop once SD has + gone off. + hislittlecuzingames: + - bugfix: Disables launch announcment alarm if it's sounding when queen hijacks diff --git a/icons/mob/humans/onmob/back.dmi b/icons/mob/humans/onmob/back.dmi index a6e9ef72c010..8fc07bc410fb 100644 Binary files a/icons/mob/humans/onmob/back.dmi and b/icons/mob/humans/onmob/back.dmi differ diff --git a/icons/mob/humans/onmob/items_lefthand_1.dmi b/icons/mob/humans/onmob/items_lefthand_1.dmi index 37b5f9bcc609..b67106a1f831 100644 Binary files a/icons/mob/humans/onmob/items_lefthand_1.dmi and b/icons/mob/humans/onmob/items_lefthand_1.dmi differ diff --git a/icons/mob/humans/onmob/items_righthand_1.dmi b/icons/mob/humans/onmob/items_righthand_1.dmi index 3ad8b52d0403..7bcc772c7375 100644 Binary files a/icons/mob/humans/onmob/items_righthand_1.dmi and b/icons/mob/humans/onmob/items_righthand_1.dmi differ diff --git a/icons/mob/humans/onmob/suit_slot.dmi b/icons/mob/humans/onmob/suit_slot.dmi index 9f0e15209fe6..e83ce1301fa7 100644 Binary files a/icons/mob/humans/onmob/suit_slot.dmi and b/icons/mob/humans/onmob/suit_slot.dmi differ diff --git a/icons/obj/items/weapons/guns/attachments.dmi b/icons/obj/items/weapons/guns/attachments.dmi index 332217fe1cf0..e627f7559a78 100644 Binary files a/icons/obj/items/weapons/guns/attachments.dmi and b/icons/obj/items/weapons/guns/attachments.dmi differ diff --git a/icons/obj/items/weapons/guns/attachments/barrel.dmi b/icons/obj/items/weapons/guns/attachments/barrel.dmi index 03c2257c69c5..138b9b658fb6 100644 Binary files a/icons/obj/items/weapons/guns/attachments/barrel.dmi and b/icons/obj/items/weapons/guns/attachments/barrel.dmi differ diff --git a/icons/obj/items/weapons/guns/guns_by_faction/uscm.dmi b/icons/obj/items/weapons/guns/guns_by_faction/uscm.dmi index 38fe8079a2e8..a7586a656965 100644 Binary files a/icons/obj/items/weapons/guns/guns_by_faction/uscm.dmi and b/icons/obj/items/weapons/guns/guns_by_faction/uscm.dmi differ diff --git a/icons/obj/structures/doors/dropship1_side2.dmi b/icons/obj/structures/doors/dropship1_side2.dmi new file mode 100644 index 000000000000..f2d96e59af5a Binary files /dev/null and b/icons/obj/structures/doors/dropship1_side2.dmi differ diff --git a/icons/obj/structures/doors/dropship2_side2.dmi b/icons/obj/structures/doors/dropship2_side2.dmi new file mode 100644 index 000000000000..bff39827c359 Binary files /dev/null and b/icons/obj/structures/doors/dropship2_side2.dmi differ diff --git a/maps/map_files/CORSAT/Corsat.dmm b/maps/map_files/CORSAT/Corsat.dmm index ab1e9cbaa2fd..b00a12dc86bd 100644 --- a/maps/map_files/CORSAT/Corsat.dmm +++ b/maps/map_files/CORSAT/Corsat.dmm @@ -37445,7 +37445,6 @@ /area/corsat/gamma/biodome/virology) "drp" = ( /obj/docking_port/stationary/marine_dropship/lz1{ - dwidth = 1; name = "Gamma Landing Zone" }, /turf/open/floor/plating, @@ -38223,7 +38222,6 @@ /area/corsat/omega/complex) "dUj" = ( /obj/docking_port/stationary/marine_dropship/lz2{ - dwidth = 1; name = "Sigma Landing Zone" }, /turf/open/floor/plating, diff --git a/maps/map_files/DesertDam/Desert_Dam.dmm b/maps/map_files/DesertDam/Desert_Dam.dmm index 4b760f41e5c0..4bf4d0e7a88c 100644 --- a/maps/map_files/DesertDam/Desert_Dam.dmm +++ b/maps/map_files/DesertDam/Desert_Dam.dmm @@ -9576,17 +9576,6 @@ /obj/structure/window/framed/colony/reinforced, /turf/open/floor/plating, /area/desert_dam/interior/dam_interior/east_tunnel_entrance) -"aCT" = ( -/obj/structure/barricade/wooden{ - desc = "This barricade is heavily reinforced. Nothing short of blasting it open seems like it'll do the trick, that or melting the breams supporting it..."; - dir = 8; - health = 25000 - }, -/turf/open/floor/prison{ - dir = 10; - icon_state = "bright_clean" - }, -/area/desert_dam/interior/dam_interior/east_tunnel_entrance) "aCU" = ( /obj/effect/decal/cleanable/dirt, /turf/open/floor/prison{ @@ -9651,18 +9640,6 @@ }, /turf/open/asphalt, /area/desert_dam/exterior/valley/valley_northwest) -"aDd" = ( -/obj/structure/bed/chair, -/obj/structure/barricade/wooden{ - desc = "This barricade is heavily reinforced. Nothing short of blasting it open seems like it'll do the trick, that or melting the breams supporting it..."; - dir = 8; - health = 25000 - }, -/turf/open/floor/prison{ - dir = 10; - icon_state = "bright_clean" - }, -/area/desert_dam/interior/dam_interior/east_tunnel_entrance) "aDe" = ( /obj/effect/decal/sand_overlay/sand1, /turf/open/asphalt{ @@ -85490,8 +85467,8 @@ dTs dTs aEa aEa -aCS -aCS +aEa +aEa aEa aEa dTs @@ -85724,8 +85701,8 @@ dTs dTs aEa aCD -aCT -aDd +aCF +aDg aDn aEa aDt diff --git a/maps/map_files/Kutjevo/Kutjevo.dmm b/maps/map_files/Kutjevo/Kutjevo.dmm index eb5f1afabaed..676bd49576f0 100644 --- a/maps/map_files/Kutjevo/Kutjevo.dmm +++ b/maps/map_files/Kutjevo/Kutjevo.dmm @@ -14435,18 +14435,6 @@ }, /turf/open/floor/plating/kutjevo, /area/kutjevo/interior/complex/botany) -"tRD" = ( -/obj/structure/platform_decoration/kutjevo{ - dir = 8 - }, -/obj/structure/platform_decoration/kutjevo{ - dir = 8 - }, -/obj/structure/platform_decoration/kutjevo{ - dir = 8 - }, -/turf/closed/wall/kutjevo/rock, -/area/kutjevo/interior/oob) "tRG" = ( /obj/structure/platform/kutjevo/smooth{ dir = 1; @@ -35827,7 +35815,7 @@ dxF dxF dxF dxF -tRD +dxF dxF dxF dxF diff --git a/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm b/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm index 69e040e98ea2..50240fcd8d55 100644 --- a/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm +++ b/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm @@ -42329,8 +42329,10 @@ /turf/open/floor/wood, /area/lv522/indoors/a_block/fitness/glass) "qzp" = ( -/obj/structure/machinery/door/airlock/dropship_hatch/two{ - dir = 8 +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside/ds2{ + id = "sh_dropship2"; + dir = 2; + name = "\improper Typhoon crew hatch" }, /turf/open/shuttle/dropship{ icon_state = "rasputin3" @@ -47136,6 +47138,16 @@ /obj/effect/decal/cleanable/dirt, /turf/open/floor/plating, /area/lv522/indoors/lone_buildings/storage_blocks) +"shh" = ( +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside/ds2{ + dir = 1; + id = "sh_dropship2"; + name = "\improper Typhoon crew hatch" + }, +/turf/open/shuttle/dropship{ + icon_state = "rasputin3" + }, +/area/lv522/landing_zone_forecon/UD6_Typhoon) "shm" = ( /obj/structure/machinery/vending/cola, /obj/effect/decal/cleanable/dirt, @@ -66448,7 +66460,7 @@ pRK qmM qGQ qTh -qzp +rjP qzp nfq fDg @@ -67810,8 +67822,8 @@ pUc qst qLz qVl -qzp -qzp +rjP +shh rFp sdE sIx diff --git a/maps/map_files/Sorokyne_Strata/Sorokyne_Strata.dmm b/maps/map_files/Sorokyne_Strata/Sorokyne_Strata.dmm index 19a7717a7e67..84355a59b16d 100644 --- a/maps/map_files/Sorokyne_Strata/Sorokyne_Strata.dmm +++ b/maps/map_files/Sorokyne_Strata/Sorokyne_Strata.dmm @@ -7794,7 +7794,9 @@ }, /area/strata/ag/interior/outpost/engi) "axf" = ( -/obj/structure/surface/table/reinforced/prison, +/obj/structure/tunnel/maint_tunnel{ + pixel_y = 16 + }, /turf/open/floor/strata, /area/strata/ag/interior/outpost/engi) "axg" = ( @@ -10464,11 +10466,13 @@ }, /area/strata/ag/interior/outpost/canteen) "aFC" = ( -/obj/structure/tunnel{ - id = "hole3" +/obj/structure/machinery/light/small, +/obj/structure/tunnel/maint_tunnel, +/turf/open/floor/strata{ + dir = 10; + icon_state = "multi_tiles" }, -/turf/open/auto_turf/snow/brown_base/layer0, -/area/strata/ag/exterior/paths/north_outpost) +/area/strata/ag/interior/outpost/engi/drome) "aFD" = ( /turf/closed/wall/strata_ice/jungle, /area/strata/ag/interior/outpost/maint/canteen_e_1) @@ -16510,11 +16514,9 @@ /turf/open/auto_turf/snow/brown_base/layer2, /area/strata/ag/interior/disposals) "bad" = ( -/obj/structure/tunnel{ - id = "hole4" - }, -/turf/open/auto_turf/snow/brown_base/layer2, -/area/strata/ag/exterior/north_lz_caves) +/obj/structure/tunnel, +/turf/open/auto_turf/strata_grass/layer1, +/area/strata/ug/interior/jungle/deep/tearlake) "bae" = ( /obj/structure/prop/almayer/computers/mapping_computer, /turf/open/floor/strata{ @@ -18476,12 +18478,9 @@ }, /area/strata/ug/interior/outpost/jung/dorms/admin4) "bgX" = ( -/obj/structure/flora/bush/ausbushes/grassybush, -/obj/structure/tunnel{ - id = "hole2" - }, -/turf/open/auto_turf/strata_grass/layer1, -/area/strata/ug/exterior/jungle/deep/carplake_center) +/obj/structure/tunnel, +/turf/open/auto_turf/ice/layer1, +/area/strata/ag/exterior/marsh/center) "bha" = ( /obj/structure/pipes/standard/simple/hidden/cyan, /turf/open/auto_turf/snow/brown_base/layer1, @@ -21979,11 +21978,9 @@ /turf/open/auto_turf/snow/brown_base/layer2, /area/strata/ag/exterior/marsh/center) "bui" = ( -/obj/structure/tunnel{ - id = "hole1" - }, -/turf/open/auto_turf/snow/brown_base/layer3, -/area/strata/ag/exterior/tcomms/tcomms_deck) +/obj/structure/tunnel, +/turf/open/auto_turf/strata_grass/layer1, +/area/strata/ug/interior/jungle/deep/minehead) "bul" = ( /obj/item/tool/shovel/snow, /turf/open/auto_turf/snow/brown_base/layer1, @@ -34633,6 +34630,12 @@ "lbh" = ( /turf/open/asphalt/cement, /area/strata/ag/exterior/tcomms/tcomms_deck) +"lbW" = ( +/obj/structure/tunnel/maint_tunnel, +/turf/open/floor/strata{ + icon_state = "floor3" + }, +/area/strata/ag/interior/outpost/admin) "lcq" = ( /obj/item/clothing/suit/storage/militia, /obj/item/clothing/suit/storage/snow_suit/doctor, @@ -36226,6 +36229,10 @@ }, /turf/open/auto_turf/strata_grass/layer1, /area/strata/ug/interior/jungle/deep/hotsprings) +"nPr" = ( +/obj/structure/tunnel, +/turf/open/auto_turf/strata_grass/layer1, +/area/strata/ug/interior/jungle/deep/east_carp) "nPJ" = ( /obj/structure/pipes/standard/manifold/hidden/cyan, /turf/open/floor/strata, @@ -37410,12 +37417,14 @@ }, /area/strata/ag/interior/tcomms) "pMU" = ( -/obj/structure/flora/bush/ausbushes/grassybush, -/obj/structure/tunnel{ - id = "hole1" +/obj/structure/tunnel/maint_tunnel{ + pixel_y = 16 }, -/turf/open/auto_turf/strata_grass/layer1, -/area/strata/ug/interior/jungle/platform/east/scrub) +/turf/open/floor/strata{ + dir = 10; + icon_state = "multi_tiles" + }, +/area/strata/ag/interior/outpost/canteen/personal_storage) "pNL" = ( /obj/structure/stairs/perspective{ color = "#6e6e6e"; @@ -49411,7 +49420,7 @@ aXP aYd aac aac -bad +aYd aYd aXP aXP @@ -49825,7 +49834,7 @@ aac aac rsm coC -coC +bgX coC wrw aac @@ -55882,7 +55891,7 @@ aac aac aac aac -bui +btX btq btq btv @@ -60485,7 +60494,7 @@ ayr ayr aCu aAb -aFC +ayw ayw aAR awJ @@ -64616,7 +64625,7 @@ biK blQ biH bsC -bll +lbW cik bCo bGO @@ -69514,7 +69523,7 @@ bvz gUj snV srk -pMU +wij wZZ htD wZZ @@ -69706,7 +69715,7 @@ bgO bht bzl cfg -ppA +aFC snV tnM srk @@ -73738,7 +73747,7 @@ awb agR agR aiM -bPZ +pMU bPZ bPZ bSv @@ -74254,7 +74263,7 @@ jLb jLb sKX jLb -jLb +bad aad aad aad @@ -78846,7 +78855,7 @@ cpg cpg cpg cpg -bgX +kvY piY piY cwD @@ -84455,7 +84464,7 @@ aad aad bHj bHj -vVK +bui bon bon bon @@ -86083,7 +86092,7 @@ sKg sKg sKg daq -daq +nPr daq daq sKg diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index f3074bd4d7d0..42e343e1b713 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -64391,17 +64391,24 @@ /area/almayer/engineering/upper_engineering/port) "rDe" = ( /obj/structure/surface/table/almayer, -/obj/item/reagent_container/food/snacks/kepler_crisps{ +/obj/structure/sign/safety/cryo{ pixel_x = 8; - pixel_y = 4 + pixel_y = 33 }, /obj/item/toy/deck{ pixel_x = -4; - pixel_y = 1 + pixel_y = 10 }, -/obj/structure/sign/safety/cryo{ - pixel_x = 8; - pixel_y = 33 +/obj/item/reagent_container/food/drinks/cans/souto/diet/cherry{ + pixel_x = 9; + pixel_y = 12 + }, +/obj/item/ashtray/plastic{ + pixel_y = -4 + }, +/obj/item/trash/cigbutt{ + pixel_x = 1; + pixel_y = 5 }, /turf/open/floor/almayer{ dir = 6; @@ -72487,15 +72494,9 @@ /area/almayer/hallways/stern_hallway) "uWI" = ( /obj/structure/surface/table/almayer, -/obj/item/ashtray/plastic, -/obj/item/trash/cigbutt{ - pixel_x = 1; +/obj/item/pizzabox/margherita{ pixel_y = 8 }, -/obj/item/reagent_container/food/drinks/cans/souto/diet/cherry{ - pixel_x = -9; - pixel_y = 12 - }, /turf/open/floor/almayer{ dir = 1; icon_state = "green" diff --git a/maps/map_files/generic/Admin_level.dmm b/maps/map_files/generic/Admin_level.dmm index 43b3d26ec3f9..d085d7a99b0c 100644 --- a/maps/map_files/generic/Admin_level.dmm +++ b/maps/map_files/generic/Admin_level.dmm @@ -12,7 +12,7 @@ /turf/open/floor/wood/ship, /area/adminlevel/ert_station) "ad" = ( -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -27,7 +27,7 @@ id = "tdome_observer"; name = "\improper Observer Shutters" }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -63,7 +63,7 @@ /obj/effect/decal/warning_stripes{ icon_state = "W" }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -72,7 +72,7 @@ /obj/effect/decal/warning_stripes{ icon_state = "E" }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -83,7 +83,7 @@ id = "tdome_t2"; name = "\improper Team 2 Shutters" }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ icon_state = "test_floor4" }, /area/tdome) @@ -101,7 +101,7 @@ /turf/open/space, /area/space) "aE" = ( -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 1; icon_state = "w-y0" }, @@ -683,7 +683,7 @@ /obj/item/device/binoculars{ pixel_y = 4 }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -896,7 +896,7 @@ }, /area/adminlevel/ert_station/shuttle_dispatch) "wj" = ( -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 1; icon_state = "w-y2" }, @@ -921,7 +921,7 @@ /area/adminlevel/ert_station) "wv" = ( /obj/structure/machinery/vending/snack, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -1147,7 +1147,7 @@ /obj/effect/decal/warning_stripes{ icon_state = "E" }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -1163,7 +1163,7 @@ /obj/structure/flora/pottedplant{ icon_state = "pottedplant_20" }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -1277,13 +1277,13 @@ /turf/open/floor/plating/almayer, /area/adminlevel/ert_station/shuttle_dispatch) "DV" = ( -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ icon_state = "tcomms" }, /area/tdome) "Ee" = ( /obj/effect/landmark/thunderdome/one, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -1375,7 +1375,7 @@ "Fw" = ( /obj/structure/surface/table/almayer, /obj/item/storage/fancy/cigar, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -1639,7 +1639,7 @@ /turf/closed/wall/mineral/gold, /area/adminlevel/ert_station) "Kq" = ( -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ icon_state = "redfull" }, /area/tdome/tdome2) @@ -1738,7 +1738,7 @@ /obj/structure/disposalpipe/trunk{ dir = 4 }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -1871,7 +1871,7 @@ /area/adminlevel/ert_station) "NU" = ( /obj/structure/machinery/vending/cola, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -1937,7 +1937,7 @@ /obj/effect/decal/warning_stripes{ icon_state = "W" }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -1967,13 +1967,13 @@ /area/adminlevel/simulation) "PF" = ( /obj/effect/landmark/thunderdome/two, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, /area/tdome/tdome2) "PJ" = ( -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 1; icon_state = "w-y1" }, @@ -2041,7 +2041,7 @@ /area/adminlevel/ert_station) "QL" = ( /obj/structure/bed/chair/comfy/black, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ icon_state = "tcomms" }, /area/tdome/tdomeobserve) @@ -2095,7 +2095,7 @@ id = "tdome_t1"; name = "\improper Team 1 Shutters" }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ icon_state = "test_floor4" }, /area/tdome) @@ -2165,7 +2165,7 @@ name = "Observer Shutters"; pixel_y = 9 }, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -2313,7 +2313,7 @@ /area/adminlevel/ert_station) "VD" = ( /obj/structure/machinery/vending/cigarette/free, -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -2483,7 +2483,7 @@ }, /area/adminlevel/ert_station) "YP" = ( -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ dir = 5; icon_state = "plating" }, @@ -2498,7 +2498,7 @@ /turf/open/floor/plating/plating_catwalk, /area/adminlevel/ert_station) "Zd" = ( -/turf/open/floor/almayer{ +/turf/open/floor/tdome{ icon_state = "bluefull" }, /area/tdome/tdome1) diff --git a/maps/shuttles/dropship_alamo.dmm b/maps/shuttles/dropship_alamo.dmm index 7c49edfdd0d2..6cd6922c22b0 100644 --- a/maps/shuttles/dropship_alamo.dmm +++ b/maps/shuttles/dropship_alamo.dmm @@ -217,8 +217,9 @@ }, /area/shuttle/drop1/sulaco) "rS" = ( -/obj/structure/machinery/door/airlock/dropship_hatch{ - id = "port_door" +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside/ds1{ + id = "port_door"; + dir = 2 }, /turf/open/shuttle/dropship{ icon_state = "rasputin15" @@ -481,8 +482,8 @@ }, /area/shuttle/drop1/sulaco) "Pf" = ( -/obj/structure/machinery/door/airlock/dropship_hatch{ - dir = 8; +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside/ds1{ + dir = 1; id = "starboard_door" }, /turf/open/shuttle/dropship{ @@ -675,7 +676,7 @@ hG Et iI JP -rS +il rS mW qn @@ -859,7 +860,7 @@ zS iv zV MP -Pf +il Pf nC nE diff --git a/maps/shuttles/dropship_normandy.dmm b/maps/shuttles/dropship_normandy.dmm index f1595cd97db9..a2847ae62611 100644 --- a/maps/shuttles/dropship_normandy.dmm +++ b/maps/shuttles/dropship_normandy.dmm @@ -350,8 +350,8 @@ /turf/template_noop, /area/shuttle/drop2/sulaco) "En" = ( -/obj/structure/machinery/door/airlock/dropship_hatch/two{ - dir = 8; +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside/ds2{ + dir = 1; id = "starboard_door" }, /turf/open/shuttle/dropship{ @@ -583,8 +583,9 @@ /turf/template_noop, /area/shuttle/drop2/sulaco) "SC" = ( -/obj/structure/machinery/door/airlock/dropship_hatch/two{ - id = "port_door" +/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/dropshipside/ds2{ + id = "port_door"; + dir = 2 }, /turf/open/shuttle/dropship{ icon_state = "rasputin15" @@ -708,7 +709,7 @@ eu OI GE lJ -SC +PJ SC jc pU @@ -892,7 +893,7 @@ wX fI fx Tp -En +PJ En gG RG diff --git a/tgui/packages/tgui-panel/settings/reducer.js b/tgui/packages/tgui-panel/settings/reducer.js index 42d799fd6597..0c93a5b94d4e 100644 --- a/tgui/packages/tgui-panel/settings/reducer.js +++ b/tgui/packages/tgui-panel/settings/reducer.js @@ -16,7 +16,7 @@ const initialState = { fontFamily: FONTS[0], lineHeight: 1.2, theme: 'light', - adminMusicVolume: 0.5, + adminMusicVolume: 0.2, // Keep these two state vars for compatibility with other servers highlightText: '', highlightColor: '#ffdd44', diff --git a/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx b/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx index bbb7fea96d2c..4c1c463e65dd 100644 --- a/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx +++ b/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx @@ -45,7 +45,7 @@ const DropshipDoorControl = (_, context) => { disabled={disable_door_controls} onClick={() => act('door-control', { - interaction: 'lock', + interaction: 'force-lock', location: 'all', }) } @@ -81,7 +81,7 @@ const DropshipDoorControl = (_, context) => {
    [tagger_locations[i]][GLOB.tagger_locations[i]]