Skip to content

Commit

Permalink
Refactor Golgari Guildgate
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Jan 26, 2024
1 parent 1c06089 commit c5399c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
19 changes: 2 additions & 17 deletions lib/magic/cards/golgari_guildgate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,8 @@ def enters_tapped?
true
end

class ManaAbility < Magic::ManaAbility
def initialize(source:)
@costs = [Costs::Tap.new(source)]

super
end

def resolve!
game.add_effect(
Effects::AddManaOrAbility.new(
source: source,
player: source.controller,
black: 1,
green: 1
)
)
end
class ManaAbility < Magic::TapManaAbility
choices :black, :green
end

def activated_abilities = [ManaAbility]
Expand Down
6 changes: 2 additions & 4 deletions spec/cards/golgari_guildgate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
end

it "taps for either black or green" do
p1.activate_ability(ability: permanent.activated_abilities.first) do
_1.pay_tap
p1.activate_mana_ability(ability: permanent.activated_abilities.first) do
_1.choose(:black)
end
game.resolve_pending_effect(black: 1)
expect(game.effects).to be_empty
expect(p1.mana_pool[:black]).to eq(1)
end
end

0 comments on commit c5399c0

Please sign in to comment.