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 XP kyonides 0 1,008 06-29-2023, 02:20 AM
Last Post: kyonides
   Kolloseum States XP kyonides 55 72,012 02-26-2019, 08:28 AM
Last Post: kyonides
   States : Expiration States Kain Nobel 1 6,678 01-26-2017, 09:45 PM
Last Post: Noctis
   DVV's States Rotation DerVVulfman 5 9,953 04-21-2016, 05:41 AM
Last Post: DerVVulfman
   Tiered States MechanicalPen 10 18,229 08-08-2013, 03:36 AM
Last Post: Karindanslav
   States : Toggle Kain Nobel 0 4,974 10-09-2012, 05:22 PM
Last Post: Kain Nobel
   States : Spread Kain Nobel 0 4,783 10-09-2012, 05:04 PM
Last Post: Kain Nobel
   States : Spread Kain Nobel 2 6,253 07-10-2012, 04:44 PM
Last Post: Kain Nobel
   Kristina's Map States DerVVulfman 1 6,153 06-30-2010, 09:33 AM
Last Post: Nadim
   States Activation System aka State-Based Passive Augments, Version 0.2 Charlie Fleed 7 12,829 03-06-2010, 09:26 PM
Last Post: fgsfds



Users browsing this thread: 1 Guest(s)