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

Enemy Protocol Hack Reward also grants a permanent hack bonus equal to current temporary Hack stat modifiers #1350

Open
Mitzruti opened this issue May 29, 2024 · 2 comments · May be fixed by #1449
Assignees
Milestone

Comments

@Mitzruti
Copy link
Contributor

This appears to be caused by the reward calculating what to set the soldier's base stat to by using GetMaxStat.

presumably it could be fixed by changing GetMaxStat to GetBaseStat, but i haven't tested that to see if it results in any other wierdness.

vanilla modifiers (gremlin, skullmining) work around this by being built into the aim calculation rather than being actual stat mods, so this is primarily an issue with modded bonuses.

@Iridar Iridar added this to the 1.30.0 milestone Dec 10, 2024
@BlackDog86
Copy link
Contributor

BlackDog86 commented Jan 6, 2025

Did a bit of logging with this - Specialist with Gremlin MKII and Iridar's Hacker's Laptop - Base hack stat of 55 and with +25 from Hacker's Laptop:
function ApplyEnemyProtocol(XComGameState_Unit Hacker, XComGameState_BaseObject HackTarget, XComGameState NewGameState)

{
	local XComGameState_Unit HackerState;

	HackerState = XComGameState_Unit(NewGameState.ModifyStateObject(class'XComGameState_Unit', Hacker.ObjectID));
	`log("Enemy protocol acitvated: Old Base Stat:" @ HackerState.GetBaseStat(eStat_Hacking) @ "Old Max Stat: " @ HackerState.GetMaxStat(eStat_Hacking) @ "Old CurrentStat: " @ HackerState.GetCurrentStat(eStat_Hacking),,'BDLOG');
	HackerState.SetBaseMaxStat(eStat_Hacking, HackerState.GetMaxStat(eStat_Hacking) + ENEMY_PROTOCOL_HACKING_BONUS);
	`log("Enemy protocol acitvated: New Base Stat:" @ HackerState.GetBaseStat(eStat_Hacking) @ "New Max Stat: " @ HackerState.GetMaxStat(eStat_Hacking) @ "New CurrentStat: " @ HackerState.GetCurrentStat(eStat_Hacking),,'BDLOG');
}

[0105.52] BDLOG: Enemy protocol activated: Old Base Stat: 55.0000 Old Max Stat: 80.0000 Old CurrentStat: 80.0000
[0105.52] BDLOG: Enemy protocol activated: New Base Stat: 100.0000 New Max Stat: 125.0000 New CurrentStat: 125.0000

So this gave a hack boost of essentially 45 to the unit (+25 from items and +20 from default.ENEMY_PROTOCOL_HACKING_BONUS) instead of just 20.

@BlackDog86
Copy link
Contributor

BlackDog86 commented Jan 6, 2025

Doing it with just a Gremlin equipped gives different results:

[1589.38] BDLOG: Enemy protocol acitvated: Old Base Stat: 75.0000 Old Max Stat:  75.0000 Old CurrentStat:  75.0000
[1589.38] BDLOG: Enemy protocol acitvated: New Base Stat: 95.0000 New Max Stat:  95.0000 New CurrentStat:  95.0000

So it seems Mitz is correct regarding how these are applied.

Tested this a fair bit with changing the code to base stat and this does appear to fix the problem quite well. Further testing required but looks promising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants