Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Immunity

Well, yeah.  Not entirely what it sounds.  But it's in two parts.  The second part links to the first part really...

1 - The idea of RMXP not giving full immunity to a status ailment when an enemy has an "F" set for it is kind of irritating.  I've heard this asked before, though I could never make sense of the answers (Because I'm not that smart).  Thanks to anybody who can give me a good way to do this.

2 - Based from Final Fantasy 10.  I'm looking for a way to show an "Immunity" tag above the damage counter, showing that the enemy can't be inflicted with this ailment. 

Much appreciation.
~Ruby
 
1- What do you mean? When an enemy has "F" set, there's a 0% chance of getting a status ailment set on it-- basically, immunity.

2- I'm not really sure what you mean here. Do you mean, if an enemy has the status effect "Immunity" inflicted, you want it to have a 0% chance of getting other status effects?
 
No, I'll expand.

1 - I mean that Immunity "F" means that the enemy can NEVER be inflicted with the ailment.
2 - Did you ever play FFX?  Well, when an enemy couldn't have a status ailment inflicted on it, a tag saying "IMMUNE" appeared near where the attack's damage was displayed. 
 

poccil

Sponsor

If what you mean is granting a temporary immunity to states:  In this case, modify the state_guard? method of Game_Enemy and Game_Actor.  The code below is untested, but place it in a new section just before the last one in the script editor.

Code:
class Game_Battler
#########################
  IMMUNITYSTATES={
    20=>[] # Prevents all states
    21=>[3,6] # Prevents states 3 and 6
  }
#########################
  def immune?(state)
   immstates=IMMUNITYSTATES
   for imm in immstates.keys
    if self.state?(imm)
     return true if immstates[imm].length==0
     return true if immstates[imm].include?(state)
    end
   end
   return false
  end
end
class Game_Enemy
  def state_guard?(state)
    return immune?(state)
  end
end
class Game_Actor
  alias petero_immunity_Game_Actor_state_guard? state_guard?
  def state_guard?(state)
    return true if immune?(state)
    return petero_immunity_Game_Actor_state_guard?(state)
  end
end
 
Dark Ruby":3vpagwxc said:
No, I'll expand.

1 - I mean that Immunity "F" means that the enemy can NEVER be inflicted with the ailment.
2 - Did you ever play FFX?  Well, when an enemy couldn't have a status ailment inflicted on it, a tag saying "IMMUNE" appeared near where the attack's damage was displayed. 

Ahh, I see. You mean you want a temporary 0% chance state, and after a few turns the state runs out and you aren't immune anymore. Try poccil's solution, it'll probably work.
 
@Sandgolem: Yeah that's what I was after.

@everybody else: When I searched up immunity on the forums, looking for the Immune tag script that Sandgolem gave me, I came up with one or two posts saying the F status in the database didn't completely make the enemy immune to a status ailment.  Is this true, or not?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top