A dump of #9338 (Contain) @create #2409 named generic RPG container:generic RPG container @prop #9338."percent" 100 r @prop #9338."max" 0 r @prop #9338."accept_gem_payment" 1 rc @prop #9338."store_action" "stores" rc @prop #9338."nostash" {} rc ;;#9338.("nostash") = {#27481} ;;#9338.("manufactured") = 923451666 ;;#9338.("worth") = -1 ;;#9338.("condition") = 100 ;;#9338.("odrop_failed_msg") = "% to drop %t but fails!" ;;#9338.("odrop_succeeded_msg") = "% %t." ;;#9338.("otake_succeeded_msg") = "% up %t." "#9338.("key") => E_PERM (Permission denied) ;;#9338.("aliases") = {"generic RPG container"} ;;#9338.("description") = "A non-weapon, non-armour piece of equipment that an end user of the system (player) might use in a VR way." ;;#9338.("object_size") = {14157, 1141286561} @verb #9338:"encumbrance" this none this @program #9338:encumbrance ".percent is amount of encumbrance offset by the container."; ".max is the maximum amount of encumbrance that can be offset."; {?doll = $nothing} = args; load = this.encumbrance + $local.rpg:weight(this, doll); if (this:is_useful_for(this.location)) offset = ((percent = (load * this.percent) / 100) > this.max) ? this.max | percent; return load - offset; else return load; endif . @verb #9338:"acceptable" this none this @program #9338:acceptable "Hacked to allow kids of $thing (including $local.rpg.equipment) only."; {item} = args; if ((item == #63585) && (this == #101591)) return 1; endif if ($object_utils:isoneof(item, this.nostash)) return 0; endif return $local.rpg.object_db:is_thing(item); . @verb #9338:"re*move ex*tract rec*over ge*t ta*ke" any from this rxd @program #9338:remove dobj = $match_utils:match(dobjstr, this.contents); if ((!(caller in {this, player, $match_utils})) && (!$local.rpg:trusted(caller_perms()))) player:tell("See Grand_Master about remote calls to this verb."); elseif (!(this.location in {player, player.location})) player:tell("You don't have ", this.name, " with you."); elseif (!valid(doll = $local.rpg:get_doll(player))) player:tell(this.name, " seems to have some sort of childproof lock."); elseif (doll:cannot_move(1)) elseif (!($local.rpg:trusted_verb(this, "opened") ? this:opened() | this:is_unlocked_for(player))) player:tell(this.name, " seems to be locked."); elseif (dobjstr in {"all", "everything"}) this:transfer_all(verb, this); elseif ($command_utils:object_match_failed(dobj, dobjstr)) return; elseif (dobj.location != this) player:tell(this.name, " doesn't contain ", dobj.name, "."); elseif ((!$object_utils:isa(dobj, $local.rpg.equipment)) || dobj:ok_exchange(this, player)) dobjname = dobj.name; dobj:moveto(player); if (dobj.location == player) player:tell("You remove ", dobjname, " from ", this.name, "."); player.location:announce(player.name, " removes ", dobjname, " from ", this.name, "."); this.last_action && this:do_update(); "doll:invite(doll.slowness / 2)"; else player:tell("You can't seem to get ", dobjname, " out of ", this.name, "."); endif endif "Quinn 01-AUG-93 0325: Hacked to handle 'all', and to check :ok_exchange."; . @verb #9338:"look_self" this none this @program #9338:look_self pass(@args); this:tell_contents(this:contents()); "Quinn 01-AUG-93 0219: Re-written, cleaned up; will eliminate improper calls to :contents after informing those who've programmed the verbs."; "Quinn 01-DEC-93 0219: oH screw it. Just made a call to :tell_contents. Let the tbks report the sorry folk who used :contents wrong."; . @verb #9338:"transfer_all" this none this @program #9338:transfer_all ":transfer_all(verb, from) -- Handle cache/retrieve 'all' or 'everything'."; "'verb' each object in the contents of 'from'."; (rpg = $local.rpg):secure(); {xfer, from} = args; gms = rpg.gms; equipment = rpg.equipment; ou = $object_utils; if (contents = setremove(from.contents, this)) while (contents && (this.location in {player, player.location})) if (((thing = contents[1]).owner in gms) && ou:isa(thing, equipment)) this:(xfer)(dobjstr = tostr(dobj = thing)); endif rpg:s_i_n(0); "if ((seconds_left() < 2) || (ticks_left() < 8000))"; " rpg:stop_time(0);"; "endif"; contents = listdelete(contents, 1); endwhile else player:tell(from.name, " is empty", valid(rpg:get_doll(from)) ? "-handed." | "."); endif "Quinn 01-AUG-93 0326: Added."; "Quinn 09-AUG-93 0735: Changed to xfer RPG equipment only."; "THX 26-Oct-1997 -- Updated code to 1.8.0 and hacked to 'get' tostr(objnum) instead of object.name to avoid duplicity problems. Also check for gm ownership to reduce :isa() calls."; . "#9338:6 --- Permission denied"; @verb #9338:"@opacity" this is any @program #9338:@opacity "Copied from generic container (#8):@opacity by Nosredna (#2487) Sat Jan 20 05:59:53 1996 PST"; if (!$perm_utils:controls(player, this)) player:tell("Can't set opacity of something you don't own."); elseif ((iobjstr != "0") && (!tonum(iobjstr))) player:tell("Opacity must be an integer (0, 1, 2)."); else player:tell("Opacity changed: Now " + {"transparent.", "opaque.", "a black hole."}[1 + this:set_opaque(tonum(iobjstr))]); endif . @verb #9338:"list_contents" this none this rx @program #9338:list_contents "Copied from Isagi's orb (#21327):list_contents by Isagi (#21077) Sat Jul 20 17:03:16 1996 PDT"; item_list = args[1]; temp = {}; for item in (item_list) temp = listappend(temp, item:title()); endfor temp2 = {}; for item in (temp) number = length(temp) - length(temp = $list_utils:setremove_all(temp, item)); if (number == 1) temp2 = listappend(temp2, item); endif if (number > 1) temp2 = listappend(temp2, ($string_utils:english_number(number) + " ") + $local.rpg.user_utils.isagi:plural(substitute("%3", match(item, "%(%<%(a%|an%) +%)?%(.*%)")))); endif endfor return temp2; "Profane (#30788) - Wed Mar 13, 2002 - strip indefinite article in titles for plural items"; . @verb #9338:"tell_contents" this none this rx @program #9338:tell_contents "Copied from Isagi's orb (#21327):tell_contents by Isagi (#21077) Sat Jul 20 17:03:24 1996 PDT"; if (contents = this:contents()) player:tell("Contents:"); su = $string_utils; string = su:english_list(this:list_contents(contents)); string = su:capitalize(string) + "."; player:tell(string); elseif (msg = this:empty_msg()) player:tell(msg); endif . @verb #9338:"set_opaque" this none this @program #9338:set_opaque "Copied from generic container (#8):set_opaque by Nosredna (#2487) Mon Jul 7 19:41:01 1997 PDT"; if (!$perm_utils:controls(caller.owner, this)) return E_PERM; elseif (typeof(number = args[1]) != INT) return E_INVARG; else number = (number < 0) ? 0 | ((number > 2) ? 2 | number); this.dark = number > this.opened; return this.opaque = number; endif . @verb #9338:"is_useful_for" this none this @program #9338:is_useful_for return 1; . @verb #9338:"acceptable(obsolete)" this none this @program #9338:acceptable(obsolete) "Hacked to allow kids of $thing (including $local.rpg.equipment) only."; if ((item == #63585) && (this == #101591)) return 1; endif {item} = args; return $local.rpg.object_db:is_thing(item); "return !(is_player(args[1]) || valid(#46:get_doll(args[1])));"; . @verb #9338:"transfer_funds" this none this @program #9338:transfer_funds if (caller == this) $local.rpg:log_error(tostr($string_utils:nn(this), " Argstr: ", argstr, " ", $string_utils:nn($object_utils:locations(this)), " ", $string_utils:nn(player), " ", $string_utils:nn(player.location), " ", toliteral(callers(1)))); endif return 0; . @verb #9338:"pu*t ins*ert st*ore ca*che" any in this rxd @program #9338:put if (!valid(dobj)) dobj = $match_utils:match(dobjstr, player.contents); "dobj = player.location:match(dobjstr);"; endif {str_u} = {$string_utils}; if ((!(caller in {this, player, $match_utils})) && (!$local.rpg:trusted(caller_perms()))) player:tell("See Grand_Master about remote calls to this verb."); elseif ((this.location != player) && (this.location != player.location)) player:tell(str_u:pronoun_sub("You don't have %t with you.")); elseif (!valid(doll = (rpg = $local.rpg):get_doll(player))) player:tell(str_u:pronoun_sub("%T seems to have some sort of childproof lock.")); elseif (doll:cannot_move(1)) elseif (!this:is_unlocked_for(player)) player:tell(str_u:pronoun_sub("%T seems to be locked.")); elseif (dobjstr in {"all", "everything"}) this:transfer_all(verb, player); elseif ($command_utils:object_match_failed(dobj, dobjstr)) return; elseif (dobj.location != player) player:tell("You don't have that."); else dobj_name = dobj.name; dobj:moveto(this); if (dobj.location == this) fork (0) rpg:say_action(("%N %<" + this.store_action) + "> %d in %t."); if (rpg.object_db:is_money(dobj) || rpg.object_db:is_missile_ammo(dobj)) player:tell(str_u:pronoun_sub("%T now contains %d.")); endif endfork this.last_action && this:do_update(); "doll:invite(doll.slowness / 2)"; else player:tell(str_u:pronoun_sub("You can't seem to fit %d into %t.")); endif endif "Quinn 01-AUG-93 0325: Hacked to handle 'all'."; "Hydros (#106189) - Sun Nov 27, 2004 - Changed to use $match_utils:match() instead of player.location:match() to allow for precise matching even when not in the RPG."; "Hydros (#106189) - Tue Mar 8, 2005 - Split the storing message into two parts: how much we put in, and how much we end up with total."; . @verb #9338:"put(old)" this none this rd @program #9338:put(old) "Args used to be any in this"; if (!valid(dobj)) dobj = $match_utils:match(dobjstr, player.contents); "dobj = player.location:match(dobjstr);"; endif if ((!(caller in {this, player, $match_utils})) && (!$local.rpg:trusted(caller_perms()))) player:tell("See Grand_Master about remote calls to this verb."); elseif ((this.location != player) && (this.location != player.location)) player:tell("You don't have ", this.name, " with you."); elseif (!valid(doll = $local.rpg:get_doll(player))) player:tell(this.name, " seems to have some sort of childproof lock."); elseif (doll:cannot_move(1)) elseif (!this:is_unlocked_for(player)) player:tell(this.name, " seems to be locked."); elseif (dobjstr in {"all", "everything"}) this:transfer_all(verb, player); elseif ($command_utils:object_match_failed(dobj, dobjstr)) return; elseif (dobj.location != player) player:tell("You don't have that."); else dobj:moveto(this); if (dobj.location == this) player:tell("You", this.store_action, " ", dobj.name, " in ", this.name, "."); player.location:announce(player.name, this.store_action, "s ", dobj.name, " in ", this.name, "."); this.last_action && this:do_update(); "doll:invite(doll.slowness / 2)"; else player:tell("You can't seem to fit ", dobj.name, " into ", this.name, "."); endif endif "Quinn 01-AUG-93 0325: Hacked to handle 'all'."; "Hydros (#106189) - Sun Nov 27, 2004 - Changed to use $match_utils:match() instead of player.location:match() to allow for precise matching even when not in the RPG."; . "***finished***