Class: PFM::Skill

Inherits:
Object show all
Defined in:
scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb

Overview

The InGame skill/move information of a Pokemon

Author:

  • Nuri Yuri

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(db_symbol) ⇒ Skill

Create a new Skill information

Parameters:

  • db_symbol (Symbol)

    db_symbol of the skill/move in the database



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

#idInteger (readonly)

ID of the skill in the Database

Returns:



13
14
15
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 13

def id
  @id
end

#ppInteger

The current number of PP the skill has

Returns:



10
11
12
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 10

def pp
  @pp
end

#ppmaxInteger

The maximum number of PP the skill has

Returns:



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

#accuracyInteger

Return the actual accuracy of the skill

Returns:



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_textString

Return the accuracy text of the skill

Returns:



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_classInteger

Get the ATK class for the UI

Returns:



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_powerInteger Also known as: power

Return the base power (Data power) of the skill

Returns:



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

#dataStudio::Move

Return the actual data of the move

Returns:



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_symbolSymbol

Return the db_symbol of the skill

Returns:

  • (Symbol)


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

#descriptionString

Return the skill description

Returns:



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_useInteger

Return the ID of the common event to call on Map use

Returns:



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

#nameString

Return the name of the skill

Returns:



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_textString

Return the text of the power of the skill

Returns:



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_textString

Return the text of the PP of the skill

Returns:



65
66
67
# File 'scripts/01450 Systems/00000 General/00001 PFM/00300 Pokemon/90000 Skill.rb', line 65

def pp_text
  "#{@pp} / #{@ppmax}"
end

#symbolSymbol

Return the symbol of the method to call in BattleEngine

Returns:

  • (Symbol)


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

#typeInteger

Return the actual type ID of the skill

Returns:



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 ?

Parameters:

  • type_id (Integer)

    ID of the type

Returns:

  • (Boolean)


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