=begin #============================================================================== ** Feature: Passive States Author: Hime Date: Apr 9, 2014 ------------------------------------------------------------------------------ ** Change log Apr 9, 2014 - updated to latest API Nov 4, 2012 - initial release ------------------------------------------------------------------------------ ** Terms of Use * Free to use in non-commercial projects * Contact me for commercial use * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Preserve this header ------------------------------------------------------------------------------ ** Required -Feature Manager (http://himeworks.com/2012/10/13/feature-manager) ------------------------------------------------------------------------------ Allows you to have passive states that are always active. Tag object with Where `id` is the state ID to add #============================================================================== =end $imported = {} if $imported.nil? $imported["Feature_PassiveStates"] = true #============================================================================== # ** Rest of the script #============================================================================== module Features module Passive_States FeatureManager.register(:passive_state, 1.23) end end class RPG::BaseItem def add_feature_passive_state(code, data_id, args) arg = args[0].to_i add_feature(code, 0, arg) end end # Looking for an efficient way to implement states without checking every update class Game_Actor < Game_Battler # This is the easiest way to do it, but computationally expensive alias :ft_passive_states_remove_state :remove_state def remove_state(state_id) return if features_value_set(:passive_state).include?(state_id) ft_passive_states_remove_state(state_id) end alias :ft_passive_states_setup :setup def setup(actor_id) ft_passive_states_setup(actor_id) add_passive_states end def add_passive_states return [] unless @actor_id features_value_set(:passive_state).each {|id| add_state(id) } end end