"A dump of #258 on Sun Dec 17 13:37:08 1995 PST @create #364 named Generic Dungeon Room:Generic Dungeon Room,Dungeon Room @prop #258."transparency_support" 0 rc @prop #258."free_exit" 0 rc @prop #258."player_all_verbs" {} rc ;;#258.("player_all_verbs") = {"drop", "throw", "give", "hand", "wear", "remove", "wield", "unwield", "sheathe", "sling", "put", "insert"} @prop #258."room_all_verbs" {} rc ;;#258.("room_all_verbs") = {"get", "take"} @prop #258."gripe_recipients" {} rc ;;#258.("gripe_recipients") = {#21259} @prop #258."magic_effect" 0 r @prop #258."blessed_exit" 0 r ;;#258.("dawn_msg") = "" ;;#258.("night_msg") = "" ;;#258.("dusk_msg") = "" ;;#258.("day_msg") = "" ;;#258.("enabled") = 1 ;;#258.("free_entry") = 0 ;;#258.("entrances") = {} ;;#258.("exits") = {} ;;#258.("ctype") = 5 ;;#258.("key") = 0 ;;#258.("aliases") = {"Generic Dungeon Room", "Dungeon Room"} ;;#258.("object_size") = {20451, 818929044} @verb #258:"acceptable" this none this @program #258:acceptable "Removed my insertion of $local.rpg:trust(0) since it seems to allow all entries from any room with an :accept verb higher than this one."; return (pass(@args) || ((what = args[1]).owner in $local.rpg.gms)) || ($object_utils:contains(this, what) && $object_utils:isa(what, #517)); . @verb #258:"l*ook" any any any rxd @program #258:look "look [at] thing -- Take a gander at something."; string = (prepstr == "at") ? iobjstr | dobjstr; what = string ? this:match(string) | this; if (!$command_utils:object_match_failed(what, string)) what:look_self(); db = $local.rpg; if (valid(db:get_doll(what)) && is_player(what)) db:look_health(what); db:look_gear(what); endif endif "Quinn 01-AUG-93 0812-ET: Hacked to recognise 'at', and to use :object_match_failed."; . @verb #258:"enterfunc" this none this @program #258:enterfunc theEntrance = this:identify_entrance(thing = args[1]); this:notify_arrival(thing, theEntrance); doll = $local.rpg:get_doll(thing); if (doll > $nothing) min = 999; for y in (doll.aggressor) if ((!valid(y)) || (y.location != this)) doll.aggressor = setremove(doll.aggressor, y); endif endfor for q in (setremove(thing.location.contents, thing)) if (((z = $local.rpg:get_doll(q)) > $nothing) && ((poss = z:get_att("act")) < min)) min = poss; endif endfor if (min < 999) doll:set_att("act", min); "fork (0)"; " doll:invite(doll:get_att(\"slowness\") / 2, {-1});"; "endfork"; else doll:set_att("act", 0); endif endif pass(@args); . @verb #258:"forgive" any none none rxd @program #258:forgive doll = $local.rpg:get_doll(player); if (dobj <= #-1) player:tell("I don't see ", dobjstr, " here."); elseif (doll == #-1) player:tell("As a peaceful person, you hold no grudges."); elseif (dobj in doll:get_att("aggressor")) player:tell("You forgive ", dobj.name, "."); doll:set_att("aggressor", setremove(doll:get_att("aggressor"), dobj)); else player:tell("You hold no grudge against ", dobj.name, "."); endif . @verb #258:"hate" any none none rxd @program #258:hate doll = $local.rpg:get_doll(player); if (dobj <= #-1) player:tell("I don't see ", dobjstr, " here."); elseif (doll == #-1) player:tell("As a peaceful person, you hold no grudges."); else player:tell("You nurse your grudge against ", dobj.name, "."); doll:set_att("aggressor", setadd(doll:get_att("aggressor"), dobj)); endif . @verb #258:"tell_contents" this none this @program #258:tell_contents contents = args[1]; ctype = args[2]; if (this.dark) return; elseif (ctype != 5) pass(@args); return; endif people = things = {}; for q in (contents) if (valid($local.rpg:get_doll(q))) people = listappend(people, q); else things = listappend(things, q); endif endfor if (things != {}) player:tell(("You see " + $string_utils:english_list($list_utils:map_verb(thi ngs, "title"))) + " here."); endif if (people != {}) player:tell(($string_utils:english_list($list_utils:map_verb(people, "title")) + ((length(people) == 1) ? " is" | " are")) + " here."); endif . @verb #258:"exitfunc" this none this rx @program #258:exitfunc "Penalise for illegal exit, clear aggressor and action properties, and remove object from the aggressor lists of everyone still in the room."; who = args[1]; if ((caller != this) && (!$perm_utils:controls(caller_perms(), who))) "standard exitfunc security check"; return E_PERM; endif addb = $local.rpg; if (!this:exit_ok(who)) this:exitshock(who); endif if (valid(z = addb:get_doll(who))) z.aggressor = {}; z.act = 0; endif for each_person in (this:contents()) if (valid(what = addb:get_doll(each_person)) && (agg = what.aggressor)) what.aggressor = setremove(agg, who); endif addb:time_stop(1); endfor pass(@args); . @verb #258:"exits" this none this rxd #78 @program #258:exits if ((callers()[1][3] in #46.gms) || (callers()[1][1] == this)) return this.exits; else return {}; endif . @verb #258:"dests" this none this rxd #78 @program #258:dests if (callers()[1][3] in #46.gms) v = {}; for k in (this:exits()) z = k; while ($object_utils:isa(z, #566)) z = z.succ_exit; endwhile if ($object_utils:isa(z, $exit)) v = listappend(v, z.dest); endif endfor return v; else return {}; endif . @verb #258:"att*ack hit ki*ll" any none none rxd @program #258:attack "attack "; "attack 's "; rpg = $local.rpg; if ((valid(cp = caller_perms()) && (caller != this)) && (!rpg:trusted(cp))) return E_PERM; endif if (parsed = $match_utils:parse_possessive_reference(dobjstr)) dobj = this:match(dobjstr = parsed[1]); where = parsed[2]; else dobj = this:match(dobjstr); where = ""; endif if (dobj == $ambiguous_match) player:tell("Which \"", dobjstr, "\" do you want to attack?"); return dobj; elseif (!valid(dobj)) player:tell("I can't see any \"", dobjstr, "\" here to attack."); return dobj; elseif (!valid(doll = rpg:get_doll(player))) player:tell("Your feeble attacks have no effect upon ", dobj.name, ". Perhaps you should consider being trained with the Bovine Illuminati."); return E_INVARG; elseif (!(w = doll:wielding())) player:tell("You are unarmed."); return E_INVIND; elseif (!doll:long_enough()) player:tell("You try to force an extra attack and fail."); return E_NACC; elseif (($player in $object_utils:ancestors(player)) && (idle_seconds(player) > 300)) player:tell("You try to force an extra attack and fail."); return E_NACC; endif if (!where) if (w[1]:has_own_hit()) w[1]:hit(dobjstr, "with", w[1].name); else doll:set_att("last_attack", time()); doll:attack(dobj, w); endif elseif (valid(tdoll = rpg:get_doll(dobj)) && valid(area = tdoll:match_body_area (where))) player:tell("You take aim for ", dobj.name, "'s ", where, "."); doll:set_att("last_attack", time()); doll:attack(dobj, w, area:attack_mod(dobj, player, w[1]), area); elseif (area == $ambiguous_match) player:tell(dobj.name, " has more than one ", where, ". You'll have to be more specific."); else player:tell("You can't find anything resembling a \"", where, "\" on ", dobj.name, "."); endif "Ogwul:Sat Apr 23 15:05:44 MDT 1994:Added ability to call w[1]:hit() if defined."; "Quinn 23-Sep-94 0732: Fixed it so the TARGET's doll is matched on instead of the attacker's when considering called shots."; "Profane 2-DEC-95 1357EST -- Added idle check for players"; . @verb #258:"@mak*ehere" this none none rd #78 @program #258:@makehere where = player.location; if (((caller_perms() in {player, $nothing}) && (player.wizard || (player == where.owner))) && ((dobj.owner == player) || dobj.r)) player:tell("Changing ", where.name, " (", where, ") to a ", dobj.name, " (", this, ")"); #0:chparent(where, dobj); where.free_entry = dobj.free_entry; where.ctype = dobj.ctype; for y in ({@where.exits, @where.entrances}) if (parent(y) == $exit) player:tell("Changing ", y.name, " (", y, ")."); #0:chparent(y, #11286); endif endfor else player:tell(caller_perms(), " can't do that."); endif . @verb #258:"exit_ok" this none this @program #258:exit_ok "You can teleport from a room your owner owns, from one that's free_exit, or if you're a GM's object."; rpg = $local.rpg; theExit = this:identify_exit(what = args[1]); this:notify_exit(what, theExit); if (((this:free_exit(what) || (theExit in this:exits())) || (what.owner == this.owner)) || (what.owner in rpg.gms)) return 1; else lenc = length(ca = callers()); index = 0; while (ca[index = index + 1][1..2] == {this, "exitfunc"}) endwhile while (ca[index = index + 1][1..2] == {what, "moveto"}) endwhile for res in (ca[index..lenc]) if (res[3] in rpg.gms) return 1; elseif ((!res[3]) in rpg.exporters) return 0; endif endfor return 0; endif . @verb #258:"same_time" this none this @program #258:same_time if (!$local.rpg:trust()) return E_PERM; endif if (!this.transparency_support) return {this}; endif where = setadd(args, this); e = this:exits(); d = this:dests(); for k in [1..length(e)] if ($object_utils:isa(e[k], #16049) && (!(d[k] in where))) where = $object_utils:isa(d[k], #258) ? d[k]:same_time(@where) | {@where, d[k]}; endif endfor return where; . @verb #258:"announce*_all_but" this none this @program #258:announce_all_but if (this.transparency_support && ((($local.rpg.thing in (anc = $object_utils:ancestors(caller))) || ($local.rpg.doll in anc)) || ($local.rpg.monster in anc))) for k in (this:same_time()) k:(verb)(@args); endfor else pass(@args); endif "Quinn 13-OCT-93 0116: Added .transparency_support check before all that ancestry snooping. Made one call to ancestors instead of several :isas. Changes should speed up :announce* calls and make tracebacks less frequent."; . @verb #258:"missile_dests" this none this @program #258:missile_dests if (!$local.rpg:trust()) return E_PERM; endif who = args[1]; where = {this}; e = this:exits(); d = this:dests(); for k in [1..length(e)] if (($object_utils:isa(e[k], #16049) || $object_utils:isa(e[k], #16050)) && e[k]:is_missile_channel_for(who)) where = listappend(where, d[k]); endif endfor return where; . @verb #258:"moveto" this none this @program #258:moveto return ($local.rpg:trust() || (args[1] == $nothing)) && pass(@args); . @verb #258:"block" any any any @verb #258:"identify_exit" this none this @program #258:identify_exit lenc = length(ca = callers()); for entry in (ca[3..lenc]) if (entry[1] in this:exits()) return entry[1]; endif endfor return args[1].location; . @verb #258:"identify_entrance" this none this @program #258:identify_entrance lenc = length(ca = callers()); for entry in (ca[3..lenc]) if (entry[1] in this:entrances()) return entry[1]; endif endfor return ca[lenc][1]; . @verb #258:"entrances" this none this rxd #78 @program #258:entrances if ((callers()[1][3] in #46.gms) || (callers()[1][1] == this)) return this.entrances; else return {}; endif . @verb #258:"contents" this none this @program #258:contents return this.contents; . @verb #258:"old_missile_dests" this none this @program #258:old_missile_dests if (!$local.rpg:trust()) return E_PERM; endif who = args[1]; where = {this}; e = this:exits(); d = this:dests(); for k in [1..length(e)] if ($object_utils:isa(e[k], #16049) && e[k]:is_missile_channel_for(who)) where = listappend(where, d[k]); endif endfor return where; . @verb #258:"notify_exit notify_arrival" this none this @program #258:notify_exit ":notify_entrance(OBJ player, OBJ entrance_used)"; ":notify_exit(OBJ player, OBJ exit_used)"; "Passes to the Adventurer's Database (#46), which notifies each object in this location of the given event."; #46:check_notification(this:contents(), verb, args); . @verb #258:"visible" this none this @program #258:visible "A more intelligent handling of `all' and `everything' matching."; "This version is tailored for the RPG, only returning kids of Adventure Gear (#517)."; if (!(dobjstr in {"all", "everything"})) return pass(@args); endif fvrb = #34283:cutr(callers(), 1)[1][2]; if (fvrb in this.room_all_verbs) objects = #34283:contents(this, #517); elseif (fvrb in this.player_all_verbs) objects = #34283:contents(args ? args[1] | player, #517); else objects = #34283:class_list(pass(@args), #517); endif if (((length(objects) > 5) || (ticks_left() < 21000)) || (seconds_left() < 12)) "...these `all' tasks frequently run out of ticks..."; "...this check probably belongs in #3879:here_huh..."; $local.rpg:stop_time(); endif return objects; . @verb #258:"@rpg-gripe" any from this rxd @program #258:@rpg-gripe $mail_editor:invoke(this.gripe_recipients, "@rpg-gripe", "@gripe: " + tostr(args[1])); . @verb #258:"magic_effect" this none this @program #258:magic_effect if (this.magic_effect > args[2]) args[1]:tell("Nothing happens."); endif return this.magic_effect; . @verb #258:"set_value" this none this @program #258:set_value ":set_value(STR property_name, value) -- Sets this.(property_name) to `value'"; if ((caller_perms() in {this.owner, #517.owner}) && $local.rpg:trust()) this.(args[1]) = args[2]; "...old code deleted, obsolete with clear_properties..."; "...i don't really see the point in returning {this}..."; "...but for backwards compatiblity (Quinn 05-JAN-93)..."; return {this}; else return E_PERM; endif . @verb #258:"get_value" this none this @program #258:get_value if ($local.rpg:trust()) return this.(args[1]); else return E_PERM; endif . @verb #258:"obvious_exits" this none this rx @program #258:obvious_exits "Hacked to check for an :obvious verb as well as the standard property."; exits = {}; for exit in (this:exits()) if ($code_utils:verb_or_property(exit, "obvious")) exits = setadd(exits, exit); endif endfor return exits; "Quinn 10-AUG-93 0748: Added."; . @verb #258:"exitfunc(old)" this none this @program #258:exitfunc(old) addb = $local.rpg; who = args[1]; if (!this:exit_ok(who)) for what in ({who, @$object_utils:all_contents(who)}) addb:time_stop(5); if ((valid(z = addb:get_doll(what)) && (is_player(what) || what.alive)) && (what.owner != this.owner)) z.ins = (z.ins + 5) + random(10); who:tell("The inherent implausibility of your exit briefly distorts your consciousness."); endif endfor endif if (valid(z = addb:get_doll(who))) z:set_att("aggressor", {}); z:set_att("act", 0); endif "This was put in as a hack until we can discover who fucked with"; "what and screwed up the system. Specifically, it is meant to make sure"; "that when people leave the room, they are NOT subsequently attacked"; "by monsters in that room"; "dr"; "ps. I know it will be spammy, alright? We got 600 users to think about,"; "tho, and the system has GOT to work."; for each_person in (this.contents) if (valid(what = addb:get_doll(each_person)) && what:get_att("aggressor")) addb:time_stop(5); what:set_att("aggressor", setremove(what:get_att("aggressor"), who)); endif endfor pass(@args); . @verb #258:"exitshock" this none this rx @program #258:exitshock ":exit_penalty(who) -- Penalise player for unauthorised teleport from an RPG room."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif addb = $local.rpg; for what in ({args[1], @$object_utils:all_contents(args[1])}) addb:time_stop(1); if ((valid(doll = addb:get_doll(what)) && (is_player(what) || what.alive)) && (what.owner != this.owner)) what:tell("The inherent implausibility of your exit briefly distorts your consciousness."); doll:check_ins(10 + random(30)); endif endfor . @verb #258:"combat_effect" this none this @program #258:combat_effect ":combat_effect(attacker, defender, weapon)"; return 0; . @verb #258:"hit(old)" any none none @program #258:hit(old) if (!valid(dobj)) player:tell("I can't see any ", dobjstr, " here to attack."); elseif (!valid(doll = $local.rpg:get_doll(player))) player:tell(("Your feeble attacks have no effect upon " + dobj.name) + ". Perhaps you should consider being trained with the Bovine Illuminati."); elseif (((w = doll.wielding) == {}) || (!valid(w[1]))) player:tell("You are unarmed."); else if (doll:long_enough()) doll:set_att("last_attack", time()); doll:attack(dobj, w); else doll.character:tell("You try to force an extra attack and fail."); return E_NACC; endif endif . @verb #258:"free_exit" this none this @program #258:free_exit return this.(verb); . @verb #258:"exit_ok(old)" this none this @program #258:exit_ok(old) "You can teleport from a room your owner owns, from one that's free_exit, or if you're a GM's object."; rpg = $local.rpg; theExit = this:identify_exit(what = args[1]); this:notify_exit(what, theExit); if (((this:free_exit(what) || (theExit in this:exits())) || (what.owner == this.owner)) || (what.owner in rpg.gms)) return 1; else lenc = length(ca = callers()); index = 0; while (ca[index = index + 1][1..2] == {this, "exitfunc"}) endwhile while (ca[index = index + 1][1..2] == {what, "moveto"}) endwhile for res in (ca[index..lenc]) if (res[3] in rpg.gms) return 1; elseif ((!res[3]) in rpg.exporters) return 0; endif endfor return 0; endif . @verb #258:"bless_exit" this none this @program #258:bless_exit ":bless_exit(what)"; "Bless exit from this room by the given object, during THIS task."; "A 'blessed' exit avoids the mental fatigue of other teleportation."; if ($local.rpg:trusted(caller_perms())) this.blessed_exit = {args[1], task_id()}; else return E_PERM; endif . @verb #258:"exit_ok(new)" this none this @program #258:exit_ok(new) "You can teleport from a room your owner owns, from one that's free_exit, or if you're a GM's object."; rpg = $local.rpg; theExit = this:identify_exit(what = args[1]); this:notify_exit(what, theExit); if (((this:free_exit(what) || (theExit in this:exits())) || (what.owner == this.owner)) || (what.owner in rpg.gms)) return 1; elseif (((b = this.blessed_exit) && (b[1] == what)) && (b[2] == task_id())) this.blessed_exit = 0; return 1; else return 0; endif . @verb #258:"look_self" this none this @program #258:look_self "Copied from Alchemy Lab (#9471):look_self by Miles (#50636) Sat Aug 26 11:01:20 1995 PDT"; "Temporary :look_effects() for showing storms active in the area."; pass(@args); storms = $local.rpg.magic_db:print_storms(this); if (storms) player:tell_lines(storms); endif . "***finished***