Jump to content

Revive Bug Fix and optional boost


Amineri

Recommended Posts

The Perk/Ability Revive has a bug in that a revived soldier is supposed to be given one additional move after being revived, in order to get out of the dangerous spot that resulted in them being critically wounded in the first place.

 

In the code that processes the Revive effects is the following:

	if(kAbility.m_kUnit.GetCharacter().HasUpgrade(56))
	{
		kTarget.Stabilize();
		kTarget.SetUnitHP(int((float(kTarget.GetUnitMaxHP()) * 0.330) + float(1)));
		kTarget.GiveOneMove();
	}
	kTarget.AddRecoverFromCriticallyWoundedAction();

Unfortunately the GiveOneMove() was bugged. It did correctly give the soldier +1 move action, but that was insufficient to make the soldier selectable and movable.

 

This hex change modifies the GiveOneMove() function to allow the soldier to take an action upon being revived. This action can be a move action or a fire action, or some other action that the soldier could take after having moved once.

 

The hex change is made to XGUnit.GiveOneMove

 

 

original hex:
4A B4 00 00 50 55 00 00 00 00 00 00 35 B4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 1B 00 00 97 59 03 00 38 00 00 00 30 00 00 00 07 35 00 9A 1B 64 33 00 00 00 00 00 00 16 25 16 1B 59 62 00 00 00 00 00 00 26 16 07 35 00 97 01 B6 30 00 00 26 16 0F 01 B6 30 00 00 26 04 0B 53 

new hex: (virtual 0x34)
4A B4 00 00 50 55 00 00 00 00 00 00 35 B4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 1B 00 00 97 59 03 00 34 00 00 00 30 00 00 00 1B 59 62 00 00 00 00 00 00 26 16 0F 01 B6 30 00 00 26 1B E8 5D 00 00 00 00 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 0B 53  

 

 

 

After the change the decompiled code should read:

 

 

function GiveOneMove()
{
	SetMoves(1);
	m_iMovesActionsPerformed = 1;
	ResetUseAbilities();
}
 

 

 

 

------------------------------------------

 

Revive and Stabilize have two additional permanent side effects, one well known, the other less so

  1. The soldier suffers a permanent -15 to will
  2. The soldier's CriticalWoundsReceived stat (stat[15]) is increased by 1

The CriticalWoundsReceived stat prevents a soldier from being critically wounded if the stat is > 0. This means that a soldier can only be critically wounded and stabilized/revived once per campaign. The second time the soldier reaches 0 HP the criticalwound check automatically fails.

 

In an attempt to make Revive a slightly more attractive perk, I've made an additional optional hex change that has two effects:

  1. The permanent will drop is reduced to -5 (for the remainder of the mission the soldier still suffers from -15 will, however)
  2. The CriticalWoundsReceived is decreased by 1 back to 0

The critically wounded and revived soldier will suffer a -15 will penalty for the duration of the mission, PLUS another -10 will if still wounded for a total penalty of -25 (confirmed -- rookie had 15 will in this state). However, upon returning to HQ only the -5 of the penalty will be permanent.

 

None of these apply to stabilizing -- they only apply to the Revive skill

 

Hex change for optional boost, XGAbilityTree.ApplyEffectsToTargets :

 

 

 

original hex: 
07 30 17 19 19 19 00 BD 7E 00 00 09 00 E6 7B 00 00 00 01 E6 7B 00 00 0A 00 63 B4 00 00 00 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 38 16 19 00 BC 7E 00 00 0A 00 00 00 00 00 00 1B EF 66 00 00 00 00 00 00 16 19 00 BC 7E 00 00 97 00 00 00 00 00 00 1B 25 63 00 00 00 00 00 00 38 44 AE AB 38 3F 19 00 BC 7E 00 00 0A 00 35 34 00 00 00 1B 32 35 00 00 00 00 00 00 16 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 05 00 F0 2C 00 00 00 1E C3 F5 A8 3E 16 38 3F 26 16 16 19 00 BC 7E 00 00 0A 00 00 00 00 00 00 1B B6 35 00 00 00 00 00 00 16 19 00 BC 7E 00 00 0A 00 00 00 00 00 00 1B 48 02 00 00 00 00 00 00 16 


new hex:  
19 00 BC 7E 00 00 0A 00 00 00 00 00 00 1B EF 66 00 00 00 00 00 00 16 19 00 BC 7E 00 00 39 00 00 00 00 00 00 1B 25 63 00 00 00 00 00 00 38 44 AE AB 38 3F 19 00 BC 7E 00 00 0A 00 35 34 00 00 00 1B 32 35 00 00 00 00 00 00 16 1E C3 F5 A8 3E 16 38 3F 26 16 16 A2 1A 2C 0F 19 00 BC 7E 00 00 09 00 0D 31 00 00 00 01 0D 31 00 00 26 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 00 19 19 00 BC 7E 00 00 0A 00 63 B4 00 00 00 1B 7B 31 00 00 00 00 00 00 16 09 00 C3 A2 00 00 00 01 C3 A2 00 00 2C 0A 16 19 00 BC 7E 00 00 0A 00 00 00 00 00 00 1B B6 35 00 00 00 00 00 00 16 19 00 BC 7E 00 00 0A 00 00 00 00 00 00 1B 48 02 00 00 00 00 00 00 16 00 BC 7E 00 00 00 BC 7E 00 00 00 BC 7E 00 00 00 BC 7E 00 00 00 BC 7E 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 
 

 

 

 

After the change the decompiled code should read:

 

 

 

kTarget.Stabilize();
kTarget.SetUnitHP(int((float(kTarget.GetUnitMaxHP()) * 0.330) + float(1)));
kTarget.GiveOneMove();
kTarget.m_aCurrentStats[15] -= 1;
kTarget.GetCharacter().m_kChar.aStats[7] += 10;
kTarget.AddRecoverFromCriticallyWoundedAction(); 

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...