Generic LRPG Thing #517

Parent Owner Flags Source rpg_march_2006/thing.txt

Aliases: Generic LRPG Thing, thing

39 verbs · 18 properties · 5 children

Verbs

VerbSpecFlagsDefinerLines
gi*ve ha*ndthis to anyrxd#51724
stat*isticsthis none noner#51713
encumbrancethis none this#5171
get_valuethis none this#51725
locationthis none this#5171
set_valuethis none this#51711
recyclethis none thisrx#51722
initializethis none this#51714
#517:set_message(old)this none this#51722
ok_exchangethis none this#51743
g*et t*akethis none nonerxd#5170
conditionthis none this#5177
keep_at_deaththis none this#5175
tell_conditionthis none this#51725
look_selfthis none this#5174
hide_from_look_gearthis none this#5173
look_gear_msgthis none this#5173
claimed_bythis none thisrx#51717
claim_forthis none this#51731
claimthis none nonerxd#51731
unclaim_forthis none this#51716
unclaimthis none nonerxd#51717
set_cond*itionthis none this#51718
destroythis none nonerxd#51713
do_movethis none this#51729
tell_claimedthis none this#5173
set_worththis none thisrxd#5178
get_worth worththis none thisrxd#5173
gluedthis none this#5172
hidden_verbsthis none this#51721
movetothis none this#51753
do_getthis none this#5171
do_updatethis none this#5178
make_fertilethis none this#51712
force_updatethis none this#5172
descriptionthis none this#5176
breakthis none this#51712
use_spell_msg_dbthis none this#5173
set_messagethis none this#51730

Properties

PropertyDefinerFlagsOwnerValue
unique#517rc0
encumbrance#517r0
manufactured#517r743932381
user_settable_messages#517rc{"bully"}
worth#517not readable (E_PERM)
keep_at_death#517r0
condition#517rE_NONE
claimed_by#517r#-1
glued#517rc0
last_action#517r0
use_spell_msg_db#517rc0
odrop_failed_msg#517"%<tries> to drop %t but fails!"
odrop_succeeded_msg#517"%<drops> %t."
otake_succeeded_msg#517"%<picks> up %t."
key#517not readable (E_PERM)
aliases#517{"Generic LRPG Thing", "thing"}
description#517"A tangible object for use in the LambdaMOO RPG."
object_size#517{35709, 1141286558}

Ancestry

Ancestors (nearest first): none

Children: #82 generic weapon, #328 Magic Database, #1387 generic dispenser, #8868 Generic Casting/Armour/View/Freeze/Combat/Magic Effect, #112297 Generic Dyable LRPG Thing

Call graph

calls n517_0 #517:gi*ve n517_9 #517:ok_exchange n517_0->n517_9 n517_30 #517:moveto n517_0->n517_30 n517_28 #517:glued n517_9->n517_28 n517_30->n517_28 n517_24 #517:do_move n517_30->n517_24 n517_3 #517:get_value n517_3->n517_9 n517_3->n517_30 n517_31 #517:do_get n517_3->n517_31 n517_6 #517:recycle n517_17 #517:claimed_by n517_6->n517_17 n517_20 #517:unclaim_for n517_6->n517_20 n517_7 #517:initialize n517_7->n517_20 n517_13 #517:tell_condition n517_11 #517:condition n517_13->n517_11 n517_14 #517:look_self n517_14->n517_13 n517_25 #517:tell_claimed n517_14->n517_25 n517_25->n517_17 n517_18 #517:claim_for n517_18->n517_17 n517_18->n517_20 n517_19 #517:claim n517_19->n517_18 n517_21 #517:unclaim n517_21->n517_20 n517_22 #517:set_cond*ition n517_32 #517:do_update n517_22->n517_32 n517_23 #517:destroy n517_23->n517_30 n517_24->n517_30 n517_24->n517_32 n517_34 #517:force_update n517_34->n517_32 n517_36 #517:break n517_36->n517_30 n517_36->n517_20 n517_38 #517:set_message n517_37 #517:use_spell_msg_db n517_38->n517_37

Source

gi*ve ha*nd

Spec this to anyFlags rxdDefiner #517

Referenced by

none

Source

1"give -- Special RPG give makes sure the exchange is allowed.";
2if ((iobj == $nothing) || (iobj == $failed_match))
3  player:tell("Who do you want to give it to?");
4elseif (iobj == $ambiguous_match)
5  player:tell("I don't know which '", iobjstr, "' you mean.");
6elseif ($object_utils:isa(player.location, #5400))
7  player:tell("We'll have none of that now.");
8elseif (this.location != player)
9  player:tell("You don't have that!");
10elseif (iobj.location != player.location)
11  player:tell("I don't see that person here.");
12elseif (!iobj:acceptable(dobj))
13  msg = `iobj:unacceptable_msg(player, dobj) ! E_VERBNF => tostr(iobj.name, " does not want that item.")';
14  player:tell(msg);
15elseif (this:ok_exchange(player, iobj))
16  this:moveto(iobj);
17  if (this.location == iobj)
18    player:tell("You hand ", this.name, " to ", iobj.name, ".");
19    iobj:tell(player.name, " hands you ", this.name, ".");
20    player:room_announce_all_but({player, iobj}, player:title(), " hands ", this:title(), " to ", iobj:title(), ".");
21  else
22    player:tell("You can't give ", this:title(), " to ", iobj.name, ".");
23  endif
24endif

stat*istics

Spec this none noneFlags rDefiner #517

Referenced by

none

Source

1if ($local.rpg:trusted(valid(cp = caller_perms()) ? cp | player))
2  a = listinsert($object_utils:ancestors(this), this);
3  a = a[1..#517 in a];
4  for y in (a)
5    if ((y.owner == #517.owner) || y.r)
6      for z in (properties(y))
7        player:tell($string_utils:left(z, 20), $string_utils:from_value(this.(z)));
8      endfor
9    endif
10  endfor
11else
12  player:tell("No permission to examine ", this.name, ".");
13endif

encumbrance

Spec this none thisDefiner #517

Referenced by

none

Source

1return this.encumbrance;

get_value

Spec this none thisDefiner #517

Referenced by

Source

1"get/take -- Special RPG get/take makes sure the exchange is allowed.";
2loc = this.location;
3if (loc == player)
4  player:tell("You already have that!");
5elseif ((!valid(loc)) || (loc != player.location))
6  player:tell("I don't see that here.");
7elseif (((loc in $local.rpg.pcs) || $object_utils:isa(loc, $local.puppet)) && (!((valid(cp = caller_perms()) ? cp | player) in $local.rpg.gms)))
8  player:tell("You can't take that.");
9elseif (this:ok_exchange(loc, player))
10  this:moveto(player);
11  if (this.location == player)
12    player:tell(this:take_succeeded_msg() || tostr("You take ", this.name, "."));
13    if (msg = this:otake_succeeded_msg())
14      player.location:announce(player.name, " ", msg);
15    endif
16    this:do_get(loc, player);
17  else
18    player:tell(this:take_failed_msg() || "You can't pick that up.");
19    if (msg = this:otake_failed_msg())
20      player.location:announce(player.name, " ", msg);
21    endif
22  endif
23endif
24"Profane 12-1-95 1216EST Added Validity check line 4";
25"Mooshie (#106469) - Fri Nov  7 19:44:23 1997 PST - Added check to see if we're on a being (RPG or puppet) so things can't port into said being and just pick us up.";

location

Spec this none thisDefiner #517

Referenced by

none

Source

1return this.location;

set_value

Spec this none thisDefiner #517

Referenced by

Source

1":set_value(STR property_name, value) -- Sets this.(property_name) to `value'";
2{prop, value} = args;
3rpg = $local.rpg;
4if (rpg:trusted(cp = caller_perms()) && ((cp in {this.owner, rpg.thing.owner}) || (caller == this)))
5  if (prop == "claimed_by")
6    rpg:log_error((("Unclaim oddity ( Player: " + $string_utils:nn(player)) + " ):") + toliteral(callers()));
7  endif
8  return this.(prop) = value;
9else
10  return E_PERM;
11endif

recycle

Spec this none thisFlags rxDefiner #517

Referenced by

none

Source

1"Added to remove invalid equipment from wielding/wearing.  Quinn (02-MAR-93)";
2if ((caller == this) || $perm_utils:controls(caller_perms(), this))
3  vacuum = (rpg = $local.rpg).vacuum;
4  if (valid(doll = rpg:get_doll(this.location)))
5    doll.wielding = setremove(doll.wielding, this);
6    doll.wearing = setremove(doll.wearing, this);
7    doll.magic_effects = setremove(doll.magic_effects, this);
8  endif
9  who = this:claimed_by();
10  if (valid(who))
11    this:unclaim_for(who);
12  endif
13  vacuum.doomed = setremove(vacuum.doomed, this);
14  if (this in (disp = rpg.dispenser).dispenses)
15    disp:rem_dispensed(this);
16  endif
17  return pass();
18else
19  return E_PERM;
20endif
21"Mooshie (#106469) - Sun Feb  1, 1998 - Remove recycled dispenser objects.";
22"THX (#105941) - Thu Jun 29, 2000 - Remove from .magic_effects too, since Isagi's amphora neglect this step.";

initialize

Spec this none thisDefiner #517

Referenced by

none

Source

1if ((caller == this) || $perm_utils:controls(caller_perms(), this))
2  pass(@args);
3  this:set_name(parent(this).name);
4  this:set_aliases(parent(this).aliases);
5  this.manufactured = time();
6  valid(this.claimed_by) && this:unclaim_for(this.claimed_by);
7  $quota_utils:object_bytes(this);
8else
9  return E_PERM;
10endif
11"Quinn 11-MAR-93 xxxx-ET: Hacked to install default names/aliases of the parent, helpful for GMs who must create from eval. ";
12"Quinn 29-JUL-93 0136-ET: Manufactured stamp added to aid in determining weapon depreciation in the form of rust, dullness.";
13"Quinn 16-DEC-93 1300-ET: $quota_utils:object_size.";
14"Slither 2-June-95 Added initialization of .claimed_by";

#517:set_message(old)

Spec this none thisDefiner #517

Referenced by

none

Source

1":set_message(msgname, newvalue)";
2"Allow adventurers to set certain messages on their equipment.";
3msgname = args[1];
4who = caller_perms();
5if ((caller == this) || $perm_utils:controls(who, this))
6  "... No questions asked.";
7  return pass(@args);
8elseif (!(msgname in (settable = this.user_settable_messages)))
9  return tostr("Sorry, but you aren't allowed to set that message.  You may set the following: ", $string_utils:english_list(settable), ".");
10elseif (this.unique || children(this))
11  return tostr($string_utils:nn(this), " is a unique artifact!  It'd be a crime to alter it.");
12elseif (this.location != who)
13  "... Only allow em to set the message if e's holding the item.";
14  return tostr("You must be holding ", this:title(), " in order to set its messages.");
15elseif (args[2])
16  return pass(@args);
17else
18  "... If empty string, we'll clear the message.  Note this will crash if Grand_Master doesn't own the property.  Temp until I petition for a clearing protocol in $root_class:set_message.";
19  clear_property(this, msgname + "_msg");
20  return 0;
21endif
22"Quinn 31-JUL-93 0244-ET: Added to facilitate customisation by players.";

ok_exchange

Spec this none thisDefiner #517

Referenced by

Source

1":ok_exchange(origin, destination)";
2"Is it okay to move this from 'origin' to 'destination'?";
3"Usually called from thing:give and :get.";
4(rpg = $local.rpg):secure();
5{origin, dest} = args;
6if (!valid(origin))
7  player:tell("I don't understand that.");
8  return 0;
9elseif (glued = this:glued(dest))
10  glued = (typeof(glued) == STR) ? glued | "The %n appears to be fixed in place.";
11  player:tell(strsub(glued, "%n", this.name));
12  return 0;
13elseif (valid(doll = rpg:get_doll(dest)))
14  "... Although we can hack the :get verb, we cannot hack the :give, so may as well put the check here.  (and :tell, since we can't leave it a mystery why the object didn't move)";
15  if (!is_player(who = doll.character))
16    "... Don't bother checking monsters?  The problem is that they can't think freely, and thus adjust their inventory.  Incongruous, yes; but necessary for the time being.  Auto-adjustment would mean extra code, extra ticks, and extra hassle.";
17  elseif (doll:cannot_take(1))
18    return 0;
19  elseif ((!doll:hands_free()) && (length(doll.wielding) >= doll.hands))
20    "Allow players wielding 2-handed weapons to use 1 hand to pick things up.";
21    if (player == who)
22      player:tell("You juggle your inventory in vain, unable to pick up ", this.name, ".  Try emptying your hands.");
23    else
24      player:tell("Sorry, but ", who.name, " has ", who.pp, " hands full.");
25      who:tell(player.name, " tries to give you ", this.name, " but your hands are full.");
26    endif
27    return 0;
28  elseif ((0 && (!(player in $object_utils:contains(player, this)))) && (doll:encumbrance() > 10))
29    "... Removed for now because of very high tick usage and unprofitable reality margin.";
30    "... Too encumbered to carry anything more.";
31    if (player == who)
32      player:tell(tostr("You try to pick up ", this.name, " but the load is too great.  Try dropping something."));
33    else
34      player:tell(tostr("Sorry, but ", who.name, " is carrying too much already."));
35      who:tell(tostr(player.name, " tries to give you ", this.name, " but you can't bear the extra burden."));
36    endif
37    return 0;
38  endif
39  "Quinn 29-JUL-93 0134-ET: Added to :moveto().";
40  "Quinn 31-JUL-93 2210-ET: Code removed from :moveto(), placed in this verb, called by :give and :get.";
41endif
42return 1;
43"THX1138 23-MAR-1997 -- Scatter assignment, s /db/rpg/g 1-$, and cleaned up a bit.";

g*et t*ake

Spec this none noneFlags rxdDefiner #517

Referenced by

none

Source

No program (verb defined but unprogrammed).

condition

Spec this none thisDefiner #517

Referenced by

Source

1":condition() => Return the condition of this object as a percentage of its original 'potency'.  Defaults to 100%.  Leave it to the owner/programmer to hack depreciation.";
2"Probably used most often for purposes of approximating worth.  A basic equation for this would be:";
3"  worth = item:worth() * item:condition() / 100";
4"Provided in consideration of all the math-morons out there.  (Like me!)";
5return this.condition;
6"Quinn 22-AUG-93 1751: Added.";
7"Quinn 30-NOV-93 0429: Return .condition instead of the default 100.";

keep_at_death

Spec this none thisDefiner #517

Referenced by

none

Source

1":keep_at_death([killer])";
2"False if the item be dropped at death.";
3"True if it is a 'natural' weapon, or otherwise shouldn't be left as loot.";
4"The killer is sent, if eir identity is known.";
5return this.keep_at_death;

tell_condition

Spec this none thisDefiner #517

Referenced by

Source

1":tell_condition([condition]) -- Tell player the condition of this item.";
2c = args ? args[1] | this:condition(player, player);
3if (typeof(c) != NUM)
4  return;
5endif
6if (c > 110)
7  player:tell("It is a perfect specimen of its type.");
8elseif (c > 99)
9  player:tell("It is practically new.");
10elseif (c > 90)
11  player:tell("It is in excellent shape.");
12elseif (c > 80)
13  player:tell("It is in very good condition.");
14elseif (c > 60)
15  player:tell("It is in pretty good shape.");
16elseif (c > 40)
17  player:tell("It isn't in terrible shape, but shows obvious signs of wear.");
18elseif (c > 25)
19  player:tell("It has seen quite a lot of use, and it shows.");
20elseif (c > 15)
21  player:tell("It's old and neglected and in pretty bad shape.");
22else
23  player:tell("It's in really bad shape, but you might be able to sell it for scrap.");
24endif
25"Quinn 01-DEC-93 0230: Provided for condition being non-numeric, in which case nothing is printed.";

look_self

Spec this none thisDefiner #517

Referenced by

Source

1":look_self() -- Show condition of an RPG item.";
2pass(@args);
3this:tell_condition();
4this:tell_claimed();

hide_from_look_gear

Spec this none thisDefiner #517

Referenced by

none

Source

1":hide_from_look_gear(doll)";
2"Return true if this equipment (when used by the given voodoo doll's character) should not show up in :look_gear displays.";
3return 0;

look_gear_msg

Spec this none thisDefiner #517

Referenced by

none

Source

1":look_gear_msg(doll)";
2"A special message to be displayed in the :look_gear output when this equipment is being used by the given voodoo doll's character.";
3"Should be a string which, if given, will be the only mention of the item in the :look_gear display.";

claimed_by

Spec this none thisFlags rxDefiner #517

Referenced by

Source

1":claimed_by()";
2"Return who claims this object.  If the property contains a player who no longer has an RPG doll, then return $nothing.";
3if (valid(who = this.claimed_by))
4  if (valid(doll = $local.rpg:get_doll(who)))
5    "if (!(this in doll:claimed_objects()))";
6    "if (doll:add_claimed_object(this) == E_QUOTA)";
7    "this.claimed_by = $nothing;";
8    "endif";
9    "endif";
10  else
11    this.claimed_by = $nothing;
12  endif
13endif
14return this.claimed_by;
15"Profane 11-APR-95 23:38EST - Rewrote. Add objects to doll's list if they somehow aren't on 'em.";
16"Slither 6/7/95 -- commented out code to add object to doll's list.";
17"  There shouldn't be any such leaks, and if there is, I want to know!";

claim_for

Spec this none thisDefiner #517

Referenced by

Source

1":claim_for(who[, ignore_quota])";
2"-> E_PERM,   caller is not a GM.";
3"-> E_NONE,   this is already claimed by given person.";
4"-> E_NACC,   claimed by someone else who won't let it go.";
5"-> E_INVARG, who is not illuminated.";
6"-> E_TYPE,   the object simply cannot be claimed (usable for a gm's custom objects).";
7"If ignore_quota is given and true, the E_QUOTA condition will not occur.";
8"-> E_QUOTA,  who has claimed eir max amount of objects.";
9who = args[1];
10rpg = $local.rpg;
11if (!rpg:trusted(caller_perms()))
12  return E_PERM;
13elseif (valid(old = this:claimed_by()))
14  if (old == who)
15    return E_NONE;
16  else
17    this:unclaim_for(old);
18  endif
19endif
20if (valid(this:claimed_by()))
21  return E_NACC;
22elseif (!valid(doll = rpg:get_doll(who)))
23  return E_INVARG;
24endif
25ignore_quota = (length(args) > 1) && args[2];
26if (!(result = doll:add_claimed_object(this, ignore_quota)))
27  return result;
28else
29  this.claimed_by = who;
30  return 1;
31endif

claim

Spec this none noneFlags rxdDefiner #517

Referenced by

none

Source

1"claim <item>";
2"Claim this item as your own, preventing it from being swept.";
3"One may only claim as many objects as their doll's max_claims allows.";
4rpg = $local.rpg;
5who = valid(cp = caller_perms()) ? rpg:trusted(cp) ? player | cp | player;
6if (this.location != who)
7  who:tell("You aren't holding ", this.name, ".");
8  return E_RANGE;
9endif
10if (children(this))
11  "Keep players from claiming items that have kids.";
12  return player:tell("this is a generic ", this.name, " and shouldn't be claimed. Please report to a GM or G_M how you got it, because these items should not be out of the vault.");
13endif
14result = this:claim_for(who);
15if (result == E_NONE)
16  who:tell("You already hold a claim to ", this.name, ".");
17elseif (result == E_INVARG)
18  who:tell("You have no need for such an item.  Perhaps if you were involved in ancient bovine cult...");
19elseif (result == E_QUOTA)
20  who:tell("No more claims can be accepted until you revoke some of your earlier ones.  Go to the Department of Environmental Protection for more info.");
21elseif (result == E_NACC)
22  old = this.claimed_by;
23  who:tell(old:titlec(), " won't give up ", old.pp, " claim.");
24elseif (result == E_TYPE)
25  who:tell("Such an item is not claimable.");
26elseif (this.claimed_by == who)
27  who:tell("You stake your claim to ", this:title(), ".");
28else
29  who:tell("You can't seem to claim that object.  Please contact a GM.");
30endif
31return result;

unclaim_for

Spec this none thisDefiner #517

Referenced by

Source

1":unclaim_for(who)";
2"-> E_PERM,   caller is not a GM.";
3"-> E_NONE,   this is not currently claimed by the given person.";
4{who} = args;
5(rpg = $local.rpg):secure();
6if (this.claimed_by != who)
7  return E_NONE;
8elseif (valid(doll = rpg:get_doll(who)))
9  doll:remove_claimed_object(this);
10endif
11if (parent(this).claimed_by == $nothing)
12  clear_property(this, "claimed_by");
13else
14  this.claimed_by = $nothing;
15endif
16return 1;

unclaim

Spec this none noneFlags rxdDefiner #517

Referenced by

none

Source

1"unclaim <item>";
2"Remove all claims you have to the object, freeing it to be claimed by someone else, or swept up.";
3rpg = $local.rpg;
4if (valid(cp = caller_perms()))
5  who = rpg:trusted(cp) ? player | cp;
6else
7  who = player;
8endif
9result = this:unclaim_for(who);
10if (result == E_NONE)
11  who:tell("You don't hold any claim to that.");
12elseif (this.claimed_by != who)
13  who:tell("You revoke your claim to ", this:title(), ".");
14else
15  who:tell("You can't seem to revoke your claim to that object.  Please contact a GM.");
16endif
17return result;

set_cond*ition

Spec this none thisDefiner #517

Referenced by

none

Source

1":set_condition(NUM) => NUM condition -- Set the .condition of the object.";
2{cond} = args;
3rpg = $local.rpg;
4if (!rpg:trusted(caller_perms()))
5  return E_PERM;
6elseif (this in rpg.dispenser.dispenses)
7  return E_TYPE;
8elseif (children(this))
9  return E_NACC;
10elseif (typeof(this.condition) != NUM)
11  return E_INVIND;
12elseif (typeof(cond) != NUM)
13  return E_INVARG;
14else
15  (cond > 245) && rpg:log_error(tostr("RPG item condition exceeds 245 (", cond, ").   Player: ", $string_utils:nn(player), "   Doll: ", $string_utils:nn(rpg:get_doll(player)), "    Room Effects: ", $string_utils:nn(`player.location.magic_effects ! ANY => $nothing'), "   Callers(): ") + toliteral(callers(1)));
16  this.last_action && this:do_update();
17  return this.condition = cond;
18endif

destroy

Spec this none noneFlags rxdDefiner #517

Referenced by

none

Source

1if (!(rpg = $local.rpg):trusted(callers() ? caller_perms() | player))
2  player:tell("How do you plan to do that?");
3  return E_PERM;
4elseif (!rpg.vacuum:killable(this))
5  if (!callers())
6    player:tell("Whoa pal, that's a little too valuable to just destroy off-handedly.");
7  endif
8else
9  this:room_announce_all(this:titlec(), " wavers and then vanishes into the aether.");
10  this:moveto($nothing);
11  rpg.recycler:_recycle(this);
12endif
13"Profane 5-AUG-96 1714PDT - Added";

do_move

Spec this none thisDefiner #517

Referenced by

Source

1":do_move(oldloc, newloc) => Do whatever would be appropriate if the item moved from oldloc to newloc.";
2{oldloc, newloc} = args;
3(rpg = $local.rpg):secure();
4for location in ({newloc, oldloc})
5  where = location;
6  while (where != $nothing)
7    if (valid(doll = rpg:get_doll(where)))
8      doll.weight = $nothing;
9    endif
10    where = where.location;
11  endwhile
12endfor
13"if (rpg.object_db:is_money(this) && (!this.quantity))";
14"((newloc == #10555) || (callers()[3][2] == \"get_collective\")) || rpg:log_error(\"$0 money moved. \" + toliteral(callers(1)))";
15"endif";
16if (valid(doll = rpg:get_doll(newloc)))
17  doll:misc_effects("notify_move", this, oldloc, newloc);
18  rpg.object_db.magnetic_object_heart:heartbeat();
19endif
20if (!valid(newloc))
21elseif (((newloc.owner in rpg.gms) || (newloc in rpg.pcs)) || (!`this:no_hoarding(newloc) ! E_VERBNF'))
22  (this.last_action || ((`is_player(newloc) ! ANY' && (this.owner == rpg.owner)) && (!(newloc in rpg.gms)))) && this:do_update();
23else
24  this:moveto(rpg.cemetery);
25endif
26"THX - 25-Apr-1997 -- Updated security and used args instead of {args[1], args[2]} for tick reasons.";
27"Profane (#30788) - Sun May  2, 1999 - new hook for backfire spell effect";
28"Profane (#30788) - Fri Dec 29, 2000 - call _misc_effects and move backfire shiznit off into a misc_effect call";
29"Profane (#30788) - Mon Apr 16, 2001 - New paradigm for magnetic object checking- call when someone picks some stuff up.";

tell_claimed

Spec this none thisDefiner #517

Referenced by

Source

1if (valid(who = this:claimed_by()))
2  player:tell(who:titlec(), " has scratched ", who.pp, " crude insignia onto the object.");
3endif

set_worth

Spec this none thisFlags rxdOwner #90864Definer #517

Referenced by

none

Source

1"item:set_worth(cost)";
2if (!(caller_perms() in {this.owner, $code_utils:verb_loc().owner, @$local.rpg.grand_masters}))
3  return E_PERM;
4elseif (length(args) < 1)
5  return E_INVARG;
6else
7  return this.worth = args[1];
8endif

get_worth worth

Spec this none thisFlags rxdOwner #90864Definer #517

Referenced by

none

Source

1"item:get_worth() - returns the .worth of an object.";
2$local.rpg:secure();
3return this.worth;

glued

Spec this none thisDefiner #517

Referenced by

Source

1":glued(OBJ dest) => 0 or 1  Is the object \"glued\" down if we try to move it to dest?";
2return this.(verb);

hidden_verbs

Spec this none thisDefiner #517

Referenced by

Source

1{who} = args;
2prev = pass(who);
3thing = (rpg = $local.rpg).thing;
4if (this.location == who)
5  prev = {@prev, {thing, "g*et t*ake", {"this", "none", "none"}}};
6  prev = {@prev, {$thing, "g*et t*ake", {"this", "none", "none"}}};
7else
8  prev = {@prev, {thing, "gi*ve ha*nd", {"this", "at/to", "any"}}};
9  prev = {@prev, {$thing, "gi*ve ha*nd", {"this", "at/to", "any"}}};
10  prev = {@prev, {$thing, "d*rop th*row", {"this", "none", "none"}}};
11endif
12if (!rpg:trusted(who))
13  prev = {@prev, {thing, "stat*istics", {"this", "none", "none"}}};
14  prev = {@prev, {thing, "destroy", {"this", "none", "none"}}};
15endif
16if (!valid(this.claimed_by))
17  prev = {@prev, {thing, "unclaim", {"this", "none", "none"}}};
18else
19  prev = {@prev, {thing, "claim", {"this", "none", "none"}}};
20endif
21return prev;

moveto

Spec this none thisDefiner #517

Referenced by

Source

1"Usage: moveto(OBJ new location)";
2"Some quick hacks to make sure this isn't being moved by the wrong people.";
3if (`caller.dest ! ANY' in {E_PROPNF, E_INVIND})
4elseif (caller != this)
5  $local.rpg:log_error((((("Attempt to move object via exit " + $string_utils:nn(caller)) + " owned by ") + tostr(`$string_utils:nn(caller.owner) ! ANY')) + "  :  ") + toliteral(callers()));
6  return E_PERM;
7endif
8cp = (caller_perms() in (rpg = $local.rpg).probation) ? $no_one | caller_perms();
9{dest} = args;
10if (valid(dest) || (cp in rpg.gms))
11elseif (caller != this)
12  for t in (callers())
13    if (index(t[2], "eject") && t[3].wizard)
14      rpg.vacuum:back_in_play(this);
15    endif
16  endfor
17endif
18doll = rpg:get_doll(place = this.location);
19if (this:glued(dest) || (((valid(doll) && valid(dest)) && (dest.location == place)) && (!(dest.owner in rpg.gms))))
20  return 0;
21endif
22if (cp in rpg.gms)
23  pass(dest);
24elseif ((((caller == place) || ((caller == this) && (caller_perms() == place))) && valid(dest)) && ((dest in {place.location, place}) || (dest.location == place)))
25  pass(dest);
26elseif (cp.wizard)
27  (callers()[1][2] == "eject") || rpg:log_error((((("Wizard-permed move via " + $string_utils:nn(caller)) + " owned by ") + tostr(`$string_utils:nn(caller.owner) ! ANY')) + "  :  ") + toliteral(callers()));
28  pass(dest);
29else
30  return 0;
31endif
32if (((place != this.location) && valid(this)) && (parent(this) != $garbage))
33  this:do_move(place, this.location);
34endif
35return 0;
36"Don't allow move if:";
37" - this.owner doesn't want it moved (i.e. :glued)";
38" - or, calling perms are in rpg.probation";
39" - or, a non-GM object is trying to get it from a location with a doll";
40"";
41"Otherwise, allow move if:";
42" - calling perms are in rpg.gms";
43" - we're being moved by a wizard";
44" - our location is moving us to a) something else in our location, or b) our location's location";
45"";
46"NOTE: Do *NOT* allow rpg.exporters to move. This allows pretty much everyone to be able to move anything.";
47"Mooshie (#106469) - Tue Dec 30, 1997 - Completely re-wrote this puppy.";
48"THX (#105941) - Wed Jan 14, 1998 - Added no-extra-tick code to allow movement by .wizards.  s /@args/dest/ to save a tick.  La!";
49"Irin - Sat May 23 13:44:16 1998 PDT - exits may not move RPG objects.";
50"THX (#105941) - Fri Dec  4, 1998 - Turn probated gamemaster perms into $no_one's.";
51"Mooshie (#106469) - Tue Jan 12, 1999 - Stopped allow the move if 'caller == this,' since stuff like $thing:drop can be hacked.";
52"Profane (#30788) - Tue Jan 12, 1999 - I dunno what mooshie did, but it screwed up dropping, so I did s/caller == place/caller in {place, this}/20";
53"Mooshie (#106469) - Wed Jan 13, 1999 - Ok, changed the line 20 check again so that, if caller == this, then caller_perms() has to be the current location. This should work (I hope!) since $thing:drop and the like do set_task_perms().";

do_get

Spec this none thisDefiner #517

Referenced by

Source

1{oldloc, newloc} = args;

do_update

Spec this none thisDefiner #517

Referenced by

Source

1if (this == $local.rpg.thing)
2  "... do nothing to the generic ...";
3elseif (caller == this)
4  {?amount = time() + 2500000} = args;
5  this.last_action = max(amount, this.last_action);
6else
7  return E_PERM;
8endif

make_fertile

Spec this none thisDefiner #517

Referenced by

none

Source

1"Usage: make_fertile()  => Makes this temporarily fertile if permitted.";
2"       make_fertile(1) => Resets this to unfertile.";
3$local.rpg:secure();
4if (args)
5  this.f = 0;
6elseif (this.f)
7else
8  this.f = 1;
9  fork (0)
10    this.f = 0;
11  endfork
12endif

force_update

Spec this none thisDefiner #517

Referenced by

none

Source

1$local.rpg:secure();
2this:do_update(@args);

description

Spec this none thisDefiner #517

Referenced by

Source

1rpg = $local.rpg;
2if (index(callers()[$][2], "@exam") && (!(player in {@rpg.gms, @rpg.wannabees})))
3  player:tell("Use 'examine' rather than '@examine' to look at LambdaRPG equipment.");
4  kill_task(task_id());
5endif
6return pass(@args);

break

Spec this none thisDefiner #517

Referenced by

none

Source

1":break() -- Make the weapon break. Instead of recycling it, we just move it to the cemetery and let the regular reaping take care of it.";
2{?announce = 1} = args;
3(rpg = $local.rpg):secure();
4dumpdest = (((loc = this.location) in rpg.pcs) || is_player(loc)) ? loc.location | loc;
5announce && rpg:rpg_announce_all_but(dumpdest, {}, this:titlec(), " falls apart into nothingness!");
6this:unclaim_for(this.claimed_by);
7(announce && this.contents) && rpg:rpg_announce_all_but(dumpdest, {}, "A ", $string_utils:english_list($list_utils:map_prop(this.contents, "name")), (length(this.contents) > 1) ? " spill" | " spills", " out of the remains of the ", this:title(), "!");
8for t in (this.contents)
9  t:moveto(dumpdest);
10endfor
11this:moveto(rpg.cemetery);
12"THX (#105941) - Wed Mar 22, 2000 - Added a splurge for dumping out the contents first and added an optional argument for suppressing the announcements.";

use_spell_msg_db

Spec this none thisDefiner #517

Referenced by

Source

1":use_spell_msg_db(STR message to set)";
2"Determines if a spellcast message may be player-set. The STR is in the form of 'SPELL_cast' or 'SPELL_cast_self'.";
3return this.(verb);

set_message

Spec this none thisDefiner #517

Referenced by

none

Source

1":set_message(msgname, newvalue)";
2"Allow adventurers to set certain messages on their equipment.";
3{msgname, value} = args;
4who = caller_perms();
5if ((caller == this) || $perm_utils:controls(who, this))
6  "... No questions asked.";
7  return pass(@args);
8elseif (this.unique || children(this))
9  return tostr($string_utils:nn(this), " is a unique artifact!  It'd be a crime to alter it.");
10elseif (this.location != who)
11  "... Only allow em to set the message if e's holding the item.";
12  return tostr("You must be holding ", this:title(), " in order to set its messages.");
13elseif (!(msgname in (settable = this.user_settable_messages)))
14  if (!this:use_spell_msg_db(msgname))
15    return tostr("Sorry, but you aren't allowed to set that message.  You may set the following: ", $string_utils:english_list(settable), ".");
16  elseif ((!value) || (value == `parent(this).(msgname) ! ANY => !value'))
17    "Clear the message!";
18    value = 0;
19  elseif ((!(all = $local.rpg.magic_db.spell_msg_db:find_exact(msgname))) || (!(value in all)))
20    "If the message isn't vetted....";
21    return tostr("Sorry, but that is an invalid value for that message. Consult ", $string_utils:nn($local.rpg.magic_db.spell_msg_db.chalkboard), " for acceptable values.");
22  endif
23endif
24if (value)
25  return pass(@args);
26else
27  "... If empty string, we'll clear the message.  Note this will crash if Grand_Master doesn't own the property.  Temp until I petition for a clearing protocol in $root_class:set_message.";
28  clear_property(this, msgname + "_msg");
29  return 0;
30endif