Class: PfrpgReaders::Filters::StrengthMod
- Inherits:
-
Object
- Object
- PfrpgReaders::Filters::StrengthMod
- Defined in:
- lib/pfrpg_readers/filters/strength_mod.rb
Instance Attribute Summary collapse
-
#character ⇒ Object
readonly
Returns the value of attribute character.
Instance Method Summary collapse
- #filter(attack) ⇒ Object
-
#initialize(character) ⇒ StrengthMod
constructor
A new instance of StrengthMod.
Constructor Details
#initialize(character) ⇒ StrengthMod
Returns a new instance of StrengthMod.
5 6 7 |
# File 'lib/pfrpg_readers/filters/strength_mod.rb', line 5 def initialize(character) @character = character end |
Instance Attribute Details
#character ⇒ Object (readonly)
Returns the value of attribute character.
4 5 6 |
# File 'lib/pfrpg_readers/filters/strength_mod.rb', line 4 def character @character end |
Instance Method Details
#filter(attack) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pfrpg_readers/filters/strength_mod.rb', line 9 def filter(attack) if attack.weapon.applies_strength_dmg? base_mod = character.str_mod if(attack.weapon.weight_class == 'Two-handed') base_mod = (base_mod * 1.5) end attack.filter_str << "Strength damage : #{base_mod}" attack.damage.add_static(base_mod) if attack.weapon.applies_strength_dmg? end end |