Class: RPG::Enemy
- Inherits:
-
Object
- Object
- RPG::Enemy
- Defined in:
- lib/rpg/enemy.rb
Defined Under Namespace
Classes: Action
Instance Attribute Summary collapse
-
#actions ⇒ Array<RPG::Enemy::Action>
The enemy’s actions.
-
#agi ⇒ Object
The enemy’s agility.
-
#animation1_id ⇒ Object
The battle animation ID.
-
#animation2_id ⇒ Object
The target animation ID.
-
#armor_id ⇒ Object
The ID of the armor used as treasure.
-
#atk ⇒ Object
The enemy’s attack power.
-
#battler_hue ⇒ Object
The adjustment value for the battler graphic’s hue (0..360).
-
#battler_name ⇒ Object
The enemy’s battler graphic file name.
-
#dex ⇒ Object
The enemy’s dexterity.
-
#element_ranks ⇒ Object
Level of elemental effectiveness.
-
#eva ⇒ Object
The enemy’s evasion rating.
-
#exp ⇒ Object
The enemy’s experience.
-
#gold ⇒ Object
The enemy’s gold.
-
#id ⇒ Object
The enemy ID.
-
#int ⇒ Object
The enemy’s intelligence.
-
#item_id ⇒ Object
The ID of the item used as treasure.
-
#maxhp ⇒ Object
The enemy’s max HP.
-
#maxsp ⇒ Object
The enemy’s max SP.
-
#mdef ⇒ Object
The enemy’s magic defense rating.
-
#name ⇒ Object
The enemy name.
-
#pdef ⇒ Object
The enemy’s physical defense rating.
-
#state_ranks ⇒ Object
Level of status effectiveness.
-
#str ⇒ Object
The enemy’s strength.
-
#treasure_prob ⇒ Object
The probability of treasure being left behind.
-
#weapon_id ⇒ Object
The ID of the weapon used as treasure.
Instance Method Summary collapse
-
#initialize ⇒ Enemy
constructor
A new instance of Enemy.
Constructor Details
#initialize ⇒ Enemy
Returns a new instance of Enemy.
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
#actions ⇒ Array<RPG::Enemy::Action>
The enemy’s actions. An Action array.
103 104 105 |
# File 'lib/rpg/enemy.rb', line 103 def actions @actions end |
#agi ⇒ Object
The enemy’s agility.
58 59 60 |
# File 'lib/rpg/enemy.rb', line 58 def agi @agi end |
#animation1_id ⇒ Object
The battle animation ID.
76 77 78 |
# File 'lib/rpg/enemy.rb', line 76 def animation1_id @animation1_id end |
#animation2_id ⇒ Object
The target animation ID.
79 80 81 |
# File 'lib/rpg/enemy.rb', line 79 def animation2_id @animation2_id end |
#armor_id ⇒ Object
The ID of the armor used as treasure.
118 119 120 |
# File 'lib/rpg/enemy.rb', line 118 def armor_id @armor_id end |
#atk ⇒ Object
The enemy’s attack power.
64 65 66 |
# File 'lib/rpg/enemy.rb', line 64 def atk @atk end |
#battler_hue ⇒ Object
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_name ⇒ Object
The enemy’s battler graphic file name.
40 41 42 |
# File 'lib/rpg/enemy.rb', line 40 def battler_name @battler_name end |
#dex ⇒ Object
The enemy’s dexterity.
55 56 57 |
# File 'lib/rpg/enemy.rb', line 55 def dex @dex end |
#element_ranks ⇒ Object
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 |
#eva ⇒ Object
The enemy’s evasion rating.
73 74 75 |
# File 'lib/rpg/enemy.rb', line 73 def eva @eva end |
#exp ⇒ Object
The enemy’s experience.
106 107 108 |
# File 'lib/rpg/enemy.rb', line 106 def exp @exp end |
#gold ⇒ Object
The enemy’s gold.
109 110 111 |
# File 'lib/rpg/enemy.rb', line 109 def gold @gold end |
#id ⇒ Object
The enemy ID.
34 35 36 |
# File 'lib/rpg/enemy.rb', line 34 def id @id end |
#int ⇒ Object
The enemy’s intelligence.
61 62 63 |
# File 'lib/rpg/enemy.rb', line 61 def int @int end |
#item_id ⇒ Object
The ID of the item used as treasure.
112 113 114 |
# File 'lib/rpg/enemy.rb', line 112 def item_id @item_id end |
#maxhp ⇒ Object
The enemy’s max HP.
46 47 48 |
# File 'lib/rpg/enemy.rb', line 46 def maxhp @maxhp end |
#maxsp ⇒ Object
The enemy’s max SP.
49 50 51 |
# File 'lib/rpg/enemy.rb', line 49 def maxsp @maxsp end |
#mdef ⇒ Object
The enemy’s magic defense rating.
70 71 72 |
# File 'lib/rpg/enemy.rb', line 70 def mdef @mdef end |
#name ⇒ Object
The enemy name.
37 38 39 |
# File 'lib/rpg/enemy.rb', line 37 def name @name end |
#pdef ⇒ Object
The enemy’s physical defense rating.
67 68 69 |
# File 'lib/rpg/enemy.rb', line 67 def pdef @pdef end |
#state_ranks ⇒ Object
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 |
#str ⇒ Object
The enemy’s strength.
52 53 54 |
# File 'lib/rpg/enemy.rb', line 52 def str @str end |
#treasure_prob ⇒ Object
The probability of treasure being left behind.
121 122 123 |
# File 'lib/rpg/enemy.rb', line 121 def treasure_prob @treasure_prob end |
#weapon_id ⇒ Object
The ID of the weapon used as treasure.
115 116 117 |
# File 'lib/rpg/enemy.rb', line 115 def weapon_id @weapon_id end |