quick surf + bug fixes

This commit is contained in:
infinitefusion
2021-12-20 16:58:31 -05:00
parent f1010cb4a6
commit d0b1796ed3
30 changed files with 151 additions and 113 deletions

View File

@@ -6,7 +6,7 @@
module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '5.0.0'
GAME_VERSION_NUMBER = "5.0.9 - beta"
GAME_VERSION_NUMBER = "5.0.10 - beta"
#
FUSION_ICON_SPRITE_OFFSET = 10

View File

@@ -37,50 +37,51 @@ class Sprite_Reflection
end
def update
return if disposed?
shouldShow = @rsprite.visible
if !shouldShow
# Just-in-time disposal of sprite
if @sprite
@sprite.dispose
@sprite = nil
end
return
end
# Just-in-time creation of sprite
@sprite = Sprite.new(@viewport) if !@sprite
if @sprite
x = @rsprite.x-@rsprite.ox
y = @rsprite.y-@rsprite.oy
y -= 32 if @rsprite.character.character_name[/offset/i]
@height = $PokemonGlobal.bridge if !@fixedheight
y += @height*16
width = @rsprite.src_rect.width
height = @rsprite.src_rect.height
@sprite.x = x+width/2
@sprite.y = y+height+height/2
@sprite.ox = width/2
@sprite.oy = height/2-2 # Hard-coded 2 pixel shift up
@sprite.oy -= @rsprite.character.bob_height*2
@sprite.z = -50 # Still water is -100, map is 0 and above
@sprite.zoom_x = @rsprite.zoom_x
@sprite.zoom_y = @rsprite.zoom_y
frame = (Graphics.frame_count%40)/10
@sprite.zoom_x *= [1.0, 0.95, 1.0, 1.05][frame]
@sprite.angle = 180.0
@sprite.mirror = true
@sprite.bitmap = @rsprite.bitmap
@sprite.tone = @rsprite.tone
if @height>0
@sprite.color = Color.new(48,96,160,255) # Dark still water
@sprite.opacity = @rsprite.opacity
@sprite.visible = !Settings::TIME_SHADING # Can't time-tone a colored sprite
else
@sprite.color = Color.new(224,224,224,96)
@sprite.opacity = @rsprite.opacity*3/4
@sprite.visible = true
end
@sprite.src_rect = @rsprite.src_rect
end
end
return
# return if disposed?
# shouldShow = @rsprite.visible
# if !shouldShow
# # Just-in-time disposal of sprite
# if @sprite
# @sprite.dispose
# @sprite = nil
# end
# return
# end
# # Just-in-time creation of sprite
# @sprite = Sprite.new(@viewport) if !@sprite
# if @sprite
# x = @rsprite.x-@rsprite.ox
# y = @rsprite.y-@rsprite.oy
# y -= 32 if @rsprite.character.character_name[/offset/i]
# @height = $PokemonGlobal.bridge if !@fixedheight
# y += @height*16
# width = @rsprite.src_rect.width
# height = @rsprite.src_rect.height
# @sprite.x = x+width/2
# @sprite.y = y+height+height/2
# @sprite.ox = width/2
# @sprite.oy = height/2-2 # Hard-coded 2 pixel shift up
# @sprite.oy -= @rsprite.character.bob_height*2
# @sprite.z = -50 # Still water is -100, map is 0 and above
# @sprite.zoom_x = @rsprite.zoom_x
# @sprite.zoom_y = @rsprite.zoom_y
# frame = (Graphics.frame_count%40)/10
# @sprite.zoom_x *= [1.0, 0.95, 1.0, 1.05][frame]
# @sprite.angle = 180.0
# @sprite.mirror = true
# @sprite.bitmap = @rsprite.bitmap
# @sprite.tone = @rsprite.tone
# if @height>0
# @sprite.color = Color.new(48,96,160,255) # Dark still water
# @sprite.opacity = @rsprite.opacity
# @sprite.visible = !Settings::TIME_SHADING # Can't time-tone a colored sprite
# else
# @sprite.color = Color.new(224,224,224,96)
# @sprite.opacity = @rsprite.opacity*3/4
# @sprite.visible = true
# end
# @sprite.src_rect = @rsprite.src_rect
# end
end
end

View File

@@ -722,6 +722,12 @@ def pbSurf
return false
end
end
if $PokemonSystem.quicksurf == 1
surfbgm = GameData::Metadata.get.surf_BGM
pbCueBGM(surfbgm, 0.5) if surfbgm
pbStartSurfing
return true
end
if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?"))
speciesname = (movefinder) ? movefinder.name : $Trainer.name
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))

View File

@@ -13,6 +13,7 @@ class PokemonSystem
attr_accessor :bgmvolume
attr_accessor :sevolume
attr_accessor :textinput
attr_accessor :quicksurf
def initialize
@textspeed = 1 # Text speed (0=slow, 1=normal, 2=fast)
@@ -26,6 +27,7 @@ class PokemonSystem
@bgmvolume = 100 # Volume of background music and ME
@sevolume = 100 # Volume of sound effects
@textinput = 1 # Text input mode (0=cursor, 1=keyboard)
@quicksurf = 0
end
end
@@ -394,6 +396,14 @@ class PokemonOption_Scene
end
if $game_switches && $game_switches[GOT_BADGE_5] #badge for Surf
@PokemonOptions <<
EnumOption.new(_INTL("Quick Surf"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.quicksurf },
proc { |value| $PokemonSystem.quicksurf = value }
)
end
@PokemonOptions = pbAddOnOptions(@PokemonOptions)
@sprites["option"] = Window_PokemonOption.new(@PokemonOptions, 0,
@sprites["title"].height, Graphics.width,

View File

@@ -1,28 +1,40 @@
#Switches
NEW_GAME_PLUS = 972
BEAT_MT_SILVER = 918
GOT_BADGE_1 = 4
GOT_BADGE_2 = 5
GOT_BADGE_3 = 6
GOT_BADGE_4 = 7
GOT_BADGE_5 = 8
GOT_BADGE_6 = 9
GOT_BADGE_7 = 10
GOT_BADGE_8 = 11
BEAT_THE_LEAGUE = 12
BEAT_MT_SILVER=918
GOT_BADGE_9 = 38
GOT_BADGE_10 = 39
GOT_BADGE_11 = 40
GOT_BADGE_12 = 41
GOT_BADGE_13 = 43
GOT_BADGE_14 = 44
GOT_BADGE_15 = 45
GOT_BADGE_16 = 50
#Variables
DEFAULT_BATTLE_TYPE = 242
BATTLE_FACTORY_TOKENS = 243
NB_GYM_REMATCHES = 162
#Settings
# This is for settings that are used in scripts since it's a chore to change them everywhere to include the module name
NUM_BADGES=Settings::NB_BADGES
EGGINITIALLEVEL=Settings::EGG_LEVEL
NUM_BADGES = Settings::NB_BADGES
EGGINITIALLEVEL = Settings::EGG_LEVEL
#this is fucking stupid but apparently necessary
FALSE = false
TRUE = true
DIRECTION_LEFT=4
DIRECTION_RIGHT=6
DIRECTION_DOWN=2
DIRECTION_UP=8
DIRECTION_LEFT = 4
DIRECTION_RIGHT = 6
DIRECTION_DOWN = 2
DIRECTION_UP = 8

View File

@@ -160,7 +160,7 @@ def generateSameEggGroupFusionsTeam(eggGroup_id)
while !foundFusionPartner
species2 = rand(Settings::NB_POKEMON) + 1
if getPokemonEggGroups(species2).include?(eggGroup)
generatedTeam << getFusionSpecies(species1, species2)
generatedTeam << getFusionSpecies(species1, specieres2)
foundFusionPartner = true
end
end

View File

@@ -562,57 +562,55 @@ def calculatePointsAndCenter(mapwidth)
end
class PokemonReadyMenu
def pbStartReadyMenu(moves, items)
commands = [[], []] # Moves, items
def pbStartReadyMenu(moves,items)
commands = [[],[]] # Moves, items
for i in moves
commands[0].push([i[0], PBMoves.getName(i[0]), true, i[1]])
commands[0].push([i[0], GameData::Move.get(i[0]).name, true, i[1]])
end
commands[0].sort! { |a, b| a[1] <=> b[1] }
commands[0].sort! { |a,b| a[1]<=>b[1] }
for i in items
commands[1].push([i, PBItems.getName(i), false])
commands[1].push([i, GameData::Item.get(i).name, false])
end
commands[1].sort! { |a, b| a[1] <=> b[1] }
commands[1].sort! { |a,b| a[1]<=>b[1] }
@scene.pbStartScene(commands)
loop do
command = @scene.pbShowCommands
if command == -1
break
else
if command[0] == 0 # Use a move
move = commands[0][command[1]][0]
user = $Trainer.party[commands[0][command[1]][3]]
if isConst?(move, PBMoves, :FLY)
###############################################
pbHideMenu
ret = pbBetterRegionMap(-1, true, true)
pbShowMenu unless ret
###############################################
if ret
$PokemonTemp.flydata = ret
$game_temp.in_menu = false
Kernel.pbUseHiddenMove(user, move)
break
end
else
pbHideMenu
if Kernel.pbConfirmUseHiddenMove(user, move)
$game_temp.in_menu = false
Kernel.pbUseHiddenMove(user, move)
break
else
pbShowMenu
end
break if command==-1
if command[0]==0 # Use a move
move = commands[0][command[1]][0]
user = $Trainer.party[commands[0][command[1]][3]]
if move == :FLY || move == :TELEPORT
###############################################
pbHideMenu
ret = pbBetterRegionMap(-1, true, true)
pbShowMenu unless ret
###############################################
if ret
$PokemonTemp.flydata = ret
$game_temp.in_menu = false
Kernel.pbUseHiddenMove(user, move)
break
end
else
pbHideMenu
if pbConfirmUseHiddenMove(user,move)
$game_temp.in_menu = false
pbUseHiddenMove(user,move)
break
else
pbShowMenu
end
else # Use an item
item = commands[1][command[1]][0]
pbHideMenu
if ItemHandlers.triggerConfirmUseInField(item)
break if Kernel.pbUseKeyItemInField(item)
end
end
pbShowMenu
else # Use an item
item = commands[1][command[1]][0]
pbHideMenu
if ItemHandlers.triggerConfirmUseInField(item)
$game_temp.in_menu = false
break if pbUseKeyItemInField(item)
$game_temp.in_menu = true
end
end
pbShowMenu
end
@scene.pbEndScene
end

View File

@@ -80,8 +80,13 @@ def useLantern()
return false
end
Kernel.pbMessage(_INTL("The Lantern illuminated the cave!"))
$PokemonGlobal.flashUsed = true
darkness.radius += 176
while darkness.radius<176
Graphics.update
Input.update
pbUpdateSceneMapd
darkness.radius+=4
end
return true
end
@@ -104,12 +109,18 @@ ItemHandlers::UseInField.add(:TELEPORTER, proc { |item|
def useTeleporter()
if HiddenMoveHandlers.triggerCanUseMove(:TELEPORT, 0,true)
Kernel.pbMessage(_INTL("Teleport to where?", $Trainer.name))
scene = PokemonRegionMapScene.new(-1, false)
screen = PokemonRegionMap.new(scene)
ret = screen.pbStartFlyScreen
ret = pbBetterRegionMap(-1, true, true)
pbShowMenu unless ret
###############################################
if ret
$PokemonTemp.flydata = ret
end
# scene = PokemonRegionMapScene.new(-1, false)
# screen = PokemonRegionMap.new(scene)
# ret = screen.pbStartFlyScreen
# if ret
# $PokemonTemp.flydata = ret
# end
end
if !$PokemonTemp.flydata
@@ -194,18 +205,18 @@ ItemHandlers::UseFromBag.add(:LANTERN, proc { |item|
darkness = $PokemonTemp.darknessSprite
if !darkness || darkness.disposed?
Kernel.pbMessage(_INTL("The cave is already illuminated."))
return false
next false
end
Kernel.pbMessage(_INTL("The Lantern illuminated the cave!"))
$PokemonGlobal.flashUsed = true
darkness.radius += 176
#while darkness.radius<176
# Graphics.update
# Input.update
# pbUpdateSceneMap
# darkness.radius+=4
#end
return true
while darkness.radius<176
Graphics.update
Input.update
pbUpdateSceneMap
darkness.radius+=4
end
next true
})
ItemHandlers::UseFromBag.add(:AZUREFLUTE, proc { |item|