• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] How to change damage done by weaknesses/resistances?

  • 5
    Posts
    6
    Years
    • Seen Mar 25, 2020
    So normally super effective moves do 2x damage and not very effective moves do 0.5x, but how could I change that multiplier? Like, what I want to do is make all not very effective moves do no damage, but I don't want to change them all into immunities because that would make pokemon with 2 types OP. So how do I make it so that, for example, fighting does no damage to a flying pokemon, but does neutral damage to a normal/flying?
     
    I figured this out. I did it by changing this

    if typemod==0
    opponent.damagestate.calcdamage=0
    opponent.damagestate.critical=false

    to this

    if typemod<8
    opponent.damagestate.calcdamage=0
    opponent.damagestate.critical=false

    in PokeBattle_Move.
     
    So do you think that I could take this approach to change the W/R's to be other values? I've always wanted weakness to be x1.5 and resistances to be x2/3.
     
    So do you think that I could take this approach to change the W/R's to be other values? I've always wanted weakness to be x1.5 and resistances to be x2/3.

    I wouldn't recommend you try to make that change in this part of the code, because IIRC lots of other places assume that typemod is one of 2, 4, 8, 16, or 32 and you'll end up breaking abilities like Filter which check for those numbers specifically.

    Instead I'd try to find the place in the code where Essentials computes the multiplier from the typemod (which it does by dividing by 8) and change that to compute your new W/R multipliers.
     
    Now that you mention it, I think I already asked this question on this forum and you gave me the same answer.
    I was/am unfortunately very lazy/incompetent and didn't find it myself. But I can always try again later.
     
    Back
    Top