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

Revival Protocol and Restoration are bugged and do not function as advertised #1414

Open
Iridar opened this issue Nov 28, 2024 · 2 comments · May be fixed by #1415
Open

Revival Protocol and Restoration are bugged and do not function as advertised #1414

Iridar opened this issue Nov 28, 2024 · 2 comments · May be fixed by #1415
Assignees

Comments

@Iridar
Copy link
Contributor

Iridar commented Nov 28, 2024

1. Incorrect number of charges for Revival Protocol

In-game description for Revival Protocol states:

Conventional GREMLIN drones grant a single Revival Protocol charge, but upgrading your GREMLIN will lead to more Revival Protocol charges.

X2GremlinTemplate has the RevivalChargesBonus, which is used by X2AbilityCharges_RevivalProtocol, but it's not used anywhere.

The Revival Protocol is coded to have the same number of default.REVIVAL_PROTOCOL_CHARGES.

This issue is fixed by (WOTC) Revival Protocol Charges Fix

2. Revival Protocol can be used only on player-controlled units

In-game description:

Send the GREMLIN to an ally...

This is more open to interpretation, but there's no reason for the Revival Protocol to be unable to target allied units such as Resistance Militia.

3. Revival Protocol is not usable on stunned units

The X2Condition_RevivalProtocol simply does not include "is unit stunned" check.

4. Revival Protocol and Restoration do not remove stun

In fact, they don't remove stun at all, they merely give the unit action points.

Bugs 2-3-4 are fixed by [WotC] Revival Protocol Fixes

5. Revival Protocol and Restoration do not restore action points correctly

Both of them apply awful X2Effect_RestoreActionPoints, which doesn't take into account the fact that different units can have different number of actions points per turn.

simulated protected function OnEffectAdded(const out EffectAppliedData ApplyEffectParameters, XComGameState_BaseObject kNewTargetState, XComGameState NewGameState, XComGameState_Effect NewEffectState)
{
	local XComGameState_Unit TargetUnit;

	TargetUnit = XComGameState_Unit(kNewTargetState);
	if (TargetUnit != none)
	{
		while (TargetUnit.NumActionPoints(class'X2CharacterTemplateManager'.default.StandardActionPoint) < class'X2CharacterTemplateManager'.default.StandardActionsPerTurn)
		{
			TargetUnit.ActionPoints.AddItem(class'X2CharacterTemplateManager'.default.StandardActionPoint);
		}
	}
}
@Iridar
Copy link
Contributor Author

Iridar commented Nov 28, 2024

Regarding bug (1) - incorrect number of charges.

This is gonna be a tough cookie to crumble, because fixing it will require gameplay-altering changes, and it's gonna be hard to balance common sense, reasonable expectations and Firaxis intentions.

The in-game description clearly states that you're supposed to get more charges with higher tier Gremlins. So players could reasonably expect getting an additional charge when upgrading to MG Gremlin, and then another at BM tier, making the ability 1/2/3.

However, Firaxis set RevivalChargesBonus=1 only for the BM Gremlin, suggesting they intended for this ability to be 1/1/2.

Scanning Protocol - which does correctly use a similar ScanningChargesBonus variable on the Gremlin Template, also gets a bonus charge only at BM level, even though the description for Scanning Protocol says:

Scanning Protocol has one charge per mission.

which isn't a bug anyone is in a hurry to fix, I guess making us a bit hypocritical.

Returning back to the Revival Protocol, the Revival Protocol Charges Fix mod does fix it to be 1/1/2, though in Vanilla Classes Redux I fix it to be 1/2/3.

Making it 1/1/2 would require replacing X2AbilityCharges on the Revival Protocol with X2AbilityCharges_RevivalProtocol, so a one line fix.

Making it 1/2/2 or 1/2/3 would also require messing with Gremlin Templates and - presumably - adding additional config variables to make extra charges at each gremlin tier configurable, and that's more than I'm comfortable with, even though I believe it would be a valid thing to do. It's also an easy OPTC fix for a third party mod. So I guess it's okay to leave it at 1/1/2.

@Iridar
Copy link
Contributor Author

Iridar commented Nov 28, 2024

Bug (4) - not removing stun.

Removing stun via X2Effect_RemoveEffects allows the X2Effect_RestoreActionPoints to do its thing, so the unit can move and recover from stun properly. However, if the unit is stunned for more than one "turn", they will be unable to take actions on the following turns until StunnedActionPoints are exhausted.

So just removing the stun isn't enough, we also need to apply X2Effect_StunRecover instead of X2Effect_RestoreActionPoints, which will reset StunnedActionPoints.

X2Effect_RestoreActionPoints is still necessary to grant action points if the unit was panicked/dazed/unconscious, though.

Making these abilities to remove stun can be done either by adding a separate X2Effect_RemoveEffects to each ability template, or just by adding stun effect name to the RemoveAdditionalEffectsForRevivalProtocolAndRestorativeMist().

While the second way is technically more invasive, I believe it to be appropriate, and if this alters any mod-added abilities, it will likely just make the function as intended.

Iridar pushed a commit to Iridar/X2WOTCCommunityHighlander that referenced this issue Nov 28, 2024
@Iridar Iridar linked a pull request Nov 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants