• 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.

Difficulty making a custom move.

  • 7
    Posts
    290
    Days
    • Seen Jan 26, 2024
    I am having trouble making moves that have bad effects for the user, like losing a quarter of their HP, getting confused, getting paralyzed, etc. While also having a positive effect like a stat increase. The move can be taught to the pokemon but it always fails and I don't know why. If someone could give me an example as how to make these types of moves, it would be very appeciated.
     
    Last edited:
  • 4
    Posts
    314
    Days
    • Seen Feb 24, 2024
    In MoveEffects_BattlerStats:

    #===============================================================================
    # Sacrifices 1/4 of HP to increase Attack.
    #===============================================================================

    class Battle::Move::RaiseUserAttackLoseQuarterOfTotalHP < Battle::Move
    attr_reader :statUp

    def canSnatch?; return true; end

    def initialize(battle, move)
    super
    @statUp = [:ATTACK, 1]
    end

    def pbMoveFailed?(user, targets)
    hpLoss = [user.totalhp / 4, 1].max
    if user.hp <= hpLoss
    @battle.pbDisplay(_INTL("But it failed!"))
    return true
    end
    return true if !user.pbCanRaiseStatStage?(@statUp[0], user, self, true)
    return false
    end

    def pbEffectGeneral(user)
    hpLoss = [user.totalhp / 4, 1].max
    user.pbReduceHP(hpLoss, false, false)
    if user.hasActiveAbility?(:CONTRARY)
    user.statsLoweredThisRound = true
    user.statsDropped = true
    @battle.pbCommonAnimation("StatDown", user)
    @battle.pbDisplay(_INTL("{1} cut its own HP and lowered its {2}!",
    user.pbThis, GameData::Stat.get(@statUp[0]).name))
    else
    user.statsRaisedThisRound = true
    @battle.pbCommonAnimation("StatUp", user)
    @battle.pbDisplay(_INTL("{1} cut its own HP and raised its {2}!",
    user.pbThis, GameData::Stat.get(@statUp[0]).name))
    end
    user.pbItemHPHealCheck
    end
    end

    You can change the ATTACK to another stat.

    In PBS file moves.txt:

    #-------------------------------
    [INSERTNAMEHERE]
    Name = InsertNameHere
    Type = InsertTypeHere
    Category = Status
    Accuracy = 0
    TotalPP = 10
    Target = User
    FunctionCode = RaiseUserAttackLoseQuarterOfTotalHP
    Description = The user raises it's Attack by sacrificing it's HP.
     
    Back
    Top