- 1,758
- Posts
- 9
- Years
- Seen today
Does anyone know how to modify the pickup list to suit gen 8?
def Kernel.pbPickup(pokemon)
is the overworld table, split into normal and rare items.Does anyone know how to modify the pickup list to suit gen 8?
def Kernel.pbPickup(pokemon)
is the overworld table, split into normal and rare items.MultipleForms.register(:SLOWBRO,{
"getMegaForm"=>proc{|pokemon|
next 2 if isConst?(pokemon.item,PBItems,:SLOWBRONITE) && pokemon.form!=1
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0
},
MultipleForms.register(:SLOWBRO,{
"getMegaForm"=>proc{|pokemon|
next 2 if isConst?(pokemon.item,PBItems,:SLOWBRONITE) && pokemon.form==0
next
},
"getUnmegaForm"=>proc{|pokemon|
if pokemon.form == 2
next 0
else
next nil
end
},
XXX,LASHOUT,Lash Out,XXX,1,DARK,Physical,100,5,0,00,0,abef,"This attack's power increases the more the user has powered down with stat changes. The user lashes its frustration over this."
################################################################################
# Power increases with the user's negative stat changes (ignores positive ones).
# (Lash Out)
################################################################################
class PokeBattle_Move_XXX < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
mult=3
for i in [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED,
PBStats::SPATK,PBStats::SPDEF,PBStats::ACCURACY,PBStats::EVASION]
mult+=attacker.stages[i] if attacker.stages[i]<0
end
return [20*mult,200].min
end
end
XXX,STEELROLLER,Steel Roller,242,130,STEEL,Physical,100,5,0,00,0,abef,"The user attacks while destroying the terrain. Fails if no terrain in effect."
################################################################################
# Destroys terrains.
# Move fails if no terrains are in effect.
# (Steel Roller)
################################################################################
class PokeBattle_Move_XXX < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if @battle.field.effects[PBEffects::GrassyTerrain]<1 && @battle.field.effects[PBEffects::ElectricTerrain]<1 &&
@battle.field.effects[PBEffects::MistyTerrain]<1 && @battle.field.effects[PBEffects::PsychicTerrain]<1
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
ret=super(attacker,opponent,hitnum,alltargets,showanimation)
if opponent.damagestate.calcdamage>0 && !opponent.damagestate.substitute
@battle.field.effects[PBEffects::GrassyTerrain]=0
@battle.field.effects[PBEffects::ElectricTerrain]=0
@battle.field.effects[PBEffects::MistyTerrain]=0
@battle.field.effects[PBEffects::PsychicTerrain]=0
@battle.pbDisplay(_INTL("Terrain was destroyed!"))
end
return ret
end
end
XXX,BURNINGJEALOUSY,Burning Jealousy,243,70,FIRE,Special,100,5,255,00,0,bcek,"The user attacks with energy from jealousy. Burn is guaranteed if the target raised it's stats."
################################################################################
# Severely burns the target if stats are boosted. (Burning Jealousy)
# (Handled in Battler's pbSuccessCheck): Hits semi-invulnerable targets if user
# is Fire-type and move is status move.
################################################################################
class PokeBattle_Move_XXX < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
return -1 if !opponent.pbCanBurn?(attacker,true,self)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.pbBurn(attacker,nil,true)
return 0
end
def pbAdditionalEffect(attacker,opponent)
return if opponent.damagestate.substitute
if opponent.stages[PBStats::ATTACK]>0
if opponent.pbCanBurn?(attacker,false,self)
opponent.pbBurn(attacker,nil,true)
end
end
if opponent.stages[PBStats::DEFENSE]>0
if opponent.pbCanBurn?(attacker,false,self)
opponent.pbBurn(attacker,nil,true)
end
end
if opponent.stages[PBStats::SPATK]>0
if opponent.pbCanBurn?(attacker,false,self)
opponent.pbBurn(attacker,nil,true)
end
end
if opponent.stages[PBStats::SPDEF]>0
if opponent.pbCanBurn?(attacker,false,self)
opponent.pbBurn(attacker,nil,true)
end
end
if opponent.stages[PBStats::SPEED]>0
if opponent.pbCanBurn?(attacker,false,self)
opponent.pbBurn(attacker,nil,true)
end
end
if opponent.stages[PBStats::ACCURACY]>0
if opponent.pbCanBurn?(attacker,false,self)
opponent.pbBurn(attacker,nil,true)
end
end
if opponent.stages[PBStats::EVASION]>0
if opponent.pbCanBurn?(attacker,false,self)
opponent.pbBurn(attacker,nil,true)
end
end
end
end
XXX,METEORBEAM,Meteor Beam,239,120,UNIVERSAL,Special,90,10,0,00,0,bef,"In this two-turn attack, the user gathers space power to raise it Sp. Atk on the first turn then attacks the next turn."
################################################################################
# User shrouds itself in space power. (Meteor Beam)
# (Handled in Battler's pbSuccessCheck): Hits some semi-invulnerable targets.
# Increases Sp. Atk on charging turn.
################################################################################
class PokeBattle_Move_XXX < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
if PBMoveData.new(opponent.effects[PBEffects::TwoTurnAttack]).function==0xC9 || # Fly
PBMoveData.new(opponent.effects[PBEffects::TwoTurnAttack]).function==0xCC || # Bounce
PBMoveData.new(opponent.effects[PBEffects::TwoTurnAttack]).function==0xCE || # Sky Drop
opponent.effects[PBEffects::SkyDrop]
return basedmg*2
end
return basedmg
end
def pbTwoTurnAttack(attacker)
@immediate=false
if !@immediate && attacker.hasWorkingItem(:POWERHERB)
@immediate=true
end
return false if @immediate
return attacker.effects[PBEffects::TwoTurnAttack]==0
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0
pbShowAnimation(@id,attacker,opponent,1,alltargets,showanimation) # Charging anim
@battle.pbDisplay(_INTL("{1} surrounded itself with space power!",attacker.pbThis))
end
if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0
attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
attacker.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self)
end
if @immediate
@battle.pbDisplay(_INTL("{1} became fully charged due to its Power Herb!",attacker.pbThis))
attacker.pbItem
end
return 0 if attacker.effects[PBEffects::TwoTurnAttack]>0
return super(attacker,opponent,hitnum,alltargets,showanimation)
end
def pbAdditionalEffect(attacker,opponent)
return if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0
if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
attacker.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self)
end
end
end
XXX,TERRAINPULSE,Terrain Pulse,000,50,NORMAL,Special,100,10,0,00,0,bcek,"The user utilizes the power the terrain; Type and power changes depending on terrain and environment in use."
################################################################################
# Power changes depending on terrain. Type changes depending on terrain. (Terrain Pulse)
################################################################################
class PokeBattle_Move_XXX < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
if @battle.field.effects[PBEffects::GrassyTerrain]
return 75
end
if @battle.field.effects[PBEffects::ElectricTerrain]
return 85
end
if @battle.field.effects[PBEffects::MistyTerrain]
return 95
end
if @battle.field.effects[PBEffects::PsychicTerrain]
return 105
end
return basedmg
end
def pbModifyType(type,attacker,opponent)
type=getConst(PBTypes,:NORMAL) || 0
if @battle.field.effects[PBEffects::GrassyTerrain]
type=(getConst(PBTypes,:GRASS) || type)
end
if @battle.field.effects[PBEffects::ElectricTerrain]
type=(getConst(PBTypes,:ELECTRIC) || type)
end
if @battle.field.effects[PBEffects::MistyTerrain]
type=(getConst(PBTypes,:FAIRY) || type)
end
if @battle.field.effects[PBEffects::PsychicTerrain]
type=(getConst(PBTypes,:PSYCHIC) || type)
end
return type
end
end
Maybe it's simple, but I was trying a lot without success (and I'm not an expert with coding). I don't want that Galarian Slowbro can Mega Evolve, so I wrote this:
But seems it's not enough, so I'd like having some help with this. Maybe some is missing in "getUnmegaForm"... I can't figure it out. What should I do to don't allowing Galarian Slowbro (form 1 in the code) to Mega Evolve (form 2 in the code)?Code:MultipleForms.register(:SLOWBRO,{ "getMegaForm"=>proc{|pokemon| next 2 if isConst?(pokemon.item,PBItems,:SLOWBRONITE) && pokemon.form!=1 next }, "getUnmegaForm"=>proc{|pokemon| next 0 },
MultipleForms.register(:GARCHOMP,{
"getMegaForm"=>proc{|pokemon|
next 1 if isConst?(pokemon.item,PBItems,:GARCHOMPITE) && pokemon.form==0
next
},
"getUnmegaForm"=>proc{|pokemon|
next 0 if pokemon.form==1
next
},
"getFormOnCreation"=>proc{|pokemon|
if $game_map && EQUESTRIA_MAPS.include?($game_map.map_id)
next 2 # Equestrian Garchomp
else
next 0
end
},
"type1"=>proc{|pokemon|
next getID(PBTypes,:DRAGON) if pokemon.form==2
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:EVIL) if pokemon.form==2
next
},
"getBaseStats"=>proc{|pokemon|
next [108,170,115,92,120,95] if pokemon.form==1
next [126,170,135,132,100,105] if pokemon.form==2
next
},
"getAbilityList"=>proc{|pokemon|
next [[getID(PBAbilities,:SANDFORCE),0]] if pokemon.form==1
next [[getID(PBAbilities,:STRONGJAW),0],
[getID(PBAbilities,:TOUGHCLAWS),1],
[getID(PBAbilities,:ROUGHSKIN),2]] if pokemon.form==2
next
},
"evYield"=>proc{|pokemon|
case pokemon.form
when 2; next [2,3,2,2,1,1] # Equestrian Garchomp
else; next # Garchomp
end
},
"getMoveList"=>proc{|pokemon|
next if pokemon.form==0
movelist=[]
case pokemon.form
when 2; movelist=[[1,:TACKLE],[1,:SCRATCH],[1,:LEER],[1,:GROWL],
[1,:BITE],[1,:DRAGONRAGE],[1,:DIG],[1,:AQUARING],
[1,:SANDTOMB],[1,:SANDSTORM],[1,:EMBER],[1,:FLAMEWHEEL],
[1,:SUPERFANG],[1,:FIREFANG],[1,:THUNDERFANG],[1,:ICEFANG],
[1,:FLAMETHROWER],[1,:SLASH],[1,:DRAGONCLAW],[1,:SHADOWCLAW],
[1,:DIVE],[3,:AQUATAIL],[5,:MAGNITUDE],[8,:EARTHQUAKE],
[11,:UPROAR],[14,:ROAR],[17,:ICYWIND],[20,:BUBBLE],
[24,:HYPERBEAM],[28,:QUICKATTACK],[33,:RAPIDSPIN],[37,:DEFOG],
[42,:SWIFT],[46,:COUNTER],[56,:AERIALACE],[59,:FLY],
[63,:AEROBLAST],[66,:BOOMBURST],[70,:HYPERBEAM],[71,:REFRESH],
[74,:FIREBLAST],[77,:DEMONCLAW],[80,:DRAGONCLAW],[83,:DEMONFANG],
[87,:DRAGONFANG],[91,:ICEPOUNCE],[91,:THUNDERPOUNCE],[91,:FLAREPOUNCE],
[95,:INFERNO],[97,:SHEERCOLD],[100,:IMPULSEBEAM]] # Equestrian Garchomp
end
for i in movelist
i[1]=getConst(PBMoves,i[1])
end
next movelist
}
})
HungerSwitch = XXX
@effects[PBEffects::Truant] = false
@effects[PBEffects::HungerSwitch] = false
# Hunger Switch
if isConst?(self.species,PBSpecies,:MORPEKO)
if self.hasWorkingAbility(:HUNGERSWITCH) && @effects[PBEffects::HungerSwitch]
if self.form!=1
self.form=1; transformed=true
end
else
if self.form!=0
self.form=0; transformed=true
end
end
end
if @battlers[i].turncount>0 && @battlers[i].hasWorkingAbility(:TRUANT)
@battlers[i].effects[PBEffects::Truant]=!@battlers[i].effects[PBEffects::Truant]
end
if @battlers[i].turncount>0 && @battlers[i].hasWorkingAbility(:HUNGERSWITCH)
@battlers[i].effects[PBEffects::HungerSwitch]=!@battlers[i].effects[PBEffects::HungerSwitch]
end
# Gulp Missile (Surf)
if hasWorkingAbility(:GULPMISSILE) && isConst?(species,PBSpecies,:CRAMORANT) &&
!@effects[PBEffects::Transform]
if isConst?(thismove.id,PBMoves,:SURF) && @hp<=((@totalhp/2).floor)
self.form=2
pbUpdate(true)
@battle.scene.pbChangePokemon(self,@pokemon)
PBDebug.log("[Form changed] #{pbThis} changed to Gorging Form")
elsif isConst?(thismove.id,PBMoves,:SURF) && @hp>((@totalhp/2).floor)
self.form=1
pbUpdate(true)
@battle.scene.pbChangePokemon(self,@pokemon)
PBDebug.log("[Form changed] #{pbThis} changed to Gulping Form")
end
end
Hopefully these will be useful:
Lash Out (How I think it should work if the user is frustrated at its stats dropping)
Spoiler:Code:XXX,LASHOUT,Lash Out,XXX,1,DARK,Physical,100,5,0,00,0,abef,"This attack's power increases the more the user has powered down with stat changes. The user lashes its frustration over this."
Spoiler:Code:################################################################################ # Power increases with the user's negative stat changes (ignores positive ones). # (Lash Out) ################################################################################ class PokeBattle_Move_XXX < PokeBattle_Move def pbBaseDamage(basedmg,attacker,opponent) mult=3 for i in [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED, PBStats::SPATK,PBStats::SPDEF,PBStats::ACCURACY,PBStats::EVASION] mult+=attacker.stages[i] if attacker.stages[i]<0 end return [20*mult,200].min end end
Steel Roller (One of the most difficult for me to figure out >~<)
Spoiler:Code:XXX,STEELROLLER,Steel Roller,242,130,STEEL,Physical,100,5,0,00,0,abef,"The user attacks while destroying the terrain. Fails if no terrain in effect."
Spoiler:Code:################################################################################ # Destroys terrains. # Move fails if no terrains are in effect. # (Steel Roller) ################################################################################ class PokeBattle_Move_XXX < PokeBattle_Move def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true) if @battle.field.effects[PBEffects::GrassyTerrain]<1 && @battle.field.effects[PBEffects::ElectricTerrain]<1 && @battle.field.effects[PBEffects::MistyTerrain]<1 && @battle.field.effects[PBEffects::PsychicTerrain]<1 @battle.pbDisplay(_INTL("But it failed!")) return -1 end ret=super(attacker,opponent,hitnum,alltargets,showanimation) if opponent.damagestate.calcdamage>0 && !opponent.damagestate.substitute @battle.field.effects[PBEffects::GrassyTerrain]=0 @battle.field.effects[PBEffects::ElectricTerrain]=0 @battle.field.effects[PBEffects::MistyTerrain]=0 @battle.field.effects[PBEffects::PsychicTerrain]=0 @battle.pbDisplay(_INTL("Terrain was destroyed!")) end return ret end end
Burning Jealousy (abit tricky)
(I know Harsh Burn isn't official but there does need to be a burn that worsens each turn; https://www.pokecommunity.com/posts/10216370) (If you want the official method, change all burns to default)
Spoiler:Code:XXX,BURNINGJEALOUSY,Burning Jealousy,243,70,FIRE,Special,100,5,255,00,0,bcek,"The user attacks with energy from jealousy. Burn is guaranteed if the target raised it's stats."
Spoiler:Code:################################################################################ # Severely burns the target if stats are boosted. (Burning Jealousy) # (Handled in Battler's pbSuccessCheck): Hits semi-invulnerable targets if user # is Fire-type and move is status move. ################################################################################ class PokeBattle_Move_XXX < PokeBattle_Move def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true) return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging? return -1 if !opponent.pbCanBurn?(attacker,true,self) pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation) opponent.pbBurn(attacker,nil,true) return 0 end def pbAdditionalEffect(attacker,opponent) return if opponent.damagestate.substitute if opponent.stages[PBStats::ATTACK]>0 if opponent.pbCanBurn?(attacker,false,self) opponent.pbBurn(attacker,nil,true) end end if opponent.stages[PBStats::DEFENSE]>0 if opponent.pbCanBurn?(attacker,false,self) opponent.pbBurn(attacker,nil,true) end end if opponent.stages[PBStats::SPATK]>0 if opponent.pbCanBurn?(attacker,false,self) opponent.pbBurn(attacker,nil,true) end end if opponent.stages[PBStats::SPDEF]>0 if opponent.pbCanBurn?(attacker,false,self) opponent.pbBurn(attacker,nil,true) end end if opponent.stages[PBStats::SPEED]>0 if opponent.pbCanBurn?(attacker,false,self) opponent.pbBurn(attacker,nil,true) end end if opponent.stages[PBStats::ACCURACY]>0 if opponent.pbCanBurn?(attacker,false,self) opponent.pbBurn(attacker,nil,true) end end if opponent.stages[PBStats::EVASION]>0 if opponent.pbCanBurn?(attacker,false,self) opponent.pbBurn(attacker,nil,true) end end end end
Meteor Beam (The reason for move.txt's secondary effect needing to be zero is because the stat boost is suppose to happen on the charging turn but needs to described as both a main and secondary effect in Move_Effects)
Spoiler:Code:XXX,METEORBEAM,Meteor Beam,239,120,UNIVERSAL,Special,90,10,0,00,0,bef,"In this two-turn attack, the user gathers space power to raise it Sp. Atk on the first turn then attacks the next turn."
Spoiler:Code:################################################################################ # User shrouds itself in space power. (Meteor Beam) # (Handled in Battler's pbSuccessCheck): Hits some semi-invulnerable targets. # Increases Sp. Atk on charging turn. ################################################################################ class PokeBattle_Move_XXX < PokeBattle_Move def pbBaseDamage(basedmg,attacker,opponent) if PBMoveData.new(opponent.effects[PBEffects::TwoTurnAttack]).function==0xC9 || # Fly PBMoveData.new(opponent.effects[PBEffects::TwoTurnAttack]).function==0xCC || # Bounce PBMoveData.new(opponent.effects[PBEffects::TwoTurnAttack]).function==0xCE || # Sky Drop opponent.effects[PBEffects::SkyDrop] return basedmg*2 end return basedmg end def pbTwoTurnAttack(attacker) @immediate=false if !@immediate && attacker.hasWorkingItem(:POWERHERB) @immediate=true end return false if @immediate return attacker.effects[PBEffects::TwoTurnAttack]==0 end def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true) if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0 pbShowAnimation(@id,attacker,opponent,1,alltargets,showanimation) # Charging anim @battle.pbDisplay(_INTL("{1} surrounded itself with space power!",attacker.pbThis)) end if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0 attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self) attacker.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self) end if @immediate @battle.pbDisplay(_INTL("{1} became fully charged due to its Power Herb!",attacker.pbThis)) attacker.pbItem end return 0 if attacker.effects[PBEffects::TwoTurnAttack]>0 return super(attacker,opponent,hitnum,alltargets,showanimation) end def pbAdditionalEffect(attacker,opponent) return if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0 if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self) attacker.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self) end end end
Terriain Pulse
Spoiler:Code:XXX,TERRAINPULSE,Terrain Pulse,000,50,NORMAL,Special,100,10,0,00,0,bcek,"The user utilizes the power the terrain; Type and power changes depending on terrain and environment in use."
Spoiler:Code:################################################################################ # Power changes depending on terrain. Type changes depending on terrain. (Terrain Pulse) ################################################################################ class PokeBattle_Move_XXX < PokeBattle_Move def pbBaseDamage(basedmg,attacker,opponent) if @battle.field.effects[PBEffects::GrassyTerrain] return 75 end if @battle.field.effects[PBEffects::ElectricTerrain] return 85 end if @battle.field.effects[PBEffects::MistyTerrain] return 95 end if @battle.field.effects[PBEffects::PsychicTerrain] return 105 end return basedmg end def pbModifyType(type,attacker,opponent) type=getConst(PBTypes,:NORMAL) || 0 if @battle.field.effects[PBEffects::GrassyTerrain] type=(getConst(PBTypes,:GRASS) || type) end if @battle.field.effects[PBEffects::ElectricTerrain] type=(getConst(PBTypes,:ELECTRIC) || type) end if @battle.field.effects[PBEffects::MistyTerrain] type=(getConst(PBTypes,:FAIRY) || type) end if @battle.field.effects[PBEffects::PsychicTerrain] type=(getConst(PBTypes,:PSYCHIC) || type) end return type end end
I've tested these and they work
You know all these things you're posting are already done, right? Are you fixing problems you found in the original codes or are you just recreating them?
Also some of these seem to not have the correct effects
BattleHandlers::HPHealItem.add(:ORANBERRY,
proc { |item,battler,battle,forced|
next false if !battler.canHeal?
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
next false if !forced && battle.pbCheckOpposingAbility(:ASONE,battler.index)
def unstoppableAbility?(abil = nil)
abil = @ability if !abil
abilityBlacklist = [
# Form-changing abilities
:BATTLEBOND,
:DISGUISE,
# :FLOWERGIFT, # This can be stopped
# :FORECAST, # This can be stopped
:MULTITYPE,
:POWERCONSTRUCT,
:SCHOOLING,
:SHIELDSDOWN,
:STANCECHANGE,
:ZENMODE,
# Abilities intended to be inherent properties of a certain species
:COMATOSE,
:RKSSYSTEM,
:ASONE
]
abilityBlacklist.each do |a|
return true if isConst?(abil, PBAbilities, a)
end
return false
end
# Abilities that trigger upon switching in
if (!fainted? && unstoppableAbility?) || abilityActive?
def pbEffectsOnSwitchIn(switchIn=false)
# Healing Wish/Lunar Dance/entry hazards
@battle.pbOnActiveOne(self) if switchIn
# Primal Revert upon entering battle
@battle.pbPrimalReversion(@index) if !fainted?
# Ending primordial weather, checking Trace
pbContinualAbilityChecks(true)
# Abilities that trigger upon switching in
if (!fainted? && unstoppableAbility?) || abilityActive?
# As One
if hasActiveAbility?(:ASONE)
@battle.pbShowAbilitySplash(self)
@battle.pbDisplay(_INTL("{1} has two Abilities!",pbThis))
@battle.pbHideAbilitySplash(self)
oldAbil = @ability
@ability = getConst(PBAbilities,:UNNERVE)
@battle.pbShowAbilitySplash(self)
@battle.pbDisplay(_INTL("{1} is too nervous to eat Berries!",pbOpposingTeam))
@battle.pbHideAbilitySplash(self)
@ability=oldAbil
BattleHandlers.triggerAbilityOnSwitchIn(@ability,self,@battle)
end
BattleHandlers.triggerAbilityOnSwitchIn(@ability,self,@battle)
end
# Check for end of primordial weather
@battle.pbEndPrimordialWeather
# Items that trigger upon switching in (Air Balloon message)
if switchIn && itemActive?
BattleHandlers.triggerItemOnSwitchIn(@item,self,@battle)
end
# Berry check, status-curing ability check
pbHeldItemTriggerCheck if switchIn
pbAbilityStatusCureCheck
end
# Greninja - Battle Bond
if !user.fainted? && !user.effects[PBEffects::Transform] &&
user.isSpecies?(:GRENINJA) &&
isConst?(user.ability,PBAbilities,:BATTLEBOND)
if [email protected]?(user.idxOpposingSide) &&
[email protected][user.index&1][user.pokemonIndex]
numFainted = 0
targets.each { |b| numFainted += 1 if b.damageState.fainted }
if numFainted>0 && user.form==1
@battle.battleBond[user.index&1][user.pokemonIndex] = true
@battle.pbDisplay(_INTL("{1} became fully charged due to its bond with its Trainer!",user.pbThis))
@battle.pbShowAbilitySplash(user,true)
@battle.pbHideAbilitySplash(user)
user.pbChangeForm(2,_INTL("{1} became Ash-Greninja!",user.pbThis))
end
end
end
# Calyrex - As One
if !user.fainted? && user.isSpecies?(:CALYREX) && isConst?(user.ability,PBAbilities,:ASONE)
if [email protected]?(user.idxOpposingSide)
numFainted = 0
targets.each { |b| numFainted += 1 if b.damageState.fainted }
if numFainted>0
oldAbil=user.ability
if user.form==1 && user.pbCanRaiseStatStage?(PBStats::ATTACK,user)
user.ability = getConst(PBAbilities,:CHILLINGNEIGH) # Ice Rider
user.pbRaiseStatStageByAbility(PBStats::ATTACK,1,user)
elsif user.form==2 && user.pbCanRaiseStatStage?(PBStats::SPATK,user)
user.ability = getConst(PBAbilities,:GRIMNEIGH) # Shadow Rider
user.pbRaiseStatStageByAbility(PBStats::SPATK,1,user)
end
user.ability=oldAbil
end
end
end
# Consume user's Gem
#===============================================================================
# User copies target's ability. (Role Play)
#===============================================================================
class PokeBattle_Move_065 < PokeBattle_Move
def ignoresSubstitute?(user); return true; end
def pbMoveFailed?(user,targets)
if user.unstoppableAbility?
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbFailsAgainstTarget?(user,target)
if target.ability==0 || user.ability==target.ability
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if target.ungainableAbility? ||
isConst?(target.ability, PBAbilities, :POWEROFALCHEMY) ||
isConst?(target.ability, PBAbilities, :RECEIVER) ||
isConst?(target.ability, PBAbilities, :TRACE) ||
isConst?(target.ability, PBAbilities, :WONDERGUARD) ||
isConst?(target.ability, PBAbilities, :ASONE)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbEffectAgainstTarget(user,target)
@battle.pbShowAbilitySplash(user,true,false)
oldAbil = user.ability
user.ability = target.ability
@battle.pbReplaceAbilitySplash(user)
@battle.pbDisplay(_INTL("{1} copied {2}'s {3}!",
user.pbThis,target.pbThis(true),target.abilityName))
@battle.pbHideAbilitySplash(user)
user.pbOnAbilityChanged(oldAbil)
user.pbEffectsOnSwitchIn
end
end
#===============================================================================
# Target copies user's ability. (Entrainment)
#===============================================================================
class PokeBattle_Move_066 < PokeBattle_Move
def pbMoveFailed?(user,targets)
if user.ability==0
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if user.ungainableAbility? ||
isConst?(user.ability, PBAbilities, :POWEROFALCHEMY) ||
isConst?(user.ability, PBAbilities, :RECEIVER) ||
isConst?(user.ability, PBAbilities, :TRACE) ||
isConst?(user.ability, PBAbilities, :ASONE)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbFailsAgainstTarget?(user,target)
if target.unstoppableAbility? || isConst?(target.ability, PBAbilities, :TRUANT)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbEffectAgainstTarget(user,target)
@battle.pbShowAbilitySplash(target,true,false)
oldAbil = target.ability
target.ability = user.ability
@battle.pbReplaceAbilitySplash(target)
@battle.pbDisplay(_INTL("{1} acquired {2}!",target.pbThis,target.abilityName))
@battle.pbHideAbilitySplash(target)
target.pbOnAbilityChanged(oldAbil)
target.pbEffectsOnSwitchIn
end
end
#===============================================================================
# User and target swap abilities. (Skill Swap)
#===============================================================================
class PokeBattle_Move_067 < PokeBattle_Move
def ignoresSubstitute?(user); return true; end
def pbMoveFailed?(user,targets)
if user.ability==0
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if user.unstoppableAbility?
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if user.ungainableAbility? || isConst?(user.ability, PBAbilities, :WONDERGUARD) ||
isConst?(user.ability, PBAbilities, :ASONE)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbFailsAgainstTarget?(user,target)
if target.ability==0 ||
(user.ability==target.ability && !NEWEST_BATTLE_MECHANICS)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if target.unstoppableAbility?
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if target.ungainableAbility? || isConst?(target.ability, PBAbilities, :WONDERGUARD)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbEffectAgainstTarget(user,target)
if user.opposes?(target)
@battle.pbShowAbilitySplash(user,false,false)
@battle.pbShowAbilitySplash(target,true,false)
end
oldUserAbil = user.ability
oldTargetAbil = target.ability
user.ability = oldTargetAbil
target.ability = oldUserAbil
if user.opposes?(target)
@battle.pbReplaceAbilitySplash(user)
@battle.pbReplaceAbilitySplash(target)
end
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} swapped Abilities with its target!",user.pbThis))
else
@battle.pbDisplay(_INTL("{1} swapped its {2} Ability with its target's {3} Ability!",
user.pbThis,target.abilityName,user.abilityName))
end
if user.opposes?(target)
@battle.pbHideAbilitySplash(user)
@battle.pbHideAbilitySplash(target)
end
user.pbOnAbilityChanged(oldUserAbil)
target.pbOnAbilityChanged(oldTargetAbil)
user.pbEffectsOnSwitchIn
target.pbEffectsOnSwitchIn
end
end
XXX,GLACIALLANCE,Glacial Lance,000,130,ICE,Physical,100,5,0,NearOther,0,bef,"The user attacks by hurling a blizzard-cloaked icicle lance at opposing Pokémon."
XXX,ASTRALBARRAGE,Astral Barrage,000,120,GHOST,Special,100,5,0,AllNearFoes,0,bef,"The user attacks by sending a frightful amount of small ghosts at opposing Pokémon."
637,REINSOFUNITY,Reins of Unity,Reins of Unity,8,0,"Reins that people presented to the king. They enhance Calyrex's power over bountiful harvests and unite Calyrex with its beloved steed.",5,0,6,
638,UNREINSOFUNITY,Reins of Unity,Reins of Unity,8,0,"Reins that people presented to the king. They enable those who are connected to communicate with each other. The reins separate Calyrex and its beloved steed.",5,0,6,
ItemHandlers::UseOnPokemon.add(:REINSOFUNITY,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:CALYREX)
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.form>0
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
# Fusing
if pkmn.fused==nil
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen<0
poke2 = $Trainer.party[chosen]
if poke2.isSpecies?(:CALYREX)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
elsif pkmn==poke2
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif poke2.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif poke2.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !poke2.isSpecies?(:GLASTRIER) &&
!poke2.isSpecies?(:SPECTRIER)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
newForm = 0
newForm = 1 if poke2.isSpecies?(:GLASTRIER)
newForm = 2 if poke2.isSpecies?(:SPECTRIER)
pkmn.setForm(newForm) {
pkmn.fused = poke2
pbRemovePokemonAt(chosen)
$PokemonBag.pbChangeItem(:REINSOFUNITY,:UNREINSOFUNITY)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
end
})
ItemHandlers::UseOnPokemon.add(:UNREINSOFUNITY,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:CALYREX)
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.form==0
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
# Unfusing
if $Trainer.party.length>=6
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
$PokemonBag.pbChangeItem(:UNREINSOFUNITY,:REINSOFUNITY)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
# I recoded/simplified it 10/29:
MultipleForms.register(:CALYREX,{
"onSetForm" => proc { |pkmn,form,oldForm|
moves = [
:GLACIALLANCE, # Ice Rider (with Glastrier) (form 1)
:ASTRALBARRAGE,# Shadow Rider (with Spectrier) (form 2)
# Both forms
:TACKLE,:TAILWHIP,:DOUBLEKICK,:STOMP,:TAKEDOWN,:THRASH,:DOUBLEEDGE,
:AVALANCHE,:TORMENT,:MIST,:ICICLECRASH,:IRONDEFENSE,:TAUNT,:SWORDSDANCE,
:HEX,:CONFUSERAY,:HAZE,:SHADOWBALL,:AGILITY,:DISABLE,:NASTYPLOT
]
if form==0
4.times do
idxMoveToReplace = -1
pkmn.moves.each_with_index do |move,i|
next if !move
moves.each do |newMove|
next if !isConst?(move.id,PBMoves,newMove)
idxMoveToReplace = i
break
end
break if idxMoveToReplace>=0
end
if idxMoveToReplace>=0
moveName = PBMoves.getName(pkmn.moves[idxMoveToReplace].id)
pkmn.pbDeleteMoveAtIndex(idxMoveToReplace)
pbMessage(_INTL("{1} forgot {2}...",pkmn.name,moveName))
end
end
pbLearnMove(pkmn,:CONFUSION,true) if pkmn.numMoves==0
$PokemonBag.pbChangeItem(:UNREINSOFUNITY,:REINSOFUNITY)
else
newMove = getConst(PBMoves,moves[form-1])
if newMove && newMove>0
pbLearnMove(pkmn,newMove,true)
end
$PokemonBag.pbChangeItem(:REINSOFUNITY,:UNREINSOFUNITY)
end
}
})
Will there be tutorials for v17 or just v18 going forward? (RE: Calyrex, etc)
No. And EBS is never gonna come to v18.But there's something else that is coming to v18.Seconding this, I'm working with 17 and won't transfer until EBS is in 18, these will also be done for 17 too, right?