Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################################################
- # Copy-Cat mini-game by Vendily
- # A modification of the default Duel minigame
- # Based on the Duel minigame by Alael
- ################################################################################
- class PokemonCopyCat
- MOVEMENTS=[
- [PBMoveRoute::Jump,0,0,
- PBMoveRoute::Wait,2,
- PBMoveRoute::Jump,0,0],
- [PBMoveRoute::TurnRight90,PBMoveRoute::Wait,2,
- PBMoveRoute::TurnRight90,PBMoveRoute::Wait,2,
- PBMoveRoute::TurnRight90,PBMoveRoute::Wait,2,
- PBMoveRoute::TurnRight90,PBMoveRoute::Wait,2,
- PBMoveRoute::TurnRight90,PBMoveRoute::Wait,2,
- PBMoveRoute::TurnRight90,PBMoveRoute::Wait,2,
- PBMoveRoute::TurnRight90,PBMoveRoute::Wait,2,
- PBMoveRoute::TurnRight90,PBMoveRoute::Wait,2],
- [PBMoveRoute::DirectionFixOn,
- PBMoveRoute::ScriptAsync,"moveLeft90",
- PBMoveRoute::ScriptAsync,"moveRight90",
- PBMoveRoute::ScriptAsync,"moveRight90",
- PBMoveRoute::ScriptAsync,"moveLeft90",
- PBMoveRoute::DirectionFixOff]
- ]
- def pbStartCopyCat(pokemon,event)
- @event=event
- end
- def pbEndCopyCat(pokemon,rounds,correct)
- exp=rounds+correct
- growthrate=pokemon.growthrate
- newexp=PBExperience.pbAddExperience(pokemon.exp,exp,growthrate)
- exp=newexp-pokemon.exp
- pokemon.changeHappiness("groom")
- Kernel.pbMessage(_INTL("{1} gained {2} Exp. Points from playing!",pokemon.name,exp))
- oldlevel=pokemon.level
- pokemon.exp+=exp
- if pokemon.level!=oldlevel
- pokemon.changeHappiness("levelup")
- pokemon.calcStats
- movelist=pokemon.getMoveList
- for i in movelist
- pbLearnMove(pokemon,i[1],true) if i[0]==pokemon.level # Try to learn a move
- end
- newspecies = Kernel.pbCheckEvolution(pokemon)
- if newspecies>0
- pbFadeOutInWithMusic(99999){
- evo=PokemonEvolutionScene.new
- evo.pbStartScreen(pokemon,newspecies)
- evo.pbEvolution
- evo.pbEndScreen
- }
- end
- end
- end
- def pbCopyCat(pokemon,event)
- pbStartCopyCat(pokemon,event)
- Kernel.pbMessage(_INTL("{1} wants to play Copy-Cat!\\.\\nCopy what {1} does!",pokemon.name))
- rounds=0
- correct=0
- loop do
- rounds+=1
- action=rand(3)
- pbMoveRoute(event,MOVEMENTS[action],true)
- pbWait(60)
- list=[
- _INTL("Jump"),
- _INTL("Spin"),
- _INTL("Wiggle"),
- _INTL("Quit")
- ]
- command=Kernel.pbMessage(_INTL("What did {1} do?",pokemon.name),list,0)
- if command==3
- Kernel.pbMessage(_INTL("You stop playing Copy-Cat with {1}.",pokemon.name))
- break
- end
- pbMoveRoute($game_player,MOVEMENTS[command],true)
- if command==action
- correct+=1
- pbPlayCry(pokemon,90,150)
- else
- pbPlayCry(pokemon,90,50)
- end
- pbWait(60)
- end
- pbEndCopyCat(pokemon,rounds,correct)
- end
- end
- def pbCopyCat(pokemon,event)
- return if !pokemon
- copycat=PokemonCopyCat.new
- copycat.pbCopyCat(pokemon,event)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement