rigbycwts
Hmm, hmm.
- 94
- Posts
- 12
- Years
- Seen Feb 22, 2019
Out of boredom, I tried to add Triple Battles to Luka's Elite Battle by reading parts of PokeBattle_Battle and PokeBattle_DynamicBattle, and doing the following:
In PokeBattle_Battle:
First, in line 235, I added this:
Next, in line 312, which is inside initialize, I added this:
Then, at line 454, just above def pbWeather, I added this function:
In PokeBattle_DynamicBattle:
I add this at line 107:
And in line 184:
Currently, I'm stuck on where to modify next, but I was thinking on making Triple Battles exclusive to the new battle system only. At first, I have thought of the graphics, but I got nervous on which section to modify next: either PokeBattle_DynamicScene, PokeBattle_UI, or PokeBattle_Sprites. Any help would be appreciated.
EDIT: Link to Scripts.rxdata in case needed: https://www.dropbox.com/s/edgya8v7cir6ui2/scripts.zip?dl=0
In PokeBattle_Battle:
First, in line 235, I added this:
Code:
attr_accessor(:triplebattle) #Triple Battle Flag
Code:
@triplebattle = false
Code:
def pbTripleBattleAllowed?
if !@fullparty && @party.length>MAXPARTYSIZE
return false
end
_opponent=@opponent
_player=@player
# Wild battle
if !_opponent
return false # No wild triple battles happen in the official games
#end
# Trainer battle
else
if _opponent.is_a?(Array)
if _opponent.length==1
_opponent=_opponent[0]
elsif _opponent.length>=2 # Triple battles do not come in tags.
return false
end
end
_player=_player
if _player.is_a?(Array)
if _player.length==1
_player=_player[0]
elsif _player.length>=2 # Triple battles do not come in tags.
return false
end
end
sendout1=pbFindNextUnfainted(@party2,0)
sendout2=pbFindNextUnfainted(@party2,sendout1+1)
sendout3=pbFindNextUnfainted(@party2,sendout1+2)
return false if sendout1<0 || sendout2<0 || sendout3<0
end
sendout1=pbFindNextUnfainted(@party1,0)
sendout2=pbFindNextUnfainted(@party1,sendout1+1)
sendout3=pbFindNextUnfainted(@party1,sendout1+2)
if sendout1<0 || sendout2<0 || sendout3<0
return false
else
return true
end
end
I add this at line 107:
Code:
elsif @triplebattle
#=======================================
# Initialize opponents in triple battles
#=======================================
if @opponent.is_a?(Array)
if @opponent.length==1
@opponent=@opponent[0]
elsif @opponent.length>=2
raise _INTL("Opponents with zero or more than one person are not allowed")
end
end
if @player.is_a?(Array)
if @player.length==1
@player=@player[0]
elsif @player.length>=2
raise _INTL("Player trainers with zero or more than one person are not allowed")
end
end
@scene.pbStartBattle(self)
pbDisplayPaused(_INTL("{1}\r\nwould like to battle!",@opponent.fullname))
sendout1=pbFindNextUnfainted(@party2,0)
sendout2=pbFindNextUnfainted(@party2,sendout1+1)
sendout3=pbFindNextUnfainted(@party2,sendout1+2)
if sendout1 < 0 || sendout2 < 0 || sendout3 < 0
raise _INTL("Opponent doesn't have three unfainted Pokémon")
end
pbDisplayBrief(_INTL("{1} sent\r\nout {2}, {3},\r\nand {4}!",
@opponent.fullname,@party2[sendout1].name,@party2[sendout2].name,@party2[sendout3].name))
@battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
@battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
@battlers[5].pbInitialize(@party2[sendout3],sendout3,false)
pbSendOut(1,@party2[sendout1])
Code:
elsif @triplebattle
#=====================================
# Initialize players in triple battles
#=====================================
sendout1=pbFindNextUnfainted(@party1,0)
sendout2=pbFindNextUnfainted(@party1,sendout1+1)
sendout3=pbFindNextUnfainted(@party1,sendout1+2)
if sendout1 < 0 || sendout2 < 0 || sendout3 < 0
raise _INTL("Player doesn't have three unfainted Pokémon")
end
pbDisplayBrief(_INTL("Go, {1}, {2} and {3}!",@party1[sendout1].name,@party1[sendout2].name,@party1[sendout3].name))
@battlers[0].pbInitialize(@party1[sendout1],sendout1,false)
@battlers[2].pbInitialize(@party1[sendout2],sendout2,false)
@battlers[4].pbInitialize(@party1[sendout3],sendout3,false)
pbSendOut(0,@party1[sendout1])
EDIT: Link to Scripts.rxdata in case needed: https://www.dropbox.com/s/edgya8v7cir6ui2/scripts.zip?dl=0
Last edited: