Class: RPG::Enemy

Inherits:
Object
  • Object
show all
Defined in:
lib/rpg/enemy.rb

Defined Under Namespace

Classes: Action

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEnemy


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rpg/enemy.rb', line 5

def initialize
  @id = 0
  @name = ""
  @battler_name = ""
  @battler_hue = 0
  @maxhp = 500
  @maxsp = 500
  @str = 50
  @dex = 50
  @agi = 50
  @int = 50
  @atk = 100
  @pdef = 100
  @mdef = 100
  @eva = 0
  @animation1_id = 0
  @animation2_id = 0
  @element_ranks = Table.new(1)
  @state_ranks = Table.new(1)
  @actions = [RPG::Enemy::Action.new]
  @exp = 0
  @gold = 0
  @item_id = 0
  @weapon_id = 0
  @armor_id = 0
  @treasure_prob = 100
end

Instance Attribute Details

#actionsArray<RPG::Enemy::Action>

The enemy's actions. An Action array.


103
104
105
# File 'lib/rpg/enemy.rb', line 103

def actions
  @actions
end

#agiObject

The enemy's agility.


58
59
60
# File 'lib/rpg/enemy.rb', line 58

def agi
  @agi
end

#animation1_idObject

The battle animation ID.


76
77
78
# File 'lib/rpg/enemy.rb', line 76

def animation1_id
  @animation1_id
end

#animation2_idObject

The target animation ID.


79
80
81
# File 'lib/rpg/enemy.rb', line 79

def animation2_id
  @animation2_id
end

#armor_idObject

The ID of the armor used as treasure.


118
119
120
# File 'lib/rpg/enemy.rb', line 118

def armor_id
  @armor_id
end

#atkObject

The enemy's attack power.


64
65
66
# File 'lib/rpg/enemy.rb', line 64

def atk
  @atk
end

#battler_hueObject

The adjustment value for the battler graphic's hue (0..360).


43
44
45
# File 'lib/rpg/enemy.rb', line 43

def battler_hue
  @battler_hue
end

#battler_nameObject

The enemy's battler graphic file name.


40
41
42
# File 'lib/rpg/enemy.rb', line 40

def battler_name
  @battler_name
end

#dexObject

The enemy's dexterity.


55
56
57
# File 'lib/rpg/enemy.rb', line 55

def dex
  @dex
end

#element_ranksObject

Level of elemental effectiveness. 1-dimensional Table using element IDs as subscripts, with 6 levels:

0

A

1

B

2

C

3

D

4

E

5

F


89
90
91
# File 'lib/rpg/enemy.rb', line 89

def element_ranks
  @element_ranks
end

#evaObject

The enemy's evasion rating.


73
74
75
# File 'lib/rpg/enemy.rb', line 73

def eva
  @eva
end

#expObject

The enemy's experience.


106
107
108
# File 'lib/rpg/enemy.rb', line 106

def exp
  @exp
end

#goldObject

The enemy's gold.


109
110
111
# File 'lib/rpg/enemy.rb', line 109

def gold
  @gold
end

#idObject

The enemy ID.


34
35
36
# File 'lib/rpg/enemy.rb', line 34

def id
  @id
end

#intObject

The enemy's intelligence.


61
62
63
# File 'lib/rpg/enemy.rb', line 61

def int
  @int
end

#item_idObject

The ID of the item used as treasure.


112
113
114
# File 'lib/rpg/enemy.rb', line 112

def item_id
  @item_id
end

#maxhpObject

The enemy's max HP.


46
47
48
# File 'lib/rpg/enemy.rb', line 46

def maxhp
  @maxhp
end

#maxspObject

The enemy's max SP.


49
50
51
# File 'lib/rpg/enemy.rb', line 49

def maxsp
  @maxsp
end

#mdefObject

The enemy's magic defense rating.


70
71
72
# File 'lib/rpg/enemy.rb', line 70

def mdef
  @mdef
end

#nameObject

The enemy name.


37
38
39
# File 'lib/rpg/enemy.rb', line 37

def name
  @name
end

#pdefObject

The enemy's physical defense rating.


67
68
69
# File 'lib/rpg/enemy.rb', line 67

def pdef
  @pdef
end

#state_ranksObject

Level of status effectiveness. 1-dimensional Table using status IDs as subscripts, with 6 levels:

0

A

1

B

2

C

3

D

4

E

5

F


99
100
101
# File 'lib/rpg/enemy.rb', line 99

def state_ranks
  @state_ranks
end

#strObject

The enemy's strength.


52
53
54
# File 'lib/rpg/enemy.rb', line 52

def str
  @str
end

#treasure_probObject

The probability of treasure being left behind.


121
122
123
# File 'lib/rpg/enemy.rb', line 121

def treasure_prob
  @treasure_prob
end

#weapon_idObject

The ID of the weapon used as treasure.


115
116
117
# File 'lib/rpg/enemy.rb', line 115

def weapon_id
  @weapon_id
end