Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Tiered States
#10
I could certainly try to make it work for VX Ace. It's not that complicated of a system I just need to know how VX Ace applies states.

Edit: Dowloaded VX Ace Lite just for you. It is both less and more confusing than RPG Maker XP.

So, try this; I have no way to test if it works, so let me know.
Code:
#=============================================================================
# * Tiered States
#=============================================================================
#===============================================================================??
# ** RPG::State
#===============================================================================??

class RPG::State
  #-----------------------------------------------------------------------------
  # * Tiered States
  #     States are applied left to right, starting at the state before the =>.
  #
  # The example provided allows for negative states (stat-downs) to be
  # counteracted by positive states (stat-ups)
  #-----------------------------------------------------------------------------
  Tiered_States = {
                  20 => [24, 23, 22, 21, 20, 19, 18],
                  22 => [18, 19, 20, 21, 22, 23, 24]
                  }
  #-----------------------------------------------------------------------------
  # * has Tiered State?
  #-----------------------------------------------------------------------------
  def tiered?
    Tiered_States.include?(@id)
  end
  #-----------------------------------------------------------------------------
  # * How many tiers?
  #-----------------------------------------------------------------------------
  def tiers
    return Tiered_States.fetch(@id, [])
  end  

end
#===============================================================================??
# ** Game_Battler
#===============================================================================??

class Game_Battler
  #-----------------------------------------------------------------------------
  # * Alias Listings
  #-----------------------------------------------------------------------------
  alias_method :mpen_default_add_state, :add_state
  #-----------------------------------------------------------------------------
  # * Add State
  #-----------------------------------------------------------------------------
  def add_state(state_id)
    if $data_states[state_id].tiered?
      
      for i in 0...$data_states[state_id].tiers.size
        current_tier = $data_states[state_id].tiers[i]
        next_tier = $data_states[state_id].tiers[i+1]
        if self.state?(current_tier)
          if next_tier == nil
            #tier at maximum, regular state rules apply
            mpen_default_add_state(current_tier)
            return
          else
            remove_state(current_tier)
            mpen_default_add_state(next_tier)
            return
          end
        end
      end
      #no tiers applyed yet, default behavior.
      mpen_default_add_state(state_id)
    else
      #no tiers exist, default behavior
      mpen_default_add_state(state_id)
    end
  end
  
end
Reply }


Messages In This Thread
Tiered States - by MechanicalPen - 04-27-2013, 05:12 AM
RE: Tiered States - by MetalRenard - 04-27-2013, 10:15 AM
RE: Tiered States - by yamina-chan - 04-27-2013, 01:14 PM
RE: Tiered States - by MechanicalPen - 04-27-2013, 06:47 PM
RE: Tiered States - by yamina-chan - 04-27-2013, 09:06 PM
RE: Tiered States - by MetalRenard - 04-28-2013, 12:08 AM
RE: Tiered States - by MechanicalPen - 04-28-2013, 12:19 AM
RE: Tiered States - by Karindanslav - 08-07-2013, 10:52 PM
RE: Tiered States - by Ahzoh - 08-07-2013, 11:48 PM
RE: Tiered States - by MechanicalPen - 08-08-2013, 12:08 AM
RE: Tiered States - by Karindanslav - 08-08-2013, 03:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   KDamage States Edition kyonides 0 569 06-29-2023, 02:20 AM
Last Post: kyonides
   Kolloseum States XP kyonides 55 64,769 02-26-2019, 08:28 AM
Last Post: kyonides
   Unalterable States DerVVulfman 0 3,684 01-22-2019, 01:04 AM
Last Post: DerVVulfman
   States : Expiration States Kain Nobel 1 5,982 01-26-2017, 09:45 PM
Last Post: Noctis
   DVV's States Rotation DerVVulfman 5 8,973 04-21-2016, 05:41 AM
Last Post: DerVVulfman
   DoubleX RMMV Permanent States DoubleX 4 8,385 12-02-2015, 08:48 AM
Last Post: DoubleX
   DoubleX RMVXA Permanent States DoubleX 1 5,535 07-21-2015, 01:19 PM
Last Post: DoubleX
   States : Toggle Kain Nobel 0 4,574 10-09-2012, 05:22 PM
Last Post: Kain Nobel
   States : Spread Kain Nobel 0 4,333 10-09-2012, 05:04 PM
Last Post: Kain Nobel
   Victor Engine - Action States Victor Sant 0 4,283 07-17-2012, 05:04 AM
Last Post: Victor Sant



Users browsing this thread: