state: battler moving last, not affecting agi. How?

i want to make a state that makes the battler its applied to move last. yet since i use agi as deffense in some formulas i dont want that affected. how do i do this?


also, as an after thought, if two battlers have this state, the one with the higher agi will move before the other
Here's the script that deals with Action Speed in Game_Action:

Code:
  #--------------------------------------------------------------------------
  # * Calculate Action Speed
  #--------------------------------------------------------------------------
  def speed
    speed = subject.agi + rand(5 + subject.agi / 4)
    speed += item.speed if item
    speed += subject.atk_speed if attack?
    speed
  end

I believe you can add a line anywhere below the first and above the last line of the method, to handle this state.  For example:

Code:
  #--------------------------------------------------------------------------
  # * Calculate Action Speed
  #--------------------------------------------------------------------------
  def speed
    speed = subject.agi + rand(5 + subject.agi / 4)
    speed -= 25000 if subject.state?(37)
    speed += item.speed if item
    speed += subject.atk_speed if attack?
    speed
  end

Replace 37 with the ID of the State.  Let me know if this doesn't work (but first do a search throughout your scripts for "def speed" to make sure that no other scripts are overwriting this change).
how do you search scripts for keywords again? I dont think any of my scripts are interfering, but i still want to check anyway


i think with that question i made it obvious what the result was

Original thread: https://forums.rpgmakerweb.com/threads/state-battler-moving-last-not-affecting-agi-how.57150/