Skip to content

Commit

Permalink
Simplify Archon of Sun's Grace static ability
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Oct 27, 2024
1 parent 1e961fd commit a207ca7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/magic/cards/archon_of_suns_grace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,8 @@ def call
end

class LifelinkAddition < StaticAbility
def initialize(source:)
@source = source
end

def keywords
[Cards::Keywords::LIFELINK]
end

def applicable_targets
source.controller.creatures.of_type("Pegasus")
end
keyword_grants Cards::Keywords::LIFELINK
applicable_targets { source.controller.creatures.of_type("Pegasus") }
end

def static_abilities = [LifelinkAddition]
Expand Down
12 changes: 12 additions & 0 deletions lib/magic/static_ability.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
module Magic
class StaticAbility
def self.keyword_grants(*keywords)
define_method(:keywords) { keywords }
end

def self.applicable_targets(&block)
define_method(:applicable_targets, block)
end

def initialize(source:)
@source = source
end

def power
0
end
Expand Down

0 comments on commit a207ca7

Please sign in to comment.