Im trying to come up with a simple but effective way to apply damage based on the players level and bonus.
The bonus, which is the equipment.
And the level, which is the attack level out of 100.
Im also trying to achieve the same effect with ai, the damage at a random range and divided by the players defence bonus and level.
I thought id seen it all in my maths class but this one really hits you. I have seen some algorithms used in diablo and runescape ( Combat level | RuneScape Wiki | Fandom ) to calculate levels but i cant get my head around it, any mathematics that can help me out?
AI.js
var damageMax = 10;
var damageMin = 5;
Attack();
var damage = Random.Range(damageMin, damageMax);
bonus = GameObject.FindWithTag("Player").GetComponent("Stats").defence;
target.SendMessage("ApplyDamage", Mathf.Round(damage / (bonus / 2)), SendMessageOptions.DontRequireReceiver);