module Natural20::FighterClass

Attributes

fighter_level[RW]
second_wind_count[RW]

Public Instance Methods

initialize_fighter() click to toggle source
# File lib/natural_20/concerns/fighter_class.rb, line 7
def initialize_fighter
  @second_wind_count = 1
end
second_wind!(amt) click to toggle source
# File lib/natural_20/concerns/fighter_class.rb, line 15
def second_wind!(amt)
  @second_wind_count -= 1
  heal!(amt)
end
second_wind_die() click to toggle source
# File lib/natural_20/concerns/fighter_class.rb, line 11
def second_wind_die
  "1d10+#{@fighter_level}"
end
short_rest_for_fighter(_battle) click to toggle source

hooks for the fighter class during a short rest

# File lib/natural_20/concerns/fighter_class.rb, line 32
def short_rest_for_fighter(_battle)
  @second_wind_count = 1
end
special_actions_for_fighter(session, battle) click to toggle source
# File lib/natural_20/concerns/fighter_class.rb, line 20
def special_actions_for_fighter(session, battle)
  %i[second_wind].map do |type|
    next unless "#{type.to_s.camelize}Action".constantize.can?(self, battle)

    case type
    when :second_wind
      SecondWindAction.new(session, self, :second_wind)
    end
  end.compact
end