class Side
Attributes
game[RW]
Public Instance Methods
acquire_free(card)
click to toggle source
# File lib/ascension.rb, line 151 def acquire_free(card) discard << card game.center_wc.remove(card) fire_event Event::CardPurchased.new(:card => card) end
defeat(monster)
click to toggle source
# File lib/ascension.rb, line 161 def defeat(monster) game.void << monster game.center.remove(monster) unless monster.name =~ /cultist/i && !game.center.include?(monster) fire_event Event::MonsterKilled.new(:card => monster, :center => true) monster.apply_abilities(self) played.pool.power -= monster.power_cost end
draw_hand!()
click to toggle source
# File lib/ascension.rb, line 141 def draw_hand! 5.times { draw_one! } end
draw_one!()
click to toggle source
# File lib/ascension.rb, line 144 def draw_one! hand << deck.draw_one end
end_turn!()
click to toggle source
# File lib/ascension.rb, line 180 def end_turn! played.discard! hand.discard! constructs.apply! draw_hand! end
engage(card)
click to toggle source
# File lib/ascension.rb, line 170 def engage(card) if card.monster? defeat(card) else purchase(card) end end
engageable_cards()
click to toggle source
# File lib/ascension.rb, line 177 def engageable_cards game.center_wc.engageable_cards(self) end
fire_event(event)
click to toggle source
# File lib/ascension.rb, line 192 def fire_event(event) events << event end
other_side()
click to toggle source
# File lib/ascension.rb, line 195 def other_side game.sides.reject { |x| x == self }.first end
play(card)
click to toggle source
# File lib/ascension.rb, line 147 def play(card) played << card hand.remove(card) end
print_status!()
click to toggle source
# File lib/ascension.rb, line 198 def print_status! puts "Center " + game.center.to_s_cards puts "Hand " + hand.to_s_cards puts "Played " + played.to_s_cards puts "Constructs " + constructs.to_s_cards unless constructs.empty? puts "Pool " + played.pool.to_s end
purchase(card)
click to toggle source
# File lib/ascension.rb, line 156 def purchase(card) acquire_free(card) #card.apply_abilities(self) played.pool.runes -= card.rune_cost end
total_cards()
click to toggle source
# File lib/ascension.rb, line 187 def total_cards [hand,played,deck,discard].map { |x| x.size }.sum end