mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Synced FPS to monitor's refresh rate, fixed broken waterfall movement
This commit is contained in:
@@ -159,8 +159,9 @@ EventHandlers.add(:on_step_taken, :auto_move_player,
|
||||
next if !$scene.is_a?(Scene_Map)
|
||||
next if event != $game_player
|
||||
currentTag = $game_player.pbTerrainTag
|
||||
if currentTag.waterfall_crest
|
||||
pbDescendWaterfall
|
||||
if currentTag.waterfall_crest || currentTag.waterfall ||
|
||||
$PokemonGlobal.descending_waterfall || $PokemonGlobal.ascending_waterfall
|
||||
pbTraverseWaterfall
|
||||
elsif currentTag.ice || $PokemonGlobal.ice_sliding
|
||||
pbSlideOnIce
|
||||
end
|
||||
|
||||
@@ -8,6 +8,8 @@ class PokemonGlobalMetadata
|
||||
attr_accessor :surfing
|
||||
attr_accessor :diving
|
||||
attr_accessor :ice_sliding
|
||||
attr_accessor :descending_waterfall
|
||||
attr_accessor :ascending_waterfall
|
||||
attr_accessor :fishing
|
||||
# Player data
|
||||
attr_accessor :startTime
|
||||
@@ -59,6 +61,8 @@ class PokemonGlobalMetadata
|
||||
@surfing = false
|
||||
@diving = false
|
||||
@ice_sliding = false
|
||||
@descending_waterfall = false
|
||||
@ascending_waterfall = false
|
||||
@fishing = false
|
||||
# Player data
|
||||
@startTime = Time.now
|
||||
@@ -113,6 +117,10 @@ class PokemonGlobalMetadata
|
||||
@encounter_version = value
|
||||
$PokemonEncounters.setup($game_map.map_id) if $PokemonEncounters && $game_map
|
||||
end
|
||||
|
||||
def forced_movement?
|
||||
return @ice_sliding || @descending_waterfall || @ascending_waterfall
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
|
||||
@@ -886,40 +886,38 @@ HiddenMoveHandlers::UseMove.add(:TELEPORT, proc { |move, pokemon|
|
||||
#===============================================================================
|
||||
# Waterfall
|
||||
#===============================================================================
|
||||
# Starts the ascending of a waterfall.
|
||||
def pbAscendWaterfall
|
||||
return if $game_player.direction != 8 # Can't ascend if not facing up
|
||||
terrain = $game_player.pbFacingTerrainTag
|
||||
return if !terrain.waterfall && !terrain.waterfall_crest
|
||||
$stats.waterfall_count += 1
|
||||
oldthrough = $game_player.through
|
||||
oldmovespeed = $game_player.move_speed
|
||||
$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
|
||||
$PokemonGlobal.ascending_waterfall = true
|
||||
$game_player.through = true
|
||||
end
|
||||
|
||||
def pbDescendWaterfall
|
||||
return if $game_player.direction != 2 # Can't descend if not facing down
|
||||
terrain = $game_player.pbFacingTerrainTag
|
||||
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
|
||||
# Triggers after finishing each step while ascending/descending a waterfall.
|
||||
def pbTraverseWaterfall
|
||||
if $game_player.direction == 2 # Facing down; descending
|
||||
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
|
||||
$game_player.through = oldthrough
|
||||
$game_player.move_speed = oldmovespeed
|
||||
end
|
||||
|
||||
def pbWaterfall
|
||||
|
||||
Reference in New Issue
Block a user