File tree Expand file tree Collapse file tree 3 files changed +53
-2
lines changed
Expand file tree Collapse file tree 3 files changed +53
-2
lines changed Original file line number Diff line number Diff line change 1+ # Al Bhed Salvagers {2}{B}
2+ # Creature — Human Artificer Warrior
3+ # Whenever this creature or another creature or artifact you control dies, target opponent loses 1 life and you gain 1 life.
4+ # 2/3
5+
6+ module Magic
7+ module Cards
8+ AlBhedSalvagers = Creature ( "Al Bhed Salvagers" ) do
9+ power 2
10+ toughness 3
11+ cost generic : 2 , black : 1
12+ creature_type "Human Artificer Warrior"
13+ end
14+
15+ class AlBhedSalvagers < Creature
16+ class Choice < Magic ::Choice
17+ def choices
18+ Magic ::Targets ::Choices . new (
19+ choices : game . opponents ( controller ) ,
20+ amount : 1 ,
21+ )
22+ end
23+
24+ def resolve! ( target :)
25+ target . trigger_effect ( :lose_life , source : actor , life : 1 )
26+ end
27+ end
28+
29+ class DeathTriggeredAbility < TriggeredAbility
30+ def should_perform?
31+ this? || ( you? && ( type? ( T ::Creature ) || type? ( T ::Artifact ) ) )
32+ end
33+
34+ def call
35+ game . add_choice ( AlBhedSalvagers ::Choice . new ( actor : actor ) )
36+
37+ actor . trigger_effect ( :gain_life , life : 1 )
38+ end
39+ end
40+
41+ def event_handlers
42+ {
43+ Events ::CreatureDied => DeathTriggeredAbility
44+ }
45+ end
46+
47+ end
48+ end
49+ end
Original file line number Diff line number Diff line change 11module Magic
22 module Cards
3- GoobbueGardner = Creature ( "Goobbue Gardener" ) do
3+ GoobbueGardener = Creature ( "Goobbue Gardener" ) do
44 power 1
55 toughness 3
66 cost generic : 1 , green : 1
77 creature_type "Plant Beast"
88 end
99
10- class GoobbueGardner < Card
10+ class GoobbueGardener < Creature
1111 class ManaAbility < Magic ::TapManaAbility
1212 choices :green
1313 end
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ def initialize(permanent)
88 @controller = permanent . controller
99 end
1010
11+ def player = controller
12+
1113 def inspect
1214 "#<Events::CreatureDied permanent: #{ permanent . name } , controller: #{ controller . name } >"
1315 end
You can’t perform that action at this time.
0 commit comments