You have 2 stats that determine how much damage you do.
Mana
Mana Aptitude(or control)
Now, I already have a pretty good idea on how the system is going to be done, but i need some advice.
For magic attack, each move will do a certain amount of your current mana(in perecntage)...for example.
var/damage = mana.value * 0.02 // 2 % of your current mana
With Mana Aptitude(or Control, which will be based on a ascale of 0.01 to 1)...
var/damage = (mana.value * 0.02) * mana_apt
now that seems pretty simple, but i want to take it a step further by making it so that there's a small chance it's going to do a large amount of damage(possibly 2 or 3 times the original damage), but only if the aptitude is pretty low.
var/damage = (mana.value * 0.02) * (mana_apt < 0.75 && prob(x) ? rand(2,4) : mana_apt)
I have no idea what to put in for x, but there's still more. When creating your character, i would like the results for the initial aptitude to be completly random. The way i was thinking....was to create a system that makes it more probable of having a lower aptitude than a higher one. I'm just not sure how to go about programming it(i'd rather not use a bunch of if statements to do this)
You set it as a crit ( critical or how u want it to be ) and u can set crit set of usr tai nin and mana ( depends on how u code it in ) it will end like this if u have it for damage
if(prob(crit)) //Change crit to wat ur damage is off of either mana from your topic
flick("attack",src)
/* view(4) << "<font color = red>[M] recieves a Critical Hit for [damage] from [src]" (optional ) */
src.doing = 1
M.health -= (damage * 2)
M.DEATH()
spawn(15) src.doing = 0
return