Class: Moves::Basic

Inherits:
Move show all
Includes:
Rollable
Defined in:
app/models/moves/basic.rb

Overview

This class represents the basic moves that all Hunters have

Constant Summary

Constants inherited from Move

Move::MOVE_TYPES

Instance Attribute Summary

Attributes inherited from Move

#created_at, #description, #haven, #id, #name, #playbook_id, #rating, #seven_to_nine, #six_and_under, #ten_plus, #twelve_plus, #type, #updated_at

Instance Method Summary collapse

Methods included from Rollable

#lucky_roll, #roll, #roll_results, #rollable?

Methods inherited from Move

policy_class, #rollable?

Methods inherited from ApplicationRecord

policy_class

Instance Method Details

#outcome(roll, hunter) ⇒ Object


47
48
49
50
51
52
53
54
55
56
57
58
# File 'app/models/moves/basic.rb', line 47

def outcome(roll, hunter)
  case roll
  when 0..6
    six_and_under
  when 7..9
    seven_to_nine
  when 10..11
    ten_plus
  else
    hunter.advanced?(self) ? twelve_plus : ten_plus
  end
end