• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

Fly Poké Ball Animation 1.0

Fly Poké Ball Animation
Current Version: 1.0

biT20Qs.gif

Adds Poké Ball opening and closing animations for using Fly like how it was done in FrLg.

----
To use this, extract the resources into their respective folders, and place the script somewhere above Main.

-------
Download:
https://www.dropbox.com/sh/aghic053xo0ilic/AADYHHITcm_tXRHlXpMWC_nBa?dl=0

-------
Script:
Code:
Expand Collapse Copy
################################################################################
#               Fly Poké Ball Animation v1.0 By Ulithium_Dragon
#                        Fly Animation v1 by KleinStudio
################################################################################

BIRD_ANIMATION_TIME = 48

#========================================================#
#////////////////////////////////////////////////////////#
#========================================================#
module PokeballUseSettings
  PokeballUseStartFileName = [
    "boy_UsePokeball",  # Player A
    "girl_UsePokeball", # Player B
  ]
  PokeballUseEndFileName = [
    "boy_UsePokeballEND",  # Player A
    "girl_UsePokeballEND", # Player B
  ]
  PokeballStartFileNameSurf = [
    "boy_surf_UsePokeball",  # Player A
    "girl_surf_UsePokeball", # Player B
  ]
  PokeballUseEndFileNameSurf = [
    "boy_surf_UsePokeballEND",  # Player A
    "girl_surf_UsePokeballEND", # Player B
  ]
  FlyReturnStartFileName = [
    "boy_UseFlyReturn",  # Player A
    "girl_UseFlyReturn", # Player B
  ]
  FlyReturnEndFileName = [
    "boy_UseFlyReturnEND",  # Player A
    "girl_UseFlyReturnEND", # Player B
  ]
end

def Kernel.pbPokeballUseAnimationStart
  $game_player.turn_down
  meta=pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID)
  if meta
    trainer=$Trainer if !trainer
    outfit=trainer ? trainer.outfit : 0
    if $PokemonGlobal.surfing || $PokemonGlobal.diving
      if outfit==0
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseStartFileNameSurf[$PokemonGlobal.playerID], $game_player.fullPattern)
      else
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseStartFileNameSurf[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
      end
    else  #Not surfing or diving.
      if outfit==0
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseStartFileName[$PokemonGlobal.playerID], $game_player.fullPattern)
      else
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseStartFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
      end
    end
    pbWait(8)
    $game_player.turn_down
    pbWait(4)
    $game_player.turn_left
    pbWait(4)
    $game_player.turn_right
    pbWait(4)
    $game_player.turn_up
    pbWait(6)
    if $PokemonGlobal.surfing || $PokemonGlobal.diving
      if outfit==0
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseEndFileNameSurf[$PokemonGlobal.playerID], $game_player.fullPattern)
      else
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseEndFileNameSurf[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
      end
    else  #Not surfing or diving.
      if outfit==0
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseEndFileName[$PokemonGlobal.playerID], $game_player.fullPattern)
      else
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseEndFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
      end
    end
    pbWait(4)
  end
end


def Kernel.pbPokeballUseFlyReturn
  $game_player.turn_down
  meta=pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID)
  if meta
    trainer=$Trainer if !trainer
    outfit=trainer ? trainer.outfit : 0
    if outfit==0
      $game_player.setDefaultCharName(PokeballUseSettings::FlyReturnStartFileName[$PokemonGlobal.playerID], $game_player.fullPattern)
    else
      $game_player.setDefaultCharName(PokeballUseSettings::FlyReturnStartFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
    end
    pbWait(4)
    $game_player.turn_down
    pbWait(2)
    $game_player.turn_left
    pbWait(2)
    $game_player.turn_right
    pbWait(2)
    $game_player.turn_up
    pbWait(2)
    if outfit==0
      $game_player.setDefaultCharName(PokeballUseSettings::FlyReturnEndFileName[$PokemonGlobal.playerID], $game_player.fullPattern)
    else
      $game_player.setDefaultCharName(PokeballUseSettings::FlyReturnEndFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
    end
    $game_player.turn_down
    pbWait(2)
    $game_player.turn_left
    pbWait(2)
    $game_player.turn_right
    pbWait(2)
    $game_player.turn_up
    pbWait(6)
    if outfit==0
      $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseEndFileName[$PokemonGlobal.playerID], $game_player.fullPattern)
    else
      $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseEndFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
    end
    pbWait(4)
  end
end


def Kernel.pbPokeballUseAnimationEnd
  meta=pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID)
  if meta
    trainer=$Trainer if !trainer
    outfit=trainer ? trainer.outfit : 0
    if $PokemonGlobal.surfing || $PokemonGlobal.diving
      if outfit==0
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseStartFileNameSurf[$PokemonGlobal.playerID], $game_player.fullPattern)
      else
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseStartFileNameSurf[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
      end
    else  #Not surfing or diving.
      if outfit==0
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseStartFileName[$PokemonGlobal.playerID], $game_player.fullPattern)
      else
        $game_player.setDefaultCharName(PokeballUseSettings::PokeballUseStartFileName[$PokemonGlobal.playerID]+"_"+outfit.to_s, $game_player.fullPattern)
      end
    end
    pbWait(8)
    $game_player.turn_up
    pbWait(4)
    $game_player.turn_right
    pbWait(4)
    $game_player.turn_left
    pbWait(4)
    $game_player.turn_down
    pbWait(4)
    $game_player.setDefaultCharName(pbGetPlayerCharset(meta,1), $game_player.fullPattern)
    $game_player.turn_down
    pbWait(8)
  end
end
#========================================================#
#////////////////////////////////////////////////////////#
#========================================================#

HiddenMoveHandlers::UseMove.add(:FLY,proc{|move,pokemon|
   if !$PokemonTemp.flydata
     Kernel.pbMessage(_INTL("Can't use that here."))
   end
   Kernel.pbPokeballUseAnimationStart
   if !pbHiddenMoveAnimation(pokemon)
     Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
   end
   pbWait(6)
   Kernel.pbPokeballUseAnimationEnd
   pbFlyAnimation
   pbFadeOutIn(99999){
      Kernel.pbCancelVehicles
      $game_temp.player_new_map_id=$PokemonTemp.flydata[0]
      $game_temp.player_new_x=$PokemonTemp.flydata[1]
      $game_temp.player_new_y=$PokemonTemp.flydata[2]
      $PokemonTemp.flydata=nil
      $game_temp.player_new_direction=2
      $scene.transfer_player
      $game_map.autoplay
      $game_map.refresh
   }
   pbFlyAnimation(true)
   pbWait(12)
   Kernel.pbPokeballUseAnimationStart
   pbWait(4)
   Kernel.pbPokeballUseFlyReturn
   pbWait(8)
   Kernel.pbPokeballUseAnimationEnd
   pbEraseEscapePoint
   return true
})
#========================================================#
#////////////////////////////////////////////////////////#
#========================================================#

class Game_Character
  def setOpacity(value)
    @opacity=(value)
  end
end

def pbFlyAnimation(landing=false)
  $fly_landing = landing
  if !landing
    $game_player.turn_left
    pbSEPlay("flybird")
  end
  @initialy = DEFAULTSCREENHEIGHT/4
  @middley = DEFAULTSCREENHEIGHT/2+96

  @flybird = Sprite.new
  @flybird.bitmap = RPG::Cache.picture("flybird")

  flyAnimation=PictureEx.new(@flybird.z)
  flyAnimation.moveOrigin(1,PictureOrigin::Center)
  flyAnimation.moveXY(0,1,DEFAULTSCREENWIDTH+@flybird.bitmap.width,@initialy)
  flyAnimation.moveCurve(BIRD_ANIMATION_TIME,1,
    DEFAULTSCREENWIDTH+@flybird.bitmap.width, @initialy,
    DEFAULTSCREENWIDTH/2, @middley,
    -@flybird.bitmap.width-1, @initialy
  )
  @flybirdPlayer = Sprite.new
  if $Trainer.gender == 1
    if !landing
      @flybirdPlayer.bitmap = RPG::Cache.picture("flybird_GirlFront")
    else
      @flybirdPlayer.bitmap = RPG::Cache.picture("flybird_GirlBack")
    end
  else
    if !landing
      @flybirdPlayer.bitmap = RPG::Cache.picture("flybird_BoyFront")
    else
      @flybirdPlayer.bitmap = RPG::Cache.picture("flybird_BoyBack")
    end
  end

  flyAnimationPlayer=PictureEx.new(@flybirdPlayer.z)
  flyAnimationPlayer.moveOrigin(1,PictureOrigin::Center)
  flyAnimationPlayer.moveXY(0,1,DEFAULTSCREENWIDTH+@flybirdPlayer.bitmap.width,@initialy)
  flyAnimationPlayer.moveCurve(BIRD_ANIMATION_TIME,1,
    DEFAULTSCREENWIDTH+@flybirdPlayer.bitmap.width, @initialy,
    DEFAULTSCREENWIDTH/2, @middley,
    -@flybirdPlayer.bitmap.width-1, @initialy
  )
  halfway = false
  @tmp = 0
  @scale = 0
  @height = 0
  @width = 0

  loop do
    pbUpdateSceneMap
    flyAnimation.update
    flyAnimationPlayer.update
    setPictureSprite(@flybird,flyAnimation)
    setPictureSprite(@flybirdPlayer,flyAnimationPlayer)
    halfway = true if @flybird.x<=DEFAULTSCREENWIDTH/2

    if halfway && @tmp == 0
      @tmp = 1
    end

    #This doesn't work... I have no idea how to scale a bitmap properly.
    if !landing && halfway
      @scale = 100 if @scale == 0
      @scale = @scale+5
      @flybirdPlayer.bitmap.height*@scale
    elsif landing && !halfway
      @scale = 200 if @scale == 0
      @scale = @scale-5 if !halfway
      @flybirdPlayer.bitmap.height*@scale
    end
    @flybird.opacity = halfway ? 0 : 255 if !landing
    @flybird.opacity = halfway ? 255 : 0 if landing
    @flybirdPlayer.opacity = halfway ? 255 : 0 if !landing
    @flybirdPlayer.opacity = halfway ? 0 : 255 if landing
    $game_player.setOpacity(landing ? 255 : 0) if @flybird.x<=DEFAULTSCREENWIDTH/2
    Graphics.update
    break if @flybird.x<=-@flybird.bitmap.width
  end

  @flybird.dispose
  @flybird = nil
  @flybirdPlayer.dispose
  @flybirdPlayer = nil
end

Pastebin Mirror:
Credits
Ulithium_Dragon
KleinStudio
Author
Ulithium_Dragon
Downloads
777
Views
1,554
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Ulithium_Dragon

Back
Top