From 84dd7b8d27836209889ebfe0b0e2216982f04b74 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 1 Oct 2024 12:06:33 -0500 Subject: [PATCH 01/27] dynamic human icons --- code/__DEFINES/mobs.dm | 3 +++ code/modules/awaymissions/corpse.dm | 2 ++ .../simple_animal/hostile/human/frontiersman.dm | 5 ++++- .../mob/living/simple_animal/hostile/human/human.dm | 12 ++++++++++++ shiptest.dme | 1 + 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index f5c382c15c29..3546e2eadec1 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -442,3 +442,6 @@ //Saves a proc call, life is suffering. If who has no targets_from var, we assume it's just who #define GET_TARGETS_FROM(who) (who.targets_from ? who.get_targets_from() : who) + +/// In dynamic human icon gen we don't replace the held item. +#define NO_REPLACE 0 diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index 26361b99cfc6..3090c158a59f 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -174,6 +174,8 @@ var/facial_hairstyle var/skin_tone + var/list/outfit_override + /obj/effect/mob_spawn/human/Initialize() if(ispath(outfit)) outfit = new outfit() diff --git a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm index d8b4af5344ea..975eaf725340 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm @@ -13,6 +13,8 @@ atmos_requirements = list("min_oxy" = 5, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 1, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0) faction = list(FACTION_ANTAG_FRONTIERSMEN) footstep_type = FOOTSTEP_MOB_SHOE + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier + r_hand = /obj/item/kitchen/knife /mob/living/simple_animal/hostile/human/frontier/internals icon_state = "frontiersmanmelee_mask" @@ -23,7 +25,6 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 - /mob/living/simple_animal/hostile/human/frontier/ranged icon_state = "frontiersmanranged" icon_living = "frontiersmanranged" @@ -34,6 +35,8 @@ minimum_distance = 5 projectilesound = 'sound/weapons/gun/revolver/cattleman.ogg' casingtype = /obj/item/ammo_casing/a44roum + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged + r_hand = /obj/item/gun/ballistic/revolver' /mob/living/simple_animal/hostile/human/frontier/ranged/internals icon_state = "frontiersmanranged_mask" diff --git a/code/modules/mob/living/simple_animal/hostile/human/human.dm b/code/modules/mob/living/simple_animal/hostile/human/human.dm index 633bd40090e8..a745be3cb2ca 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/human.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/human.dm @@ -39,3 +39,15 @@ footstep_type = FOOTSTEP_MOB_SHOE faction = list("hermit") + + /// Path of the mob spawner we base the mob's visuals off of. + var/mob_spawner + /// Path of the right hand held item we give to the mob's visuals. + var/r_hand + /// Path of the left hand held item we give to the mob's visuals. + var/l_hand + +/mob/living/simple_animal/hostile/human/Initialize(mapload) + . = ..() + if(mob_spawner) + apply_dynamic_human_appearance(src, mob_spawn_path = mob_spawner, r_hand = r_hand, l_hand = l_hand) diff --git a/shiptest.dme b/shiptest.dme index 53b8c061b5fa..7bbebb835351 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -193,6 +193,7 @@ #include "code\__HELPERS\dates.dm" #include "code\__HELPERS\datums.dm" #include "code\__HELPERS\dna.dm" +#include "code\__HELPERS\dynamic_human_icon_gen.dm" #include "code\__HELPERS\files.dm" #include "code\__HELPERS\filters.dm" #include "code\__HELPERS\game.dm" From 71c6fa5114bac6db0dd0a36f3f2d2bf788a112a3 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 1 Oct 2024 12:06:46 -0500 Subject: [PATCH 02/27] the helper --- code/__HELPERS/dynamic_human_icon_gen.dm | 64 ++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 code/__HELPERS/dynamic_human_icon_gen.dm diff --git a/code/__HELPERS/dynamic_human_icon_gen.dm b/code/__HELPERS/dynamic_human_icon_gen.dm new file mode 100644 index 000000000000..d426af94a689 --- /dev/null +++ b/code/__HELPERS/dynamic_human_icon_gen.dm @@ -0,0 +1,64 @@ +///Global list of all dynamically generated icons, for caching, so we don't have to generate multiple times. +GLOBAL_LIST_EMPTY(dynamic_human_appearances) + +/// Creates a human with the given parameters and returns an appearance of it +/proc/get_dynamic_human_appearance(outfit_path, species_path = /datum/species/human, mob_spawn_path, r_hand, l_hand, bloody_slots = NONE, animated = TRUE) + if(!species_path) + return FALSE + if(!ispath(species_path)) + stack_trace("Attempted to call get_dynamic_human_appearance() with an instantiated species_path. Pass the species datum typepath instead.") + return FALSE + var/arg_string = "[outfit_path]_[species_path]_[mob_spawn_path]_[l_hand]_[r_hand]_[bloody_slots]" + if(GLOB.dynamic_human_appearances[arg_string]) //if already exists in our cache, just return that + return GLOB.dynamic_human_appearances[arg_string] + var/mob/living/carbon/human/dummy/consistent/dummy = new() + dummy.set_species(species_path) + dummy.stat = DEAD //this is to avoid side effects of mob spawners + dummy.underwear = "Nude" + dummy.undershirt = "Nude" + dummy.socks = "Nude" + if(outfit_path) + var/datum/outfit/outfit = new outfit_path() + if(r_hand != NO_REPLACE) //we can still override to be null, no replace means just use outfit's + outfit.r_hand = r_hand + if(l_hand != NO_REPLACE) + outfit.l_hand = l_hand + dummy.equipOutfit(outfit, visualsOnly = TRUE) + else if(mob_spawn_path) + var/obj/effect/mob_spawn/spawner = new mob_spawn_path(null) + spawner.outfit_override = list() + if(r_hand != NO_REPLACE) + spawner.outfit_override["r_hand"] = r_hand + if(l_hand != NO_REPLACE) + spawner.outfit_override["l_hand"] = l_hand + spawner.special(dummy, dummy) + spawner.equip(dummy) + for(var/obj/item/carried_item in dummy) + if(dummy.is_holding(carried_item)) + var/datum/component/two_handed/twohanded = carried_item.GetComponent(/datum/component/two_handed) + if(twohanded) + twohanded.wield(dummy) + /* + var/datum/component/transforming/transforming = carried_item.GetComponent(/datum/component/transforming) + if(transforming) + transforming.set_active(carried_item) + */ + if(bloody_slots & carried_item.slot_flags) + carried_item.add_mob_blood(dummy) + dummy.update_held_items() + var/mutable_appearance/output = dummy.appearance + GLOB.dynamic_human_appearances[arg_string] = output + qdel(dummy) + return output + +///This exists to apply the icons async, as that cannot be done in Initialize because of possible sleeps. +/proc/apply_dynamic_human_appearance(atom/target, outfit_path, species_path = /datum/species/human, mob_spawn_path, r_hand, l_hand, bloody_slots = NONE) + INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(set_dynamic_human_appearance), args) + +///This proc gets an argument of a target and runs +/proc/set_dynamic_human_appearance(list/arguments) + var/atom/target = arguments[1] //1st argument is the target + var/dynamic_appearance = get_dynamic_human_appearance(arglist(arguments.Copy(2))) //the rest of the arguments starting from 2 matter to the proc + target.icon = 'icons/blanks/32x32.dmi' + target.icon_state = "nothing" + target.copy_overlays(dynamic_appearance, cut_old = TRUE) From b2763d684eeb8e879c9855c05106f6a8f63dede1 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 1 Oct 2024 14:27:36 -0500 Subject: [PATCH 03/27] this is annoying --- code/__HELPERS/dynamic_human_icon_gen.dm | 12 +++++++----- .../simple_animal/hostile/human/frontiersman.dm | 4 ++-- .../mob/living/simple_animal/hostile/human/human.dm | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/code/__HELPERS/dynamic_human_icon_gen.dm b/code/__HELPERS/dynamic_human_icon_gen.dm index d426af94a689..6c857136b2fc 100644 --- a/code/__HELPERS/dynamic_human_icon_gen.dm +++ b/code/__HELPERS/dynamic_human_icon_gen.dm @@ -25,7 +25,7 @@ GLOBAL_LIST_EMPTY(dynamic_human_appearances) outfit.l_hand = l_hand dummy.equipOutfit(outfit, visualsOnly = TRUE) else if(mob_spawn_path) - var/obj/effect/mob_spawn/spawner = new mob_spawn_path(null) + var/obj/effect/mob_spawn/human/spawner = new mob_spawn_path(null) spawner.outfit_override = list() if(r_hand != NO_REPLACE) spawner.outfit_override["r_hand"] = r_hand @@ -45,7 +45,8 @@ GLOBAL_LIST_EMPTY(dynamic_human_appearances) */ if(bloody_slots & carried_item.slot_flags) carried_item.add_mob_blood(dummy) - dummy.update_held_items() + //dummy.update_held_items() + dummy.regenerate_icons() var/mutable_appearance/output = dummy.appearance GLOB.dynamic_human_appearances[arg_string] = output qdel(dummy) @@ -59,6 +60,7 @@ GLOBAL_LIST_EMPTY(dynamic_human_appearances) /proc/set_dynamic_human_appearance(list/arguments) var/atom/target = arguments[1] //1st argument is the target var/dynamic_appearance = get_dynamic_human_appearance(arglist(arguments.Copy(2))) //the rest of the arguments starting from 2 matter to the proc - target.icon = 'icons/blanks/32x32.dmi' - target.icon_state = "nothing" - target.copy_overlays(dynamic_appearance, cut_old = TRUE) + target.icon = 'icons/mob/human.dmi' + target.icon_state = "" + target.appearance_flags |= KEEP_TOGETHER + target.copy_overlays(dynamic_appearance) diff --git a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm index 975eaf725340..28b27dec4c69 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm @@ -14,7 +14,7 @@ faction = list(FACTION_ANTAG_FRONTIERSMEN) footstep_type = FOOTSTEP_MOB_SHOE mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier - r_hand = /obj/item/kitchen/knife + r_hand = /obj/item/melee/knife/kitchen /mob/living/simple_animal/hostile/human/frontier/internals icon_state = "frontiersmanmelee_mask" @@ -36,7 +36,7 @@ projectilesound = 'sound/weapons/gun/revolver/cattleman.ogg' casingtype = /obj/item/ammo_casing/a44roum mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged - r_hand = /obj/item/gun/ballistic/revolver' + r_hand = /obj/item/gun/ballistic/revolver /mob/living/simple_animal/hostile/human/frontier/ranged/internals icon_state = "frontiersmanranged_mask" diff --git a/code/modules/mob/living/simple_animal/hostile/human/human.dm b/code/modules/mob/living/simple_animal/hostile/human/human.dm index a745be3cb2ca..5b8d55b179a8 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/human.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/human.dm @@ -50,4 +50,4 @@ /mob/living/simple_animal/hostile/human/Initialize(mapload) . = ..() if(mob_spawner) - apply_dynamic_human_appearance(src, mob_spawn_path = mob_spawner, r_hand = r_hand, l_hand = l_hand) + apply_dynamic_human_appearance(src, /datum/outfit/frontier, mob_spawn_path = mob_spawner, r_hand = r_hand, l_hand = l_hand) From ffc02b55d110deac0aa506cf20b045f6b413a767 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 1 Oct 2024 15:04:40 -0500 Subject: [PATCH 04/27] ok this fixes it --- code/__HELPERS/dynamic_human_icon_gen.dm | 1 + code/modules/mob/living/simple_animal/hostile/human/human.dm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/dynamic_human_icon_gen.dm b/code/__HELPERS/dynamic_human_icon_gen.dm index 6c857136b2fc..e7e744cf94cf 100644 --- a/code/__HELPERS/dynamic_human_icon_gen.dm +++ b/code/__HELPERS/dynamic_human_icon_gen.dm @@ -47,6 +47,7 @@ GLOBAL_LIST_EMPTY(dynamic_human_appearances) carried_item.add_mob_blood(dummy) //dummy.update_held_items() dummy.regenerate_icons() + COMPILE_OVERLAYS(dummy) var/mutable_appearance/output = dummy.appearance GLOB.dynamic_human_appearances[arg_string] = output qdel(dummy) diff --git a/code/modules/mob/living/simple_animal/hostile/human/human.dm b/code/modules/mob/living/simple_animal/hostile/human/human.dm index 5b8d55b179a8..a745be3cb2ca 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/human.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/human.dm @@ -50,4 +50,4 @@ /mob/living/simple_animal/hostile/human/Initialize(mapload) . = ..() if(mob_spawner) - apply_dynamic_human_appearance(src, /datum/outfit/frontier, mob_spawn_path = mob_spawner, r_hand = r_hand, l_hand = l_hand) + apply_dynamic_human_appearance(src, mob_spawn_path = mob_spawner, r_hand = r_hand, l_hand = l_hand) From d52784edcd8b9f46fc70e49e8ec042e45f90843c Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 1 Oct 2024 15:30:08 -0500 Subject: [PATCH 05/27] gives him his eyes back. --- code/__HELPERS/dynamic_human_icon_gen.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__HELPERS/dynamic_human_icon_gen.dm b/code/__HELPERS/dynamic_human_icon_gen.dm index e7e744cf94cf..290df46b2872 100644 --- a/code/__HELPERS/dynamic_human_icon_gen.dm +++ b/code/__HELPERS/dynamic_human_icon_gen.dm @@ -13,7 +13,7 @@ GLOBAL_LIST_EMPTY(dynamic_human_appearances) return GLOB.dynamic_human_appearances[arg_string] var/mob/living/carbon/human/dummy/consistent/dummy = new() dummy.set_species(species_path) - dummy.stat = DEAD //this is to avoid side effects of mob spawners + dummy.stat = CONSCIOUS //He needs to be alive or he has no eyes. Scary dummy.underwear = "Nude" dummy.undershirt = "Nude" dummy.socks = "Nude" From 37f9915094173139b6c2932cb460242ecd9976b9 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 1 Oct 2024 15:39:09 -0500 Subject: [PATCH 06/27] cool! --- code/__HELPERS/dynamic_human_icon_gen.dm | 5 ++--- .../mob/living/simple_animal/hostile/human/frontiersman.dm | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/__HELPERS/dynamic_human_icon_gen.dm b/code/__HELPERS/dynamic_human_icon_gen.dm index 290df46b2872..beda93eaf0f0 100644 --- a/code/__HELPERS/dynamic_human_icon_gen.dm +++ b/code/__HELPERS/dynamic_human_icon_gen.dm @@ -26,11 +26,10 @@ GLOBAL_LIST_EMPTY(dynamic_human_appearances) dummy.equipOutfit(outfit, visualsOnly = TRUE) else if(mob_spawn_path) var/obj/effect/mob_spawn/human/spawner = new mob_spawn_path(null) - spawner.outfit_override = list() if(r_hand != NO_REPLACE) - spawner.outfit_override["r_hand"] = r_hand + spawner.r_hand = r_hand if(l_hand != NO_REPLACE) - spawner.outfit_override["l_hand"] = l_hand + spawner.l_hand = l_hand spawner.special(dummy, dummy) spawner.equip(dummy) for(var/obj/item/carried_item in dummy) diff --git a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm index 28b27dec4c69..a600225902ad 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm @@ -36,7 +36,7 @@ projectilesound = 'sound/weapons/gun/revolver/cattleman.ogg' casingtype = /obj/item/ammo_casing/a44roum mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged - r_hand = /obj/item/gun/ballistic/revolver + r_hand = /obj/item/gun/ballistic/revolver/shadow /mob/living/simple_animal/hostile/human/frontier/ranged/internals icon_state = "frontiersmanranged_mask" @@ -63,6 +63,7 @@ /obj/item/gun/ballistic/rifle/illestren) casingtype = /obj/item/ammo_casing/a8_50r projectilesound = 'sound/weapons/gun/rifle/mosin.ogg' + r_hand = /obj/item/gun/ballistic/rifle/illestren /mob/living/simple_animal/hostile/human/frontier/ranged/mosin/internals icon_state = "frontiersmanrangedrifle_mask" @@ -91,6 +92,8 @@ casingtype = /obj/item/ammo_casing/shotgun/buckshot loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, /obj/item/gun/ballistic/shotgun/brimstone) + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper + r_hand = /obj/item/gun/ballistic/shotgun/brimstone /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/internals icon_state = "frontiersmanrangedelite_mask" From 2e1783e2c4a6cad1c02d75c3dfd004a097f6bf08 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 1 Oct 2024 16:12:38 -0500 Subject: [PATCH 07/27] refactor the frointersmen just a little to not reuse alot of code --- .../mob/living/simple_animal/corpse.dm | 30 ++++ .../hostile/human/frontiersman.dm | 128 +++++------------- .../simple_animal/hostile/human/human.dm | 15 ++ 3 files changed, 76 insertions(+), 97 deletions(-) diff --git a/code/modules/mob/living/simple_animal/corpse.dm b/code/modules/mob/living/simple_animal/corpse.dm index 1b8004cbd5b5..58a09c5a67ec 100644 --- a/code/modules/mob/living/simple_animal/corpse.dm +++ b/code/modules/mob/living/simple_animal/corpse.dm @@ -123,6 +123,9 @@ hairstyle = "Bald" facial_hairstyle = "Shaved" +/obj/effect/mob_spawn/human/corpse/frontier/internals + outfit = /datum/outfit/frontier/internals + /datum/outfit/frontier name = "Frontiersman Corpse" uniform = /obj/item/clothing/under/frontiersmen @@ -130,12 +133,22 @@ head = /obj/item/clothing/head/beret/sec/frontier gloves = /obj/item/clothing/gloves/color/black +/datum/outfit/frontier/internals + mask = /obj/item/clothing/mask/gas/sechailer + l_pocket = /obj/item/tank/internals/emergency_oxygen/engi + /obj/effect/mob_spawn/human/corpse/frontier/ranged outfit = /datum/outfit/frontier +/obj/effect/mob_spawn/human/corpse/frontier/ranged/internals + outfit = /datum/outfit/frontier/internals + /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper outfit = /datum/outfit/frontier/trooper +/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/internals + outfit = /datum/outfit/frontier/trooper/internals + /datum/outfit/frontier/trooper name = "Frontiersman Armored Corpse" suit = /obj/item/clothing/suit/armor/vest/bulletproof/frontier @@ -144,6 +157,9 @@ ears = /obj/item/radio/headset head = /obj/item/clothing/head/helmet/bulletproof/x11/frontier +/datum/outfit/frontier/trooper/internals + mask = /obj/item/clothing/mask/gas/sechailer + l_pocket = /obj/item/tank/internals/emergency_oxygen/engi /obj/effect/mob_spawn/human/corpse/frontier/ranged/officer name = "Frontiersman Officer" @@ -157,6 +173,13 @@ ears = /obj/item/radio/headset head = /obj/item/clothing/head/frontier/peaked +/obj/effect/mob_spawn/human/corpse/frontier/ranged/officer/internals + outfit = /datum/outfit/frontier/officer/internals + +/datum/outfit/frontier/officer/internals + mask = /obj/item/clothing/mask/gas/sechailer + l_pocket = /obj/item/tank/internals/emergency_oxygen/engi + /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy outfit = /datum/outfit/frontier/trooper/heavy @@ -166,6 +189,13 @@ head = /obj/item/clothing/head/beret/sec/frontier/officer back = /obj/item/minigunpack +/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy/internals + outfit = /datum/outfit/frontier/trooper/heavy/internals + +/datum/outfit/frontier/trooper/heavy/internals + mask = /obj/item/clothing/mask/gas + l_pocket = /obj/item/tank/internals/emergency_oxygen/engi + /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy/gunless outfit = /datum/outfit/frontier/trooper/heavy/gunless diff --git a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm index a600225902ad..3394d1b41a16 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm @@ -3,33 +3,24 @@ desc = "A frontiersman! A terrorist that would probably kill everyone without mercy." icon_state = "frontiersmanmelee" icon = 'icons/mob/simple_frontiersman.dmi' - icon_living = "frontiersmanmelee" - icon_dead = "frontiersmanmelee_dead" speak_chance = 0 melee_damage_lower = 15 melee_damage_upper = 15 - loot = list(/obj/effect/mob_spawn/human/corpse/frontier, - /obj/item/melee/knife/survival) + loot = list() atmos_requirements = list("min_oxy" = 5, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 1, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0) faction = list(FACTION_ANTAG_FRONTIERSMEN) footstep_type = FOOTSTEP_MOB_SHOE mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier - r_hand = /obj/item/melee/knife/kitchen + r_hand = /obj/item/melee/knife/survival /mob/living/simple_animal/hostile/human/frontier/internals icon_state = "frontiersmanmelee_mask" - icon_living = "frontiersmanmelee_mask" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier, - /obj/item/clothing/mask/gas/sechailer, - /obj/item/tank/internals/emergency_oxygen/engi) atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/internals /mob/living/simple_animal/hostile/human/frontier/ranged icon_state = "frontiersmanranged" - icon_living = "frontiersmanranged" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged, - /obj/item/gun/ballistic/revolver/shadow) ranged = 1 retreat_distance = 5 minimum_distance = 5 @@ -40,137 +31,96 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/internals icon_state = "frontiersmanranged_mask" - icon_living = "frontiersmanranged_mask" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged, - /obj/item/gun/ballistic/revolver/shadow, - /obj/item/clothing/mask/gas/sechailer, - /obj/item/tank/internals/emergency_oxygen/engi) atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/internals /mob/living/simple_animal/hostile/human/frontier/ranged/internals/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged, - /obj/item/clothing/mask/gas/sechailer, - /obj/item/tank/internals/emergency_oxygen/engi) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/mosin icon_state = "frontiersmanrangedrifle" - icon_living = "frontiersmanrangedrifle" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged, - /obj/item/gun/ballistic/rifle/illestren) casingtype = /obj/item/ammo_casing/a8_50r projectilesound = 'sound/weapons/gun/rifle/mosin.ogg' r_hand = /obj/item/gun/ballistic/rifle/illestren /mob/living/simple_animal/hostile/human/frontier/ranged/mosin/internals icon_state = "frontiersmanrangedrifle_mask" - icon_living = "frontiersmanrangedrifle_mask" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged, - /obj/item/gun/ballistic/rifle/illestren, - /obj/item/clothing/mask/gas/sechailer, - /obj/item/tank/internals/emergency_oxygen/engi) atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/internals /mob/living/simple_animal/hostile/human/frontier/ranged/mosin/internals/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged, - /obj/item/clothing/mask/gas/sechailer, - /obj/item/tank/internals/emergency_oxygen/engi) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/mosin/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/trooper icon_state = "frontiersmanrangedelite" - icon_living = "frontiersmanrangedelite" maxHealth = 170 health = 170 projectilesound = 'sound/weapons/gun/shotgun/shot.ogg' casingtype = /obj/item/ammo_casing/shotgun/buckshot - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/gun/ballistic/shotgun/brimstone) mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper r_hand = /obj/item/gun/ballistic/shotgun/brimstone /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/internals icon_state = "frontiersmanrangedelite_mask" - icon_living = "frontiersmanrangedelite_mask" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/gun/ballistic/shotgun/brimstone, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/internals atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/internals/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/skm icon_state = "frontiersmanrangedak47" - icon_living = "frontiersmanrangedak47" projectilesound = 'sound/weapons/gun/rifle/skm.ogg' rapid = 4 rapid_fire_delay = 3 casingtype = /obj/item/ammo_casing/a762_40 - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/gun/ballistic/automatic/assault/skm) + r_hand = /obj/item/gun/ballistic/automatic/assault/skm -/mob/living/simple_animal/hostile/human/frontier/ranged/trooper/internals +/mob/living/simple_animal/hostile/human/frontier/ranged/trooper/skm/internals icon_state = "frontiersmanrangedak47_mask" - icon_living = "frontiersmanrangedak47_mask" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/gun/ballistic/automatic/assault/skm, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/internals + r_hand = /obj/item/gun/ballistic/automatic/assault/skm -/mob/living/simple_animal/hostile/human/frontier/ranged/trooper/internals/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) +/mob/living/simple_animal/hostile/human/frontier/ranged/trooper/skm/internals/neutered + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/skm/neutured - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/rifle icon_state = "frontiersmanrangedmosin" - icon_living = "frontiersmanrangedmosin" - - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/gun/ballistic/rifle/illestren) casingtype = /obj/item/ammo_casing/a8_50r projectilesound = 'sound/weapons/gun/rifle/mosin.ogg' + r_hand = /obj/item/gun/ballistic/rifle/illestren /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/rifle/internals icon_state = "frontiersmanrangedmosin_mask" - icon_living = "frontiersmanrangedmosin_mask" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/gun/ballistic/rifle/illestren, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/internals /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/rifle/internals/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/rifle/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/heavy icon_state = "frontiersmanrangedminigun" - icon_living = "frontiersmanrangedminigun" projectilesound = 'sound/weapons/laser4.ogg' maxHealth = 260 health = 260 @@ -178,52 +128,36 @@ rapid_fire_delay = 1.5 casingtype = null projectiletype = /obj/projectile/beam/weak/penetrator - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy) + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/heavy/internals icon_state = "frontiersmanrangedminigun_mask" - icon_living = "frontiersmanrangedminigun_mask" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 - - -/mob/living/simple_animal/hostile/human/frontier/ranged/trooper/heavy/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy/gunless, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy/internals /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/heavy/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy/gunless) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/officer name = "Frontiersman Officer" icon_state = "frontiersmanofficer" - icon_living = "frontiersmanofficer" maxHealth = 65 health = 65 rapid = 4 projectilesound = 'sound/weapons/gun/pistol/mauler.ogg' casingtype = /obj/item/ammo_casing/c9mm - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/officer, - /obj/item/gun/ballistic/automatic/pistol/mauler) + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/officer + r_hand = /obj/item/gun/ballistic/automatic/pistol/mauler /mob/living/simple_animal/hostile/human/frontier/ranged/officer/internals icon_state = "frontiersmanofficer_mask" - icon_living = "frontiersmanofficer_mask" - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/officer, - /obj/item/gun/ballistic/automatic/pistol/mauler, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 + mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/officer/internals /mob/living/simple_animal/hostile/human/frontier/ranged/officer/internals/neutered - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/officer, - /obj/item/clothing/mask/gas, - /obj/item/tank/internals/emergency_oxygen/engi) + neutered = TRUE /mob/living/simple_animal/hostile/human/frontier/ranged/officer/neutured - loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/officer) + neutered = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/human/human.dm b/code/modules/mob/living/simple_animal/hostile/human/human.dm index a745be3cb2ca..7b4eb6694633 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/human.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/human.dm @@ -40,14 +40,29 @@ faction = list("hermit") + /// If we use stuff from dynamic human icon generation for loot + var/human_loot = TRUE /// Path of the mob spawner we base the mob's visuals off of. var/mob_spawner /// Path of the right hand held item we give to the mob's visuals. var/r_hand /// Path of the left hand held item we give to the mob's visuals. var/l_hand + // If we drop l and r hand loot + var/neutered = FALSE /mob/living/simple_animal/hostile/human/Initialize(mapload) . = ..() if(mob_spawner) apply_dynamic_human_appearance(src, mob_spawn_path = mob_spawner, r_hand = r_hand, l_hand = l_hand) + +/mob/living/simple_animal/hostile/human/drop_loot() + . = ..() + if(!human_loot) + return + if(mob_spawner) + new mob_spawner(loc) + if(r_hand && !neutered) + new r_hand(loc) + if(l_hand && !neutered) + new r_hand(loc) From d116e0c625c82804f17aac56f6834409d059e3db Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 1 Oct 2024 16:46:23 -0500 Subject: [PATCH 08/27] fix unit tests --- code/modules/mob/living/simple_animal/corpse.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/mob/living/simple_animal/corpse.dm b/code/modules/mob/living/simple_animal/corpse.dm index 58a09c5a67ec..4f61874cd432 100644 --- a/code/modules/mob/living/simple_animal/corpse.dm +++ b/code/modules/mob/living/simple_animal/corpse.dm @@ -134,6 +134,7 @@ gloves = /obj/item/clothing/gloves/color/black /datum/outfit/frontier/internals + name = "Frontiersman Corpse Internals" mask = /obj/item/clothing/mask/gas/sechailer l_pocket = /obj/item/tank/internals/emergency_oxygen/engi @@ -158,6 +159,7 @@ head = /obj/item/clothing/head/helmet/bulletproof/x11/frontier /datum/outfit/frontier/trooper/internals + name = "Frontiersman Armored Corpse Internals" mask = /obj/item/clothing/mask/gas/sechailer l_pocket = /obj/item/tank/internals/emergency_oxygen/engi @@ -174,6 +176,7 @@ head = /obj/item/clothing/head/frontier/peaked /obj/effect/mob_spawn/human/corpse/frontier/ranged/officer/internals + name = "Frontiersman Officer Corpse Internals" outfit = /datum/outfit/frontier/officer/internals /datum/outfit/frontier/officer/internals @@ -193,6 +196,7 @@ outfit = /datum/outfit/frontier/trooper/heavy/internals /datum/outfit/frontier/trooper/heavy/internals + name = "Frontiersman Heavy Corpse Internals" mask = /obj/item/clothing/mask/gas l_pocket = /obj/item/tank/internals/emergency_oxygen/engi From 6e13b18e7ac80e576112785af05628d2a1bcf753 Mon Sep 17 00:00:00 2001 From: fallcon Date: Sun, 6 Oct 2024 14:58:01 -0500 Subject: [PATCH 09/27] fix tests? --- code/__HELPERS/dynamic_human_icon_gen.dm | 2 +- code/modules/mob/living/simple_animal/corpse.dm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/dynamic_human_icon_gen.dm b/code/__HELPERS/dynamic_human_icon_gen.dm index beda93eaf0f0..05743e15a71e 100644 --- a/code/__HELPERS/dynamic_human_icon_gen.dm +++ b/code/__HELPERS/dynamic_human_icon_gen.dm @@ -63,4 +63,4 @@ GLOBAL_LIST_EMPTY(dynamic_human_appearances) target.icon = 'icons/mob/human.dmi' target.icon_state = "" target.appearance_flags |= KEEP_TOGETHER - target.copy_overlays(dynamic_appearance) + target.copy_overlays(dynamic_appearance, TRUE) diff --git a/code/modules/mob/living/simple_animal/corpse.dm b/code/modules/mob/living/simple_animal/corpse.dm index 4f61874cd432..3b82fc5d1578 100644 --- a/code/modules/mob/living/simple_animal/corpse.dm +++ b/code/modules/mob/living/simple_animal/corpse.dm @@ -180,6 +180,7 @@ outfit = /datum/outfit/frontier/officer/internals /datum/outfit/frontier/officer/internals + name = "Frontiersman Officer Corpse Internals" mask = /obj/item/clothing/mask/gas/sechailer l_pocket = /obj/item/tank/internals/emergency_oxygen/engi From ace18d4f6f71bdc7acb6361f999d2be7d72282cb Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 6 Oct 2024 18:30:44 -0500 Subject: [PATCH 10/27] removes emmisives to test this --- code/game/atoms_movable.dm | 2 +- code/modules/mob/living/simple_animal/hostile/human/human.dm | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 79326ab9e2ad..38bb5a461e1a 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -143,7 +143,7 @@ if(vs.plane == EMISSIVE_BLOCKER_PLANE) SSvis_overlays.remove_vis_overlay(src, list(vs)) break - SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE, dir) + //SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE, dir) /atom/movable/proc/can_zFall(turf/source, levels = 1, turf/target, direction) if(!direction) diff --git a/code/modules/mob/living/simple_animal/hostile/human/human.dm b/code/modules/mob/living/simple_animal/hostile/human/human.dm index 7b4eb6694633..d234320dc060 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/human.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/human.dm @@ -34,7 +34,6 @@ unsuitable_atmos_damage = 15 minbodytemp = 180 status_flags = CANPUSH - del_on_death = TRUE footstep_type = FOOTSTEP_MOB_SHOE From 3312e7341411470229e40cc162e129b259715b28 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 6 Oct 2024 19:24:37 -0500 Subject: [PATCH 11/27] porting some prs to fix issues i hope https://github.com/tgstation/tgstation/pull/69696 https://github.com/tgstation/tgstation/pull/73965 --- code/__DEFINES/flags.dm | 4 +- code/__DEFINES/overlays.dm | 23 ++ code/__DEFINES/stat_tracking.dm | 6 +- code/__DEFINES/subsystems.dm | 25 -- code/__HELPERS/dynamic_human_icon_gen.dm | 1 - code/__HELPERS/icons.dm | 1 - code/_compile_options.dm | 4 - code/_globalvars/bitfields.dm | 1 - code/controllers/subsystem/overlays.dm | 311 ++++++++++-------- code/datums/holocall.dm | 1 - code/game/atoms.dm | 10 +- code/game/atoms_movable.dm | 2 +- code/game/objects/items/robot/robot_items.dm | 2 - code/modules/admin/verbs/mapping.dm | 1 - code/modules/admin/verbs/one_click_antag.dm | 1 - code/modules/autowiki/pages/ships.dm | 1 - .../mob/dead/new_player/preferences_setup.dm | 1 - shiptest.dme | 1 + 18 files changed, 200 insertions(+), 196 deletions(-) create mode 100644 code/__DEFINES/overlays.dm diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 77e608ac922e..b54d30bf32de 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -21,8 +21,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define CONDUCT_1 (1<<5) /// For machines and structures that should not break into parts, eg, holodeck stuff #define NODECONSTRUCT_1 (1<<7) -/// atom queued to SSoverlay -#define OVERLAY_QUEUED_1 (1<<8) +// NEED TO REMOVE THIS FULLY AND UPDATE THE NUMBERS +//#define OVERLAY_QUEUED_1 (1<<8) /// item has priority to check when entering or leaving #define ON_BORDER_1 (1<<9) //Whether or not this atom shows screentips when hovered over diff --git a/code/__DEFINES/overlays.dm b/code/__DEFINES/overlays.dm new file mode 100644 index 000000000000..ae452f4d8375 --- /dev/null +++ b/code/__DEFINES/overlays.dm @@ -0,0 +1,23 @@ +// A reasonable number of maximum overlays an object needs +// If you think you need more, rethink it +#define MAX_ATOM_OVERLAYS 100 + +/// Checks if an atom has reached the overlay limit, and make a loud error if it does. +#define VALIDATE_OVERLAY_LIMIT(changed_on) \ + if(length(changed_on.overlays) >= MAX_ATOM_OVERLAYS) { \ + var/text_lays = overlays2text(changed_on.overlays); \ + stack_trace("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\ + \n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]"); \ + changed_on.overlays.Cut(); \ + } \ + +/// Performs any operations that ought to run after an appearance change +#define POST_OVERLAY_CHANGE(changed_on) \ + if(alternate_appearances) { \ + for(var/I in changed_on.alternate_appearances){\ + var/datum/atom_hud/alternate_appearance/AA = changed_on.alternate_appearances[I];\ + if(AA.transfer_overlays){\ + AA.copy_overlays(changed_on, TRUE);\ + }\ + } \ + } diff --git a/code/__DEFINES/stat_tracking.dm b/code/__DEFINES/stat_tracking.dm index 69ea3c598bee..a7be42d4c4e2 100644 --- a/code/__DEFINES/stat_tracking.dm +++ b/code/__DEFINES/stat_tracking.dm @@ -8,10 +8,6 @@ #define STAT_LOG_ENTRY(entrylist, entryname) \ var/list/STAT_ENTRY = entrylist[entryname] || (entrylist[entryname] = new /list(STAT_ENTRY_LENGTH)); \ STAT_ENTRY[STAT_ENTRY_TIME] += STAT_TIME; \ - var/STAT_INCR_AMOUNT = min(1, 2**round((STAT_ENTRY[STAT_ENTRY_COUNT] || 0)/SHORT_REAL_LIMIT)); \ - if (STAT_INCR_AMOUNT == 1 || prob(100/STAT_INCR_AMOUNT)) { \ - STAT_ENTRY[STAT_ENTRY_COUNT] += STAT_INCR_AMOUNT; \ - }; \ - + STAT_ENTRY[STAT_ENTRY_COUNT] += 1; diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 54874bc9e16b..85c1150d7930 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -236,31 +236,6 @@ #define SSEXPLOSIONS_TURFS 2 #define SSEXPLOSIONS_THROWS 3 -//! ## Overlays subsystem - -///Compile all the overlays for an atom from the cache lists -// |= on overlays is not actually guaranteed to not add same appearances but we're optimistically using it anyway. -#define COMPILE_OVERLAYS(A) \ - do{ \ - var/list/ad = A.add_overlays; \ - var/list/rm = A.remove_overlays; \ - if(LAZYLEN(rm)){ \ - A.overlays -= rm; \ - rm.Cut(); \ - } \ - if(LAZYLEN(ad)){ \ - A.overlays |= ad; \ - ad.Cut(); \ - } \ - for(var/I in A.alternate_appearances){ \ - var/datum/atom_hud/alternate_appearance/AA = A.alternate_appearances[I]; \ - if(AA.transfer_overlays){ \ - AA.copy_overlays(A, TRUE); \ - } \ - } \ - A.flags_1 &= ~OVERLAY_QUEUED_1; \ - }while(FALSE) - // Vote subsystem counting methods /// First past the post. One selection per person, and the selection with the most votes wins. #define VOTE_COUNT_METHOD_SINGLE 1 diff --git a/code/__HELPERS/dynamic_human_icon_gen.dm b/code/__HELPERS/dynamic_human_icon_gen.dm index 05743e15a71e..c884e901d4fa 100644 --- a/code/__HELPERS/dynamic_human_icon_gen.dm +++ b/code/__HELPERS/dynamic_human_icon_gen.dm @@ -46,7 +46,6 @@ GLOBAL_LIST_EMPTY(dynamic_human_appearances) carried_item.add_mob_blood(dummy) //dummy.update_held_items() dummy.regenerate_icons() - COMPILE_OVERLAYS(dummy) var/mutable_appearance/output = dummy.appearance GLOB.dynamic_human_appearances[arg_string] = output qdel(dummy) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 38e540e996b9..6bd5a57100dd 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1091,7 +1091,6 @@ GLOBAL_LIST_EMPTY(friendly_animal_types) var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing") - COMPILE_OVERLAYS(body) for(var/D in showDirs) body.setDir(D) var/icon/partial = getFlatIcon(body, defdir=D) diff --git a/code/_compile_options.dm b/code/_compile_options.dm index ee7638ea853d..df29931d11ca 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -86,7 +86,3 @@ #define RUIN_PLACEMENT_TEST #define SHIP_PLACEMENT_TEST #endif - -// A reasonable number of maximum overlays an object needs -// If you think you need more, rethink it -#define MAX_ATOM_OVERLAYS 100 diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index d9957c7db0f1..1b6333653e79 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -100,7 +100,6 @@ DEFINE_BITFIELD(flags_1, list( "NO_LAVA_GEN_1" = NO_LAVA_GEN_1, "NO_RUINS_1" = NO_RUINS_1, "ON_BORDER_1" = ON_BORDER_1, - "OVERLAY_QUEUED_1" = OVERLAY_QUEUED_1, "PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1, "PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1, "RAD_NO_CONTAMINATE_1" = RAD_NO_CONTAMINATE_1, diff --git a/code/controllers/subsystem/overlays.dm b/code/controllers/subsystem/overlays.dm index 43cccd87abbd..41df60feee45 100644 --- a/code/controllers/subsystem/overlays.dm +++ b/code/controllers/subsystem/overlays.dm @@ -1,184 +1,106 @@ SUBSYSTEM_DEF(overlays) name = "Overlay" - flags = SS_TICKER - wait = 1 - priority = FIRE_PRIORITY_OVERLAYS - init_order = INIT_ORDER_OVERLAY - - var/list/queue + flags = SS_NO_FIRE|SS_NO_INIT var/list/stats - var/list/overlay_icon_state_caches - var/list/overlay_icon_cache /datum/controller/subsystem/overlays/PreInit() - overlay_icon_state_caches = list() - overlay_icon_cache = list() - queue = list() stats = list() -/datum/controller/subsystem/overlays/Initialize() - initialized = TRUE - fire(mc_check = FALSE) - return ..() - - -/datum/controller/subsystem/overlays/stat_entry(msg) - msg = "Ov:[length(queue)]" - return ..() - - /datum/controller/subsystem/overlays/Shutdown() text2file(render_stats(stats), "[GLOB.log_directory]/overlay.log") - /datum/controller/subsystem/overlays/Recover() - overlay_icon_state_caches = SSoverlays.overlay_icon_state_caches - overlay_icon_cache = SSoverlays.overlay_icon_cache - queue = SSoverlays.queue - - -/datum/controller/subsystem/overlays/fire(resumed = FALSE, mc_check = TRUE) - var/list/queue = src.queue - var/static/count = 0 - if (count) - var/c = count - count = 0 //so if we runtime on the Cut, we don't try again. - queue.Cut(1,c+1) - - for (var/thing in queue) - count++ - if(thing) - STAT_START_STOPWATCH - var/atom/A = thing - COMPILE_OVERLAYS(A) - STAT_STOP_STOPWATCH - STAT_LOG_ENTRY(stats, A.type) - if(mc_check) - if(MC_TICK_CHECK) - break - else - CHECK_TICK - - if (count) - queue.Cut(1,count+1) - count = 0 + stats = SSoverlays.stats + +/// Converts an overlay list into text for debug printing +/// Of note: overlays aren't actually mutable appearances, they're just appearances +/// Don't have access to that type tho, so this is the best you're gonna get +/proc/overlays2text(list/overlays) + var/list/unique_overlays = list() + // As anything because we're basically doing type coercion, rather then actually filtering for mutable appearances + for(var/mutable_appearance/overlay as anything in overlays) + var/key = "[overlay.icon]-[overlay.icon_state]-[overlay.dir]" + unique_overlays[key] += 1 + var/list/output_text = list() + for(var/key in unique_overlays) + output_text += "([key]) = [unique_overlays[key]]" + return output_text.Join("\n") /proc/iconstate2appearance(icon, iconstate) var/static/image/stringbro = new() - var/list/icon_states_cache = SSoverlays.overlay_icon_state_caches - var/list/cached_icon = icon_states_cache[icon] - if (cached_icon) - var/cached_appearance = cached_icon["[iconstate]"] - if (cached_appearance) - return cached_appearance stringbro.icon = icon stringbro.icon_state = iconstate - if (!cached_icon) //not using the macro to save an associated lookup - cached_icon = list() - icon_states_cache[icon] = cached_icon - var/cached_appearance = stringbro.appearance - cached_icon["[iconstate]"] = cached_appearance - return cached_appearance + return stringbro.appearance /proc/icon2appearance(icon) var/static/image/iconbro = new() - var/list/icon_cache = SSoverlays.overlay_icon_cache - . = icon_cache[icon] - if (!.) - iconbro.icon = icon - . = iconbro.appearance - icon_cache[icon] = . - -/atom/proc/build_appearance_list(old_overlays) - var/static/image/appearance_bro = new() - var/list/new_overlays = list() - if (!islist(old_overlays)) - old_overlays = list(old_overlays) - for (var/overlay in old_overlays) + iconbro.icon = icon + return iconbro.appearance + +/atom/proc/build_appearance_list(list/build_overlays) + if (!islist(build_overlays)) + build_overlays = list(build_overlays) + for (var/overlay in build_overlays) if(!overlay) + build_overlays -= overlay continue if (istext(overlay)) - new_overlays += iconstate2appearance(icon, overlay) + var/index = build_overlays.Find(overlay) + build_overlays[index] = iconstate2appearance(icon, overlay) else if(isicon(overlay)) - new_overlays += icon2appearance(overlay) - else - if(isloc(overlay)) - var/atom/A = overlay - if (A.flags_1 & OVERLAY_QUEUED_1) - COMPILE_OVERLAYS(A) - appearance_bro.appearance = overlay //this works for images and atoms too! - if(!ispath(overlay)) - var/image/I = overlay - appearance_bro.dir = I.dir - new_overlays += appearance_bro.appearance - return new_overlays - -#define NOT_QUEUED_ALREADY (!(flags_1 & OVERLAY_QUEUED_1)) -#define QUEUE_FOR_COMPILE flags_1 |= OVERLAY_QUEUED_1; SSoverlays.queue += src; -/atom/proc/cut_overlays() - LAZYINITLIST(remove_overlays) - LAZYINITLIST(add_overlays) - remove_overlays = overlays.Copy() - add_overlays.Cut() - - //If not already queued for work and there are overlays to remove - if(NOT_QUEUED_ALREADY && remove_overlays.len) - QUEUE_FOR_COMPILE + var/index = build_overlays.Find(overlay) + build_overlays[index] = icon2appearance(overlay) + return build_overlays -/mob/living/carbon/cut_overlays() - icon_render_keys = list() - return ..() +/atom/proc/cut_overlays() + STAT_START_STOPWATCH + overlays = null + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) -/atom/proc/cut_overlay(list/overlays) +/atom/proc/cut_overlay(list/remove_overlays) if(!overlays) return - overlays = build_appearance_list(overlays) - LAZYINITLIST(add_overlays) //always initialized after this point - LAZYINITLIST(remove_overlays) - var/a_len = add_overlays.len - var/r_len = remove_overlays.len - remove_overlays += overlays - add_overlays -= overlays - - var/fa_len = add_overlays.len - var/fr_len = remove_overlays.len - - //If not already queued and there is work to be done - if(NOT_QUEUED_ALREADY && (fa_len != a_len || fr_len != r_len)) - QUEUE_FOR_COMPILE - -/atom/proc/add_overlay(list/overlays) + STAT_START_STOPWATCH + overlays -= build_appearance_list(remove_overlays) + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) + +/atom/proc/add_overlay(list/add_overlays) if(!overlays) return - - overlays = build_appearance_list(overlays) - - LAZYINITLIST(add_overlays) //always initialized after this point - var/a_len = add_overlays.len - - add_overlays += overlays - var/fa_len = add_overlays.len - if(NOT_QUEUED_ALREADY && fa_len != a_len) - QUEUE_FOR_COMPILE - -/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom + STAT_START_STOPWATCH + overlays += build_appearance_list(add_overlays) + VALIDATE_OVERLAY_LIMIT(src) + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) + +/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom if(!other) if(cut_old) cut_overlays() return + STAT_START_STOPWATCH var/list/cached_other = other.overlays.Copy() - if(cached_other) - if(cut_old || !LAZYLEN(overlays)) - remove_overlays = overlays - add_overlays = cached_other - if(NOT_QUEUED_ALREADY) - QUEUE_FOR_COMPILE - else if(cut_old) - cut_overlays() - -#undef NOT_QUEUED_ALREADY -#undef QUEUE_FOR_COMPILE + if(cut_old) + if(cached_other) + overlays = cached_other + else + overlays = null + VALIDATE_OVERLAY_LIMIT(src) + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) + else if(cached_other) + overlays += cached_other + VALIDATE_OVERLAY_LIMIT(src) + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) //TODO: Better solution for these? /image/proc/add_overlay(x) @@ -204,3 +126,100 @@ SUBSYSTEM_DEF(overlays) overlays |= cached_other else if(cut_old) cut_overlays() + +// Debug procs + +/atom + /// List of overlay "keys" (info about the appearance) -> mutable versions of static appearances + /// Drawn from the overlays list + var/list/realized_overlays + /// List of underlay "keys" (info about the appearance) -> mutable versions of static appearances + /// Drawn from the underlays list + var/list/realized_underlays + +/image + /// List of overlay "keys" (info about the appearance) -> mutable versions of static appearances + /// Drawn from the overlays list + var/list/realized_overlays + /// List of underlay "keys" (info about the appearance) -> mutable versions of static appearances + /// Drawn from the underlays list + var/list/realized_underlays + +/// Takes the atoms's existing overlays and underlays, and makes them mutable so they can be properly vv'd in the realized_overlays/underlays list +/atom/proc/realize_overlays() + realized_overlays = realize_appearance_queue(overlays) + realized_underlays = realize_appearance_queue(underlays) + +/// Takes the image's existing overlays, and makes them mutable so they can be properly vv'd in the realized_overlays list +/image/proc/realize_overlays() + realized_overlays = realize_appearance_queue(overlays) + realized_underlays = realize_appearance_queue(underlays) + +/// Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected +/proc/realize_appearance_queue(list/appearances) + var/list/real_appearances = list() + var/list/queue = appearances.Copy() + var/queue_index = 0 + while(queue_index < length(queue)) + queue_index++ + // If it's not a command, we assert that it's an appearance + var/mutable_appearance/appearance = queue[queue_index] + if(!appearance) // Who fucking adds nulls to their sublists god you people are the worst + continue + + var/mutable_appearance/new_appearance = new /mutable_appearance() + new_appearance.appearance = appearance + var/key = "[appearance.icon]-[appearance.icon_state]-[appearance.plane]-[appearance.layer]-[appearance.dir]-[appearance.color]" + var/tmp_key = key + var/appearance_indx = 1 + while(real_appearances[tmp_key]) + tmp_key = "[key]-[appearance_indx]" + appearance_indx++ + + real_appearances[tmp_key] = new_appearance + var/add_index = queue_index + // Now check its children + for(var/mutable_appearance/child_appearance as anything in appearance.overlays) + add_index++ + queue.Insert(add_index, child_appearance) + for(var/mutable_appearance/child_appearance as anything in appearance.underlays) + add_index++ + queue.Insert(add_index, child_appearance) + return real_appearances + +/// Takes two appearances as args, prints out, logs, and returns a text representation of their differences +/// Including suboverlays +/proc/diff_appearances(mutable_appearance/first, mutable_appearance/second, iter = 0) + var/list/diffs = list() + var/list/firstdeet = first.vars + var/list/seconddeet = second.vars + var/diff_found = FALSE + for(var/name in first.vars) + var/firstv = firstdeet[name] + var/secondv = seconddeet[name] + if(firstv ~= secondv) + continue + if((islist(firstv) || islist(secondv)) && length(firstv) == 0 && length(secondv) == 0) + continue + if(name == "vars") // Go away + continue + if(name == "_listen_lookup") // This is just gonna happen with marked datums, don't care + continue + if(name == "overlays") + first.realize_overlays() + second.realize_overlays() + var/overlays_differ = FALSE + for(var/i in 1 to length(first.realized_overlays)) + if(diff_appearances(first.realized_overlays[i], second.realized_overlays[i], iter + 1)) + overlays_differ = TRUE + + if(!overlays_differ) + continue + + diff_found = TRUE + diffs += "Diffs detected at [name]: First ([firstv]), Second ([secondv])" + + var/text = "Depth of: [iter]\n\t[diffs.Join("\n\t")]" + message_admins(text) + log_world(text) + return diff_found diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index c5f907f9c31d..0212380e80b8 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -321,7 +321,6 @@ if(outfit_type) mannequin.equipOutfit(outfit_type,TRUE) mannequin.setDir(SOUTH) - COMPILE_OVERLAYS(mannequin) . = image(mannequin) unset_busy_human_dummy("HOLODISK_PRESET") diff --git a/code/game/atoms.dm b/code/game/atoms.dm index b96e8a53c824..038d6168b1ba 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -735,9 +735,13 @@ SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays) var/list/new_overlays = update_overlays() - if(managed_overlays) - cut_overlay(managed_overlays) - managed_overlays = null + if (managed_overlays) + if (length(overlays) == (islist(managed_overlays) ? length(managed_overlays) : 1)) + overlays = null + POST_OVERLAY_CHANGE(src) + else + cut_overlay(managed_overlays) + managed_overlays = null if(length(new_overlays)) managed_overlays = new_overlays add_overlay(new_overlays) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 38bb5a461e1a..79326ab9e2ad 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -143,7 +143,7 @@ if(vs.plane == EMISSIVE_BLOCKER_PLANE) SSvis_overlays.remove_vis_overlay(src, list(vs)) break - //SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE, dir) + SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE, dir) /atom/movable/proc/can_zFall(turf/source, levels = 1, turf/target, direction) if(!direction) diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 614b37ec4548..88417b3a38c4 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -856,7 +856,6 @@ . = ..() var/mutable_appearance/arm = mutable_appearance(icon = icon, icon_state = "borg_beaker_apparatus_arm") if(stored) - COMPILE_OVERLAYS(stored) stored.pixel_x = 0 stored.pixel_y = 0 var/mutable_appearance/stored_copy = new /mutable_appearance(stored) @@ -913,7 +912,6 @@ . = ..() var/mutable_appearance/arm = mutable_appearance(icon, "borg_hardware_apparatus_arm1") if(stored) - COMPILE_OVERLAYS(stored) stored.pixel_x = -3 stored.pixel_y = 0 if(!istype(stored, /obj/item/circuitboard)) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 8f1b69bc831d..19b74e54b60d 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -307,7 +307,6 @@ GLOBAL_VAR_INIT(say_disabled, FALSE) qdel(I) randomize_human(D) JB.equip(D, TRUE, FALSE) - COMPILE_OVERLAYS(D) var/icon/I = icon(getFlatIcon(D), frame = 1) final.Insert(I, JB.name) qdel(D) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index abdecf91de60..e1f4014e9084 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -251,7 +251,6 @@ equipAntagOnDummy(mannequin, ert) - COMPILE_OVERLAYS(mannequin) CHECK_TICK var/icon/preview_icon = icon('icons/effects/effects.dmi', "nothing") preview_icon.Scale(48+32, 16+32) diff --git a/code/modules/autowiki/pages/ships.dm b/code/modules/autowiki/pages/ships.dm index c59a321942b6..04f0cfa484c7 100644 --- a/code/modules/autowiki/pages/ships.dm +++ b/code/modules/autowiki/pages/ships.dm @@ -80,7 +80,6 @@ wiki_dummy.wipe_state() to_equip.equip(wiki_dummy, TRUE, FALSE) - COMPILE_OVERLAYS(wiki_dummy) var/icon/wiki_icon = icon(getFlatIcon(wiki_dummy), frame = 1) //Make all icons 32x32 for wiki sizing consistency diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index 71b66ac54fb4..86a2f792a839 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -64,6 +64,5 @@ if(selected_outfit && show_gear) selected_outfit.equip(mannequin, TRUE, preference_source = parent) - COMPILE_OVERLAYS(mannequin) parent.show_character_previews(new /mutable_appearance(mannequin)) unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES) diff --git a/shiptest.dme b/shiptest.dme index 7bbebb835351..e9060157bd4e 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -105,6 +105,7 @@ #include "code\__DEFINES\nanites.dm" #include "code\__DEFINES\networks.dm" #include "code\__DEFINES\obj_flags.dm" +#include "code\__DEFINES\overlays.dm" #include "code\__DEFINES\overmap.dm" #include "code\__DEFINES\paper.dm" #include "code\__DEFINES\particles.dm" From 3571925aea251a586bbe002f8727d028ec883255 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 6 Oct 2024 19:42:40 -0500 Subject: [PATCH 12/27] handling for decals in unit test --- code/game/objects/effects/decals/decal.dm | 6 ++++++ code/modules/unit_tests/create_and_destroy.dm | 3 +++ 2 files changed, 9 insertions(+) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 0d2282eeb873..b2b3376155ef 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -59,7 +59,13 @@ T.AddElement(/datum/element/decal, icon, detail_overlay, dir, FALSE, detail_color, null, null, alpha, appearance_flags) return INITIALIZE_HINT_QDEL + /obj/effect/turf_decal/Destroy(force) SHOULD_CALL_PARENT(FALSE) moveToNullspace() +#ifdef UNIT_TESTS + if(GLOB.running_create_and_destroy) + var/turf/T = loc + T.RemoveElement(/datum/element/decal, icon, icon_state, dir, null, null, alpha, color, null, FALSE, null) +#endif return QDEL_HINT_QUEUE diff --git a/code/modules/unit_tests/create_and_destroy.dm b/code/modules/unit_tests/create_and_destroy.dm index 9aee2ca10624..cabd27e3895e 100644 --- a/code/modules/unit_tests/create_and_destroy.dm +++ b/code/modules/unit_tests/create_and_destroy.dm @@ -3,6 +3,7 @@ //You absolutely must run last priority = TEST_DEL_WORLD +GLOBAL_VAR_INIT(running_create_and_destroy, FALSE) /datum/unit_test/create_and_destroy/Run() //We'll spawn everything here var/turf/spawn_at = run_loc_bottom_left @@ -114,6 +115,7 @@ var/original_baseturfs = islist(spawn_at.baseturfs) ? spawn_at.baseturfs.Copy() : spawn_at.baseturfs var/original_baseturf_count = length(original_baseturfs) + GLOB.running_create_and_destroy = TRUE for(var/type_path in typesof(/atom/movable, /turf) - ignore) //No areas please if(ispath(type_path, /turf)) spawn_at.ChangeTurf(type_path) @@ -213,6 +215,7 @@ if(fails & BAD_INIT_SLEPT) TEST_FAIL("[path] slept during Initialize()") + GLOB.running_create_and_destroy = FALSE SSticker.delay_end = FALSE //This shouldn't be needed, but let's be polite SSgarbage.collection_timeout[GC_QUEUE_CHECK] = GC_CHECK_QUEUE From b01244ec76f24fecb6e8880ddbe60580f2676250 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 6 Oct 2024 19:44:04 -0500 Subject: [PATCH 13/27] https://github.com/tgstation/tgstation/pull/71706 --- code/game/objects/effects/decals/decal.dm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index b2b3376155ef..d81e5abc28b0 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -59,13 +59,17 @@ T.AddElement(/datum/element/decal, icon, detail_overlay, dir, FALSE, detail_color, null, null, alpha, appearance_flags) return INITIALIZE_HINT_QDEL - /obj/effect/turf_decal/Destroy(force) SHOULD_CALL_PARENT(FALSE) - moveToNullspace() #ifdef UNIT_TESTS +// If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit +// I hate it too bestie if(GLOB.running_create_and_destroy) var/turf/T = loc - T.RemoveElement(/datum/element/decal, icon, icon_state, dir, null, null, alpha, color, null, FALSE, null) + T.RemoveElement(/datum/element/decal, icon, icon_state, dir, null, layer, alpha, color, null, FALSE, null) #endif + // Intentionally used over moveToNullspace(), which calls doMove(), which fires + // off an enormous amount of procs, signals, etc, that this temporary effect object + // never needs or affects. + loc = null return QDEL_HINT_QUEUE From 15704eb703e86ce9c7d35fa0c8e22fcd3f5909a0 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 6 Oct 2024 20:30:39 -0500 Subject: [PATCH 14/27] small fix --- code/_globalvars/misc.dm | 2 ++ code/modules/unit_tests/create_and_destroy.dm | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index d6c720380f46..cde6b820ad32 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -29,3 +29,5 @@ GLOBAL_LIST_EMPTY(poll_options) GLOBAL_PROTECT(poll_options) GLOBAL_VAR_INIT(internal_tick_usage, 0.2 * world.tick_lag) //This var is updated every tick by a DLL if present, used to reduce lag + +GLOBAL_VAR_INIT(running_create_and_destroy, FALSE) diff --git a/code/modules/unit_tests/create_and_destroy.dm b/code/modules/unit_tests/create_and_destroy.dm index cabd27e3895e..3c0e0124d00b 100644 --- a/code/modules/unit_tests/create_and_destroy.dm +++ b/code/modules/unit_tests/create_and_destroy.dm @@ -3,7 +3,6 @@ //You absolutely must run last priority = TEST_DEL_WORLD -GLOBAL_VAR_INIT(running_create_and_destroy, FALSE) /datum/unit_test/create_and_destroy/Run() //We'll spawn everything here var/turf/spawn_at = run_loc_bottom_left From 247f0a42cbf8c60a653913d407edfbfb36534c1e Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 6 Oct 2024 20:42:41 -0500 Subject: [PATCH 15/27] i think that define was not true so should acctually work now --- code/game/objects/effects/decals/decal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index d81e5abc28b0..a1818f16a787 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -61,7 +61,7 @@ /obj/effect/turf_decal/Destroy(force) SHOULD_CALL_PARENT(FALSE) -#ifdef UNIT_TESTS +#ifdef CREATE_AND_DESTROY_TEST // If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit // I hate it too bestie if(GLOB.running_create_and_destroy) From 278e78a2d439ec3de2f001544c56a0e6532592fb Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 6 Oct 2024 20:49:32 -0500 Subject: [PATCH 16/27] test --- code/game/objects/effects/decals/decal.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index a1818f16a787..d2b72271e9b7 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -61,13 +61,13 @@ /obj/effect/turf_decal/Destroy(force) SHOULD_CALL_PARENT(FALSE) -#ifdef CREATE_AND_DESTROY_TEST +//#ifdef CREATE_AND_DESTROY_TEST // If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit // I hate it too bestie if(GLOB.running_create_and_destroy) var/turf/T = loc T.RemoveElement(/datum/element/decal, icon, icon_state, dir, null, layer, alpha, color, null, FALSE, null) -#endif +//#endif // Intentionally used over moveToNullspace(), which calls doMove(), which fires // off an enormous amount of procs, signals, etc, that this temporary effect object // never needs or affects. From 4d9d42b24a3c9afaf7d78bf1ead76573bc48591a Mon Sep 17 00:00:00 2001 From: fallcon Date: Thu, 10 Oct 2024 04:13:43 -0500 Subject: [PATCH 17/27] warning --- code/__DEFINES/overlays.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/overlays.dm b/code/__DEFINES/overlays.dm index ae452f4d8375..583870d4926a 100644 --- a/code/__DEFINES/overlays.dm +++ b/code/__DEFINES/overlays.dm @@ -6,7 +6,7 @@ #define VALIDATE_OVERLAY_LIMIT(changed_on) \ if(length(changed_on.overlays) >= MAX_ATOM_OVERLAYS) { \ var/text_lays = overlays2text(changed_on.overlays); \ - stack_trace("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\ + WARNING("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\ \n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]"); \ changed_on.overlays.Cut(); \ } \ From b5d3aebce50d155f18fee5990827520c3614861b Mon Sep 17 00:00:00 2001 From: fallcon Date: Thu, 10 Oct 2024 04:15:39 -0500 Subject: [PATCH 18/27] these numbers were all inaccurate before i got here --- code/__DEFINES/flags.dm | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index b54d30bf32de..634287657e3c 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -21,33 +21,31 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define CONDUCT_1 (1<<5) /// For machines and structures that should not break into parts, eg, holodeck stuff #define NODECONSTRUCT_1 (1<<7) -// NEED TO REMOVE THIS FULLY AND UPDATE THE NUMBERS -//#define OVERLAY_QUEUED_1 (1<<8) /// item has priority to check when entering or leaving -#define ON_BORDER_1 (1<<9) +#define ON_BORDER_1 (1<<8) //Whether or not this atom shows screentips when hovered over -#define NO_SCREENTIPS_1 (1<<10) +#define NO_SCREENTIPS_1 (1<<9) /// Prevent clicking things below it on the same turf eg. doors/ fulltile windows -#define PREVENT_CLICK_UNDER_1 (1<<11) -#define HOLOGRAM_1 (1<<12) +#define PREVENT_CLICK_UNDER_1 (1<<10) +#define HOLOGRAM_1 (1<<11) /// Prevents mobs from getting chainshocked by teslas and the supermatter -#define SHOCKED_1 (1<<13) +#define SHOCKED_1 (1<<12) ///Whether /atom/Initialize() has already run for the object -#define INITIALIZED_1 (1<<14) +#define INITIALIZED_1 (1<<13) /// was this spawned by an admin? used for stat tracking stuff. -#define ADMIN_SPAWNED_1 (1<<15) +#define ADMIN_SPAWNED_1 (1<<14) /// should not get harmed if this gets caught by an explosion? -#define PREVENT_CONTENTS_EXPLOSION_1 (1<<16) +#define PREVENT_CONTENTS_EXPLOSION_1 (1<<15) /// should the contents of this atom be acted upon -#define RAD_PROTECT_CONTENTS_1 (1 << 17) +#define RAD_PROTECT_CONTENTS_1 (1 << 16) /// should this object be allowed to be contaminated -#define RAD_NO_CONTAMINATE_1 (1 << 18) +#define RAD_NO_CONTAMINATE_1 (1 << 17) ///Use when this shouldn't be obscured by large icons, like trees. -#define SHOW_BEHIND_LARGE_ICONS_1 (1<<12) +#define SHOW_BEHIND_LARGE_ICONS_1 (1<<18) /// Should we use the initial icon for display? Mostly used by overlay only objects -#define HTML_USE_INITAL_ICON_1 (1<<20) +#define HTML_USE_INITAL_ICON_1 (1<<19) // Whether or not this atom is storing contents for a disassociated storage object -#define HAS_DISASSOCIATED_STORAGE_1 (1<<24) +#define HAS_DISASSOCIATED_STORAGE_1 (1<<20) // Update flags for [/atom/proc/update_appearance] /// Update the atom's name From 70c09f6687f122389f1f77b4a750ab8145f7bcc1 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 18 Oct 2024 03:32:14 -0500 Subject: [PATCH 19/27] will this fix this? --- code/game/objects/effects/decals/decal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index d2b72271e9b7..6d2b5be5fb85 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -66,7 +66,7 @@ // I hate it too bestie if(GLOB.running_create_and_destroy) var/turf/T = loc - T.RemoveElement(/datum/element/decal, icon, icon_state, dir, null, layer, alpha, color, null, FALSE, null) + T.RemoveElement(/datum/element/decal, icon, icon_state, dir, layer, color, alpha) //#endif // Intentionally used over moveToNullspace(), which calls doMove(), which fires // off an enormous amount of procs, signals, etc, that this temporary effect object From d4775ecd55db7ac49b35d2c675b7329bd35c14d4 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 18 Oct 2024 04:26:11 -0500 Subject: [PATCH 20/27] Comment out validate overlay limit --- code/__DEFINES/overlays.dm | 4 ++++ code/game/objects/effects/decals/decal.dm | 8 +------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/code/__DEFINES/overlays.dm b/code/__DEFINES/overlays.dm index 583870d4926a..fae81afbd92d 100644 --- a/code/__DEFINES/overlays.dm +++ b/code/__DEFINES/overlays.dm @@ -1,3 +1,6 @@ +/* I do want this however this currently only fails on decals specificly in create and destroy. + Updating the overlays in genral was already pretty unatomic.area + I've added porting some updated decal code from tg to resolve this to my list. // A reasonable number of maximum overlays an object needs // If you think you need more, rethink it #define MAX_ATOM_OVERLAYS 100 @@ -10,6 +13,7 @@ \n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]"); \ changed_on.overlays.Cut(); \ } \ +*/ /// Performs any operations that ought to run after an appearance change #define POST_OVERLAY_CHANGE(changed_on) \ diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 6d2b5be5fb85..4dd7007f0892 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -61,13 +61,7 @@ /obj/effect/turf_decal/Destroy(force) SHOULD_CALL_PARENT(FALSE) -//#ifdef CREATE_AND_DESTROY_TEST -// If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit -// I hate it too bestie - if(GLOB.running_create_and_destroy) - var/turf/T = loc - T.RemoveElement(/datum/element/decal, icon, icon_state, dir, layer, color, alpha) -//#endif + // Intentionally used over moveToNullspace(), which calls doMove(), which fires // off an enormous amount of procs, signals, etc, that this temporary effect object // never needs or affects. From a7a26a6e7ba18628465cd739602184c4ee5074a1 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 18 Oct 2024 04:28:26 -0500 Subject: [PATCH 21/27] Acctually we can leave in the removal just dont error it. --- code/__DEFINES/overlays.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/overlays.dm b/code/__DEFINES/overlays.dm index fae81afbd92d..6457095141df 100644 --- a/code/__DEFINES/overlays.dm +++ b/code/__DEFINES/overlays.dm @@ -1,6 +1,10 @@ /* I do want this however this currently only fails on decals specificly in create and destroy. Updating the overlays in genral was already pretty unatomic.area I've added porting some updated decal code from tg to resolve this to my list. + WARNING("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\ + \n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]"); \ +*/ + // A reasonable number of maximum overlays an object needs // If you think you need more, rethink it #define MAX_ATOM_OVERLAYS 100 @@ -9,11 +13,8 @@ #define VALIDATE_OVERLAY_LIMIT(changed_on) \ if(length(changed_on.overlays) >= MAX_ATOM_OVERLAYS) { \ var/text_lays = overlays2text(changed_on.overlays); \ - WARNING("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\ - \n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]"); \ changed_on.overlays.Cut(); \ } \ -*/ /// Performs any operations that ought to run after an appearance change #define POST_OVERLAY_CHANGE(changed_on) \ From 44285ddedbfbda709935593e51df383815502b60 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 18 Oct 2024 04:43:46 -0500 Subject: [PATCH 22/27] bad indentation --- code/__DEFINES/overlays.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/overlays.dm b/code/__DEFINES/overlays.dm index 6457095141df..3a202a519b7b 100644 --- a/code/__DEFINES/overlays.dm +++ b/code/__DEFINES/overlays.dm @@ -1,7 +1,7 @@ /* I do want this however this currently only fails on decals specificly in create and destroy. - Updating the overlays in genral was already pretty unatomic.area - I've added porting some updated decal code from tg to resolve this to my list. - WARNING("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\ + Updating the overlays in genral was already pretty unatomic.area + I've added porting some updated decal code from tg to resolve this to my list. + WARNING("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\ \n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]"); \ */ From e1bb81027cd1eca09eeab3915e1bf947bf39b5c7 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sat, 28 Dec 2024 17:11:06 -0600 Subject: [PATCH 23/27] yea --- code/_compile_options.dm | 15 +++++++++++--- .../hostile/human/frontiersman.dm | 20 +++++++++---------- .../simple_animal/hostile/human/syndicate.dm | 2 +- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 688e53e2aa4e..d5f43d594be8 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -87,6 +87,15 @@ #define SHIP_PLACEMENT_TEST #endif -// A reasonable number of maximum overlays an object needs -// If you think you need more, rethink it -#define MAX_ATOM_OVERLAYS 100 +#if defined(OPENDREAM) + #if !defined(CIBUILDING) + #warn You are building with OpenDream. Remember to build TGUI manually. + #warn You can do this by running tgui-build.cmd from the bin directory. + #endif +#else + #if !defined(CBT) && !defined(SPACEMAN_DMM) + #warn Building with Dream Maker is no longer supported and will result in errors. + #warn In order to build, run BUILD.cmd in the root directory. + #warn Consider switching to VSCode editor instead, where you can press Ctrl+Shift+B to build. + #endif +#endif diff --git a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm index 6199ba89583e..dfe188803290 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm @@ -7,7 +7,7 @@ melee_damage_lower = 15 melee_damage_upper = 15 loot = list() - atmos_requirements = list("min_oxy" = 5, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 1, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = NORMAL_ATMOS_REQS faction = list(FACTION_ANTAG_FRONTIERSMEN) footstep_type = FOOTSTEP_MOB_SHOE mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier @@ -15,7 +15,7 @@ /mob/living/simple_animal/hostile/human/frontier/internals icon_state = "frontiersmanmelee_mask" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/internals @@ -33,7 +33,7 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/internals icon_state = "frontiersmanranged_mask" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/internals @@ -90,7 +90,7 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/mosin/internals icon_state = "frontiersmanrangedrifle_mask" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/internals @@ -114,7 +114,7 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/internals icon_state = "frontiersmanrangedelite_mask" mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/internals - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/internals/neutered @@ -130,7 +130,7 @@ icon_living = "frontiersmanflametrooper" loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/flame, /obj/item/flamethrower) - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 maxbodytemp = 1000 @@ -165,7 +165,7 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/skm/internals icon_state = "frontiersmanrangedak47_mask" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/internals r_hand = /obj/item/gun/ballistic/automatic/assault/skm @@ -186,7 +186,7 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/rifle/internals icon_state = "frontiersmanrangedmosin_mask" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/internals @@ -209,7 +209,7 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/heavy/internals icon_state = "frontiersmanrangedminigun_mask" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy/internals @@ -236,7 +236,7 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/officer/internals icon_state = "frontiersmanofficer_mask" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 mob_spawner = /obj/effect/mob_spawn/human/corpse/frontier/ranged/officer/internals diff --git a/code/modules/mob/living/simple_animal/hostile/human/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/human/syndicate.dm index 7e0f4a8b9c2c..05b9ea0a50ca 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/syndicate.dm @@ -13,7 +13,7 @@ speak_chance = 0 stat_attack = HARD_CRIT loot = list(/obj/effect/mob_spawn/human/corpse/syndicatesoldier, /obj/item/clothing/neck/dogtag/ramzi) - atmos_requirements = list("min_oxy" = 5, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 1, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0) + atmos_requirements = NORMAL_ATMOS_REQS maxbodytemp = 400 unsuitable_atmos_damage = 15 faction = list(FACTION_ANTAG_SYNDICATE) From cdc81a4820fdaf12b01a1b854cfe361b223feee4 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 29 Dec 2024 06:04:55 -0600 Subject: [PATCH 24/27] unsed var, updating decal init --- code/__DEFINES/overlays.dm | 1 - code/game/objects/effects/decals/decal.dm | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/overlays.dm b/code/__DEFINES/overlays.dm index 3a202a519b7b..b21bb5007672 100644 --- a/code/__DEFINES/overlays.dm +++ b/code/__DEFINES/overlays.dm @@ -12,7 +12,6 @@ /// Checks if an atom has reached the overlay limit, and make a loud error if it does. #define VALIDATE_OVERLAY_LIMIT(changed_on) \ if(length(changed_on.overlays) >= MAX_ATOM_OVERLAYS) { \ - var/text_lays = overlays2text(changed_on.overlays); \ changed_on.overlays.Cut(); \ } \ diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 4dd7007f0892..8d5486556c96 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -5,12 +5,15 @@ resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF var/turf_loc_check = TRUE -/obj/effect/decal/Initialize() +/obj/effect/decal/Initialize(mapload) . = ..() - if(turf_loc_check && (!isturf(loc) || NeverShouldHaveComeHere(loc))) + if(NeverShouldHaveComeHere(loc)) + if(mapload) + stack_trace("[name] spawned in a bad turf ([loc]) at [AREACOORD(src)] in \the [get_area(src)]. \ + Please remove it or allow it to pass NeverShouldHaveComeHere if it's intended.") return INITIALIZE_HINT_QDEL var/static/list/loc_connections = list( - COMSIG_TURF_CHANGED = PROC_REF(handle_turf_change), + COMSIG_TURF_CHANGE = PROC_REF(on_decal_move), ) AddElement(/datum/element/connect_loc, loc_connections) @@ -24,7 +27,7 @@ if(!(resistance_flags & FIRE_PROOF)) //non fire proof decal or being burned by lava qdel(src) -/obj/effect/decal/proc/handle_turf_change(turf/source, path, list/new_baseturfs, flags, list/post_change_callbacks) +/obj/effect/decal/proc/on_decal_move(turf/source, path, list/new_baseturfs, flags, list/post_change_callbacks) SIGNAL_HANDLER post_change_callbacks += CALLBACK(src, PROC_REF(sanity_check_self)) From 47d9a2ba5a1b6514364d848201ad9025d5a14568 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 29 Dec 2024 15:14:07 -0600 Subject: [PATCH 25/27] swaps this to a warn --- code/game/objects/effects/decals/decal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 8d5486556c96..34e22da3e9cd 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -9,7 +9,7 @@ . = ..() if(NeverShouldHaveComeHere(loc)) if(mapload) - stack_trace("[name] spawned in a bad turf ([loc]) at [AREACOORD(src)] in \the [get_area(src)]. \ + WARNING("[name] spawned in a bad turf ([loc]) at [AREACOORD(src)] in \the [get_area(src)]. \ Please remove it or allow it to pass NeverShouldHaveComeHere if it's intended.") return INITIALIZE_HINT_QDEL var/static/list/loc_connections = list( From 808e3c4e0487863c039c9e95f5040aca885dc55f Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 29 Dec 2024 15:21:59 -0600 Subject: [PATCH 26/27] fixes crash? --- code/game/objects/effects/decals/decal.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 34e22da3e9cd..41652d539940 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -65,6 +65,14 @@ /obj/effect/turf_decal/Destroy(force) SHOULD_CALL_PARENT(FALSE) + // If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit + // I hate it too bestie + if(GLOB.running_create_and_destroy) + var/turf/T = loc + T.RemoveElement(/datum/element/decal, icon, icon_state, dir, FALSE, color, null, null, alpha, FALSE) + if(detail_overlay) + T.RemoveElement(/datum/element/decal, icon, detail_overlay, dir, FALSE, detail_color, null, null, alpha, appearance_flags) + // Intentionally used over moveToNullspace(), which calls doMove(), which fires // off an enormous amount of procs, signals, etc, that this temporary effect object // never needs or affects. From 4fe3cfdcf0df204d49ed88c472edf181045d9002 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Mon, 6 Jan 2025 18:18:34 -0600 Subject: [PATCH 27/27] merge fix --- code/game/objects/effects/decals/decal.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 23938434cdcc..41652d539940 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -64,8 +64,8 @@ /obj/effect/turf_decal/Destroy(force) SHOULD_CALL_PARENT(FALSE) - - // If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit + + // If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit // I hate it too bestie if(GLOB.running_create_and_destroy) var/turf/T = loc