RMXP STATS
What the stats does and some tips in assigning stats
- Crystalgate
- 07/29/2011 06:18 PM
- 26938 views
Introduction
Whenever someone asks about RMXP stats, there will always be an inaccurate answer. It never fails, I've yet to see someone asking about RMXP stats and not receive an inaccurate answer. The reason for this is probably a combination of the RMXP stats being a bit of a mess and the tooltip being of limited help. So, hopefully this tutorial can shed some light on how RMXP stats work.
The stats
ATK:
ATK influences the damage of standard attacks and skills can be set to have their damage influenced by ATK as well.
The average damage for standard attacks is:
Damage may be up to 15% higher or lower than average.
The average damage for skills is:
Damage may be up to Skill Variance percent higher or lower than average.
PDEF:
PDEF reduces the damage of standard attacks and skills with a PDEF-F higher than zero. For standard attacks, a PDEF equal to the attackers ATK will reduce damage to half (ignoring the rounding that occurs if PDEF is an odd number) and a PDEF twice that of the attackers ATK will completely negate the damage. With those two examples as guidelines, you should be able to estimate how much impact PDEF will have with other values.
MDEF:
MDEF reduces the damage of skills with an MDEF-F higher than zero. Normally, that means spells, but RMXP doesn't force you to make it so. However, if you design spells like the default spells are designed, an MDEF equal to the skill's Power will cut the damage to half (again, ignoring some rounding) and an MDEF twice of the skill's Power will completely negate the damage.
EVA:
EVA influences your chance of evading standard attacks and skills with an EVA-F higher than zero. For standard attacks, the chance to evade is ( 8*Target’s AGI/Attacker’s DEX + Target’s EVA)%. For skills, take that chance and multiply it with the EVA-F of the skill and then divide with 100.
Typically, expect the chance of evading standard attacks to be around 5-10% higher than EVA.
STR:
STR influences the damage standard attacks and skills with a STR-F higher than zero deals. Check ATK for the exact formula. Do note that the amount of damage you deal is proportional to STR + 20, so it's best to think of STR as being 20 points higher than it actually is when comparing how strong the characters are, especially if you're going for low stats.
DEX:
DEX affects you accuracy with standard attacks and skills with an EVA-F higher than zero, your chance to score a critical hit with standard attacks and also affects the damage skills with a DEX-F higher than zero deals.
Check EVA for how the chance of evading is calculated. Note that while DEX affects how accurate you are, it does a poor job of it. Having a high DEX will reduce how much the target's AGI influences evasion, but not how much influence it's EVA has. The problem is, usually it's EVA that has the greater influence on evasion. As it is, if you make a thief with a DEX of 80 and a fighter with a DEX of 40, the player will not even notice that the thief is more accurate.
The chance of scoring a critical hit is (4*Attacker‘s DEX/Target‘s AGI)%. This only works for standard attacks.
Generally speaking, unless you create DEX based skills, DEX is a very weak stat.
AGI:
AGI affects turn order, your chance of evading standard attacks and skills with an EVA-F greater than zero, how likely you are to suffer critical hits, the success rate of the escape command and also affects the damage of skills with an AGI-F greater than zero.
Turn order is usually the most important function of AGI. Turn order is decided by taking the character’s AGI and to that number adding a random value from 0 to (10+AGI/4)-1. Note that if you're going for low stats, the 10 in the equation tends to make turn order very random. A trick you can use if you just want to wing it is to add 40 to the characters' actual AGI scores and then compare them. So, if one character has an AGI of 1 and another an AGI of 2, think of it as 41 vs. 42.
Chance to hit and chance to suffer a critical hit is covered by EVA and DEX. However, don't expect any of those functions to add much value to the AGI stat.
You chance of escaping is (50*average character AGI/average enemy AGI)%.
INT:
INT affect the damage of skills with an INT-F higher than zero. Typically, that means spells which makes INT for mages what STR is for fighters.
Statting tips
The first tip I have is; don't go for low stats. The algorithm isn't build for that. Having 5 STR instead of just 3 doesn't increase the damage you deal in a meaningful way, like having 50 STR instead of just 30 does. Further, turn order will get extremely randomized. A character with 40 AGI is always faster than one with 20 AGI, but with 4 AGI vs. 2 AGI, it's barely even noticeable that one of them is faster than the other.
The second tip I have is not to let MDEF increase to fast unless you have a lot of tiers of spells. Let's say an early game enemy has an MDEF of 10 and a late game enemy an MDEF of 200. The characters will then need to upgrade to a higher tier spell rapidly, like maybe every dungeon at the beginning and every other later on. If you make PDEF increase fast, the characters will also need to upgrade weapons rapidly, but typically it's easier to give characters new weapons every town than it is to give them new spells all the time. There are ways around this problem, but if you know those ways, chance is you don't need my tips to begin with.
Finally, EVA does not scale like the other stats. An accessory that grants +10 STR is more impressive at the beginning of a game when you only have, say 30 of it, than late game when you already have 150 of it. The same goes for every stat except EVA. 30 EVA makes you just as evasive late game as it makes you early game.
Conclusion
It's very common that I play a game and within the first ten minutes notices that whoever made the game doesn't know what the stats actually does. So, I hope this tutorial will help some people getting the statting right. When you give your characters and their equipment stats, please think a step further than "I want the thief to be more dexterous than the fighter, so let's give her 1,5 times as much DEX" and also consider the mechanical effects your decision will have.
Whenever someone asks about RMXP stats, there will always be an inaccurate answer. It never fails, I've yet to see someone asking about RMXP stats and not receive an inaccurate answer. The reason for this is probably a combination of the RMXP stats being a bit of a mess and the tooltip being of limited help. So, hopefully this tutorial can shed some light on how RMXP stats work.
The stats
ATK:
ATK influences the damage of standard attacks and skills can be set to have their damage influenced by ATK as well.
The average damage for standard attacks is:
Damage = (Attacker’s ATK - [Target’s PDEF/2]) * (20+Attacker's STR) / 20
Damage may be up to 15% higher or lower than average.
The average damage for skills is:
Damage = (Skill Power + [Attacker’s ATK*Skill ATK-F/100] - [Target‘s PDEF*Skill PDEF-F/200]
- [Target‘s MDEF*Skill MDEF-F/200]) * (20 + [Attacker’s STR*Skill STR-F/100] +
[Attacker’s DEX*Skill DEX-F/100] + [Attacker’s AGI*Skill AGI-F/100] + [Attacker’s INT*Skill INT-F/100]) / 20
Damage may be up to Skill Variance percent higher or lower than average.
PDEF:
PDEF reduces the damage of standard attacks and skills with a PDEF-F higher than zero. For standard attacks, a PDEF equal to the attackers ATK will reduce damage to half (ignoring the rounding that occurs if PDEF is an odd number) and a PDEF twice that of the attackers ATK will completely negate the damage. With those two examples as guidelines, you should be able to estimate how much impact PDEF will have with other values.
MDEF:
MDEF reduces the damage of skills with an MDEF-F higher than zero. Normally, that means spells, but RMXP doesn't force you to make it so. However, if you design spells like the default spells are designed, an MDEF equal to the skill's Power will cut the damage to half (again, ignoring some rounding) and an MDEF twice of the skill's Power will completely negate the damage.
EVA:
EVA influences your chance of evading standard attacks and skills with an EVA-F higher than zero. For standard attacks, the chance to evade is ( 8*Target’s AGI/Attacker’s DEX + Target’s EVA)%. For skills, take that chance and multiply it with the EVA-F of the skill and then divide with 100.
Typically, expect the chance of evading standard attacks to be around 5-10% higher than EVA.
STR:
STR influences the damage standard attacks and skills with a STR-F higher than zero deals. Check ATK for the exact formula. Do note that the amount of damage you deal is proportional to STR + 20, so it's best to think of STR as being 20 points higher than it actually is when comparing how strong the characters are, especially if you're going for low stats.
DEX:
DEX affects you accuracy with standard attacks and skills with an EVA-F higher than zero, your chance to score a critical hit with standard attacks and also affects the damage skills with a DEX-F higher than zero deals.
Check EVA for how the chance of evading is calculated. Note that while DEX affects how accurate you are, it does a poor job of it. Having a high DEX will reduce how much the target's AGI influences evasion, but not how much influence it's EVA has. The problem is, usually it's EVA that has the greater influence on evasion. As it is, if you make a thief with a DEX of 80 and a fighter with a DEX of 40, the player will not even notice that the thief is more accurate.
The chance of scoring a critical hit is (4*Attacker‘s DEX/Target‘s AGI)%. This only works for standard attacks.
Generally speaking, unless you create DEX based skills, DEX is a very weak stat.
AGI:
AGI affects turn order, your chance of evading standard attacks and skills with an EVA-F greater than zero, how likely you are to suffer critical hits, the success rate of the escape command and also affects the damage of skills with an AGI-F greater than zero.
Turn order is usually the most important function of AGI. Turn order is decided by taking the character’s AGI and to that number adding a random value from 0 to (10+AGI/4)-1. Note that if you're going for low stats, the 10 in the equation tends to make turn order very random. A trick you can use if you just want to wing it is to add 40 to the characters' actual AGI scores and then compare them. So, if one character has an AGI of 1 and another an AGI of 2, think of it as 41 vs. 42.
Chance to hit and chance to suffer a critical hit is covered by EVA and DEX. However, don't expect any of those functions to add much value to the AGI stat.
You chance of escaping is (50*average character AGI/average enemy AGI)%.
INT:
INT affect the damage of skills with an INT-F higher than zero. Typically, that means spells which makes INT for mages what STR is for fighters.
Statting tips
The first tip I have is; don't go for low stats. The algorithm isn't build for that. Having 5 STR instead of just 3 doesn't increase the damage you deal in a meaningful way, like having 50 STR instead of just 30 does. Further, turn order will get extremely randomized. A character with 40 AGI is always faster than one with 20 AGI, but with 4 AGI vs. 2 AGI, it's barely even noticeable that one of them is faster than the other.
The second tip I have is not to let MDEF increase to fast unless you have a lot of tiers of spells. Let's say an early game enemy has an MDEF of 10 and a late game enemy an MDEF of 200. The characters will then need to upgrade to a higher tier spell rapidly, like maybe every dungeon at the beginning and every other later on. If you make PDEF increase fast, the characters will also need to upgrade weapons rapidly, but typically it's easier to give characters new weapons every town than it is to give them new spells all the time. There are ways around this problem, but if you know those ways, chance is you don't need my tips to begin with.
Finally, EVA does not scale like the other stats. An accessory that grants +10 STR is more impressive at the beginning of a game when you only have, say 30 of it, than late game when you already have 150 of it. The same goes for every stat except EVA. 30 EVA makes you just as evasive late game as it makes you early game.
Conclusion
It's very common that I play a game and within the first ten minutes notices that whoever made the game doesn't know what the stats actually does. So, I hope this tutorial will help some people getting the statting right. When you give your characters and their equipment stats, please think a step further than "I want the thief to be more dexterous than the fighter, so let's give her 1,5 times as much DEX" and also consider the mechanical effects your decision will have.
Posts
Pages:
1
For magic spells, Power basically replace ATK and this is (to my mind) the main problem with XP default formula, because it forces you to have tiered spells. While for physical skills, Power is just added to ATK, a stat which is weapon-dependant.
That's definitely one of the problems with the default XP formulas and maybe even the main problem. But there's definitely a lot more problems.
XP by default gives you more control over more stats than the other engines. However, often you don't get to manipulate them in a satisfactory way. For example, the other engines have one stat for both casting magic and magic defense. XP has one stat which makes you better at casting spells and another stat for magic defense. This decision I approve off. The problem is, MDEF is an equipment only stat, while INT raises as the character levels up. Also, MDEF lowers the base damage while INT increases the rate. This means that while they do offset each other, they do so in an unnecessarily complicated way.
XP by default gives you more control over more stats than the other engines. However, often you don't get to manipulate them in a satisfactory way. For example, the other engines have one stat for both casting magic and magic defense. XP has one stat which makes you better at casting spells and another stat for magic defense. This decision I approve off. The problem is, MDEF is an equipment only stat, while INT raises as the character levels up. Also, MDEF lowers the base damage while INT increases the rate. This means that while they do offset each other, they do so in an unnecessarily complicated way.
Maybe, but I wouldn't know. RMXP already has enough stats for any system I've thought up so far, so I usually just change what they do rather than add new stats.
The INT-F value of a skill determines how useful INT is in determining damage or healing. INT-F percent of the actor's INT is used to compute damage, so if you set it to just 1, only 1% of the actors INT will be used.
Generally, you should set INT-F to 100 for offensive spells and 0 for skills that aren't offensive- or healing spells. For healing spells, try 100 or 50, whatever gives the best result.
Generally, you should set INT-F to 100 for offensive spells and 0 for skills that aren't offensive- or healing spells. For healing spells, try 100 or 50, whatever gives the best result.
I don't know if this is the best way to do things but...
Iv set it so magic attacks scale with ATK as well.
Now I did a few tests and noticed that if ATK and PDEF are roughly the same they will mostly counter out each other. Which is where STR or INT comes in for pushing it over into real damage.
So I set the power to 1 and have an ATK-F of 100 and then either STR or int
Try these out yourself if you want.
First test a physical attack and notice the difference. Then try an ability that has a power of 1 set to use STR or INT as well as attack and notice the difference.
By doing this enables you to have spells which scale with gear. And you can always have tiered spells by simply giving them power on top of atk.
Look at this example
Character 1
HP :1000
ATK: 50
STR: 200
INT: 10
DEX: 100
AGI: 100
PDEF:100
MDEF:100
Character 2
HP :1000
ATK: 50
STR: 10
INT: 200
DEX: 100
AGI: 100
PDEF:100
MDEF:100
Monster
HP:2000
ATK: 50
STR: 100
INT: 100
DEX: 100
AGI: 100
PDEF: 50
MDEF: 50
(I know this is old but I found it through google so it may help people out if they find it that way.)
Iv set it so magic attacks scale with ATK as well.
Now I did a few tests and noticed that if ATK and PDEF are roughly the same they will mostly counter out each other. Which is where STR or INT comes in for pushing it over into real damage.
So I set the power to 1 and have an ATK-F of 100 and then either STR or int
Try these out yourself if you want.
First test a physical attack and notice the difference. Then try an ability that has a power of 1 set to use STR or INT as well as attack and notice the difference.
By doing this enables you to have spells which scale with gear. And you can always have tiered spells by simply giving them power on top of atk.
Look at this example
Character 1
HP :1000
ATK: 50
STR: 200
INT: 10
DEX: 100
AGI: 100
PDEF:100
MDEF:100
Character 2
HP :1000
ATK: 50
STR: 10
INT: 200
DEX: 100
AGI: 100
PDEF:100
MDEF:100
Monster
HP:2000
ATK: 50
STR: 100
INT: 100
DEX: 100
AGI: 100
PDEF: 50
MDEF: 50
(I know this is old but I found it through google so it may help people out if they find it that way.)
Here's a link to my low stats algorithm. It solved everything.
http://forum.chaos-project.com/index.php/topic,12756.0.html
Here is te script below too:
#------------------------------------------------------------------------------
#
# ***** Customized Battle Algorithm *****
#
#------------------------------------------------------------------------------
#
# There are a few important things to note about this script. The default
# setup of this script will work well with static settings for str, int, dex,
# agi, and evade. This means that when you use the database, in the Actors tab,
# double-click on each of these attributes(except for evade, that comes later)
# and select the 'generate curve' option. From the ranges of level 1 to level 99,
# you should set the values to be the same on both ends. This means that only
# weapons, armor, items, and level will increase. Also, by the default system,
# something like unarmed combat will be based on the static str value and level
# at the time. You can find the actual modification below, but it looks like
# this:
#
# self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
#
# As you might notice, this also applied to the enemy. The enemy does not have
# a level attribute by default, this is why when naming an enemy, it is VERY
# VITAL that you append the enemy's name with the level value. This will have
# a great bearing on how strong or weak the enemy will be. So, naming a few
# enemies would look like this:
#
# ** (NOTICE LEVELS 1 - 9 NEED A "0" BEFORE THE SINGLE DIGIT) **
#
# slime_01 <= Level one slime
#
# vampire_09 <= Level 9 vampire
#
# boss_23 <= Level 23 boss
# ** Make sure and DON'T FORGET THE UNDERSCORE! "_" **
#
# How high you set the level is ultimately up to you, but keeping the levels
# close to your party average is a relatively good gauge because of the level's
# impact on the attacker's strength. Also, this will only read between levels
# 1 - 99. If you want to use 3 digit levels, it's a pretty easy fix. I wouldn't
# suggest the damage cap at 9999 for that however..
#
#
#
# I will give detailed step by step instructions below.
#
#------------------------------------------------------------------------------
# Debug
#------------------------------------------------------------------------------
# To view your evade run: Custom_Algo_Debug.show_player_evade
#
# To view your enemy level, make a common event and put this script inside it.
#
# Custom_Algo_Debug.show_enemy_levels
#
# Then, create an item and call it "Debug". Have the item run the common event
# you just created during battle. This will list the enemy levels to make sure
# that everything is running smoothly.
#------------------------------------------------------------------------------
# Configuration
#------------------------------------------------------------------------------
# This is where you can customize the following elements:
#
# - Set enemy level
# - Set a Damage Cap
# - custom hp/sp growth curve
# - custom static evasion attribute
# - Enemies Adapt To Average Party Level(think Skyrim/Oblivion)
#
#
#------------------------------------------------------------------------------
# SET ENEMY LEVEL BY NAME
#
# To set enemy level by name, put the enemy name in the database followed by
# an underscore and the two-digit level number. There is a detailed explanation
# above, but here is a quick example anyway.
# slime_09 = slime, level 9
# vampire_23 = vampire, level 23
#
SET_ENEMY_LEVEL = true #use this to turn on and off.
#CANNOT BE USED WITH ADAPTIVE ENEMY LEVEL!!!!!!!
#
# if set to false, the enemy level will default to 1. DO NOT MIX WITH
# ADAPTIVE_ENEMY_LEVEL switch!!! If so, you will see a warning and the game will
# not run properly and return to default settings.
#------------------------------------------------------------------------------
# ADAPTIVE ENEMY LEVEL
#
ADAPTIVE_ENEMY_LEVEL = false #turn this on and off here.
#CANNOT BE USED WITH SET_ENEMY_LEVEL!!!!!!!!!!!!
# This will make each enemy level adapt to your party average.
# I will be adding a random variance feature in the near future.
#------------------------------------------------------------------------------
# CAP DAMAGE
#
# To set a damage cap so that anything (< or = x) will be at a cap_damage_limit
#
CAP_DAMAGE = true #set to false to turn off or true to turn on.
CAP_DAMAGE_LIMIT = 9999 # the number to cap the damage at.
#------------------------------------------------------------------------------
# CUSTOM BASE HP/SP and GROWTH CURVE
SET_HP_SP_GAIN_CURVE = true #to turn this feature on and off.
#This is to set your starting HP/SP. The elements are referenced by class_id.
#There should be as many elements as there are classes in your game. You can
#easily add an element by adding a value and seperating it with a comma. I
#would suggest setting a base hp and mp at the same time, otherwise it will
#default to the database.
# If you choose to use this, it will override the
# database hp and sp values and they will be rendered useless.
$custom_max_hp_base =
$custom_max_sp_base =
# This is to set the growth speed. Each element represents what is added to
# the max hp/sp after a level up. Each array element corresponds to its level.
# NOTICE the first element is a ZERO. KEEP THE FIRST ELEMENT A ZERO or you will
# possibly break stuff.
$custom_level_growth_hp =
$custom_level_growth_sp =
#------------------------------------------------------------------------------
# CUSTOM STARTING/STATIC EVA PERCENTAGE
SET_STATIC_EVADE = true #put false to turn this feature off.
# This will set a constant eva value for each class that will be there without
# weapons or armor. Weapons and armor will still add a bonus accordingly.
# Each element in the array is referenced by class_id. To add an element,
# simply add another value seperated by a comma as shown below.
$static_eva_percentage =
#------------------------------------------------------------------------------
#
#
#------------------------------------------------------------------------------
# Suggestions / Notes
#------------------------------------------------------------------------------
#
# My notes/suggestions
#-------------------------------------------------------------------------------
#Physical Attack Addition:
#
# Much like some FF games, the level plays a part in the progression.
#
# Here is the physical attack formula:
#
# self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
#
#
#-------------------------------------------------------------------------------
# PHYSICAL ATTACKS:
# Physical Attack vs. Physical Defense
# 1. Physical defense that is 200% of Attack yields 0% damage.
# 2. Physical defense that is 150% of Attack yields 25% damage.
# 3. Physical defense that is 100% of Attack yields 50% damage.
# 4. Physical defense that is 50% of Attack yields 75% damage.
# 5. Physical defense that is 1% of Attack yields 100% damage.
#------------------------------------------------------------------------------
# CRITICAL PERCENTAGES:
#Attacker Dexterity vs. Defender Agility
# 1. if agility is same as dex, critical% = 4
# 2. if agility is 1/2 of dex, critical% = 8
# 3. if agility is 1/4 of dex, critical% = 16
# 4. if agility is 1/8 of dex, critical% = 32
# 5. and so on..
#------------------------------------------------------------------------------
# EVADE PERCENTAGES:
#Evade pretty much stays the same regardless of Dexterity.
# Evade value = rough percentage of chance to evade attack.
#------------------------------------------------------------------------------
# SKILL POWER BREAKDOWN:
#we are using:
# power * rate / 20 * user.level / 2
#Skill power with no -F(forces) added is exactly (power * level / 2)
#------------------------------------------------------------------------------
# MAGIC BASED ATTACKING SKILLS:
#Attack Skills with INT-F added:
#For magic, I suggest using a INT-F setting of 50.
# 1. Skill power with INT-F of 100% yields a degradation of 1/6 per 10
# attribute points.
# 2. Skill power with INT-F of 50% yields a degradation of 1/8 per 10
# attribute points.
# 3. Skill power with INT-F of 25% yields a degradation of 1/10 per 10
# attribute points.
#------------------------------------------------------------------------------
# PHYSICAL BASED ATTACKING SKILLS:
#For skills that slightly strenghthen attacks do the following, or something
#close to it:
#Power = 10
#ATK-F = 100
#EVA-F = ? If you want them to be evaded possibly, then set to 100.
#STR-F = 100
#DEX-F = ?
#INT-F = 0
#Hit Rate = ? This is useless if set_static_evade = true
#PDEF-F = 100
#MDEF-F = 0
#Variable = 15
# This type of setting is good for skills that grow with the player.
# They will be a bit strong at first, but they won't become obsolete quickly
# or at all like in a lot of games.
# If you desire a more tier style layout, try laying off of the ATK-F and maybe
# the PDEF-F as well...
#------------------------------------------------------------------------------
# HEALING BASED SKILLS
#
# Healing Skills will render almost exactly the same negative damage(Healing)
# as an attacking spell will render with positive damage(attack). This is
# obviously taking into account that the INT-F is the same in both cases.
#
#------------------------------------------------------------------------------
# Minimum and Maximum ranges for stuff:
#Mininum would be someone weaker with a certain attribute like INT for a knight
#or STR for a wizard.
#Max is opposite. I'm sure there's not much need for explanation here, but these
#are to be static values with the exception of ATK, Hitpoints, and Skill Points.
# Battler stats:
#Attack - min = 3 / max = 255 or more but 255 is pretty good.
#Str - min 12 / max = (maybe around 40 - 50)
#Def - min 1 / max = shoot for around 200 or so.
#Dex - min around 15 / max around 60
#Agility - min around 15 / max around 50(maybe 60)
#Evade - min around 3-5 / max around 15 to 21
#Intelligence - min around 25 / max around 40
#Hit points level 1 min - 40 - 60 / max 6000 - 8000(we could use accesories to
#add bonus at level up)
#Skill points level 1 min - 9 to 16 / max 400 - 600 (we could use accessory to
#add at level up)
#------------------------------------------------------------------------------
#
# Do not edit the code below unless you know what you're doing.
#
###############################################################################
# **** CODE BELOW ****
###############################################################################
#------------------------------------------------------------------------------
# Game Battler part 3
#------------------------------------------------------------------------------
class Game_Battler
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
# Clear critical flag
self.critical = false
# First hit detection
hit_result = (rand(100) < attacker.hit)
# If hit occurs
if hit_result == true
# Calculate basic damage
atk = .max
###### Mod by Level Here
self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Critical correction
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
# Guard correction
if self.guarding?
self.damage /= 2
end
end
# Dispersion
if self.damage.abs > 0
amp = .max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
#eva = 100
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
##############
# Damage Cap #
##############
if CAP_DAMAGE == true
if self.damage >= CAP_DAMAGE_LIMIT
self.damage = CAP_DAMAGE_LIMIT
end
end #### End damage Cap
# If hit occurs
if hit_result == true
# State Removed by Shock
remove_states_shock
# Substract damage from HP
self.hp -= self.damage
# State change
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# When missing
else
# Set damage to "Miss"
self.damage = "Miss"
# Clear critical flag
self.critical = false
end
# End Method
return true
end
# End Physical Attack mod
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# Clear critical flag
self.critical = false
# If skill scope is for ally with 1 or more HP, and your own HP = 0,
# or skill scope is for ally with 0, and your own HP = 1 or more
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
# End Method
return false
end
# Clear effective flag
effective = false
# Set effective flag if common ID is effective
effective |= skill.common_event_id > 0
# First hit detection
hit = skill.hit
if skill.atk_f > 0
hit *= user.hit / 100
end
hit_result = (rand(100) < hit)
# Set effective flag if skill is uncertain
effective |= hit < 100
# If hit occurs
if hit_result == true
# Calculate power
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = .max
end
# Calculate rate
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Calculate basic damage
self.damage = power * rate / 20 * user.level / 2 ######## level mod
# Element correction
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Guard correction
if self.guarding?
self.damage /= 2
end
end
# Dispersion
if skill.variance > 0 and self.damage.abs > 0
amp = .max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
eva = 8 * self.agi / user.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
# Set effective flag if skill is uncertain
effective |= hit < 100
end
# If hit occurs
if hit_result == true
# If physical attack has power other than 0
if skill.power != 0 and skill.atk_f > 0
# State Removed by Shock
remove_states_shock
# Set to effective flag
effective = true
end
# Substract damage from HP
last_hp = self.hp
self.hp -= self.damage
effective |= self.hp != last_hp
# State change
@state_changed = false
effective |= states_plus(skill.plus_state_set)
effective |= states_minus(skill.minus_state_set)
# If power is 0
if skill.power == 0
# Set damage to an empty string
self.damage = ""
# If state is unchanged
unless @state_changed
# Set damage to "Miss"
self.damage = "Miss"
end
end
# If miss occurs
else
# Set damage to "Miss"
self.damage = "Miss"
end
# If not in battle
unless $game_temp.in_battle
# Set damage to nil
self.damage = nil
end
# End Method
return effective
end
#End Skill Effect mod
end ##end game battler class
#------------------------------------------------------------------------------
# End of Game Battler part 3
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# SET ENEMY LEVEL
#------------------------------------------------------------------------------
if SET_ENEMY_LEVEL == true and ADAPTIVE_ENEMY_LEVEL == false
#if SET_ENEMY_LEVEL switch is on do this below as long as Adaptive isn't on.
class Game_Enemy < Game_Battler
def level #sets enemy level based on value that appends to the enemy name.
first_num = $data_enemies.name.chr #add first number after name
second_num = $data_enemies.name.chr #now add second number
one_and_two = first_num.to_s + second_num.to_s #display numbers as a string
return one_and_two.to_i #convert the number into an integer
end
def name #show enemy name but remove the underscore and level numbers from
#display.
return $data_enemies.name
end
end #end Game_Enemy class here
else #if enemy switch is not on, make level = 1 so things will be back to normal.
class Game_Enemy < Game_Battler
def level
return 1
end
end
end #end if SET_ENEMY_LEVEL statement
#------------------------------------------------------------------------------
# End of SET ENEMY LEVEL
#------------------------------------------------------------------------------
#
#
#------------------------------------------------------------------------------
# ADAPTIVE ENEMY LEVEL
#------------------------------------------------------------------------------
if ADAPTIVE_ENEMY_LEVEL == true and SET_ENEMY_LEVEL == false
class Game_Enemy < Game_Battler
def level_average
i = 1
x = 0
for i in 1..$game_party.actors.size
x += $game_actors.level
end
average = x/i # setting average party level
return average
end
def level_variance
positive_or_negative =
variance_max = 15
variance_calculation = rand(variance_max) * positive_or_negative
return variance_calculation
end
############
def level
return level_average #+ level_variance
end
end #end Game_Enemy class here
elsif SET_ENEMY_LEVEL == false and ADAPTIVE_ENEMY_LEVEL == false #if conditions are not met for ADAPTIVE_ENEMY_LEVEL...
class Game_Enemy < Game_Battler
def level
return 1
end
end
end
#------------------------------------------------------------------------------
# END OF ADAPTIVE ENEMY LEVEL
#------------------------------------------------------------------------------
#
#
#------------------------------------------------------------------------------
# Game Actor Class (Actor Evade Attribute)
#------------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Get Basic Evasion Correction
#--------------------------------------------------------------------------
if SET_STATIC_EVADE == true
class Game_Actor < Game_Battler
def base_eva
armor1 = $data_armors
armor2 = $data_armors
armor3 = $data_armors
armor4 = $data_armors
eva1 = armor1 != nil ? armor1.eva : 0
eva2 = armor2 != nil ? armor2.eva : 0
eva3 = armor3 != nil ? armor3.eva : 0
eva4 = armor4 != nil ? armor4.eva : 0
return eva1 + eva2 + eva3 + eva4 + $static_eva_percentage#static_evasion_value
#adding custom evade value bonus
end
end #end this class
else #if SET_STATIC_EVADE == false
end #end if statement
#------------------------------------------------------------------------------
# End of Game Actor Class (Actor Evade Attribute)
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Custom HP/MP Gain Curve System
#------------------------------------------------------------------------------
if SET_HP_SP_GAIN_CURVE == true # if HP/SP gain switch is on..
class Game_Actor < Game_Battler
##### HP Gain CURVE ####
def level_hp_bonus_sum
i = 0
add_level_bonus_array_elements_together = 0
while i < @level
add_level_bonus_array_elements_together += $custom_level_growth_hp
i += 1
end
return add_level_bonus_array_elements_together
end
def base_maxhp
if @class_id > $custom_max_hp_base.size or @level > $custom_level_growth_hp.size
return $data_actors.parameters
else
return $custom_max_hp_base + level_hp_bonus_sum
end
end #### END HP Gain CURVE
##### sp Gain CURVE ####
def level_sp_bonus_sum
i = 0
add_level_bonus_array_elements_together = 0
while i < @level
add_level_bonus_array_elements_together += $custom_level_growth_sp
i += 1
end
return add_level_bonus_array_elements_together
end
def base_maxsp
if @class_id > $custom_max_sp_base.size or @level > $custom_level_growth_sp.size
return $data_actors.parameters
else
return $custom_max_sp_base + level_sp_bonus_sum
end
end #### END sp Gain CURVE
end #end Game Actor Class
else #if hp/sp swtich is off, then do nothing and resume to normal.
end
#------------------------------------------------------------------------------
# END OF Custom HP/MP Gain Curve System
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#
# A Little HP/MP Growth Helper Module
#
#------------------------------------------------------------------------------
#
# This will give you a text file of either hp or mp growth that you can put
# inside your data file or manually input the values into your hp/sp array above.
# The second option is suggested for use of this script. You can simply skip this
# and modify the array in the configuration setting, but you can use this tool
# to modify the values in your own way. For instance, if you wanted to gain 5
# points per level, the you could just do starting_hp += 5 to show those results.
# This tool was mainly for me, but you might be able to make use of it for you.
#
# To request results, make a map event and give one of the two following
# commands:
#
# Give_Results.give_hp_results(PUT_STARTING_VALUE_HERE_AS_AN_INTEGER)
#
# Give_Results.give_mp_results(PUT_STARTING_VALUE_HERE_AS_AN_INTEGER)
module Give_Results
module_function
def give_hp_results(starting_hp) #please give me starting hp value
print "*HINT* It is a good idea to make it between 35 and 60."
$level_growth_hp =
i = 0
File.open('hp_results.txt', 'w') do |f1|
while i < 99
starting_hp += $level_growth_hp
f1.print starting_hp
if i < $level_growth_hp.size - 1
f1.print ','
end
i += 1
end
end
end
def give_mp_results # please give me starting mp value
print "*HINT* It is a good idea to make it between 35 and 60."
starting_mp = gets.to_i
$level_growth_mp =
i = 0
File.open('hp_results.txt', 'w') do |f1|
while i < 99
starting_mp += $level_growth_mp
f1.print starting_mp
if i < $level_growth_mp.size
f1.print ','
end
i += 1
end
end
end
end
#------------------------------------------------------------------------------
# END OF Little HP/MP Growth Helper Module
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Debug Windows/Tools
#------------------------------------------------------------------------------
module Custom_Algo_Debug
module_function
def show_enemy_levels
Enemy_Level_Window.new
end
def show_player_evade
i = 1
for i in 1..$game_party.actors.size
print "Name: " + $game_actors.name.to_s + "\nEvade: " + $game_actors.eva.to_s
end
end
def average_player_levels
i = 1
x = 0
for i in 1..$game_party.actors.size
x += $game_actors.level
end
average = x/i
print average.to_s
end
end
class Enemy_Level_Window < Window_Base
#BLOCK 1
def initialize
super(0, 0, 440,380)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
#BLOCK 2
for i in 0...$game_troop.enemies.size
enemy_index = i + 1
x = 0
y = i * 30
if i >= 2
x=250
y -= 300
end
enemy = $game_troop.enemies
self.contents.font.color = text_color(6)
self.contents.draw_text(x, y, 200, 32, enemy_index.to_s + ". " + enemy.name.to_s + " Level: " + enemy.level.to_s)
end
end
end
################################################################################
http://forum.chaos-project.com/index.php/topic,12756.0.html
Here is te script below too:
#------------------------------------------------------------------------------
#
# ***** Customized Battle Algorithm *****
#
#------------------------------------------------------------------------------
#
# There are a few important things to note about this script. The default
# setup of this script will work well with static settings for str, int, dex,
# agi, and evade. This means that when you use the database, in the Actors tab,
# double-click on each of these attributes(except for evade, that comes later)
# and select the 'generate curve' option. From the ranges of level 1 to level 99,
# you should set the values to be the same on both ends. This means that only
# weapons, armor, items, and level will increase. Also, by the default system,
# something like unarmed combat will be based on the static str value and level
# at the time. You can find the actual modification below, but it looks like
# this:
#
# self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
#
# As you might notice, this also applied to the enemy. The enemy does not have
# a level attribute by default, this is why when naming an enemy, it is VERY
# VITAL that you append the enemy's name with the level value. This will have
# a great bearing on how strong or weak the enemy will be. So, naming a few
# enemies would look like this:
#
# ** (NOTICE LEVELS 1 - 9 NEED A "0" BEFORE THE SINGLE DIGIT) **
#
# slime_01 <= Level one slime
#
# vampire_09 <= Level 9 vampire
#
# boss_23 <= Level 23 boss
# ** Make sure and DON'T FORGET THE UNDERSCORE! "_" **
#
# How high you set the level is ultimately up to you, but keeping the levels
# close to your party average is a relatively good gauge because of the level's
# impact on the attacker's strength. Also, this will only read between levels
# 1 - 99. If you want to use 3 digit levels, it's a pretty easy fix. I wouldn't
# suggest the damage cap at 9999 for that however..
#
#
#
# I will give detailed step by step instructions below.
#
#------------------------------------------------------------------------------
# Debug
#------------------------------------------------------------------------------
# To view your evade run: Custom_Algo_Debug.show_player_evade
#
# To view your enemy level, make a common event and put this script inside it.
#
# Custom_Algo_Debug.show_enemy_levels
#
# Then, create an item and call it "Debug". Have the item run the common event
# you just created during battle. This will list the enemy levels to make sure
# that everything is running smoothly.
#------------------------------------------------------------------------------
# Configuration
#------------------------------------------------------------------------------
# This is where you can customize the following elements:
#
# - Set enemy level
# - Set a Damage Cap
# - custom hp/sp growth curve
# - custom static evasion attribute
# - Enemies Adapt To Average Party Level(think Skyrim/Oblivion)
#
#
#------------------------------------------------------------------------------
# SET ENEMY LEVEL BY NAME
#
# To set enemy level by name, put the enemy name in the database followed by
# an underscore and the two-digit level number. There is a detailed explanation
# above, but here is a quick example anyway.
# slime_09 = slime, level 9
# vampire_23 = vampire, level 23
#
SET_ENEMY_LEVEL = true #use this to turn on and off.
#CANNOT BE USED WITH ADAPTIVE ENEMY LEVEL!!!!!!!
#
# if set to false, the enemy level will default to 1. DO NOT MIX WITH
# ADAPTIVE_ENEMY_LEVEL switch!!! If so, you will see a warning and the game will
# not run properly and return to default settings.
#------------------------------------------------------------------------------
# ADAPTIVE ENEMY LEVEL
#
ADAPTIVE_ENEMY_LEVEL = false #turn this on and off here.
#CANNOT BE USED WITH SET_ENEMY_LEVEL!!!!!!!!!!!!
# This will make each enemy level adapt to your party average.
# I will be adding a random variance feature in the near future.
#------------------------------------------------------------------------------
# CAP DAMAGE
#
# To set a damage cap so that anything (< or = x) will be at a cap_damage_limit
#
CAP_DAMAGE = true #set to false to turn off or true to turn on.
CAP_DAMAGE_LIMIT = 9999 # the number to cap the damage at.
#------------------------------------------------------------------------------
# CUSTOM BASE HP/SP and GROWTH CURVE
SET_HP_SP_GAIN_CURVE = true #to turn this feature on and off.
#This is to set your starting HP/SP. The elements are referenced by class_id.
#There should be as many elements as there are classes in your game. You can
#easily add an element by adding a value and seperating it with a comma. I
#would suggest setting a base hp and mp at the same time, otherwise it will
#default to the database.
# If you choose to use this, it will override the
# database hp and sp values and they will be rendered useless.
$custom_max_hp_base =
$custom_max_sp_base =
# This is to set the growth speed. Each element represents what is added to
# the max hp/sp after a level up. Each array element corresponds to its level.
# NOTICE the first element is a ZERO. KEEP THE FIRST ELEMENT A ZERO or you will
# possibly break stuff.
$custom_level_growth_hp =
$custom_level_growth_sp =
#------------------------------------------------------------------------------
# CUSTOM STARTING/STATIC EVA PERCENTAGE
SET_STATIC_EVADE = true #put false to turn this feature off.
# This will set a constant eva value for each class that will be there without
# weapons or armor. Weapons and armor will still add a bonus accordingly.
# Each element in the array is referenced by class_id. To add an element,
# simply add another value seperated by a comma as shown below.
$static_eva_percentage =
#------------------------------------------------------------------------------
#
#
#------------------------------------------------------------------------------
# Suggestions / Notes
#------------------------------------------------------------------------------
#
# My notes/suggestions
#-------------------------------------------------------------------------------
#Physical Attack Addition:
#
# Much like some FF games, the level plays a part in the progression.
#
# Here is the physical attack formula:
#
# self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
#
#
#-------------------------------------------------------------------------------
# PHYSICAL ATTACKS:
# Physical Attack vs. Physical Defense
# 1. Physical defense that is 200% of Attack yields 0% damage.
# 2. Physical defense that is 150% of Attack yields 25% damage.
# 3. Physical defense that is 100% of Attack yields 50% damage.
# 4. Physical defense that is 50% of Attack yields 75% damage.
# 5. Physical defense that is 1% of Attack yields 100% damage.
#------------------------------------------------------------------------------
# CRITICAL PERCENTAGES:
#Attacker Dexterity vs. Defender Agility
# 1. if agility is same as dex, critical% = 4
# 2. if agility is 1/2 of dex, critical% = 8
# 3. if agility is 1/4 of dex, critical% = 16
# 4. if agility is 1/8 of dex, critical% = 32
# 5. and so on..
#------------------------------------------------------------------------------
# EVADE PERCENTAGES:
#Evade pretty much stays the same regardless of Dexterity.
# Evade value = rough percentage of chance to evade attack.
#------------------------------------------------------------------------------
# SKILL POWER BREAKDOWN:
#we are using:
# power * rate / 20 * user.level / 2
#Skill power with no -F(forces) added is exactly (power * level / 2)
#------------------------------------------------------------------------------
# MAGIC BASED ATTACKING SKILLS:
#Attack Skills with INT-F added:
#For magic, I suggest using a INT-F setting of 50.
# 1. Skill power with INT-F of 100% yields a degradation of 1/6 per 10
# attribute points.
# 2. Skill power with INT-F of 50% yields a degradation of 1/8 per 10
# attribute points.
# 3. Skill power with INT-F of 25% yields a degradation of 1/10 per 10
# attribute points.
#------------------------------------------------------------------------------
# PHYSICAL BASED ATTACKING SKILLS:
#For skills that slightly strenghthen attacks do the following, or something
#close to it:
#Power = 10
#ATK-F = 100
#EVA-F = ? If you want them to be evaded possibly, then set to 100.
#STR-F = 100
#DEX-F = ?
#INT-F = 0
#Hit Rate = ? This is useless if set_static_evade = true
#PDEF-F = 100
#MDEF-F = 0
#Variable = 15
# This type of setting is good for skills that grow with the player.
# They will be a bit strong at first, but they won't become obsolete quickly
# or at all like in a lot of games.
# If you desire a more tier style layout, try laying off of the ATK-F and maybe
# the PDEF-F as well...
#------------------------------------------------------------------------------
# HEALING BASED SKILLS
#
# Healing Skills will render almost exactly the same negative damage(Healing)
# as an attacking spell will render with positive damage(attack). This is
# obviously taking into account that the INT-F is the same in both cases.
#
#------------------------------------------------------------------------------
# Minimum and Maximum ranges for stuff:
#Mininum would be someone weaker with a certain attribute like INT for a knight
#or STR for a wizard.
#Max is opposite. I'm sure there's not much need for explanation here, but these
#are to be static values with the exception of ATK, Hitpoints, and Skill Points.
# Battler stats:
#Attack - min = 3 / max = 255 or more but 255 is pretty good.
#Str - min 12 / max = (maybe around 40 - 50)
#Def - min 1 / max = shoot for around 200 or so.
#Dex - min around 15 / max around 60
#Agility - min around 15 / max around 50(maybe 60)
#Evade - min around 3-5 / max around 15 to 21
#Intelligence - min around 25 / max around 40
#Hit points level 1 min - 40 - 60 / max 6000 - 8000(we could use accesories to
#add bonus at level up)
#Skill points level 1 min - 9 to 16 / max 400 - 600 (we could use accessory to
#add at level up)
#------------------------------------------------------------------------------
#
# Do not edit the code below unless you know what you're doing.
#
###############################################################################
# **** CODE BELOW ****
###############################################################################
#------------------------------------------------------------------------------
# Game Battler part 3
#------------------------------------------------------------------------------
class Game_Battler
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
# Clear critical flag
self.critical = false
# First hit detection
hit_result = (rand(100) < attacker.hit)
# If hit occurs
if hit_result == true
# Calculate basic damage
atk = .max
###### Mod by Level Here
self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Critical correction
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
# Guard correction
if self.guarding?
self.damage /= 2
end
end
# Dispersion
if self.damage.abs > 0
amp = .max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
#eva = 100
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
##############
# Damage Cap #
##############
if CAP_DAMAGE == true
if self.damage >= CAP_DAMAGE_LIMIT
self.damage = CAP_DAMAGE_LIMIT
end
end #### End damage Cap
# If hit occurs
if hit_result == true
# State Removed by Shock
remove_states_shock
# Substract damage from HP
self.hp -= self.damage
# State change
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# When missing
else
# Set damage to "Miss"
self.damage = "Miss"
# Clear critical flag
self.critical = false
end
# End Method
return true
end
# End Physical Attack mod
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# Clear critical flag
self.critical = false
# If skill scope is for ally with 1 or more HP, and your own HP = 0,
# or skill scope is for ally with 0, and your own HP = 1 or more
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
# End Method
return false
end
# Clear effective flag
effective = false
# Set effective flag if common ID is effective
effective |= skill.common_event_id > 0
# First hit detection
hit = skill.hit
if skill.atk_f > 0
hit *= user.hit / 100
end
hit_result = (rand(100) < hit)
# Set effective flag if skill is uncertain
effective |= hit < 100
# If hit occurs
if hit_result == true
# Calculate power
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = .max
end
# Calculate rate
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Calculate basic damage
self.damage = power * rate / 20 * user.level / 2 ######## level mod
# Element correction
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Guard correction
if self.guarding?
self.damage /= 2
end
end
# Dispersion
if skill.variance > 0 and self.damage.abs > 0
amp = .max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
eva = 8 * self.agi / user.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
# Set effective flag if skill is uncertain
effective |= hit < 100
end
# If hit occurs
if hit_result == true
# If physical attack has power other than 0
if skill.power != 0 and skill.atk_f > 0
# State Removed by Shock
remove_states_shock
# Set to effective flag
effective = true
end
# Substract damage from HP
last_hp = self.hp
self.hp -= self.damage
effective |= self.hp != last_hp
# State change
@state_changed = false
effective |= states_plus(skill.plus_state_set)
effective |= states_minus(skill.minus_state_set)
# If power is 0
if skill.power == 0
# Set damage to an empty string
self.damage = ""
# If state is unchanged
unless @state_changed
# Set damage to "Miss"
self.damage = "Miss"
end
end
# If miss occurs
else
# Set damage to "Miss"
self.damage = "Miss"
end
# If not in battle
unless $game_temp.in_battle
# Set damage to nil
self.damage = nil
end
# End Method
return effective
end
#End Skill Effect mod
end ##end game battler class
#------------------------------------------------------------------------------
# End of Game Battler part 3
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# SET ENEMY LEVEL
#------------------------------------------------------------------------------
if SET_ENEMY_LEVEL == true and ADAPTIVE_ENEMY_LEVEL == false
#if SET_ENEMY_LEVEL switch is on do this below as long as Adaptive isn't on.
class Game_Enemy < Game_Battler
def level #sets enemy level based on value that appends to the enemy name.
first_num = $data_enemies.name.chr #add first number after name
second_num = $data_enemies.name.chr #now add second number
one_and_two = first_num.to_s + second_num.to_s #display numbers as a string
return one_and_two.to_i #convert the number into an integer
end
def name #show enemy name but remove the underscore and level numbers from
#display.
return $data_enemies.name
end
end #end Game_Enemy class here
else #if enemy switch is not on, make level = 1 so things will be back to normal.
class Game_Enemy < Game_Battler
def level
return 1
end
end
end #end if SET_ENEMY_LEVEL statement
#------------------------------------------------------------------------------
# End of SET ENEMY LEVEL
#------------------------------------------------------------------------------
#
#
#------------------------------------------------------------------------------
# ADAPTIVE ENEMY LEVEL
#------------------------------------------------------------------------------
if ADAPTIVE_ENEMY_LEVEL == true and SET_ENEMY_LEVEL == false
class Game_Enemy < Game_Battler
def level_average
i = 1
x = 0
for i in 1..$game_party.actors.size
x += $game_actors.level
end
average = x/i # setting average party level
return average
end
def level_variance
positive_or_negative =
variance_max = 15
variance_calculation = rand(variance_max) * positive_or_negative
return variance_calculation
end
############
def level
return level_average #+ level_variance
end
end #end Game_Enemy class here
elsif SET_ENEMY_LEVEL == false and ADAPTIVE_ENEMY_LEVEL == false #if conditions are not met for ADAPTIVE_ENEMY_LEVEL...
class Game_Enemy < Game_Battler
def level
return 1
end
end
end
#------------------------------------------------------------------------------
# END OF ADAPTIVE ENEMY LEVEL
#------------------------------------------------------------------------------
#
#
#------------------------------------------------------------------------------
# Game Actor Class (Actor Evade Attribute)
#------------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Get Basic Evasion Correction
#--------------------------------------------------------------------------
if SET_STATIC_EVADE == true
class Game_Actor < Game_Battler
def base_eva
armor1 = $data_armors
armor2 = $data_armors
armor3 = $data_armors
armor4 = $data_armors
eva1 = armor1 != nil ? armor1.eva : 0
eva2 = armor2 != nil ? armor2.eva : 0
eva3 = armor3 != nil ? armor3.eva : 0
eva4 = armor4 != nil ? armor4.eva : 0
return eva1 + eva2 + eva3 + eva4 + $static_eva_percentage#static_evasion_value
#adding custom evade value bonus
end
end #end this class
else #if SET_STATIC_EVADE == false
end #end if statement
#------------------------------------------------------------------------------
# End of Game Actor Class (Actor Evade Attribute)
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Custom HP/MP Gain Curve System
#------------------------------------------------------------------------------
if SET_HP_SP_GAIN_CURVE == true # if HP/SP gain switch is on..
class Game_Actor < Game_Battler
##### HP Gain CURVE ####
def level_hp_bonus_sum
i = 0
add_level_bonus_array_elements_together = 0
while i < @level
add_level_bonus_array_elements_together += $custom_level_growth_hp
i += 1
end
return add_level_bonus_array_elements_together
end
def base_maxhp
if @class_id > $custom_max_hp_base.size or @level > $custom_level_growth_hp.size
return $data_actors.parameters
else
return $custom_max_hp_base + level_hp_bonus_sum
end
end #### END HP Gain CURVE
##### sp Gain CURVE ####
def level_sp_bonus_sum
i = 0
add_level_bonus_array_elements_together = 0
while i < @level
add_level_bonus_array_elements_together += $custom_level_growth_sp
i += 1
end
return add_level_bonus_array_elements_together
end
def base_maxsp
if @class_id > $custom_max_sp_base.size or @level > $custom_level_growth_sp.size
return $data_actors.parameters
else
return $custom_max_sp_base + level_sp_bonus_sum
end
end #### END sp Gain CURVE
end #end Game Actor Class
else #if hp/sp swtich is off, then do nothing and resume to normal.
end
#------------------------------------------------------------------------------
# END OF Custom HP/MP Gain Curve System
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#
# A Little HP/MP Growth Helper Module
#
#------------------------------------------------------------------------------
#
# This will give you a text file of either hp or mp growth that you can put
# inside your data file or manually input the values into your hp/sp array above.
# The second option is suggested for use of this script. You can simply skip this
# and modify the array in the configuration setting, but you can use this tool
# to modify the values in your own way. For instance, if you wanted to gain 5
# points per level, the you could just do starting_hp += 5 to show those results.
# This tool was mainly for me, but you might be able to make use of it for you.
#
# To request results, make a map event and give one of the two following
# commands:
#
# Give_Results.give_hp_results(PUT_STARTING_VALUE_HERE_AS_AN_INTEGER)
#
# Give_Results.give_mp_results(PUT_STARTING_VALUE_HERE_AS_AN_INTEGER)
module Give_Results
module_function
def give_hp_results(starting_hp) #please give me starting hp value
print "*HINT* It is a good idea to make it between 35 and 60."
$level_growth_hp =
i = 0
File.open('hp_results.txt', 'w') do |f1|
while i < 99
starting_hp += $level_growth_hp
f1.print starting_hp
if i < $level_growth_hp.size - 1
f1.print ','
end
i += 1
end
end
end
def give_mp_results # please give me starting mp value
print "*HINT* It is a good idea to make it between 35 and 60."
starting_mp = gets.to_i
$level_growth_mp =
i = 0
File.open('hp_results.txt', 'w') do |f1|
while i < 99
starting_mp += $level_growth_mp
f1.print starting_mp
if i < $level_growth_mp.size
f1.print ','
end
i += 1
end
end
end
end
#------------------------------------------------------------------------------
# END OF Little HP/MP Growth Helper Module
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Debug Windows/Tools
#------------------------------------------------------------------------------
module Custom_Algo_Debug
module_function
def show_enemy_levels
Enemy_Level_Window.new
end
def show_player_evade
i = 1
for i in 1..$game_party.actors.size
print "Name: " + $game_actors.name.to_s + "\nEvade: " + $game_actors.eva.to_s
end
end
def average_player_levels
i = 1
x = 0
for i in 1..$game_party.actors.size
x += $game_actors.level
end
average = x/i
print average.to_s
end
end
class Enemy_Level_Window < Window_Base
#BLOCK 1
def initialize
super(0, 0, 440,380)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
#BLOCK 2
for i in 0...$game_troop.enemies.size
enemy_index = i + 1
x = 0
y = i * 30
if i >= 2
x=250
y -= 300
end
enemy = $game_troop.enemies
self.contents.font.color = text_color(6)
self.contents.draw_text(x, y, 200, 32, enemy_index.to_s + ". " + enemy.name.to_s + " Level: " + enemy.level.to_s)
end
end
end
################################################################################
Excellent tutorial. Keep it up!
I realized most of these things through trial and error but some information was still very surprising.
I realized most of these things through trial and error but some information was still very surprising.
Pages:
1