Skip to content

Commit

Permalink
Fix cheating class level 3 by copying level 2 activation
Browse files Browse the repository at this point in the history
  • Loading branch information
tool4EvEr authored and tool4EvEr committed Nov 28, 2024
1 parent 239ad37 commit 6932446
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import forge.game.Game;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.spellability.SpellAbility;
Expand All @@ -18,8 +19,13 @@ public class ClassLevelUpEffect extends SpellAbilityEffect {
public void resolve(SpellAbility sa) {
final Card host = sa.getHostCard();
final Game game = host.getGame();
final int level = host.getClassLevel() + 1;
host.setClassLevel(level);
final int level = host.getClassLevel();

if (AbilityUtils.calculateAmount(host, sa.getRestrictions().getClassLevel(), sa) != level) {
return;
}

host.setClassLevel(level +1);

// need to run static ability to get Trigger online
game.getAction().checkStaticAbilities();
Expand Down

0 comments on commit 6932446

Please sign in to comment.