Class: RPG::Enemy

Inherits:
BaseItem show all
Defined in:
lib/rpg/enemy.rb,
lib/rpg/enemy/action.rb,
lib/rpg/enemy/drop_item.rb

Defined Under Namespace

Classes: Action, DropItem

Instance Attribute Summary (collapse)

Attributes inherited from BaseItem

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

Instance Method Summary (collapse)

Constructor Details

- (Enemy) initialize

Returns a new instance of Enemy



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/rpg/enemy.rb', line 3

def initialize
  super
  @battler_name = ''
  @battler_hue = 0
  @params = [100,0,10,10,10,10,10,10]
  @exp = 0
  @gold = 0
  @drop_items = Array.new(3) { RPG::Enemy::DropItem.new }
  @actions = [RPG::Enemy::Action.new]
  @features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
  @features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
  @features.push(RPG::BaseItem::Feature.new(31, 1, 0))
end

Instance Attribute Details

- (Object) actions

Returns the value of attribute actions



22
23
24
# File 'lib/rpg/enemy.rb', line 22

def actions
  @actions
end

- (Object) battler_hue

Returns the value of attribute battler_hue



17
18
19
# File 'lib/rpg/enemy.rb', line 17

def battler_hue
  @battler_hue
end

- (Object) battler_name

Returns the value of attribute battler_name



16
17
18
# File 'lib/rpg/enemy.rb', line 16

def battler_name
  @battler_name
end

- (Object) drop_items

Returns the value of attribute drop_items



21
22
23
# File 'lib/rpg/enemy.rb', line 21

def drop_items
  @drop_items
end

- (Object) exp

Returns the value of attribute exp



19
20
21
# File 'lib/rpg/enemy.rb', line 19

def exp
  @exp
end

- (Object) gold

Returns the value of attribute gold



20
21
22
# File 'lib/rpg/enemy.rb', line 20

def gold
  @gold
end

- (Object) params

Returns the value of attribute params



18
19
20
# File 'lib/rpg/enemy.rb', line 18

def params
  @params
end