From 693244623147ec0449e06ca8a87bac10a2611d5a Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Thu, 28 Nov 2024 18:59:57 +0100 Subject: [PATCH] Fix cheating class level 3 by copying level 2 activation --- .../forge/game/ability/effects/ClassLevelUpEffect.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/ClassLevelUpEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ClassLevelUpEffect.java index 5c7aafc7644..95c7dc47cef 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ClassLevelUpEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ClassLevelUpEffect.java @@ -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; @@ -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();