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

@@ -4,7 +4,7 @@
# Pokérus check
EventHandlers.add(:on_frame_update, :pokerus_counter,
proc {
next if !$player
next if !$player&.party.any? { |pkmn| pkmn.pokerusStage == 1 }
last = $PokemonGlobal.pokerusTime
next if !last
now = pbGetTimeNow
@@ -48,7 +48,7 @@ EventHandlers.add(:on_frame_update, :low_battery_warning,
next if $game_temp.warned_low_battery || !pbBatteryLow?
next if $game_temp.in_menu || $game_temp.in_battle || $game_player.move_route_forcing ||
$game_temp.message_window_showing || pbMapInterpreterRunning?
next if pbGetTimeNow.sec != 0
next if Time.now.sec != 0
$game_temp.warned_low_battery = true
pbMessage(_INTL("The game has detected that the battery is low. You should save soon to avoid losing your progress."))
}