Fix: passive effects not revoked on combat death or sacrifice
The attack resolution and sacrifice paths in GameEngine.cs bypassed RevokePassivesForSource (and EvaluateAurasOnLeave for combat deaths). Now all three exit points call both aura/passive cleanup before removing the unit from the board. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -665,6 +665,8 @@ public static class GameEngine
|
||||
|
||||
if (attacker.CurrentHealth <= 0)
|
||||
{
|
||||
AbilitySystem.EvaluateAurasOnLeave(state, attacker.InstanceId);
|
||||
AbilitySystem.RevokePassivesForSource(state, attacker.InstanceId);
|
||||
if (state.Board is not null) state.Board.RemoveUnit(attacker.InstanceId);
|
||||
MoveToDiscard(activePlayer, attacker);
|
||||
|
||||
@@ -686,6 +688,8 @@ public static class GameEngine
|
||||
}
|
||||
else
|
||||
{
|
||||
AbilitySystem.EvaluateAurasOnLeave(state, target.InstanceId);
|
||||
AbilitySystem.RevokePassivesForSource(state, target.InstanceId);
|
||||
if (state.Board is not null) state.Board.RemoveUnit(target.InstanceId);
|
||||
MoveToDiscard(opponentPlayer, target);
|
||||
|
||||
@@ -738,6 +742,7 @@ public static class GameEngine
|
||||
player.CurrentSt += stReturn;
|
||||
|
||||
AbilitySystem.EvaluateAurasOnLeave(state, unitInstanceId);
|
||||
AbilitySystem.RevokePassivesForSource(state, unitInstanceId);
|
||||
if (state.Board is not null) state.Board.RemoveUnit(unitInstanceId);
|
||||
player.Field.Remove(unit);
|
||||
player.Discard.Add(unit);
|
||||
|
||||
Reference in New Issue
Block a user