// mon optimize this function 4/20/98 // this function is extensively referenced, for example from id(), // present(), ... so must be fast. int visible(object ob) { int lvl, invis; /* lvl = wiz_level(this_object()); if( lvl > 1) return 1; if( lvl > wiz_level(ob) ) return 1; */ if(wizardp(this_object())) return 1; invis = ob->query("env/invisibility"); if( !invis ) invis = ob->query_temp("invisiblity"); // if( intp(invis) && (invis > lvl) ) return 0; if( invis ) { if( wizardp(ob) ) return 0; if(!userp(ob)) return 0; if( query("env/invisibility") ) return 1; return 0; } if( ob->is_ghost() ) { if( is_ghost() ) return 1; if( query_temp("apply/astral_vision") ) return 1; return 0; } return 1; }
int visible(object ob) { int lvl; if (! ob->is_character()) return 1; if (! wizardp(ob)) { if (wizardp(this_object()) || query("env/invisible") || is_ghost()) return 1; if (ob->query("env/invisible") || ob->is_ghost()) return 0; } lvl = wiz_level(this_object()); if (lvl && lvl >= wiz_level(ob)) return 1; if (ob->query("env/invisible") == "YES") return 0; if (lvl && lvl >= (int)ob->query("env/invisible")) return 1; if (wizardp(ob) && ob->query("env/invisible")) return 0; return 1; }
int visible(object ob) { int lvl, invis; lvl = wiz_level(this_object()); if( lvl > wiz_level(ob) ) return 1; invis = ob->query("env/invisibility"); if( intp(invis) && (invis > lvl) ) return 0; if( ob->is_ghost() ) { if( is_ghost() ) return 1; if( query_temp("apply/astral_vision") ) return 1; return 0; } return 1; }