money.c

lpmud/mudlib/obj/money.c · 467 B

From the archive lpmud-1.4.1-A-r11.tar.gz

Download the archive   « Back to the archive contents

int money;

reset(arg) {
    if (arg)
	return;
    money = 1;
}

query_weight() { return 0; }

short() {
    if (money == 0)
	return 0;
    return money + " gold coins";
}

get() {
    call_other(this_player(), "add_money", money);
    money = 0;
    set_heart_beat(1);
    return 1;
}

set_money(m) {
    money = m;
}

id(str) {
    if (str == "coins")
	return 1;
    if (str == "money")
	return 1;
}

heart_beat() {
    if (money == 0)
	destruct(this_object());
}

Site Stats

Snippets: 1791
Codebases: 571