From 55fec8e05ee32e833597fb3c36dd316dec342db2 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 13:40:31 +1100 Subject: [PATCH 01/41] Create scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 scripts/scr_battle_count/scr_battle_count.gml diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml new file mode 100644 index 0000000000..d1ab692398 --- /dev/null +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -0,0 +1,69 @@ +function scr_battle_count(){ + // Ensure the global variable exists (safety check) + if (!variable_global_exists("enemies_cleared_count")) { + log_error("Global variable 'enemies_cleared_count' not found in check_purge_milestone!"); + exit; // Exit the function if the counter doesn't exist + } + + // Check if the count is positive and a multiple of 5 + if (global.enemies_cleared_count > 0 && (global.enemies_cleared_count mod 2 == 0)) { + + // --- ACTION TO PERFORM EVERY 5 CLEARS --- + + // --- Randomly Choose Flavor Text --- + var _num_options = 5; // <<< SET THIS to the number of text options below + var _text_choice = irandom(_num_options - 1); // Generates a random integer from 0 to (_num_options - 1) + + // Use a switch statement for cleaner selection + switch (_text_choice) { + + case 0: // Option 1 (Influential Ears) + scr_alert("blue", "reward", "Word of your Chapter's tireless defence of the Sector reaches influential ears within the Imperium.", 0, 0); + scr_event_log("INFO", "Imperial Factions note the Chapter's continued effectiveness in purging threats."); + break; + + case 1: // Option 2 (Efficiency Not Unnoticed) + scr_alert("blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0); + scr_event_log("INFO", "Imperial elements acknowledge the Chapter's effectiveness against sector threats."); + break; + + case 2: // Option 3 (Bureaucratic Acknowledgment) + scr_alert("blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0); + scr_event_log("INFO", "Administratum logs successful anti-xenos/heretic operations by the Chapter."); + break; + + case 3: // Option 4 (Faith and Fury) + scr_alert("blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0); + scr_event_log("INFO", "Tales of the Chapter's victories inspire piety and bolster relations with the faithful."); + break; + + case 4: // Option 5 (Simple Effectiveness) + scr_alert("blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0); + scr_event_log("INFO", "Chapter operations demonstrably reduce enemy presence; Imperial factions approve."); + break; + + // Add more cases here if you create more text options + // case 5: + // scr_alert(...); + // scr_event_log(...); + // break; + + default: // Fallback in case something goes wrong + scr_alert("blue", "reward", "Your Chapter continues its duties effectively.", 0, 0); + scr_event_log("INFO", "Chapter effectiveness noted by Imperial factions."); + break; + } + // --- End Flavor Text Selection --- + + + // --- Apply disposition bonuses (without clamping - as requested previously) --- + if (instance_exists(obj_controller)) { + obj_controller.disposition[eFACTION.Mechanicus] += 50; + obj_controller.disposition[eFACTION.Ecclesiarchy] += 50; + obj_controller.disposition[eFACTION.Inquisition] += 50; + } else { + log_error("obj_controller not found in check_purge_milestone!"); + } + // --- END ACTION TO PERFORM --- + } +} From 417e4bdb4c34aab4f12032c23199b2bf81f83cf1 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 13:43:12 +1100 Subject: [PATCH 02/41] Create scr_battle_count.yy --- scripts/scr_battle_count/scr_battle_count.yy | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/scr_battle_count/scr_battle_count.yy diff --git a/scripts/scr_battle_count/scr_battle_count.yy b/scripts/scr_battle_count/scr_battle_count.yy new file mode 100644 index 0000000000..d4b091644b --- /dev/null +++ b/scripts/scr_battle_count/scr_battle_count.yy @@ -0,0 +1,12 @@ + "$GMScript":"v1", + "%Name":"scr_battle_count", + "isCompatibility":false, + "isDnD":false, + "name":"scr_battle_count", + "parent":{ + "name":"Helpers", + "path":"folders/Scripts/Helpers.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} From 25324643aed668485fe84a14cc3a0c203def9f08 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 13:46:44 +1100 Subject: [PATCH 03/41] Update ChapterMaster.yyp --- ChapterMaster.yyp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index f216b6c4ac..a10d26ad00 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -786,6 +786,7 @@ {"id":{"name":"scr_pen_And_paper","path":"scripts/scr_pen_And_paper/scr_pen_And_paper.yy",},}, {"id":{"name":"scr_perils_table","path":"scripts/scr_perils_table/scr_perils_table.yy",},}, {"id":{"name":"scr_planetary_feature","path":"scripts/scr_planetary_feature/scr_planetary_feature.yy",},}, + {"id":{"name":"scr_battle_count","path":"scripts/scr_battle_count/scr_battle_count.yy",},}, {"id":{"name":"scr_PlanetData","path":"scripts/scr_PlanetData/scr_PlanetData.yy",},}, {"id":{"name":"scr_player_combat_weapon_stacks","path":"scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.yy",},}, {"id":{"name":"scr_player_fleet_combat_functions","path":"scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.yy",},}, @@ -1679,4 +1680,4 @@ "TextureGroups":[ {"$GMTextureGroup":"","%Name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","customOptions":"","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"name":"Default","resourceType":"GMTextureGroup","resourceVersion":"2.0","targets":-1,}, ], -} \ No newline at end of file +} From b52591bcca67557322b266338b801c13bae4e147 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 13:50:41 +1100 Subject: [PATCH 04/41] Update Alarm_5.gml --- objects/obj_ncombat/Alarm_5.gml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/objects/obj_ncombat/Alarm_5.gml b/objects/obj_ncombat/Alarm_5.gml index 60b4f8aba2..6220bc8a6a 100644 --- a/objects/obj_ncombat/Alarm_5.gml +++ b/objects/obj_ncombat/Alarm_5.gml @@ -375,6 +375,8 @@ if (defeat=0) and (reduce_power=true){ p_owner[battle_planet] = eFACTION.Imperium } dispo[battle_planet] += 10; + global.enemies_cleared_count += 1; + scr_battle_count(); scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}", x, y); if (dispo[battle_planet] >= 101) then p_owner[battle_planet] = 1; From e7f5175fbf6c209444bb01569df39d482dccb7ed Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 13:54:13 +1100 Subject: [PATCH 05/41] Update scr_enemy_ai_a.gml --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 61 ++++++----------------- 1 file changed, 14 insertions(+), 47 deletions(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index f4a34ae61d..d66332ed85 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -818,57 +818,24 @@ function scr_enemy_ai_a() { // 135; - var planet_saved = ((p_player[_run] + p_raided[_run]) > 0 && p_orks[_run] = 0 && p_tyranids[_run] < 4 && p_chaos[_run] = 0 && p_traitors[_run] = 0 && p_necrons[_run] = 0 && p_tau[_run] = 0); - + var planet_saved = ((p_player[_run] + p_raided[_run]) > 0 && p_orks[_run] == 0 && p_tyranids[_run] < 4 && p_chaos[_run] == 0 && p_traitors[_run] == 0 && p_necrons[_run] == 0 && p_tau[_run] == 0); if (planet_saved){ - var who_cleansed=""; - var who_return=""; - var make_alert = false; - var planet_string = $"{name} {scr_roman(_run)}"; - if (p_owner[_run] = 7) { - who_cleansed="Orks" - make_alert=true; - }else if (p_owner[_run] = 8 && p_pdf[_run] = 0) { - who_cleansed="Tau" - make_alert=true; - }else if (p_owner[_run] = 13) { - who_cleansed="Necrons" - make_alert=true; - }else if (p_owner[_run] = 10) { - who_cleansed="Chaos" - make_alert=true; - } else if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0){ - who_cleansed="Gene Stealer Cult" - make_alert=true; - delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); - adjust_influence(eFACTION.Tyranids, -25, _run); - } - if (make_alert){ - if (p_first[_run] = 1){ - p_owner[_run] = eFACTION.Player; - who_return = "your"; - } else if (p_first[_run] = 3 || p_type[_run]=="Forge"){ - who_return="mechanicus"; - obj_controller.disposition[3] += 10; - p_owner[_run] = eFACTION.Mechanicus - }else if (p_type[_run]!="Dead"){ - who_return="the governor"; - if (who_cleansed=="tau"){ - who_return="a more suitable governer" - } - p_owner[_run] = eFACTION.Imperium; - } - dispo[_run] += 10; - scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); - scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}", x, y); - if (dispo[_run] >= 101) then p_owner[_run] = 1; + var who_cleansed = ""; var who_return = ""; var make_alert = false; var original_owner_before_cleanse = p_owner[_run]; var planet_string = $"{name} {scr_roman(_run)}"; + if (original_owner_before_cleanse == eFACTION.Ork) { who_cleansed="Orks"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Tau && p_pdf[_run] == 0) { who_cleansed="Tau"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Necrons) { who_cleansed="Necrons"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Chaos) { who_cleansed="Chaos"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Tyranids || (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0)){ who_cleansed="Tyranid"; if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult)) { who_cleansed = "Genestealer Cult"; delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); adjust_influence(eFACTION.Tyranids, -25, _run, self); } make_alert=true; } + if (make_alert){ + if (p_first[_run] == eFACTION.Player){ p_owner[_run] = eFACTION.Player; who_return = "your Chapter"; } else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run]=="Forge"){ who_return = "the Adeptus Mechanicus"; obj_controller.disposition[eFACTION.Mechanicus] += 5; p_owner[_run] = eFACTION.Mechanicus; } else if (p_type[_run] != "Dead"){ who_return = "the planetary governor"; if (who_cleansed=="Tau"){ who_return = "a loyal governor"; } var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { if (p_first[_run] == eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Ecclesiarchy; who_return = "the Ecclesiarchy"; } obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; } else { p_owner[_run] = eFACTION.Imperium; } } else { if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Imperium; who_return = "Imperial Administration"; } } + if (who_return != "") { + dispo[_run] = max(-90, min(100, dispo[_run] + 10)); + global.enemies_cleared_count += 1; + scr_battle_count(); + scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); + if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { p_owner[_run] = eFACTION.Player; scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); } + } } - } - if (p_raided[_run] > 0) then p_raided[_run] = 0; - delete _planet_data; - } // end repeat here + + } // quene player battles here From f9e4bc2ab7cee5589ac6cbd0822229be6345a159 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 13:57:24 +1100 Subject: [PATCH 06/41] Update scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index d1ab692398..568ccdf1ba 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -5,10 +5,10 @@ function scr_battle_count(){ exit; // Exit the function if the counter doesn't exist } - // Check if the count is positive and a multiple of 5 - if (global.enemies_cleared_count > 0 && (global.enemies_cleared_count mod 2 == 0)) { + // Check if the count is positive and a multiple of 4 + if (global.enemies_cleared_count > 0 && (global.enemies_cleared_count mod 4 == 0)) { - // --- ACTION TO PERFORM EVERY 5 CLEARS --- + // --- ACTION TO PERFORM EVERY 4 CLEARS --- // --- Randomly Choose Flavor Text --- var _num_options = 5; // <<< SET THIS to the number of text options below @@ -58,9 +58,10 @@ function scr_battle_count(){ // --- Apply disposition bonuses (without clamping - as requested previously) --- if (instance_exists(obj_controller)) { - obj_controller.disposition[eFACTION.Mechanicus] += 50; - obj_controller.disposition[eFACTION.Ecclesiarchy] += 50; - obj_controller.disposition[eFACTION.Inquisition] += 50; + obj_controller.disposition[eFACTION.Imperium] += 8; + obj_controller.disposition[eFACTION.Mechanicus] += 5; + obj_controller.disposition[eFACTION.Ecclesiarchy] += 6; + obj_controller.disposition[eFACTION.Inquisition] += 4; } else { log_error("obj_controller not found in check_purge_milestone!"); } From 7f6ff0d5e8081768bbbc93c13df38028647f89d7 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 14:32:31 +1100 Subject: [PATCH 07/41] Update scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index 568ccdf1ba..dcf0407b9b 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -1,9 +1,4 @@ function scr_battle_count(){ - // Ensure the global variable exists (safety check) - if (!variable_global_exists("enemies_cleared_count")) { - log_error("Global variable 'enemies_cleared_count' not found in check_purge_milestone!"); - exit; // Exit the function if the counter doesn't exist - } // Check if the count is positive and a multiple of 4 if (global.enemies_cleared_count > 0 && (global.enemies_cleared_count mod 4 == 0)) { @@ -56,7 +51,7 @@ function scr_battle_count(){ // --- End Flavor Text Selection --- - // --- Apply disposition bonuses (without clamping - as requested previously) --- + // --- Apply disposition bonuses if (instance_exists(obj_controller)) { obj_controller.disposition[eFACTION.Imperium] += 8; obj_controller.disposition[eFACTION.Mechanicus] += 5; From d93abb20f092a17c31d82bbc6464cc768195a361 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 14:39:14 +1100 Subject: [PATCH 08/41] Update scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index dcf0407b9b..ba057c285f 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -50,16 +50,11 @@ function scr_battle_count(){ } // --- End Flavor Text Selection --- - // --- Apply disposition bonuses - if (instance_exists(obj_controller)) { obj_controller.disposition[eFACTION.Imperium] += 8; obj_controller.disposition[eFACTION.Mechanicus] += 5; obj_controller.disposition[eFACTION.Ecclesiarchy] += 6; obj_controller.disposition[eFACTION.Inquisition] += 4; - } else { - log_error("obj_controller not found in check_purge_milestone!"); - } // --- END ACTION TO PERFORM --- } } From fb552697f85fa4edec9f50396da9c84fbb2e7279 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 14:42:39 +1100 Subject: [PATCH 09/41] Update scr_enemy_ai_a.gml --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index d66332ed85..3be63fa34f 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -821,15 +821,25 @@ function scr_enemy_ai_a() { var planet_saved = ((p_player[_run] + p_raided[_run]) > 0 && p_orks[_run] == 0 && p_tyranids[_run] < 4 && p_chaos[_run] == 0 && p_traitors[_run] == 0 && p_necrons[_run] == 0 && p_tau[_run] == 0); if (planet_saved){ var who_cleansed = ""; var who_return = ""; var make_alert = false; var original_owner_before_cleanse = p_owner[_run]; var planet_string = $"{name} {scr_roman(_run)}"; - if (original_owner_before_cleanse == eFACTION.Ork) { who_cleansed="Orks"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Tau && p_pdf[_run] == 0) { who_cleansed="Tau"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Necrons) { who_cleansed="Necrons"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Chaos) { who_cleansed="Chaos"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Tyranids || (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0)){ who_cleansed="Tyranid"; if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult)) { who_cleansed = "Genestealer Cult"; delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); adjust_influence(eFACTION.Tyranids, -25, _run, self); } make_alert=true; } + if (original_owner_before_cleanse == eFACTION.Ork) { who_cleansed="Orks"; make_alert=true; } + else if (original_owner_before_cleanse == eFACTION.Tau && p_pdf[_run] == 0) { who_cleansed="Tau"; make_alert=true; } + else if (original_owner_before_cleanse == eFACTION.Necrons) { who_cleansed="Necrons"; make_alert=true; } + else if (original_owner_before_cleanse == eFACTION.Chaos) { who_cleansed="Chaos"; make_alert=true; } + else if (original_owner_before_cleanse == eFACTION.Tyranids || (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0)){ + who_cleansed="Tyranid"; + if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult)) { who_cleansed = "Genestealer Cult"; delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); + adjust_influence(eFACTION.Tyranids, -25, _run, self); } + make_alert=true; } if (make_alert){ - if (p_first[_run] == eFACTION.Player){ p_owner[_run] = eFACTION.Player; who_return = "your Chapter"; } else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run]=="Forge"){ who_return = "the Adeptus Mechanicus"; obj_controller.disposition[eFACTION.Mechanicus] += 5; p_owner[_run] = eFACTION.Mechanicus; } else if (p_type[_run] != "Dead"){ who_return = "the planetary governor"; if (who_cleansed=="Tau"){ who_return = "a loyal governor"; } var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { if (p_first[_run] == eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Ecclesiarchy; who_return = "the Ecclesiarchy"; } obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; } else { p_owner[_run] = eFACTION.Imperium; } } else { if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Imperium; who_return = "Imperial Administration"; } } - if (who_return != "") { - dispo[_run] = max(-90, min(100, dispo[_run] + 10)); - global.enemies_cleared_count += 1; - scr_battle_count(); - scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); - if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { p_owner[_run] = eFACTION.Player; scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); } + if (p_first[_run] == eFACTION.Player){ p_owner[_run] = eFACTION.Player; who_return = "your Chapter"; } else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run]=="Forge"){ who_return = "the Adeptus Mechanicus"; obj_controller.disposition[eFACTION.Mechanicus] += 5; p_owner[_run] = eFACTION.Mechanicus; } else if (p_type[_run] != "Dead"){ who_return = "the planetary governor"; if (who_cleansed=="Tau"){ who_return = "a loyal governor"; } var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { if (p_first[_run] == eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Ecclesiarchy; who_return = "the Ecclesiarchy"; } obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; } else { p_owner[_run] = eFACTION.Imperium; } } else { if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Imperium; who_return = "Imperial Administration"; } } + if (who_return != "") { + dispo[_run] = max(-90, min(100, dispo[_run] + 10)); + global.enemies_cleared_count += 1; + scr_battle_count(); + scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); + scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); + if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { p_owner[_run] = eFACTION.Player; + scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); } } } } From a233b7dffd9e89672086e13313d2266681dffb33 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 14:47:26 +1100 Subject: [PATCH 10/41] Update scr_enemy_ai_a.gml --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index 3be63fa34f..08990e4b41 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -831,7 +831,16 @@ function scr_enemy_ai_a() { adjust_influence(eFACTION.Tyranids, -25, _run, self); } make_alert=true; } if (make_alert){ - if (p_first[_run] == eFACTION.Player){ p_owner[_run] = eFACTION.Player; who_return = "your Chapter"; } else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run]=="Forge"){ who_return = "the Adeptus Mechanicus"; obj_controller.disposition[eFACTION.Mechanicus] += 5; p_owner[_run] = eFACTION.Mechanicus; } else if (p_type[_run] != "Dead"){ who_return = "the planetary governor"; if (who_cleansed=="Tau"){ who_return = "a loyal governor"; } var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { if (p_first[_run] == eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Ecclesiarchy; who_return = "the Ecclesiarchy"; } obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; } else { p_owner[_run] = eFACTION.Imperium; } } else { if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Imperium; who_return = "Imperial Administration"; } } + if (p_first[_run] == eFACTION.Player){ p_owner[_run] = eFACTION.Player; who_return = "your Chapter"; } + else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run]=="Forge"){ who_return = "the Adeptus Mechanicus"; obj_controller.disposition[eFACTION.Mechanicus] += 5; + p_owner[_run] = eFACTION.Mechanicus; } + else if (p_type[_run] != "Dead"){ who_return = "the planetary governor"; if (who_cleansed=="Tau"){ who_return = "a loyal governor"; } + var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); + if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { if (p_first[_run] == eFACTION.Ecclesiarchy) { + p_owner[_run] = eFACTION.Ecclesiarchy; who_return = "the Ecclesiarchy"; } obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; } + else { p_owner[_run] = eFACTION.Imperium; } } + else { if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { + p_owner[_run] = eFACTION.Imperium; who_return = "Imperial Administration"; } } if (who_return != "") { dispo[_run] = max(-90, min(100, dispo[_run] + 10)); global.enemies_cleared_count += 1; From 03d457398135d89e397012797b221f6da0db4d5a Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 14:50:36 +1100 Subject: [PATCH 11/41] Update scr_enemy_ai_a.gml --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 163 +++++++++++++++++----- 1 file changed, 128 insertions(+), 35 deletions(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index 08990e4b41..7c6c4ba525 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -818,44 +818,137 @@ function scr_enemy_ai_a() { // 135; - var planet_saved = ((p_player[_run] + p_raided[_run]) > 0 && p_orks[_run] == 0 && p_tyranids[_run] < 4 && p_chaos[_run] == 0 && p_traitors[_run] == 0 && p_necrons[_run] == 0 && p_tau[_run] == 0); - if (planet_saved){ - var who_cleansed = ""; var who_return = ""; var make_alert = false; var original_owner_before_cleanse = p_owner[_run]; var planet_string = $"{name} {scr_roman(_run)}"; - if (original_owner_before_cleanse == eFACTION.Ork) { who_cleansed="Orks"; make_alert=true; } - else if (original_owner_before_cleanse == eFACTION.Tau && p_pdf[_run] == 0) { who_cleansed="Tau"; make_alert=true; } - else if (original_owner_before_cleanse == eFACTION.Necrons) { who_cleansed="Necrons"; make_alert=true; } - else if (original_owner_before_cleanse == eFACTION.Chaos) { who_cleansed="Chaos"; make_alert=true; } - else if (original_owner_before_cleanse == eFACTION.Tyranids || (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0)){ - who_cleansed="Tyranid"; - if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult)) { who_cleansed = "Genestealer Cult"; delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); - adjust_influence(eFACTION.Tyranids, -25, _run, self); } - make_alert=true; } - if (make_alert){ - if (p_first[_run] == eFACTION.Player){ p_owner[_run] = eFACTION.Player; who_return = "your Chapter"; } - else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run]=="Forge"){ who_return = "the Adeptus Mechanicus"; obj_controller.disposition[eFACTION.Mechanicus] += 5; - p_owner[_run] = eFACTION.Mechanicus; } - else if (p_type[_run] != "Dead"){ who_return = "the planetary governor"; if (who_cleansed=="Tau"){ who_return = "a loyal governor"; } - var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); - if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { if (p_first[_run] == eFACTION.Ecclesiarchy) { - p_owner[_run] = eFACTION.Ecclesiarchy; who_return = "the Ecclesiarchy"; } obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; } - else { p_owner[_run] = eFACTION.Imperium; } } - else { if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { - p_owner[_run] = eFACTION.Imperium; who_return = "Imperial Administration"; } } - if (who_return != "") { - dispo[_run] = max(-90, min(100, dispo[_run] + 10)); - global.enemies_cleared_count += 1; - scr_battle_count(); - scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); - scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); - if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { p_owner[_run] = eFACTION.Player; - scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); } +// Determine if the planet qualifies as "saved" this turn. +// Conditions: Player forces must be present (or raided flag is set), AND +// all major non-Imperial ground threats (Orks, significant Tyranids, Chaos forces, Necrons, Tau) are eliminated. +var planet_saved = ( + (p_player[_run] + p_raided[_run]) > 0 && // Player involved or planet was raided + p_orks[_run] == 0 && // No Orks + p_tyranids[_run] < 4 && // Tyranids below significant infestation level + p_chaos[_run] == 0 && // No Chaos Space Marines / Daemons + p_traitors[_run] == 0 && // No Heretics / Traitors + p_necrons[_run] == 0 && // No Necrons + p_tau[_run] == 0 // No Tau ground forces +); + +// --- Apply Effects if Planet Was Saved --- +if (planet_saved) { + // --- Initialize variables for this saved planet --- + var who_cleansed = ""; // String: Describes the primary enemy cleansed + var who_return = ""; // String: Describes who regains control of the planet + var make_alert = false; // Boolean: Flag to trigger alerts and apply bonuses + var original_owner_before_cleanse = p_owner[_run]; // Store owner ID before potential changes + var planet_string = $"{name} {scr_roman(_run)}"; // Formatted planet name (e.g., "SystemName II") + + // --- Determine which enemy faction was primarily defeated --- + // This logic primarily uses the owner just before cleansing as the indicator. + if (original_owner_before_cleanse == eFACTION.Ork) { + who_cleansed = "Orks"; + make_alert = true; + } + else if (original_owner_before_cleanse == eFACTION.Tau && p_pdf[_run] == 0) { // Special case: Tau considered cleansed only if their PDF is also gone? + who_cleansed = "Tau"; + make_alert = true; + } + else if (original_owner_before_cleanse == eFACTION.Necrons) { + who_cleansed = "Necrons"; + make_alert = true; + } + else if (original_owner_before_cleanse == eFACTION.Chaos) { + who_cleansed = "Chaos"; // Includes CSM, Daemons, possibly Traitors if owner flipped + make_alert = true; + } + // Check Tyranids/GSC based on previous owner OR if GSC feature was present and Nids are now low + else if (original_owner_before_cleanse == eFACTION.Tyranids || + (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0)) + { + who_cleansed = "Tyranid"; // Generic term initially + + // Check specifically if a Genestealer Cult feature was present + if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult)) { + who_cleansed = "Genestealer Cult"; // More specific name + delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); // Remove the cult feature + adjust_influence(eFACTION.Tyranids, -25, _run, self); // Reduce residual Tyranid influence (pass 'self' for star context) + } + make_alert = true; // Trigger alert for Tyranids or GSC + } + + // --- Apply effects ONLY if an enemy was confirmed cleansed --- + if (make_alert) { + + // --- Determine who gets control back based on original owner (p_first) --- + if (p_first[_run] == eFACTION.Player) { // If originally Player owned + p_owner[_run] = eFACTION.Player; + who_return = "your Chapter"; + } + else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run] == "Forge") { // If originally Mechanicus or a Forge World + who_return = "the Adeptus Mechanicus"; + obj_controller.disposition[eFACTION.Mechanicus] += 5; // FACTION disposition bonus + p_owner[_run] = eFACTION.Mechanicus; + } + else if (p_type[_run] != "Dead") { // If originally Imperial or other non-specific (and not dead) + who_return = "the planetary governor"; // Default return description + if (who_cleansed == "Tau") { who_return = "a loyal governor"; } // Special description for Tau cleanse + + // Check if Sisters should get control or bonus + var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); + if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { + // If originally Ecclesiarchy, give them control back + if (p_first[_run] == eFACTION.Ecclesiarchy) { + p_owner[_run] = eFACTION.Ecclesiarchy; + who_return = "the Ecclesiarchy"; } - } - } - if (p_raided[_run] > 0) then p_raided[_run] = 0; + // Always give faction bonus if it was their original world OR a holy site + obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; // FACTION disposition bonus + } + else { // If not originally Ecclesiarchy and not a holy site, defaults to Imperium + p_owner[_run] = eFACTION.Imperium; + } + } + else { // If it's a dead world reverting + // If original owner wasn't Player/Mech/Eccl, default ownership to Imperium + if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { + p_owner[_run] = eFACTION.Imperium; + who_return = "Imperial Administration"; // Generic term for dead world + } + // Otherwise, it implies Player/Mech/Eccl originally owned the dead world, + // so the p_owner should have been set correctly by the p_first check earlier. + } - } + // --- Apply Generic Bonuses/Alerts if control returned meaningfully --- + if (who_return != "") { + + // 1. Increase LOCAL governor disposition (capped) + dispo[_run] = max(-90, min(100, dispo[_run] + 10)); + + // 2. Increment GLOBAL counter for enemies cleared + // Ensure global variable is initialized at game start! + if (!variable_global_exists("enemies_cleared_count")) global.enemies_cleared_count = 0; + global.enemies_cleared_count += 1; + + // 3. Check for purge milestone (calls the function that handles the every-5-clears bonus) + scr_battle_count(); // Renamed from check_purge_milestone in user's pasted code + + // 4. Log the cleanse event + scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); // Keep original log type? Use "INFO" or "SUCCESS"? + + // 5. Create a screen alert message + scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); + + // 6. Check if high local disposition flips the planet to player control + if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { + p_owner[_run] = eFACTION.Player; + scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); + } + } // End if (who_return != "") + } // End if (make_alert) +} // End if (planet_saved) + +// Reset raided flag if it was set for this planet +if (p_raided[_run] > 0) then p_raided[_run] = 0; +// IMPORTANT: Delete the PlanetData struct if it was used in this loop iteration +// delete _planet_data; // This line should be present if _planet_data was created // quene player battles here From c5411af7c1dbc9cb8edaa3a4911dcff00dc81fae Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 15:45:44 +1100 Subject: [PATCH 12/41] Update Alarm_5.gml --- objects/obj_ncombat/Alarm_5.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/objects/obj_ncombat/Alarm_5.gml b/objects/obj_ncombat/Alarm_5.gml index 6220bc8a6a..34c4fcc4eb 100644 --- a/objects/obj_ncombat/Alarm_5.gml +++ b/objects/obj_ncombat/Alarm_5.gml @@ -375,7 +375,7 @@ if (defeat=0) and (reduce_power=true){ p_owner[battle_planet] = eFACTION.Imperium } dispo[battle_planet] += 10; - global.enemies_cleared_count += 1; + obj_controller.enemies_cleared_count += 1; scr_battle_count(); scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}", x, y); From 8c3235829e0f46284e2baa2a02ebc726c720fb42 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 15:46:58 +1100 Subject: [PATCH 13/41] Update scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index ba057c285f..d99be292f1 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -1,7 +1,7 @@ function scr_battle_count(){ // Check if the count is positive and a multiple of 4 - if (global.enemies_cleared_count > 0 && (global.enemies_cleared_count mod 4 == 0)) { + if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count mod 4 == 0)) { // --- ACTION TO PERFORM EVERY 4 CLEARS --- From f6c12287d8fe89d9e11afb6bb2070e0d5885327e Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 15:49:27 +1100 Subject: [PATCH 14/41] Update scr_enemy_ai_a.gml --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index 7c6c4ba525..b4cf430a42 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -922,15 +922,13 @@ if (planet_saved) { dispo[_run] = max(-90, min(100, dispo[_run] + 10)); // 2. Increment GLOBAL counter for enemies cleared - // Ensure global variable is initialized at game start! - if (!variable_global_exists("enemies_cleared_count")) global.enemies_cleared_count = 0; - global.enemies_cleared_count += 1; + obj_controller.enemies_cleared_count += 1; - // 3. Check for purge milestone (calls the function that handles the every-5-clears bonus) - scr_battle_count(); // Renamed from check_purge_milestone in user's pasted code + (calls the function that handles the every-4-clears bonus) + scr_battle_count(); // 4. Log the cleanse event - scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); // Keep original log type? Use "INFO" or "SUCCESS"? + scr_event_log("INFO", $"{who_cleansed} cleansed from {planet_string}", name); // Keep original log type? Use "INFO" or "SUCCESS"? // 5. Create a screen alert message scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); From d48bb6ab5796c565c9b81c20307d21b817933359 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 15:50:41 +1100 Subject: [PATCH 15/41] Update Create_0.gml --- objects/obj_controller/Create_0.gml | 1 + 1 file changed, 1 insertion(+) diff --git a/objects/obj_controller/Create_0.gml b/objects/obj_controller/Create_0.gml index 8d01453e58..6f3c51b865 100644 --- a/objects/obj_controller/Create_0.gml +++ b/objects/obj_controller/Create_0.gml @@ -180,6 +180,7 @@ obj_controller.restart_strength=0; obj_controller.restart_cooperation=0; obj_controller.restart_purity=0; obj_controller.restart_stability=0; +obj_controller.enemies_cleared_count = 0; // ** Sets default equipement for roles ** // 100 is defaults, 101 is the allowable starting equipment From c4f1acb799fb0bbe27a2d357ef923613660f9a12 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 15:52:20 +1100 Subject: [PATCH 16/41] Update scr_load_controller.gml --- scripts/scr_load_controller/scr_load_controller.gml | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/scr_load_controller/scr_load_controller.gml b/scripts/scr_load_controller/scr_load_controller.gml index d4b8c599b0..0a2f0bb692 100644 --- a/scripts/scr_load_controller/scr_load_controller.gml +++ b/scripts/scr_load_controller/scr_load_controller.gml @@ -487,6 +487,7 @@ function scr_load_controller(save_id){ obj_ini.progenitor_disposition=ini_read_real("Controller","progenitor_disposition",0); obj_ini.imperium_disposition=ini_read_real("Controller","imperium_disposition",0); obj_controller.astartes_disposition=ini_read_real("Controller","astartes_disposition",0); + obj_controller.enemies_cleared_count = ini_read_real("Controller", "enemies_cleared_count", 0); obj_controller.bat_devastator_column=ini_read_real("Controller","bat_devastator_column",1); obj_controller.bat_assault_column=ini_read_real("Controller","bat_assault_column",4); From fbde5da7a94708a70d24ec87f631d28f3a994332 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 15:52:54 +1100 Subject: [PATCH 17/41] Update scr_save_controller.gml --- scripts/scr_save_controller/scr_save_controller.gml | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/scr_save_controller/scr_save_controller.gml b/scripts/scr_save_controller/scr_save_controller.gml index a231b1907c..9118ba7f75 100644 --- a/scripts/scr_save_controller/scr_save_controller.gml +++ b/scripts/scr_save_controller/scr_save_controller.gml @@ -10,6 +10,7 @@ function scr_save_controller(save_id){ ini_write_real("Save","play_time",play_time); ini_write_real("Save","game_seed",global.game_seed); ini_write_real("Save","use_custom_icon",obj_ini.use_custom_icon); + ini_write_real("Controller", "enemies_cleared_count", obj_controller.enemies_cleared_count); var t=date_current_datetime(); var month=date_get_month(t); From 80c2456e7e4ed76e1d0fe6f79d506c4e34fa9d4e Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 18:56:22 +1100 Subject: [PATCH 18/41] Update scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Мастер Чиф <43174917+MCPO-Spartan-117@users.noreply.github.com> --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index b4cf430a42..e9c1051d69 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -919,7 +919,7 @@ if (planet_saved) { if (who_return != "") { // 1. Increase LOCAL governor disposition (capped) - dispo[_run] = max(-90, min(100, dispo[_run] + 10)); + dispo[_run] = clamp(dispo[_run] + 10, -90, 100); // 2. Increment GLOBAL counter for enemies cleared obj_controller.enemies_cleared_count += 1; From 605af3c3241135be713157d2e3da324caffed5fa Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Thu, 27 Mar 2025 18:56:35 +1100 Subject: [PATCH 19/41] Update scripts/scr_battle_count/scr_battle_count.gml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Мастер Чиф <43174917+MCPO-Spartan-117@users.noreply.github.com> --- scripts/scr_battle_count/scr_battle_count.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index d99be292f1..3fcf806df3 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -13,8 +13,8 @@ function scr_battle_count(){ switch (_text_choice) { case 0: // Option 1 (Influential Ears) - scr_alert("blue", "reward", "Word of your Chapter's tireless defence of the Sector reaches influential ears within the Imperium.", 0, 0); - scr_event_log("INFO", "Imperial Factions note the Chapter's continued effectiveness in purging threats."); + scr_alert("c_blue", "reward", "Word of your Chapter's tireless defence of the Sector reaches influential ears within the Imperium."); + scr_event_log("c_blue", "Imperial Factions note the Chapter's continued effectiveness in purging threats."); break; case 1: // Option 2 (Efficiency Not Unnoticed) From ff1bab5566dd341d725ae312380f24045c4fc07c Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Fri, 28 Mar 2025 13:49:17 +1100 Subject: [PATCH 20/41] Update scripts/scr_battle_count/scr_battle_count.gml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Мастер Чиф <43174917+MCPO-Spartan-117@users.noreply.github.com> --- scripts/scr_battle_count/scr_battle_count.gml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index 3fcf806df3..a48a639771 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -51,10 +51,11 @@ function scr_battle_count(){ // --- End Flavor Text Selection --- // --- Apply disposition bonuses - obj_controller.disposition[eFACTION.Imperium] += 8; - obj_controller.disposition[eFACTION.Mechanicus] += 5; - obj_controller.disposition[eFACTION.Ecclesiarchy] += 6; - obj_controller.disposition[eFACTION.Inquisition] += 4; + #macro FACT_DISPO obj_controller.disposition + FACT_DISPO[eFACTION.Imperium] = clamp(FACT_DISPO[eFACTION.Imperium] + 8, -92, 100); + FACT_DISPO[eFACTION.Mechanicus] = clamp(FACT_DISPO[eFACTION.Mechanicus] + 5, -95, 100); + FACT_DISPO[eFACTION.Ecclesiarchy] = clamp(FACT_DISPO[eFACTION.Ecclesiarchy] + 6, -94, 100); + FACT_DISPO[eFACTION.Inquisition] = clamp(FACT_DISPO[eFACTION.Inquisition] + 4, -96, 100); // --- END ACTION TO PERFORM --- } } From 272942073e8cf269bfd2d4bd9b91b6aee0e98624 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Fri, 28 Mar 2025 13:53:33 +1100 Subject: [PATCH 21/41] Update scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index a48a639771..0a90578829 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -1,7 +1,7 @@ function scr_battle_count(){ // Check if the count is positive and a multiple of 4 - if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count mod 4 == 0)) { + if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count%4 == 0)) { // --- ACTION TO PERFORM EVERY 4 CLEARS --- From 05d18eb8c8cc5792419dd818bc60c70b4cf72081 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Fri, 28 Mar 2025 13:54:12 +1100 Subject: [PATCH 22/41] Update scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index 0a90578829..8e3d5ac815 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -1,9 +1,9 @@ function scr_battle_count(){ // Check if the count is positive and a multiple of 4 - if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count%4 == 0)) { + if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count%6 == 0)) { - // --- ACTION TO PERFORM EVERY 4 CLEARS --- + // --- ACTION TO PERFORM EVERY 6 CLEARS --- // --- Randomly Choose Flavor Text --- var _num_options = 5; // <<< SET THIS to the number of text options below From b6c7cd0827c1d5d3eabd6cb9fb950d8dff1a6e17 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Fri, 28 Mar 2025 13:55:21 +1100 Subject: [PATCH 23/41] Update scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index 8e3d5ac815..e9020e1111 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -1,6 +1,6 @@ function scr_battle_count(){ - // Check if the count is positive and a multiple of 4 + // Check if the count is positive and a multiple of 6 if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count%6 == 0)) { // --- ACTION TO PERFORM EVERY 6 CLEARS --- From 00e0d51379e226c8007f39dc8943c003cd3d06b8 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Fri, 28 Mar 2025 14:16:22 +1100 Subject: [PATCH 24/41] Update scripts/scr_battle_count/scr_battle_count.gml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- scripts/scr_battle_count/scr_battle_count.gml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index e9020e1111..b52b43fd55 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -18,22 +18,26 @@ function scr_battle_count(){ break; case 1: // Option 2 (Efficiency Not Unnoticed) - scr_alert("blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0); +- scr_alert("blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0); ++ scr_alert("c_blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0); scr_event_log("INFO", "Imperial elements acknowledge the Chapter's effectiveness against sector threats."); break; case 2: // Option 3 (Bureaucratic Acknowledgment) - scr_alert("blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0); +- scr_alert("blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0); ++ scr_alert("c_blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0); scr_event_log("INFO", "Administratum logs successful anti-xenos/heretic operations by the Chapter."); break; case 3: // Option 4 (Faith and Fury) - scr_alert("blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0); +- scr_alert("blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0); ++ scr_alert("c_blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0); scr_event_log("INFO", "Tales of the Chapter's victories inspire piety and bolster relations with the faithful."); break; case 4: // Option 5 (Simple Effectiveness) - scr_alert("blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0); +- scr_alert("blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0); ++ scr_alert("c_blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0); scr_event_log("INFO", "Chapter operations demonstrably reduce enemy presence; Imperial factions approve."); break; @@ -44,7 +48,8 @@ function scr_battle_count(){ // break; default: // Fallback in case something goes wrong - scr_alert("blue", "reward", "Your Chapter continues its duties effectively.", 0, 0); +- scr_alert("blue", "reward", "Your Chapter continues its duties effectively.", 0, 0); ++ scr_alert("c_blue", "reward", "Your Chapter continues its duties effectively.", 0, 0); scr_event_log("INFO", "Chapter effectiveness noted by Imperial factions."); break; } From 85bf01a2ec6b68cef0d58c12cff73948892eab6f Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Fri, 28 Mar 2025 14:17:26 +1100 Subject: [PATCH 25/41] Update scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index e9c1051d69..8cfd11de58 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -946,7 +946,7 @@ if (planet_saved) { if (p_raided[_run] > 0) then p_raided[_run] = 0; // IMPORTANT: Delete the PlanetData struct if it was used in this loop iteration -// delete _planet_data; // This line should be present if _planet_data was created +delete _planet_data; // Return allocated memory to the Omnissiah // quene player battles here From 18793de26ef4ac087b43d4ee41d7bf4393b70239 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Fri, 28 Mar 2025 23:06:02 +1100 Subject: [PATCH 26/41] fix: failed to check demonworlds as hostile --- scripts/scr_destroy_planet/scr_destroy_planet.gml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/scr_destroy_planet/scr_destroy_planet.gml b/scripts/scr_destroy_planet/scr_destroy_planet.gml index a49965c680..10314170a5 100644 --- a/scripts/scr_destroy_planet/scr_destroy_planet.gml +++ b/scripts/scr_destroy_planet/scr_destroy_planet.gml @@ -79,8 +79,9 @@ function scr_destroy_planet(destruction_method) { // Relation penalties here, if applicable if (you.p_type[baid]="Daemon"){ + obj_controller.disposition[2]+=5; + obj_controller.disposition[3]+=5; obj_controller.disposition[4]+=5; - obj_controller.disposition[5]+=5; var o=0; if (scr_has_adv("Reverent Guardians")) then o=500; @@ -93,7 +94,7 @@ function scr_destroy_planet(destruction_method) { } //TODO a shitload of helper functions to make this sort of stuff easier - if ((you.p_owner[baid]=3) or (you.p_first[baid]=3)) and (obj_controller.faction_status[eFACTION.Mechanicus]!="War"){ + if ((you.p_owner[baid]=3) or (you.p_first[baid]=3)) and (obj_controller.faction_status[eFACTION.Mechanicus]!="War") and (you.p_type[baid]!="Daemon"){ obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=50; @@ -130,7 +131,7 @@ function scr_destroy_planet(destruction_method) { } } - if (enemy9=5) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]!="War"){ + if (enemy9=5) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]!="War") and you.p_type[baid]!="Daemon" { obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=50; @@ -158,7 +159,7 @@ function scr_destroy_planet(destruction_method) { if (you.p_tyranids[baid]<5){ - if (you.p_first[baid]=2) and (you.p_type[baid]="Hive") and (planet_feature_bool(you.p_feature[baid], P_features.Daemonic_Incursion)==0) and (obj_controller.faction_status[eFACTION.Imperium]!="War"){ + if (you.p_first[baid]=2) and (you.p_type[baid]="Hive") and (you.p_type[baid]!="Daemon") and (obj_controller.faction_status[eFACTION.Imperium]!="War"){ obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=60; @@ -189,7 +190,7 @@ function scr_destroy_planet(destruction_method) { if (planet_feature_bool(you.p_feature[baid], P_features.Sororitas_Cathedral)==1) then obj_controller.disposition[5]-=30; } - if (you.p_owner[baid]=2) and ((you.p_type[baid]="Temperate") or (you.p_type[baid]="Temperate")) and (planet_feature_bool(you.p_feature[baid], P_features.Daemonic_Incursion)==0){ + if (you.p_owner[baid]=2) and ((you.p_type[baid]="Temperate") or (you.p_type[baid]="Temperate")) and (you.p_type[baid]!="Daemon"){ obj_controller.loyalty-=30; obj_controller.loyalty_hidden-=30; obj_controller.disposition[eFACTION.Imperium]-=30; From 43123958d6151e51e8ad5328b2d4fca2a1453dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Fri, 28 Mar 2025 11:41:24 -0400 Subject: [PATCH 27/41] fix: scr_battle_count metadata --- scripts/scr_battle_count/scr_battle_count.yy | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/scr_battle_count/scr_battle_count.yy b/scripts/scr_battle_count/scr_battle_count.yy index d4b091644b..d2d9bd1f6d 100644 --- a/scripts/scr_battle_count/scr_battle_count.yy +++ b/scripts/scr_battle_count/scr_battle_count.yy @@ -1,3 +1,4 @@ +{ "$GMScript":"v1", "%Name":"scr_battle_count", "isCompatibility":false, From b300e25486fbeb7b87e43569b9a946d07a29b087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Fri, 28 Mar 2025 11:58:43 -0400 Subject: [PATCH 28/41] fix: Proper comment --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index 8cfd11de58..d57c72f073 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -924,7 +924,7 @@ if (planet_saved) { // 2. Increment GLOBAL counter for enemies cleared obj_controller.enemies_cleared_count += 1; - (calls the function that handles the every-4-clears bonus) + // 3. calls the function that handles the every-4-clears bonus scr_battle_count(); // 4. Log the cleanse event From 01aaa7aba6a977f3df6bd40f94a2151e01d09ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Fri, 28 Mar 2025 12:13:42 -0400 Subject: [PATCH 29/41] fix: Remove diff symbols from bot --- scripts/scr_battle_count/scr_battle_count.gml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index b52b43fd55..87b8344557 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -18,26 +18,22 @@ function scr_battle_count(){ break; case 1: // Option 2 (Efficiency Not Unnoticed) -- scr_alert("blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0); -+ scr_alert("c_blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0); + scr_alert("c_blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0); scr_event_log("INFO", "Imperial elements acknowledge the Chapter's effectiveness against sector threats."); break; case 2: // Option 3 (Bureaucratic Acknowledgment) -- scr_alert("blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0); -+ scr_alert("c_blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0); + scr_alert("c_blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0); scr_event_log("INFO", "Administratum logs successful anti-xenos/heretic operations by the Chapter."); break; case 3: // Option 4 (Faith and Fury) -- scr_alert("blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0); -+ scr_alert("c_blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0); + scr_alert("c_blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0); scr_event_log("INFO", "Tales of the Chapter's victories inspire piety and bolster relations with the faithful."); break; case 4: // Option 5 (Simple Effectiveness) -- scr_alert("blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0); -+ scr_alert("c_blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0); + scr_alert("c_blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0); scr_event_log("INFO", "Chapter operations demonstrably reduce enemy presence; Imperial factions approve."); break; @@ -48,8 +44,7 @@ function scr_battle_count(){ // break; default: // Fallback in case something goes wrong -- scr_alert("blue", "reward", "Your Chapter continues its duties effectively.", 0, 0); -+ scr_alert("c_blue", "reward", "Your Chapter continues its duties effectively.", 0, 0); + scr_alert("c_blue", "reward", "Your Chapter continues its duties effectively.", 0, 0); scr_event_log("INFO", "Chapter effectiveness noted by Imperial factions."); break; } From 25b40e87c4e348d6940f598af49785d641558e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Fri, 28 Mar 2025 12:16:53 -0400 Subject: [PATCH 30/41] fix: Format and fix for loop --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 217 +++++++++++----------- 1 file changed, 104 insertions(+), 113 deletions(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index d57c72f073..9fbd9cd3ca 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -818,135 +818,126 @@ function scr_enemy_ai_a() { // 135; -// Determine if the planet qualifies as "saved" this turn. -// Conditions: Player forces must be present (or raided flag is set), AND -// all major non-Imperial ground threats (Orks, significant Tyranids, Chaos forces, Necrons, Tau) are eliminated. -var planet_saved = ( - (p_player[_run] + p_raided[_run]) > 0 && // Player involved or planet was raided - p_orks[_run] == 0 && // No Orks - p_tyranids[_run] < 4 && // Tyranids below significant infestation level - p_chaos[_run] == 0 && // No Chaos Space Marines / Daemons - p_traitors[_run] == 0 && // No Heretics / Traitors - p_necrons[_run] == 0 && // No Necrons - p_tau[_run] == 0 // No Tau ground forces -); + // Determine if the planet qualifies as "saved" this turn. + // Conditions: Player forces must be present (or raided flag is set), AND + // all major non-Imperial ground threats (Orks, significant Tyranids, Chaos forces, Necrons, Tau) are eliminated. + var planet_saved = ( + (p_player[_run] + p_raided[_run]) > 0 && // Player involved or planet was raided + p_orks[_run] == 0 && // No Orks + p_tyranids[_run] < 4 && // Tyranids below significant infestation level + p_chaos[_run] == 0 && // No Chaos Space Marines / Daemons + p_traitors[_run] == 0 && // No Heretics / Traitors + p_necrons[_run] == 0 && // No Necrons + p_tau[_run] == 0 // No Tau ground forces + ); -// --- Apply Effects if Planet Was Saved --- -if (planet_saved) { - // --- Initialize variables for this saved planet --- - var who_cleansed = ""; // String: Describes the primary enemy cleansed - var who_return = ""; // String: Describes who regains control of the planet - var make_alert = false; // Boolean: Flag to trigger alerts and apply bonuses - var original_owner_before_cleanse = p_owner[_run]; // Store owner ID before potential changes - var planet_string = $"{name} {scr_roman(_run)}"; // Formatted planet name (e.g., "SystemName II") + // --- Apply Effects if Planet Was Saved --- + if (planet_saved) { + // --- Initialize variables for this saved planet --- + var who_cleansed = ""; // String: Describes the primary enemy cleansed + var who_return = ""; // String: Describes who regains control of the planet + var make_alert = false; // Boolean: Flag to trigger alerts and apply bonuses + var original_owner_before_cleanse = p_owner[_run]; // Store owner ID before potential changes + var planet_string = $"{name} {scr_roman(_run)}"; // Formatted planet name (e.g., "SystemName II") - // --- Determine which enemy faction was primarily defeated --- - // This logic primarily uses the owner just before cleansing as the indicator. - if (original_owner_before_cleanse == eFACTION.Ork) { - who_cleansed = "Orks"; - make_alert = true; - } - else if (original_owner_before_cleanse == eFACTION.Tau && p_pdf[_run] == 0) { // Special case: Tau considered cleansed only if their PDF is also gone? - who_cleansed = "Tau"; - make_alert = true; - } - else if (original_owner_before_cleanse == eFACTION.Necrons) { - who_cleansed = "Necrons"; - make_alert = true; - } - else if (original_owner_before_cleanse == eFACTION.Chaos) { - who_cleansed = "Chaos"; // Includes CSM, Daemons, possibly Traitors if owner flipped - make_alert = true; - } - // Check Tyranids/GSC based on previous owner OR if GSC feature was present and Nids are now low - else if (original_owner_before_cleanse == eFACTION.Tyranids || - (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0)) - { - who_cleansed = "Tyranid"; // Generic term initially + // --- Determine which enemy faction was primarily defeated --- + // This logic primarily uses the owner just before cleansing as the indicator. + if (original_owner_before_cleanse == eFACTION.Ork) { + who_cleansed = "Orks"; + make_alert = true; + } else if (original_owner_before_cleanse == eFACTION.Tau && p_pdf[_run] == 0) { // Special case: Tau considered cleansed only if their PDF is also gone? + who_cleansed = "Tau"; + make_alert = true; + } else if (original_owner_before_cleanse == eFACTION.Necrons) { + who_cleansed = "Necrons"; + make_alert = true; + } else if (original_owner_before_cleanse == eFACTION.Chaos) { + who_cleansed = "Chaos"; // Includes CSM, Daemons, possibly Traitors if owner flipped + make_alert = true; + // Check Tyranids/GSC based on previous owner OR if GSC feature was present and Nids are now low + } else if (original_owner_before_cleanse == eFACTION.Tyranids || (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0)) { + who_cleansed = "Tyranid"; // Generic term initially - // Check specifically if a Genestealer Cult feature was present - if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult)) { - who_cleansed = "Genestealer Cult"; // More specific name - delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); // Remove the cult feature - adjust_influence(eFACTION.Tyranids, -25, _run, self); // Reduce residual Tyranid influence (pass 'self' for star context) - } - make_alert = true; // Trigger alert for Tyranids or GSC - } + // Check specifically if a Genestealer Cult feature was present + if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult)) { + who_cleansed = "Genestealer Cult"; // More specific name + delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); // Remove the cult feature + adjust_influence(eFACTION.Tyranids, -25, _run, self); // Reduce residual Tyranid influence (pass 'self' for star context) + } + make_alert = true; // Trigger alert for Tyranids or GSC + } - // --- Apply effects ONLY if an enemy was confirmed cleansed --- - if (make_alert) { + // --- Apply effects ONLY if an enemy was confirmed cleansed --- + if (make_alert) { - // --- Determine who gets control back based on original owner (p_first) --- - if (p_first[_run] == eFACTION.Player) { // If originally Player owned - p_owner[_run] = eFACTION.Player; - who_return = "your Chapter"; - } - else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run] == "Forge") { // If originally Mechanicus or a Forge World - who_return = "the Adeptus Mechanicus"; - obj_controller.disposition[eFACTION.Mechanicus] += 5; // FACTION disposition bonus - p_owner[_run] = eFACTION.Mechanicus; - } - else if (p_type[_run] != "Dead") { // If originally Imperial or other non-specific (and not dead) - who_return = "the planetary governor"; // Default return description - if (who_cleansed == "Tau") { who_return = "a loyal governor"; } // Special description for Tau cleanse + // --- Determine who gets control back based on original owner (p_first) --- + if (p_first[_run] == eFACTION.Player) { // If originally Player owned + p_owner[_run] = eFACTION.Player; + who_return = "your Chapter"; + } else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run] == "Forge") { // If originally Mechanicus or a Forge World + who_return = "the Adeptus Mechanicus"; + obj_controller.disposition[eFACTION.Mechanicus] += 5; // FACTION disposition bonus + p_owner[_run] = eFACTION.Mechanicus; + } else if (p_type[_run] != "Dead") { // If originally Imperial or other non-specific (and not dead) + who_return = "the planetary governor"; // Default return description + if (who_cleansed == "Tau") { who_return = "a loyal governor"; } // Special description for Tau cleanse - // Check if Sisters should get control or bonus - var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); - if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { - // If originally Ecclesiarchy, give them control back - if (p_first[_run] == eFACTION.Ecclesiarchy) { - p_owner[_run] = eFACTION.Ecclesiarchy; - who_return = "the Ecclesiarchy"; + // Check if Sisters should get control or bonus + var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); + if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { + // If originally Ecclesiarchy, give them control back + if (p_first[_run] == eFACTION.Ecclesiarchy) { + p_owner[_run] = eFACTION.Ecclesiarchy; + who_return = "the Ecclesiarchy"; + } + // Always give faction bonus if it was their original world OR a holy site + obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; // FACTION disposition bonus + } else { // If not originally Ecclesiarchy and not a holy site, defaults to Imperium + p_owner[_run] = eFACTION.Imperium; + } + } else { // If it's a dead world reverting + // If original owner wasn't Player/Mech/Eccl, default ownership to Imperium + if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { + p_owner[_run] = eFACTION.Imperium; + who_return = "Imperial Administration"; // Generic term for dead world + } + // Otherwise, it implies Player/Mech/Eccl originally owned the dead world, + // so the p_owner should have been set correctly by the p_first check earlier. } - // Always give faction bonus if it was their original world OR a holy site - obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; // FACTION disposition bonus - } - else { // If not originally Ecclesiarchy and not a holy site, defaults to Imperium - p_owner[_run] = eFACTION.Imperium; - } - } - else { // If it's a dead world reverting - // If original owner wasn't Player/Mech/Eccl, default ownership to Imperium - if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { - p_owner[_run] = eFACTION.Imperium; - who_return = "Imperial Administration"; // Generic term for dead world - } - // Otherwise, it implies Player/Mech/Eccl originally owned the dead world, - // so the p_owner should have been set correctly by the p_first check earlier. - } - // --- Apply Generic Bonuses/Alerts if control returned meaningfully --- - if (who_return != "") { + // --- Apply Generic Bonuses/Alerts if control returned meaningfully --- + if (who_return != "") { - // 1. Increase LOCAL governor disposition (capped) - dispo[_run] = clamp(dispo[_run] + 10, -90, 100); + // 1. Increase LOCAL governor disposition (capped) + dispo[_run] = clamp(dispo[_run] + 10, -90, 100); - // 2. Increment GLOBAL counter for enemies cleared - obj_controller.enemies_cleared_count += 1; + // 2. Increment GLOBAL counter for enemies cleared + obj_controller.enemies_cleared_count += 1; - // 3. calls the function that handles the every-4-clears bonus - scr_battle_count(); + // 3. calls the function that handles the every-4-clears bonus + scr_battle_count(); - // 4. Log the cleanse event - scr_event_log("INFO", $"{who_cleansed} cleansed from {planet_string}", name); // Keep original log type? Use "INFO" or "SUCCESS"? + // 4. Log the cleanse event + scr_event_log("INFO", $"{who_cleansed} cleansed from {planet_string}", name); // Keep original log type? Use "INFO" or "SUCCESS"? - // 5. Create a screen alert message - scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); + // 5. Create a screen alert message + scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); - // 6. Check if high local disposition flips the planet to player control - if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { - p_owner[_run] = eFACTION.Player; - scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); - } - } // End if (who_return != "") - } // End if (make_alert) -} // End if (planet_saved) + // 6. Check if high local disposition flips the planet to player control + if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { + p_owner[_run] = eFACTION.Player; + scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); + } + } // End if (who_return != "") + } // End if (make_alert) + } // End if (planet_saved) -// Reset raided flag if it was set for this planet -if (p_raided[_run] > 0) then p_raided[_run] = 0; + // Reset raided flag if it was set for this planet + if (p_raided[_run] > 0) { p_raided[_run] = 0; } -// IMPORTANT: Delete the PlanetData struct if it was used in this loop iteration -delete _planet_data; // Return allocated memory to the Omnissiah + // IMPORTANT: Delete the PlanetData struct if it was used in this loop iteration + delete _planet_data; // Return allocated memory to the Omnissiah + } // end repeat here // quene player battles here From e398fb741ac4a062f6f08cb4922c037147b2e682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Fri, 28 Mar 2025 13:46:54 -0400 Subject: [PATCH 31/41] fix: Proper colors --- scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index 9fbd9cd3ca..da39591e05 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -918,7 +918,7 @@ function scr_enemy_ai_a() { scr_battle_count(); // 4. Log the cleanse event - scr_event_log("INFO", $"{who_cleansed} cleansed from {planet_string}", name); // Keep original log type? Use "INFO" or "SUCCESS"? + scr_event_log("green", $"{who_cleansed} cleansed from {planet_string}", name); // 5. Create a screen alert message scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y); @@ -926,7 +926,7 @@ function scr_enemy_ai_a() { // 6. Check if high local disposition flips the planet to player control if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { p_owner[_run] = eFACTION.Player; - scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); + scr_alert(c_blue, "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); } } // End if (who_return != "") } // End if (make_alert) From 2b8f6abebb241f584fd738c2a339374c04dcfdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Fri, 28 Mar 2025 13:47:54 -0400 Subject: [PATCH 32/41] refactor: Array and struct for readability and maintenance --- scripts/scr_battle_count/scr_battle_count.gml | 71 +++++++------------ 1 file changed, 27 insertions(+), 44 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index 87b8344557..8504d554fc 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -1,54 +1,37 @@ function scr_battle_count(){ // Check if the count is positive and a multiple of 6 - if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count%6 == 0)) { + if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count % 6 == 0)) { // --- ACTION TO PERFORM EVERY 6 CLEARS --- // --- Randomly Choose Flavor Text --- - var _num_options = 5; // <<< SET THIS to the number of text options below - var _text_choice = irandom(_num_options - 1); // Generates a random integer from 0 to (_num_options - 1) - - // Use a switch statement for cleaner selection - switch (_text_choice) { - - case 0: // Option 1 (Influential Ears) - scr_alert("c_blue", "reward", "Word of your Chapter's tireless defence of the Sector reaches influential ears within the Imperium."); - scr_event_log("c_blue", "Imperial Factions note the Chapter's continued effectiveness in purging threats."); - break; - - case 1: // Option 2 (Efficiency Not Unnoticed) - scr_alert("c_blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0); - scr_event_log("INFO", "Imperial elements acknowledge the Chapter's effectiveness against sector threats."); - break; - - case 2: // Option 3 (Bureaucratic Acknowledgment) - scr_alert("c_blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0); - scr_event_log("INFO", "Administratum logs successful anti-xenos/heretic operations by the Chapter."); - break; - - case 3: // Option 4 (Faith and Fury) - scr_alert("c_blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0); - scr_event_log("INFO", "Tales of the Chapter's victories inspire piety and bolster relations with the faithful."); - break; - - case 4: // Option 5 (Simple Effectiveness) - scr_alert("c_blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0); - scr_event_log("INFO", "Chapter operations demonstrably reduce enemy presence; Imperial factions approve."); - break; - - // Add more cases here if you create more text options - // case 5: - // scr_alert(...); - // scr_event_log(...); - // break; - - default: // Fallback in case something goes wrong - scr_alert("c_blue", "reward", "Your Chapter continues its duties effectively.", 0, 0); - scr_event_log("INFO", "Chapter effectiveness noted by Imperial factions."); - break; - } - // --- End Flavor Text Selection --- + var _text_array = [ + [{ + alert : "Word of your Chapter's tireless defence of the Sector reaches influential ears within the Imperium.", + log : "Imperial Factions note the Chapter's continued effectiveness in purging threats." + }], + [{ + alert : "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", + log : "Imperial elements acknowledge the Chapter's effectiveness against sector threats." + }], + [{ + alert : "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", + log : "Administratum logs successful anti-xenos/heretic operations by the Chapter." + }], + [{ + alert : "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", + log : "Tales of the Chapter's victories inspire piety and bolster relations with the faithful." + }], + [{ + alert : "Your Chapter continues its duties effectively.", + log : "Chapter effectiveness noted by Imperial factions." + }] + ] + var _text_choice = irandom(array_length(_text_array) - 1); + // Alert doesn't seem to work, probably because of UI + scr_alert(c_blue, "reward", $"{_text_array[_text_choice][0].alert}"); + scr_event_log(c_blue, $"{_text_array[_text_choice][0].log}"); // --- Apply disposition bonuses #macro FACT_DISPO obj_controller.disposition From 9c472836a9e87a4ea1ed7dd451f7e283a197e08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Fri, 28 Mar 2025 13:48:34 -0400 Subject: [PATCH 33/41] style: Auto changes --- ChapterMaster.yyp | 2 +- scripts/scr_battle_count/scr_battle_count.yy | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 78ab105166..cbb6339106 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -671,6 +671,7 @@ {"id":{"name":"scr_arti_descr","path":"scripts/scr_arti_descr/scr_arti_descr.yy",},}, {"id":{"name":"scr_audience","path":"scripts/scr_audience/scr_audience.yy",},}, {"id":{"name":"scr_battle_allies","path":"scripts/scr_battle_allies/scr_battle_allies.yy",},}, + {"id":{"name":"scr_battle_count","path":"scripts/scr_battle_count/scr_battle_count.yy",},}, {"id":{"name":"scr_battle_roster","path":"scripts/scr_battle_roster/scr_battle_roster.yy",},}, {"id":{"name":"scr_battle_sort","path":"scripts/scr_battle_sort/scr_battle_sort.yy",},}, {"id":{"name":"scr_bionics_count","path":"scripts/scr_bionics_count/scr_bionics_count.yy",},}, @@ -787,7 +788,6 @@ {"id":{"name":"scr_perils_table","path":"scripts/scr_perils_table/scr_perils_table.yy",},}, {"id":{"name":"scr_planet_heresy","path":"scripts/scr_planet_heresy/scr_planet_heresy.yy",},}, {"id":{"name":"scr_planetary_feature","path":"scripts/scr_planetary_feature/scr_planetary_feature.yy",},}, - {"id":{"name":"scr_battle_count","path":"scripts/scr_battle_count/scr_battle_count.yy",},}, {"id":{"name":"scr_PlanetData","path":"scripts/scr_PlanetData/scr_PlanetData.yy",},}, {"id":{"name":"scr_player_combat_weapon_stacks","path":"scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.yy",},}, {"id":{"name":"scr_player_fleet_combat_functions","path":"scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.yy",},}, diff --git a/scripts/scr_battle_count/scr_battle_count.yy b/scripts/scr_battle_count/scr_battle_count.yy index d2d9bd1f6d..2e8cde2771 100644 --- a/scripts/scr_battle_count/scr_battle_count.yy +++ b/scripts/scr_battle_count/scr_battle_count.yy @@ -7,7 +7,7 @@ "parent":{ "name":"Helpers", "path":"folders/Scripts/Helpers.yy", - }, - "resourceType":"GMScript", + }, + "resourceType":"GMScript", "resourceVersion":"2.0", -} +} \ No newline at end of file From 0b345ed9f5363bcb142ad5f61d91c4acac7a59eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Fri, 28 Mar 2025 14:49:52 -0400 Subject: [PATCH 34/41] refactor: Use elses and some formatting This should probably be in another PR --- .../scr_destroy_planet/scr_destroy_planet.gml | 100 ++++++++---------- 1 file changed, 46 insertions(+), 54 deletions(-) diff --git a/scripts/scr_destroy_planet/scr_destroy_planet.gml b/scripts/scr_destroy_planet/scr_destroy_planet.gml index 10314170a5..e29533d20e 100644 --- a/scripts/scr_destroy_planet/scr_destroy_planet.gml +++ b/scripts/scr_destroy_planet/scr_destroy_planet.gml @@ -78,9 +78,9 @@ function scr_destroy_planet(destruction_method) { } // Relation penalties here, if applicable - if (you.p_type[baid]="Daemon"){ - obj_controller.disposition[2]+=5; - obj_controller.disposition[3]+=5; + if (you.p_type[baid] == "Daemon") { + obj_controller.disposition[eFACTION.Imperium] += 5; + obj_controller.disposition[eFACTION.Mechanicus] += 5; obj_controller.disposition[4]+=5; obj_controller.disposition[5]+=5; var o=0; @@ -91,10 +91,8 @@ function scr_destroy_planet(destruction_method) { obj_controller.penitent_current+=1500; obj_controller.penitent_turn=0; obj_controller.penitent_turnly=0;} - } - - //TODO a shitload of helper functions to make this sort of stuff easier - if ((you.p_owner[baid]=3) or (you.p_first[baid]=3)) and (obj_controller.faction_status[eFACTION.Mechanicus]!="War") and (you.p_type[baid]!="Daemon"){ + //TODO a shitload of helper functions to make this sort of stuff easier + } else if ((you.p_owner[baid] == eFACTION.Mechanicus || you.p_first[baid] == eFACTION.Mechanicus) && obj_controller.faction_status[eFACTION.Mechanicus] != "War") { obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=50; @@ -130,8 +128,7 @@ function scr_destroy_planet(destruction_method) { obj_controller.audien_topic[obj_controller.audiences]="declare_war";} } - } - if (enemy9=5) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]!="War") and you.p_type[baid]!="Daemon" { + } else if (enemy9 == eFACTION.Ecclesiarchy && obj_controller.faction_status[eFACTION.Ecclesiarchy] != "War") { obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=50; @@ -154,51 +151,46 @@ function scr_destroy_planet(destruction_method) { obj_controller.audiences+=1; obj_controller.audien[obj_controller.audiences]=2; obj_controller.audien_topic[obj_controller.audiences]="declare_war"; - } - - - - if (you.p_tyranids[baid]<5){ - if (you.p_first[baid]=2) and (you.p_type[baid]="Hive") and (you.p_type[baid]!="Daemon") and (obj_controller.faction_status[eFACTION.Imperium]!="War"){ - obj_controller.loyalty-=50; - obj_controller.loyalty_hidden-=50; - obj_controller.disposition[eFACTION.Imperium]-=60; - obj_controller.disposition[3]-=30; - obj_controller.disposition[4]-=40; - obj_controller.disposition[5]-=40; - - obj_controller.faction_status[eFACTION.Imperium]="War"; - obj_controller.faction_status[eFACTION.Mechanicus]="War"; - obj_controller.faction_status[eFACTION.Inquisition]="War"; - obj_controller.faction_status[eFACTION.Ecclesiarchy]="War"; - - obj_controller.audiences+=1; - obj_controller.audien[obj_controller.audiences]=2; - obj_controller.audien_topic[obj_controller.audiences]="declare_war"; - if (obj_controller.known[eFACTION.Inquisition]>1){ - obj_controller.audiences+=1; - obj_controller.audien[obj_controller.audiences]=4; - obj_controller.audien_topic[obj_controller.audiences]="declare_war";} - if (obj_controller.known[eFACTION.Ecclesiarchy]>1){ - obj_controller.audiences+=1; - obj_controller.audien[obj_controller.audiences]=5; - obj_controller.audien_topic[obj_controller.audiences]="declare_war";} - if (obj_controller.known[eFACTION.Mechanicus]>1){ - obj_controller.audiences+=1; - obj_controller.audien[obj_controller.audiences]=3; - obj_controller.audien_topic[obj_controller.audiences]="declare_war";} - - if (planet_feature_bool(you.p_feature[baid], P_features.Sororitas_Cathedral)==1) then obj_controller.disposition[5]-=30; - } - if (you.p_owner[baid]=2) and ((you.p_type[baid]="Temperate") or (you.p_type[baid]="Temperate")) and (you.p_type[baid]!="Daemon"){ - obj_controller.loyalty-=30; - obj_controller.loyalty_hidden-=30; - obj_controller.disposition[eFACTION.Imperium]-=30; - obj_controller.disposition[3]-=15; - obj_controller.disposition[4]-=30; - obj_controller.disposition[5]-=30; - } - } + } else if (obj_controller.faction_status[eFACTION.Imperium] != "War" && planet_feature_bool(you.p_feature[baid], P_features.Daemonic_Incursion) == 0 && you.p_tyranids[baid] < 5) { + if (you.p_first[baid] == eFACTION.Imperium && you.p_type[baid] == "Hive") { + obj_controller.loyalty -= 50; + obj_controller.loyalty_hidden -= 50; + obj_controller.disposition[eFACTION.Imperium]-=60; + obj_controller.disposition[eFACTION.Mechanicus] -= 30; + obj_controller.disposition[eFACTION.Inquisition] -= 40; + obj_controller.disposition[eFACTION.Ecclesiarchy] -= 40; + + obj_controller.faction_status[eFACTION.Imperium] = "War"; + obj_controller.faction_status[eFACTION.Mechanicus] = "War"; + obj_controller.faction_status[eFACTION.Inquisition] = "War"; + obj_controller.faction_status[eFACTION.Ecclesiarchy] = "War"; + + obj_controller.audiences += 1; + obj_controller.audien[obj_controller.audiences] = 2; + obj_controller.audien_topic[obj_controller.audiences] = "declare_war"; + if (obj_controller.known[eFACTION.Inquisition] > 1){ + obj_controller.audiences += 1; + obj_controller.audien[obj_controller.audiences] = 4; + obj_controller.audien_topic[obj_controller.audiences] = "declare_war";} + if (obj_controller.known[eFACTION.Ecclesiarchy] > 1){ + obj_controller.audiences += 1; + obj_controller.audien[obj_controller.audiences] = 5; + obj_controller.audien_topic[obj_controller.audiences] = "declare_war";} + if (obj_controller.known[eFACTION.Mechanicus] > 1){ + obj_controller.audiences += 1; + obj_controller.audien[obj_controller.audiences] = 3; + obj_controller.audien_topic[obj_controller.audiences] = "declare_war";} + + if (planet_feature_bool(you.p_feature[baid], P_features.Sororitas_Cathedral) == 1) { obj_controller.disposition[5] -= 30; } + } else if (you.p_owner[baid] == eFACTION.Imperium && (you.p_type[baid] == "Temperate" || you.p_type[baid] == "Desert")) { + obj_controller.loyalty -= 30; + obj_controller.loyalty_hidden -= 30; + obj_controller.disposition[eFACTION.Imperium] -= 30; + obj_controller.disposition[eFACTION.Mechanicus] -= 15; + obj_controller.disposition[eFACTION.Inquisition] -= 30; + obj_controller.disposition[eFACTION.Ecclesiarchy] -= 30; + } + } // Planet changes here //TODO make a plane_reset function From 0df49ad43c67f8d6aa07a163599162eda36cacca Mon Sep 17 00:00:00 2001 From: Nelsonh <81228864+OH296@users.noreply.github.com> Date: Fri, 28 Mar 2025 22:12:56 +0000 Subject: [PATCH 35/41] Update scripts/scr_battle_count/scr_battle_count.gml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Мастер Чиф <43174917+MCPO-Spartan-117@users.noreply.github.com> --- scripts/scr_battle_count/scr_battle_count.gml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index 8504d554fc..5ab5153646 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -7,31 +7,31 @@ function scr_battle_count(){ // --- Randomly Choose Flavor Text --- var _text_array = [ - [{ + { alert : "Word of your Chapter's tireless defence of the Sector reaches influential ears within the Imperium.", log : "Imperial Factions note the Chapter's continued effectiveness in purging threats." - }], - [{ + }, + { alert : "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", log : "Imperial elements acknowledge the Chapter's effectiveness against sector threats." - }], - [{ + }, + { alert : "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", log : "Administratum logs successful anti-xenos/heretic operations by the Chapter." - }], - [{ + }, + { alert : "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", log : "Tales of the Chapter's victories inspire piety and bolster relations with the faithful." - }], - [{ + }, + { alert : "Your Chapter continues its duties effectively.", log : "Chapter effectiveness noted by Imperial factions." - }] + } ] - var _text_choice = irandom(array_length(_text_array) - 1); + var _text_choice = array_random_element(_text_array); // Alert doesn't seem to work, probably because of UI - scr_alert(c_blue, "reward", $"{_text_array[_text_choice][0].alert}"); - scr_event_log(c_blue, $"{_text_array[_text_choice][0].log}"); + scr_alert(c_blue, "reward", $"{_text_array[_text_choice].alert}"); + scr_event_log(c_blue, $"{_text_array[_text_choice].log}"); // --- Apply disposition bonuses #macro FACT_DISPO obj_controller.disposition From 869907b766005a2d9a5aba97a2753054d2139542 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Sat, 29 Mar 2025 18:45:30 +1100 Subject: [PATCH 36/41] Update scripts/scr_battle_count/scr_battle_count.gml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Мастер Чиф <43174917+MCPO-Spartan-117@users.noreply.github.com> --- scripts/scr_battle_count/scr_battle_count.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index 5ab5153646..d0c0c63e3a 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -30,8 +30,8 @@ function scr_battle_count(){ ] var _text_choice = array_random_element(_text_array); // Alert doesn't seem to work, probably because of UI - scr_alert(c_blue, "reward", $"{_text_array[_text_choice].alert}"); - scr_event_log(c_blue, $"{_text_array[_text_choice].log}"); + scr_alert(c_blue, "reward", $"{_text_choice.alert}"); + scr_event_log(c_blue, $"{_text_choice.log}"); // --- Apply disposition bonuses #macro FACT_DISPO obj_controller.disposition From c655f4ab93516b206e582e2c555a5f3266e8c8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Wed, 2 Apr 2025 09:57:59 -0400 Subject: [PATCH 37/41] Revert "refactor: Use elses and some formatting" This reverts commit 0b345ed9f5363bcb142ad5f61d91c4acac7a59eb. --- .../scr_destroy_planet/scr_destroy_planet.gml | 100 ++++++++++-------- 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/scripts/scr_destroy_planet/scr_destroy_planet.gml b/scripts/scr_destroy_planet/scr_destroy_planet.gml index e29533d20e..10314170a5 100644 --- a/scripts/scr_destroy_planet/scr_destroy_planet.gml +++ b/scripts/scr_destroy_planet/scr_destroy_planet.gml @@ -78,9 +78,9 @@ function scr_destroy_planet(destruction_method) { } // Relation penalties here, if applicable - if (you.p_type[baid] == "Daemon") { - obj_controller.disposition[eFACTION.Imperium] += 5; - obj_controller.disposition[eFACTION.Mechanicus] += 5; + if (you.p_type[baid]="Daemon"){ + obj_controller.disposition[2]+=5; + obj_controller.disposition[3]+=5; obj_controller.disposition[4]+=5; obj_controller.disposition[5]+=5; var o=0; @@ -91,8 +91,10 @@ function scr_destroy_planet(destruction_method) { obj_controller.penitent_current+=1500; obj_controller.penitent_turn=0; obj_controller.penitent_turnly=0;} - //TODO a shitload of helper functions to make this sort of stuff easier - } else if ((you.p_owner[baid] == eFACTION.Mechanicus || you.p_first[baid] == eFACTION.Mechanicus) && obj_controller.faction_status[eFACTION.Mechanicus] != "War") { + } + + //TODO a shitload of helper functions to make this sort of stuff easier + if ((you.p_owner[baid]=3) or (you.p_first[baid]=3)) and (obj_controller.faction_status[eFACTION.Mechanicus]!="War") and (you.p_type[baid]!="Daemon"){ obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=50; @@ -128,7 +130,8 @@ function scr_destroy_planet(destruction_method) { obj_controller.audien_topic[obj_controller.audiences]="declare_war";} } - } else if (enemy9 == eFACTION.Ecclesiarchy && obj_controller.faction_status[eFACTION.Ecclesiarchy] != "War") { + } + if (enemy9=5) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]!="War") and you.p_type[baid]!="Daemon" { obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=50; @@ -151,46 +154,51 @@ function scr_destroy_planet(destruction_method) { obj_controller.audiences+=1; obj_controller.audien[obj_controller.audiences]=2; obj_controller.audien_topic[obj_controller.audiences]="declare_war"; - } else if (obj_controller.faction_status[eFACTION.Imperium] != "War" && planet_feature_bool(you.p_feature[baid], P_features.Daemonic_Incursion) == 0 && you.p_tyranids[baid] < 5) { - if (you.p_first[baid] == eFACTION.Imperium && you.p_type[baid] == "Hive") { - obj_controller.loyalty -= 50; - obj_controller.loyalty_hidden -= 50; - obj_controller.disposition[eFACTION.Imperium]-=60; - obj_controller.disposition[eFACTION.Mechanicus] -= 30; - obj_controller.disposition[eFACTION.Inquisition] -= 40; - obj_controller.disposition[eFACTION.Ecclesiarchy] -= 40; - - obj_controller.faction_status[eFACTION.Imperium] = "War"; - obj_controller.faction_status[eFACTION.Mechanicus] = "War"; - obj_controller.faction_status[eFACTION.Inquisition] = "War"; - obj_controller.faction_status[eFACTION.Ecclesiarchy] = "War"; - - obj_controller.audiences += 1; - obj_controller.audien[obj_controller.audiences] = 2; - obj_controller.audien_topic[obj_controller.audiences] = "declare_war"; - if (obj_controller.known[eFACTION.Inquisition] > 1){ - obj_controller.audiences += 1; - obj_controller.audien[obj_controller.audiences] = 4; - obj_controller.audien_topic[obj_controller.audiences] = "declare_war";} - if (obj_controller.known[eFACTION.Ecclesiarchy] > 1){ - obj_controller.audiences += 1; - obj_controller.audien[obj_controller.audiences] = 5; - obj_controller.audien_topic[obj_controller.audiences] = "declare_war";} - if (obj_controller.known[eFACTION.Mechanicus] > 1){ - obj_controller.audiences += 1; - obj_controller.audien[obj_controller.audiences] = 3; - obj_controller.audien_topic[obj_controller.audiences] = "declare_war";} - - if (planet_feature_bool(you.p_feature[baid], P_features.Sororitas_Cathedral) == 1) { obj_controller.disposition[5] -= 30; } - } else if (you.p_owner[baid] == eFACTION.Imperium && (you.p_type[baid] == "Temperate" || you.p_type[baid] == "Desert")) { - obj_controller.loyalty -= 30; - obj_controller.loyalty_hidden -= 30; - obj_controller.disposition[eFACTION.Imperium] -= 30; - obj_controller.disposition[eFACTION.Mechanicus] -= 15; - obj_controller.disposition[eFACTION.Inquisition] -= 30; - obj_controller.disposition[eFACTION.Ecclesiarchy] -= 30; - } - } + } + + + + if (you.p_tyranids[baid]<5){ + if (you.p_first[baid]=2) and (you.p_type[baid]="Hive") and (you.p_type[baid]!="Daemon") and (obj_controller.faction_status[eFACTION.Imperium]!="War"){ + obj_controller.loyalty-=50; + obj_controller.loyalty_hidden-=50; + obj_controller.disposition[eFACTION.Imperium]-=60; + obj_controller.disposition[3]-=30; + obj_controller.disposition[4]-=40; + obj_controller.disposition[5]-=40; + + obj_controller.faction_status[eFACTION.Imperium]="War"; + obj_controller.faction_status[eFACTION.Mechanicus]="War"; + obj_controller.faction_status[eFACTION.Inquisition]="War"; + obj_controller.faction_status[eFACTION.Ecclesiarchy]="War"; + + obj_controller.audiences+=1; + obj_controller.audien[obj_controller.audiences]=2; + obj_controller.audien_topic[obj_controller.audiences]="declare_war"; + if (obj_controller.known[eFACTION.Inquisition]>1){ + obj_controller.audiences+=1; + obj_controller.audien[obj_controller.audiences]=4; + obj_controller.audien_topic[obj_controller.audiences]="declare_war";} + if (obj_controller.known[eFACTION.Ecclesiarchy]>1){ + obj_controller.audiences+=1; + obj_controller.audien[obj_controller.audiences]=5; + obj_controller.audien_topic[obj_controller.audiences]="declare_war";} + if (obj_controller.known[eFACTION.Mechanicus]>1){ + obj_controller.audiences+=1; + obj_controller.audien[obj_controller.audiences]=3; + obj_controller.audien_topic[obj_controller.audiences]="declare_war";} + + if (planet_feature_bool(you.p_feature[baid], P_features.Sororitas_Cathedral)==1) then obj_controller.disposition[5]-=30; + } + if (you.p_owner[baid]=2) and ((you.p_type[baid]="Temperate") or (you.p_type[baid]="Temperate")) and (you.p_type[baid]!="Daemon"){ + obj_controller.loyalty-=30; + obj_controller.loyalty_hidden-=30; + obj_controller.disposition[eFACTION.Imperium]-=30; + obj_controller.disposition[3]-=15; + obj_controller.disposition[4]-=30; + obj_controller.disposition[5]-=30; + } + } // Planet changes here //TODO make a plane_reset function From 63ee7147be93192da0bfeb9c8848a553399b1a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B5=D1=80=20=D0=A7=D0=B8=D1=84?= <43174917+MCPO-Spartan-117@users.noreply.github.com> Date: Wed, 2 Apr 2025 09:58:10 -0400 Subject: [PATCH 38/41] Revert "fix: failed to check demonworlds as hostile" This reverts commit 18793de26ef4ac087b43d4ee41d7bf4393b70239. --- scripts/scr_destroy_planet/scr_destroy_planet.gml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/scr_destroy_planet/scr_destroy_planet.gml b/scripts/scr_destroy_planet/scr_destroy_planet.gml index 10314170a5..a49965c680 100644 --- a/scripts/scr_destroy_planet/scr_destroy_planet.gml +++ b/scripts/scr_destroy_planet/scr_destroy_planet.gml @@ -79,9 +79,8 @@ function scr_destroy_planet(destruction_method) { // Relation penalties here, if applicable if (you.p_type[baid]="Daemon"){ - obj_controller.disposition[2]+=5; - obj_controller.disposition[3]+=5; obj_controller.disposition[4]+=5; + obj_controller.disposition[5]+=5; var o=0; if (scr_has_adv("Reverent Guardians")) then o=500; @@ -94,7 +93,7 @@ function scr_destroy_planet(destruction_method) { } //TODO a shitload of helper functions to make this sort of stuff easier - if ((you.p_owner[baid]=3) or (you.p_first[baid]=3)) and (obj_controller.faction_status[eFACTION.Mechanicus]!="War") and (you.p_type[baid]!="Daemon"){ + if ((you.p_owner[baid]=3) or (you.p_first[baid]=3)) and (obj_controller.faction_status[eFACTION.Mechanicus]!="War"){ obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=50; @@ -131,7 +130,7 @@ function scr_destroy_planet(destruction_method) { } } - if (enemy9=5) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]!="War") and you.p_type[baid]!="Daemon" { + if (enemy9=5) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]!="War"){ obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=50; @@ -159,7 +158,7 @@ function scr_destroy_planet(destruction_method) { if (you.p_tyranids[baid]<5){ - if (you.p_first[baid]=2) and (you.p_type[baid]="Hive") and (you.p_type[baid]!="Daemon") and (obj_controller.faction_status[eFACTION.Imperium]!="War"){ + if (you.p_first[baid]=2) and (you.p_type[baid]="Hive") and (planet_feature_bool(you.p_feature[baid], P_features.Daemonic_Incursion)==0) and (obj_controller.faction_status[eFACTION.Imperium]!="War"){ obj_controller.loyalty-=50; obj_controller.loyalty_hidden-=50; obj_controller.disposition[eFACTION.Imperium]-=60; @@ -190,7 +189,7 @@ function scr_destroy_planet(destruction_method) { if (planet_feature_bool(you.p_feature[baid], P_features.Sororitas_Cathedral)==1) then obj_controller.disposition[5]-=30; } - if (you.p_owner[baid]=2) and ((you.p_type[baid]="Temperate") or (you.p_type[baid]="Temperate")) and (you.p_type[baid]!="Daemon"){ + if (you.p_owner[baid]=2) and ((you.p_type[baid]="Temperate") or (you.p_type[baid]="Temperate")) and (planet_feature_bool(you.p_feature[baid], P_features.Daemonic_Incursion)==0){ obj_controller.loyalty-=30; obj_controller.loyalty_hidden-=30; obj_controller.disposition[eFACTION.Imperium]-=30; From fae1b8e720aed8518140d46393c76841b6749cc4 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Sat, 12 Apr 2025 18:46:22 +1000 Subject: [PATCH 39/41] Update scripts/scr_load_controller/scr_load_controller.gml Co-authored-by: EttyKitty <20323032+EttyKitty@users.noreply.github.com> --- scripts/scr_load_controller/scr_load_controller.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scr_load_controller/scr_load_controller.gml b/scripts/scr_load_controller/scr_load_controller.gml index 50d1bece5f..43ce60150c 100644 --- a/scripts/scr_load_controller/scr_load_controller.gml +++ b/scripts/scr_load_controller/scr_load_controller.gml @@ -487,7 +487,7 @@ function scr_load_controller(save_id){ obj_ini.progenitor_disposition=ini_read_real("Controller","progenitor_disposition",0); obj_ini.imperium_disposition=ini_read_real("Controller","imperium_disposition",0); obj_controller.astartes_disposition=ini_read_real("Controller","astartes_disposition",0); - obj_controller.enemies_cleared_count = ini_read_real("Controller", "enemies_cleared_count", 0); + obj_controller.enemies_cleared_count = ini_read_real("Controller", "enemies_cleared_count", 0); obj_controller.bat_devastator_column=ini_read_real("Controller","bat_devastator_column",1); obj_controller.bat_assault_column=ini_read_real("Controller","bat_assault_column",4); From 262bd458d501ff1d9a159bd3d11dfaeb01a678c8 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Sat, 17 May 2025 07:45:48 +1000 Subject: [PATCH 40/41] Update scr_battle_count.gml This system will now increase loyalty until i figure out the deed system --- scripts/scr_battle_count/scr_battle_count.gml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index d0c0c63e3a..e5bb18244e 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -1,9 +1,9 @@ function scr_battle_count(){ - // Check if the count is positive and a multiple of 6 - if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count % 6 == 0)) { + // Check if the count is positive and a multiple of 15 + if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count % 15 == 0)) { - // --- ACTION TO PERFORM EVERY 6 CLEARS --- + // --- ACTION TO PERFORM EVERY 15 CLEARS --- // --- Randomly Choose Flavor Text --- var _text_array = [ @@ -29,16 +29,13 @@ function scr_battle_count(){ } ] var _text_choice = array_random_element(_text_array); - // Alert doesn't seem to work, probably because of UI - scr_alert(c_blue, "reward", $"{_text_choice.alert}"); + + scr_alert(c_blue, $"{_text_choice.alert}"); scr_event_log(c_blue, $"{_text_choice.log}"); - // --- Apply disposition bonuses - #macro FACT_DISPO obj_controller.disposition - FACT_DISPO[eFACTION.Imperium] = clamp(FACT_DISPO[eFACTION.Imperium] + 8, -92, 100); - FACT_DISPO[eFACTION.Mechanicus] = clamp(FACT_DISPO[eFACTION.Mechanicus] + 5, -95, 100); - FACT_DISPO[eFACTION.Ecclesiarchy] = clamp(FACT_DISPO[eFACTION.Ecclesiarchy] + 6, -94, 100); - FACT_DISPO[eFACTION.Inquisition] = clamp(FACT_DISPO[eFACTION.Inquisition] + 4, -96, 100); + // --- Apply bonuses + obj_controller.loyalty+=5; + obj_controller.loyalty_hidden+=5; // --- END ACTION TO PERFORM --- } } From 8aa0d3e79c6f195cd108179774d2b18f993fe4c1 Mon Sep 17 00:00:00 2001 From: Frost-bit-jpg Date: Sat, 17 May 2025 07:46:25 +1000 Subject: [PATCH 41/41] Update scr_battle_count.gml --- scripts/scr_battle_count/scr_battle_count.gml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/scr_battle_count/scr_battle_count.gml b/scripts/scr_battle_count/scr_battle_count.gml index e5bb18244e..e93951c274 100644 --- a/scripts/scr_battle_count/scr_battle_count.gml +++ b/scripts/scr_battle_count/scr_battle_count.gml @@ -1,9 +1,9 @@ function scr_battle_count(){ - // Check if the count is positive and a multiple of 15 - if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count % 15 == 0)) { + // Check if the count is positive and a multiple of 10 + if (obj_controller.enemies_cleared_count > 0 && (obj_controller.enemies_cleared_count % 10 == 0)) { - // --- ACTION TO PERFORM EVERY 15 CLEARS --- + // --- ACTION TO PERFORM EVERY 10 CLEARS --- // --- Randomly Choose Flavor Text --- var _text_array = [