Damage Formula help

Eschaton

Hack Fraud
Veteran
Joined
Mar 4, 2013
Messages
2,029
Reaction score
532
First Language
English
Primarily Uses
N/A
Is this possible in the damage formula box?  If not, how do I accomplish this effect?

Formula for nearly all skills:

(User's Offensive parameter plus y) minus (target Defensive parameter plus w) = z
If z higher than target's Defensive Parameter multiplied by x, then inflict/remove state (ignoring state percentage chance).
Regardless, do damage/heal.  With some skills, inflict stun.

y = a random number between 0 and the user's level
x = a number that is specific to the skill.
w = the first actor's level

"Offensive parameter" can mean ATK, MAT, or LUK, depending on the skill

"Defensive parameter" can mean DEF, MDF, or AGL, depending on the skill.
Nearly all skills add or remove a state.

I understand that with this formula, enemies get stronger as the player gains levels.  They don't level up from grinding, they level up from completing quests.  They mainly get stronger through other means, like perks and talent ranks.

I'm using a script by Victor Sant to create traits that raise the effectiveness of elements for each skill using that element.  Damage represents effectiveness of skills, whether they're for DPS or for inflicting states.  All skills using the above formula deal damage and can inflict a state.  This is to prevent wasting a turn on a skill that MIGHT only inflict a state.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Try something like this (I'll use OFF for the offensive parameter - ATK, MAT, LUK, and DEF for the defensive parameter - DEF, MDF, AGL)

b.add_state(id) if (a.OFF + y) - (b.DEF + w) > (b.def * x); b.add_state(stun_id); <damage_calc>where you can do b.add_state or b.remove_state with the state's id
b.add_state(stun_id) had the id for the stun skill, and this section is optional - only use for those skills that you want to add the stun state;


<damage_calc> is replaced with the normal formula to calculate damage


This might end up with the states applied/removed, even if damage ends up being 0.


I'm only assuming Victor's scripts don't alter the way damage is calculated.
 

Eschaton

Hack Fraud
Veteran
Joined
Mar 4, 2013
Messages
2,029
Reaction score
532
First Language
English
Primarily Uses
N/A
I'm only assuming Victor's scripts don't alter the way damage is calculated.
So am I, haha.  What's the code for w, x, and y?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
oh, sorry - I didn't read the rest of that.


For y, put

Code:
Math.rand(a.level) + 1
For w, do you mean Actor 1, or do you mean the leader? It will be one of these:
Code:
$game_party.leader.level
Code:
$game_actors[1].level
The value for x will be something you'll have to work out, as all you've said is it's "a number that's specific to the skill". All that tells me is that each skill will probably have a different number here, but gives me no information as to what that number actually is.
 

Eschaton

Hack Fraud
Veteran
Joined
Mar 4, 2013
Messages
2,029
Reaction score
532
First Language
English
Primarily Uses
N/A
The value for x will be something you'll have to work out, as all you've said is it's "a number that's specific to the skill". All that tells me is that each skill will probably have a different number here, but gives me no information as to what that number actually is.
Er... yes.

Anyway, thanks for the help, I'll be testing this formula extensively.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Well, if you can tell me what "x = a number that is specific to the skill" means, then I can give you the formula :) Is it the skill id? Is it calculated on the skill id? Is it some parameter on the skill? Is it something you want to put into the note box on the skill? See what I mean?
 

Eschaton

Hack Fraud
Veteran
Joined
Mar 4, 2013
Messages
2,029
Reaction score
532
First Language
English
Primarily Uses
N/A
Oh, it's just going to be an integer unique to the skill.  I also made a mistake with my request, in that x and y should be switched.  I can do that myself, though.

Also, for state IDs, do I include parentheses?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yes, because you're passing an argument to a method or function.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
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'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top