Stacking States

still the problem, that removing 1 state (with medicine) removes the entire stack of 10 (wound).

anyone already fixed that ?
here the fixed version: (by Another Fen)

class Game_Battler

  

  #----FIX: BY: "Another Fen" (GER)------------------------------------------

  # * Remove Single State Stack

  #--------------------------------------------------------------------------

  def remove_state_stack(state_id)

    case @states.count(state_id)

    when 0 

      return

    when 1 

      remove_state(state_id)

    else 

      @states.delete_at(@states.index(state_id))

      @result.removed_states.push(state_id).uniq!

      refresh

    end

  end

  

  #--------------------------------------------------------------------------

  # * [Remove State] Effect  (Redefined)

  #--------------------------------------------------------------------------

  def item_effect_remove_state(user, item, effect)

    chance = effect.value1

    if rand < chance

      remove_state_stack(effect.data_id)

      @result.success = true

    end

  end

end

 

 

class Game_Interpreter

  

  #--------------------------------------------------------------------------

  # * Change State  (Redefined)

  #--------------------------------------------------------------------------

  def command_313

    iterate_actor_var(@params[0], @params[1]) do |actor|

      already_dead = actor.dead?

      if @params[2] == 0

        actor.add_state(@params[3])

      else

        actor.remove_state_stack(@params[3])

      end

      actor.perform_collapse_effect if actor.dead? && !already_dead

    end

    $game_party.clear_results

  end

 

  #--------------------------------------------------------------------------

  # * Change Enemy State  (Redefined)

  #--------------------------------------------------------------------------

  def command_333

    iterate_enemy_index(@params[0]) do |enemy|

      already_dead = enemy.dead?

      if @params[1] == 0

        enemy.add_state(@params[2])

      else

        enemy.remove_state_stack(@params[2])

      end

      enemy.perform_collapse_effect if enemy.dead? && !already_dead

    end

  end

end

 

 

 

 

now it works.
Sorry again for another necropost, but I have a possible bug to report. Enemy icons don't update, but player icons do.






Neon hasn't been on in 8 months or so, but I thought someone else might have experienced a similar issue.
Uh, what script are you using to display enemy states? This isn't a feature of the default battle system.
http://forums.rpgmakerweb.com/index.php?/topic/697-enemy-hp-bars/

The only reason I label it as a potential bug is due to the fact that from how I read the code, it should impact all battlers, friendly and otherwise, rather than just one specific subset.
The states impact all battlers. The HP bars script just displays each instance of a state separately (it displays "ATK Lv1" twice instead of "ATK Lv2"). You should be able to fix that by changing line 139-142 of the HP bar script:


@battler.states.each do |state|


  @hp_bar.draw_icon(state.icon_index,xx,yy)


  xx += 24


end


=>



@battler.state_icons.each do |icon_index|


  @hp_bar.draw_icon(icon_index,xx,yy)


  xx += 24


end
Gah, I never even thought it might be the other scripts involved.. My apologies, and thank you, yet again, fen. You've been a lifesaver.
It says stack level too deep. Please help this is very annoying...
It'll only say that if you put two of the same script in your editor. 
It'll only say that if you put two of the same script in your editor. 

Yeah looks like it..
Very great script!
but i was little disappointed, because this script can't be used for Falcao Pearl ABS Liquid V.3
if you want, can you make this script is compatable with Falcao Pearl ABS Liquid V.3 Script?
i'm sorry for request carelessly!

Original thread: https://forums.rpgmakerweb.com/threads/stacking-states.14110/