• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!

Ironing out new Abilities

Nova Ozuka

Trainer
Member
Joined
Apr 15, 2022
Posts
61
I made a couple of new abilities that Aurorus gets, but they're not quite doing what they're supposed to. The first is Freeze Body, an Ice-Type version of Flame Body.
Ruby:
Expand Collapse Copy
Battle::AbilityEffects::OnBeingHit.add(:FREEZEBODY,
  proc { |ability, user, target, move, battle|
    next if !move.pbContactMove?(user)
    next if user.frozen? || battle.pbRandom(100) >= 30
    battle.pbShowAbilitySplash(target)
    if user.pbCanFreeze?(target, Battle::Scene::USE_ABILITY_SPLASH) &&
       user.affectedByContactEffect?(Battle::Scene::USE_ABILITY_SPLASH)
      msg = nil
      if !Battle::Scene::USE_ABILITY_SPLASH
        msg = _INTL("{1}'s {2} froze {3}!", target.pbThis, target.abilityName, user.pbThis(true))
      end
      user.pbFreeze(target)
    end
    battle.pbHideAbilitySplash(target)
  }
)
Originally, I had the freeze line as user.pbFreeze(target,msg), but the game didn't like that, so I got rid of the msg and ended up with this:
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `empty?' for #<Battle::Battler>

Backtrace:
Battler_Statuses:232:in `pbInflictStatus'
[Generation 9 Pack] [003] Weather and Status.rb:429:in `pbInflictStatus'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:597:in `pbInflictStatus'
Battler_Statuses:396:in `pbFreeze'
Battle_AbilityEffects:1846:in `block in <main>'
Event_Handlers:195:in `trigger'
Battle_AbilityEffects:219:in `triggerOnBeingHit'
Battler_UseMoveTriggerEffects:10:in `pbEffectsOnMakingHit'
[v21.1 Hotfixes] Battle bug fixes.rb:149:in `pbEffectsOnMakingHit'
[Generation 9 Pack] [002] Battle_Battler.rb:487:in `pbEffectsOnMakingHit'



The next one is a Primordial Weather ability that doesn't do much, or at least I haven't made it do much yet. It starts a weather labled :Snowstorm. The problem isn't really with the ability itself. The issue I'm having is trying to make Aurora Veil work while it's active.
Code:
Expand Collapse Copy
  class Battle::Move::StartWeakenDamageAgainstUserSideIfHail < Battle::Move
  def canSnatch?; return true; end

  def pbMoveFailed?(user, targets)
    if user.effectiveWeather != :Hail
      return false if user.effectiveWeather = :Snowstorm
      @battle.pbDisplay(_INTL("But it failed!"))
      return true
    end
    if user.pbOwnSide.effects[PBEffects::AuroraVeil] > 0
      @battle.pbDisplay(_INTL("But it failed!"))
      return true
    end
    return false
  end

  def pbEffectGeneral(user)
    user.pbOwnSide.effects[PBEffects::AuroraVeil] = 5
    user.pbOwnSide.effects[PBEffects::AuroraVeil] = 8 if user.hasActiveItem?(:LIGHTCLAY)
    @battle.pbDisplay(_INTL("{1} made {2} stronger against physical and special moves!",
                            @name, user.pbTeam(true)))
  end
end
Genuinely, I might be missing something small here. I've tried everything I could think of, but this one just doesn't want to work except with :Hail.
 
Back
Top