Class: PfrpgCore::Item
- Inherits:
-
Object
- Object
- PfrpgCore::Item
- Includes:
- PfrpgUtility::Affectable
- Defined in:
- lib/pfrpg_core/item.rb
Instance Attribute Summary collapse
-
#ac_bonus ⇒ Object
readonly
Returns the value of attribute ac_bonus.
-
#arcane_spell_failure_chance ⇒ Object
readonly
Returns the value of attribute arcane_spell_failure_chance.
-
#armor_check_penalty ⇒ Object
readonly
Returns the value of attribute armor_check_penalty.
-
#cost ⇒ Object
readonly
Returns the value of attribute cost.
-
#critical_dmg ⇒ Object
readonly
Returns the value of attribute critical_dmg.
-
#critical_range ⇒ Object
readonly
Returns the value of attribute critical_range.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#dmg_m ⇒ Object
readonly
Returns the value of attribute dmg_m.
-
#dmg_s ⇒ Object
readonly
Returns the value of attribute dmg_s.
-
#dmg_type ⇒ Object
readonly
Returns the value of attribute dmg_type.
-
#effects ⇒ Object
readonly
Returns the value of attribute effects.
-
#equipped ⇒ Object
readonly
Returns the value of attribute equipped.
-
#max_dex_bonus ⇒ Object
readonly
Returns the value of attribute max_dex_bonus.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#range ⇒ Object
readonly
Returns the value of attribute range.
-
#slot ⇒ Object
readonly
Returns the value of attribute slot.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#special ⇒ Object
readonly
Returns the value of attribute special.
-
#speed_thirty ⇒ Object
readonly
Returns the value of attribute speed_thirty.
-
#speed_twenty ⇒ Object
readonly
Returns the value of attribute speed_twenty.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#weapon_type ⇒ Object
readonly
Returns the value of attribute weapon_type.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
-
#weight_class ⇒ Object
readonly
Returns the value of attribute weight_class.
Instance Method Summary collapse
- #applies_strength_dmg? ⇒ Boolean
-
#initialize(item, equipped) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(item, equipped) ⇒ Item
Returns a new instance of Item.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/pfrpg_core/item.rb', line 10 def initialize(item, equipped) @name = item[:name] @description = item[:description] @slot = item[:slot] @type = item[:type] @effects = item[:effects] @cost = item[:cost] @dmg_m = item[:dmg_m] @dmg_s = item[:dmg_s] @critical_range = item[:critical_range] @critical_dmg = item[:critical_dmg] @range = item[:range] @weight = item[:weight] @dmg_type = item[:dmg_type] @special = item[:special] @source = item[:source] @weapon_type = item[:weapon_type] @weight_class = item[:weight_class] @ac_bonus = item[:ac_bonus] @max_dex_bonus = item[:max_dex_bonus] @armor_check_penalty = item[:armor_check_penalty] @arcane_spell_failure_chance = item[:arcane_spell_failure_chance] @speed_twenty = item[:speed_twenty] @speed_thirty = item[:speed_thirty] @equipped = equipped end |
Instance Attribute Details
#ac_bonus ⇒ Object (readonly)
Returns the value of attribute ac_bonus.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def ac_bonus @ac_bonus end |
#arcane_spell_failure_chance ⇒ Object (readonly)
Returns the value of attribute arcane_spell_failure_chance.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def arcane_spell_failure_chance @arcane_spell_failure_chance end |
#armor_check_penalty ⇒ Object (readonly)
Returns the value of attribute armor_check_penalty.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def armor_check_penalty @armor_check_penalty end |
#cost ⇒ Object (readonly)
Returns the value of attribute cost.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def cost @cost end |
#critical_dmg ⇒ Object (readonly)
Returns the value of attribute critical_dmg.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def critical_dmg @critical_dmg end |
#critical_range ⇒ Object (readonly)
Returns the value of attribute critical_range.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def critical_range @critical_range end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def description @description end |
#dmg_m ⇒ Object (readonly)
Returns the value of attribute dmg_m.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def dmg_m @dmg_m end |
#dmg_s ⇒ Object (readonly)
Returns the value of attribute dmg_s.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def dmg_s @dmg_s end |
#dmg_type ⇒ Object (readonly)
Returns the value of attribute dmg_type.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def dmg_type @dmg_type end |
#effects ⇒ Object (readonly)
Returns the value of attribute effects.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def effects @effects end |
#equipped ⇒ Object (readonly)
Returns the value of attribute equipped.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def equipped @equipped end |
#max_dex_bonus ⇒ Object (readonly)
Returns the value of attribute max_dex_bonus.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def max_dex_bonus @max_dex_bonus end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def name @name end |
#range ⇒ Object (readonly)
Returns the value of attribute range.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def range @range end |
#slot ⇒ Object (readonly)
Returns the value of attribute slot.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def slot @slot end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def source @source end |
#special ⇒ Object (readonly)
Returns the value of attribute special.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def special @special end |
#speed_thirty ⇒ Object (readonly)
Returns the value of attribute speed_thirty.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def speed_thirty @speed_thirty end |
#speed_twenty ⇒ Object (readonly)
Returns the value of attribute speed_twenty.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def speed_twenty @speed_twenty end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def type @type end |
#weapon_type ⇒ Object (readonly)
Returns the value of attribute weapon_type.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def weapon_type @weapon_type end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def weight @weight end |
#weight_class ⇒ Object (readonly)
Returns the value of attribute weight_class.
4 5 6 |
# File 'lib/pfrpg_core/item.rb', line 4 def weight_class @weight_class end |
Instance Method Details
#applies_strength_dmg? ⇒ Boolean
37 38 39 40 |
# File 'lib/pfrpg_core/item.rb', line 37 def applies_strength_dmg? ['light', 'one-handed', 'two-handed'].include?(weight_class.downcase) || name == 'Sling' end |