Is it possible to extend/alter a state's duration in battle?

● ARCHIVED · READ-ONLY
Started by Theguysayshi 3 posts View original ↗
  1. Hi there,

    Each state has a set turn duration, but I was wondering if it can be extended via a scripts so they can last longer or shorter depending on the battle.

    Once such problem is when using a move that gives you many positive states for one turn, but the states stand alone last for longer. The script would be used to change the duration accordingly.

    I was wondering if there is a script that exists such as "extendstate([actor],[stateno.],[turnduration])" that would be able to alter the length of a state on any actor at when called.

    I've noticed the code in the "Game_Battler" section of the script but I'm not sure how to link to an actor nor alter anything contained in it.

    #--------------------------------------------------------------------------
    # * Update State Turn Count
    #--------------------------------------------------------------------------
    def update_state_turns
    states.each do |state|
    @state_turns[state.id] -= 1 if @state_turns[state.id] > 0
    end
    end

    Is something like this possible? I'm not sure how to tackle it. Many thanks in advance if someone can help.
  2. You could make a new method to extend the duration of the states. Like
    Code:
    class Game_Battler
      def extend_state(state_id, dur)
        @state_turns[state_id] += dur if @state_turns[state_id]
      end
    end
    And what you do just use damage formula, like
    Code:
    a.extend_state(5, 1)
    To extend state 5 for one more turn
  3. Thank you! I had no idea how to edit state values, so I wasn't sure how to get around it.

    Thank you so much! Now I know.