fixes mélangés...

This commit is contained in:
infinitefusion
2022-07-20 16:11:06 -04:00
parent 2d52624986
commit cd16986e30
5 changed files with 554 additions and 498 deletions

View File

@@ -1006,6 +1006,7 @@ class Interpreter
# * Return to Title Screen # * Return to Title Screen
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def command_354 def command_354
resetPlayerPosition
$game_temp.to_title = true $game_temp.to_title = true
return false return false
end end

View File

@@ -45,6 +45,7 @@ class Spriteset_Map
end end
def initialize(map=nil) def initialize(map=nil)
return if $scene.is_a?(Scene_Intro) || $scene.is_a?(Scene_DebugIntro)
@map = (map) ? map : $game_map @map = (map) ? map : $game_map
$scene.map_renderer.add_tileset(@map.tileset_name) $scene.map_renderer.add_tileset(@map.tileset_name)
@map.autotile_names.each { |filename| $scene.map_renderer.add_autotile(filename) } @map.autotile_names.each { |filename| $scene.map_renderer.add_autotile(filename) }

View File

@@ -1,225 +1,245 @@
#=============================================================================== # #===============================================================================
# Klein Footprints / WolfPP for Pokémon Essentials # # Klein Footprints / WolfPP for Pokémon Essentials
# Give credits if you're using this! # # Give credits if you're using this!
# http://kleinstudio.deviantart.com # # http://kleinstudio.deviantart.com
# #
# # bo4p5687 update (v.19)
# #===============================================================================
# #
# bo4p5687 update (v.19) # # Fix event comment
#=============================================================================== # def pbEventCommentInput(*args)
# parameters = []
# Fix event comment # list = *args[0].list # Event or event page
def pbEventCommentInput(*args) # elements = *args[1] # Number of elements
parameters = [] # trigger = *args[2] # Trigger
list = *args[0].list # Event or event page # return nil if list == nil
elements = *args[1] # Number of elements # return nil unless list.is_a?(Array)
trigger = *args[2] # Trigger # for item in list
return nil if list == nil # next unless item.code == 108 || item.code == 408
return nil unless list.is_a?(Array) # if item.parameters[0] == trigger[0]
for item in list # start = list.index(item) + 1
next unless item.code == 108 || item.code == 408 # finish = start + elements[0]
if item.parameters[0] == trigger[0] # for id in start...finish
start = list.index(item) + 1 # next if !list[id]
finish = start + elements[0] # parameters.push(list[id].parameters[0])
for id in start...finish # end
next if !list[id] # return parameters
parameters.push(list[id].parameters[0]) # end
end # end
return parameters # return nil
end # end
end #
return nil # module FootprintVariables
end # # If you set pokemon here, they doesn't have footprints
# FOLLOWING_DONT_WALK = [
module FootprintVariables # # Example:
# If you set pokemon here, they doesn't have footprints # # 12,15,17
FOLLOWING_DONT_WALK = [ # ]
# Example: #
# 12,15,17 # # Set here the terrain tag for footprints, 3 is sand
] # TERRAIN_FOOT = 3
#
# Set here the terrain tag for footprints, 3 is sand # # Initial opacity for footprints
TERRAIN_FOOT = 3 # FOOT_OPACITY = 62
#
# Initial opacity for footprints # # Delay velocity
FOOT_OPACITY = 62 # FOOT_DELAY = 1.1
#
# Delay velocity # def self.get_new_id
FOOT_DELAY = 1.1 # newId = 1
# while !$game_map.events[newId].nil? do
def self.get_new_id # break if $game_map.events[newId].erased
newId = 1 # newId += 1
while !$game_map.events[newId].nil? do # end
break if $game_map.events[newId].erased # return newId
newId += 1 # end
end #
return newId # def self.show(event, position)
end # if event != $game_player
# return if event.character_name == "" || event.character_name == "nil" || event.name.include?("/nofoot/")
def self.show(event, position) # return if pbEventCommentInput(event, 0, "NoFoot")
if event != $game_player # if $Trainer.party.length > 0
return if event.character_name == "" || event.character_name == "nil" || event.name.include?("/nofoot/") # return if (!($game_map.events[event] && $game_map.events[event].name == "Dependent") &&
return if pbEventCommentInput(event, 0, "NoFoot") # (FOLLOWING_DONT_WALK.include?($Trainer.party[0].species) || $PokemonGlobal.bicycle))
if $Trainer.party.length > 0 # end
return if (!($game_map.events[event] && $game_map.events[event].name == "Dependent") && # end
(FOLLOWING_DONT_WALK.include?($Trainer.party[0].species) || $PokemonGlobal.bicycle)) # character_sprites = $scene.spriteset.character_sprites
end # viewport = $scene.spriteset.viewport1
end # footsprites = $scene.spriteset.footsprites
character_sprites = $scene.spriteset.character_sprites # nid = self.get_new_id
viewport = $scene.spriteset.viewport1 # rpgEvent = RPG::Event.new(position[0], position[1])
footsprites = $scene.spriteset.footsprites # rpgEvent.id = nid
nid = self.get_new_id # fev = Game_Event.new($game_map.map_id, rpgEvent, $game_map)
rpgEvent = RPG::Event.new(position[0], position[1]) # eventsprite = Sprite_Character.new(viewport, fev)
rpgEvent.id = nid # character_sprites.push(eventsprite)
fev = Game_Event.new($game_map.map_id, rpgEvent, $game_map) # footsprites.push(Footsprite.new(eventsprite, fev, viewport, $game_map, position[2], nid, character_sprites, (event == $game_player)))
eventsprite = Sprite_Character.new(viewport, fev) # end
character_sprites.push(eventsprite) #
footsprites.push(Footsprite.new(eventsprite, fev, viewport, $game_map, position[2], nid, character_sprites, (event==$game_player))) # end
end #
# class Game_Event < Game_Character
end # attr_reader :erased
# end
class Game_Event < Game_Character #
attr_reader :erased # class Sprite_Character
end # alias old_initialize_foot initialize
#
class Sprite_Character # def initialize(viewport, character = nil)
alias old_initialize_foot initialize # old_initialize_foot(viewport, character)
def initialize(viewport, character=nil) # @disposed = false
old_initialize_foot(viewport, character) # end
@disposed = false #
end # alias old_update_foot update
#
alias old_update_foot update # def update
def update # return if @disposed
return if @disposed # old_update_foot
old_update_foot # end
end #
# alias old_dispose_foot dispose
alias old_dispose_foot dispose #
def dispose # def dispose
old_dispose_foot # old_dispose_foot
@disposed = true # @disposed = true
end # end
end # end
#
class Spriteset_Map # class Spriteset_Map
attr_accessor :character_sprites # attr_accessor :character_sprites
attr_accessor :footsprites # attr_accessor :footsprites
#
alias old_initialize initialize # alias old_initialize initialize
def initialize(map=nil) #
old_initialize(map) # def initialize(map = nil)
@footsprites = [] # begin
end # old_initialize(map) if map != nil
# @footsprites = []
def viewport1 # rescue
return @@viewport1 # return
end # end
# end
def putFootprint(event, pos) #
return FootprintVariables.show(event, pos) # def viewport1
end # return @@viewport1
# end
alias old_dispose dispose #
def dispose # def putFootprint(event, pos)
old_dispose # return FootprintVariables.show(event, pos)
@footsprites.each { |sprite| sprite.dispose } if !@footsprites.nil? # end
@footsprites.clear #
end # alias old_dispose dispose
#
alias old_update update # def dispose
def update # old_dispose
old_update # @footsprites.each { |sprite| sprite.dispose } if !@footsprites.nil?
return if @footsprites.nil? # @footsprites.clear
@footsprites.each { |sprite| sprite.update } # end
end #
end # alias old_update update
#
class Scene_Map # def update
def spriteset? # old_update
return !@spritesets.nil? # return if @footsprites.nil?
end # @footsprites.each { |sprite| sprite.update }
end # end
# end
class Game_Character #
# class Scene_Map
def get_last_pos # def spriteset?
case direction # return !@spritesets.nil?
when 2 then return [@x, @y-1, direction] # Move down # end
when 4 then return [@x+1, @y, direction] # Move left # end
when 6 then return [@x-1, @y, direction] # Move right #
when 8 then return [@x, @y+1, direction] # Move up # class Game_Character
end #
return false # def get_last_pos
end # case direction
# when 2 then
def foot_prints? # return [@x, @y - 1, direction] # Move down
return $game_map.terrain_tag(get_last_pos[0], get_last_pos[1]) == FootprintVariables::TERRAIN_FOOT && $scene.is_a?(Scene_Map) && $scene.spriteset? # when 4 then
end # return [@x + 1, @y, direction] # Move left
# when 6 then
alias leave_tile_footprints triggerLeaveTile # return [@x - 1, @y, direction] # Move right
def triggerLeaveTile # when 8 then
leave_tile_footprints # return [@x, @y + 1, direction] # Move up
$scene.spriteset.putFootprint(self, get_last_pos) if foot_prints? # end
end # return false
# end
end #
# def foot_prints?
class Footsprite # return $game_map.terrain_tag(get_last_pos[0], get_last_pos[1]) == FootprintVariables::TERRAIN_FOOT && $scene.is_a?(Scene_Map) && $scene.spriteset?
def initialize(sprite,event,viewport,map,direction,nid,chardata,player) # end
@rsprite = sprite #
# Sprite # alias leave_tile_footprints triggerLeaveTile
@sprite = Sprite.new(viewport) #
file = player && $PokemonGlobal.bicycle ? "footsetbike.png" : "footset.png" # def triggerLeaveTile
@sprite.bitmap = RPG::Cache.load_bitmap("Graphics/Pictures/", file) # leave_tile_footprints
# Set position # $scene.spriteset.putFootprint(self, get_last_pos) if foot_prints?
@realwidth = @sprite.bitmap.width/4 # end
@sprite.src_rect.width = @realwidth #
@opacity = FootprintVariables::FOOT_OPACITY # end
setFootset(direction) #
# Values # class Footsprite
@map = map # def initialize(sprite, event, viewport, map, direction, nid, chardata, player)
@event = event # return if $scene.is_a?(PokemonLoad_Scene) || $scene.is_a?(PokemonLoadScreen)
@disposed = false # @rsprite = sprite
@eventid = nid # # Sprite
@viewport = viewport # @sprite = Sprite.new(viewport)
@chardata = chardata # file = player && $PokemonGlobal.bicycle ? "footsetbike.png" : "footset.png"
update # @sprite.bitmap = RPG::Cache.load_bitmap("Graphics/Pictures/", file)
end # # Set position
# @realwidth = @sprite.bitmap.width / 4
def setFootset(direction) # @sprite.src_rect.width = @realwidth
@sprite.src_rect.x = # @opacity = FootprintVariables::FOOT_OPACITY
case direction # setFootset(direction)
when 2 then 0 # Move down # # Values
when 4 then @realwidth * 3 # Move left # @map = map
when 6 then @realwidth * 2 # Move right # @event = event
when 8 then @realwidth # Move up # @disposed = false
end # @eventid = nid
@sprite.opacity = @opacity # @viewport = viewport
end # @chardata = chardata
# update
def dispose # end
return if @disposed #
@disposed = true # def setFootset(direction)
@event.erase # @sprite.src_rect.x =
(0...@chardata.length).each { |i| @chardata.delete_at(i) if @chardata[i] == @rsprite } # case direction
@rsprite.dispose # when 2 then
@sprite.dispose # 0 # Move down
@sprite = nil # when 4 then
end # @realwidth * 3 # Move left
# when 6 then
def update # @realwidth * 2 # Move right
return if @disposed # when 8 then
x = @rsprite.x - @rsprite.ox # @realwidth # Move up
y = @rsprite.y - @rsprite.oy # end
width = @rsprite.src_rect.width # @sprite.opacity = @opacity
height = @rsprite.src_rect.height # end
@sprite.x = x + width / 2 #
@sprite.y = y + height # def dispose
@sprite.ox = @realwidth / 2 # return if @disposed
@sprite.oy = @sprite.bitmap.height # @disposed = true
@sprite.z = @rsprite.z - 2 # @event.erase
@opacity -= FootprintVariables::FOOT_DELAY # (0...@chardata.length).each { |i| @chardata.delete_at(i) if @chardata[i] == @rsprite }
@sprite.opacity = @opacity # @rsprite.dispose
dispose if @sprite.opacity <= 0 # @sprite.dispose
end # @sprite = nil
end # end
#
# def update
# return if @disposed
# x = @rsprite.x - @rsprite.ox
# y = @rsprite.y - @rsprite.oy
# width = @rsprite.src_rect.width
# height = @rsprite.src_rect.height
# @sprite.x = x + width / 2
# @sprite.y = y + height
# @sprite.ox = @realwidth / 2
# @sprite.oy = @sprite.bitmap.height
# @sprite.z = @rsprite.z - 2
# @opacity -= FootprintVariables::FOOT_DELAY
# @sprite.opacity = @opacity
# dispose if @sprite.opacity <= 0
# end
# end

View File

@@ -1,278 +1,278 @@
# #=============================================================================== # # #===============================================================================
# # * Unreal Time System - by FL (Credits will be apreciated) # # # * Unreal Time System - by FL (Credits will be apreciated)
# #=============================================================================== # # #===============================================================================
# # #
# # # This script is for Pokémon Essentials. It makes the time in game uses its
# # # own clock that only pass when you are in game instead of using real time
# # # (like Minecraft and Zelda: Ocarina of Time).
# # #
# # #== INSTALLATION ===============================================================
# # #
# # # To this script works, put it above main OR convert into a plugin.
# # #
# # #== HOW TO USE =================================================================
# # #
# # # This script automatic works after installed.
# # #
# # # If you wish to add/reduce time, there are 3 ways:
# # #
# # # 1. EXTRA_SECONDS/EXTRA_DAYS are variables numbers that hold time passage;
# # # The time in these variable isn't affected by PROPORTION.
# # # Example: When the player sleeps you wish to the time in game advance
# # # 8 hours, so put in EXTRA_SECONDS a game variable number and sum
# # # 28800 (60*60*8) in this variable every time that the players sleeps.
# # #
# # # 2. 'UnrealTime.add_seconds(seconds)' and 'UnrealTime.add_days(days)' does the
# # # same thing, in fact, EXTRA_SECONDS/EXTRA_DAYS call these methods.
# # #
# # # 3. 'UnrealTime.advance_to(16,17,18)' advance the time to a fixed time of day,
# # # 16:17:18 on this example.
# # #
# # #== NOTES ======================================================================
# # #
# # # If you wish to some parts still use real time like the Trainer Card start time
# # # and Pokémon Trainer Memo, just change 'pbGetTimeNow' to 'Time.now' in their
# # # scripts.
# # #
# # # This script uses the Ruby Time class. Before Essentials version 19 (who came
# # # with 64-bit ruby) it can only have 1901-2038 range.
# # #
# # # Some time methods:
# # # 'pbGetTimeNow.year', 'pbGetTimeNow.mon' (the numbers from 1-12),
# # # 'pbGetTimeNow.day','pbGetTimeNow.hour', 'pbGetTimeNow.min',
# # # 'pbGetTimeNow.sec', 'pbGetAbbrevMonthName(pbGetTimeNow.mon)',
# # # 'pbGetTimeNow.strftime("%A")' (displays weekday name),
# # # 'pbGetTimeNow.strftime("%I:%M %p")' (displays Hours:Minutes pm/am)
# # #
# # #===============================================================================
# # # #
# # This script is for Pokémon Essentials. It makes the time in game uses its # # if defined?(PluginManager) && !PluginManager.installed?("Unreal Time System")
# # own clock that only pass when you are in game instead of using real time # # PluginManager.register({
# # (like Minecraft and Zelda: Ocarina of Time). # # :name => "Unreal Time System",
# # :version => "1.1",
# # :link => "https://www.pokecommunity.com/showthread.php?t=285831",
# # :credits => "FL"
# # })
# # end
# # # #
# #== INSTALLATION =============================================================== # module UnrealTime
# # # # Set false to disable this system (returns Time.now)
# # To this script works, put it above main OR convert into a plugin. # ENABLED=true
# #
# #== HOW TO USE =================================================================
# #
# # This script automatic works after installed.
# #
# # If you wish to add/reduce time, there are 3 ways:
# #
# # 1. EXTRA_SECONDS/EXTRA_DAYS are variables numbers that hold time passage;
# # The time in these variable isn't affected by PROPORTION.
# # Example: When the player sleeps you wish to the time in game advance
# # 8 hours, so put in EXTRA_SECONDS a game variable number and sum
# # 28800 (60*60*8) in this variable every time that the players sleeps.
# #
# # 2. 'UnrealTime.add_seconds(seconds)' and 'UnrealTime.add_days(days)' does the
# # same thing, in fact, EXTRA_SECONDS/EXTRA_DAYS call these methods.
# #
# # 3. 'UnrealTime.advance_to(16,17,18)' advance the time to a fixed time of day,
# # 16:17:18 on this example.
# #
# #== NOTES ======================================================================
# #
# # If you wish to some parts still use real time like the Trainer Card start time
# # and Pokémon Trainer Memo, just change 'pbGetTimeNow' to 'Time.now' in their
# # scripts.
# #
# # This script uses the Ruby Time class. Before Essentials version 19 (who came
# # with 64-bit ruby) it can only have 1901-2038 range.
# #
# # Some time methods:
# # 'pbGetTimeNow.year', 'pbGetTimeNow.mon' (the numbers from 1-12),
# # 'pbGetTimeNow.day','pbGetTimeNow.hour', 'pbGetTimeNow.min',
# # 'pbGetTimeNow.sec', 'pbGetAbbrevMonthName(pbGetTimeNow.mon)',
# # 'pbGetTimeNow.strftime("%A")' (displays weekday name),
# # 'pbGetTimeNow.strftime("%I:%M %p")' (displays Hours:Minutes pm/am)
# #
# #===============================================================================
# #
# if defined?(PluginManager) && !PluginManager.installed?("Unreal Time System") # # Time proportion here.
# PluginManager.register({ # # So if it is 100, one second in real time will be 100 seconds in game.
# :name => "Unreal Time System", # # If it is 60, one second in real time will be one minute in game.
# :version => "1.1", # PROPORTION=60
# :link => "https://www.pokecommunity.com/showthread.php?t=285831", #
# :credits => "FL" # # Starting on Essentials v17, the map tone only try to refresh tone each 30
# }) # # real time seconds.
# # If this variable number isn't -1, the game use this number instead of 30.
# # When time is changed with advance_to or add_seconds, the tone refreshes.
# TONE_CHECK_INTERVAL = 10.0
#
# # Make this true to time only pass at field (Scene_Map)
# # A note to scripters: To make time pass on other scenes, put line
# # '$PokemonGlobal.addNewFrameCount' near to line 'Graphics.update'
# TIME_STOPS=true
#
# # Make this true to time pass in battle, during turns and command selection.
# # This won't affect the Pokémon and Bag submenus.
# # Only works if TIME_STOPS=true.
# BATTLE_PASS=true
#
# # Make this true to time pass when the Dialog box or the main menu are open.
# # This won't affect the submenus like Pokémon and Bag.
# # Only works if TIME_STOPS=true.
# TALK_PASS=true
#
# # Choose switch number that when true the time won't pass (or -1 to cancel).
# # Only works if TIME_STOPS=true.
# SWITCH_STOPS=-1
#
# # Choose variable(s) number(s) that can hold time passage (or -1 to cancel).
# # Look at description for more details.
# EXTRA_SECONDS=79
# EXTRA_DAYS=-1
#
# # Initial date. In sequence: Year, month, day, hour and minutes.
# # Method UnrealTime.reset resets time back to this time.
# def self.initial_date
# return Time.local(2000,1,1, 12,0)
# end # end
# #
module UnrealTime # # Advance to next time. If time already passed, advance
# Set false to disable this system (returns Time.now) # # into the time on the next day.
ENABLED=true # # Hour is 0..23
# def self.advance_to(hour,min=0,sec=0)
# Time proportion here. # if hour < 0 || hour > 23
# So if it is 100, one second in real time will be 100 seconds in game. # raise RangeError, "hour is #{hour}, should be 0..23"
# If it is 60, one second in real time will be one minute in game. # end
PROPORTION=60 # day_seconds = 60*60*24
# seconds_now = pbGetTimeNow.hour*60*60+pbGetTimeNow.min*60+pbGetTimeNow.sec
# Starting on Essentials v17, the map tone only try to refresh tone each 30 # target_seconds = hour*60*60+min*60+sec
# real time seconds. # seconds_added = target_seconds-seconds_now
# If this variable number isn't -1, the game use this number instead of 30. # seconds_added += day_seconds if seconds_added<0
# When time is changed with advance_to or add_seconds, the tone refreshes. # $PokemonGlobal.newFrameCount+=seconds_added
TONE_CHECK_INTERVAL = 10.0 # PBDayNight.sheduleToneRefresh
# end
# Make this true to time only pass at field (Scene_Map) #
# A note to scripters: To make time pass on other scenes, put line # # Resets time to initial_date.
# '$PokemonGlobal.addNewFrameCount' near to line 'Graphics.update' # def self.reset
TIME_STOPS=true # raise "Method doesn't work when TIME_STOPS is false!" if !TIME_STOPS
# $game_variables[EXTRA_SECONDS]=0 if EXTRA_DAYS>0
# Make this true to time pass in battle, during turns and command selection. # $game_variables[EXTRA_DAYS]=0 if EXTRA_DAYS>0
# This won't affect the Pokémon and Bag submenus. # $PokemonGlobal.newFrameCount=0
# Only works if TIME_STOPS=true. # $PokemonGlobal.extraYears=0
BATTLE_PASS=true # PBDayNight.sheduleToneRefresh
# end
# Make this true to time pass when the Dialog box or the main menu are open. #
# This won't affect the submenus like Pokémon and Bag. # # Does the same thing as EXTRA_SECONDS variable.
# Only works if TIME_STOPS=true. # def self.add_seconds(seconds)
TALK_PASS=true # raise "Method doesn't work when TIME_STOPS is false!" if !TIME_STOPS
# $PokemonGlobal.newFrameCount+=(seconds*Graphics.frame_rate)/PROPORTION.to_f
# Choose switch number that when true the time won't pass (or -1 to cancel). # PBDayNight.sheduleToneRefresh
# Only works if TIME_STOPS=true. # end
SWITCH_STOPS=-1 #
# def self.add_days(days)
# Choose variable(s) number(s) that can hold time passage (or -1 to cancel). # add_seconds(60*60*24*days)
# Look at description for more details. # end
EXTRA_SECONDS=79 #
EXTRA_DAYS=-1 # NEED_32_BIT_FIX = [''].pack('p').size <= 4
# end
# Initial date. In sequence: Year, month, day, hour and minutes. #
# Method UnrealTime.reset resets time back to this time. # # Essentials V18 and lower compatibility
def self.initial_date # module Settings
return Time.local(2000,1,1, 12,0) # TIME_SHADING = defined?(ENABLESHADING) ? ENABLESHADING : ::TIME_SHADING
end # end if defined?(TIME_SHADING) || defined?(ENABLESHADING)
#
# Advance to next time. If time already passed, advance # module PBDayNight
# into the time on the next day. # class << self
# Hour is 0..23 # if method_defined?(:getTone) && UnrealTime::TONE_CHECK_INTERVAL > 0
def self.advance_to(hour,min=0,sec=0) # def getTone
if hour < 0 || hour > 23 # @cachedTone = Tone.new(0,0,0) if !@cachedTone
raise RangeError, "hour is #{hour}, should be 0..23" # return @cachedTone if !Settings::TIME_SHADING
end # toneNeedUpdate = (!@dayNightToneLastUpdate ||
day_seconds = 60*60*24 # Graphics.frame_count-@dayNightToneLastUpdate >=
seconds_now = pbGetTimeNow.hour*60*60+pbGetTimeNow.min*60+pbGetTimeNow.sec # Graphics.frame_rate*UnrealTime::TONE_CHECK_INTERVAL
target_seconds = hour*60*60+min*60+sec # )
seconds_added = target_seconds-seconds_now # if toneNeedUpdate
seconds_added += day_seconds if seconds_added<0 # getToneInternal
$PokemonGlobal.newFrameCount+=seconds_added # @dayNightToneLastUpdate = Graphics.frame_count
PBDayNight.sheduleToneRefresh # end
end # return @cachedTone
# end
# Resets time to initial_date. # end
def self.reset #
raise "Method doesn't work when TIME_STOPS is false!" if !TIME_STOPS # # Shedule a tone refresh on the next try (probably next frame)
$game_variables[EXTRA_SECONDS]=0 if EXTRA_DAYS>0 # def sheduleToneRefresh
$game_variables[EXTRA_DAYS]=0 if EXTRA_DAYS>0 # @dayNightToneLastUpdate = nil
$PokemonGlobal.newFrameCount=0 # end
$PokemonGlobal.extraYears=0 # end
PBDayNight.sheduleToneRefresh # end
end #
# def pbGetTimeNow
# Does the same thing as EXTRA_SECONDS variable. # return Time.now if !$PokemonGlobal || !UnrealTime::ENABLED
def self.add_seconds(seconds) # day_seconds = 60*60*24
raise "Method doesn't work when TIME_STOPS is false!" if !TIME_STOPS # if UnrealTime::TIME_STOPS
$PokemonGlobal.newFrameCount+=(seconds*Graphics.frame_rate)/PROPORTION.to_f # # Sum the extra values to newFrameCount
PBDayNight.sheduleToneRefresh # if UnrealTime::EXTRA_SECONDS>0
end # UnrealTime.add_seconds(pbGet(UnrealTime::EXTRA_SECONDS))
# $game_variables[UnrealTime::EXTRA_SECONDS]=0
def self.add_days(days) # end
add_seconds(60*60*24*days) # if UnrealTime::EXTRA_DAYS>0
end # UnrealTime.add_seconds(day_seconds*pbGet(UnrealTime::EXTRA_DAYS))
# $game_variables[UnrealTime::EXTRA_DAYS]=0
NEED_32_BIT_FIX = [''].pack('p').size <= 4 # end
end # elsif UnrealTime::EXTRA_SECONDS>0 && UnrealTime::EXTRA_DAYS>0
# # Checks to regulate the max/min values at UnrealTime::EXTRA_SECONDS
# Essentials V18 and lower compatibility # while pbGet(UnrealTime::EXTRA_SECONDS)>=day_seconds
module Settings # $game_variables[UnrealTime::EXTRA_SECONDS]-=day_seconds
TIME_SHADING = defined?(ENABLESHADING) ? ENABLESHADING : ::TIME_SHADING # $game_variables[UnrealTime::EXTRA_DAYS]+=1
end if defined?(TIME_SHADING) || defined?(ENABLESHADING) # end
# while pbGet(UnrealTime::EXTRA_SECONDS)<=-day_seconds
module PBDayNight # $game_variables[UnrealTime::EXTRA_SECONDS]+=day_seconds
class << self # $game_variables[UnrealTime::EXTRA_DAYS]-=1
if method_defined?(:getTone) && UnrealTime::TONE_CHECK_INTERVAL > 0 # end
def getTone # end
@cachedTone = Tone.new(0,0,0) if !@cachedTone # start_time=UnrealTime.initial_date
return @cachedTone if !Settings::TIME_SHADING # if UnrealTime::TIME_STOPS
toneNeedUpdate = (!@dayNightToneLastUpdate || # time_played=$PokemonGlobal.newFrameCount
Graphics.frame_count-@dayNightToneLastUpdate >= # else
Graphics.frame_rate*UnrealTime::TONE_CHECK_INTERVAL # time_played=Graphics.frame_count
) # end
if toneNeedUpdate # time_played=(time_played*UnrealTime::PROPORTION)/Graphics.frame_rate
getToneInternal # time_jumped=0
@dayNightToneLastUpdate = Graphics.frame_count # if UnrealTime::EXTRA_SECONDS>-1
end # time_jumped+=pbGet(UnrealTime::EXTRA_SECONDS)
return @cachedTone # end
end # if UnrealTime::EXTRA_DAYS>-1
end # time_jumped+=pbGet(UnrealTime::EXTRA_DAYS)*day_seconds
# end
# Shedule a tone refresh on the next try (probably next frame) # time_ret = 0
def sheduleToneRefresh # # Before Essentials V19, there is a year limit. To prevent crashes due to this
@dayNightToneLastUpdate = nil # # limit, every time that you reach in year 2036 the system will subtract 6
end # # years (to works with leap year) from your date and sum in
end # # $PokemonGlobal.extraYears. You can sum your actual year with this extraYears
end # # when displaying years.
# loop do
def pbGetTimeNow # time_fix=0
return Time.now if !$PokemonGlobal || !UnrealTime::ENABLED # if $PokemonGlobal.extraYears!=0
day_seconds = 60*60*24 # time_fix = $PokemonGlobal.extraYears*day_seconds*(365*6+1)/6
if UnrealTime::TIME_STOPS # end
# Sum the extra values to newFrameCount # time_ret=start_time+(time_played+time_jumped-time_fix)
if UnrealTime::EXTRA_SECONDS>0 # break if !UnrealTime::NEED_32_BIT_FIX || time_ret.year<2036
UnrealTime.add_seconds(pbGet(UnrealTime::EXTRA_SECONDS)) # $PokemonGlobal.extraYears+=6
$game_variables[UnrealTime::EXTRA_SECONDS]=0 # end
end # return time_ret
if UnrealTime::EXTRA_DAYS>0 # end
UnrealTime.add_seconds(day_seconds*pbGet(UnrealTime::EXTRA_DAYS)) #
$game_variables[UnrealTime::EXTRA_DAYS]=0 # if UnrealTime::ENABLED
end # class PokemonGlobalMetadata
elsif UnrealTime::EXTRA_SECONDS>0 && UnrealTime::EXTRA_DAYS>0 # attr_accessor :newFrameCount # Became float when using extra values
# Checks to regulate the max/min values at UnrealTime::EXTRA_SECONDS # attr_accessor :extraYears
while pbGet(UnrealTime::EXTRA_SECONDS)>=day_seconds #
$game_variables[UnrealTime::EXTRA_SECONDS]-=day_seconds # def addNewFrameCount
$game_variables[UnrealTime::EXTRA_DAYS]+=1 # return if (UnrealTime::SWITCH_STOPS>0 &&
end # $game_switches[UnrealTime::SWITCH_STOPS])
while pbGet(UnrealTime::EXTRA_SECONDS)<=-day_seconds # self.newFrameCount+=1
$game_variables[UnrealTime::EXTRA_SECONDS]+=day_seconds # end
$game_variables[UnrealTime::EXTRA_DAYS]-=1 #
end # def newFrameCount
end # @newFrameCount=0 if !@newFrameCount
start_time=UnrealTime.initial_date # return @newFrameCount
if UnrealTime::TIME_STOPS # end
time_played=$PokemonGlobal.newFrameCount #
else # def extraYears
time_played=Graphics.frame_count # @extraYears=0 if !@extraYears
end # return @extraYears
time_played=(time_played*UnrealTime::PROPORTION)/Graphics.frame_rate # end
time_jumped=0 # end
if UnrealTime::EXTRA_SECONDS>-1 #
time_jumped+=pbGet(UnrealTime::EXTRA_SECONDS) # if UnrealTime::TIME_STOPS
end # class Scene_Map
if UnrealTime::EXTRA_DAYS>-1 # alias :updateold :update
time_jumped+=pbGet(UnrealTime::EXTRA_DAYS)*day_seconds # def update
end # $PokemonGlobal.addNewFrameCount
time_ret = 0 # updateold
# Before Essentials V19, there is a year limit. To prevent crashes due to this # end
# limit, every time that you reach in year 2036 the system will subtract 6 #
# years (to works with leap year) from your date and sum in # if UnrealTime::TALK_PASS
# $PokemonGlobal.extraYears. You can sum your actual year with this extraYears # alias :miniupdateold :miniupdate
# when displaying years. # def miniupdate
loop do # $PokemonGlobal.addNewFrameCount
time_fix=0 # miniupdateold
if $PokemonGlobal.extraYears!=0 # end
time_fix = $PokemonGlobal.extraYears*day_seconds*(365*6+1)/6 # end
end # end
time_ret=start_time+(time_played+time_jumped-time_fix) #
break if !UnrealTime::NEED_32_BIT_FIX || time_ret.year<2036 # if UnrealTime::BATTLE_PASS
$PokemonGlobal.extraYears+=6 # class PokeBattle_Scene
end # alias :pbGraphicsUpdateold :pbGraphicsUpdate
return time_ret # def pbGraphicsUpdate
end # $PokemonGlobal.addNewFrameCount
# pbGraphicsUpdateold
if UnrealTime::ENABLED # end
class PokemonGlobalMetadata # end
attr_accessor :newFrameCount # Became float when using extra values # end
attr_accessor :extraYears # end
# end
def addNewFrameCount
return if (UnrealTime::SWITCH_STOPS>0 &&
$game_switches[UnrealTime::SWITCH_STOPS])
self.newFrameCount+=1
end
def newFrameCount
@newFrameCount=0 if !@newFrameCount
return @newFrameCount
end
def extraYears
@extraYears=0 if !@extraYears
return @extraYears
end
end
if UnrealTime::TIME_STOPS
class Scene_Map
alias :updateold :update
def update
$PokemonGlobal.addNewFrameCount
updateold
end
if UnrealTime::TALK_PASS
alias :miniupdateold :miniupdate
def miniupdate
$PokemonGlobal.addNewFrameCount
miniupdateold
end
end
end
if UnrealTime::BATTLE_PASS
class PokeBattle_Scene
alias :pbGraphicsUpdateold :pbGraphicsUpdate
def pbGraphicsUpdate
$PokemonGlobal.addNewFrameCount
pbGraphicsUpdateold
end
end
end
end
end

View File

@@ -1,4 +1,5 @@
class Scene_DebugIntro class Scene_DebugIntro
attr_accessor :map_renderer
def main def main
Graphics.transition(0) Graphics.transition(0)
sscene = PokemonLoad_Scene.new sscene = PokemonLoad_Scene.new
@@ -8,8 +9,41 @@ class Scene_DebugIntro
end end
end end
def resetPlayerPosition
save_data = load_save_file(SaveData::FILE_PATH)
map = save_data[:map_factory].map.map_id
x = save_data[:game_player].x
y = save_data[:game_player].y
dir = save_data[:game_player].direction
$MapFactory.setup(map)
$game_player.moveto(x,y)
$game_player.direction = dir
end
def load_save_file(file_path)
save_data = SaveData.read_from_file(file_path)
unless SaveData.valid?(save_data)
if File.file?(file_path + '.bak')
pbMessage(_INTL('The save file is corrupt. A backup will be loaded.'))
save_data = load_save_file(file_path + '.bak')
else
self.prompt_save_deletion
return {}
end
end
return save_data
end
def returnToTitle()
resetPlayerPosition
pbMapInterpreter.command_end
$game_temp.to_title = true
end
def pbCallTitle def pbCallTitle
return Scene_DebugIntro.new if $DEBUG $game_temp.to_title = false
#return Scene_DebugIntro.new if $DEBUG
return Scene_Intro.new return Scene_Intro.new
end end