Skip to content

Commit

Permalink
Don't remove judgement of justice if a hero is attacking (HearthSim#4344
Browse files Browse the repository at this point in the history
)

* Don't remove judgement of justice if a hero is attacking

* Fix secrets
  • Loading branch information
Jonysegal authored Sep 14, 2021
1 parent 243445d commit 3a5a68e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions HDTTests/Hearthstone/Secrets/SecretEventHandlerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void SingleSecret_HeroToHero_PlayerAttackTest()
_game.SecretsManager.HandleAttack(_heroPlayer, _heroOpponent);
VerifySecrets(0, HunterSecrets.All, HunterSecrets.BearTrap, HunterSecrets.ExplosiveTrap, HunterSecrets.WanderingMonster);
VerifySecrets(1, MageSecrets.All, MageSecrets.IceBarrier);
VerifySecrets(2, PaladinSecrets.All, PaladinSecrets.NobleSacrifice, PaladinSecrets.JudgmentOfJustice);
VerifySecrets(2, PaladinSecrets.All, PaladinSecrets.NobleSacrifice);
VerifySecrets(3, RogueSecrets.All);

_playerMinion1.SetTag(GameTag.ZONE, (int)Zone.PLAY);
Expand All @@ -179,7 +179,7 @@ public void SingleSecret_HeroToHero_PlayerAttackTest()
VerifySecrets(0, HunterSecrets.All, HunterSecrets.BearTrap, HunterSecrets.ExplosiveTrap,
HunterSecrets.Misdirection, HunterSecrets.WanderingMonster);
VerifySecrets(1, MageSecrets.All, MageSecrets.IceBarrier);
VerifySecrets(2, PaladinSecrets.All, PaladinSecrets.NobleSacrifice, PaladinSecrets.JudgmentOfJustice);
VerifySecrets(2, PaladinSecrets.All, PaladinSecrets.NobleSacrifice);
VerifySecrets(3, RogueSecrets.All);
}

Expand Down Expand Up @@ -211,7 +211,7 @@ public void SingleSecret_HeroToMinion_PlayerAttackTest()
_game.SecretsManager.HandleAttack(_heroPlayer, _opponentMinion1);
VerifySecrets(0, HunterSecrets.All, HunterSecrets.SnakeTrap, HunterSecrets.VenomstrikeTrap, HunterSecrets.PackTactics);
VerifySecrets(1, MageSecrets.All, MageSecrets.SplittingImage, MageSecrets.OasisAlly);
VerifySecrets(2, PaladinSecrets.All, PaladinSecrets.NobleSacrifice, PaladinSecrets.AutodefenseMatrix, PaladinSecrets.JudgmentOfJustice);
VerifySecrets(2, PaladinSecrets.All, PaladinSecrets.NobleSacrifice, PaladinSecrets.AutodefenseMatrix);
VerifySecrets(3, RogueSecrets.All, RogueSecrets.Bamboozle);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,19 @@ public void HandleAttack(Entity attacker, Entity defender, bool fastOnly = false

var exclude = new List<MultiIdCard>();

exclude.Add(Paladin.JudgmentOfJustice);

var freeSpaceOnBoard = FreeSpaceOnBoard;
if(freeSpaceOnBoard)
exclude.Add(Paladin.NobleSacrifice);

if(attacker.IsHero)
{

}
else
{
exclude.Add(Paladin.JudgmentOfJustice);
}

if(defender.IsHero)
{
if(!fastOnly && attacker.Health >= 1)
Expand Down

0 comments on commit 3a5a68e

Please sign in to comment.