verb
Say(mesg as text)
set category = "Speech"
if(length(mesg)>200) mesg=copytext("[mesg]",1,200)
//If the text is over 200 characters, only display 200, prevents lag and spam.
oview(9) << "<font color=blue>[src] says: [mesg]</font>"
verb
OOC(mesg as text)
set category = "Speech"
if(length(mesg)>200) mesg=copytext("[mesg]",1,200)
world << "<font color=green>[src] OOC's: [mesg]</font>"</b>
--------------------------------------------------
verb
Attack()
set category = "Battle"
if(usr.resting==1)
usr<<"You're resting!!"
return
if(src.energy <= 0)
usr<<"You are too tired!"
return
if(src.attacking) return //If he is already attacking, kill the proc
src.energy -= 2
var/mob/M=locate(/mob/) in get_step(src,src.dir) //Reference to a mob in front of you
if(!M) return //If there is no mob, kill the procedure
src.attacking=1 ///Attacking Delay variable
var/damage = src.str-(M.defense/2)
if(damage<=0) src<<"[M.name] dodges the attack!" //If he does no damage
else
M.hp -= damage
view()<<"[src.name] attacks [M.name] for [damage] HP!"
if(M.hp<=0)//If M's HP is lower than or equal to 0
src.kills ++ //Add to the kills
src.Deathcheck(M) //Special deathcheck, allows to Repop afterwards\
important if the monsters get stronger
sleep(5)//Sleep for 0.5 seconds, if sleep() can use increments of time
src.attacking=null //Nullify the attacking variable, thefore allowing you to attack again
if(usr.exp>=usr.maxexp)
usr.level += 1
var/strplus=(rand(1,5)*usr.level)
var/defplus=(rand(1,5)*usr.level)
var/manaplus=(rand(1,5)*usr.level)
var/hpplus=(rand(1,5)*usr.level)
usr.str+=strplus
usr.defense+=defplus
usr.maxhp+=hpplus
usr.maxmana+=manaplus
usr<<"<center><b><font color=red>Level up!!"
usr<<"<center>----------------------------------"
usr<<"<center><b><font color=red>Health points ups by [hpplus]"
usr<<"<center><b><font color=red>Strength ups by [strplus]"
usr<<"<center><b><font color=red>Defense ups by [defplus]"
usr<<"<center><b><font color=red>Mana ups by [manaplus]"
usr<<"<center>----------------------------------</center>"
usr.hp = usr.maxhp
usr.mana = usr.maxmana
usr.maxexp = 100+(10*usr.level)
usr.exp = 0
proc
Deathcheck(mob/M) //Special deathcheck, allows for repop\
extra argument is to show who killed who
if(M.hp<=0) //check the HP again
view()<<"[M.name] dies at the hands of [src.name]!"
src.exp+=(M.maxexp/2)
//Tells you who has died and who te killer was
M.deaths ++//Add one to M's death varaible
if(M.client) //If M is an actual player, respawn him
M.Move (locate(1,1,1))
M.hp = M.maxhp
M.mana = M.maxmana
M.energy = 100
else //If not, delete M and wait 2 seconds to repop the world
del(M)
sleep(200)
world.Repop()
Problem description:1. Say verb does not work, while OOC does o.O
2. When you kill a mob, you need to wait till he respawns to kill another mob (same mob as the one you killed).
You're say verb used oview() which dosen't show the user the text. But rather everyone else. I also fixed a tag you had outside "". And I also fixed some useless if() statements.
Although I don't have time to fully redo your battle systems, I did a chunk. (I'm at school). And learn to close your HTML tags!
~Hiero