- 4
- Posts
- 2
- Years
- Seen Apr 24, 2025
I've made a new status condition called Anxiety. The user is unable to move and it can't be cured on its own without using an item, though this is intended for use by NPCs to give to the player. Everything works as expected, but it doesn't show the message that it should upon the end of the turn where it states that the user has taken damage.
![[PokeCommunity.com] Custom status condition not showing hurt message [PokeCommunity.com] Custom status condition not showing hurt message](https://data.pokecommunity.com/attachments/83/83147-8e80b3a2a90e02056eccd1b2153d1853.jpg)
The codes I've used is based on both burn so they take damage in the end, and freeze so they're unable to move.
GameData::Status.register({
:id => :ANXIETY,
:name => _INTL("Anxiety"),
:animation => "Paralysis",
:icon_position => 7
priority.each do |battler|
next if battler.status != :ANXIETY || !battler.takesIndirectDamage?
battler.droppedBelowHalfHP = false
dmg = (Settings::MECHANICS_GENERATION >= 7) ? battler.totalhp / 4 : battler.totalhp / 1
battler.pbContinueStatus { battler.pbReduceHP(dmg, false) }
battler.pbItemHPHealCheck
battler.pbAbilitiesOnDamageTaken
battler.pbFaint if battler.fainted?
battler.droppedBelowHalfHP = false
end
end
case self.status
when :SLEEP then msg = _INTL("{1} is already asleep!", pbThis)
when :POISON then msg = _INTL("{1} is already poisoned!", pbThis)
when :BURN then msg = _INTL("{1} already has a burn!", pbThis)
when :PARALYSIS then msg = _INTL("{1} is already paralyzed!", pbThis)
when :FROZEN then msg = _INTL("{1} is already frozen solid!", pbThis)
when :ANXIETY then msg = _INTL("{1} is already riddled with anxiety!", pbThis)
end
"Generalised status displays"
...
when :SLEEP
@battle.pbDisplay(_INTL("{1} is fast asleep.", pbThis))
when :POISON
@battle.pbDisplay(_INTL("{1} was hurt by poison!", pbThis))
when :BURN
@battle.pbDisplay(_INTL("{1} was hurt by its burn!", pbThis))
when :PARALYSIS
@battle.pbDisplay(_INTL("{1} is paralyzed! It can't move!", pbThis))
when :FROZEN
@battle.pbDisplay(_INTL("{1} is frozen solid!", pbThis))
when :ANXIETY
@battle.pbDisplay(_INTL("{1} is trembling in fear!", pbThis))
end
...
when :SLEEP then @battle.pbDisplay(_INTL("{1} woke up!", pbThis))
when :POISON then @battle.pbDisplay(_INTL("{1} was cured of its poisoning.", pbThis))
when :BURN then @battle.pbDisplay(_INTL("{1}'s burn was healed.", pbThis))
when :PARALYSIS then @battle.pbDisplay(_INTL("{1} was cured of paralysis.", pbThis))
when :FROZEN then @battle.pbDisplay(_INTL("{1} thawed out!", pbThis))
when :ANXIETY then @battle.pbDisplay(_INTL("{1} regained its composure!", pbThis))
when :ANXIETY
PBDebug.log("[Move failed] #{pbThis} in trembling in fear")
@lastMoveFailed = true
return false
end
#===============================================================================
# Gives anxiety to the target
#===============================================================================
class Battle::Move::AnxietyTarget < Battle::Move
def pbFailsAgainstTarget?(user, target, show_message)
return false if damagingMove?
return !target.pbCanAnxiety?(user, show_message, self)
end
def pbEffectAgainstTarget(user, target)
return if damagingMove?
target.pbAnxiety
end
end
It even shows up in the debug log, so I'm not exactly sure where it's going wrong here either.
![[PokeCommunity.com] Custom status condition not showing hurt message [PokeCommunity.com] Custom status condition not showing hurt message](https://data.pokecommunity.com/attachments/83/83162-3e80b94b115866117828b83728836751.jpg)
![[PokeCommunity.com] Custom status condition not showing hurt message [PokeCommunity.com] Custom status condition not showing hurt message](https://data.pokecommunity.com/attachments/83/83147-8e80b3a2a90e02056eccd1b2153d1853.jpg)
The codes I've used is based on both burn so they take damage in the end, and freeze so they're unable to move.
Spoiler: "Status" Script
GameData::Status.register({
:id => :ANXIETY,
:name => _INTL("Anxiety"),
:animation => "Paralysis",
:icon_position => 7
Spoiler: "Battle_EndOfRoundPhase" Script
priority.each do |battler|
next if battler.status != :ANXIETY || !battler.takesIndirectDamage?
battler.droppedBelowHalfHP = false
dmg = (Settings::MECHANICS_GENERATION >= 7) ? battler.totalhp / 4 : battler.totalhp / 1
battler.pbContinueStatus { battler.pbReduceHP(dmg, false) }
battler.pbItemHPHealCheck
battler.pbAbilitiesOnDamageTaken
battler.pbFaint if battler.fainted?
battler.droppedBelowHalfHP = false
end
end
Spoiler: "Battler_Statuses" Script
case self.status
when :SLEEP then msg = _INTL("{1} is already asleep!", pbThis)
when :POISON then msg = _INTL("{1} is already poisoned!", pbThis)
when :BURN then msg = _INTL("{1} already has a burn!", pbThis)
when :PARALYSIS then msg = _INTL("{1} is already paralyzed!", pbThis)
when :FROZEN then msg = _INTL("{1} is already frozen solid!", pbThis)
when :ANXIETY then msg = _INTL("{1} is already riddled with anxiety!", pbThis)
end
"Generalised status displays"
...
when :SLEEP
@battle.pbDisplay(_INTL("{1} is fast asleep.", pbThis))
when :POISON
@battle.pbDisplay(_INTL("{1} was hurt by poison!", pbThis))
when :BURN
@battle.pbDisplay(_INTL("{1} was hurt by its burn!", pbThis))
when :PARALYSIS
@battle.pbDisplay(_INTL("{1} is paralyzed! It can't move!", pbThis))
when :FROZEN
@battle.pbDisplay(_INTL("{1} is frozen solid!", pbThis))
when :ANXIETY
@battle.pbDisplay(_INTL("{1} is trembling in fear!", pbThis))
end
...
when :SLEEP then @battle.pbDisplay(_INTL("{1} woke up!", pbThis))
when :POISON then @battle.pbDisplay(_INTL("{1} was cured of its poisoning.", pbThis))
when :BURN then @battle.pbDisplay(_INTL("{1}'s burn was healed.", pbThis))
when :PARALYSIS then @battle.pbDisplay(_INTL("{1} was cured of paralysis.", pbThis))
when :FROZEN then @battle.pbDisplay(_INTL("{1} thawed out!", pbThis))
when :ANXIETY then @battle.pbDisplay(_INTL("{1} regained its composure!", pbThis))
Spoiler: "Battler_UseMoveSuccessChecks" Script
when :ANXIETY
PBDebug.log("[Move failed] #{pbThis} in trembling in fear")
@lastMoveFailed = true
return false
end
Spoiler: "MoveEffects_BattlerOther" Script
#===============================================================================
# Gives anxiety to the target
#===============================================================================
class Battle::Move::AnxietyTarget < Battle::Move
def pbFailsAgainstTarget?(user, target, show_message)
return false if damagingMove?
return !target.pbCanAnxiety?(user, show_message, self)
end
def pbEffectAgainstTarget(user, target)
return if damagingMove?
target.pbAnxiety
end
end
It even shows up in the debug log, so I'm not exactly sure where it's going wrong here either.
![[PokeCommunity.com] Custom status condition not showing hurt message [PokeCommunity.com] Custom status condition not showing hurt message](https://data.pokecommunity.com/attachments/83/83162-3e80b94b115866117828b83728836751.jpg)