/* Water Brothers Guild add_actions. Called from init() of the wb_soul.c */ #define PATH "players/jubal/water" short() { return "grok"; } init() { /* if(this_player()->query_guild_string()!="water brother") return dest(); */ environment()->set_heal_hp_rate(5); environment()->set_heal_sp_rate(13); set_heart_beat(1); add_action("dest","bye"); add_action("grok","grok"); } dest() { return destruct(this_object()); } grok(str) { string pre,rest; object who; if(!str) return just_grok(); if(str=="self") return self(); if(str=="stat") return write("Not implemented yet (stat).\n"); if(try_peer(str)) return 1; if(sscanf(str,"\"%s\"",pre)==1) return set_prompt(pre); if(sscanf(str,"pre %s",pre)==1) return set_pre(pre); return make_object(str); } just_grok() { write("Yes you do.\n"); return 1; } make_object(str) { write("make object?\n"); return 1; } self() { write("grok self!\n"); if (this_player()->query_ghost()) { write("You concentrate on resolidifying to a flesh form.\n"); this_player()->remove_ghost(); return 1; } return 1; } set_prompt(str) { write("set prompt: "+str+"\n"); return 1; } set_pre(str) { this_player()->set_pretitle(str); if (str) write("New short: "+this_player()->short()+"\n"); return 1; } try_peer(str) { string dest_dir; int i; string where; object room,ob; if(!str || (sscanf(str,"%s",where)!=1 && sscanf(str,"to %s",where)!=1)) return 0; dest_dir=environment(this_player())->query_exits(); i=1; if(!dest_dir) return 1; if (where=="u") where="up"; if (where=="d") where="down"; if (where=="n") where="north"; if (where=="s") where="south"; if (where=="w") where="west"; if (where=="e") where="east"; if (where=="nw") where="northwest"; if (where=="ne") where="northeast"; if (where=="sw") where="southwest"; if (where=="se") where="southeast"; write("trying: "+where+"\n"); while(i < sizeof(dest_dir)) { if (where == dest_dir[i]) { write("You peer around the corner to the "+where+"\n"); room=find_object(dest_dir[i-1]); room->long(); ob = first_inventory(room); while(ob) { write(ob->short(0)+".\n"); ob = next_inventory(ob); } return 1; } i += 2; } return 0; } guild(str) { if (str!="help") return 0; write("Water Brother commands:\n"); write("----------------------\n"); write("score score and guild score\n"); write("grok understand ones opponent better\n"); write("drink water drink from the water of life\n"); write("pre set pretitle\n"); write("unghost Re-solidify after dying\n"); return 1; } life(str) { if (str!="water") { notify_fail("What ? (Maybe you should try drinking water)"); return 0; } write("You drink from the water of life. May you grok in fullness.\n"); say(this_player()->query_name()+" drinks from the water of life.\n"); return 1; } info(str) { object who; if(!str) { write("Usage: grok \n"); return 1; } if (!(who=find_player(str))) if(!(who=present(str,environment(this_player())))) who=present(str,this_player()); if (!who) { write("Could not see "+str+"\n"); return 1; } if(!living(who)) { write("You grok the "+str+"\n"); write("It likes you.\n"); return 1; } if(environment(who)!=environment(this_player())) { write("You grok "+str+" and become one with his surroundings:\n"); write(environment(who)->short()+"\n"); return 1; } write("You grok "+str+"\n"); write(capitalize(who->query_pronoun())+" is alive.\n"); write("Short: "+who->short()+"\n"); if (who->query_guild_string()=="water brother") tell_object(who,this_player()->query_name()+" groks you in fullness.\n"); return 1; } guild_score() { this_player()->score(); write("Guild score info goes here.\n"); return 1; } /* HEART BEAT */ heart_beat() { return; } /* OBJECT STUFF */ drop() { return 1; } query_auto_load() { return PATH+"wb_soul.c:"; } extra_look() { return environment()->query_name()+" is a Water Brother"; } id(str) { return str=="grok" || str=="guild_object"; }