-
Couldn't load subscription status.
- Fork 39
feat: Imperial Loyalty #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
55fec8e
417e4bd
4e7cc4d
2532464
b52591b
e7f5175
f9e4bc2
7f6ff0d
d93abb2
fb55269
a233b7d
03d4573
c5411af
8c32358
f6c1228
d48bb6a
c4f1acb
fbde5da
80c2456
605af3c
8a5f5d9
ff1bab5
2729420
05d18eb
b6c7cd0
00e0d51
85bf01a
18793de
4312395
b300e25
01aaa7a
25b40e8
e398fb7
2b8f6ab
9c47283
0b345ed
826bd9c
0df49ad
869907b
66738db
627d8d6
4b3ae9e
a8951d5
c655f4a
63ee714
ea571a5
d4a15f6
fae1b8e
14c4b91
a5de627
262bd45
8aa0d3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| function scr_battle_count(){ | ||
|
|
||
| // 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 10 CLEARS --- | ||
|
|
||
| // --- 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 = array_random_element(_text_array); | ||
|
|
||
| scr_alert(c_blue, $"{_text_choice.alert}"); | ||
| scr_event_log(c_blue, $"{_text_choice.log}"); | ||
|
|
||
| // --- Apply bonuses | ||
| obj_controller.loyalty+=5; | ||
| obj_controller.loyalty_hidden+=5; | ||
| // --- END ACTION TO PERFORM --- | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -816,58 +816,126 @@ 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 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; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| if (p_raided[_run] > 0) then p_raided[_run] = 0; | ||
| delete _planet_data; | ||
| } // end repeat here | ||
| // 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 | ||
|
Comment on lines
+875
to
+877
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it possible to cheese all of these dispo/planet dispo rewards, by leaving a squad on the planet and waiting for a lvl 1 enemy to pop up? Also, population % from max should matter, perhaps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, if you combine with SR rework, this would indeed become comedic as you take out a squad of orks, and imperials start to like you... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to game logic, those squad of orks if left unchecked will more than likely cause supply disruption and lots of problems in the local system otherwise they wouldn't be able at all to penetrate the defensive fleet yes? orks multiply very fast and if left unchecked will very quickly become a serious problem. Typically imperium response is so slow but to the plantery governor you are preserving otherwise very needed resources. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on experience - if there is some PDF left around, they generally should be capable to handle the ork invasion when it's strength is reduced. Say, SR 1 orks versus ~10'000 PDF troops. Bonus if they do get some fortifications, and your marine garrisons helping out. But if PDF is 0, yeah, the player basically has no option but to wipe the invaders off the surface. The next turn, imperial control is restored and they rebuild the PDF. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm trying to think of a way to avoid this i guess cooldown after cleaning the planet will suffice. my old method of making whatever you save somehow your responsibility is kinda bad. |
||
| 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"; | ||
| } | ||
| // 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] = clamp(dispo[_run] + 10, -90, 100); | ||
|
|
||
| // 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(); | ||
|
|
||
| // 4. Log the cleanse event | ||
| 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); | ||
EttyKitty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // 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(c_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) { 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 | ||
| } // end repeat here | ||
|
|
||
| // quene player battles here | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.