Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Unalterable States
#1
Unalterable States
Version: 1.0



Introduction
This is a very simple script in principle and intent. It merely prevents specific status effects from being added or removed unless performed by way of a script call. This way, custom and unique states that are meant to be permanent cannot be accidentally healed by way of items of the use or the Recover All map event.



Script
Code:
#==============================================================================
# ** Unalterable States
#------------------------------------------------------------------------------
#    by DerVVulfman
#    version 1.0
#    01-21-2019 (MM-DD-YYYY)
#    RGSS / RPGMaker XP
#==============================================================================
#
#  This is a very simple script in principle and intent.  It merely prevents
#  specific status effects  from being added or removed  unless performed by
#  way of a script call.  This way,  custom and unique states that are meant
#  to be permanent  cannot be accidentally healed by way of items of the use
#  of the Recover All map event.
#
#  States that are meant  to be permanent,  and cannot be summarily added or
#  remove by normal means,  have their IDs listed in  the Unalterable_States
#  module below.  There is but only one array to edit.  So... list away!
#
#  As stated earlier, you will now need to use script calls to actively
#  add these states.  They are as follows.
#
#  (target).dvv_add_unalterable_state(state_id [, force] )
#    and
#  (target).dvv_remove_unalterable_state(state_id [, force] )
#
#  EXAMPLE:   $game_party.actors[2].dvv_add_unalterable_state(5)
#
#  These are mirrors of the normal 'add_state' and 'remove_state' methods,
#  the methods which are being bypassed  if an Unalterable state is found.
#  
#
#==============================================================================
#
#  TERMS AND CONDITIONS:
#  Free for use, even in commercial games.  However, due credit is required.
#
#==============================================================================


module Unalterable_States
  
  STATES = [21]  # Yes, I had a 21st state in MY game. "Upset Tummy"  ^_^
  
end



#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias dvv_add_unalterable_state add_state
  alias dvv_remove_unalterable_state remove_state
  #--------------------------------------------------------------------------
  # * Add State
  #     state_id : state ID
  #     force    : forcefully added flag (used to deal with auto state)
  #--------------------------------------------------------------------------
  def add_state(state_id, force = false)
    # Block if non-changing
    return if Unalterable_States::STATES.include?(state_id)
    # Perform the original call
    dvv_add_unalterable_state(state_id, force)
  end
  #--------------------------------------------------------------------------
  # * Remove State
  #     state_id : state ID
  #     force    : forcefully removed flag (used to deal with auto state)
  #--------------------------------------------------------------------------
  def remove_state(state_id, force = false)
    # Block if non-changing
    return if Unalterable_States::STATES.include?(state_id)
    # Perform the original call
    dvv_remove_unalterable_state(state_id, force)
  end
end



Instructions
It's a simple system with instructions in the script.



Compatibility
While it should be compatible with any RPGMaker XP script, it might cause issues if you accidentally make a status effect super-permanent when not intended. Carful careful!!!



Terms and Conditions
Free for use, even in commercial games. However, due credit is required.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   KDamage States Edition kyonides 0 519 06-29-2023, 02:20 AM
Last Post: kyonides
   Kolloseum States XP kyonides 55 63,904 02-26-2019, 08:28 AM
Last Post: kyonides
   States : Expiration States Kain Nobel 1 5,896 01-26-2017, 09:45 PM
Last Post: Noctis
   DVV's States Rotation DerVVulfman 5 8,839 04-21-2016, 05:41 AM
Last Post: DerVVulfman
   DoubleX RMMV Permanent States DoubleX 4 8,272 12-02-2015, 08:48 AM
Last Post: DoubleX
   DoubleX RMVXA Permanent States DoubleX 1 5,454 07-21-2015, 01:19 PM
Last Post: DoubleX
   Tiered States MechanicalPen 10 16,157 08-08-2013, 03:36 AM
Last Post: Karindanslav
   States : Toggle Kain Nobel 0 4,511 10-09-2012, 05:22 PM
Last Post: Kain Nobel
   States : Spread Kain Nobel 0 4,273 10-09-2012, 05:04 PM
Last Post: Kain Nobel
   Victor Engine - Action States Victor Sant 0 4,216 07-17-2012, 05:04 AM
Last Post: Victor Sant



Users browsing this thread: