From fe2c797e638bb0d76c37b322275456da9c7e51e9 Mon Sep 17 00:00:00 2001 From: carys-the-weed-cloud <36204825+carys-the-weed-cloud@users.noreply.github.com> Date: Tue, 7 Jul 2026 18:53:10 -0400 Subject: [PATCH 1/6] refactor: Global variables should be delcared at start. --- objects/obj_star/Create_0.gml | 17 - scripts/__init/__init.gml | 27 + scripts/scr_PlanetData/scr_PlanetData.gml | 10 - .../scr_culture_visuals.gml | 1551 ----------------- 4 files changed, 27 insertions(+), 1578 deletions(-) diff --git a/objects/obj_star/Create_0.gml b/objects/obj_star/Create_0.gml index 85cc1d2c8b..10aa52538b 100644 --- a/objects/obj_star/Create_0.gml +++ b/objects/obj_star/Create_0.gml @@ -131,23 +131,6 @@ ai_c = -1; ai_d = -1; ai_e = -1; -global.star_name_colors = [ - c_gray, - c_white, //player - c_gray, //imperium - c_red, // toaster fuckers - CM_GREEN_COLOR, //nothing for inquisition - c_white, //ecclesiarchy - #FF8000, //Hi, I'm Elfo - #009500, // waagh - #FECB01, // the greater good - #AD5272, // bug boys - c_dkgray, // chaos - CM_GREEN_COLOR, //nothing for heretics either - #AD5272, //why 12 is skipped in general, we will never know - #80FF00 // Sleepy robots -]; - #region save/load serialization /// Called from save function to take all object variables and convert them to a json savable format and return it diff --git a/scripts/__init/__init.gml b/scripts/__init/__init.gml index ba0c460a8f..3c87509a80 100644 --- a/scripts/__init/__init.gml +++ b/scripts/__init/__init.gml @@ -173,4 +173,31 @@ function __init() { global.name_generator = new NameGenerator(); global.star_sprites = ds_map_create(); global.base_component_surface = -1; + + global.force_strength_descriptions = [ + "None", + "Minimal", + "Sparse", + "Moderate", + "Numerous", + "Very Numerous", + "Overwhelming", + ]; + + global.star_name_colors = [ + c_gray, + c_white, // Player + c_gray, // Imperium + c_red, // Mechanicus + CM_GREEN_COLOR, // Inquisition (Default) + c_white, // Ecclesiarchy + #FF8000, // Eldar + #009500, // Orks + #FECB01, // Tau + #AD5272, // Tyranids + c_dkgray, // Chaos + CM_GREEN_COLOR, // Heretics (Default) + #AD5272, // why 12 is skipped in general, we will never know + #80FF00 // Necrons + ]; } diff --git a/scripts/scr_PlanetData/scr_PlanetData.gml b/scripts/scr_PlanetData/scr_PlanetData.gml index 053569d7b4..d711546c6d 100644 --- a/scripts/scr_PlanetData/scr_PlanetData.gml +++ b/scripts/scr_PlanetData/scr_PlanetData.gml @@ -1,13 +1,3 @@ -global.force_strength_descriptions = [ - "none", - "Minimal", - "Sparse", - "Moderate", - "Numerous", - "Very Numerous", - "Overwhelming", -]; - /// @param {Real} _planet /// @param {Id.Instance.obj_star} _system function PlanetData(_planet, _system) constructor { diff --git a/scripts/scr_culture_visuals/scr_culture_visuals.gml b/scripts/scr_culture_visuals/scr_culture_visuals.gml index 465c41a459..df6de74fe3 100644 --- a/scripts/scr_culture_visuals/scr_culture_visuals.gml +++ b/scripts/scr_culture_visuals/scr_culture_visuals.gml @@ -336,1557 +336,6 @@ function set_up_visual_overides() { } } -global.modular_drawing_items = [ - { - sprite: spr_purity_seal, - body_types: [ - 0, - 2 - ], - position: "purity_seals", - }, - { - position: "crown", - body_types: [0], - max_saturation: 60, - exp: { - scale: true, - exp_scale_max: 200, - }, - sprite: spr_psy_hood_alpha2, - equipped: { - "gear": "Psychic Hood", - }, - cultures: ["Alpha"], - prevent_others: true, - }, - { - position: "crest", - body_types: [2], - sprite: spr_indomitus_complex_psy_hood, - equipped: { - "gear": "Psychic Hood", - }, - prevent_others: true, - subcomponents: [[spr_indomitus_complex_psy_hood_cables]], - overides: { - "crown": spr_indomitus_complex_psy_hood_crown, - }, - }, - { - position: "robe", - body_types: [0], - sprite: spr_binders_robe, - role_type: [SPECIALISTS_LIBRARIANS], - max_saturation: 10, - }, - { - position: "robe", - body_types: [0], - sprite: spr_binders_robe, - role_type: [SPECIALISTS_LIBRARIANS], - max_saturation: 40, - chapter_adv: [ - "Favoured By The Warp", - "Warp Touched" - ], - chapter_disadv: ["Warp Tainted"], - allow_either: [ - "chapter_adv", - "chapter_disadv" - ], - }, - { - position: "belt", - body_types: [0], - sprite: spr_binders_belt, - role_type: [SPECIALISTS_LIBRARIANS], - chapter_adv: [ - "Favoured By The Warp", - "Warp Touched" - ], - chapter_disadv: ["Warp Tainted"], - allow_either: [ - "chapter_adv", - "chapter_disadv" - ], - max_saturation: 50, - }, - { - position: "crown", - body_types: [0], - sprite: spr_psy_hood_complex, - equipped: { - "gear": "Psychic Hood", - }, - prevent_others: true, - subcomponents: [ - [ - spr_blank, - spr_psy_hood_components - ] - ], - }, - { - sprite: spr_da_mk5_helm_crests, - cultures: ["Knightly"], - body_types: [0], - armours: [ - "MK3 Iron Armour", - "MK4 Maximus", - "MK5 Heresy" - ], - position: "crest", - assign_by_rank: 2, - exp: { - min: 70, - }, - }, - { - sprite: spr_da_mk7_helm_crests, - cultures: ["Knightly"], - body_types: [0], - armours: [ - "MK7 Aquila", - "Power Armour", - "MK8 Errant", - "Artificer Armour" - ], - position: "crest", - assign_by_rank: 2, - }, - { - sprite: spr_terminator_laurel, - armours: [ - "Terminator Armour", - "Tartaros" - ], - roles: [ - eROLE.CAPTAIN, - eROLE.CHAMPION - ], - position: "crown", - body_types: [2], - }, - { - sprite: spr_laurel, - body_types: [0], - armours: [ - "Terminator Armour", - "Tartaros" - ], - roles: [ - eROLE.CAPTAIN, - eROLE.CHAMPION - ], - position: "crown", - }, - { - sprite: spr_special_helm, - body_types: [0], - armours_exclude: ["MK3 Iron Armour"], - roles: [ - eROLE.CAPTAIN, - eROLE.CHAMPION - ], - assign_by_rank: 2, - position: "mouth_variants", - }, - { - cultures: ["Mongol"], - sprite: spr_mongol_topknots, - body_types: [0], - position: "crest", - }, - { - cultures: [ - "Cthonian", - "Gothic" - ], - sprite: spr_chap_trim_right, - body_types: [0], - position: "right_trim", - max_saturation: 80, - exp: { - scale: true, - exp_scale_max: 300, - }, - flip: true, - }, - { - sprite: spr_chap_trim_right, - body_types: [0], - position: "right_trim", - role_type: [SPECIALISTS_CHAPLAINS], - flip: true, - }, - { - cultures: ["Mongol"], - sprite: spr_mongol_hat, - body_types: [0], - position: "crown", - }, - { - cultures: ["Prussian"], - sprite: spr_prussian_spike, - body_types: [0], - position: "crest", - }, - { - cultures: ["Mechanical Cult"], - assign_by_rank: 2, - sprite: spr_metal_tabbard, - shadows: spr_metal_tabbard_shadow, - role_type: [SPECIALISTS_TECHS], - body_types: [0], - position: "tabbard", - allow_either: [ - "cultures", - "role_type" - ], - }, - { - cultures: ["Knightly"], - sprite: spr_knightly_personal_livery, - body_types: [0], - assign_by_rank: 3, - position: "left_personal_livery", - }, - { - cultures: ["Gladiator"], - sprite: spr_gladiator_crest, - body_types: [0], - assign_by_rank: 2, - position: "crest", - }, - { - cultures: ["Mechanical Cult"], - assign_by_rank: 2, - sprite: spr_terminator_metal_tabbard, - role_type: [SPECIALISTS_TECHS], - body_types: [2], - position: "tabbard", - allow_either: [ - "cultures", - "role_type" - ], - }, - { - cultures: ["Flame Cult"], - sprite: spr_mk3_mouth_flame_cult, - body_types: [0], - position: "mouth_variants", - armours: ["MK3 Iron Armour"], - }, - { - cultures: ["Prussian"], - sprite: spr_mk3_mouth_prussian, - body_types: [0], - position: "mouth_variants", - armours: ["MK3 Iron Armour"], - }, - { - cultures: ["Prussian"], - sprite: spr_mk6_mouth_prussian, - body_types: [0], - position: "mouth_variants", - armours: ["MK3 Iron Armour"], - }, - { - cultures: ["Prussian"], - sprite: spr_mk7_prussia_chest, - body_types: [0], - position: "chest_variants", - }, - { - cultures: ["Prussian"], - sprite: spr_mk7_mouth_prussian, - body_types: [0], - position: "chest_variants", - armours: [ - "MK8 Errant", - "MK7 Aquila" - ], - }, - { - cultures: ["Mongol"], - sprite: spr_mk7_mongol_chest_variants, - body_types: [0], - position: "chest_variants", - armours: [ - "MK8 Errant", - "MK7 Aquila" - ], - }, - { - cultures: ["Gladiator"], - sprite: spr_mk7_gladiator_chest, - body_types: [0], - position: "chest_variants", - armours: [ - "MK8 Errant", - "MK7 Aquila" - ], - }, - { - cultures: ["Mongol"], - sprite: spr_mk4_mongol_chest_variants, - body_types: [0], - position: "chest_variants", - armours: ["MK4 Maximus"], - }, - { - cultures: ["Mongol"], - sprite: spr_mk6_mongol_chest_variants, - body_types: [0], - position: "chest_variants", - armours: ["MK6 Corvus"], - }, - { - cultures: ["Knightly"], - sprite: spr_knightly_robes, - body_types: [0], - position: "robe", - assign_by_rank: 4, - }, - { - cultures: ["Knightly"], - sprite: spr_da_backpack, - body_types: [0], - position: "backpack", - assign_by_rank: 3, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - }, - { - cultures: ["Alpha"], - sprite: spr_alpha_backpack, - body_types: [0], - position: "backpack", - assign_by_rank: 3, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - }, - { - chapter_adv: ["Reverent Guardians"], - sprite: spr_pack_brazier3, - traits: ["zealous_faith"], - body_types: [0], - allow_either: [ - "chapter_adv", - "traits", - "role_type" - ], - role_type: [SPECIALISTS_CHAPLAINS], - position: "backpack_decoration", - assign_by_rank: 4, - max_saturation: 40, - }, - { - sprite: spr_gear_librarian, - body_types: [0], - position: "right_pauldron_icons", - role_type: [SPECIALISTS_LIBRARIANS], - }, - { - sprite: spr_gear_librarian_term, - body_types: [2], - position: "right_pauldron_icons", - role_type: [SPECIALISTS_LIBRARIANS], - }, - { - sprite: spr_roman_centurian_crest, - shadows: spr_roman_centurian_crest_shadows, - body_types: [0], - cultures: [ - "Roman", - "Greek", - "Gladiator" - ], - position: "crest", - role_type: [SPECIALISTS_CAPTAIN_CANDIDATES], - assign_by_rank: 2, - }, - { - sprite: spr_marksmans_honor, - body_types: [ - 0, - 2 - ], - position: "purity_seals", - stats: [ - [ - "ballistic_skill", - 50, - "exmore" - ] - ], - }, - { - sprite: spr_crux_on_chain, - body_types: [ - 0, - 2 - ], - position: "purity_seals", - exp: { - min: 100, - }, - }, - { - cultures: ["Knightly"], - sprite: spr_mk6_knightly_mouth_variants, - body_types: [0], - position: "mouth_variants", - armours: ["MK6 Corvus"], - }, - { - cultures: ["Knightly"], - sprite: spr_mk6_forehead_knightly, - body_types: [0], - position: "forehead", - armours: ["MK6 Corvus"], - }, - { - cultures: ["Cthonian"], - sprite: spr_mk6_cthonian_heads, - body_types: [0], - position: "head", - armours: ["MK6 Corvus"], - }, - { - sprite: spr_mk7_complex_crux_belt, - body_types: [ - 0, - 2 - ], - position: "belt", - offsets: { - "Tartaros": { - x: 7, - }, - }, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour", - "Tartaros" - ], - exp: { - min: 100, - }, - }, - { - sprite: spr_crux_belt_fancy, - body_types: [ - 0, - 2 - ], - position: "belt", - offsets: { - "Tartaros": { - x: 7, - }, - }, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour", - "Tartaros" - ], - assign_by_rank: 3, - exp: { - min: 100, - }, - }, - { - cultures: [ - "Knightly", - "Crusader" - ], - sprite: spr_mk7_rope_belt, - body_types: [0], - position: "belt", - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour", - "MK4 Maximus" - ], - assign_by_rank: 2, - }, - { - cultures: [ - "Knightly", - "Crusader", - "Gladiator" - ], - sprite: spr_lion_belt, - body_types: [0], - position: "belt", - exp: { - min: 70, - }, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - assign_by_rank: 2, - }, - { - cultures: ["Knightly"], - sprite: spr_knightly_belt, - body_types: [0], - position: "belt", - exp: { - min: 50, - }, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - assign_by_rank: 3, - }, - { - sprite: spr_skulls_belt, - body_types: [0], - position: "belt", - role_type: [SPECIALISTS_CHAPLAINS], - cultures: ["Gothic"], - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - allow_either: [ - "cultures", - "role_type" - ], - }, - { - sprite: spr_tech_belt, - body_types: [0], - position: "belt", - role_type: [SPECIALISTS_TECHS], - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - }, - { - cultures: ["Feral"], - sprite: spr_teeth, - body_types: [ - 0, - 2 - ], - position: "purity_seals", - traits: [ - "tyrannic_vet", - "beast_slayer", - "feral" - ], - allow_either: [ - "cultures", - "traits" - ], - }, - { - cultures: ["Knightly"], - sprite: spr_mk7_knightly_chest, - body_types: [0], - position: "chest_variants", - armours: [ - "MK8 Errant", - "MK7 Aquila", - "Artificer Armour" - ], - }, - { - sprite: spr_ultra_belt, - cultures: ["Ultra"], - body_types: [ - 0, - 2 - ], - assign_by_rank: 3, - position: "belt", - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour", - "Tartaros" - ], - }, - { - cultures: [ - "Roman", - "Gladiator" - ], - sprite: spr_roman_tabbard, - body_types: [ - 0, - 2 - ], - position: "tabbard", - max_saturation: 50, - assign_by_rank: 3, - exp: { - min: 50, - }, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour", - "Tartaros", - "MK4 Maximus", - "MK3 Iron Armour" - ], - }, - { - cultures: ["Cthonian"], - sprite: spr_cthonian_tabbard, - body_types: [ - 0, - 2 - ], - position: "tabbard", - max_saturation: 50, - assign_by_rank: 3, - exp: { - min: 50, - }, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour", - "Tartaros", - "MK4 Maximus", - "MK3 Iron Armour" - ], - }, - { - cultures: [ - "Cthonian", - "Prussian" - ], - sprite: spr_chain_mail_tabbard, - body_types: [ - 0, - 2 - ], - position: "tabbard", - max_saturation: 50, - assign_by_rank: 3, - exp: { - min: 50, - }, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour", - "Tartaros", - "MK4 Maximus", - "MK3 Iron Armour" - ], - }, - { - cultures: ["Ultra"], - sprite: spr_ultra_tassels, - body_types: [ - 0, - 2 - ], - position: "purity_seals", - exp: { - min: 80, - }, - }, - { - cultures: [ - "Ultra", - "Roman" - ], - sprite: spr_ultra_backpack, - body_types: [0], - position: "backpack", - assign_by_rank: 2, - exp: { - min: 80, - }, - }, - { - cultures: [ - "Ultra", - "Roman" - ], - sprite: spr_roman_cloak, - body_types: [0], - position: "cloak", - max_saturation: 35, - overides: { - "right_pauldron_hangings": spr_ultra_right_shoulder_hanging, - }, - assign_by_rank: 2, - exp: { - min: 80, - }, - }, - { - cultures: ["Ultra"], - sprite: spr_mk7_chest_ultra, - body_types: [0], - position: "chest_variants", - armours: [ - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - }, - { - max_saturation: 50, - cultures: ["Knightly"], - sprite: spr_indomitus_knightly_robe, - body_types: [2], - position: "robe", - armours: ["Terminator Armour"], - }, - { - cultures: [ - "Feral", - "Gothic" - ], - sprite: spr_skull_on_chain, - body_types: [2], - position: "purity_seals", - }, - { - cultures: ["Knightly"], - sprite: spr_sword_pendant, - body_types: [ - 0, - 2 - ], - position: "purity_seals", - }, - { - sprite: spr_mk7_complex_belt, - body_types: [0], - position: "belt", - armours_exclude: ["MK3 Iron Armour"], - }, - { - sprite: spr_dev_pack_complex, - body_types: [0], - position: "backpack_augment", - equipped: { - "mobi": "Heavy Weapons Pack", - }, - overides: { - "chest_fastening": spr_backpack_fastening, - }, - }, - { - sprite: spr_jump_pack_complex, - body_types: [0], - position: "backpack_augment", - equipped: { - "mobi": "Jump Pack", - }, - overides: { - "chest_fastening": spr_backpack_fastening, - }, - }, - { - sprite: spr_cyclone_launcher, - body_types: [2], - position: "backpack_augment", - equipped: { - "mobi": "Cyclone Missile System", - }, - }, - { - sprite: spr_jump_pack_serpha_complex, - body_types: [0], - position: "backpack_augment", - equipped: { - "mobi": "Serpha Jump Pack", - }, - overides: { - "chest_fastening": spr_backpack_fastening, - }, - }, - { - sprite: spr_gear_hood2, - body_types: [0], - position: "mouth_variants", - role_type: [SPECIALISTS_LIBRARIANS], - chapter_disadv: ["Warp Tainted"], - }, - { - sprite: spr_mk4_chest_fastenings, - body_types: [0], - position: "chest_fastening", - armours: ["MK4 Maximus"], - }, - { - sprite: spr_mk7_complex_right_pauldron, - body_types: [0], - position: "right_pauldron_base", - shadows: spr_mk7_complex_right_pauldron_shadow, - flip: true, - }, - { - cultures: ["Cthonian"], - max_saturation: 30, - sprite: spr_right_pauldron_chainmail, - body_types: [0], - position: "right_pauldron_base", - flip: true, - }, - { - sprite: spr_bonding_studs_right, - body_types: [0], - position: "right_pauldron_embeleshments", - max_saturation: 15, - armours_exclude: [ - "MK5 Heresy", - "MK6 Corvus" - ], - flip: true, - }, - { - sprite: spr_bonding_studs_right, - body_types: [0], - position: "right_pauldron_embeleshments", - armours: [ - "MK5 Heresy", - "MK6 Corvus" - ], - flip: true, - }, - { - cultures: ["Cthonian"], - sprite: spr_pauldron_spikes_right, - body_types: [0], - position: "right_pauldron_embeleshments", - max_saturation: 30, - traits: [ - "blunt", - "cunning", - "brute" - ], - allow_either: [ - "cultures", - "traits" - ], - flip: true, - }, - { - cultures: ["Wolf Cult"], - sprite: spr_chaplain_wolfterm_helm, - body_types: [2], - position: "head", - prevent_others: true, - ban: ["mouth_variants"], - role_type: [SPECIALISTS_CHAPLAINS], - }, - { - cultures: ["Wolf Cult"], - sprite: spr_chaplain_wolf_helm, - body_types: [0], - position: "head", - prevent_others: true, - ban: ["mouth_variants"], - role_type: [SPECIALISTS_CHAPLAINS], - offsets: { - "Tartaros": { - y: -5, - }, - }, - }, - { - sprite: spr_chaplain_term_helm, - body_types: [2], - position: "head", - prevent_others: true, - ban: ["mouth_variants"], - role_type: [SPECIALISTS_CHAPLAINS], - offsets: { - "Tartaros": { - y: -5, - }, - }, - }, - { - sprite: spr_chaplain_helm, - body_types: [0], - position: "head", - prevent_others: true, - ban: ["mouth_variants"], - role_type: [SPECIALISTS_CHAPLAINS], - }, - { - cultures: [ - "Feral", - "Wolf Cult" - ], - sprite: spr_wolf_tail, - body_types: [ - 2, - 0 - ], - position: "purity_seals", - }, - { - cultures: [ - "Feral", - "Wolf Cult" - ], - sprite: spr_right_pauldron_fur_hanging, - body_types: [0], - position: "right_pauldron_hangings", - max_saturation: 20, - flip: true, - }, - { - cultures: [ - "Feral", - "Wolf Cult" - ], - sprite: spr_term_right_fur_hanging, - body_types: [2], - position: "right_pauldron_hangings", - max_saturation: 20, - flip: true, - }, - { - cultures: ["Wolf Cult"], - sprite: spr_fur_tail_topknot, - body_types: [0], - position: "crest", - max_saturation: 30, - }, - { - cultures: ["Runic"], - sprite: spr_runes_hanging, - body_types: [ - 0, - 2 - ], - position: "purity_seals", - }, - { - cultures: ["Wolf Cult"], - sprite: spr_mk7_wolf_cult_chest_variants, - body_types: [0], - position: "chest_variants", - armours: [ - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - }, - { - cultures: ["Wolf Cult"], - sprite: spr_mk7_wolf_cult_belt, - body_types: [0], - position: "belt", - armours_exclude: ["MK3 Iron Armour"], - }, - { - cultures: ["Runic"], - sprite: spr_mk7_runic_belt, - body_types: [0], - position: "belt", - armours_exclude: ["MK3 Iron Armour"], - }, - { - cultures: ["Wolf Cult"], - sprite: spr_fur_tabbard, - body_types: [ - 0, - 2 - ], - position: "tabbard", - max_saturation: 20, - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour", - "Tartaros", - "MK4 Maximus", - "MK3 Iron Armour" - ], - }, - { - cultures: ["Runic"], - sprite: spr_mk3_runic_chest, - body_types: [0], - position: "chest_variants", - armours: ["MK3 Iron Armour"], - }, - { - sprite: spr_mk3_chest, - body_types: [0], - position: "chest_variants", - armours: ["MK3 Iron Armour"], - }, - { - sprite: spr_death_watch_pauldron, - chapter: "Deathwatch", - position: "left_pauldron_base", - body_types: [0], - prevent_others: true, - }, - { - position: "bare_head", - sprite: spr_bare_heads_colourable, - }, - { - position: "bare_neck", - sprite: spr_bare_neck_colourable, - }, - { - position: "bare_eyes", - sprite: spr_bare_eyes, - }, - { - position: "gorget", - sprite: spr_mk8_gorget, - armours: ["MK8 Errant"], - body_types: [0], - shadows: spr_mk8_gorgot_shadows, - }, - { - position: "right_shin", - body_types: [0], - sprite: spr_right_shin_spikes, - traits: [ - "blunt", - "cunning", - "brute" - ], - allow_either: [ - "cultures", - "traits" - ], - cultures: ["Cthonian"], - max_saturation: 80, - exp: { - scale: true, - exp_scale_max: 300, - }, - flip: true, - }, - { - position: "right_knee", - body_types: [2], - sprite: spr_indomitus_right_knee_crux, - armours: ["Terminator Armour"], - max_saturation: 30, - flip: true, - }, - { - position: "right_eye", - sprite: spr_indomitus_right_eye_bionic, - body_types: [2], - body_parts: { - "right_eye": "bionic", - }, - flip: true, - }, - { - position: "right_leg", - sprite: spr_indomitus_right_leg_bionic, - body_types: [2], - body_parts: { - "right_leg": "bionic", - }, - prevent_others: true, - ban: [ - "right_knee", - "knees" - ], - flip: true, - }, - { - position: "right_leg", - sprite: spr_bionic_leg_right, - body_types: [0], - body_parts: { - "right_leg": "bionic", - }, - prevent_others: true, - ban: [ - "right_knee", - "knees" - ], - flip: true, - }, - { - position: "right_eye", - sprite: spr_bionic_right_eyes, - body_types: [0], - body_parts: { - "right_eye": "bionic", - }, - flip: true, - }, - { - position: "forehead", - sprite: spr_helm_decorations, - body_types: [ - 0, - 2 - ], - max_saturation: 50, - roles: [ - eROLE.SERGEANT, - eROLE.CHAMPION, - eROLE.VETERANSERGEANT - ], - offsets: { - "Terminator Armour": { - y: -10, - }, - }, - }, - { - position: "right_arm", - sprite: spr_cata_right_arm, - body_types: [2], - armours: ["Cataphractii"], - subcomponents: [ - [ - spr_blank, - spr_cata_right_armtrim - ] - ], - flip: true, - }, - { - position: "armour", - sprite: spr_cata_complex, - body_types: [2], - armours: ["Cataphractii"], - subcomponents: [[spr_cata_cowl_trim]], - }, - { - position: "tabbard", - sprite: spr_cata_tabbard_leather, - body_types: [2], - armours: ["Cataphractii"], - subcomponents: [ - [ - spr_blank, - spr_cata_tabbard_leather_hangings - ] - ], - }, - { - position: "tabbard", - sprite: spr_cata_tabbard_mail, - body_types: [2], - armours: ["Cataphractii"], - }, - { - position: "right_knee", - sprite: spr_cata_right_knee, - body_types: [2], - armours: ["Cataphractii"], - max_saturation: 50, - flip: true, - }, - { - position: "right_leg", - sprite: spr_cata_right_leg, - body_types: [2], - armours: ["Cataphractii"], - subcomponents: [ - [ - spr_blank, - spr_cata_heavy_toe_right - ] - ], - flip: true, - }, - { - position: "right_pauldron_embeleshments", - sprite: spr_cata_shoulder_hanging_leather_right, - body_types: [2], - armours: ["Cataphractii"], - subcomponents: [ - [ - spr_blank, - spr_cata_shoulder_hanging_leather_right_tips - ] - ], - overides: { - "left_pauldron_embeleshments": spr_cata_shoulder_hanging_leather_left, - "tabbard": spr_cata_tabbard_leather, - }, - subcomponents: [ - [ - spr_blank, - spr_cata_shoulder_hanging_leather_right_tips - ] - ], - flip: true, - }, - { - position: "right_pauldron_embeleshments", - sprite: spr_cata_shoulder_hanging_mail_right, - body_types: [2], - armours: ["Cataphractii"], - overides: { - "left_pauldron_embeleshments": spr_cata_shoulder_hanging_mail_left, - "tabbard": spr_cata_tabbard_mail, - }, - flip: true, - }, - { - sprite: spr_blank, - body_types: [2], - position: "right_trim", - armours: ["Cataphractii"], - subcomponents: [ - [ - spr_blank, - spr_cata_right_trim - ], - [ - spr_blank, - spr_cata_right_trim_2 - ], - [ - spr_blank, - spr_cata_right_trim_1 - ] - ], - flip: true, - }, - { - position: "foreground_item", - sprite: spr_gear_combat_shield, - body_types: [ - 0, - 1, - 2 - ], - offsets: { - "Terminator Armour": { - y: -10, - x: -15, - }, - "Tartaros": { - x: -8, - }, - }, - subcomponents: [ - [ - spr_blank, - spr_combat_shield_bottom_part - ] - ], - equipped: { - "gear": "Combat Shield", - }, - }, - { - position: "right_eye", - sprite: spr_gear_apoth_eye, - role_type: [SPECIALISTS_APOTHECARIES], - offsets: { - "Terminator Armour": { - y: -6, - }, - "Tartaros": { - y: -6, - }, - }, - }, - { - position: "backpack_decoration", - sprite: spr_gear_apoth, - role_type: [SPECIALISTS_APOTHECARIES], - offsets: { - "Terminator Armour": { - y: -22, - }, - "Tartaros": { - y: -30, - }, - }, - }, - { - position: "backpack_decoration", - sprite: spr_angelic_wings, - body_types: [ - 0, - 1 - ], - cultures: ["Angelic"], - assign_by_rank: 2, - equipment_has_tag: { - "gear": "jump", - }, - }, - { - position: "leg_variants", - sprite: spr_mk7_leg_variants, - body_types: [0], - shadows: spr_mk7_leg_variants_shadows, - armours: [ - "MK7 Aquila", - "Artificer Armour", - "MK8 Errant" - ], - max_saturation: 30, - }, - { - position: "backpack", - sprite: spr_mk7_complex_backpack, - body_types: [0], - shadows: spr_mk7_complex_backpack_shadow, - armours: [ - "MK7 Aquila", - "Artificer Armour", - "MK8 Errant" - ], - }, - { - position: "right_leg", - sprite: spr_techmarine_right_leg, - body_types: [0], - armours: [ - "MK5 Heresy", - "MK6 Corvus", - "MK7 Aquila", - "MK8 Errant", - "Artificer Armour" - ], - traits: [ - "tinkerer", - "flesh_is_weak" - ], - role_type: [SPECIALISTS_TECHS], - shadows: spr_techmarine_right_leg_shadow, - allow_either: [ - "traits", - "role_type" - ], - max_saturation: 50, - flip: true, - }, - { - position: "chest_variants", - body_types: [0], - sprite: spr_techmarine_chest, - max_saturation: 50, - traits: [ - "tinkerer", - "flesh_is_weak" - ], - role_type: [SPECIALISTS_TECHS], - allow_either: [ - "traits", - "role_type" - ], - }, - // "head": spr_techmarine_head, - { - position: "right_arm", - armours: [ - "MK3 Iron Armour", - "Artificer Armour", - "MK5 Heresy" - ], - sprite: spr_mk3_right_arm, - body_types: [0], - flip: true, - shadows: spr_mk3_right_arm_shadow, - }, - { - position: "right_arm", - armours: [ - "MK5 Heresy", - "Artificer Armour" - ], - sprite: spr_mk5_right_arm, - body_types: [0], - flip: true, - shadows: spr_mk5_right_arm_shadow, - }, - { - position: "right_arm", - armours: [ - "MK4 Maximus", - "Artificer Armour" - ], - sprite: spr_mk4_right_arm, - shadows: spr_mk4_right_arm_shadow, - body_types: [0], - flip: true, - }, - { - position: "right_arm", - armours: [ - "MK7 Aquila", - "Artificer Armour", - "MK6 Corvus", - "MK8 Errant" - ], - sprite: spr_mk7_right_arm, - shadows: spr_mk7_right_arm_shadow, - body_types: [0], - flip: true, - }, - //Indomitus Sprites - { - position: "armour", - armours: ["Terminator Armour"], - sprite: spr_indomitus_complex, - shadows: spr_indomitus_complex_shadows, - body_types: [2], - }, - { - position: "head", - armours: ["Terminator Armour"], - sprite: spr_indomitus_head_variants, - shadows: spr_indomitus_head_variants_shadows, - body_types: [2], - }, - { - position: "right_arm", - armours: ["Terminator Armour"], - sprite: spr_indomitus_right_arm, - shadows: spr_indomitus_right_arm_shadows, - body_types: [2], - flip: true, - }, - { - position: "right_leg", - armours: ["Terminator Armour"], - sprite: spr_indomitus_leg_variants, - shadows: spr_indomitus_leg_variants_shadows, - body_types: [2], - }, - { - position: "right_shin", - body_types: [2], - sprite: spr_indomitus_right_shin, - armours: ["Terminator Armour"], - shadows: spr_indomitus_right_shin_shadows, - flip: true, - }, - //Tartaros Sprites - { - position: "armour", - armours: ["Tartaros"], - sprite: spr_tartaros_complex, - shadows: spr_tartaros_shadows, - body_types: [2], - }, - { - position: "right_arm", - armours: ["Tartaros"], - sprite: spr_tartaros_right_arm, - shadows: spr_tartaros_right_arm_shadows, - body_types: [2], - flip: true, - }, - { - position: "gorget", - armours: ["Tartaros"], - sprite: spr_tartaros_gorget, - shadows: spr_tartaros_gorget_shadows, - body_types: [2], - }, - { - position: "head", - armours: ["Tartaros"], - sprite: spr_tartaros_head_variants, - shadows: spr_tartaros_head_shadows, - body_types: [2], - }, - { - position: "forehead", - armours: ["Tartaros"], - sprite: spr_tartaros_forehead_variants, - shadows: spr_tartaros_forehead_shadows, - body_types: [2], - }, - { - position: "right_leg", - armours: ["Tartaros"], - sprite: spr_tartaros_right_leg, - shadows: spr_tartaros_right_leg_shadows, - body_types: [2], - flip: true, - subcomponents: [ - [ - spr_blank, - spr_blank, - spr_blank, - spr_tartaros_leg_rivets - ] - ], - }, - { - position: "right_trim", - armours: ["Tartaros"], - sprite: spr_tartaros_right_trim, - shadows: spr_tartaros_right_trim_shadows, - body_types: [2], - flip: true, - }, - { - position: "chest_variants", - armours: ["Tartaros"], - sprite: spr_tartaros_chest, - shadows: spr_tartaros_chest_shadows, - body_types: [2], - } -]; - function DummyMarine() constructor { static update = function() { delete body; From cf5de26e1e6962688750789e40197fcf7cd30e2e Mon Sep 17 00:00:00 2001 From: carys-the-weed-cloud <36204825+carys-the-weed-cloud@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:55:56 -0400 Subject: [PATCH 2/6] refactor: Cleanup combat code. --- objects/obj_enunit/Alarm_0.gml | 2 +- objects/obj_enunit/Create_0.gml | 2 +- objects/obj_pnunit/Alarm_6.gml | 5 +---- objects/obj_pnunit/Create_0.gml | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 2ca388bb62..8c0b3809f7 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -56,7 +56,7 @@ if (!engaged) { var cm_present = false; var cm_index = -1; - var cm_block = false; + var cm_block = noone; with (obj_pnunit) { for (var u = 0; u < array_length(unit_struct); u++) { if (marine_type[u] == obj_ini.role[100][eROLE.CHAPTERMASTER]) { diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index c5d7de3fcf..8746fb2f92 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -1,4 +1,4 @@ -unit = ""; +unit = undefined; men = 0; veh = 0; dreads = 0; diff --git a/objects/obj_pnunit/Alarm_6.gml b/objects/obj_pnunit/Alarm_6.gml index a9a58d7f4f..62ac8b4e7f 100644 --- a/objects/obj_pnunit/Alarm_6.gml +++ b/objects/obj_pnunit/Alarm_6.gml @@ -1,6 +1,4 @@ -// -// Handles marines dying on battle -// +/// @description Handles marines dying on battle // Remove from ships // Remove from the controller @@ -23,7 +21,6 @@ for (var i = 0; i < array_length(unit_struct); i++) { if (unit.ship_location > -1) { obj_ini.ship_carrying[unit.ship_location] -= man_size; } - // scr_kill_unit(unit.company, unit.marine_number); } } diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index f484862cf1..aa333d8c0a 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -1,4 +1,4 @@ -unit = ""; +unit = undefined; men = 0; veh = 0; charge = 0; From e48e0974d0b8772eb979a021b417045d2c8c2dea Mon Sep 17 00:00:00 2001 From: carys-the-weed-cloud <36204825+carys-the-weed-cloud@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:56:39 -0400 Subject: [PATCH 3/6] fix: Ensure the enemy exists before fighting it. --- objects/obj_pnunit/Alarm_0.gml | 98 +++++++++++++++++----------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 1c43c0829e..a3fdbd7a22 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -81,6 +81,10 @@ try { instance_destroy(); } enemy = instance_nearest(0, y, obj_enunit); + if (!instance_exists(enemy)) { + engaged = false; + break; + } } if ((range[i] >= dist) && (ammo[i] != 0 || range[i] == 1)) { @@ -109,41 +113,39 @@ try { ap = 1; } - if (instance_exists(enemy)) { - if ((obj_enunit.veh > 0) && (obj_enunit.men == 0) && (apa[i] > 10)) { - ap = 1; - } + if ((obj_enunit.veh > 0) && (obj_enunit.men == 0) && (apa[i] > 10)) { + ap = 1; + } - if ((ap == 1) && (once_only == 0)) { - // Check for vehicles - var g = 0; + if ((ap == 1) && (once_only == 0)) { + // Check for vehicles + var g = 0; - if (enemy.veh > 0) { - good = scr_target(enemy, "veh"); // First target has vehicles, blow it to hell - scr_shoot(i, enemy, good, "arp", "ranged"); - } - if ((good == 0) && (instance_number(obj_enunit) > 1)) { - // First target does not have vehicles, cycle through objects to find one that has vehicles - var x2 = enemy.x; - repeat (instance_number(obj_enunit) - 1) { - if (good == 0) { - x2 += 10; - var enemy2 = instance_nearest(x2, y, obj_enunit); - if ((enemy2.veh > 0) && (good == 0)) { - good = scr_target(enemy2, "veh"); // This target has vehicles, blow it to hell - scr_shoot(i, enemy2, good, "arp", "ranged"); - once_only = 1; - } + if (enemy.veh > 0) { + good = scr_target(enemy, "veh"); // First target has vehicles, blow it to hell + scr_shoot(i, enemy, good, "arp", "ranged"); + } + if ((good == 0) && (instance_number(obj_enunit) > 1)) { + // First target does not have vehicles, cycle through objects to find one that has vehicles + var x2 = enemy.x; + repeat (instance_number(obj_enunit) - 1) { + if (good == 0) { + x2 += 10; + var enemy2 = instance_nearest(x2, y, obj_enunit); + if ((enemy2.veh > 0) && (good == 0)) { + good = scr_target(enemy2, "veh"); // This target has vehicles, blow it to hell + scr_shoot(i, enemy2, good, "arp", "ranged"); + once_only = 1; } } } - if (good == 0) { - ap = 0; - } // Fuck it, shoot at infantry } + if (good == 0) { + ap = 0; + } // Fuck it, shoot at infantry } - if (instance_exists(enemy) && (once_only == 0)) { + if (once_only == 0) { if ((enemy.medi > 0) && (enemy.veh == 0)) { good = scr_target(enemy, "medi"); // First target has vehicles, blow it to hell scr_shoot(i, enemy, good, "medi", "ranged"); @@ -170,28 +172,26 @@ try { } } - if (instance_exists(enemy)) { - if ((ap == 0) && (once_only == 0)) { - // Check for men - var g = 0; - good = 0; + if ((ap == 0) && (once_only == 0)) { + // Check for men + var g = 0; + good = 0; - if (enemy.men + enemy.medi > 0) { - good = scr_target(enemy, "men"); // First target has vehicles, blow it to hell - scr_shoot(i, enemy, good, "att", "ranged"); - } - if ((good == 0) && (instance_number(obj_enunit) > 1)) { - // First target does not have vehicles, cycle through objects to find one that has vehicles - var x2 = enemy.x; - repeat (instance_number(obj_enunit) - 1) { - if (good == 0) { - x2 += 10; - var enemy2 = instance_nearest(x2, y, obj_enunit); - if ((enemy2.men > 0) && (good == 0)) { - good = scr_target(enemy2, "men"); // This target has vehicles, blow it to hell - scr_shoot(i, enemy2, good, "att", "ranged"); - once_only = 1; - } + if (enemy.men + enemy.medi > 0) { + good = scr_target(enemy, "men"); // First target has vehicles, blow it to hell + scr_shoot(i, enemy, good, "att", "ranged"); + } + if ((good == 0) && (instance_number(obj_enunit) > 1)) { + // First target does not have vehicles, cycle through objects to find one that has vehicles + var x2 = enemy.x; + repeat (instance_number(obj_enunit) - 1) { + if (good == 0) { + x2 += 10; + var enemy2 = instance_nearest(x2, y, obj_enunit); + if ((enemy2.men > 0) && (good == 0)) { + good = scr_target(enemy2, "men"); // This target has vehicles, blow it to hell + scr_shoot(i, enemy2, good, "att", "ranged"); + once_only = 1; } } } @@ -247,7 +247,7 @@ try { if ((ap == 0) && (once_only == 0)) { // Check for men - var g = 0, good = 0; + var good = 0; if ((enemy.men > 0) && (once_only == 0)) { good = scr_target(enemy, "men"); From baa7fe886cc1d5238a8a2579878886421af68729 Mon Sep 17 00:00:00 2001 From: carys-the-weed-cloud <36204825+carys-the-weed-cloud@users.noreply.github.com> Date: Tue, 7 Jul 2026 20:25:10 -0400 Subject: [PATCH 4/6] refactor: Cleanup Allied ship code. --- objects/obj_al_ship/Create_0.gml | 1 + objects/obj_al_ship/Step_0.gml | 138 +++++++++---------------------- 2 files changed, 40 insertions(+), 99 deletions(-) diff --git a/objects/obj_al_ship/Create_0.gml b/objects/obj_al_ship/Create_0.gml index 0b21ad38bb..efd840fd60 100644 --- a/objects/obj_al_ship/Create_0.gml +++ b/objects/obj_al_ship/Create_0.gml @@ -24,6 +24,7 @@ class = ""; hp = 0; maxhp = 0; conditions = ""; +owner = eFACTION.IMPERIUM; shields = 1; maxshields = 1; armour_front = 0; diff --git a/objects/obj_al_ship/Step_0.gml b/objects/obj_al_ship/Step_0.gml index 1155fe63a5..bdefc1181f 100644 --- a/objects/obj_al_ship/Step_0.gml +++ b/objects/obj_al_ship/Step_0.gml @@ -1,40 +1,46 @@ // Manages space combat, checks if ships are destroyed and does the targeting and pointing of the ship +image_angle = direction; -var bull, ok, targe = 0, rdir = 0, dist = 9999, xx = x, yy = y; -var front = 0, right = 0, left = 0, rear = 0; -var f = 0, facing = "", ammo = 0, range = 0, wep = "", dam = 0; -var o_dist = 0, spid = 0; -var gud = 0; +if (obj_fleet.start != 5) { + exit; +} +// Need to every couple of seconds check this +// with obj_en_ship if not big then disable, check nearest, and activate once more +if (instance_exists(obj_en_ship)) { + target = instance_nearest(x, y, obj_en_ship); +} +if (!instance_exists(target)) { + exit; +} -if (owner != 6) { - image_angle = direction; +if ((shields > 0) && (shields < maxshields)) { + shields += (owner == eFACTION.ELDAR) ? 0.03 : 0.02; +} - if (obj_fleet.start != 5) { - exit; - } +var bull = noone; +var ok = 0; +var targe = noone; +var dist = 9999; +var front = 0; +var right = 0; +var left = 0; +var rear = 0; +var facing = ""; +var ammo = 0; +var range = 0; +var wep = ""; +var dam = 0; +var o_dist = 0; +var spid = 0; +var gud = 0; +if (owner != eFACTION.ELDAR) { if ((class == "Daemon") && (image_alpha < 1)) { image_alpha += 0.006; } - o_dist = 0; - spid = 0; - - if ((shields > 0) && (shields < maxshields)) { - shields += 0.02; - } - - // Need to every couple of seconds check this - // with obj_en_ship if not big then disable, check nearest, and activate once more - if (instance_exists(obj_en_ship)) { - target = instance_nearest(x, y, obj_en_ship); - } - if (!instance_exists(target)) { - exit; - } // Check if ship is destroyed if (hp <= 0) { - gud = 0; for (var wh = 1; wh <= 5; wh++) { if (obj_fleet.enemy[wh] == owner) { gud = wh; @@ -161,10 +167,10 @@ if (owner != 6) { dist = point_distance(x, y, target.x, target.y) - max(sprite_get_width(sprite_index), sprite_get_height(sprite_index)); // For example here we could improve the options and how ships beheave... - if ((target != 0) && (action == "attack")) { + if ((target != noone) && (action == "attack")) { direction = turn_towards_point(direction, x, y, target.x, target.y, 0.1); } - if ((target != 0) && (action == "broadside") && (dist > o_dist)) { + if ((target != noone) && (action == "broadside") && (dist > o_dist)) { if (y >= target.y) { dist = point_distance(x, y, target.x + lengthdir_x(64, target.direction - 180), target.y + lengthdir_y(128, target.direction - 90)) - max(sprite_get_width(sprite_index), sprite_get_height(sprite_index)); } @@ -223,11 +229,7 @@ if (owner != 6) { turret_cool -= 1; } - targe = 0; - rdir = 0; dist = 9999; - xx = x; - yy = y; // Turret targetting if ((turrets > 0) && instance_exists(obj_en_in) && (turret_cool == 0)) { targe = instance_nearest(x, y, obj_en_in); @@ -248,10 +250,7 @@ if (owner != 6) { bull.direction += choose(random(10), 1 * -random(10)); } } - targe = 0; dist = 9999; - xx = lengthdir_x(64, direction + 90); - yy = lengthdir_y(64, direction + 90); // TODO we could implement facing with stronger shields or other stuff front = 0; @@ -259,8 +258,6 @@ if (owner != 6) { left = 0; rear = 0; - targe = instance_nearest(xx, yy, obj_en_ship); - rdir = point_direction(x, y, target.x, target.y); target_l = instance_nearest(x + lengthdir_x(64, direction + 90), y + lengthdir_y(64, direction + 90), obj_en_ship); target_r = instance_nearest(x + lengthdir_x(64, direction + 270), y + lengthdir_y(64, direction + 270), obj_en_ship); @@ -268,21 +265,14 @@ if (owner != 6) { front = 1; } - f = 0; - facing = ""; - ammo = 0; - range = 0; - wep = ""; - dam = 0; - for (var gg = 1; gg <= weapons; gg++) { // Resets ok = 0; - f += 1; facing = ""; ammo = 0; range = 0; wep = ""; + dam = 0; if ((cooldown[gg] <= 0) && (weapon[gg] != "") && (weapon_ammo[gg] > 0)) { ok = 1; @@ -293,7 +283,6 @@ if (owner != 6) { range = weapon_range[gg]; } - targe = target; if ((facing == "front") && (front == 1)) { ok = 2; } @@ -303,10 +292,7 @@ if (owner != 6) { if (facing == "special") { ok = 2; } - if (!instance_exists(targe)) { - exit; - } - dist = point_distance(x, y, targe.x, targe.y); + dist = point_distance(x, y, target.x, target.y); if ((facing == "right") && (point_direction(x, y, target_r.x, target_r.y) < 337) && (point_direction(x, y, target_r.x, target_r.y) > 203)) { ok = 2; } @@ -330,9 +316,6 @@ if (owner != 6) { bull = instance_create(x + lengthdir_x(32, direction), y + lengthdir_y(32, direction), obj_al_round); bull.speed = 20; bull.dam = dam; - if (targe == target) { - bull.direction = point_direction(x + lengthdir_x(32, direction), y + lengthdir_y(32, direction), target.x, target.y); - } if (facing != "front") { bull.direction = point_direction(x + lengthdir_x(32, direction), y + lengthdir_y(32, direction), target.x, target.y); } @@ -432,27 +415,8 @@ if (owner != 6) { } } // Checks if the enemy fleet is Eldar -if (owner == 6) { - image_angle = direction; - - if (obj_fleet.start != 5) { - exit; - } - - o_dist = 0; - spid = 0; - - if ((shields > 0) && (shields < maxshields)) { - shields += 0.03; - } - // Need to every couple of seconds check this - // with obj_en_ship if not big then disable, check nearest, and activate once more - if (instance_exists(obj_en_ship)) { - target = instance_nearest(x, y, obj_en_ship); - } - +if (owner == eFACTION.ELDAR) { if (hp <= 0) { - gud = 0; for (var wh = 1; wh <= 5; wh++) { if (obj_fleet.enemy[wh] == owner) { gud = wh; @@ -544,10 +508,7 @@ if (owner == 6) { turret_cool -= 1; } - targe = 0; dist = 9999; - xx = x; - yy = y; if ((turrets > 0) && instance_exists(obj_en_in) && (turret_cool == 0)) { targe = instance_nearest(x, y, obj_en_in); @@ -572,20 +533,13 @@ if (owner == 6) { bull.direction += choose(random(10), 1 * -random(10)); } } - targe = 0; - rdir = 0; dist = 9999; - xx = lengthdir_x(64, direction + 90); - yy = lengthdir_y(64, direction + 90); - front = 0; right = 0; left = 0; rear = 0; - targe = instance_nearest(xx, yy, obj_en_ship); - rdir = point_direction(x, y, target.x, target.y); target_l = instance_nearest(x + lengthdir_x(64, direction + 90), y + lengthdir_y(64, direction + 90), obj_en_ship); target_r = instance_nearest(x + lengthdir_x(64, direction + 270), y + lengthdir_y(64, direction + 270), obj_en_ship); @@ -593,20 +547,13 @@ if (owner == 6) { front = 1; } - f = 0; - facing = ""; - ammo = 0; - range = 0; - wep = ""; - dam = 0; - for (var gg = 1; gg <= weapons; gg++) { ok = 0; - f += 1; facing = ""; ammo = 0; range = 0; wep = ""; + dam = 0; if ((cooldown[gg] <= 0) && (weapon[gg] != "") && (weapon_ammo[gg] > 0)) { ok = 1; @@ -617,7 +564,6 @@ if (owner == 6) { range = weapon_range[gg]; } - targe = target; if ((facing == "front") && (front == 1)) { ok = 2; } @@ -627,10 +573,7 @@ if (owner == 6) { if (facing == "special") { ok = 2; } - if (!instance_exists(targe)) { - exit; - } - dist = point_distance(x, y, targe.x, targe.y); + dist = point_distance(x, y, target.x, target.y); if ((facing == "right") && (point_direction(x, y, target_r.x, target_r.y) < 337) && (point_direction(x, y, target_r.x, target_r.y) > 203)) { ok = 2; @@ -655,9 +598,6 @@ if (owner == 6) { bull = instance_create(x + lengthdir_x(32, direction), y + lengthdir_y(32, direction), obj_al_round); bull.speed = 20; bull.dam = dam; - if (targe == target) { - bull.direction = point_direction(x + lengthdir_x(32, direction), y + lengthdir_y(32, direction), target.x, target.y); - } if (facing != "front") { bull.direction = point_direction(x + lengthdir_x(32, direction), y + lengthdir_y(32, direction), target.x, target.y); } From a65e7c12e678b3a7ec117cdbd2a515be483911d6 Mon Sep 17 00:00:00 2001 From: carys-the-weed-cloud <36204825+carys-the-weed-cloud@users.noreply.github.com> Date: Tue, 7 Jul 2026 20:32:40 -0400 Subject: [PATCH 5/6] fix: Misc scr_culture_cisuals corrections. --- .../scr_culture_visuals.gml | 1545 +++++++++++++++++ 1 file changed, 1545 insertions(+) diff --git a/scripts/scr_culture_visuals/scr_culture_visuals.gml b/scripts/scr_culture_visuals/scr_culture_visuals.gml index df6de74fe3..5eeb441fa3 100644 --- a/scripts/scr_culture_visuals/scr_culture_visuals.gml +++ b/scripts/scr_culture_visuals/scr_culture_visuals.gml @@ -336,6 +336,1551 @@ function set_up_visual_overides() { } } +global.modular_drawing_items = [ + { + sprite: spr_purity_seal, + body_types: [ + 0, + 2 + ], + position: "purity_seals", + }, + { + position: "crown", + body_types: [0], + max_saturation: 60, + exp: { + scale: true, + exp_scale_max: 200, + }, + sprite: spr_psy_hood_alpha2, + equipped: { + "gear": "Psychic Hood", + }, + cultures: ["Alpha"], + prevent_others: true, + }, + { + position: "crest", + body_types: [2], + sprite: spr_indomitus_complex_psy_hood, + equipped: { + "gear": "Psychic Hood", + }, + prevent_others: true, + subcomponents: [[spr_indomitus_complex_psy_hood_cables]], + overides: { + "crown": spr_indomitus_complex_psy_hood_crown, + }, + }, + { + position: "robe", + body_types: [0], + sprite: spr_binders_robe, + role_type: [SPECIALISTS_LIBRARIANS], + max_saturation: 10, + }, + { + position: "robe", + body_types: [0], + sprite: spr_binders_robe, + role_type: [SPECIALISTS_LIBRARIANS], + max_saturation: 40, + chapter_adv: [ + "Favoured By The Warp", + "Warp Touched" + ], + chapter_disadv: ["Warp Tainted"], + allow_either: [ + "chapter_adv", + "chapter_disadv" + ], + }, + { + position: "belt", + body_types: [0], + sprite: spr_binders_belt, + role_type: [SPECIALISTS_LIBRARIANS], + chapter_adv: [ + "Favoured By The Warp", + "Warp Touched" + ], + chapter_disadv: ["Warp Tainted"], + allow_either: [ + "chapter_adv", + "chapter_disadv" + ], + max_saturation: 50, + }, + { + position: "crown", + body_types: [0], + sprite: spr_psy_hood_complex, + equipped: { + "gear": "Psychic Hood", + }, + prevent_others: true, + subcomponents: [ + [ + spr_blank, + spr_psy_hood_components + ] + ], + }, + { + sprite: spr_da_mk5_helm_crests, + cultures: ["Knightly"], + body_types: [0], + armours: [ + "MK3 Iron Armour", + "MK4 Maximus", + "MK5 Heresy" + ], + position: "crest", + assign_by_rank: 2, + exp: { + min: 70, + }, + }, + { + sprite: spr_da_mk7_helm_crests, + cultures: ["Knightly"], + body_types: [0], + armours: [ + "MK7 Aquila", + "Power Armour", + "MK8 Errant", + "Artificer Armour" + ], + position: "crest", + assign_by_rank: 2, + }, + { + sprite: spr_terminator_laurel, + armours: [ + "Terminator Armour", + "Tartaros" + ], + roles: [ + eROLE.CAPTAIN, + eROLE.CHAMPION + ], + position: "crown", + body_types: [2], + }, + { + sprite: spr_laurel, + body_types: [0], + armours: [ + "Terminator Armour", + "Tartaros" + ], + roles: [ + eROLE.CAPTAIN, + eROLE.CHAMPION + ], + position: "crown", + }, + { + sprite: spr_special_helm, + body_types: [0], + armours_exclude: ["MK3 Iron Armour"], + roles: [ + eROLE.CAPTAIN, + eROLE.CHAMPION + ], + assign_by_rank: 2, + position: "mouth_variants", + }, + { + cultures: ["Mongol"], + sprite: spr_mongol_topknots, + body_types: [0], + position: "crest", + }, + { + cultures: [ + "Cthonian", + "Gothic" + ], + sprite: spr_chap_trim_right, + body_types: [0], + position: "right_trim", + max_saturation: 80, + exp: { + scale: true, + exp_scale_max: 300, + }, + flip: true, + }, + { + sprite: spr_chap_trim_right, + body_types: [0], + position: "right_trim", + role_type: [SPECIALISTS_CHAPLAINS], + flip: true, + }, + { + cultures: ["Mongol"], + sprite: spr_mongol_hat, + body_types: [0], + position: "crown", + }, + { + cultures: ["Prussian"], + sprite: spr_prussian_spike, + body_types: [0], + position: "crest", + }, + { + cultures: ["Mechanical Cult"], + assign_by_rank: 2, + sprite: spr_metal_tabbard, + shadows: spr_metal_tabbard_shadow, + role_type: [SPECIALISTS_TECHS], + body_types: [0], + position: "tabbard", + allow_either: [ + "cultures", + "role_type" + ], + }, + { + cultures: ["Knightly"], + sprite: spr_knightly_personal_livery, + body_types: [0], + assign_by_rank: 3, + position: "left_personal_livery", + }, + { + cultures: ["Gladiator"], + sprite: spr_gladiator_crest, + body_types: [0], + assign_by_rank: 2, + position: "crest", + }, + { + cultures: ["Mechanical Cult"], + assign_by_rank: 2, + sprite: spr_terminator_metal_tabbard, + role_type: [SPECIALISTS_TECHS], + body_types: [2], + position: "tabbard", + allow_either: [ + "cultures", + "role_type" + ], + }, + { + cultures: ["Flame Cult"], + sprite: spr_mk3_mouth_flame_cult, + body_types: [0], + position: "mouth_variants", + armours: ["MK3 Iron Armour"], + }, + { + cultures: ["Prussian"], + sprite: spr_mk3_mouth_prussian, + body_types: [0], + position: "mouth_variants", + armours: ["MK3 Iron Armour"], + }, + { + cultures: ["Prussian"], + sprite: spr_mk6_mouth_prussian, + body_types: [0], + position: "mouth_variants", + armours: ["MK3 Iron Armour"], + }, + { + cultures: ["Prussian"], + sprite: spr_mk7_prussia_chest, + body_types: [0], + position: "chest_variants", + }, + { + cultures: ["Prussian"], + sprite: spr_mk7_mouth_prussian, + body_types: [0], + position: "chest_variants", + armours: [ + "MK8 Errant", + "MK7 Aquila" + ], + }, + { + cultures: ["Mongol"], + sprite: spr_mk7_mongol_chest_variants, + body_types: [0], + position: "chest_variants", + armours: [ + "MK8 Errant", + "MK7 Aquila" + ], + }, + { + cultures: ["Gladiator"], + sprite: spr_mk7_gladiator_chest, + body_types: [0], + position: "chest_variants", + armours: [ + "MK8 Errant", + "MK7 Aquila" + ], + }, + { + cultures: ["Mongol"], + sprite: spr_mk4_mongol_chest_variants, + body_types: [0], + position: "chest_variants", + armours: ["MK4 Maximus"], + }, + { + cultures: ["Mongol"], + sprite: spr_mk6_mongol_chest_variants, + body_types: [0], + position: "chest_variants", + armours: ["MK6 Corvus"], + }, + { + cultures: ["Knightly"], + sprite: spr_knightly_robes, + body_types: [0], + position: "robe", + assign_by_rank: 4, + }, + { + cultures: ["Knightly"], + sprite: spr_da_backpack, + body_types: [0], + position: "backpack", + assign_by_rank: 3, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + }, + { + cultures: ["Alpha"], + sprite: spr_alpha_backpack, + body_types: [0], + position: "backpack", + assign_by_rank: 3, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + }, + { + chapter_adv: ["Reverent Guardians"], + sprite: spr_pack_brazier3, + traits: ["zealous_faith"], + body_types: [0], + allow_either: [ + "chapter_adv", + "traits", + "role_type" + ], + role_type: [SPECIALISTS_CHAPLAINS], + position: "backpack_decoration", + assign_by_rank: 4, + max_saturation: 40, + }, + { + sprite: spr_gear_librarian, + body_types: [0], + position: "right_pauldron_icons", + role_type: [SPECIALISTS_LIBRARIANS], + }, + { + sprite: spr_gear_librarian_term, + body_types: [2], + position: "right_pauldron_icons", + role_type: [SPECIALISTS_LIBRARIANS], + }, + { + sprite: spr_roman_centurian_crest, + shadows: spr_roman_centurian_crest_shadows, + body_types: [0], + cultures: [ + "Roman", + "Greek", + "Gladiator" + ], + position: "crest", + role_type: [SPECIALISTS_CAPTAIN_CANDIDATES], + assign_by_rank: 2, + }, + { + sprite: spr_marksmans_honor, + body_types: [ + 0, + 2 + ], + position: "purity_seals", + stats: [ + [ + "ballistic_skill", + 50, + "exmore" + ] + ], + }, + { + sprite: spr_crux_on_chain, + body_types: [ + 0, + 2 + ], + position: "purity_seals", + exp: { + min: 100, + }, + }, + { + cultures: ["Knightly"], + sprite: spr_mk6_knightly_mouth_variants, + body_types: [0], + position: "mouth_variants", + armours: ["MK6 Corvus"], + }, + { + cultures: ["Knightly"], + sprite: spr_mk6_forehead_knightly, + body_types: [0], + position: "forehead", + armours: ["MK6 Corvus"], + }, + { + cultures: ["Cthonian"], + sprite: spr_mk6_cthonian_heads, + body_types: [0], + position: "head", + armours: ["MK6 Corvus"], + }, + { + sprite: spr_mk7_complex_crux_belt, + body_types: [ + 0, + 2 + ], + position: "belt", + offsets: { + "Tartaros": { + x: 7, + }, + }, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour", + "Tartaros" + ], + exp: { + min: 100, + }, + }, + { + sprite: spr_crux_belt_fancy, + body_types: [ + 0, + 2 + ], + position: "belt", + offsets: { + "Tartaros": { + x: 7, + }, + }, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour", + "Tartaros" + ], + assign_by_rank: 3, + exp: { + min: 100, + }, + }, + { + cultures: [ + "Knightly", + "Crusader" + ], + sprite: spr_mk7_rope_belt, + body_types: [0], + position: "belt", + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour", + "MK4 Maximus" + ], + assign_by_rank: 2, + }, + { + cultures: [ + "Knightly", + "Crusader", + "Gladiator" + ], + sprite: spr_lion_belt, + body_types: [0], + position: "belt", + exp: { + min: 70, + }, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + assign_by_rank: 2, + }, + { + cultures: ["Knightly"], + sprite: spr_knightly_belt, + body_types: [0], + position: "belt", + exp: { + min: 50, + }, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + assign_by_rank: 3, + }, + { + sprite: spr_skulls_belt, + body_types: [0], + position: "belt", + role_type: [SPECIALISTS_CHAPLAINS], + cultures: ["Gothic"], + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + allow_either: [ + "cultures", + "role_type" + ], + }, + { + sprite: spr_tech_belt, + body_types: [0], + position: "belt", + role_type: [SPECIALISTS_TECHS], + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + }, + { + cultures: ["Feral"], + sprite: spr_teeth, + body_types: [ + 0, + 2 + ], + position: "purity_seals", + traits: [ + "tyrannic_vet", + "beast_slayer", + "feral" + ], + allow_either: [ + "cultures", + "traits" + ], + }, + { + cultures: ["Knightly"], + sprite: spr_mk7_knightly_chest, + body_types: [0], + position: "chest_variants", + armours: [ + "MK8 Errant", + "MK7 Aquila", + "Artificer Armour" + ], + }, + { + sprite: spr_ultra_belt, + cultures: ["Ultra"], + body_types: [ + 0, + 2 + ], + assign_by_rank: 3, + position: "belt", + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour", + "Tartaros" + ], + }, + { + cultures: [ + "Roman", + "Gladiator" + ], + sprite: spr_roman_tabbard, + body_types: [ + 0, + 2 + ], + position: "tabbard", + max_saturation: 50, + assign_by_rank: 3, + exp: { + min: 50, + }, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour", + "Tartaros", + "MK4 Maximus", + "MK3 Iron Armour" + ], + }, + { + cultures: ["Cthonian"], + sprite: spr_cthonian_tabbard, + body_types: [ + 0, + 2 + ], + position: "tabbard", + max_saturation: 50, + assign_by_rank: 3, + exp: { + min: 50, + }, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour", + "Tartaros", + "MK4 Maximus", + "MK3 Iron Armour" + ], + }, + { + cultures: [ + "Cthonian", + "Prussian" + ], + sprite: spr_chain_mail_tabbard, + body_types: [ + 0, + 2 + ], + position: "tabbard", + max_saturation: 50, + assign_by_rank: 3, + exp: { + min: 50, + }, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour", + "Tartaros", + "MK4 Maximus", + "MK3 Iron Armour" + ], + }, + { + cultures: ["Ultra"], + sprite: spr_ultra_tassels, + body_types: [ + 0, + 2 + ], + position: "purity_seals", + exp: { + min: 80, + }, + }, + { + cultures: [ + "Ultra", + "Roman" + ], + sprite: spr_ultra_backpack, + body_types: [0], + position: "backpack", + assign_by_rank: 2, + exp: { + min: 80, + }, + }, + { + cultures: [ + "Ultra", + "Roman" + ], + sprite: spr_roman_cloak, + body_types: [0], + position: "cloak", + max_saturation: 35, + overides: { + "right_pauldron_hangings": spr_ultra_right_shoulder_hanging, + }, + assign_by_rank: 2, + exp: { + min: 80, + }, + }, + { + cultures: ["Ultra"], + sprite: spr_mk7_chest_ultra, + body_types: [0], + position: "chest_variants", + armours: [ + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + }, + { + max_saturation: 50, + cultures: ["Knightly"], + sprite: spr_indomitus_knightly_robe, + body_types: [2], + position: "robe", + armours: ["Terminator Armour"], + }, + { + cultures: [ + "Feral", + "Gothic" + ], + sprite: spr_skull_on_chain, + body_types: [2], + position: "purity_seals", + }, + { + cultures: ["Knightly"], + sprite: spr_sword_pendant, + body_types: [ + 0, + 2 + ], + position: "purity_seals", + }, + { + sprite: spr_mk7_complex_belt, + body_types: [0], + position: "belt", + armours_exclude: ["MK3 Iron Armour"], + }, + { + sprite: spr_dev_pack_complex, + body_types: [0], + position: "backpack_augment", + equipped: { + "mobi": "Heavy Weapons Pack", + }, + overides: { + "chest_fastening": spr_backpack_fastening, + }, + }, + { + sprite: spr_jump_pack_complex, + body_types: [0], + position: "backpack_augment", + equipped: { + "mobi": "Jump Pack", + }, + overides: { + "chest_fastening": spr_backpack_fastening, + }, + }, + { + sprite: spr_cyclone_launcher, + body_types: [2], + position: "backpack_augment", + equipped: { + "mobi": "Cyclone Missile System", + }, + }, + { + sprite: spr_jump_pack_serpha_complex, + body_types: [0], + position: "backpack_augment", + equipped: { + "mobi": "Serpha Jump Pack", + }, + overides: { + "chest_fastening": spr_backpack_fastening, + }, + }, + { + sprite: spr_gear_hood2, + body_types: [0], + position: "mouth_variants", + role_type: [SPECIALISTS_LIBRARIANS], + chapter_disadv: ["Warp Tainted"], + }, + { + sprite: spr_mk4_chest_fastenings, + body_types: [0], + position: "chest_fastening", + armours: ["MK4 Maximus"], + }, + { + sprite: spr_mk7_complex_right_pauldron, + body_types: [0], + position: "right_pauldron_base", + shadows: spr_mk7_complex_right_pauldron_shadow, + flip: true, + }, + { + cultures: ["Cthonian"], + max_saturation: 30, + sprite: spr_right_pauldron_chainmail, + body_types: [0], + position: "right_pauldron_base", + flip: true, + }, + { + sprite: spr_bonding_studs_right, + body_types: [0], + position: "right_pauldron_embeleshments", + max_saturation: 15, + armours_exclude: [ + "MK5 Heresy", + "MK6 Corvus" + ], + flip: true, + }, + { + sprite: spr_bonding_studs_right, + body_types: [0], + position: "right_pauldron_embeleshments", + armours: [ + "MK5 Heresy", + "MK6 Corvus" + ], + flip: true, + }, + { + cultures: ["Cthonian"], + sprite: spr_pauldron_spikes_right, + body_types: [0], + position: "right_pauldron_embeleshments", + max_saturation: 30, + traits: [ + "blunt", + "cunning", + "brute" + ], + allow_either: [ + "cultures", + "traits" + ], + flip: true, + }, + { + cultures: ["Wolf Cult"], + sprite: spr_chaplain_wolfterm_helm, + body_types: [2], + position: "head", + prevent_others: true, + ban: ["mouth_variants"], + role_type: [SPECIALISTS_CHAPLAINS], + }, + { + cultures: ["Wolf Cult"], + sprite: spr_chaplain_wolf_helm, + body_types: [0], + position: "head", + prevent_others: true, + ban: ["mouth_variants"], + role_type: [SPECIALISTS_CHAPLAINS], + offsets: { + "Tartaros": { + y: -5, + }, + }, + }, + { + sprite: spr_chaplain_term_helm, + body_types: [2], + position: "head", + prevent_others: true, + ban: ["mouth_variants"], + role_type: [SPECIALISTS_CHAPLAINS], + offsets: { + "Tartaros": { + y: -5, + }, + }, + }, + { + sprite: spr_chaplain_helm, + body_types: [0], + position: "head", + prevent_others: true, + ban: ["mouth_variants"], + role_type: [SPECIALISTS_CHAPLAINS], + }, + { + cultures: [ + "Feral", + "Wolf Cult" + ], + sprite: spr_wolf_tail, + body_types: [ + 2, + 0 + ], + position: "purity_seals", + }, + { + cultures: [ + "Feral", + "Wolf Cult" + ], + sprite: spr_right_pauldron_fur_hanging, + body_types: [0], + position: "right_pauldron_hangings", + max_saturation: 20, + flip: true, + }, + { + cultures: [ + "Feral", + "Wolf Cult" + ], + sprite: spr_term_right_fur_hanging, + body_types: [2], + position: "right_pauldron_hangings", + max_saturation: 20, + flip: true, + }, + { + cultures: ["Wolf Cult"], + sprite: spr_fur_tail_topknot, + body_types: [0], + position: "crest", + max_saturation: 30, + }, + { + cultures: ["Runic"], + sprite: spr_runes_hanging, + body_types: [ + 0, + 2 + ], + position: "purity_seals", + }, + { + cultures: ["Wolf Cult"], + sprite: spr_mk7_wolf_cult_chest_variants, + body_types: [0], + position: "chest_variants", + armours: [ + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + }, + { + cultures: ["Wolf Cult"], + sprite: spr_mk7_wolf_cult_belt, + body_types: [0], + position: "belt", + armours_exclude: ["MK3 Iron Armour"], + }, + { + cultures: ["Runic"], + sprite: spr_mk7_runic_belt, + body_types: [0], + position: "belt", + armours_exclude: ["MK3 Iron Armour"], + }, + { + cultures: ["Wolf Cult"], + sprite: spr_fur_tabbard, + body_types: [ + 0, + 2 + ], + position: "tabbard", + max_saturation: 20, + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour", + "Tartaros", + "MK4 Maximus", + "MK3 Iron Armour" + ], + }, + { + cultures: ["Runic"], + sprite: spr_mk3_runic_chest, + body_types: [0], + position: "chest_variants", + armours: ["MK3 Iron Armour"], + }, + { + sprite: spr_mk3_chest, + body_types: [0], + position: "chest_variants", + armours: ["MK3 Iron Armour"], + }, + { + sprite: spr_death_watch_pauldron, + chapter: "Deathwatch", + position: "left_pauldron_base", + body_types: [0], + prevent_others: true, + }, + { + position: "bare_head", + sprite: spr_bare_heads_colourable, + }, + { + position: "bare_neck", + sprite: spr_bare_neck_colourable, + }, + { + position: "bare_eyes", + sprite: spr_bare_eyes, + }, + { + position: "gorget", + sprite: spr_mk8_gorget, + armours: ["MK8 Errant"], + body_types: [0], + shadows: spr_mk8_gorgot_shadows, + }, + { + position: "right_shin", + body_types: [0], + sprite: spr_right_shin_spikes, + traits: [ + "blunt", + "cunning", + "brute" + ], + allow_either: [ + "cultures", + "traits" + ], + cultures: ["Cthonian"], + max_saturation: 80, + exp: { + scale: true, + exp_scale_max: 300, + }, + flip: true, + }, + { + position: "right_knee", + body_types: [2], + sprite: spr_indomitus_right_knee_crux, + armours: ["Terminator Armour"], + max_saturation: 30, + flip: true, + }, + { + position: "right_eye", + sprite: spr_indomitus_right_eye_bionic, + body_types: [2], + body_parts: { + "right_eye": "bionic", + }, + flip: true, + }, + { + position: "right_leg", + sprite: spr_indomitus_right_leg_bionic, + body_types: [2], + body_parts: { + "right_leg": "bionic", + }, + prevent_others: true, + ban: [ + "right_knee", + "knees" + ], + flip: true, + }, + { + position: "right_leg", + sprite: spr_bionic_leg_right, + body_types: [0], + body_parts: { + "right_leg": "bionic", + }, + prevent_others: true, + ban: [ + "right_knee", + "knees" + ], + flip: true, + }, + { + position: "right_eye", + sprite: spr_bionic_right_eyes, + body_types: [0], + body_parts: { + "right_eye": "bionic", + }, + flip: true, + }, + { + position: "forehead", + sprite: spr_helm_decorations, + body_types: [ + 0, + 2 + ], + max_saturation: 50, + roles: [ + eROLE.SERGEANT, + eROLE.CHAMPION, + eROLE.VETERANSERGEANT + ], + offsets: { + "Terminator Armour": { + y: -10, + }, + }, + }, + { + position: "right_arm", + sprite: spr_cata_right_arm, + body_types: [2], + armours: ["Cataphractii"], + subcomponents: [ + [ + spr_blank, + spr_cata_right_armtrim + ] + ], + flip: true, + }, + { + position: "armour", + sprite: spr_cata_complex, + body_types: [2], + armours: ["Cataphractii"], + subcomponents: [[spr_cata_cowl_trim]], + }, + { + position: "tabbard", + sprite: spr_cata_tabbard_leather, + body_types: [2], + armours: ["Cataphractii"], + subcomponents: [ + [ + spr_blank, + spr_cata_tabbard_leather_hangings + ] + ], + }, + { + position: "tabbard", + sprite: spr_cata_tabbard_mail, + body_types: [2], + armours: ["Cataphractii"], + }, + { + position: "right_knee", + sprite: spr_cata_right_knee, + body_types: [2], + armours: ["Cataphractii"], + max_saturation: 50, + flip: true, + }, + { + position: "right_leg", + sprite: spr_cata_right_leg, + body_types: [2], + armours: ["Cataphractii"], + subcomponents: [ + [ + spr_blank, + spr_cata_heavy_toe_right + ] + ], + flip: true, + }, + { + position: "right_pauldron_embeleshments", + sprite: spr_cata_shoulder_hanging_leather_right, + body_types: [2], + armours: ["Cataphractii"], + overides: { + "left_pauldron_embeleshments": spr_cata_shoulder_hanging_leather_left, + "tabbard": spr_cata_tabbard_leather, + }, + subcomponents: [ + [ + spr_blank, + spr_cata_shoulder_hanging_leather_right_tips + ] + ], + flip: true, + }, + { + position: "right_pauldron_embeleshments", + sprite: spr_cata_shoulder_hanging_mail_right, + body_types: [2], + armours: ["Cataphractii"], + overides: { + "left_pauldron_embeleshments": spr_cata_shoulder_hanging_mail_left, + "tabbard": spr_cata_tabbard_mail, + }, + flip: true, + }, + { + sprite: spr_blank, + body_types: [2], + position: "right_trim", + armours: ["Cataphractii"], + subcomponents: [ + [ + spr_blank, + spr_cata_right_trim + ], + [ + spr_blank, + spr_cata_right_trim_2 + ], + [ + spr_blank, + spr_cata_right_trim_1 + ] + ], + flip: true, + }, + { + position: "foreground_item", + sprite: spr_gear_combat_shield, + body_types: [ + 0, + 1, + 2 + ], + offsets: { + "Terminator Armour": { + y: -10, + x: -15, + }, + "Tartaros": { + x: -8, + }, + }, + subcomponents: [ + [ + spr_blank, + spr_combat_shield_bottom_part + ] + ], + equipped: { + "gear": "Combat Shield", + }, + }, + { + position: "right_eye", + sprite: spr_gear_apoth_eye, + role_type: [SPECIALISTS_APOTHECARIES], + offsets: { + "Terminator Armour": { + y: -6, + }, + "Tartaros": { + y: -6, + }, + }, + }, + { + position: "backpack_decoration", + sprite: spr_gear_apoth, + role_type: [SPECIALISTS_APOTHECARIES], + offsets: { + "Terminator Armour": { + y: -22, + }, + "Tartaros": { + y: -30, + }, + }, + }, + { + position: "backpack_decoration", + sprite: spr_angelic_wings, + body_types: [ + 0, + 1 + ], + cultures: ["Angelic"], + assign_by_rank: 2, + equipment_has_tag: { + "gear": "jump", + }, + }, + { + position: "leg_variants", + sprite: spr_mk7_leg_variants, + body_types: [0], + shadows: spr_mk7_leg_variants_shadows, + armours: [ + "MK7 Aquila", + "Artificer Armour", + "MK8 Errant" + ], + max_saturation: 30, + }, + { + position: "backpack", + sprite: spr_mk7_complex_backpack, + body_types: [0], + shadows: spr_mk7_complex_backpack_shadow, + armours: [ + "MK7 Aquila", + "Artificer Armour", + "MK8 Errant" + ], + }, + { + position: "right_leg", + sprite: spr_techmarine_right_leg, + body_types: [0], + armours: [ + "MK5 Heresy", + "MK6 Corvus", + "MK7 Aquila", + "MK8 Errant", + "Artificer Armour" + ], + traits: [ + "tinkerer", + "flesh_is_weak" + ], + role_type: [SPECIALISTS_TECHS], + shadows: spr_techmarine_right_leg_shadow, + allow_either: [ + "traits", + "role_type" + ], + max_saturation: 50, + flip: true, + }, + { + position: "chest_variants", + body_types: [0], + sprite: spr_techmarine_chest, + max_saturation: 50, + traits: [ + "tinkerer", + "flesh_is_weak" + ], + role_type: [SPECIALISTS_TECHS], + allow_either: [ + "traits", + "role_type" + ], + }, + // "head": spr_techmarine_head, + { + position: "right_arm", + armours: [ + "MK3 Iron Armour", + "Artificer Armour", + "MK5 Heresy" + ], + sprite: spr_mk3_right_arm, + body_types: [0], + flip: true, + shadows: spr_mk3_right_arm_shadow, + }, + { + position: "right_arm", + armours: [ + "MK5 Heresy", + "Artificer Armour" + ], + sprite: spr_mk5_right_arm, + body_types: [0], + flip: true, + shadows: spr_mk5_right_arm_shadow, + }, + { + position: "right_arm", + armours: [ + "MK4 Maximus", + "Artificer Armour" + ], + sprite: spr_mk4_right_arm, + shadows: spr_mk4_right_arm_shadow, + body_types: [0], + flip: true, + }, + { + position: "right_arm", + armours: [ + "MK7 Aquila", + "Artificer Armour", + "MK6 Corvus", + "MK8 Errant" + ], + sprite: spr_mk7_right_arm, + shadows: spr_mk7_right_arm_shadow, + body_types: [0], + flip: true, + }, + //Indomitus Sprites + { + position: "armour", + armours: ["Terminator Armour"], + sprite: spr_indomitus_complex, + shadows: spr_indomitus_complex_shadows, + body_types: [2], + }, + { + position: "head", + armours: ["Terminator Armour"], + sprite: spr_indomitus_head_variants, + shadows: spr_indomitus_head_variants_shadows, + body_types: [2], + }, + { + position: "right_arm", + armours: ["Terminator Armour"], + sprite: spr_indomitus_right_arm, + shadows: spr_indomitus_right_arm_shadows, + body_types: [2], + flip: true, + }, + { + position: "right_leg", + armours: ["Terminator Armour"], + sprite: spr_indomitus_leg_variants, + shadows: spr_indomitus_leg_variants_shadows, + body_types: [2], + }, + { + position: "right_shin", + body_types: [2], + sprite: spr_indomitus_right_shin, + armours: ["Terminator Armour"], + shadows: spr_indomitus_right_shin_shadows, + flip: true, + }, + //Tartaros Sprites + { + position: "armour", + armours: ["Tartaros"], + sprite: spr_tartaros_complex, + shadows: spr_tartaros_shadows, + body_types: [2], + }, + { + position: "right_arm", + armours: ["Tartaros"], + sprite: spr_tartaros_right_arm, + shadows: spr_tartaros_right_arm_shadows, + body_types: [2], + flip: true, + }, + { + position: "gorget", + armours: ["Tartaros"], + sprite: spr_tartaros_gorget, + shadows: spr_tartaros_gorget_shadows, + body_types: [2], + }, + { + position: "head", + armours: ["Tartaros"], + sprite: spr_tartaros_head_variants, + shadows: spr_tartaros_head_shadows, + body_types: [2], + }, + { + position: "forehead", + armours: ["Tartaros"], + sprite: spr_tartaros_forehead_variants, + shadows: spr_tartaros_forehead_shadows, + body_types: [2], + }, + { + position: "right_leg", + armours: ["Tartaros"], + sprite: spr_tartaros_right_leg, + shadows: spr_tartaros_right_leg_shadows, + body_types: [2], + flip: true, + subcomponents: [ + [ + spr_blank, + spr_blank, + spr_blank, + spr_tartaros_leg_rivets + ] + ], + }, + { + position: "right_trim", + armours: ["Tartaros"], + sprite: spr_tartaros_right_trim, + shadows: spr_tartaros_right_trim_shadows, + body_types: [2], + flip: true, + }, + { + position: "chest_variants", + armours: ["Tartaros"], + sprite: spr_tartaros_chest, + shadows: spr_tartaros_chest_shadows, + body_types: [2], + } +]; + function DummyMarine() constructor { static update = function() { delete body; From 93520a7677d16292d12aa9ac7a0191ae994812ef Mon Sep 17 00:00:00 2001 From: carys-the-weed-cloud <36204825+carys-the-weed-cloud@users.noreply.github.com> Date: Tue, 7 Jul 2026 20:40:57 -0400 Subject: [PATCH 6/6] refactor: Enforce enemy existence during combat. --- objects/obj_pnunit/Alarm_0.gml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index a3fdbd7a22..a104570622 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -119,8 +119,6 @@ try { if ((ap == 1) && (once_only == 0)) { // Check for vehicles - var g = 0; - if (enemy.veh > 0) { good = scr_target(enemy, "veh"); // First target has vehicles, blow it to hell scr_shoot(i, enemy, good, "arp", "ranged"); @@ -143,6 +141,10 @@ try { if (good == 0) { ap = 0; } // Fuck it, shoot at infantry + if (!instance_exists(enemy)) { + engaged = false; + continue; + } } if (once_only == 0) { @@ -170,11 +172,14 @@ try { } // Next up is infantry // Was previously ap=1; } + if (!instance_exists(enemy)) { + engaged = false; + continue; + } } if ((ap == 0) && (once_only == 0)) { // Check for men - var g = 0; good = 0; if (enemy.men + enemy.medi > 0) { @@ -196,6 +201,10 @@ try { } } } + if (!instance_exists(enemy)) { + engaged = false; + continue; + } } } else if ((range_shoot == "melee") && ((range[i] == 1) || (range[i] != floor(range[i])))) { // Weapon meets preliminary checks @@ -225,6 +234,10 @@ try { if ((good == 0) && (att[i] > 0)) { ap = 0; } // Fuck it, shoot at infantry + if (!instance_exists(enemy)) { + engaged = false; + continue; + } } if ((enemy.veh == 0) && (enemy.medi > 0) && (once_only == 0)) { @@ -243,6 +256,10 @@ try { if ((good == 0) && (att[i] > 0)) { ap = 0; } // Fuck it, shoot at infantry + if (!instance_exists(enemy)) { + engaged = false; + continue; + } } if ((ap == 0) && (once_only == 0)) { @@ -258,6 +275,10 @@ try { if (good != 0) { once_only = 1; } + if (!instance_exists(enemy)) { + engaged = false; + continue; + } } } }