MCPcopy Create free account
hub / github.com/EasyRPG/Player / Other

Method Other

src/game_interpreter_control_variables.cpp:220–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220int ControlVariables::Other(int op) {
221 switch (op) {
222 case 0:
223 // Gold
224 return Main_Data::game_party->GetGold();
225 break;
226 case 1:
227 // Timer 1 remaining time
228 return Main_Data::game_party->GetTimerSeconds(Main_Data::game_party->Timer1);
229 break;
230 case 2:
231 // Number of heroes in party
232 return Main_Data::game_party->GetActors().size();
233 break;
234 case 3:
235 // Number of saves
236 return Main_Data::game_system->GetSaveCount();
237 break;
238 case 4:
239 // Number of battles
240 return Main_Data::game_party->GetBattleCount();
241 break;
242 case 5:
243 // Number of wins
244 return Main_Data::game_party->GetWinCount();
245 break;
246 case 6:
247 // Number of defeats
248 return Main_Data::game_party->GetDefeatCount();
249 break;
250 case 7:
251 // Number of escapes (aka run away)
252 return Main_Data::game_party->GetRunCount();
253 break;
254 case 8:
255 // MIDI play position
256 if (Player::IsPatchKeyPatch()) {
257 return Main_Data::game_ineluki->GetMidiTicks();
258 } else {
259 return Audio().BGM_GetTicks();
260 }
261 break;
262 case 9:
263 // Timer 2 remaining time
264 return Main_Data::game_party->GetTimerSeconds(Main_Data::game_party->Timer2);
265 break;
266 case 10:
267 // Current date (YYMMDD)
268 if (Player::IsPatchManiac()) {
269 std::time_t t = std::time(nullptr);
270 std::tm* tm = std::localtime(&t);
271 return atoi(Utils::FormatDate(tm, Utils::DateFormat_YYMMDD).c_str());
272 }
273 break;
274 case 11:
275 // Current time (HHMMSS)
276 if (Player::IsPatchManiac()) {
277 std::time_t t = std::time(nullptr);

Callers

nothing calls this directly

Calls 12

GetGoldMethod · 0.80
GetTimerSecondsMethod · 0.80
GetSaveCountMethod · 0.80
GetBattleCountMethod · 0.80
GetWinCountMethod · 0.80
GetDefeatCountMethod · 0.80
GetRunCountMethod · 0.80
GetMidiTicksMethod · 0.80
GetFrameCounterMethod · 0.80
sizeMethod · 0.45
GetActorsMethod · 0.45
BGM_GetTicksMethod · 0.45

Tested by

no test coverage detected