Improved usage of Time.now and pbGetTimeNow

This commit is contained in:
Maruno17
2023-05-17 19:24:38 +01:00
parent 28a2b7c9c1
commit 62e372f4d7
14 changed files with 49 additions and 52 deletions

View File

@@ -209,7 +209,7 @@ def pbHatch(pokemon)
pokemon.name = nil
pokemon.owner = Pokemon::Owner.new_from_trainer($player)
pokemon.happiness = 120
pokemon.timeEggHatched = pbGetTimeNow
pokemon.timeEggHatched = Time.now.to_i
pokemon.obtain_method = 1 # hatched from egg
pokemon.hatched_map = $game_map.map_id
pokemon.record_first_moves

View File

@@ -43,7 +43,7 @@ class PokemonTrainerCard_Scene
hour = totalsec / 60 / 60
min = totalsec / 60 % 60
time = (hour > 0) ? _INTL("{1}h {2}m", hour, min) : _INTL("{1}m", min)
$PokemonGlobal.startTime = pbGetTimeNow if !$PokemonGlobal.startTime
$PokemonGlobal.startTime = Time.now if !$PokemonGlobal.startTime
starttime = _INTL("{1} {2}, {3}",
pbGetAbbrevMonthName($PokemonGlobal.startTime.mon),
$PokemonGlobal.startTime.day,

View File

@@ -378,8 +378,7 @@ def pbReceiveMysteryGift(id)
if gift[1] == 0 # Pokémon
gift[2].personalID = rand(2**16) | (rand(2**16) << 16)
gift[2].calc_stats
time = pbGetTimeNow
gift[2].timeReceived = time.getgm.to_i
gift[2].timeReceived = Time.now.to_i
gift[2].obtain_method = 4 # Fateful encounter
gift[2].record_first_moves
gift[2].obtain_level = gift[2].level