• 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] 4x Effectiveness Message

HeroesFightingFear

"The Champion of Alon"
99
Posts
4
Years
  • Code:
    # Type effectiveness
        if numhits>1
          if target.damagestate.typemod>8
            if alltargets.length>1
              @battle.pbDisplay(_INTL("It's super effective on {1}!",target.pbThis(true)))
            else
              @battle.pbDisplay(_INTL("It's super effective!"))
            end
          elsif target.damagestate.typemod>=1 && target.damagestate.typemod<8
            if alltargets.length>1
              @battle.pbDisplay(_INTL("It's not very effective on {1}...",target.pbThis(true)))
            else
              @battle.pbDisplay(_INTL("It's not very effective..."))
            end
          end
          if realnumhits==1
            @battle.pbDisplay(_INTL("Hit {1} time!",realnumhits))
          else
            @battle.pbDisplay(_INTL("Hit {1} times!",realnumhits))
          end
        end
        PBDebug.log("Move did #{numhits} hit(s), total damage=#{turneffects[PBEffects::TotalDamage]}")

    I wanna add something like this stuff for 4x effectiveness. Anyone know how to do it? If so, that'd be great!
    As for the display idea...
    Code:
              @battle.pbDisplay(_INTL("It's extremely effective on {1}!",target.pbThis(true)))
            else
              @battle.pbDisplay(_INTL("It's extremely effective!"))
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • If this code (typemod>8) recognizes when a move is super effective:
    Code:
    typemod>8
            if alltargets.length>1
              @battle.pbDisplay(_INTL("It's super effective on {1}!",target.pbThis(true)))

    Then you will need to make a new code to recognized a number major than '8' and set it to inflict x4 effective and then, do a 'elsif' for the code above, to show your new message.
     

    Diegou18

    Forever Chandelure lover.
    75
    Posts
    6
    Years
    • Seen Aug 16, 2021
    As WolfPP said, you should modify that code. I did it, and it looks like this (=>16 represents the x4 effectiveness):
    Code:
          if target.damagestate.typemod>=16 #(x4 Effectiveness)
            if alltargets.length>1
              @battle.pbDisplay(_INTL("¡Es ultra eficaz en {1}!",target.pbThis(true)))
            else
              @battle.pbDisplay(_INTL("¡Es ultra eficaz!"))
            end   
          elsif target.damagestate.typemod>8 && target.damagestate.typemod<16 #(x2 Effectiveness)
            if alltargets.length>1
              @battle.pbDisplay(_INTL("¡Es súper eficaz en {1}!",target.pbThis(true)))
            else
              @battle.pbDisplay(_INTL("¡Es súper eficaz!"))
            end
          elsif target.damagestate.typemod>=1 && target.damagestate.typemod<8 #(x1/2 Effectiveness)
            if alltargets.length>1
              @battle.pbDisplay(_INTL("No es muy eficaz en {1}...",target.pbThis(true)))
            else
              @battle.pbDisplay(_INTL("No es muy eficaz..."))
            end
          end
     
    Last edited:

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Okay but it will only show the message but I don't think it will trigger typemod to 16 (and IDK how 'typemode' works). I believe you guys need to dig the code about 'typemod', like from 'PokeBattle_Move' script:
    Code:
          effectiveness=0
          if opponent.damagestate.typemod<8
            effectiveness=1   # "Not very effective"
          elsif opponent.damagestate.typemod>8
            effectiveness=2   # "Super effective"
          end
          if opponent.damagestate.typemod!=0
            @battle.scene.pbDamageAnimation(opponent,effectiveness)
          end

    Etc. GL anyway!
     

    Diegou18

    Forever Chandelure lover.
    75
    Posts
    6
    Years
    • Seen Aug 16, 2021
    To be honest, I have it in my game, and I've not modified typemod's code. I probably forgot an edition and where it is lol.
    I didn't modify typemod's code since Essentials, by itself, has defined (Idk where, really) a code for x4 effectiveness, or there wouldn't be any difference if you hit a Grass-Bug or a Grass type with a Fire move. I discovered it by my own, testing numbers in order to see what message appears and with 16 worked. I know it's kinda noob, but I'm actually xD.
     
    Back
    Top