Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Defend puts state on actor

Save-Point

Full Version: Defend puts state on actor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello :)
In RMXP there is no actual explanastion for a player what "Defend" does.
I know it changing damage mulpiplier /2 (mostly). Player is sometimes confused is it even working.
What if i want more? Defend is useless in almost every battles right now.
Sooo i figured out that it could automaticly puts a state on actor and regenerate little sp.
That state could for example protect actor from other 'bad states' and rise all elements resistance.
That would be much better :)
I was already experimenting. I modificated Game_Battler 1 in line 298
before:
Code:
def guarding?
return (@current_action.kind == 0 and @current_action.basic == 1)
  end
after:
Code:
def guarding?
return (@current_action.kind == 0 and @current_action.basic == 1 and add_state(78) and self.sp += 10)
  end

but its working after enemy attack player so its useless i think. Also it regenerates full sp except 10 i dont know why
(i've tryed also making it like (x=@sp+10 and self.sp = x) not working)

Someone have some solution?
This is the function when battlers're attacking
You should find the function that define when you clicks on defend action
(02-09-2017, 01:57 PM)Whisper Wrote: [ -> ]In RMXP there is no actual explanastion for a player what "Defend" does.
I know it changing damage mulpiplier /2 (mostly). Player is sometimes confused is it even working.

First, yeah....  the magic of the guarding state is that the 'attack_effect/skill_effect/item_effect' methods within the Game_Battler class cuts the damage by half.  Still... it's not that you can SEE that the battler is guarding.

Well... unless you're using a sideview battlesystem that lets the battler choose a 'blocking/guarding/shield-raising' pose, or have some text pop that says 'Freddy is defending'.  So perhaps making a status effect appear over the battler (if even one that does nothing) might be helpful.

BUT... the area you were looking to edit only looks to see if the battler is guarding/defending.  It doesn't turn the guarding effect on for the battler. 

Now you're wanting it for the default battle system I am guessing.  And with that, the best place to perform an edit would likely be within the 'make_action_orders' method of Scene_Battle 4. That way, all decisions would have been made (no chance of changing minds).  Note the below code:

Code:
  def make_action_orders

    # Initialize @action_battlers array
    @action_battlers = []
    # Add enemy to @action_battlers array
    for enemy in $game_troop.enemies
      @action_battlers.push(enemy)
    end
    # Add actor to @action_battlers array
    for actor in $game_party.actors
      @action_battlers.push(actor)
    end
    # Decide action speed for all
    for battler in @action_battlers
      # MY CODE EDIT-------------
      if battler.current_action.kind == 0 && battler.current_action.basic == 1
        battler.add_state(4)
      end
      # END OF MY EDIT-------------
      battler.make_action_speed
    end
    # Line up action speed in order from greatest to least
    @action_battlers.sort! {|a,b|
      b.current_action.speed - a.current_action.speed }
  end

Now, the edit adds state 4 from the database.  You COULD add a blank state that only has a shield-drawing popup over the hero that is released at the end of battle... one that ends after the battle turn. 

Including a regen state...  perhaps you can find a regen state script to include.  Perhaps this little addition to show the hero is defending is enough for now.
Thank You :)