• 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?".
  • A reminder that our new forum software has 2FA! It can be accessed by clicking your username and then "Password and security" from the menu. We strongly suggest not reusing passwords for your online accounts and enabling 2FA if possible.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Difficulty making a custom move.

7
Posts
190
Days
  • Age 29
  • 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
215
Days
  • Age 24
  • 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