bank.c

ds2.4.1/lib/lib/bank.c · 650 B

From the archive ds2.4.1.zip

Download the archive   « Back to the archive contents

#include <lib.h>

inherit LIB_ROOM;

static void create() {
    room::create();
}

mixed teller_check(){
    object *livs = get_livings(this_object());
    object teller;
    if(sizeof(livs))
	foreach(object liv in livs){
	if(inherits(LIB_TELLER,liv)) return liv;
    }
    return 0;
}

void init() {
    ::init();
    add_action("HandleTeller","deposit");
    add_action("HandleTeller","withdraw");
    add_action("HandleTeller","exchange");
    add_action("HandleTeller","balance");
}

int HandleTeller(string str){
    object teller = teller_check();
    if(!teller) return 0;
    teller->cmdParse(this_player(),query_verb(),str);
    return 1;
}

Site Stats

Snippets: 1791
Codebases: 571