coins.c
ci/ci.dir/obj/coins.c · 1.3 KB
From the archive ci-1.2.tar.gz
Download the archive « Back to the archive contents
#include <sys.h>
int value,flags,special;
object owner;
get_type() { return TYPE_COINS; }
self_destruct() { destruct(this_object()); return 1; }
replicate() {
object o;
o=clone_object("/obj/coins");
call_other(o,"set_special",special);
call_other(o,"set_flags",flags);
call_other(o,"set_owner",owner);
call_other(o,"set_value",value);
return o;
}
stat() {
tell_player(this_player(),"Object Type: COINS\n");
if (flags) tell_player(this_player(),"Flags: "+make_flags(flags)+"\n");
if (special) tell_player(this_player(),"Special: "+itoa(special)+"\n");
tell_player(this_player(),"Value: "+itoa(value)+"\n");
if (owner) tell_player(this_player(),"Owner: "+make_num(owner)+"\n");
return 1;
}
get_special() { return special; }
get_flags() { return flags; }
set_special(arg) { special=arg; return 1; }
set_flags(arg) { flags=arg; return 1; }
get_owner() { return owner; }
set_owner(arg) { owner=arg; return 1; }
get_short() { return itoa(value)+" gold coins"; }
get_long() { return "Oooh, look at the shiny gold!"; }
get_name() { return "coins"; }
id(arg) { return arg=="coins" || arg=="gold"; }
get() {
if (call_other(caller_object(),"add_gold",value))
destruct(this_object());
return 1;
}
get_value() { return value; }
set_value(arg) {
if (arg>0) {
value=arg;
return 1;
} else
return 0;
}