• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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] Possible to make a type's attacks deal less damage depending on the user

53
Posts
8
Years
  • In my game I've added a new type, the Chaos-type.
    This type is unique in that it is super effective against all types with a few exceptions.
    I want to make it so pokemon that aren't Chaos-type will deal less damage when they use Chaos moves. Specifically, I would like non-chaos types to deal x1.3 super effective damage instead of x2 damage when using a Chaos move. How would I go about doing that?
     
    824
    Posts
    8
    Years
  • Script Section PokeBattle_Move, in the function def pbCalcDamage( (which starts on line 571), find line 1036. It should read like this:
    Code:
          typemod=pbTypeModMessages(type,attacker,opponent)

    Add this directly below it:
    Code:
          typemod=16.0 if isConst?(type,PBTypes,:CHAOS)
          typemod=10.4 if isConst?(type,PBTypes,:CHAOS) && !attacker.pbHasType?(:CHAOS)

    A typemod of 8 means the attack is neutrally effective.
    A typemod of 16 is standard super effectiveness.
    8 multiplied by 1.3 is 10.4, so a typemod of 10.4 means that type effectiveness is 1.3


    Note, however, that in this case, STAB mechanics would apply. A Chaos-type Pokemon (which would give the move a 2x effectiveness) would receive STAB on the Chaos-type move, whereas a non-Chaos type Pokemon (which would give the move a 1.3x effectiveness) would not. STAB is 1.5x damage output, or 2x damage output with the ability Adaptability.

    This means that:
    Chaos-type move used by Chaos-type Pokemon with Adaptability
    2x * 2x (effectiveness * Adaptability STAB) = 4x damage

    Chaos-type move used by Chaos-type Pokemon with some other ability
    2x * 1.5x (effectiveness * STAB) = 3x damage

    Chaos-type move used by non-Chaos-type Pokemon, with or without Adaptability
    1.3x (effectiveness) = 1.3x damage

    Do you want these moves to be that powerful? If not, might I suggest removing STAB mechanics from Chaos moves? This would be done by replacing line 1027, which reads:
    Code:
        if attacker.pbHasType?(type) && (options&IGNOREPKMNTYPES)==0
    with these two lines:
    Code:
        if isConst?(type,PBTypes,:CHAOS)
        elsif attacker.pbHasType?(type) && (options&IGNOREPKMNTYPES)==0
     
    Last edited:
    Back
    Top