• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Apologies if you've had troubles connecting to the site, you may need a VPN to access it. Staff are also facing issues connecting, so if it's urgent please message Cat on-site or through Discord directly.
  • Hey Guest, staff applications are open! If you are interested in becoming a forum staff member and/or Discord staff member, please apply through this Google Form before April 2! You can also message Cat with any questions.

Grant status immunity to types (PEv20.1)

Desperado

Novice
Member
Joined
Jan 22, 2024
Posts
20
I thought this would be simple to set up. First, I looked for the part of the scripts that handles whether a type is immune to a status effect: [[ Battle ]] > [[ Battler ]] > Battler_Statuses > starting at line 86:
hasImmuneType = false
case newStatus
when :SLEEP
hasImmuneType |= pbHasType?(:PSYCHIC)
# Desperado's note: added the above line to make psychic-types immune to sleep status.
# No type is immune to sleep
when :POISON
if !(user && user.hasActiveAbility?(:CORROSION))
hasImmuneType |= pbHasType?(:POISON)
hasImmuneType |= pbHasType?(:STEEL)
end
when :BURN
hasImmuneType |= pbHasType?(:FIRE)
# Desperado's note: added the below line to make rock-types immune to burn status.
hasImmuneType |= pbHasType?(:ROCK)
when :PARALYSIS
hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS
when :FROZEN
hasImmuneType |= pbHasType?(:ICE)
end
if hasImmuneType
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) if showMessages
return false
end
I added lines to make rock-types immune to burn and psychic-types immune to sleep. I copied the existing lines and simply changed the type. I run the game. I use a move that induces sleep on a psychic-type target. Neither has an ability or effect that would cause a type's immunity to a status effect to be prevented from working correctly. I can still put the psychic-type to sleep. I try the same where I apply burn status to a rock-type that should be immune to the status, but the rock-type still gets burned. I tried using a poison-type to inflict poison status on another poison-type where neither has an ability or effect that'd affect the outcome and the defender isn't affected and the attempt to inflict poison status fails, so clearly I'm doing something wrong and the function of a type being immune to a status effect works somewhere.

Thanks in advance for any help.
 
Back
Top