Advertisement
Guest User

Untitled

a guest
Jun 16th, 2018
935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. def pbBossFight(species1,level1,forma=0,variable=nil,canescape=true,canlose=false)
  2. if (Input.press?(Input::CTRL) && $DEBUG) || $Trainer.pokemonCount==0
  3. if $Trainer.pokemonCount>0
  4. Kernel.pbMessage(_INTL("SALTANDO BATALLA..."))
  5. end
  6. pbSet(variable,1)
  7. $PokemonGlobal.nextBattleBGM=nil
  8. $PokemonGlobal.nextBattleME=nil
  9. $PokemonGlobal.nextBattleBack=nil
  10. return true
  11. end
  12. if species1.is_a?(String) || species1.is_a?(Symbol)
  13. species1=getID(PBSpecies,species1)
  14. end
  15. currentlevels=[]
  16. for i in $Trainer.party
  17. currentlevels.push(i.level)
  18. end
  19. genwildpoke=pbGenerateWildPokemon(species1,level1)
  20. genwildpoke.form=forma
  21. Events.onStartBattle.trigger(nil,genwildpoke)
  22. scene=pbNewBattleScene
  23. if $PokemonGlobal.partner
  24. othertrainer=PokeBattle_Trainer.new(
  25. $PokemonGlobal.partner[1],$PokemonGlobal.partner[0])
  26. othertrainer.id=$PokemonGlobal.partner[2]
  27. othertrainer.party=$PokemonGlobal.partner[3]
  28. combinedParty=[]
  29. for i in 0...$Trainer.party.length
  30. combinedParty[i]=$Trainer.party[i]
  31. end
  32. for i in 0...othertrainer.party.length
  33. combinedParty[6+i]=othertrainer.party[i]
  34. end
  35. battle=PokeBattle_Battle.new(scene,combinedParty,[genwildpoke],
  36. [$Trainer,othertrainer],nil)
  37. battle.fullparty1=true
  38. else
  39. battle=PokeBattle_Battle.new(scene,$Trainer.party,[genwildpoke],
  40. $Trainer,nil)
  41. battle.fullparty1=false
  42. end
  43. battle.internalbattle=true
  44. battle.doublebattle=battle.pbDoubleBattleAllowed?()
  45. battle.doublebattle=true if $Trainer.party.length>1
  46. battle.cantescape=!canescape
  47. pbPrepareBattle(battle)
  48. decision=0
  49. pbBattleAnimation(pbGetWildBattleBGM(species1)) {
  50. pbSceneStandby {
  51. decision=battle.pbStartBattle(canlose)
  52. }
  53. for i in $Trainer.party
  54. if i.isMega?
  55. i.makeUnmega rescue nil
  56. end
  57. end
  58. if $PokemonGlobal.partner
  59. pbHealAll
  60. for i in $PokemonGlobal.partner[3]
  61. i.heal
  62. if i.isMega?
  63. i.makeUnmega rescue nil
  64. end
  65. end
  66. end
  67. if decision==2 || decision==5
  68. if canlose
  69. for i in $Trainer.party; i.heal; end
  70. for i in 0...10
  71. Graphics.update
  72. end
  73. # else
  74. # $game_system.bgm_unpause
  75. # $game_system.bgs_unpause
  76. # Kernel.pbStartOver
  77. end
  78. end
  79. Events.onEndBattle.trigger(nil,decision,canlose)
  80. }
  81. Input.update
  82. pbSet(variable,decision)
  83. return (decision !=2 && decision !=5)
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement