how would i make a weapon (as in an rpg) that can do more or less damage depending upon the weapon?
hers my code im using that doesnt work:
obj
icon = 'sword.dmi' // i defined an object called sword
verb
get() //you need to b able to get it
set scr in usr.loc //it needs to be directly
loc = usr //under you to pick it up
usr << "You pick up sword."
del(src) //deletes sword so u cant pick
//it up more then once
stab(mob/M as mob in oview(1)) //new verb
//called stab
usr << "You stab [M]!"
oview() << "[usr] stabs [M]!"
var/damage = rand(5,15) //damge is random amount
//between 5 and 15
world << "[damage] damage!" //world hears the
//amount of damage dealt
M.HP -= damage //the amount of damage dealt
//is subtracted from mobs current health
M.DeathChack() //deletes corpse if dead
i have already defined deathcheck which is a proc that deletes the corpses of the people i kill so there aren't bodys everywhere. i also already defined hp, or health points. i have already defined damagee too, so thats not my problem. any help?
ID:161247
![]() May 29 2008, 3:00 pm (Edited on May 29 2008, 3:31 pm)
|
|
> del(src) //deletes sword so u cant pick I may be wrong, as I haven't coded in quite a while...but I believe that this would delete the sword you just picked up meaning that you couldn't use it to do any damage. I don't think you want that there... |
if so...
If you want completely different swords, just make different objects.....