mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Added decent spacing to all scripts thanks to Rubocop
This commit is contained in:
@@ -6,45 +6,45 @@ module HiddenMoveHandlers
|
||||
ConfirmUseMove = MoveHandlerHash.new
|
||||
UseMove = MoveHandlerHash.new
|
||||
|
||||
def self.addCanUseMove(item,proc); CanUseMove.add(item,proc); end
|
||||
def self.addConfirmUseMove(item,proc); ConfirmUseMove.add(item,proc); end
|
||||
def self.addUseMove(item,proc); UseMove.add(item,proc); end
|
||||
def self.addCanUseMove(item, proc); CanUseMove.add(item, proc); end
|
||||
def self.addConfirmUseMove(item, proc); ConfirmUseMove.add(item, proc); end
|
||||
def self.addUseMove(item, proc); UseMove.add(item, proc); end
|
||||
|
||||
def self.hasHandler(item)
|
||||
return CanUseMove[item]!=nil && UseMove[item]!=nil
|
||||
return CanUseMove[item] != nil && UseMove[item] != nil
|
||||
end
|
||||
|
||||
# Returns whether move can be used
|
||||
def self.triggerCanUseMove(item,pokemon,showmsg)
|
||||
def self.triggerCanUseMove(item, pokemon, showmsg)
|
||||
return false if !CanUseMove[item]
|
||||
return CanUseMove.trigger(item,pokemon,showmsg)
|
||||
return CanUseMove.trigger(item, pokemon, showmsg)
|
||||
end
|
||||
|
||||
# Returns whether the player confirmed that they want to use the move
|
||||
def self.triggerConfirmUseMove(item,pokemon)
|
||||
def self.triggerConfirmUseMove(item, pokemon)
|
||||
return true if !ConfirmUseMove[item]
|
||||
return ConfirmUseMove.trigger(item,pokemon)
|
||||
return ConfirmUseMove.trigger(item, pokemon)
|
||||
end
|
||||
|
||||
# Returns whether move was used
|
||||
def self.triggerUseMove(item,pokemon)
|
||||
def self.triggerUseMove(item, pokemon)
|
||||
return false if !UseMove[item]
|
||||
return UseMove.trigger(item,pokemon)
|
||||
return UseMove.trigger(item, pokemon)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def pbCanUseHiddenMove?(pkmn,move,showmsg = true)
|
||||
return HiddenMoveHandlers.triggerCanUseMove(move,pkmn,showmsg)
|
||||
def pbCanUseHiddenMove?(pkmn, move, showmsg = true)
|
||||
return HiddenMoveHandlers.triggerCanUseMove(move, pkmn, showmsg)
|
||||
end
|
||||
|
||||
def pbConfirmUseHiddenMove(pokemon,move)
|
||||
return HiddenMoveHandlers.triggerConfirmUseMove(move,pokemon)
|
||||
def pbConfirmUseHiddenMove(pokemon, move)
|
||||
return HiddenMoveHandlers.triggerConfirmUseMove(move, pokemon)
|
||||
end
|
||||
|
||||
def pbUseHiddenMove(pokemon,move)
|
||||
return HiddenMoveHandlers.triggerUseMove(move,pokemon)
|
||||
def pbUseHiddenMove(pokemon, move)
|
||||
return HiddenMoveHandlers.triggerUseMove(move, pokemon)
|
||||
end
|
||||
|
||||
# Unused
|
||||
@@ -52,8 +52,8 @@ def pbHiddenMoveEvent
|
||||
Events.onAction.trigger(nil)
|
||||
end
|
||||
|
||||
def pbCheckHiddenMoveBadge(badge = -1,showmsg = true)
|
||||
return true if badge<0 # No badge requirement
|
||||
def pbCheckHiddenMoveBadge(badge = -1, showmsg = true)
|
||||
return true if badge < 0 # No badge requirement
|
||||
return true if $DEBUG
|
||||
if (Settings::FIELD_MOVES_COUNT_BADGES) ? $player.badge_count >= badge : $player.badges[badge]
|
||||
return true
|
||||
@@ -69,33 +69,33 @@ end
|
||||
#===============================================================================
|
||||
def pbHiddenMoveAnimation(pokemon)
|
||||
return false if !pokemon
|
||||
viewport=Viewport.new(0,0,0,0)
|
||||
viewport.z=99999
|
||||
bg=Sprite.new(viewport)
|
||||
bg.bitmap=RPG::Cache.picture("hiddenMovebg")
|
||||
sprite=PokemonSprite.new(viewport)
|
||||
viewport = Viewport.new(0, 0, 0, 0)
|
||||
viewport.z = 99999
|
||||
bg = Sprite.new(viewport)
|
||||
bg.bitmap = RPG::Cache.picture("hiddenMovebg")
|
||||
sprite = PokemonSprite.new(viewport)
|
||||
sprite.setOffset(PictureOrigin::Center)
|
||||
sprite.setPokemonBitmap(pokemon)
|
||||
sprite.z=1
|
||||
sprite.visible=false
|
||||
strobebitmap=AnimatedBitmap.new("Graphics/Pictures/hiddenMoveStrobes")
|
||||
strobes=[]
|
||||
sprite.z = 1
|
||||
sprite.visible = false
|
||||
strobebitmap = AnimatedBitmap.new("Graphics/Pictures/hiddenMoveStrobes")
|
||||
strobes = []
|
||||
15.times do |i|
|
||||
strobe=BitmapSprite.new(26*2,8*2,viewport)
|
||||
strobe.bitmap.blt(0,0,strobebitmap.bitmap,Rect.new(0,(i%2)*8*2,26*2,8*2))
|
||||
strobe.z=((i%2)==0 ? 2 : 0)
|
||||
strobe.visible=false
|
||||
strobe = BitmapSprite.new(26 * 2, 8 * 2, viewport)
|
||||
strobe.bitmap.blt(0, 0, strobebitmap.bitmap, Rect.new(0, (i % 2) * 8 * 2, 26 * 2, 8 * 2))
|
||||
strobe.z = ((i % 2) == 0 ? 2 : 0)
|
||||
strobe.visible = false
|
||||
strobes.push(strobe)
|
||||
end
|
||||
strobebitmap.dispose
|
||||
interp=RectInterpolator.new(
|
||||
Rect.new(0,Graphics.height/2,Graphics.width,0),
|
||||
Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),
|
||||
Graphics.frame_rate/4)
|
||||
ptinterp=nil
|
||||
phase=1
|
||||
frames=0
|
||||
strobeSpeed = 64*20/Graphics.frame_rate
|
||||
interp = RectInterpolator.new(
|
||||
Rect.new(0, Graphics.height / 2, Graphics.width, 0),
|
||||
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
|
||||
Graphics.frame_rate / 4)
|
||||
ptinterp = nil
|
||||
phase = 1
|
||||
frames = 0
|
||||
strobeSpeed = 64 * 20 / Graphics.frame_rate
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
@@ -104,71 +104,71 @@ def pbHiddenMoveAnimation(pokemon)
|
||||
when 1 # Expand viewport height from zero to full
|
||||
interp.update
|
||||
interp.set(viewport.rect)
|
||||
bg.oy=(bg.bitmap.height-viewport.rect.height)/2
|
||||
bg.oy = (bg.bitmap.height - viewport.rect.height) / 2
|
||||
if interp.done?
|
||||
phase=2
|
||||
ptinterp=PointInterpolator.new(
|
||||
Graphics.width+(sprite.bitmap.width/2),bg.bitmap.height/2,
|
||||
Graphics.width/2,bg.bitmap.height/2,
|
||||
Graphics.frame_rate*4/10)
|
||||
phase = 2
|
||||
ptinterp = PointInterpolator.new(
|
||||
Graphics.width + (sprite.bitmap.width / 2), bg.bitmap.height / 2,
|
||||
Graphics.width / 2, bg.bitmap.height / 2,
|
||||
Graphics.frame_rate * 4 / 10)
|
||||
end
|
||||
when 2 # Slide Pokémon sprite in from right to centre
|
||||
ptinterp.update
|
||||
sprite.x=ptinterp.x
|
||||
sprite.y=ptinterp.y
|
||||
sprite.visible=true
|
||||
sprite.x = ptinterp.x
|
||||
sprite.y = ptinterp.y
|
||||
sprite.visible = true
|
||||
if ptinterp.done?
|
||||
phase=3
|
||||
phase = 3
|
||||
pokemon.play_cry
|
||||
frames=0
|
||||
frames = 0
|
||||
end
|
||||
when 3 # Wait
|
||||
frames+=1
|
||||
if frames>Graphics.frame_rate*3/4
|
||||
phase=4
|
||||
ptinterp=PointInterpolator.new(
|
||||
Graphics.width/2,bg.bitmap.height/2,
|
||||
-(sprite.bitmap.width/2),bg.bitmap.height/2,
|
||||
Graphics.frame_rate*4/10)
|
||||
frames=0
|
||||
frames += 1
|
||||
if frames > Graphics.frame_rate * 3 / 4
|
||||
phase = 4
|
||||
ptinterp = PointInterpolator.new(
|
||||
Graphics.width / 2, bg.bitmap.height / 2,
|
||||
-(sprite.bitmap.width / 2), bg.bitmap.height / 2,
|
||||
Graphics.frame_rate * 4 / 10)
|
||||
frames = 0
|
||||
end
|
||||
when 4 # Slide Pokémon sprite off from centre to left
|
||||
ptinterp.update
|
||||
sprite.x=ptinterp.x
|
||||
sprite.y=ptinterp.y
|
||||
sprite.x = ptinterp.x
|
||||
sprite.y = ptinterp.y
|
||||
if ptinterp.done?
|
||||
phase=5
|
||||
sprite.visible=false
|
||||
interp=RectInterpolator.new(
|
||||
Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),
|
||||
Rect.new(0,Graphics.height/2,Graphics.width,0),
|
||||
Graphics.frame_rate/4)
|
||||
phase = 5
|
||||
sprite.visible = false
|
||||
interp = RectInterpolator.new(
|
||||
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
|
||||
Rect.new(0, Graphics.height / 2, Graphics.width, 0),
|
||||
Graphics.frame_rate / 4)
|
||||
end
|
||||
when 5 # Shrink viewport height from full to zero
|
||||
interp.update
|
||||
interp.set(viewport.rect)
|
||||
bg.oy=(bg.bitmap.height-viewport.rect.height)/2
|
||||
phase=6 if interp.done?
|
||||
bg.oy = (bg.bitmap.height - viewport.rect.height) / 2
|
||||
phase = 6 if interp.done?
|
||||
end
|
||||
# Constantly stream the strobes across the screen
|
||||
for strobe in strobes
|
||||
strobe.ox=strobe.viewport.rect.x
|
||||
strobe.oy=strobe.viewport.rect.y
|
||||
strobe.ox = strobe.viewport.rect.x
|
||||
strobe.oy = strobe.viewport.rect.y
|
||||
if !strobe.visible # Initial placement of strobes
|
||||
randomY = 16*(1+rand(bg.bitmap.height/16-2))
|
||||
strobe.y = randomY+(Graphics.height-bg.bitmap.height)/2
|
||||
randomY = 16 * (1 + rand(bg.bitmap.height / 16 - 2))
|
||||
strobe.y = randomY + (Graphics.height - bg.bitmap.height) / 2
|
||||
strobe.x = rand(Graphics.width)
|
||||
strobe.visible = true
|
||||
elsif strobe.x<Graphics.width # Move strobe right
|
||||
elsif strobe.x < Graphics.width # Move strobe right
|
||||
strobe.x += strobeSpeed
|
||||
else # Strobe is off the screen, reposition it to the left of the screen
|
||||
randomY = 16*(1+rand(bg.bitmap.height/16-2))
|
||||
strobe.y = randomY+(Graphics.height-bg.bitmap.height)/2
|
||||
strobe.x = -strobe.bitmap.width-rand(Graphics.width/4)
|
||||
randomY = 16 * (1 + rand(bg.bitmap.height / 16 - 2))
|
||||
strobe.y = randomY + (Graphics.height - bg.bitmap.height) / 2
|
||||
strobe.x = -strobe.bitmap.width - rand(Graphics.width / 4)
|
||||
end
|
||||
end
|
||||
pbUpdateSceneMap
|
||||
break if phase==6
|
||||
break if phase == 6
|
||||
end
|
||||
sprite.dispose
|
||||
for strobe in strobes
|
||||
@@ -188,7 +188,7 @@ end
|
||||
def pbCut
|
||||
move = :CUT
|
||||
movefinder = $player.get_pokemon_with_move(move)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT,false) || (!$DEBUG && !movefinder)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT, false) || (!$DEBUG && !movefinder)
|
||||
pbMessage(_INTL("This tree looks like it can be cut down."))
|
||||
return false
|
||||
end
|
||||
@@ -196,15 +196,15 @@ def pbCut
|
||||
if pbConfirmMessage(_INTL("Would you like to cut it?"))
|
||||
$stats.cut_count += 1
|
||||
speciesname = (movefinder) ? movefinder.name : $player.name
|
||||
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:CUT,proc { |move,pkmn,showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT,showmsg)
|
||||
HiddenMoveHandlers::CanUseMove.add(:CUT, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT, showmsg)
|
||||
facingEvent = $game_player.pbFacingEvent
|
||||
if !facingEvent || !facingEvent.name[/cuttree/i]
|
||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||
@@ -213,9 +213,9 @@ HiddenMoveHandlers::CanUseMove.add(:CUT,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:CUT,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:CUT, proc { |move, pokemon|
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
$stats.cut_count += 1
|
||||
facingEvent = $game_player.pbFacingEvent
|
||||
@@ -228,20 +228,20 @@ HiddenMoveHandlers::UseMove.add(:CUT,proc { |move,pokemon|
|
||||
def pbSmashEvent(event)
|
||||
return if !event
|
||||
if event.name[/cuttree/i]
|
||||
pbSEPlay("Cut",80)
|
||||
pbSEPlay("Cut", 80)
|
||||
elsif event.name[/smashrock/i]
|
||||
pbSEPlay("Rock Smash",80)
|
||||
pbSEPlay("Rock Smash", 80)
|
||||
end
|
||||
pbMoveRoute(event,[
|
||||
PBMoveRoute::Wait,2,
|
||||
pbMoveRoute(event, [
|
||||
PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnLeft,
|
||||
PBMoveRoute::Wait,2,
|
||||
PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnRight,
|
||||
PBMoveRoute::Wait,2,
|
||||
PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnUp,
|
||||
PBMoveRoute::Wait,2
|
||||
PBMoveRoute::Wait, 2
|
||||
])
|
||||
pbWait(Graphics.frame_rate*4/10)
|
||||
pbWait(Graphics.frame_rate * 4 / 10)
|
||||
event.erase
|
||||
$PokemonMap.addErasedEvent(event.id) if $PokemonMap
|
||||
end
|
||||
@@ -251,9 +251,9 @@ end
|
||||
#===============================================================================
|
||||
# Dig
|
||||
#===============================================================================
|
||||
HiddenMoveHandlers::CanUseMove.add(:DIG,proc { |move,pkmn,showmsg|
|
||||
HiddenMoveHandlers::CanUseMove.add(:DIG, proc { |move, pkmn, showmsg|
|
||||
escape = ($PokemonGlobal.escapePoint rescue nil)
|
||||
if !escape || escape==[]
|
||||
if !escape || escape == []
|
||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||
next false
|
||||
end
|
||||
@@ -264,18 +264,18 @@ HiddenMoveHandlers::CanUseMove.add(:DIG,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::ConfirmUseMove.add(:DIG,proc { |move,pkmn|
|
||||
HiddenMoveHandlers::ConfirmUseMove.add(:DIG, proc { |move, pkmn|
|
||||
escape = ($PokemonGlobal.escapePoint rescue nil)
|
||||
next false if !escape || escape==[]
|
||||
next false if !escape || escape == []
|
||||
mapname = pbGetMapNameFromId(escape[0])
|
||||
next pbConfirmMessage(_INTL("Want to escape from here and return to {1}?",mapname))
|
||||
next pbConfirmMessage(_INTL("Want to escape from here and return to {1}?", mapname))
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:DIG,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:DIG, proc { |move, pokemon|
|
||||
escape = ($PokemonGlobal.escapePoint rescue nil)
|
||||
if escape
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = escape[0]
|
||||
@@ -303,13 +303,13 @@ def pbDive
|
||||
return false if !map_metadata || !map_metadata.dive_map_id
|
||||
move = :DIVE
|
||||
movefinder = $player.get_pokemon_with_move(move)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE, false) || (!$DEBUG && !movefinder)
|
||||
pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
|
||||
return false
|
||||
end
|
||||
if pbConfirmMessage(_INTL("The sea is deep here. Would you like to use Dive?"))
|
||||
speciesname = (movefinder) ? movefinder.name : $player.name
|
||||
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = map_metadata.dive_map_id
|
||||
@@ -341,13 +341,13 @@ def pbSurfacing
|
||||
return if !surface_map_id
|
||||
move = :DIVE
|
||||
movefinder = $player.get_pokemon_with_move(move)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE, false) || (!$DEBUG && !movefinder)
|
||||
pbMessage(_INTL("Light is filtering down from above. A Pokémon may be able to surface here."))
|
||||
return false
|
||||
end
|
||||
if pbConfirmMessage(_INTL("Light is filtering down from above. Would you like to use Dive?"))
|
||||
speciesname = (movefinder) ? movefinder.name : $player.name
|
||||
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = surface_map_id
|
||||
@@ -359,7 +359,7 @@ def pbSurfacing
|
||||
pbUpdateVehicle
|
||||
$scene.transfer_player(false)
|
||||
surfbgm = GameData::Metadata.get.surf_BGM
|
||||
(surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue
|
||||
(surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue
|
||||
$game_map.refresh
|
||||
}
|
||||
return true
|
||||
@@ -368,7 +368,7 @@ def pbSurfacing
|
||||
end
|
||||
|
||||
# @deprecated This method is slated to be removed in v21.
|
||||
def pbTransferUnderwater(mapid,x,y,direction = $game_player.direction)
|
||||
def pbTransferUnderwater(mapid, x, y, direction = $game_player.direction)
|
||||
Deprecation.warn_method('pbTransferUnderwater', 'v21', '"Transfer Player" event command')
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = mapid
|
||||
@@ -398,8 +398,8 @@ Events.onAction += proc { |_sender, _e|
|
||||
end
|
||||
}
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,showmsg)
|
||||
HiddenMoveHandlers::CanUseMove.add(:DIVE, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE, showmsg)
|
||||
if $PokemonGlobal.diving
|
||||
surface_map_id = nil
|
||||
GameData::MapMetadata.each do |map_data|
|
||||
@@ -425,7 +425,7 @@ HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:DIVE, proc { |move, pokemon|
|
||||
wasdiving = $PokemonGlobal.diving
|
||||
if $PokemonGlobal.diving
|
||||
dive_map_id = nil
|
||||
@@ -439,7 +439,7 @@ HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
|
||||
end
|
||||
next false if !dive_map_id
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = dive_map_id
|
||||
@@ -461,8 +461,8 @@ HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
|
||||
#===============================================================================
|
||||
# Flash
|
||||
#===============================================================================
|
||||
HiddenMoveHandlers::CanUseMove.add(:FLASH,proc { |move,pkmn,showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLASH,showmsg)
|
||||
HiddenMoveHandlers::CanUseMove.add(:FLASH, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLASH, showmsg)
|
||||
if !$game_map.metadata&.dark_map
|
||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||
next false
|
||||
@@ -474,21 +474,21 @@ HiddenMoveHandlers::CanUseMove.add(:FLASH,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:FLASH, proc { |move, pokemon|
|
||||
darkness = $game_temp.darkness_sprite
|
||||
next false if !darkness || darkness.disposed?
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
$PokemonGlobal.flashUsed = true
|
||||
$stats.flash_count += 1
|
||||
radiusDiff = 8*20/Graphics.frame_rate
|
||||
while darkness.radius<darkness.radiusMax
|
||||
radiusDiff = 8 * 20 / Graphics.frame_rate
|
||||
while darkness.radius < darkness.radiusMax
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
darkness.radius += radiusDiff
|
||||
darkness.radius = darkness.radiusMax if darkness.radius>darkness.radiusMax
|
||||
darkness.radius = darkness.radiusMax if darkness.radius > darkness.radiusMax
|
||||
end
|
||||
next true
|
||||
})
|
||||
@@ -542,11 +542,11 @@ def pbFlyToNewLocation(pkmn = nil, move = :FLY)
|
||||
return true
|
||||
end
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:FLY,proc { |move, pkmn, showmsg|
|
||||
HiddenMoveHandlers::CanUseMove.add(:FLY, proc { |move, pkmn, showmsg|
|
||||
next pbCanFly?(pkmn, showmsg)
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:FLY,proc { |move, pkmn|
|
||||
HiddenMoveHandlers::UseMove.add(:FLY, proc { |move, pkmn|
|
||||
if $game_temp.fly_destination.nil?
|
||||
pbMessage(_INTL("Can't use that here."))
|
||||
next false
|
||||
@@ -562,21 +562,21 @@ HiddenMoveHandlers::UseMove.add(:FLY,proc { |move, pkmn|
|
||||
#===============================================================================
|
||||
def pbHeadbuttEffect(event = nil)
|
||||
event = $game_player.pbFacingEvent(true) if !event
|
||||
a = (event.x+(event.x/24).floor+1)*(event.y+(event.y/24).floor+1)
|
||||
a = (a*2/5)%10 # Even 2x as likely as odd, 0 is 1.5x as likely as odd
|
||||
a = (event.x + (event.x / 24).floor + 1) * (event.y + (event.y / 24).floor + 1)
|
||||
a = (a * 2 / 5) % 10 # Even 2x as likely as odd, 0 is 1.5x as likely as odd
|
||||
b = $player.public_ID % 10 # Practically equal odds of each value
|
||||
chance = 1 # ~50%
|
||||
if a==b # 10%
|
||||
if a == b # 10%
|
||||
chance = 8
|
||||
elsif a>b && (a-b).abs<5 # ~30.3%
|
||||
elsif a > b && (a - b).abs < 5 # ~30.3%
|
||||
chance = 5
|
||||
elsif a<b && (a-b).abs>5 # ~9.7%
|
||||
elsif a < b && (a - b).abs > 5 # ~9.7%
|
||||
chance = 5
|
||||
end
|
||||
if rand(10)>=chance
|
||||
if rand(10) >= chance
|
||||
pbMessage(_INTL("Nope. Nothing..."))
|
||||
else
|
||||
enctype = (chance==1) ? :HeadbuttLow : :HeadbuttHigh
|
||||
enctype = (chance == 1) ? :HeadbuttLow : :HeadbuttHigh
|
||||
if pbEncounter(enctype)
|
||||
$stats.headbutt_battles += 1
|
||||
else
|
||||
@@ -595,7 +595,7 @@ def pbHeadbutt(event = nil)
|
||||
if pbConfirmMessage(_INTL("A Pokémon could be in this tree. Would you like to use Headbutt?"))
|
||||
$stats.headbutt_count += 1
|
||||
speciesname = (movefinder) ? movefinder.name : $player.name
|
||||
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
pbHeadbuttEffect(event)
|
||||
return true
|
||||
@@ -603,7 +603,7 @@ def pbHeadbutt(event = nil)
|
||||
return false
|
||||
end
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:HEADBUTT,proc { |move,pkmn,showmsg|
|
||||
HiddenMoveHandlers::CanUseMove.add(:HEADBUTT, proc { |move, pkmn, showmsg|
|
||||
facingEvent = $game_player.pbFacingEvent
|
||||
if !facingEvent || !facingEvent.name[/headbutttree/i]
|
||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||
@@ -612,9 +612,9 @@ HiddenMoveHandlers::CanUseMove.add(:HEADBUTT,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:HEADBUTT,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:HEADBUTT, proc { |move, pokemon|
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
$stats.headbutt_count += 1
|
||||
facingEvent = $game_player.pbFacingEvent
|
||||
@@ -636,22 +636,22 @@ end
|
||||
def pbRockSmash
|
||||
move = :ROCKSMASH
|
||||
movefinder = $player.get_pokemon_with_move(move)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH,false) || (!$DEBUG && !movefinder)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH, false) || (!$DEBUG && !movefinder)
|
||||
pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
|
||||
return false
|
||||
end
|
||||
if pbConfirmMessage(_INTL("This rock appears to be breakable. Would you like to use Rock Smash?"))
|
||||
$stats.rock_smash_count += 1
|
||||
speciesname = (movefinder) ? movefinder.name : $player.name
|
||||
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:ROCKSMASH,proc { |move,pkmn,showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH,showmsg)
|
||||
HiddenMoveHandlers::CanUseMove.add(:ROCKSMASH, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH, showmsg)
|
||||
facingEvent = $game_player.pbFacingEvent
|
||||
if !facingEvent || !facingEvent.name[/smashrock/i]
|
||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||
@@ -660,9 +660,9 @@ HiddenMoveHandlers::CanUseMove.add(:ROCKSMASH,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:ROCKSMASH,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:ROCKSMASH, proc { |move, pokemon|
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
$stats.rock_smash_count += 1
|
||||
facingEvent = $game_player.pbFacingEvent
|
||||
@@ -685,29 +685,29 @@ def pbStrength
|
||||
end
|
||||
move = :STRENGTH
|
||||
movefinder = $player.get_pokemon_with_move(move)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH,false) || (!$DEBUG && !movefinder)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH, false) || (!$DEBUG && !movefinder)
|
||||
pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
|
||||
return false
|
||||
end
|
||||
pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.\1"))
|
||||
if pbConfirmMessage(_INTL("Would you like to use Strength?"))
|
||||
speciesname = (movefinder) ? movefinder.name : $player.name
|
||||
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",speciesname))
|
||||
pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!", speciesname))
|
||||
$PokemonMap.strengthUsed = true
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
Events.onAction += proc { |_sender,_e|
|
||||
Events.onAction += proc { |_sender, _e|
|
||||
facingEvent = $game_player.pbFacingEvent
|
||||
pbStrength if facingEvent && facingEvent.name[/strengthboulder/i]
|
||||
}
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:STRENGTH,proc { |move,pkmn,showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH,showmsg)
|
||||
HiddenMoveHandlers::CanUseMove.add(:STRENGTH, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH, showmsg)
|
||||
if $PokemonMap.strengthUsed
|
||||
pbMessage(_INTL("Strength is already being used.")) if showmsg
|
||||
next false
|
||||
@@ -715,11 +715,11 @@ HiddenMoveHandlers::CanUseMove.add(:STRENGTH,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:STRENGTH,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:STRENGTH, proc { |move, pokemon|
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!\1",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!\1", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",pokemon.name))
|
||||
pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!", pokemon.name))
|
||||
$PokemonMap.strengthUsed = true
|
||||
next true
|
||||
})
|
||||
@@ -734,16 +734,16 @@ def pbSurf
|
||||
return false if !$game_player.can_ride_vehicle_with_follower?
|
||||
move = :SURF
|
||||
movefinder = $player.get_pokemon_with_move(move)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, false) || (!$DEBUG && !movefinder)
|
||||
return false
|
||||
end
|
||||
if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?"))
|
||||
speciesname = (movefinder) ? movefinder.name : $player.name
|
||||
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbCancelVehicles
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
surfbgm = GameData::Metadata.get.surf_BGM
|
||||
pbCueBGM(surfbgm,0.5) if surfbgm
|
||||
pbCueBGM(surfbgm, 0.5) if surfbgm
|
||||
pbStartSurfing
|
||||
return true
|
||||
end
|
||||
@@ -759,19 +759,19 @@ def pbStartSurfing
|
||||
$game_temp.surf_base_coords = $map_factory.getFacingCoords($game_player.x, $game_player.y, $game_player.direction)
|
||||
pbJumpToward
|
||||
$game_temp.surf_base_coords = nil
|
||||
$game_player.check_event_trigger_here([1,2])
|
||||
$game_player.check_event_trigger_here([1, 2])
|
||||
end
|
||||
|
||||
def pbEndSurf(_xOffset,_yOffset)
|
||||
def pbEndSurf(_xOffset, _yOffset)
|
||||
return false if !$PokemonGlobal.surfing
|
||||
x = $game_player.x
|
||||
y = $game_player.y
|
||||
if $game_map.terrain_tag(x,y).can_surf && !$game_player.pbFacingTerrainTag.can_surf
|
||||
if $game_map.terrain_tag(x, y).can_surf && !$game_player.pbFacingTerrainTag.can_surf
|
||||
$game_temp.surf_base_coords = [x, y]
|
||||
if pbJumpToward(1,false,true)
|
||||
if pbJumpToward(1, false, true)
|
||||
$game_map.autoplayAsCue
|
||||
$game_player.increase_steps
|
||||
result = $game_player.check_event_trigger_here([1,2])
|
||||
result = $game_player.check_event_trigger_here([1, 2])
|
||||
pbOnStepTaken(result)
|
||||
end
|
||||
$game_temp.surf_base_coords = nil
|
||||
@@ -781,7 +781,7 @@ def pbEndSurf(_xOffset,_yOffset)
|
||||
end
|
||||
|
||||
# @deprecated This method is slated to be removed in v21.
|
||||
def pbTransferSurfing(mapid,xcoord,ycoord,direction = $game_player.direction)
|
||||
def pbTransferSurfing(mapid, xcoord, ycoord, direction = $game_player.direction)
|
||||
Deprecation.warn_method('pbTransferSurfing', 'v21', '"Transfer Player" event command')
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = mapid
|
||||
@@ -794,16 +794,16 @@ def pbTransferSurfing(mapid,xcoord,ycoord,direction = $game_player.direction)
|
||||
}
|
||||
end
|
||||
|
||||
Events.onAction += proc { |_sender,_e|
|
||||
Events.onAction += proc { |_sender, _e|
|
||||
next if $PokemonGlobal.surfing
|
||||
next if $game_map.metadata&.always_bicycle
|
||||
next if !$game_player.pbFacingTerrainTag.can_surf_freely
|
||||
next if !$game_map.passable?($game_player.x,$game_player.y,$game_player.direction,$game_player)
|
||||
next if !$game_map.passable?($game_player.x, $game_player.y, $game_player.direction, $game_player)
|
||||
pbSurf
|
||||
}
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:SURF,proc { |move,pkmn,showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,showmsg)
|
||||
HiddenMoveHandlers::CanUseMove.add(:SURF, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, showmsg)
|
||||
if $PokemonGlobal.surfing
|
||||
pbMessage(_INTL("You're already surfing.")) if showmsg
|
||||
next false
|
||||
@@ -817,21 +817,21 @@ HiddenMoveHandlers::CanUseMove.add(:SURF,proc { |move,pkmn,showmsg|
|
||||
next false
|
||||
end
|
||||
if !$game_player.pbFacingTerrainTag.can_surf_freely ||
|
||||
!$game_map.passable?($game_player.x,$game_player.y,$game_player.direction,$game_player)
|
||||
!$game_map.passable?($game_player.x, $game_player.y, $game_player.direction, $game_player)
|
||||
pbMessage(_INTL("No surfing here!")) if showmsg
|
||||
next false
|
||||
end
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:SURF,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:SURF, proc { |move, pokemon|
|
||||
$game_temp.in_menu = false
|
||||
pbCancelVehicles
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
surfbgm = GameData::Metadata.get.surf_BGM
|
||||
pbCueBGM(surfbgm,0.5) if surfbgm
|
||||
pbCueBGM(surfbgm, 0.5) if surfbgm
|
||||
pbStartSurfing
|
||||
next true
|
||||
})
|
||||
@@ -846,7 +846,7 @@ def pbSweetScent
|
||||
pbMessage(_INTL("The sweet scent faded for some reason..."))
|
||||
return
|
||||
end
|
||||
viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
||||
viewport.z = 99999
|
||||
count = 0
|
||||
viewport.color.red = 255
|
||||
@@ -855,9 +855,9 @@ def pbSweetScent
|
||||
viewport.color.alpha -= 10
|
||||
alphaDiff = 12 * 20 / Graphics.frame_rate
|
||||
loop do
|
||||
if count==0 && viewport.color.alpha<128
|
||||
if count == 0 && viewport.color.alpha < 128
|
||||
viewport.color.alpha += alphaDiff
|
||||
elsif count>Graphics.frame_rate/4
|
||||
elsif count > Graphics.frame_rate / 4
|
||||
viewport.color.alpha -= alphaDiff
|
||||
else
|
||||
count += 1
|
||||
@@ -865,7 +865,7 @@ def pbSweetScent
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
break if viewport.color.alpha<=0
|
||||
break if viewport.color.alpha <= 0
|
||||
end
|
||||
viewport.dispose
|
||||
enctype = $PokemonEncounters.encounter_type
|
||||
@@ -875,13 +875,13 @@ def pbSweetScent
|
||||
end
|
||||
end
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:SWEETSCENT,proc { |move,pkmn,showmsg|
|
||||
HiddenMoveHandlers::CanUseMove.add(:SWEETSCENT, proc { |move, pkmn, showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:SWEETSCENT,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:SWEETSCENT, proc { |move, pokemon|
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
pbSweetScent
|
||||
next true
|
||||
@@ -892,7 +892,7 @@ HiddenMoveHandlers::UseMove.add(:SWEETSCENT,proc { |move,pokemon|
|
||||
#===============================================================================
|
||||
# Teleport
|
||||
#===============================================================================
|
||||
HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
|
||||
HiddenMoveHandlers::CanUseMove.add(:TELEPORT, proc { |move, pkmn, showmsg|
|
||||
if !$game_map.metadata&.outdoor_map
|
||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||
next false
|
||||
@@ -911,22 +911,22 @@ HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::ConfirmUseMove.add(:TELEPORT,proc { |move,pkmn|
|
||||
HiddenMoveHandlers::ConfirmUseMove.add(:TELEPORT, proc { |move, pkmn|
|
||||
healing = $PokemonGlobal.healingSpot
|
||||
healing = GameData::PlayerMetadata.get($player.character_ID)&.home if !healing
|
||||
healing = GameData::Metadata.get.home if !healing # Home
|
||||
next false if !healing
|
||||
mapname = pbGetMapNameFromId(healing[0])
|
||||
next pbConfirmMessage(_INTL("Want to return to the healing spot used last in {1}?",mapname))
|
||||
next pbConfirmMessage(_INTL("Want to return to the healing spot used last in {1}?", mapname))
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:TELEPORT,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:TELEPORT, proc { |move, pokemon|
|
||||
healing = $PokemonGlobal.healingSpot
|
||||
healing = GameData::PlayerMetadata.get($player.character_ID)&.home if !healing
|
||||
healing = GameData::Metadata.get.home if !healing # Home
|
||||
next false if !healing
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
pbFadeOutIn {
|
||||
$game_temp.player_new_map_id = healing[0]
|
||||
@@ -985,13 +985,13 @@ end
|
||||
def pbWaterfall
|
||||
move = :WATERFALL
|
||||
movefinder = $player.get_pokemon_with_move(move)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL,false) || (!$DEBUG && !movefinder)
|
||||
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL, false) || (!$DEBUG && !movefinder)
|
||||
pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
|
||||
return false
|
||||
end
|
||||
if pbConfirmMessage(_INTL("It's a large waterfall. Would you like to use Waterfall?"))
|
||||
speciesname = (movefinder) ? movefinder.name : $player.name
|
||||
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
pbAscendWaterfall
|
||||
return true
|
||||
@@ -999,7 +999,7 @@ def pbWaterfall
|
||||
return false
|
||||
end
|
||||
|
||||
Events.onAction += proc { |_sender,_e|
|
||||
Events.onAction += proc { |_sender, _e|
|
||||
terrain = $game_player.pbFacingTerrainTag
|
||||
if terrain.waterfall
|
||||
pbWaterfall
|
||||
@@ -1008,8 +1008,8 @@ Events.onAction += proc { |_sender,_e|
|
||||
end
|
||||
}
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:WATERFALL,proc { |move,pkmn,showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL,showmsg)
|
||||
HiddenMoveHandlers::CanUseMove.add(:WATERFALL, proc { |move, pkmn, showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL, showmsg)
|
||||
if !$game_player.pbFacingTerrainTag.waterfall
|
||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||
next false
|
||||
@@ -1017,9 +1017,9 @@ HiddenMoveHandlers::CanUseMove.add(:WATERFALL,proc { |move,pkmn,showmsg|
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:WATERFALL,proc { |move,pokemon|
|
||||
HiddenMoveHandlers::UseMove.add(:WATERFALL, proc { |move, pokemon|
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
pbAscendWaterfall
|
||||
next true
|
||||
|
||||
Reference in New Issue
Block a user