• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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
    1
    Years
    • 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:
    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