mob/var
life = 100
accuracy = 6
speed = 5
strength = 4
mob/verb
attack(accuracy % 4)
if (accuracy >= 1)
life - attack
else
life = life
Problem description:I'm currently trying to code a combat system that works on percentages for accuracy. I am thinking first I have to define accuracy, speed, strength and all that. Once that's done I have to make it so that there is a base accuracy all players have, and to hit you have to reach a certain integer, when they attack a random number from 1-10 is generated and added to their base accuracy and if the integer is met then the attack hits. I guess speed of the target would decrease from the attacking players roll, while the players roll would add to it.
I can see it, but I'm not particularly sure how to code it. I know I'm not doing it right, because
As i see it, the attack verb got a set acc to 4%, no matter what stats the player have.
In the attack verb you say: if the accuracy is Equal or greater then 1, then life - attack, who´s life - who´s attack?
else someones life = someone life.
Which dont make any sense to me, but is this how you want it to be?