RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

[VXA][SOLVED] States Immune to Full Recovery

Started by dragon3025, August 12, 2012, 03:12:14 PM

0 Members and 1 Guest are viewing this topic.

dragon3025

States Immune to Full Recovery
8/12/12




Summary
I hate how full recovery event command removes positive states, (for example you have a state that boost defense, and it get's removed once you use full recovery). Can someone make a script that allows choose which states aren't affected by it.

Features Desired

  • Ability to list which states don't get removed by Full Recovery

Games its been in

  • I know that Final Fantasy XII has this feature, (for example: you use cast Protect on your party and then use a Save Crystal, which also fully Recovers your party, positive status effects like Protect aren't removed).




Did you search?
Yes

Where did you search?

  • Google
  • RMRK
  • RPG Maker VX.net Forums

What did you search for?

  • "Full Recovery"
  • "Full Recovery" + States
  • States
  • "Full Recovery" + Immune States
  • (I might have used more, but I searched so many times).

pacdiggity

Put the tag "\no_recover" in the notebox of states you don't want to remove upon full recovery.

class Game_BattlerBase
  def clear_states
    hold_states = []
    states.each { |state|
      hold_states.push if !state.note[/\\no[_ ]recover/i].nil?
    }
    @states = hold_states
    @state_turns = {}
    @state_steps = {}
  end
end
it's like a metaphor or something i don't know

dragon3025

Quote from: Pacman on August 12, 2012, 09:01:25 PM
Put the tag "\no_recover" in the notebox of states you don't want to remove upon full recovery.

class Game_BattlerBase
  def clear_states
    hold_states = []
    states.each { |state|
      hold_states.push if !state.note[/\\no[_ ]recover/i].nil?
    }
    @states = hold_states
    @state_turns = {}
    @state_steps = {}
  end
end

Thanks for the reply Pacman. I tried it and it gave me this error though:

Script 'Game_BattlerBase' line 146: NoMethodError occured.

undefined method `collect' for nil:NilClass

I then tried using it in a fresh new project and it removed the "\no_recover" states also.

pacdiggity

This should work.
class Game_BattlerBase
  alias no_recover_states_init initialize
  def initialize(*args)
    @states = []
    no_recover_states_init(*args)
  end
  alias no_recover_states_clear clear_states
  def clear_states(*args)
    hold_states = []
    for state in states
      hold_states.push(state.id) if state.note[/\\no[_ ]recover/i] != nil
    end
    no_recover_states_clear(*args)
    @states = hold_states
  end
end
it's like a metaphor or something i don't know

dragon3025

Quote from: Pacman on August 13, 2012, 10:21:42 AM
This should work.
class Game_BattlerBase
  alias no_recover_states_init initialize
  def initialize(*args)
    @states = []
    no_recover_states_init(*args)
  end
  alias no_recover_states_clear clear_states
  def clear_states(*args)
    hold_states = []
    for state in states
      hold_states.push(state.id) if state.note[/\\no[_ ]recover/i] != nil
    end
    no_recover_states_clear(*args)
    @states = hold_states
  end
end

It gave me this error:
Script 'Game_Actor' line 52: TypeError occurred

no implicit conversion from nil to integer

and I tried it in a new project again and it removed all of the states again.

pacdiggity

I don't get that error. It works completely fine for me.
it's like a metaphor or something i don't know

dragon3025

Quote from: Pacman on August 13, 2012, 09:11:51 PM
I don't get that error. It works completely fine for me.
I put without quotes "\no_recover" with the backslash included right? I don't understand, you tried this in a fresh new project right?

pacdiggity

Yes, new project, everything. Works fine.
it's like a metaphor or something i don't know

dragon3025

#8
Quote from: Pacman on August 14, 2012, 11:40:11 AM
Yes, new project, everything. Works fine.
Sorry, it is working now. I made the silly mistake of putting the script below "Main". Thanks for the script, this really helps.

I tested it out while placing other script in it, (one at a time), and finally figured it out, Yanfly's 'Yanfly Engine Ace - Passive States v1.02" is causing this compatibility error:

"Script 'Game_Actor' line 52: TypeError occurred

no implicit conversion from nil to integer"

The problem was fixed though: http://rmrk.net/index.php/topic,46683.0.html