mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Added class Data::Ability and made all code use symbols for abilities instead of numbers. Also added class Data::Item but it's unused.
This commit is contained in:
@@ -1086,23 +1086,22 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE,proc { |item,pkmn,scene|
|
||||
abils = pkmn.getAbilityList
|
||||
abil1 = 0; abil2 = 0
|
||||
abil1 = nil; abil2 = nil
|
||||
for i in abils
|
||||
abil1 = i[0] if i[1]==0
|
||||
abil2 = i[0] if i[1]==1
|
||||
end
|
||||
if abil1<=0 || abil2<=0 || pkmn.hasHiddenAbility? || pkmn.isSpecies?(:ZYGARDE)
|
||||
if abil1.nil? || abil2.nil? || pkmn.hasHiddenAbility? || pkmn.isSpecies?(:ZYGARDE)
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
newabil = (pkmn.abilityIndex+1)%2
|
||||
newabilname = PBAbilities.getName((newabil==0) ? abil1 : abil2)
|
||||
newabilname = Data::Ability.get((newabil==0) ? abil1 : abil2).name
|
||||
if scene.pbConfirm(_INTL("Would you like to change {1}'s Ability to {2}?",
|
||||
pkmn.name,newabilname))
|
||||
pkmn.setAbility(newabil)
|
||||
scene.pbRefresh
|
||||
scene.pbDisplay(_INTL("{1}'s Ability changed to {2}!",pkmn.name,
|
||||
PBAbilities.getName(pkmn.ability)))
|
||||
scene.pbDisplay(_INTL("{1}'s Ability changed to {2}!",pkmn.name,newabilname))
|
||||
next true
|
||||
end
|
||||
next false
|
||||
|
||||
Reference in New Issue
Block a user