Skip to content

Commit

Permalink
Add Storm Caller
Browse files Browse the repository at this point in the history
Fixes #346
  • Loading branch information
radar committed Jul 15, 2023
1 parent b2a299b commit 4db4eee
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/magic/cards/storm_caller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module Magic
module Cards
StormCaller = Creature("Storm Caller") do
creature_type("Ogre Shaman")
cost red: 1, generic: 2
power 3
toughness 2
end

class StormCaller < Creature
class ETB < TriggeredAbility::EnterTheBattlefield

def perform
effect = Effects::DealDamage.new(
source: permanent,
choices: game.opponents(controller),
targets: game.opponents(controller),
damage: 2,
)
game.add_effect(effect)
end
end

def etb_triggers = [ETB]
end
end
end
14 changes: 14 additions & 0 deletions spec/cards/storm_caller_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'spec_helper'

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

let(:card) { Card("Storm Caller") }

it "deals 2 damage to each opponent" do
p2_starting_life = p2.life
card.resolve!(p1)

expect(p2.life).to eq(p2_starting_life - 2)
end
end

0 comments on commit 4db4eee

Please sign in to comment.