#include "path.h" object owner; string name; /* owner name for netdead */ int dir_num; /* which way are we facing? */ int lost; /* do we know north? */ string room; /* what room are we in? (can't escape hell!) */ init() { if(environment(this_object())!=TP) return; if(owner) return; write("You are going to Hell.\n"); owner=TP; name=owner->query_real_name(); lost=1; dir_num=random(DIR_SZ); if(!room) moved(); /* starting room */ add_action("hell","",1); } /* querys and sets */ query_owner() { return owner; } query_dir() { return COMPASS[dir_num]; } query_dir_num() { return dir_num; } set_lost(x) { lost=x; } query_lost() { return lost; } set_room(x) { room=x; } query_room() { return room; } moved() { room=file_name(environment(TP)); } /* called in hroom.c */ return_hell() { int tmp; object ro; if(query_verb()=="forward" || query_verb()=="glance" || query_verb()=="look") return 1; /* called during actual move :) */ if(!room) return !write("Your room is gone!\n"); /* room is gone! */ if(!(ro=find_object(room))) return !write("Your section of hell has exploded!\n"); move_object(TP,ro); write("Moved you back to hell.\n");; return 0; } /* actions */ hell(str) { string verb,tmp; int i; verb=query_verb(); if(verb=="forward") return environment()->move(); if(file_name(environment(TP))!=room && !return_hell()) return 0; if(verb=="left" || verb=="right") { if(!str) return turn(verb=="right" ? 1 : -1); if(!sscanf(str,"%d",i)) return write("Usage: left|right [amount#]\n"); return turn(verb=="right" ? i : -i); } if(verb=="turn" && str=="around") return turn(4); if(verb=="about" && str=="face") return turn(4); } turn(x) { string str; if(x>4 || x<-4) return write("You can't turn that much!\n"); dir_num+=x; if(dir_num<0) dir_num+=DIR_SZ; if(x<0) { x=-x; if(dir_num<0) dir_num+=DIR_SZ; str="left"; } else { if(dir_num>DIR_SZ-1) dir_num-=DIR_SZ; str="right"; } if(x==4) str="around.\n"; else if(x>1) str+=" "+x+" times.\n"; else str+=".\n"; write("You turn "+str); say(NAME+" turns "+str); write("Exits are now: "+environment(TP)->long_exit_str()+"\n"); return 1; } /* object stuff */ short(){ return "You are in hell"; } extra_look() { if(lost) return NAME+" is lost in hell"; return NAME+" is in hell"; } long(){ write(short()+"\n"); return 1; } id(str) { return str=="hobj" || str=="__hobj"; } get() { return 0; } drop() { return 1; }