Abilities in Pokémon Essentials BES are passive effects that activate automatically during battle or in the overworld. Each Pokémon can have up to two regular abilities and up to four hidden abilities.
Abilities are defined in PBS/abilities.txt with the following format:
ID,InternalName,DisplayName,Description
Examples from abilities.txt:
1,STENCH,Hedor,"Debido al mal olor que emana, al atacar al rival puede hacerlo retroceder."2,DRIZZLE,Llovizna,"Hace que llueva cuando entra en combate."3,SPEEDBOOST,Impulso,"Aumenta la Velocidad en cada turno."
Pokémon receive abilities through their species data in PBS/pokemon.txt:
# From pokemon.txt species definitionAbilities=OVERGROW,CHLOROPHYLL # First ability, second abilityHiddenAbility=LEAFGUARD,SAPSIPPER # Hidden abilities 1-4
Ability Slot System
Slot 0: Primary ability (most common)
Slot 1: Secondary ability (some Pokémon have two regular abilities)
Hidden: Special abilities obtainable through events, Dream World, etc.
2,DRIZZLE,Llovizna,"Hace que llueva cuando entra en combate."
DROUGHT (ID: 70)
70,DROUGHT,Sequía,"Cuando el Pokémon entra en combate, el tiempo pasa a ser soleado."
SANDSTREAM (ID: 45)
45,SANDSTREAM,Chorro Arena,"Crea una tormenta de arena al entrar en combate."
These abilities automatically change the weather when the Pokémon enters battle.Implementation pattern:
def pbOnActiveAll if ability == PBAbilities::DRIZZLE @battle.pbStartWeather(PBWeather::RAIN, true) endend
Stat-Changing Abilities
INTIMIDATE (ID: 22)
22,INTIMIDATE,Intimidación,"Al entrar en combate amilana al rival de tal manera que su Ataque disminuye."
Lowers opposing Pokémon’s Attack by one stage upon entering battle.Implementation:
def pbOnActiveAll if ability == PBAbilities::INTIMIDATE for target in @battle.opponents if !target.hasAbility(:CLEARBODY) && !target.hasAbility(:WHITESMOKE) target.pbReduceStat(PBStats::ATTACK, 1, true) end end endend
25,WONDERGUARD,Superguarda,"Gracias a un poder misterioso, solo le hacen daño los movimientos supereficaces."
Only super-effective moves can damage this Pokémon.Implementation:
def pbOnBeingHit(move, user) if ability == PBAbilities::WONDERGUARD effectiveness = pbTypeModifier(move.type, user, self) if effectiveness < 2 # Not super effective return 0 # No damage end endend
17,IMMUNITY,Inmunidad,"Su sistema inmunitario evita el envenenamiento."
LIMBER (ID: 7)
7,LIMBER,Flexibilidad,"Evita ser paralizado gracias a la flexibilidad de su cuerpo."
INSOMNIA (ID: 15)
15,INSOMNIA,Insomnio,"Su resistencia al sueño le impide quedarse dormido."
MAGMAARMOR (ID: 40)
40,MAGMAARMOR,Escudo Magma,"Gracias al magma candente que lo envuelve, evita la congelación."
WATERVEIL (ID: 41)
41,WATERVEIL,Velo Agua,"Evita las quemaduras gracias a la capa de agua que lo envuelve."
Implementation:
def pbCanInflictStatus?(status, user, showMessages) case status when PBStatuses::POISON if ability == PBAbilities::IMMUNITY return false end when PBStatuses::PARALYSIS if ability == PBAbilities::LIMBER return false end when PBStatuses::SLEEP if ability == PBAbilities::INSOMNIA return false end end return trueend
33,SWIFTSWIM,Nado Rápido,"Sube la Velocidad cuando llueve."
CHLOROPHYLL (ID: 34)
34,CHLOROPHYLL,Clorofila,"Sube la Velocidad cuando hace sol."
SANDVEIL (ID: 8)
8,SANDVEIL,Velo arena,"Aumenta la Evasión durante las tormentas de arena."
CLOUDNINE / AIRLOCK (ID: 13, 76)
13,CLOUDNINE,Aclimatación,"Anula todos los efectos del tiempo atmosférico."76,AIRLOCK,Esclusa de aire,"Neutraliza todos los efectos del tiempo atmosférico."
# Check if Pokémon has a specific abilityif pokemon.hasAbility?(:INTIMIDATE) # Do somethingend# Get ability IDability_id = pokemon.ability# Get ability nameability_name = PBAbilities.getName(pokemon.ability)
Custom abilities are implemented in the battle engine scripts, not in PBS files.
Steps to create a custom ability:
Add entry to PBS/abilities.txt
Implement trigger logic in battle scripts
Recompile PBS data
Example implementation pattern:
# In PokeBattle_Battler or PokeBattle_Battledef pbAbilitiesOnSwitchIn(battler) case battler.ability when PBAbilities::CUSTOMABILITY # Your custom logic here battler.pbIncreaseStat(PBStats::ATTACK, 1) endend