Skip to content
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

Create an option to make Fatigue and Injury Times Independent #1149

Merged

Conversation

Grobobobo
Copy link
Contributor

Fixes #1148

@github-actions
Copy link
Contributor

github-actions bot commented Jun 26, 2022

Pull request modifies event listener templates

Difference (click to expand)
diff --git a/target/CHL_Event_Compiletest.uc b/target/CHL_Event_Compiletest.uc
index c229218..ceded57 100644
--- a/target/CHL_Event_Compiletest.uc
+++ b/target/CHL_Event_Compiletest.uc
@@ -630,6 +630,24 @@ static function EventListenerReturn OnOverrideHitEffects(Object EventData, Objec
 	return ELR_NoInterrupt;
 }
 
+static function EventListenerReturn OnOverrideInjuryClearingFatigueBehavior(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
+{
+	local XComGameState_Unit UnitState;
+	local XComLWTuple Tuple;
+	local bool ShouldOverride;
+
+	UnitState = XComGameState_Unit(EventSource);
+	Tuple = XComLWTuple(EventData);
+
+	ShouldOverride = Tuple.Data[0].b;
+
+	// Your code here
+
+	Tuple.Data[0].b = ShouldOverride;
+
+	return ELR_NoInterrupt;
+}
+
 static function EventListenerReturn OnOverrideKillXp(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
 {
 	local XComGameState_Unit KilledUnit;
What? (click to expand)

The Highlander documentation tool generates event listener examples from event specifications.
This comment contains the modifications that would be made to the copy-pasteable event listeners in documentation, for PR authors and reviewers to inspect for correctness, and will automatically be kept up-to-date whenever this PR is updated.

@Iridar
Copy link
Contributor

Iridar commented Jun 26, 2022

Looks good to me. Is this tested?

@Iridar Iridar added the ready-to-review A pull request is ready to be reviewed label Jun 26, 2022
@Iridar Iridar added this to the 1.25.0 milestone Jun 26, 2022
@Xymanek
Copy link
Member

Xymanek commented Jun 26, 2022

How does the unit status UI behave?

…ntext_HeadquartersOrder.uc

Co-authored-by: robojumper <robojumper@gmail.com>
@Grobobobo
Copy link
Contributor Author

I've tested it, if you just put it to false, then the unit switches to the shaken status after recovering from injury.

@Xymanek
Copy link
Member

Xymanek commented Jul 4, 2022

the unit switches to the shaken status after recovering from injury

The problem with this is that the player has no idea when the soldier will actually be available for duty

@Grobobobo
Copy link
Contributor Author

Grobobobo commented Jul 4, 2022

the unit switches to the shaken status after recovering from injury

The problem with this is that the player has no idea when the soldier will actually be available for duty

I don't think it's that big of a problem, you can still clearly see the red will regardless, but even then
I imagine it'll be possible to modify the injury status message to also display shaken/tired time

@Iridar
Copy link
Contributor

Iridar commented May 12, 2023

A systemic change like that would've been probably better implemented as a config bool, I struggle to come up with a use case where you would want different behavior for different soldiers in this regard.

The problem with this is that the player has no idea when the soldier will actually be available for duty

I agree that this is a problem as well.

However, I don't see either as grounds enough to deny this change, seeing as it preserves the vanilla behavior either way.

@Iridar Iridar added ready-for-merge the pull request was reviewed and is ready to be merged. and removed ready-to-review A pull request is ready to be reviewed labels May 12, 2023
@Iridar Iridar merged commit d386bf6 into X2CommunityCore:master May 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge the pull request was reviewed and is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an option to make Fatigue and Injury Times Independent
4 participants