From d1c7be258820628b94bf7440fb40552b027831ff Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 8 Nov 2024 08:31:13 +1100 Subject: [PATCH] Fix all remaining specs --- lib/magic/cards/primal_might.rb | 2 ++ lib/magic/cards/tide_skimmer.rb | 2 ++ lib/magic/game.rb | 4 +--- spec/cards/animal_sanctuary_spec.rb | 2 +- spec/cards/basris_solidarity_spec.rb | 2 ++ spec/cards/bog_badger_spec.rb | 1 + spec/cards/burn_bright_spec.rb | 2 ++ spec/cards/charge_through_spec.rb | 1 + spec/cards/containment_priest_spec.rb | 1 + spec/cards/defiant_strike_spec.rb | 1 + spec/cards/doomwake_giant_spec.rb | 2 ++ spec/cards/feat_of_resistance_spec.rb | 1 + spec/cards/grasp_of_darkness_spec.rb | 1 + spec/cards/heroic_intervention_spec.rb | 1 + spec/cards/massacre_girl_spec.rb | 3 +++ spec/cards/primal_might_spec.rb | 1 + spec/cards/rookie_mistake_spec.rb | 1 + spec/cards/rousing_read_spec.rb | 1 + spec/cards/shalais_acolyte_spec.rb | 2 ++ spec/cards/siege_striker_spec.rb | 2 ++ spec/cards/sure_strike_spec.rb | 2 ++ spec/cards/titanic_growth_spec.rb | 1 + spec/cards/watcher_of_the_spheres_spec.rb | 1 + 23 files changed, 33 insertions(+), 4 deletions(-) diff --git a/lib/magic/cards/primal_might.rb b/lib/magic/cards/primal_might.rb index b8d9eac..7d28aa4 100644 --- a/lib/magic/cards/primal_might.rb +++ b/lib/magic/cards/primal_might.rb @@ -22,6 +22,8 @@ def resolve!(targets:, value_for_x:) toughness: value_for_x ) + game.tick! + first_creature.fight(second_creature) end end diff --git a/lib/magic/cards/tide_skimmer.rb b/lib/magic/cards/tide_skimmer.rb index ce90ce2..af97e82 100644 --- a/lib/magic/cards/tide_skimmer.rb +++ b/lib/magic/cards/tide_skimmer.rb @@ -5,6 +5,8 @@ class TideSkimmer < Creature cost "{3}{U}" creature_type "Drake" keywords :flying + power 2 + toughness 3 class AttackerTrigger < TriggeredAbility def should_perform? diff --git a/lib/magic/game.rb b/lib/magic/game.rb index 380050a..2b99e9c 100644 --- a/lib/magic/game.rb +++ b/lib/magic/game.rb @@ -110,9 +110,7 @@ def add_effect(effect) end logger.debug "Resolving effect: #{effect}" - result = effect.resolve! - tick! - result + effect.resolve! end def tick! diff --git a/spec/cards/animal_sanctuary_spec.rb b/spec/cards/animal_sanctuary_spec.rb index 2f08f6e..7526c73 100644 --- a/spec/cards/animal_sanctuary_spec.rb +++ b/spec/cards/animal_sanctuary_spec.rb @@ -29,8 +29,8 @@ def activate_ability _1.pay_mana(generic: { green: 2 }) _1.targeting(rambunctious_mutt) end - game.stack.resolve! + game.tick! end it "puts a +1/+1 counter on target creature" do diff --git a/spec/cards/basris_solidarity_spec.rb b/spec/cards/basris_solidarity_spec.rb index 4e1fe0c..8f2d21c 100644 --- a/spec/cards/basris_solidarity_spec.rb +++ b/spec/cards/basris_solidarity_spec.rb @@ -11,6 +11,8 @@ it "adds a counter to each creature under p1's control" do cast_and_resolve(card: subject, player: p1) + game.tick! + expect(wood_elves.counters.count).to eq(1) expect(wood_elves.power).to eq(2) expect(wood_elves.toughness).to eq(2) diff --git a/spec/cards/bog_badger_spec.rb b/spec/cards/bog_badger_spec.rb index c89817b..d17fd07 100644 --- a/spec/cards/bog_badger_spec.rb +++ b/spec/cards/bog_badger_spec.rb @@ -15,6 +15,7 @@ action.pay_kicker(black: 1) game.take_action(action) game.stack.resolve! + game.tick! creatures = p1.creatures expect(creatures.all? { |c| c.has_keyword?(:menace) }).to eq(true) diff --git a/spec/cards/burn_bright_spec.rb b/spec/cards/burn_bright_spec.rb index 53e855e..dc7168a 100644 --- a/spec/cards/burn_bright_spec.rb +++ b/spec/cards/burn_bright_spec.rb @@ -17,6 +17,7 @@ end game.stack.resolve! + game.tick! expect(onakke_ogre.power).to eq(6) expect(onakke_ogre.toughness).to eq(2) @@ -36,6 +37,7 @@ _1.pay_mana(red: 1, generic: { red: 2 }) end game.stack.resolve! + game.tick! expect(cloudkin_seer.power).to eq(2) expect(onakke_ogre.power).to eq(6) diff --git a/spec/cards/charge_through_spec.rb b/spec/cards/charge_through_spec.rb index 7263ab2..acdb6a9 100644 --- a/spec/cards/charge_through_spec.rb +++ b/spec/cards/charge_through_spec.rb @@ -17,6 +17,7 @@ action.targeting(wood_elves) game.take_action(action) game.stack.resolve! + game.tick! expect(wood_elves.trample?).to eq(true) expect(charge_through.zone).to be_graveyard end diff --git a/spec/cards/containment_priest_spec.rb b/spec/cards/containment_priest_spec.rb index 3f69b37..b8cd7ab 100644 --- a/spec/cards/containment_priest_spec.rb +++ b/spec/cards/containment_priest_spec.rb @@ -73,6 +73,7 @@ expect{ game.stack.resolve! + game.tick! }.to change { game.exile.cards.count }.by(1) expect(game.battlefield.permanents.count).to eq(1) expect(game.battlefield.permanents.map(&:name)).to_not include('Story Seeker') diff --git a/spec/cards/defiant_strike_spec.rb b/spec/cards/defiant_strike_spec.rb index fd8f306..f091e14 100644 --- a/spec/cards/defiant_strike_spec.rb +++ b/spec/cards/defiant_strike_spec.rb @@ -16,6 +16,7 @@ .targeting(wood_elves) game.take_action(action) game.stack.resolve! + game.tick! buff = wood_elves.modifiers.first expect(buff.power_modification).to eq(1) diff --git a/spec/cards/doomwake_giant_spec.rb b/spec/cards/doomwake_giant_spec.rb index 86a6466..860e03d 100644 --- a/spec/cards/doomwake_giant_spec.rb +++ b/spec/cards/doomwake_giant_spec.rb @@ -20,6 +20,7 @@ end game.stack.resolve! + game.tick! aggregate_failures do expect(p1_ajanis_pridemate.power).to eq(2) @@ -50,6 +51,7 @@ end game.stack.resolve! + game.tick! aggregate_failures do expect(p1_ajanis_pridemate.power).to eq(2) diff --git a/spec/cards/feat_of_resistance_spec.rb b/spec/cards/feat_of_resistance_spec.rb index c83cf46..535f1f3 100644 --- a/spec/cards/feat_of_resistance_spec.rb +++ b/spec/cards/feat_of_resistance_spec.rb @@ -18,6 +18,7 @@ action.pay_mana(white: 1, generic: { white: 1}) game.take_action(action) game.stack.resolve! + game.tick! expect(wood_elves.power).to eq(2) expect(wood_elves.toughness).to eq(2) diff --git a/spec/cards/grasp_of_darkness_spec.rb b/spec/cards/grasp_of_darkness_spec.rb index 4ebc6d4..431f488 100644 --- a/spec/cards/grasp_of_darkness_spec.rb +++ b/spec/cards/grasp_of_darkness_spec.rb @@ -15,6 +15,7 @@ .targeting(wood_elves) game.take_action(action) game.stack.resolve! + game.tick! expect(wood_elves.power).to eq(-3) expect(wood_elves.toughness).to eq(-3) expect(wood_elves).to be_dead diff --git a/spec/cards/heroic_intervention_spec.rb b/spec/cards/heroic_intervention_spec.rb index 6bbcbec..b644128 100644 --- a/spec/cards/heroic_intervention_spec.rb +++ b/spec/cards/heroic_intervention_spec.rb @@ -14,6 +14,7 @@ it "all permanents you control gain hexproof and indestructible" do cast_and_resolve(card: subject) + game.tick! island = p1.permanents.by_name("Island").first wood_elves = p1.permanents.by_name("Wood Elves").first diff --git a/spec/cards/massacre_girl_spec.rb b/spec/cards/massacre_girl_spec.rb index 2065205..4162140 100644 --- a/spec/cards/massacre_girl_spec.rb +++ b/spec/cards/massacre_girl_spec.rb @@ -15,9 +15,12 @@ end game.stack.resolve! + game.tick! # This dies to the ETB -1/-1 triggered ability expect(wood_elves.card.zone).to be_graveyard + + game.tick! # This dies to the "creature died" -1/-1 triggered ability expect(alpine_watchdog.card.zone).to be_graveyard end diff --git a/spec/cards/primal_might_spec.rb b/spec/cards/primal_might_spec.rb index 71b9dbd..a6722fb 100644 --- a/spec/cards/primal_might_spec.rb +++ b/spec/cards/primal_might_spec.rb @@ -15,6 +15,7 @@ _1.pay_mana(green: 1, x: { green: 3 }) end game.stack.resolve! + game.tick! expect(wood_elves.power).to eq(4) expect(alpine_watchdog.damage).to eq(4) diff --git a/spec/cards/rookie_mistake_spec.rb b/spec/cards/rookie_mistake_spec.rb index 533daa1..0e1c3b6 100644 --- a/spec/cards/rookie_mistake_spec.rb +++ b/spec/cards/rookie_mistake_spec.rb @@ -13,6 +13,7 @@ _1.pay_mana(blue: 1) end game.stack.resolve! + game.tick! expect(wood_elves.toughness).to eq(3) expect(pack_leader.power).to eq(0) diff --git a/spec/cards/rousing_read_spec.rb b/spec/cards/rousing_read_spec.rb index 9b2ce84..d218c2d 100644 --- a/spec/cards/rousing_read_spec.rb +++ b/spec/cards/rousing_read_spec.rb @@ -16,6 +16,7 @@ end game.stack.resolve! + game.tick! choice = game.choices.last game.resolve_choice!(card: choice.cards.first) diff --git a/spec/cards/shalais_acolyte_spec.rb b/spec/cards/shalais_acolyte_spec.rb index a9fb178..d226246 100644 --- a/spec/cards/shalais_acolyte_spec.rb +++ b/spec/cards/shalais_acolyte_spec.rb @@ -13,6 +13,7 @@ action.pay_kicker(generic: { white: 1 }, green: 1) game.take_action(action) game.stack.resolve! + game.tick! permanent = p1.creatures.by_name("Shalai's Acolyte").first expect(permanent.power).to eq(5) @@ -26,6 +27,7 @@ action.pay_mana(white: 1, generic: { white: 4 }) game.take_action(action) game.stack.resolve! + game.tick! permanent = p1.creatures.by_name("Shalai's Acolyte").first expect(permanent.power).to eq(3) diff --git a/spec/cards/siege_striker_spec.rb b/spec/cards/siege_striker_spec.rb index 7befdcd..f8a7de5 100644 --- a/spec/cards/siege_striker_spec.rb +++ b/spec/cards/siege_striker_spec.rb @@ -24,6 +24,7 @@ action = Magic::Actions::TapPermanent.new(game: game, player: p1, permanent: wood_elves) game.take_action(action) + game.tick! expect(siege_striker.power).to eq(2) expect(siege_striker.toughness).to eq(2) @@ -35,6 +36,7 @@ action = Magic::Actions::TapPermanent.new(game: game, player: p1, permanent: wood_elves) game.take_action(action) + game.tick! expect(siege_striker.power).to eq(1) expect(siege_striker.toughness).to eq(1) diff --git a/spec/cards/sure_strike_spec.rb b/spec/cards/sure_strike_spec.rb index d868ada..f23fb2c 100644 --- a/spec/cards/sure_strike_spec.rb +++ b/spec/cards/sure_strike_spec.rb @@ -14,6 +14,7 @@ _1.pay_mana(generic: { red: 1 }, red: 1).targeting(onakke_ogre) end game.stack.resolve! + game.tick! expect(onakke_ogre.power).to eq(7) expect(onakke_ogre.toughness).to eq(2) @@ -21,6 +22,7 @@ game.current_turn.end! game.current_turn.cleanup! game.next_turn + game.tick! expect(onakke_ogre.power).to eq(4) expect(onakke_ogre.first_strike?).to eq(false) diff --git a/spec/cards/titanic_growth_spec.rb b/spec/cards/titanic_growth_spec.rb index 6c27b02..6c7c902 100644 --- a/spec/cards/titanic_growth_spec.rb +++ b/spec/cards/titanic_growth_spec.rb @@ -12,6 +12,7 @@ end game.stack.resolve! + game.tick! expect(wood_elves.power).to eq(5) expect(wood_elves.toughness).to eq(5) diff --git a/spec/cards/watcher_of_the_spheres_spec.rb b/spec/cards/watcher_of_the_spheres_spec.rb index 3b439ed..41fa279 100644 --- a/spec/cards/watcher_of_the_spheres_spec.rb +++ b/spec/cards/watcher_of_the_spheres_spec.rb @@ -16,6 +16,7 @@ end it "adds a +1/+1 buff" do + game.tick! expect(watcher_of_the_spheres.power).to eq(3) expect(watcher_of_the_spheres.toughness).to eq(3) end