Class: PFM::Trainer

Inherits:
Object show all
Defined in:
docs/4_Systems_104_Trainer.rb

Overview

The actor trainer data informations

Main object stored in $trainer and PFM.game_state.trainer

Author:

  • Nuri Yuri

Constant Summary collapse

TIME_FORMAT =

Time format

'%02d:%02d'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game_state = PFM.game_state) ⇒ Trainer

Create a new Trainer

Parameters:

  • game_state (PFM::GameState) (defaults to: PFM.game_state)

    variable responsive of containing the whole game state for easier access



117
118
# File 'docs/4_Systems_104_Trainer.rb', line 117

def initialize(game_state = PFM.game_state)
end

Instance Attribute Details

#badgesArray<Boolean>

The badges this trainer object has collected

Returns:

  • (Array<Boolean>)


102
103
104
# File 'docs/4_Systems_104_Trainer.rb', line 102

def badges
  @badges
end

#current_versionInteger

The current version de PSDK (update management). It’s saved like game_version

Returns:

  • (Integer)


111
112
113
# File 'docs/4_Systems_104_Trainer.rb', line 111

def current_version
  @current_version
end

#game_statePFM::GameState

Get the game state responsive of the whole game state

Returns:



114
115
116
# File 'docs/4_Systems_104_Trainer.rb', line 114

def game_state
  @game_state
end

#game_versionInteger

The game version in which this object has been saved or created

Returns:

  • (Integer)


108
109
110
# File 'docs/4_Systems_104_Trainer.rb', line 108

def game_version
  @game_version
end

#id_boyInteger

The internal ID of the trainer as a boy

Returns:

  • (Integer)


90
91
92
# File 'docs/4_Systems_104_Trainer.rb', line 90

def id_boy
  @id_boy
end

#id_girlInteger

The internal ID of the trainer as a girl. It’s equal to id_boy ^ 0x28F4AB4C

Returns:

  • (Integer)


93
94
95
# File 'docs/4_Systems_104_Trainer.rb', line 93

def id_girl
  @id_girl
end

#name_boyString

Name of the trainer as a boy (Default to Palbolsky)

Returns:



81
82
83
# File 'docs/4_Systems_104_Trainer.rb', line 81

def name_boy
  @name_boy
end

#name_girlString

Name of the trainer as a girl (Default to Yuri)

Returns:



84
85
86
# File 'docs/4_Systems_104_Trainer.rb', line 84

def name_girl
  @name_girl
end

#play_timeInteger

The time the player has played as this Trainer object

Returns:

  • (Integer)


99
100
101
# File 'docs/4_Systems_104_Trainer.rb', line 99

def play_time
  @play_time
end

#playing_girlBoolean

If the player is playing the girl trainer

Returns:

  • (Boolean)


87
88
89
# File 'docs/4_Systems_104_Trainer.rb', line 87

def playing_girl
  @playing_girl
end

#regionInteger

The ID of the current region in which the trainer is

Returns:

  • (Integer)


105
106
107
# File 'docs/4_Systems_104_Trainer.rb', line 105

def region
  @region
end

#start_timeInteger

The time in second when the Trainer object has been created (computer time)

Returns:

  • (Integer)


96
97
98
# File 'docs/4_Systems_104_Trainer.rb', line 96

def start_time
  @start_time
end

Instance Method Details

#badge_counterInteger

Return the number of badges the trainer got

Returns:

  • (Integer)


147
148
# File 'docs/4_Systems_104_Trainer.rb', line 147

def badge_counter
end

#badge_obtained?(badge_num, region = 1) ⇒ Boolean Also known as: has_badge?

Has the player got the badge ?

Parameters:

  • badge_num (1, 2, 3, 4, 5, 6, 7, 8)

    the badge

  • region (Integer) (defaults to: 1)

    the region id (starting by 1)

Returns:

  • (Boolean)


159
160
# File 'docs/4_Systems_104_Trainer.rb', line 159

def badge_obtained?(badge_num, region = 1)
end

#define_gender(playing_girl) Also known as: set_gender

Set the gender of the trainer

Parameters:

  • playing_girl (Boolean)

    if the trainer will be a girl



164
165
# File 'docs/4_Systems_104_Trainer.rb', line 164

def define_gender(playing_girl)
end

#idInteger

Return the id of the trainer

Returns:

  • (Integer)


129
130
# File 'docs/4_Systems_104_Trainer.rb', line 129

def id
end

#load_time

Load the time counter with the current time



135
136
# File 'docs/4_Systems_104_Trainer.rb', line 135

def load_time
end

#nameString

Return the name of the trainer

Returns:



121
122
# File 'docs/4_Systems_104_Trainer.rb', line 121

def name
end

#name=(value)

Change the name of the trainer

Parameters:

  • value (String)

    the new value of the trainer name



125
126
# File 'docs/4_Systems_104_Trainer.rb', line 125

def name=(value)
end

#play_time_textString

Return the play time text (without updating it)

Returns:



169
170
# File 'docs/4_Systems_104_Trainer.rb', line 169

def play_time_text
end

#redefine_var

Redefine some variable RMXP uses with the right values



132
133
# File 'docs/4_Systems_104_Trainer.rb', line 132

def redefine_var
end

#set_badge(badge_num, region = 1, value = true)

Set the got state of a badge

Parameters:

  • badge_num (1, 2, 3, 4, 5, 6, 7, 8)

    the badge

  • region (Integer) (defaults to: 1)

    the region id (starting by 1)

  • value (Boolean) (defaults to: true)

    the got state of the badge



153
154
# File 'docs/4_Systems_104_Trainer.rb', line 153

def set_badge(badge_num, region = 1, value = true)
end

#time_counterInteger

Return the time counter (current time - time counter)

Returns:

  • (Integer)


139
140
# File 'docs/4_Systems_104_Trainer.rb', line 139

def time_counter
end

#update_play_timeInteger

Update the play time and reload the time counter

Returns:

  • (Integer)

    the play time



143
144
# File 'docs/4_Systems_104_Trainer.rb', line 143

def update_play_time
end