Skip to content

Commit

Permalink
Add Igneous Cur
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Jan 29, 2024
1 parent ba31f7e commit c541a7b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/magic/cards/igneous_cur.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module Magic
module Cards
IgneousCur = Creature("Igneous Cur") do
creature_type("Elemental Dog")
power 1
toughness 2
end

class IgneousCur < Creature
class ActivatedAbility < Magic::ActivatedAbility
def costs
[Costs::Mana.new(red: 1, generic: 1)]
end

def resolve!
source.modify_power(2)
end
end

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

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

subject { ResolvePermanent("Igneous Cur", owner: p1) }


context "activated ability" do
it "increases power by +2" do
expect(subject.power).to eq(1)
expect(subject.activated_abilities.count).to eq(1)
p1.add_mana(red: 2)

ability = subject.activated_abilities.first
p1.activate_ability(ability: ability) do
_1.pay_mana(red: 1, generic: { red: 1 })
end
game.stack.resolve!
expect(subject.power).to eq(3)

p1.add_mana(red: 2)
p1.activate_ability(ability: ability) do
_1.pay_mana(red: 1, generic: { red: 1 })
end
game.stack.resolve!

expect(subject.power).to eq(5)
expect(subject.toughness).to eq(2)
end
end
end

0 comments on commit c541a7b

Please sign in to comment.