View Single Post
  #32    
Old May 18th, 2012 (10:10 AM).
TACHAN TACHAN is offline
 
Join Date: Jan 2010
Gender: Female
Posts: 170
I bring a contribution for Pokebattle_MoveEffect.
They all work well, except the last one.

Quote:
################################################################################
# After inflicting damage, user switches out. Ignores trapping moves.#U-turn, Volt Change
################################################################################
class PokeBattle_Move_0EE < PokeBattle_Move_000
def pbEffect(attacker,opponent)
ret=super(attacker,opponent)
if @battle.pbCanChooseNonActive?(attacker.index)
newpoke=0
@battle.pbAnimation(@id,attacker,nil)
newpoke=@battle.pbSwitchInBetween(attacker.index,true,false)
@battle.pbReplace(attacker.index,newpoke)
end
return ret
end
end
Quote:
################################################################################
# Target flees from battle. In trainer battles, target switches out instead.
# Fails if target is a higher level than the user. For damaging moves.
#Circle Throw, Dragon Tail
################################################################################
class PokeBattle_Move_0EC < PokeBattle_Move_000
def pbEffect(attacker,opponent)
ret=super(attacker,opponent)
if opponent.ability==PBAbilities:UCTIONCUPS
@battle.pbDisplay(_INTL("{1} anchors itself with Suction Cups!",opponent.pbThis))
return -1
end
if opponent.effects[PBEffects::Ingrain]
@battle.pbDisplay(_INTL("{1} anchored itself with its roots!",opponent.pbThis))
return -1
end
if !@battle.opponent
x=@battle.pbRandom(256)
varA=((x*(attacker.level+opponent.level)/256).floor+1)
varB=(opponent.level/4).floor
if varA<=varB
@battle.pbDisplay(_INTL("But i failed!"))
return -1
end
@battle.decision=3 # Set decision to escaped
return 0
else
choices=[]
party=@battle.pbParty(opponent.index)
for i in 0..party.length-1
choices[choices.length]=i if @battle.pbCanSwitchLax?(opponent.index,i,false)
end
if choices.length==0
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
newpoke=choices[@battle.pbRandom(choices.length)]
@battle.pbAnimation(@id,attacker,opponent)
opponent.pbInitialize(party[newpoke],newpoke,false)
if !@battle.pbOwnedByPlayer?(opponent.index)
@battle.pbPlayer.seen[party[newpoke].species]=true
@battle.scene.pbTrainerSendOut(opponent.index,party[newpoke])
else
@battle.scene.pbSendOut(opponent.index,party[newpoke])
end
@battle.pbDisplay(_INTL("{1} was dragged out!",opponent.pbThis))
@battle.pbOnActiveOne(opponent)
return 0
end
end
end
Quote:
################################################################################
# Target's ability becomes Simple.
#SIMPLE
################################################################################
class PokeBattle_Move_063 < PokeBattle_Move_000
def pbEffect(attacker,opponent)
if opponent.ability==PBAbilities:IMPLE
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
opponent.ability=PBAbilities:IMPLE
@battle.pbDisplay(_INTL("{1} changed {2}'s ability to Simple!",attacker.pbThis,opponent.pbThis))
return 0
end
end
Quote:
################################################################################
# Target's ability becomes Insomnia.
#WORRY SEED
################################################################################
class PokeBattle_Move_064 < PokeBattle_Move_000
def pbEffect(attacker,opponent)
if opponent.ability==PBAbilities::INSOMNIA
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
opponent.ability=PBAbilities::INSOMNIA
@battle.pbDisplay(_INTL("{1} changed {2}'s ability to Insomnia!",attacker.pbThis,opponent.pbThis))
return 0
end
end
Quote:
################################################################################
# User copes target's types.
#REFLECT TYPE
################################################################################
class PokeBattle_Move_062 < PokeBattle_Move_000
def pbEffect(attacker,opponent)
@battle.pbAnimation(@id,attacker,opponent)
attacker.type1=opponent.type1
attacker.type2=opponent.type2
@battle.pbDisplay(_INTL("{1} copied the {2}'s {3}!",attacker.pbThis,typename))
return 0
end
end
This effect(Reflect Type) is not completely nice, I do not know in that circumstances it has to fail.

Quote:
"@battle.pbDisplay(_INTL("{1} copied the {2}'s {3}!",attacker.pbThis,typename))"
It me does not work, I do not know because.

What is clear is that it works copying the types of the rival. Shiftry copied the types Dark/Flying, and Wing Attack damaged to him neutral.
Reply With Quote