Help programming abilities?

I'm not directly familiar with the Showdown code itself, so here's a general overview of how I would program these abilities.

Ancient Presence:
  • Declare a new type (or use a preexisting one if it already exists) with no weaknesses and resistances
  • The ability itself does three things:
    • Respects immunity based on the target's ability and item (also the wiki doesn't include move effects that apply an immunity, so you would need to make a ruling as to whether you also check for e.g. magnet rise).
      • check if the item/ability provides an immunity, if so, check the unmodified type of the move being used. If they match, don't modify the attack further and let the immunity proceed as normal.
    • Set the attacking move's type to the new one with no interactions
    • Apply a *1.5 multiplier to the damage dealt. This is equivalent to applying STAB
Omnitype:
  • Declare a new type with the relevant attack interactions
  • Effects of Omnitype:
    • Provides the other listed immunities, plus an immunity to Stealth Rock (and Steelsurge) which will be handled separately. This part is always active, and cancelled by Mold Breaker/Turboblaze/Teravolt.
      • Possibly include an exception to the poison immunity that allows for Corrosion to function. Note that this means that the ability cannot have a "cures poison if active" component like most status-preventing abilities. The wiki entry doesn't provide any info on the interaction.
    • When the mon enters battle, check if Stealth Rock (and/or Steelsurge) is active on the relevant side. If so, apply the correct damage for Omnitype (1/4 for rocks, 1/16 for steelsurge) and display the message for them taking hazard damage. Should also turn off if forced in by an opponent with Mold Breaker/Teravolt/Turboblaze since that case will result in normal hazard damage being dealt.
    • When the mon is attacked, check if the opponent has Mold Breaker/Turboblaze/Teravolt. If not:
      1. Store the current type, so that it can be returned to later
      2. change type to the new "all" type
      3. Check if the attacking type does damage outside of the normal bounds for one type's interactions (grass and bug, as well as any type that has modified damage behind the immunity [Normal/ghost/electric/poison/ground])
        • If so, apply an extra multiplier for the damage
      4. resolve damage
      5. revert to the previous type from the stored variable
I'm not sure exactly how ignoring an ability works, so you might be able to avoid the check for the opponent's Mold Breaker since the ability would still be flagged as ignorable for the immunities. It also might be better to have the 'all' type contain the weaknesses/resistances behind the immunities and have the type immunities handled by the ability part instead, but I decided on this organization since Normal, Poison, and Ground would have required an extra modifier anyway.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top