- 8
- Posts
- 10
- Years
- Seen Dec 19, 2014
I haven't tested it 100%, but I know it works in singles (haven't had the time to test it for double battles, but it should theoretically work, but you know how it is with code :) )
Anyway, here it is:
I know this should probably go to the Gen 6 project but I haven't had the time to check out the compiled scripts file, though I don't think there should be any conflicts, but I just wanted to post the script so people could test it.
Anyway, here it is:
Spoiler:
In PBEffects, before
add (change 91 to whatever the next effect number is avaliable)
In PokeBattle_Battler:
in def pbInitEffects(batonpass) after
add
replace
with
after
put
In PokeBattle_ActualScene
in class PokemonDataBox < SpriteWrapper in def refresh
after
add
in class PokeballSendOutAnimation in def initialize
replace
with
replace
with
replace
with
in def update
replace
with
in class PokeballPlayerSendOutAnimation in def initialize
replace
with
replace
with
in def update
replace
with
in def pbTrainerSendOut
replace
with
replace
with
in def pbSendOut
replace
with
replace
with
In PokeBattle_Battle
after
add
replace
with
replace
with
replace
with
after
#=======================================
# Initialize opponents in double battles
#=======================================
replace
with
replace
with
after
#======================================
# Initialize opponent in single battles
#======================================
replace
with
after
#=====================================
# Initialize players in double battles
#=====================================
replace
with
replace
with
after
#====================================
# Initialize player in single battles
#====================================
replace
with
In PokeBattle_MoveEffects
in class PokeBattle_Move_063 < PokeBattle_Move
after
put
in class PokeBattle_Move_064 < PokeBattle_Move
after
put
in class PokeBattle_Move_068 < PokeBattle_Move
after
put
Code:
# These effects apply to a side
Code:
Illusion = 91 #Illusion
in def pbInitEffects(batonpass) after
Code:
@effects[PBEffects::Yawn] = 0
Code:
if isConst?(self.ability,PBAbilities,:ILLUSION) #Illusion
[email protected](@index)
party=party.find_all {|item| item && !item.egg? && item.hp>0 }
if party[party.length-1] != @pokemon
@effects[PBEffects::Illusion] = party[party.length-1]
end
end #Illusion
Code:
def pbThis(lowercase=false)
if @battle.pbIsOpposing?(@index)
if @battle.opponent
return lowercase ? _INTL("the foe {1}",@name) : _INTL("The foe {1}",@name)
else
return lowercase ? _INTL("the wild {1}",@name) : _INTL("The wild {1}",@name)
end
elsif @battle.pbOwnedByPlayer?(@index)
return _INTL("{1}",self.name)
else
return lowercase ? _INTL("the ally {1}",@name) : _INTL("The ally {1}",@name)
end
end
Code:
def pbThis(lowercase=false)
if @battle.pbIsOpposing?(@index)
if @battle.opponent
return lowercase ? _INTL("the foe {1}",self.name) : _INTL("The foe {1}",self.name)
else
return lowercase ? _INTL("the wild {1}",self.name) : _INTL("The wild {1}",self.name)
end
elsif @battle.pbOwnedByPlayer?(@index)
return _INTL("{1}",self.name)
else
return lowercase ? _INTL("the ally {1}",self.name) : _INTL("The ally {1}",self.name)
end
end
def name #Illusion
return @effects[PBEffects::Illusion] != nil ? @effects[PBEffects::Illusion].name : @name
end #Illusion
Code:
# Illusion goes here
Code:
if isConst?(target.ability,PBAbilities,:ILLUSION) #ILLUSION
if target.effects[PBEffects::Illusion]!=nil
# Break the illusion
# Animation should go here
target.effects[PBEffects::Illusion]=nil
@battle.scene.pbChangePokemon(target,target.pokemon)
@battle.pbDisplay(_INTL("{1}'s {2} was broken!",target.pbThis,
PBAbilities.getName(target.ability)))
end
end #ILLUSION
in class PokemonDataBox < SpriteWrapper in def refresh
after
Code:
genderX+=@spritebaseX+14
Code:
[email protected] #ILLUSION
if @battler.effects[PBEffects::Illusion] != nil #ILLUSION
[email protected][PBEffects::Illusion].gender #ILLUSION
end #ILLUSION
replace
Code:
def initialize(sprite,spritehash,pkmn,doublebattle)
Code:
def initialize(sprite,spritehash,pkmn,doublebattle,illusionpoke)
Code:
@endspritey=adjustBattleSpriteY(sprite,pkmn.species,pkmn.index)
Code:
@illusionpoke = illusionpoke #ILLUSION
if illusionpoke != nil #ILLUSION
@endspritey=adjustBattleSpriteY(sprite,illusionpoke.species,pkmn.index)
else
@endspritey=adjustBattleSpriteY(sprite,pkmn.species,pkmn.index)
end #ILLUSION
Code:
@shadowVisible=showShadow?(pkmn.species)
Code:
if illusionpoke != nil #ILLUSION
@shadowVisible=showShadow?(illusionpoke.species)
else
@shadowVisible=showShadow?(pkmn.species)
end #ILLUSION
replace
Code:
pbPlayCry(@pkmn.pokemon ? @pkmn.pokemon : @pkmn.species)
Code:
if @illusionpoke != nil #ILLUSION
pbPlayCry(@illusionpoke)
else
pbPlayCry(@pkmn.pokemon ? @pkmn.pokemon : @pkmn.species)
end #ILLUSION
replace
Code:
def initialize(sprite,spritehash,pkmn,doublebattle)
Code:
def initialize(sprite,spritehash,pkmn,doublebattle,illusionpoke)
Code:
@endspritey=adjustBattleSpriteY(sprite,pkmn.species,pkmn.index)
Code:
@illusionpoke = illusionpoke #ILLUSION
if illusionpoke != nil #ILLUSION
@endspritey=adjustBattleSpriteY(sprite,illusionpoke.species,pkmn.index)
else
@endspritey=adjustBattleSpriteY(sprite,pkmn.species,pkmn.index)
end #ILLUSION
replace
Code:
pbPlayCry(@pkmn.pokemon ? @pkmn.pokemon : @pkmn.species)
Code:
if @illusionpoke != nil #ILLUSION
pbPlayCry(@illusionpoke)
else
pbPlayCry(@pkmn.pokemon ? @pkmn.pokemon : @pkmn.species)
end #ILLUSION
replace
Code:
sendout=PokeballSendOutAnimation.new(@sprites["pokemon#{battlerindex}"],
@sprites,@battle.battlers[battlerindex],@battle.doublebattle)
Code:
if @battle.battlers[battlerindex].effects[PBEffects::Illusion] != nil #Illusion
@sprites["pokemon#{battlerindex}"].setPokemonBitmap(
@battle.battlers[battlerindex].effects[PBEffects::Illusion],false)
end
sendout=PokeballSendOutAnimation.new(@sprites["pokemon#{battlerindex}"],
@sprites,@battle.battlers[battlerindex],@battle.doublebattle,
@battle.battlers[battlerindex].effects[PBEffects::Illusion]) #Illusion
Code:
if @battle.battlers[battlerindex].pokemon.isShiny? && @battle.battlescene
Code:
if @battle.battlers[battlerindex].pokemon.isShiny? && @battle.battlescene ||
(@battle.battlers[battlerindex].effects[PBEffects::Illusion] != nil &&
@battle.battlers[battlerindex].effects[PBEffects::Illusion].isShiny?) #ILLUSION
replace
Code:
sendout=PokeballPlayerSendOutAnimation.new(@sprites["pokemon#{battlerindex}"],
@sprites,@battle.battlers[battlerindex],@battle.doublebattle)
Code:
if @battle.battlers[battlerindex].effects[PBEffects::Illusion] != nil #Illusion
@sprites["pokemon#{battlerindex}"].setPokemonBitmap(
@battle.battlers[battlerindex].effects[PBEffects::Illusion],true)
end
sendout=PokeballPlayerSendOutAnimation.new(@sprites["pokemon#{battlerindex}"],
@sprites,@battle.battlers[battlerindex],@battle.doublebattle,
@battle.battlers[battlerindex].effects[PBEffects::Illusion]) #Illusion
Code:
if @battle.battlers[battlerindex].pokemon.isShiny? && @battle.battlescene
Code:
if @battle.battlers[battlerindex].pokemon.isShiny? && @battle.battlescene ||
(@battle.battlers[battlerindex].effects[PBEffects::Illusion] != nil &&
@battle.battlers[battlerindex].effects[PBEffects::Illusion].isShiny?) #ILLUSION
after
Code:
if !pbIsOpposing?(index) || (@opponent && pbIsOpposing?(index))
newenemy=pbSwitchInBetween(index,false,false)
Code:
if isConst?(@party2[newenemy].ability,PBAbilities,:ILLUSION) #ILLUSION
[email protected]_all {|item| item && !item.egg? && item.hp>0 }
if party3[@party2.length-1] != @party2[newenemy]
illusionpoke = party3[party3.length-1]
end
end #ILLUSION
newname = illusionpoke != nil ? illusionpoke.name : @party2[newenemy].name #ILLUSION
Code:
pbDisplayPaused(_INTL("{1} is about to send in {2}.",opponent.fullname,@party2[newenemy].name))
Code:
pbDisplayPaused(_INTL("{1} is about to send in {2}.",opponent.fullname,newname)) #ILLUSION
Code:
opposing=@battlers[index].pbOppositeOpposing
if opposing.isFainted? || opposing.hp==opposing.totalhp
pbDisplayBrief(_INTL("Go! {1}!",party[newpoke].name))
elsif opposing.hp>=(opposing.totalhp/2)
pbDisplayBrief(_INTL("Do it! {1}!",party[newpoke].name))
elsif opposing.hp>=(opposing.totalhp/4)
pbDisplayBrief(_INTL("Go for it, {1}!",party[newpoke].name))
else
pbDisplayBrief(_INTL("Your foe's weak!\nGet 'em, {1}!",party[newpoke].name))
end
Code:
if isConst?(party[newpoke].ability,PBAbilities,:ILLUSION) #ILLUSION
party2=party.find_all {|item| item && !item.egg? && item.hp>0 }
if party2[party.length-1] != party[newpoke]
illusionpoke = party[party.length-1]
end
end #ILLUSION
newname = illusionpoke != nil ? illusionpoke.name : party[newpoke].name
opposing=@battlers[index].pbOppositeOpposing
if opposing.hp<=0 || opposing.hp==opposing.totalhp
pbDisplayBrief(_INTL("Go! {1}!",newname))
elsif opposing.hp>=(opposing.totalhp/2)
pbDisplayBrief(_INTL("Do it! {1}!",newname))
elsif opposing.hp>=(opposing.totalhp/4)
pbDisplayBrief(_INTL("Go for it, {1}!",newname))
else
pbDisplayBrief(_INTL("Your foe's weak!\nGet 'em, {1}!",newname))
end
Code:
owner=pbGetOwner(index)
pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",owner.fullname,party[newpoke].name))
Code:
if isConst?(party[newpoke].ability,PBAbilities,:ILLUSION) #ILLUSION
party2=party.find_all {|item| item && !item.egg? && item.hp>0 }
if party2[party.length-1] != party[newpoke]
illusionpoke = party[party.length-1]
end
end #ILLUSION
newname = illusionpoke != nil ? illusionpoke.name : party[newpoke].name #ILLUSION
owner=pbGetOwner(index)
pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",owner.fullname,newname)) #ILLUSION
#=======================================
# Initialize opponents in double battles
#=======================================
replace
Code:
pbSendOut(1,@party2[sendout1])
pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",@opponent[1].fullname,@party2[sendout2].name))
Code:
@battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
@battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",@opponent[0].fullname,@battlers[1].name)) #ILLUSION
pbSendOut(1,@party2[sendout1])
pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",@opponent[1].fullname,@battlers[3].name)) #ILLUSION
Code:
pbDisplayBrief(_INTL("{1} sent\r\nout {2} and {3}!",
@opponent.fullname,@party2[sendout1].name,@party2[sendout2].name))
@battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
@battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
Code:
@battlers[1].pbInitialize(@party2[sendout1],sendout1,false) #ILLUSION
@battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
pbDisplayBrief(_INTL("{1} sent\r\nout {2} and {3}!",
@opponent.fullname,@battlers[1].name,@battlers[3].name)) #ILLUSION
#======================================
# Initialize opponent in single battles
#======================================
replace
Code:
pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",@opponent.fullname,trainerpoke.name))
@battlers[1].pbInitialize(trainerpoke,sendout,false)
Code:
@battlers[1].pbInitialize(trainerpoke,sendout,false) #ILLUSION
pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",@opponent.fullname,@battlers[1].name))
#=====================================
# Initialize players in double battles
#=====================================
replace
Code:
pbDisplayBrief(_INTL("{1} sent\r\nout {2}! Go! {3}!",
@player[1].fullname,@party1[sendout2].name,@party1[sendout1].name))
Code:
@battlers[0].pbInitialize(@party1[sendout1],sendout1,false) #ILLUSION
@battlers[2].pbInitialize(@party1[sendout2],sendout2,false)
pbDisplayBrief(_INTL("{1} sent\r\nout {2}! Go! {3}!",
@player[1].fullname,@battlers[2].name,@battlers[0].name))#ILLUSION
Code:
pbDisplayBrief(_INTL("Go! {1} and {2}!",@party1[sendout1].name,@party1[sendout2].name))
end
@battlers[0].pbInitialize(@party1[sendout1],sendout1,false)
@battlers[2].pbInitialize(@party1[sendout2],sendout2,false)
Code:
@battlers[0].pbInitialize(@party1[sendout1],sendout1,false) #ILLUSION
@battlers[2].pbInitialize(@party1[sendout2],sendout2,false)
pbDisplayBrief(_INTL("Go! {1} and {2}!",@battlers[0].name,@battlers[2].name)) #ILLUSION
end
#====================================
# Initialize player in single battles
#====================================
replace
Code:
pbDisplayBrief(_INTL("Go! {1}!",playerpoke.name))
@battlers[0].pbInitialize(playerpoke,sendout,false)
Code:
@battlers[0].pbInitialize(playerpoke,sendout,false) #Illusion
pbDisplayBrief(_INTL("Go! {1}!",@battlers[0].name))
in class PokeBattle_Move_063 < PokeBattle_Move
after
Code:
@battle.pbDisplay(_INTL("{1} acquired {2}!",opponent.pbThis,abilityname))
Code:
if opponent.effects[PBEffects::Illusion]!=nil #ILLUSION
# Animation should go here
# Break the illusion
opponent.effects[PBEffects::Illusion]=nil
@battle.scene.pbChangePokemon(opponent,opponent.pokemon)
@battle.pbDisplay(_INTL("{1}'s {2} was broken!",opponent.pbThis,
PBAbilities.getName(opponent.ability)))
end #ILLUSION
after
Code:
@battle.pbDisplay(_INTL("{1} acquired {2}!",opponent.pbThis,abilityname))
Code:
if opponent.effects[PBEffects::Illusion]!=nil #ILLUSION
# Animation should go here
# Break the illusion
opponent.effects[PBEffects::Illusion]=nil
@battle.scene.pbChangePokemon(opponent,opponent.pokemon)
@battle.pbDisplay(_INTL("{1}'s {2} was broken!",opponent.pbThis,
PBAbilities.getName(opponent.ability)))
end #ILLUSION
after
Code:
@battle.pbDisplay(_INTL("{1}'s ability was suppressed!",opponent.pbThis))
Code:
if opponent.effects[PBEffects::Illusion]!=nil #ILLUSION
# Animation should go here
# Break the illusion
opponent.effects[PBEffects::Illusion]=nil
@battle.scene.pbChangePokemon(opponent,opponent.pokemon)
@battle.pbDisplay(_INTL("{1}'s {2} was broken!",opponent.pbThis,
PBAbilities.getName(opponent.ability)))
end #ILLUSION
I know this should probably go to the Gen 6 project but I haven't had the time to check out the compiled scripts file, though I don't think there should be any conflicts, but I just wanted to post the script so people could test it.