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.

remove_state's force flag

I have a problem regarding the force flag you can set when calling the remove_state method inside Game_Battler... let me show it to you for short...

Code:
  def remove_state(state_id, force = false)
    if state?(state_id)
      if @states_turn[state_id] == -1 and not force
        return
      end
      if @hp == 0 and $data_states[state_id].zero_hp
        zero_hp = false
        for i in @states
          if i != state_id and $data_states[i].zero_hp
            zero_hp = true
          end
        end
        if zero_hp == false
          @hp = 1
        end
      end
      @states.delete(state_id)
      @states_turn.delete(state_id)
    end
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end

Well, I don't get what difference the force flag exactly mades... I can call the method like so...
Code:
remove_state(state_id)
remove state(state_id, true)
...and it won't make an obvous difference for me... Can someone please tell me what it does?
 

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