diff --git a/code/controllers/subsystem/SSticker.dm b/code/controllers/subsystem/SSticker.dm index 3990499f419..6afc582df2b 100644 --- a/code/controllers/subsystem/SSticker.dm +++ b/code/controllers/subsystem/SSticker.dm @@ -660,10 +660,13 @@ SUBSYSTEM_DEF(ticker) log_game("///////////////////////////////////////////////////////") // Add AntagHUD to everyone, see who was really evil the whole time! - for(var/datum/atom_hud/antag/H in GLOB.huds) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/antag/antag_hud = hud + if(!istype(antag_hud)) + continue for(var/m in GLOB.player_list) var/mob/M = m - H.add_hud_to(M) + antag_hud.add_hud_to(M) var/static/list/base_encouragement_messages = list( "Keep on keeping on!", diff --git a/code/controllers/subsystem/processing/SSstation.dm b/code/controllers/subsystem/processing/SSstation.dm index 64a285813d3..a26322434d8 100644 --- a/code/controllers/subsystem/processing/SSstation.dm +++ b/code/controllers/subsystem/processing/SSstation.dm @@ -9,7 +9,7 @@ PROCESSING_SUBSYSTEM_DEF(station) /// A list of currently active station traits var/list/station_traits = list() /// Assoc list of trait type || assoc list of traits with weighted value. Used for picking traits from a specific category. - var/list/selectable_traits_by_types = list(STATION_TRAIT_POSITIVE = list(), STATION_TRAIT_NEUTRAL = list(), STATION_TRAIT_NEGATIVE = list()) + var/alist/selectable_traits_by_types = alist(STATION_TRAIT_POSITIVE = list(), STATION_TRAIT_NEUTRAL = list(), STATION_TRAIT_NEGATIVE = list()) /datum/controller/subsystem/processing/station/Initialize() SetupTraits() diff --git a/code/datums/atom_hud.dm b/code/datums/atom_hud.dm index 7830f3f2ae5..66da34e945a 100644 --- a/code/datums/atom_hud.dm +++ b/code/datums/atom_hud.dm @@ -2,7 +2,7 @@ GLOBAL_LIST_EMPTY(all_huds) ///GLOBAL HUD LIST -GLOBAL_LIST_INIT(huds, list( +GLOBAL_LIST_INIT(huds, alist( DATA_HUD_SECURITY_BASIC = new/datum/atom_hud/data/human/security/basic(), DATA_HUD_SECURITY_ADVANCED = new/datum/atom_hud/data/human/security/advanced(), DATA_HUD_MEDICAL_BASIC = new/datum/atom_hud/data/human/medical/basic(), diff --git a/code/datums/components/parry.dm b/code/datums/components/parry.dm index ecf652ec9d5..c22651ec020 100644 --- a/code/datums/components/parry.dm +++ b/code/datums/components/parry.dm @@ -52,7 +52,7 @@ else parryable_attack_types = list(_parryable_attack_types) - var/static/list/attack_types_english = list( + var/static/alist/attack_types_english = alist( MELEE_ATTACK = "melee attacks", UNARMED_ATTACK = "unarmed attacks", PROJECTILE_ATTACK = "projectiles", diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index e5d88f58d0c..5e2e0fb39da 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -7,10 +7,18 @@ /* DATA HUD DATUMS */ /atom/proc/add_to_all_human_data_huds() - for(var/datum/atom_hud/data/human/hud in GLOB.huds) hud.add_to_hud(src) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/human/chosen_hud = hud + if(!istype(chosen_hud)) + continue + chosen_hud.add_to_hud(src) /atom/proc/remove_from_all_data_huds() - for(var/datum/atom_hud/data/hud in GLOB.huds) hud.remove_from_hud(src) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/chosen_hud = hud + if(!istype(chosen_hud)) + continue + chosen_hud.remove_from_hud(src) /datum/atom_hud/data diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 87fda0e43e2..195b1b761ff 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -162,7 +162,10 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays) damage_deflection = AIRLOCK_DAMAGE_DEFLECTION_R update_icon() prepare_huds() - for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/diagnostic/diag_hud = hud + if(!istype(diag_hud)) + continue diag_hud.add_to_hud(src) diag_hud_set_electrified() @@ -202,7 +205,10 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays) if(electrified_timer) deltimer(electrified_timer) electrified_timer = null - for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/diagnostic/diag_hud = hud + if(!istype(diag_hud)) + continue diag_hud.remove_from_hud(src) return ..() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 36324869f8a..edf2eaf7ccd 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -15,7 +15,7 @@ armor = list(MELEE = 20, BULLET = 10, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 100, ACID = 75) bubble_icon = "machine" cares_about_temperature = TRUE - var/list/facing_modifiers = list(MECHA_FRONT_ARMOUR = 1.5, MECHA_SIDE_ARMOUR = 1, MECHA_BACK_ARMOUR = 0.5) + var/alist/facing_modifiers = alist(MECHA_FRONT_ARMOUR = 1.5, MECHA_SIDE_ARMOUR = 1, MECHA_BACK_ARMOUR = 0.5) var/initial_icon = null //Mech type for resetting icon. Only used for reskinning kits (see custom items) var/can_move = 0 // time of next allowed movement /// Time it takes to enter the mech @@ -146,7 +146,10 @@ log_message("[src] created.") GLOB.mechas_list += src //global mech list prepare_huds() - for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/diagnostic/diag_hud = hud + if(!istype(diag_hud)) + continue diag_hud.add_to_hud(src) diag_hud_set_mechhealth() diag_hud_set_mechcell() diff --git a/code/game/objects/effects/anomalous_particulate.dm b/code/game/objects/effects/anomalous_particulate.dm index 7af9976d6fa..9eeca1f0b45 100644 --- a/code/game/objects/effects/anomalous_particulate.dm +++ b/code/game/objects/effects/anomalous_particulate.dm @@ -417,7 +417,10 @@ . = ..() GLOB.anomaly_smash_track.smashes += src prepare_huds() - for(var/datum/atom_hud/data/anomalous/a_hud in GLOB.huds) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/anomalous/a_hud = hud + if(!istype(a_hud)) + continue a_hud.add_to_hud(src) do_hud_stuff() @@ -481,5 +484,3 @@ qdel(src) #undef NUM_ANOM_PER_OBJ - - diff --git a/code/modules/antagonists/_common/antag_hud.dm b/code/modules/antagonists/_common/antag_hud.dm index 0cb800aa38d..9a81c4ade44 100644 --- a/code/modules/antagonists/_common/antag_hud.dm +++ b/code/modules/antagonists/_common/antag_hud.dm @@ -47,13 +47,20 @@ newhud.join_hud(current) /datum/mind/proc/leave_all_huds() - for(var/datum/atom_hud/antag/hud in GLOB.huds) - if(current in hud.hudusers) - hud.leave_hud(current) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/antag/antag_hud = hud + if(!istype(antag_hud)) + continue + if(current in antag_hud.hudusers) + antag_hud.leave_hud(current) for(var/datum/atom_hud/data/hud in GLOB.huds) - if(current in hud.hudusers) - hud.remove_hud_from(current) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/data_hud = hud + if(!istype(data_hud)) + continue + if(current in data_hud.hudusers) + data_hud.remove_hud_from(current) ///Master Servent Datum Sytems,Based on TG Gang system// diff --git a/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm b/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm index aa9a5a77554..e634e819262 100644 --- a/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm +++ b/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm @@ -11,7 +11,7 @@ var/rep_per_completion = 2 /// Completing every contract at a given difficulty will always result in a sum of TC greater or equal than the difficulty's threshold. /// Structure: EXTRACTION_DIFFICULTY_(EASY|MEDIUM|HARD) => number - var/difficulty_tc_thresholds = list( + var/difficulty_tc_thresholds = alist( EXTRACTION_DIFFICULTY_EASY = 100, EXTRACTION_DIFFICULTY_MEDIUM = 150, EXTRACTION_DIFFICULTY_HARD = 200, diff --git a/code/modules/antagonists/traitor/contractor/datums/objective_contract.dm b/code/modules/antagonists/traitor/contractor/datums/objective_contract.dm index 321bb08271a..741c797cecc 100644 --- a/code/modules/antagonists/traitor/contractor/datums/objective_contract.dm +++ b/code/modules/antagonists/traitor/contractor/datums/objective_contract.dm @@ -14,7 +14,7 @@ /// An area's difficulty should be measured in how crowded it generally is, how out of the way it is and so on. /// Outdoor or invalid areas are filtered out. /// Structure: EXTRACTION_DIFFICULTY_(EASY|MEDIUM|HARD) => list() - var/static/list/possible_zone_names = list( + var/static/alist/possible_zone_names = alist( EXTRACTION_DIFFICULTY_EASY = list( // Rooms "Alternate Construction Area", diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index a81e022a6cd..2f5b539a6d3 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -708,11 +708,11 @@ GLOBAL_LIST_INIT(aalarm_modes, list( ) data["mode"] = mode data["presets"] = list( - AALARM_PRESET_HUMAN = list("name"="Human", "desc"="Checks for oxygen and nitrogen", "id" = AALARM_PRESET_HUMAN),\ - AALARM_PRESET_VOX = list("name"="Vox", "desc"="Checks for nitrogen only", "id" = AALARM_PRESET_VOX),\ - AALARM_PRESET_COLDROOM = list("name"="Coldroom", "desc"="For freezers", "id" = AALARM_PRESET_COLDROOM),\ - AALARM_PRESET_SERVER = list("name"="Server Room", "desc"="For server rooms", "id" = AALARM_PRESET_SERVER),\ - AALARM_PRESET_DISABLED = list("name"="Disabled", "desc"="Disables all alarms", "id" = AALARM_PRESET_DISABLED) + list("name"="Human", "desc"="Checks for oxygen and nitrogen", "id" = AALARM_PRESET_HUMAN),\ + list("name"="Vox", "desc"="Checks for nitrogen only", "id" = AALARM_PRESET_VOX),\ + list("name"="Coldroom", "desc"="For freezers", "id" = AALARM_PRESET_COLDROOM),\ + list("name"="Server Room", "desc"="For server rooms", "id" = AALARM_PRESET_SERVER),\ + list("name"="Disabled", "desc"="Disables all alarms", "id" = AALARM_PRESET_DISABLED) ) data["preset"] = preset diff --git a/code/modules/hallucinations/hallucinations.dm b/code/modules/hallucinations/hallucinations.dm index 290d4af9f65..a8551be17ea 100644 --- a/code/modules/hallucinations/hallucinations.dm +++ b/code/modules/hallucinations/hallucinations.dm @@ -1,4 +1,4 @@ -GLOBAL_LIST_INIT(hallucinations, list( +GLOBAL_LIST_INIT(hallucinations, alist( HALLUCINATE_MINOR = list( /obj/effect/hallucination/bolts = 10, /obj/effect/hallucination/fake_danger = 10, diff --git a/code/modules/mob/dead/observer/observer_base.dm b/code/modules/mob/dead/observer/observer_base.dm index e3e40840f12..c922ff671ab 100644 --- a/code/modules/mob/dead/observer/observer_base.dm +++ b/code/modules/mob/dead/observer/observer_base.dm @@ -421,8 +421,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp antagHUD = TRUE GLOB.antag_hud_users |= user.ckey - for(var/datum/atom_hud/antag/hud in GLOB.huds) - hud.add_hud_to(src) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/antag/chosen_hud = hud + if(!istype(chosen_hud)) + continue + chosen_hud.add_hud_to(src) /** * Toggles off all HUDs for the ghost player. @@ -433,8 +436,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp remove_the_hud(DATA_HUD_MEDICAL_ADVANCED) remove_the_hud(DATA_HUD_MALF_AI) antagHUD = FALSE - for(var/datum/atom_hud/antag/H in GLOB.huds) - H.remove_hud_from(src) + + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/antag/chosen_hud = hud + if(!istype(chosen_hud)) + continue + chosen_hud.remove_hud_from(src) /mob/dead/observer/proc/toggle_rad_view() ghost_flags ^= GHOST_SEE_RADS diff --git a/code/modules/mob/living/basic/mining/hivelord.dm b/code/modules/mob/living/basic/mining/hivelord.dm index 5ee94e9d814..38e0d6b96c4 100644 --- a/code/modules/mob/living/basic/mining/hivelord.dm +++ b/code/modules/mob/living/basic/mining/hivelord.dm @@ -396,7 +396,7 @@ if(prob(70)) backpack_contents += pick(/obj/item/stamp/clown, /obj/item/reagent_containers/spray/waterflower, /obj/item/food/grown/banana, /obj/item/megaphone) if(prob(30)) - backpack_contents += list(/obj/item/stack/sheet/mineral/bananium = pickweight(list(1 = 3, 2 = 2, 3 = 1))) + backpack_contents += list(/obj/item/stack/sheet/mineral/bananium = pickweight(alist(1 = 3, 2 = 2, 3 = 1))) if(prob(10)) l_pocket = pickweight(list(/obj/item/bikehorn/golden = 3, /obj/item/bikehorn/airhorn= 1 )) if(prob(10)) diff --git a/code/modules/mob/living/carbon/human/species/grey.dm b/code/modules/mob/living/carbon/human/species/grey.dm index c37d46a8277..50e62892e32 100644 --- a/code/modules/mob/living/carbon/human/species/grey.dm +++ b/code/modules/mob/living/carbon/human/species/grey.dm @@ -12,7 +12,7 @@ eyes = "grey_eyes_s" butt_sprite = "grey" - icon_skin_tones = list( + icon_skin_tones = alist( 1 = "Default Grey", 2 = "Grey Green", 3 = "Grey Blue", @@ -111,4 +111,3 @@ H.adjustFireLoss(1) return TRUE return ..() - diff --git a/code/modules/mob/living/carbon/human/species/human_species.dm b/code/modules/mob/living/carbon/human/species/human_species.dm index d953f6d3ff8..01536dcca01 100644 --- a/code/modules/mob/living/carbon/human/species/human_species.dm +++ b/code/modules/mob/living/carbon/human/species/human_species.dm @@ -15,7 +15,7 @@ making humans one of the most recognizable and socially diverse species in the sector." /// Organized to be from Light to Dark. - icon_skin_tones = list( + icon_skin_tones = alist( 1 = "Default White", 2 = "Pale", 3 = "Classic", @@ -63,6 +63,3 @@ new_icobase = 'icons/mob/human_races/human_skintones/r_human_pale.dmi' H.change_icobase(new_icobase, owner_sensitive) //Update the icobase of all our organs, but make sure we don't mess with frankenstein limbs in doing so. - - - diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index 016879fc49f..2e115fad0da 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -80,10 +80,13 @@ ..() var/datum/action/innate/change_monitor/monitor = new() monitor.Grant(H) - for(var/datum/atom_hud/data/human/medical/medhud in GLOB.huds) - medhud.remove_from_hud(H) - for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) - diag_hud.add_to_hud(H) + for(var/hud_key, hud in GLOB.huds) + if(istype(hud, /datum/atom_hud/data/diagnostic)) + var/datum/atom_hud/data/diagnostic/diag_hud = hud + diag_hud.add_to_hud(H) + else if(istype(hud, /datum/atom_hud/data/human/medical)) + var/datum/atom_hud/data/human/medical/med_hud = hud + med_hud.remove_from_hud(H) // i love snowflake code var/image/health_bar = H.hud_list[DIAG_HUD] @@ -98,10 +101,13 @@ ..() for(var/datum/action/innate/change_monitor/monitor in H.actions) monitor.Remove(H) - for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) - diag_hud.remove_from_hud(H) - for(var/datum/atom_hud/data/human/medical/medhud in GLOB.huds) - medhud.add_to_hud(H) + for(var/hud_key, hud in GLOB.huds) + if(istype(hud, /datum/atom_hud/data/diagnostic)) + var/datum/atom_hud/data/diagnostic/diag_hud = hud + diag_hud.remove_from_hud(H) + else if(istype(hud, /datum/atom_hud/data/human/medical)) + var/datum/atom_hud/data/human/medical/med_hud = hud + med_hud.add_hud_to(H) // i love snowflake code var/image/health_bar = H.hud_list[DIAG_HUD] diff --git a/code/modules/mob/living/carbon/human/species/moth.dm b/code/modules/mob/living/carbon/human/species/moth.dm index ffd4970d0e9..56a1507b1b2 100644 --- a/code/modules/mob/living/carbon/human/species/moth.dm +++ b/code/modules/mob/living/carbon/human/species/moth.dm @@ -32,7 +32,7 @@ Unlike most species in the galactic fold, Nian do not recognize the authority of the Trans-Solar Federation: \ having instead established close diplomatic relationships with their splinter faction, the USSP." - icon_skin_tones = list( + icon_skin_tones = alist( 1 = "Default Biege", 2 = "Lighter", 3 = "Darker", diff --git a/code/modules/mob/living/carbon/human/species/vox.dm b/code/modules/mob/living/carbon/human/species/vox.dm index 52e2d77d563..62dc398ec69 100644 --- a/code/modules/mob/living/carbon/human/species/vox.dm +++ b/code/modules/mob/living/carbon/human/species/vox.dm @@ -42,7 +42,7 @@ male_sneeze_sound = 'sound/voice/shrieksneeze.ogg' female_sneeze_sound = 'sound/voice/shrieksneeze.ogg' - icon_skin_tones = list( + icon_skin_tones = alist( 1 = "Default Lime", 2 = "Plum", 3 = "Brown", diff --git a/code/modules/mob/living/silicon/silicon_mob.dm b/code/modules/mob/living/silicon/silicon_mob.dm index 59f84c19958..d52ad84faa5 100644 --- a/code/modules/mob/living/silicon/silicon_mob.dm +++ b/code/modules/mob/living/silicon/silicon_mob.dm @@ -92,7 +92,10 @@ /mob/living/silicon/Initialize(mapload) . = ..() - for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/diagnostic/diag_hud = hud + if(!istype(diag_hud)) + continue diag_hud.add_to_hud(src) diag_hud_set_status() diag_hud_set_health() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index d55186cc14f..12fdc97d080 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -161,7 +161,10 @@ default_language = GLOB.all_languages["Galactic Common"] prepare_huds() - for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/data/diagnostic/diag_hud = hud + if(!istype(diag_hud)) + continue diag_hud.add_to_hud(src) permanent_huds |= diag_hud diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm b/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm index 73632893123..47357d0a897 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm @@ -108,7 +108,7 @@ // Color of our blade var/sword_color // Colors for our blade - var/list/static/colormap = list( + var/alist/static/colormap = alist( 1 = LIGHT_COLOR_GREEN, 2 = LIGHT_COLOR_RED, 3 = LIGHT_COLOR_LIGHTBLUE, diff --git a/code/modules/tgui/modules/ghost_hud_panel.dm b/code/modules/tgui/modules/ghost_hud_panel.dm index 8e4039904f2..dffcb1d1b46 100644 --- a/code/modules/tgui/modules/ghost_hud_panel.dm +++ b/code/modules/tgui/modules/ghost_hud_panel.dm @@ -84,14 +84,20 @@ GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new) add_verb(ghost, list(/mob/dead/observer/proc/do_observe, /mob/dead/observer/proc/observe)) ghost.antagHUD = TRUE - for(var/datum/atom_hud/antag/H in GLOB.huds) - H.add_hud_to(ghost) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/antag/chosen_hud = hud + if(!istype(chosen_hud)) + continue + chosen_hud.add_hud_to(ghost) var/datum/atom_hud/data/human/malf_ai/H = GLOB.huds[DATA_HUD_MALF_AI] H.add_hud_to(ghost) if("ahud_off") ghost.antagHUD = FALSE - for(var/datum/atom_hud/antag/H in GLOB.huds) - H.remove_hud_from(ghost) + for(var/hud_key, hud in GLOB.huds) + var/datum/atom_hud/antag/chosen_hud = hud + if(!istype(chosen_hud)) + continue + chosen_hud.remove_hud_from(ghost) var/datum/atom_hud/data/human/malf_ai/H = GLOB.huds[DATA_HUD_MALF_AI] H.remove_hud_from(ghost)