Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PokemonGlobalMetadata
- attr_accessor :clone_backup
- def clone_backup ; @clone_backup=[] if !@clone_backup ; return @clone_backup ; end
- end
- ITEM_CLONE=true
- def pbClonePokemon(ableProc=nil,allowIneligible=nil)
- chosen=0
- pbFadeOutIn(99999){
- scene = PokemonParty_Scene.new
- screen = PokemonPartyScreen.new(scene,$Trainer.party)
- if ableProc
- chosen=screen.pbChooseAblePokemon(ableProc,allowIneligible)
- else
- screen.pbStartScene(_INTL("Choose a Pokémon."),false)
- chosen = screen.pbChoosePokemon
- screen.pbEndScene
- end
- }
- if chosen>=0
- $PokemonGlobal.clone_backup=[]
- $PokemonGlobal.clone_backup.push($Trainer.party[chosen])
- p $PokemonGlobal.clone_backup
- poke=PokeBattle_Pokemon.new($PokemonGlobal.clone_backup[0].species,$PokemonGlobal.clone_backup[0].level,$Trainer)
- poke.setAbility($PokemonGlobal.clone_backup[0].ability)
- poke.status=$PokemonGlobal.clone_backup[0].status
- poke.setGender($PokemonGlobal.clone_backup[0].otgender)
- for i in 0...6
- poke.iv[i]=$PokemonGlobal.clone_backup[0].iv[i]
- poke.ev[i]=$PokemonGlobal.clone_backup[0].ev[i]
- poke.ev[i]-=4 if poke.ev[i]>4
- end
- for moves in 0...4
- poke.moves[moves]=$PokemonGlobal.clone_backup[0].moves[moves]
- end
- poke.item=$PokemonGlobal.clone_backup[0].item if ITEM_CLONE
- poke.ballused=$PokemonGlobal.clone_backup[0].ballused
- poke.happiness=$PokemonGlobal.clone_backup[0].happiness
- poke.setNature($PokemonGlobal.clone_backup[0].nature)
- pbAddPokemon(poke)
- $PokemonGlobal.clone_backup.clear
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment