When the exp for one of the skills reaches (skill level * 50) they gain a level in it. Like Runescape, you know. I'm having a hard time figuring out if my monsters are too strong or too weak, though, so I was wondering what would be an ideal damage calculator.
One of my monsters is the Deer. It has 3 health and maxhealth (A bit low, but they're gotta have to be killable from the very beginning, with a bit of luck) and 2 strength and defense. Compared to Spiders and Rats which inflicts 0 damage, this one can kill a new player fairly quickly (New players start with 10 health and 1 in each skill). So any suggestions to improving my NPC stats/damage calculation? I'll post the attack code I use below, along with the NPC monsters.
mob
verb
Attack()
set category = "Combat"
if(usr.Attacking == 0)//if the person is not attacking
for(var/mob/M in get_step(src,usr.dir)) //this is hardest part of the code lol, basically, if their is a mob in the persons next step and in the persons direction
var/damage = usr.curstrength - M.curdefense / rand(1,10)//varible damage equal to the value of 10
var/misschance = rand(1,5)
if(misschance == 1)
damage = 0
usr << "You completely miss your opponent!"
return
if(damage <= 0)
damage = 0
M.health -= damage//the person infront of you looses the variable damage(10)
usr.comexp=damage/2
M.defcomexp=damage/2
spawn() usr.strcheck()
spawn() M.defcheck()
view(6) <<" [M] got hit by [src] for [damage] damage!"//outputs to the world what happend
usr.Attacking = 1//the persons attacking variable goes to 1, disabling it from attacking again
spawn(7)//waits 7 milliseconds in the background
usr.Attacking = 0//allows the person to attack again
spawn() M.DeathCheck()
Credit to whoever made it. I added a "misschance" var to make it possible to miss with your attacks (The opponents are 100% accurate though, I'll find a way to fix it), and I'm thinking of adding an Accuracu skill of some sort. The monsters for now...
mob
monster
Rat
icon = 'rat.dmi'
npc = 1
enemy = 1
health = 1
mhealth = 1
curstrength = 0
curdefense = 0
Spider
icon = 'Monsters.dmi'
npc = 1
enemy = 1
health = 1
mhealth = 1
curstrength = 0
curdefense = 0
Deer
icon = 'deer.dmi'
npc = 1
enemy = 1
health = 3
mhealth = 3
curstrength = 2
curdefense = 2
Boar
icon = 'boar.dmi'
npc = 1
enemy = 1
health = 5
mhealth = 5
curstrength = 5
curdefense = 5
Note that Boars are nearly unbeatable at the first levels without proper equipment, which seems kind-of wrong since it's stats aren't all that high. Or what are your opinions?
Just my thoughts.