Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DreamState
- attr_accessor :ballcount
- attr_accessor :pokemon
- attr_accessor :start
- def initialize
- @start=nil
- @pokemon=nil
- @ballcount=0
- end
- def pbGoToStart
- if $scene.is_a?(Scene_Map)
- pbFadeOutIn(99999){
- $game_temp.player_transferring = true
- $game_temp.transition_processing = true
- $game_temp.player_new_map_id = @start[0]
- $game_temp.player_new_x = @start[1]
- $game_temp.player_new_y = @start[2]
- $game_temp.player_new_direction = 2
- $scene.transfer_player
- }
- end
- end
- def pbStart(pokemon,balls)
- @start=[$game_map.map_id,$game_player.x,$game_player.y,$game_player.direction]
- @pokemon=pokemon
- @ballcount=balls
- end
- def inProgress?
- return !@pokemon.nil?
- end
- def pbEnd
- @start=nil
- @pokemon=nil
- @ballcount=0
- end
- end
- def pbInDream?
- return pbDreamState.inProgress?
- end
- def pbDreamState
- if !$PokemonGlobal.dreamState
- $PokemonGlobal.dreamState=DreamState.new
- end
- return $PokemonGlobal.dreamState
- end
- Events.onWildBattleOverride+= proc { |sender,e|
- species=e[0]
- level=e[1]
- handled=e[2]
- next if handled[0]!=nil
- next if !pbInDream?
- handled[0]=pbDreamBattle(species,level)
- }
- def pbDreamBattle(species,level)
- genwildpoke=pbGenerateWildPokemon(species,level)
- scene=pbNewBattleScene
- battle=PokeBattle_DreamWorld.new(scene,[pbDreamState.pokemon],[genwildpoke],$Trainer,nil)
- battle.ballcount=pbDreamState.ballcount
- battle.environment=pbGetEnvironment
- decision=0
- pbBattleAnimation(pbGetWildBattleBGM(species)) {
- pbSceneStandby {
- decision=battle.pbStartBattle
- }
- }
- pbDreamState.ballcount=battle.ballcount
- Input.update
- Events.onWildBattleEnd.trigger(nil,species,level,decision)
- return decision
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement