• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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] Creating a Special Defense Variant of Psyshock

  • 79
    Posts
    9
    Years
    • Seen Jan 12, 2024
    Hello, I'm attempting to create a physical move that uses the target's special defense, effectively a reverse of Psyshock.

    Here's its info in moves.txt:
    690,SOULSTRIKE,Soul Strike,D0D,80,GHOST,Physical,100,10,10,00,0,abef,"The user attacks through to the target's very soul. This attack does special damage."

    In Pokebattle_Move, I changed:
    Code:
        defense=opponent.defense
        defstage=opponent.stages[PBStats::DEFENSE]+6
        # TODO: Wonder Room should apply around here
        applysandstorm=false
    to:
    Code:
        if type>=0 && pbIsPhysical?(type) && @function!=0xD0D # Soul Strike
          defense=opponent.defense
          defstage=opponent.stages[PBStats::DEFENSE]+6
          applysandstorm=false
        end
    and in Pokebattle_MoveEffects:
    Code:
    ################################################################################
    # Target's Special Defense is used instead of its Defense for this move's
    # calculations. (Soul Strike)
    ################################################################################
    class PokeBattle_Move_D0D < PokeBattle_Move
    # Handled in superclass def pbCalcDamage, do not edit!
    end

    However, I now receive this error when attempting to use any physical move:
    Spoiler:

    I tried to use the same format special defense and psyshock used, but I must have messed up somewhere. Any help would be greatly appreciated!
     
    I'm getting the same error, and I even added the code to PokeBattle_AI. Can anyone help us? I was planning to add two Ghost moves named Shadow Shock and Shadow Strike (though Spirit Shock and Spirit Strike are good alternatives.)
     
    This is how it worked for me:
    Right in PokeBattle_Move under
    Code:
        # TODO: Wonder Room should apply around here
        applysandstorm=false

    I did this where 178 is the number of the new move in your case it should be 0xD0D:

    Code:
        if type>=0 && (pbIsSpecial?(type) || @function==0x178) && @function!=0x122 # Psyshock
          defense=opponent.spdef
          defstage=opponent.stages[PBStats::SPDEF]+6
          applysandstorm=true
        end
     
    This is how it worked for me:
    Right in PokeBattle_Move under
    Code:
        # TODO: Wonder Room should apply around here
        applysandstorm=false

    I did this where 178 is the number of the new move in your case it should be 0xD0D:

    Code:
        if type>=0 && (pbIsSpecial?(type) || @function==0x178) && @function!=0x122 # Psyshock
          defense=opponent.spdef
          defstage=opponent.stages[PBStats::SPDEF]+6
          applysandstorm=true
        end

    Thank you! This worked for me.

    I'm getting the same error, and I even added the code to PokeBattle_AI. Can anyone help us? I was planning to add two Ghost moves named Shadow Shock and Shadow Strike (though Spirit Shock and Spirit Strike are good alternatives.)

    Going off of AmineFifty's code, I changed the script in Pokebattle_AI to:

    Code:
        # Get base defense stat
        defense=pbRoughStat(opponent,PBStats::DEFENSE,skill)
        applysandstorm=false
        if type>=0 && move.pbIsSpecial?(type) [COLOR="Red"]|| move.function==0xD0D # Soul Strike[/COLOR]
          if move.function!=0x122 # Psyshock
            defense=pbRoughStat(opponent,PBStats::SPDEF,skill)
            applysandstorm=true
          end
        end

    I forgot to copy what the script was before editing, but it no longer returns an error so I'm hoping it works lol.
     
    Back
    Top