-
Notifications
You must be signed in to change notification settings - Fork 44
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 7 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,70 @@ | ||
| 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 | ||
| } | ||
|
Frost-bit-jpg marked this conversation as resolved.
Outdated
|
||
|
|
||
| // Check if the count is positive and a multiple of 4 | ||
| if (global.enemies_cleared_count > 0 && (global.enemies_cleared_count mod 4 == 0)) { | ||
|
Frost-bit-jpg marked this conversation as resolved.
Outdated
|
||
|
|
||
| // --- ACTION TO PERFORM EVERY 4 CLEARS --- | ||
|
|
||
| // --- Randomly Choose Flavor Text --- | ||
| var _num_options = 5; // <<< SET THIS to the number of text options below | ||
|
Contributor
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. Really wish GM had a constant marker like in C++ but the compiler should make it one anyway.
Collaborator
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. @MCPO-Spartan-117 instances like this where its defined within a function
Contributor
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.
Collaborator
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.
They are in that they are reserved across all calls of a function so within the scope of the method they are are good as we have to a constant. And in the instance above it would be appropriate for it to be made a static to achieve the same goal is all i'm saying
Contributor
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.
Collaborator
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.
it would be stored in memory rather than being generated and gc'd. Its an almost irrelevant quibble but you asked.
Well i never saw what logic would be overridden in first place?
Contributor
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. And there is the misunderstanding, Not the one from
Contributor
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.
You slightly changed handling and that is it.
Initiation and type qualifier.
Collaborator
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.
Okay sorry i'm reading back through the code i had a completely different variable for some insane reason. apologies. But now i'm reading through In general why is this data not just being put in a an array and a random item plucked from the array this is just overly verbose IMO
Contributor
Author
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. Alright so considering how easy it might for some players to just clean the planet perhaps we can adjust it to be 6 or even 8? i'm open to suggestions to make it more complex if necessary. |
||
| 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."); | ||
|
Frost-bit-jpg marked this conversation as resolved.
Outdated
|
||
| 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)) { | ||
|
Frost-bit-jpg marked this conversation as resolved.
Outdated
|
||
| obj_controller.disposition[eFACTION.Imperium] += 8; | ||
| obj_controller.disposition[eFACTION.Mechanicus] += 5; | ||
| obj_controller.disposition[eFACTION.Ecclesiarchy] += 6; | ||
| obj_controller.disposition[eFACTION.Inquisition] += 4; | ||
|
Frost-bit-jpg marked this conversation as resolved.
Outdated
|
||
| } else { | ||
| log_error("obj_controller not found in check_purge_milestone!"); | ||
| } | ||
| // --- END ACTION TO PERFORM --- | ||
| } | ||
| } | ||
|
Frost-bit-jpg marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| "$GMScript":"v1", | ||
| "%Name":"scr_battle_count", | ||
| "isCompatibility":false, | ||
| "isDnD":false, | ||
| "name":"scr_battle_count", | ||
|
Frost-bit-jpg marked this conversation as resolved.
|
||
| "parent":{ | ||
| "name":"Helpers", | ||
| "path":"folders/Scripts/Helpers.yy", | ||
| }, | ||
|
Frost-bit-jpg marked this conversation as resolved.
Outdated
|
||
| "resourceType":"GMScript", | ||
| "resourceVersion":"2.0", | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.