1. Welcome to Smogon! Check out the Smogon Starters Hangout for everything you need to know about starting out in the community. Don't forget to introduce yourself in the Introduction and Hangout Thread, too!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

[on site] The Complete Damage Formula for Diamond & Pearl

Discussion in 'Archives' started by X-Act, Jul 18, 2007.

  1. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    Damage Formula = (((((((Level × 2 ÷ 5) + 2) × BasePower × [Sp]Atk ÷ 50) ÷ [Sp]Def) × Mod1) + 2) ×
    CH × Mod2 × R ÷ 100) × STAB × Type1 × Type2 × Mod3

    You would floor after each call, like BasePower, Att/def stat, etc... You would not floor within something like BasePower during

    BasePower = HH × BP × IT × CHG × MS × WS × UA × FA
    right? It would make no sense here because if you did Helping Hand, which is 1.5 and floored that, it would always be 1.0, resulting in no bonus ever.

    Thus, when you look at this:

    [Sp]Def = Stat × SM × Mod × SX

    It mentions that: If there are two simultaneous boosts in Mod, first apply the ability boost, then the item boost, and finally the Sandstorm boost.

    However, you would multiply everything out in for that Mod, returning the result, without flooring, then calculate the total stat (no flooring inside), and when you finally return the result for the def stat, you would floor right before it. Right?
  2. RBG

    RBG Got a long list of ex-lovers, they'll tell you I'm insane.
    is a Smogon Social Media Contributoris a Super Moderatoris a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Researcher Alumnusis a Tiering Contributor Alumnusis a Battle Server Moderator Alumnus
    Facebook Manager

    Joined:
    Jan 27, 2008
    Messages:
    3,367
    The Mods are just there so the formula isn't longer and biigeer than it has to look.

  3. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    Oh, I see... I would floor (helping hand * base power) then take that result and multiply by the item, flooring that result, etc. Right?
  4. RBG

    RBG Got a long list of ex-lovers, they'll tell you I'm insane.
    is a Smogon Social Media Contributoris a Super Moderatoris a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Researcher Alumnusis a Tiering Contributor Alumnusis a Battle Server Moderator Alumnus
    Facebook Manager

    Joined:
    Jan 27, 2008
    Messages:
    3,367
    Exactly
  5. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    The move Me First looks like it makes things very complicated. When figuring out the bonuses of things like Ability and Item modifiers for various parts of the formula, should Me First be used or should the Defending Pokemon's attack be used instead? Thanks!

    For example, Me First is a Normal move... If the opponent used Bite, which is Dark, and Absol used Me First, would the move now get STAB, too?
  6. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Smogon IRC SOp Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    Yes, it would. The on battle text would go something like this:

    Lucario used Me First!
    Lucario used Hammer Arm!
    It's super effective!
    Lucario's Speed fell!
    Rhydon fainted!

    Hence it's as if Lucario used the move Hammer Arm with x1.5 power, with the speed drop and all. Since Lucario is a Fighting-type Pokemon, it boosts the move also due to STAB. So it gets a x1.5 boost due to STAB and a x1.5 boost due to Me First.
  7. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    Holy crap... That makes my programming even harder now... Dammit... Oh wait, I can just put a checkbox in to say that you used that move instead, which just gives the 1.5x bonus automatically.

    Hey, I'm getting close to finishing the code up for this thing... Are there some situations you have for the damage it causes so I have something to test against? Thanks!

    Edit:

    It looks like you are missing a few things when it comes to abilities. You never mentioned how to apply any of these abilities:

    Levitate
    Volt Absorb
    Water Absorb
    Motor Drive

    I don't remember exactly, but I thought there was something that overrides the Levitate ability?

    I would assume, though, that these are supposed to be applied during the Mod3 phase?
  8. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Smogon IRC SOp Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    Gravity overrides Levitate ability, but it also overrides the Flying typing.

    Those 4 abilities would negate damage completely for Ground, Electric, Water, and Electric moves respectively.
  9. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    Forgot to mention Wonder Guard, the Type changing plates of Arceus, Air Lock & Cloude Nine override weather, Battle Armor negates Critical Hits, etc... Lots of abilties affect the damage dealt, but they are not metioned... Is this on purpose?
  10. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Smogon IRC SOp Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    Well, if they override things, you just don't multiply or multiply the relevant thing? Why should they be mentioned?
  11. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    If they aren't mentioned, people who are trying to apply the formula are not going to know about those things that automatically override everything unless they specifically look for them on their own.
  12. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    (Since no one responded, I can't edit or no one will respond)

    Where would Intimidate get placed in the order of things? During the Ability Modifier? If so, would it come before or after the Attacker's Ability? Thanks!
  13. RBG

    RBG Got a long list of ex-lovers, they'll tell you I'm insane.
    is a Smogon Social Media Contributoris a Super Moderatoris a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Researcher Alumnusis a Tiering Contributor Alumnusis a Battle Server Moderator Alumnus
    Facebook Manager

    Joined:
    Jan 27, 2008
    Messages:
    3,367
    Intimidate is a stat modifier, so it falls in the -1, -2, -3 ect for attack
  14. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    Oh my god, I feel stupid... Thanks...
  15. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    I have a question on the move Me First. It says that it uses the opponent's move... If that is the case, should the base attack power be calculated based on the Opponent's move instead of Me First's AP? Me first is not mentioned in Section 2. Thanks!

    Edit: Also, when applying effectiveness, do I use Me First's type or the attacker's move type? Thanks!
  16. Archer

    Archer

    Joined:
    Dec 22, 2007
    Messages:
    101
    Eruption is 150 Power at full health, whereas Weather Ball is 100.
    So if they have the same type, and get the weather boost...

    150*1.5 > 100*1.5, no?
  17. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    Moreover, you can never use Netbattle / Shoddybattle to test things. The developers don't have any extra information we don't have; in fact, they often use Smogon's dexes to find how to code things.
  18. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    245
    Which ability will end up taking precedence? Wonder Guard or Mold Breaker? Would Mold Breaker cause Wonder Guard to not function? Thanks!
  19. Veedrock

    Veedrock

    Joined:
    Oct 18, 2008
    Messages:
    2,780
    Mold Breaker negates Wonder Guard.

    Also from Shedinja's analysis:

Users Viewing Thread (Users: 0, Guests: 0)