mob
var
attack = 5
equiped = 0
health = 100
maxhealth = 100
obj
var
attackadd
//Define all objects
obj
proc/respawn()
new src.type(locate(rand(1,world.maxx),rand(1,world.maxy),rand(1,world.maxz)))//Makes a new src at a random location
weapons
icon = 'weapons.dmi'
verb/get()//global verb for all object under the /obj/weapons
set src in oview(1)
set category = null
src.respawn()//Calls the respawn proc
src.Move(usr)//You picked it up
verb/equip()
set src in usr
set category = null
if(!usr.equiped)
usr.attack+=src.attackadd//The power of the the weapon is now with you
src.verbs+=/obj/weapons/proc/unequip//Now you can unequip the weapon
src.verbs-=/obj/weapons/verb/equip//No longer have the equip verb
src.suffix+="Equiped"//Shows it as equiped
usr.equiped = 1
else
usr << "You already have something equiped!"
proc/unequip()
set src in usr
if(!usr.equiped)//Extra precautions
usr << "You don't have anything equiped!"
else
usr.attack-=src.attackadd//You can no longer use the power of the weapon
src.verbs-=/obj/weapons/proc/unequip
src.verbs+=/obj/weapons/verb/equip
src.suffix = ""//No longer shows it as equiped
usr.equiped = 0
verb
drop()
set src in usr
if(src.suffix == "Equiped")
usr << "Un-equip [src] first!"
else
src.Move(usr.loc)
shortsword
attackadd = 25//This is the var we'll use to judge the amount of power the weapon has
icon_state = "short sword"
club
attackadd = 10
icon_state = "club"
rustysword
attackadd = 15
icon_state = "rusty sword"
mob
Stat()
..()
statpanel("Items",contents)//Items
it isn't appilying the weapon's attack value to the players attack value on the stats panel
The DM tags are done like:
<DM>
coding
</DM>
To achieve this: