Help! Need Armor to Increase Escape Rate

ohwowrelz

Warper
Member
Joined
Apr 14, 2013
Messages
2
Reaction score
0
Primarily Uses
I am trying to create an accessory that, when equipped, increases the chance to escape battles. 

I can't figure out how to create the armor using events, or find a script that will help me.

If you can help in any way that would be much appreciated, thank you! 
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
By default, AGI affects Escape Ratio. It's found in BattleManager.

  #--------------------------------------------------------------------------

  # * Create Escape Success Probability

  #--------------------------------------------------------------------------

  def self.make_escape_ratio

    @escape_ratio = 1.5 - 1.0 * $game_troop.agi / $game_party.agi

  end

 

Feel free to change it to work with other stats and such.

Maybe use Luck instead of AGI or something for like a custom idea (and then giving enemies 0 Luck and the special armor a Luck boost)
 
Last edited by a moderator:

ohwowrelz

Warper
Member
Joined
Apr 14, 2013
Messages
2
Reaction score
0
Primarily Uses
By default, AGI affects Escape Ratio. It's found in BattleManager.

  #--------------------------------------------------------------------------

  # * Create Escape Success Probability

  #--------------------------------------------------------------------------

  def self.make_escape_ratio

    @escape_ratio = 1.5 - 1.0 * $game_troop.agi / $game_party.agi

  end

 

Feel free to change it to work with other stats and such.

Maybe use Luck instead of AGI or something for like a custom idea (and then giving enemies 0 Luck and the special armor a Luck boost)
What would I change if I wanted to make it use Magic Attack instead of Agility?
 

DuncanS

Veteran
Veteran
Joined
Sep 18, 2013
Messages
160
Reaction score
96
First Language
English
Primarily Uses
If you want to use the same formula, just with Magic Attack, change

@escape_ratio = 1.5 - 1.0 * $game_troop.agi / $game_party.agito

enemies = $game_troop.membersparty = $game_party.members return 1 if party.size == 0 || enemies.size == 0 enemy_avg_mat = enemies.inject(0) { |r, enemy| r += enemy.mat } / enemies.size party_avg_mat = party.inject(0) { |r, member| r += member.mat } / party.size @escape_ratio = 1.5 - 1.0 * enemy_avg_mat / party_avg_matIt's a lot longer because agi is actually a method in Game_Unit that calculates the average agility of a Game_Unit. You could include a similar method in Game_Unit too:

#--------------------------------------------------------------------------# * Calculate Average Value of Magic Attack#--------------------------------------------------------------------------def mat return 1 if members.size == 0 members.inject(0) {|r, member| r += member.mat } / members.sizeendAnd the function then becomes

#--------------------------------------------------------------------------# * Create Escape Success Probability#--------------------------------------------------------------------------def self.make_escape_ratio @escape_ratio = 1.5 - 1.0 * $game_troop.mat / $game_party.matendHopefully that answers your question!

Cheers,

Duncan
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,017,004
Members
137,562
Latest member
tamedeathman
Top