mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Synced FPS to monitor's refresh rate, fixed broken waterfall movement
This commit is contained in:
@@ -188,7 +188,7 @@ class Scene_Map
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
return if $game_temp.message_window_showing
|
return if $game_temp.message_window_showing
|
||||||
if !pbMapInterpreterRunning? && !$PokemonGlobal.ice_sliding
|
if !pbMapInterpreterRunning? && !$PokemonGlobal.forced_movement?
|
||||||
if Input.trigger?(Input::USE)
|
if Input.trigger?(Input::USE)
|
||||||
$game_temp.interact_calling = true
|
$game_temp.interact_calling = true
|
||||||
elsif Input.trigger?(Input::ACTION)
|
elsif Input.trigger?(Input::ACTION)
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ class Game_Player < Game_Character
|
|||||||
self.move_speed = (type == :surfing_jumping) ? 3 : 4
|
self.move_speed = (type == :surfing_jumping) ? 3 : 4
|
||||||
end
|
end
|
||||||
new_charset = pbGetPlayerCharset(meta.surf_charset)
|
new_charset = pbGetPlayerCharset(meta.surf_charset)
|
||||||
|
when :descending_waterfall, :ascending_waterfall
|
||||||
|
self.move_speed = 2 if !@move_route_forcing
|
||||||
|
new_charset = pbGetPlayerCharset(meta.surf_charset)
|
||||||
when :cycling, :cycling_fast, :cycling_jumping, :cycling_stopped
|
when :cycling, :cycling_fast, :cycling_jumping, :cycling_stopped
|
||||||
if !@move_route_forcing
|
if !@move_route_forcing
|
||||||
self.move_speed = (type == :cycling_jumping) ? 3 : 5
|
self.move_speed = (type == :cycling_jumping) ? 3 : 5
|
||||||
@@ -148,6 +151,10 @@ class Game_Player < Game_Character
|
|||||||
increase_steps
|
increase_steps
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
|
elsif pbFacingTerrainTag.waterfall_crest && dir == 2
|
||||||
|
$PokemonGlobal.descending_waterfall = true
|
||||||
|
$game_player.through = true
|
||||||
|
$stats.waterfalls_descended += 1
|
||||||
end
|
end
|
||||||
# Jumping out of surfing back onto land
|
# Jumping out of surfing back onto land
|
||||||
return if pbEndSurf(x_offset, y_offset)
|
return if pbEndSurf(x_offset, y_offset)
|
||||||
@@ -421,7 +428,7 @@ class Game_Player < Game_Character
|
|||||||
|
|
||||||
def update_command_new
|
def update_command_new
|
||||||
dir = Input.dir4
|
dir = Input.dir4
|
||||||
if $PokemonGlobal.ice_sliding
|
if $PokemonGlobal.forced_movement?
|
||||||
move_forward
|
move_forward
|
||||||
elsif !pbMapInterpreterRunning? && !$game_temp.message_window_showing &&
|
elsif !pbMapInterpreterRunning? && !$game_temp.message_window_showing &&
|
||||||
!$game_temp.in_mini_update && !$game_temp.in_menu
|
!$game_temp.in_mini_update && !$game_temp.in_menu
|
||||||
@@ -452,6 +459,10 @@ class Game_Player < Game_Character
|
|||||||
if !@moved_last_frame || @stopped_last_frame # Started a new step
|
if !@moved_last_frame || @stopped_last_frame # Started a new step
|
||||||
if $PokemonGlobal.ice_sliding || @last_terrain_tag.ice
|
if $PokemonGlobal.ice_sliding || @last_terrain_tag.ice
|
||||||
set_movement_type(:ice_sliding)
|
set_movement_type(:ice_sliding)
|
||||||
|
elsif $PokemonGlobal.descending_waterfall
|
||||||
|
set_movement_type(:descending_waterfall)
|
||||||
|
elsif $PokemonGlobal.ascending_waterfall
|
||||||
|
set_movement_type(:ascending_waterfall)
|
||||||
else
|
else
|
||||||
faster = can_run?
|
faster = can_run?
|
||||||
if $PokemonGlobal&.diving
|
if $PokemonGlobal&.diving
|
||||||
@@ -528,7 +539,7 @@ class Game_Player < Game_Character
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update_event_triggering
|
def update_event_triggering
|
||||||
return if moving? || jumping? || $PokemonGlobal.ice_sliding
|
return if moving? || jumping? || $PokemonGlobal.forced_movement?
|
||||||
# Try triggering events upon walking into them/in front of them
|
# Try triggering events upon walking into them/in front of them
|
||||||
if @moved_this_frame
|
if @moved_this_frame
|
||||||
$game_temp.followers.turn_followers
|
$game_temp.followers.turn_followers
|
||||||
|
|||||||
@@ -159,8 +159,9 @@ EventHandlers.add(:on_step_taken, :auto_move_player,
|
|||||||
next if !$scene.is_a?(Scene_Map)
|
next if !$scene.is_a?(Scene_Map)
|
||||||
next if event != $game_player
|
next if event != $game_player
|
||||||
currentTag = $game_player.pbTerrainTag
|
currentTag = $game_player.pbTerrainTag
|
||||||
if currentTag.waterfall_crest
|
if currentTag.waterfall_crest || currentTag.waterfall ||
|
||||||
pbDescendWaterfall
|
$PokemonGlobal.descending_waterfall || $PokemonGlobal.ascending_waterfall
|
||||||
|
pbTraverseWaterfall
|
||||||
elsif currentTag.ice || $PokemonGlobal.ice_sliding
|
elsif currentTag.ice || $PokemonGlobal.ice_sliding
|
||||||
pbSlideOnIce
|
pbSlideOnIce
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ class PokemonGlobalMetadata
|
|||||||
attr_accessor :surfing
|
attr_accessor :surfing
|
||||||
attr_accessor :diving
|
attr_accessor :diving
|
||||||
attr_accessor :ice_sliding
|
attr_accessor :ice_sliding
|
||||||
|
attr_accessor :descending_waterfall
|
||||||
|
attr_accessor :ascending_waterfall
|
||||||
attr_accessor :fishing
|
attr_accessor :fishing
|
||||||
# Player data
|
# Player data
|
||||||
attr_accessor :startTime
|
attr_accessor :startTime
|
||||||
@@ -59,6 +61,8 @@ class PokemonGlobalMetadata
|
|||||||
@surfing = false
|
@surfing = false
|
||||||
@diving = false
|
@diving = false
|
||||||
@ice_sliding = false
|
@ice_sliding = false
|
||||||
|
@descending_waterfall = false
|
||||||
|
@ascending_waterfall = false
|
||||||
@fishing = false
|
@fishing = false
|
||||||
# Player data
|
# Player data
|
||||||
@startTime = Time.now
|
@startTime = Time.now
|
||||||
@@ -113,6 +117,10 @@ class PokemonGlobalMetadata
|
|||||||
@encounter_version = value
|
@encounter_version = value
|
||||||
$PokemonEncounters.setup($game_map.map_id) if $PokemonEncounters && $game_map
|
$PokemonEncounters.setup($game_map.map_id) if $PokemonEncounters && $game_map
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def forced_movement?
|
||||||
|
return @ice_sliding || @descending_waterfall || @ascending_waterfall
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -886,40 +886,38 @@ HiddenMoveHandlers::UseMove.add(:TELEPORT, proc { |move, pokemon|
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Waterfall
|
# Waterfall
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
# Starts the ascending of a waterfall.
|
||||||
def pbAscendWaterfall
|
def pbAscendWaterfall
|
||||||
return if $game_player.direction != 8 # Can't ascend if not facing up
|
return if $game_player.direction != 8 # Can't ascend if not facing up
|
||||||
terrain = $game_player.pbFacingTerrainTag
|
terrain = $game_player.pbFacingTerrainTag
|
||||||
return if !terrain.waterfall && !terrain.waterfall_crest
|
return if !terrain.waterfall && !terrain.waterfall_crest
|
||||||
$stats.waterfall_count += 1
|
$stats.waterfall_count += 1
|
||||||
oldthrough = $game_player.through
|
$PokemonGlobal.ascending_waterfall = true
|
||||||
oldmovespeed = $game_player.move_speed
|
$game_player.through = true
|
||||||
$game_player.through = true
|
|
||||||
$game_player.move_speed = 2
|
|
||||||
loop do
|
|
||||||
$game_player.move_up
|
|
||||||
terrain = $game_player.pbTerrainTag
|
|
||||||
break if !terrain.waterfall && !terrain.waterfall_crest
|
|
||||||
end
|
|
||||||
$game_player.through = oldthrough
|
|
||||||
$game_player.move_speed = oldmovespeed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbDescendWaterfall
|
# Triggers after finishing each step while ascending/descending a waterfall.
|
||||||
return if $game_player.direction != 2 # Can't descend if not facing down
|
def pbTraverseWaterfall
|
||||||
terrain = $game_player.pbFacingTerrainTag
|
if $game_player.direction == 2 # Facing down; descending
|
||||||
return if !terrain.waterfall && !terrain.waterfall_crest
|
|
||||||
$stats.waterfalls_descended += 1
|
|
||||||
oldthrough = $game_player.through
|
|
||||||
oldmovespeed = $game_player.move_speed
|
|
||||||
$game_player.through = true
|
|
||||||
$game_player.move_speed = 2
|
|
||||||
loop do
|
|
||||||
$game_player.move_down
|
|
||||||
terrain = $game_player.pbTerrainTag
|
terrain = $game_player.pbTerrainTag
|
||||||
break if !terrain.waterfall && !terrain.waterfall_crest
|
if !terrain.waterfall && !terrain.waterfall_crest
|
||||||
|
$PokemonGlobal.descending_waterfall = false
|
||||||
|
$game_player.through = false
|
||||||
|
return
|
||||||
|
end
|
||||||
|
$stats.waterfalls_descended += 1 if !$PokemonGlobal.descending_waterfall
|
||||||
|
$PokemonGlobal.descending_waterfall = true
|
||||||
|
$game_player.through = true
|
||||||
|
elsif $PokemonGlobal.ascending_waterfall
|
||||||
|
terrain = $game_player.pbTerrainTag
|
||||||
|
if !terrain.waterfall && !terrain.waterfall_crest
|
||||||
|
$PokemonGlobal.ascending_waterfall = false
|
||||||
|
$game_player.through = false
|
||||||
|
return
|
||||||
|
end
|
||||||
|
$PokemonGlobal.ascending_waterfall = true
|
||||||
|
$game_player.through = true
|
||||||
end
|
end
|
||||||
$game_player.through = oldthrough
|
|
||||||
$game_player.move_speed = oldmovespeed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbWaterfall
|
def pbWaterfall
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
// This option may be force-disabled at build time.
|
// This option may be force-disabled at build time.
|
||||||
// (default: disabled)
|
// (default: disabled)
|
||||||
//
|
//
|
||||||
// "syncToRefreshrate": false,
|
"syncToRefreshrate": true,
|
||||||
|
|
||||||
|
|
||||||
// A list of fonts to render without alpha blending.
|
// A list of fonts to render without alpha blending.
|
||||||
|
|||||||
Reference in New Issue
Block a user