Hi guys, I'm trying to create a combat system that calculates the fighting level ( it's over 9000!!! XD) and fatigue.
There is a way to make this formula shorter?
a.atk * 4 + {[a.level + (a.hp/10) + (a.mp/10) + a.tp + a.atk + a.def + a.agi + a.mat + a.mdf + a.luk]/9} - b.def * 2 + {[b.level + (b.hp/10) + (b.mp/10) + b.tp + b.atk + b.def + b.agi + b.mat + b.mdf + b.luk]/9}
A couple things.
-It looks like you're taking the average of all stats, including level, but dividing by 9, vice the 10 parameters you listed in each section.
-Without plug ins, this formula won't work for combat, as enemies don't have levels or tp. This would work for skills that are targeting other party members though.
-In general, I don't think this formula will accomplish what you want, as written. Currently, you're adding both the attacker and defenders stats to the final damage, instead of doing a comparison. Let's try grouping the attacker and defenders portions,
(a
.atk
* 4 + ((a
.hp
/10 + a
.mp
/10 + a
.atk
+ a
.def + a
.agi
+ a
.mat
+ a
.mdf
+ a
.luk)
/8))
- (b
.def * 2 + ((b
.hp
/10 + b
.mp
/10 + b
.atk
+ b
.def + b
.agi
+ b
.mat
+ b
.mdf
+ b
.luk)
/8))
Or you could use it as a fraction to modify the a.atk-b.def portion:
(a.atk*4-b.def*2)*(((a.hp/10+a.mp/10+a.atk+a.def+a.agi+a.mat+a.mdf+a.luk)/8)/((b.hp/10+b.mp/10+b.atk+b.def+b.agi+b.mat+b.mdf+b.luk)8))
I think the second one would serve your purpose better, as it creates a direct comparison between the attacker and defender, and modifies the damage based on that outcome.
Run both through your favorite spreadsheet to see which numbers you like better. Hope that helps somewhat.