Class: RPG::Armor

Inherits:
EquipItem show all
Defined in:
lib/rpg/armor.rb

Instance Attribute Summary (collapse)

Attributes inherited from EquipItem

#etype_id, #params, #price

Attributes inherited from BaseItem

#description, #features, #icon_index, #id, #name, #note

Instance Method Summary (collapse)

Constructor Details

- (Armor) initialize

Returns a new instance of Armor



3
4
5
6
7
8
# File 'lib/rpg/armor.rb', line 3

def initialize
  super
  @atype_id = 0
  @etype_id = 1
  @features.push(RPG::BaseItem::Feature.new(22, 1, 0))
end

Instance Attribute Details

- (Object) atype_id

Returns the value of attribute atype_id



12
13
14
# File 'lib/rpg/armor.rb', line 12

def atype_id
  @atype_id
end

Instance Method Details

- (Object) performance



9
10
11
# File 'lib/rpg/armor.rb', line 9

def performance
  params[3] + params[5] + params.inject(0) {|r, v| r += v }
end