query_auto_load() { return "players/ranma/staff.c:"; }
id(str) { return str == "staff" || str == "old staff"; }
long() { write("Not the famous Fizban Staff.\n"); }
reset(arg) { if (arg) return; }
get() { return 1; }
drop() { return 1; }
init() {
add_action("getthing","get!");
add_action("dropthing","drop!");
add_action("destall","clean");
add_action("trans","trans");
add_action("heal","heal");
add_action("zap","zap");
}

getthing(str) {
object ob;
if (!str) return 0;
ob = present(str, environment(this_player()));
if (!ob) { write("That is not here.\n");
return 1;
}
move_object(ob, this_player());
write("Ok.\n");
say(this_player()->query_name() + " takes " + ob->query_name());
return 1;
}

dropthing(str) {
object ob;
if (!str) return 0;
ob = present(str, this_player());
if (!ob) { write("That is not here.\n");
return 1;
}
move_object(ob, environment(this_player()));
write("Ok.\n");
say(this_player()->query_name() + " drops " + ob->query_name());
return 1;
}

destall(str) {
object where;
object ob, next;
if (!str) {
write("Clean what?\n");
return 1;
}
where = find_living(str);
if (!where) where = str;
ob = first_inventory(where);
if (!ob) { write("Nothing there to clean.\n");
return 1;
}
while (ob) {
next = next_inventory(ob);
if (!living(ob) && !ob->id("ND")) destruct(ob);
ob = next;
}
write("Done.\n");
return 1;
}

zap(str) {
object ob;
if (!str) { write("Zap whom?\n");
return 1;
}
ob = present(str, environment(this_player()));
if (!ob) {
write("That is not here.\n");
return 1;
}
if (!living(ob)) {
write("That is not a living thing!\n");
return 1;
}
write("You summon a bolt of lightning from the sky.\n");
say(this_player()->query_name() + " summons a bolt of lightning from the sky.\n");
ob->hit_player(1000000);
return 1;
}

heal(str) {
object ob;
if (!str) { write("Heal whom?\n");
return 1;
}
ob = find_living(str);
if (!ob) {
write("That is not here.\n");
return 1;
}
if (!living(ob)) {
write("That is not a living thing!\n");
return 1;
}
write("You heal " + capitalize(ob->query_name()) + "\n");
tell_object(ob, this_player()->query_name() + " heals you.\n");
ob->heal_self(1000000);
return 1;
}

