Class: PFM::Skill
- Defined in:
- scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb
Overview
The InGame skill/move information of a Pokemon
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
ID of the skill in the Database.
-
#pp ⇒ Integer
The current number of PP the skill has.
-
#ppmax ⇒ Integer
The maximum number of PP the skill has.
Instance Method Summary collapse
-
#accuracy ⇒ Integer
Return the actual accuracy of the skill.
-
#accuracy_text ⇒ String
Return the accuracy text of the skill.
-
#atk_class ⇒ Integer
Get the ATK class for the UI.
-
#base_power ⇒ Integer
(also: #power)
Return the base power (Data power) of the skill.
-
#data ⇒ Studio::Move
Return the actual data of the move.
-
#db_symbol ⇒ Symbol
Return the db_symbol of the skill.
-
#description ⇒ String
Return the skill description.
-
#initialize(db_symbol) ⇒ Skill
constructor
Create a new Skill information.
-
#map_use ⇒ Integer
Return the ID of the common event to call on Map use.
-
#name ⇒ String
Return the name of the skill.
-
#power_text ⇒ String
Return the text of the power of the skill.
-
#pp_text ⇒ String
Return the text of the PP of the skill.
-
#symbol ⇒ Symbol
Return the symbol of the method to call in BattleEngine.
-
#type ⇒ Integer
Return the actual type ID of the skill.
-
#type?(type_id) ⇒ Boolean
Is the skill a specific type ?.
Constructor Details
#initialize(db_symbol) ⇒ Skill
Create a new Skill information
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 17 def initialize(db_symbol) data = data_move(db_symbol) @id = data.id @db_symbol = data.db_symbol if @id == 0 @ppmax = 0 @pp = 0 return end @ppmax = data.pp @pp = @ppmax end |
Instance Attribute Details
#id ⇒ Integer (readonly)
ID of the skill in the Database
13 14 15 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 13 def id @id end |
#pp ⇒ Integer
The current number of PP the skill has
10 11 12 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 10 def pp @pp end |
#ppmax ⇒ Integer
The maximum number of PP the skill has
7 8 9 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 7 def ppmax @ppmax end |
Instance Method Details
#accuracy ⇒ Integer
Return the actual accuracy of the skill
84 85 86 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 84 def accuracy return data.accuracy end |
#accuracy_text ⇒ String
Return the accuracy text of the skill
90 91 92 93 94 95 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 90 def accuracy_text acc = data.accuracy return text_get(11, 12) if acc == 0 return acc.to_s end |
#atk_class ⇒ Integer
Get the ATK class for the UI
123 124 125 126 127 128 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 123 def atk_class return 2 if data.category == :special return 3 if data.category == :status return 1 end |
#base_power ⇒ Integer Also known as: power
Return the base power (Data power) of the skill
71 72 73 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 71 def base_power return data.power end |
#data ⇒ Studio::Move
Return the actual data of the move
32 33 34 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 32 def data return data_move(@db_symbol || @id || :__undef__) end |
#db_symbol ⇒ Symbol
Return the db_symbol of the skill
38 39 40 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 38 def db_symbol return @db_symbol ||= data.db_symbol end |
#description ⇒ String
Return the skill description
99 100 101 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 99 def description return text_get(7, @id || 0) # GameData::Skill.descr(@id) end |
#map_use ⇒ Integer
Return the ID of the common event to call on Map use
105 106 107 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 105 def map_use return data.map_use end |
#name ⇒ String
Return the name of the skill
44 45 46 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 44 def name return data.name end |
#power_text ⇒ String
Return the text of the power of the skill
56 57 58 59 60 61 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 56 def power_text power = base_power return text_get(11, 12) if power == 0 return power.to_s end |
#pp_text ⇒ String
Return the text of the PP of the skill
65 66 67 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 65 def pp_text "#{@pp} / #{@ppmax}" end |
#symbol ⇒ Symbol
Return the symbol of the method to call in BattleEngine
50 51 52 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 50 def symbol return data.be_method end |
#type ⇒ Integer
Return the actual type ID of the skill
78 79 80 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 78 def type return data_type(data.type).id end |
#type?(type_id) ⇒ Boolean
Is the skill a specific type ?
111 112 113 |
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 111 def type?(type_id) return type == type_id end |