Skip to content

Commit

Permalink
Add Radiant Fountain
Browse files Browse the repository at this point in the history
Fixes #259
  • Loading branch information
radar committed Jan 29, 2024
1 parent d0c3650 commit 2dadae9
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/magic/cards/radiant_fountain.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module Magic
module Cards
RadiantFountain = Card("Radiant Fountain") do
type "Land"

enters_the_battlefield do
permanent.controller.gain_life(2)
end
end

class RadiantFountain < Card
def enters_tapped?
false
end

class ManaAbility < Magic::TapManaAbility
choices :colorless
end

def activated_abilities = [ManaAbility]
end
end
end
37 changes: 37 additions & 0 deletions spec/cards/radiant_fountain_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
require 'spec_helper'

RSpec.describe Magic::Cards::RadiantFountain do
include_context "two player game"

let(:card) { Card("Radiant Fountain") }

let!(:permanent) do
p1.play_land(land: card)
p1.permanents.by_name("Radiant Fountain").first
end

it "enters the battlefield untapped" do
game.stack.resolve!
expect(permanent).not_to be_tapped
end

it "has the controller gain life" do
expect(p1.life).to eq(22)
end

it "taps for colorless" do
p1.activate_mana_ability(ability: permanent.activated_abilities.first) do
_1.choose(:colorless)
end

expect(p1.mana_pool[:colorless]).to eq(1)
end

it "cannot tap for another color" do
expect {
p1.activate_mana_ability(ability: permanent.activated_abilities.first) do
_1.choose(:blue)
end
}.to raise_error("Invalid choice made for mana ability:")
end
end

0 comments on commit 2dadae9

Please sign in to comment.