Module: GamesAndRpgParadise::Formulas::DnD
- Defined in:
- lib/games_and_rpg_paradise/formulas/formulas.rb
Overview
Constant Summary
collapse
- ATTRIBUTE_MODIFIER =
'(attribute_score) / 2 + (-5)'
Class Method Summary
collapse
Class Method Details
.calculate_dnd_attribute_modifier(attribute_score = 18) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/games_and_rpg_paradise/formulas/formulas.rb', line 25
def self.calculate_dnd_attribute_modifier(attribute_score = 18)
_ = ATTRIBUTE_MODIFIER.
gsub(/attribute_score/, attribute_score.to_s)
result = eval(_)
return result
end
|