//Title: Rudimentary Encumbrance
//Credit to: Jtgibson
//Contributed by: Jtgibson
/*
This is just a very basic encumbrance system. There are many ways in which it
could be improved, including eliminating the 'encumbrance' var and calculating
it dynamically, but this is a good way to get started.
*/
mob
var
encumbrance = 0
max_encumbrance = 15
obj/item
var
bulk = 1
verb/get()
set src = oview(0)
if(usr.max_encumbrance < src.bulk)
usr << "You're not strong enough to carry this."
return
if(usr.encumbrance + src.bulk > usr.max_encumbrance)
usr << "You're carrying too much to carry this."
return
usr.encumbrance += src.bulk
src.loc = usr
usr << "You get [src]."
verb/drop()
set src in usr
var/obj/O
for(O in usr.loc) break
if(O)
usr << "There is already an item here."
else
usr << "You drop [src]."
usr.encumbrance -= src.bulk
src.loc = usr.loc
ID:195059
Aug 30 2007, 10:23 am
|
|