generic puppet #116

Parent #91Owner #36Flags read, fertileSource RPG Core/rpgcore-patched.db

Aliases: generic puppet, puppet

21 verbs · 103 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
take_hitthis none thisrxd#11623
diethis none thisrxd#11642
birththis none thisrxd#11611
_forcethis none thisrxd#11622
@start @stopthis none nonerd#11623
random_freethis none thisrxd#1164
to_defendthis none thisrxd#1166
tellthis none thisrxd#1169
watch ignorethis none nonerxd#11618
saythis none thisrxd#11618
direct_saythis none thisrxd#11625
l*ookthis none thisrxd#11650
goany any anyrxd#11616
wandernone none nonerxd#11643
look_selfthis none thisrxd#11625
pass_outthis none thisrxd#11619
init_for_corethis none thisrxd#11616
_lootthis none thisrxd#11622
@addlang*uage @add-lang*uageany at/to thisrd#11612
@rmlang*uage @rm-lang*uageany out of/from inside/from thisrd#11613
askthis any anyrxd#11687

Properties

PropertyDefinerFlagsOwnerValue
my_tell#116rw#360
watchers#116r#36{}
terrain_only#116rc#360
enemy#116r#36#-1
hostility#116rc#361
gestate#116rc#3630
birth_msg#116rc#36"%N %<unfades> from non-being."
wander_task#116r#360
wait_seconds#116rc#36480
controller#116rc#36#-1
death_msg#91rc#36<clear>
alive#91r#36<clear>
alert#91r#36<clear>
mobile#91r#36<clear>
wielded#91r#36#110
last_paged#91r#36<clear>
last_healed#91r#36<clear>
followed_by#91r#36<clear>
following#91r#36<clear>
free_points#91r#360.0
stats#91r#36<clear>
stats_current#91r#36<clear>
skills#91r#36<clear>
race#91r#36<clear>
org#91r#36""
money#91r#36<clear>
follow_msg#91rc#36<clear>
stopfollow_msg#91rc#36<clear>
searching#91r#36<clear>
languages#91r#36{{#142}, {2.0}}
speaking#91r#36<clear>
remembered_names#91r#36{}
short_desc_msg#91r#36""
_mail_task#40rc#36<clear>
messages_going#40c#36<clear>
mail_lists#40rc#36<clear>
mail_notify#40r#2<clear>
mail_forward#40rc#36<clear>
mail_options#40rc#36{}
message_keep_date#40rc#36<clear>
messages_kept#40rc#36<clear>
current_message#40c#36{0, -1300000000}
messages#40c#36<clear>
ansi_options#95r#36<clear>
replace_codes#95r#36<clear>
features#6r#36<clear>
previous_connection#6#2<clear>
email_address#6#2<clear>
last_disconnect_time#6r#2<clear>
help#6rc#360
more_msg#6rc#36<clear>
linetask#6r#36<clear>
linesleft#6r#36<clear>
linebuffer#6#36<clear>
pagelen#6r#36<clear>
owned_objects#6r#2<clear>
linelen#6r#36<clear>
current_folder#6c#36<clear>
all_connect_places#6#2<clear>
last_connect_place#6#2<clear>
brief#6rc#36<clear>
lines#6c#36<clear>
page_absent_msg#6rc#36<clear>
pq#6rc#36<clear>
pqc#6rc#36<clear>
page_origin_msg#6rc#36<clear>
page_echo_msg#6rc#36<clear>
edit_options#6rc#36<clear>
last_connect_time#6r#2<clear>
ownership_quota#6#36<clear>
gender#6rc#36<clear>
prc#6rc#36<clear>
ppc#6rc#36<clear>
poc#6rc#36<clear>
psc#6rc#36<clear>
pr#6rc#36<clear>
pp#6rc#36<clear>
po#6rc#36<clear>
ps#6rc#36<clear>
home#6rc#36#62
password#6#2<clear>
gaglist#6rc#36<clear>
paranoid#6rc#36<clear>
display_options#6rc#36<clear>
verb_subs#6rc#36<clear>
first_connect_time#6r#2<clear>
size_quota#6#36<clear>
last_password_time#6#2<clear>
last_connect_attempt#6#2<clear>
page_count_start_time#6r#2<clear>
ping_task#6r#36<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#36
list of 73{"**** IMPORTANT - USE '@MOVE' INSTEAD OF 'GET' & 'DROP' TO MOVE PUPPETS! ****", "", "The generic puppet can receive input (as if it were a player) through the '_force' verb.", "Here are some examples:", "", "puppet:_force(\"give beer to Wally\")", "", "puppet:_force(STRING)", "", "puppet:_force(verb,\" \",dobj,\" \",prep,\" \",iobj)", "", "puppet:_force(argstr)", "", "puppet:_force(verb,\" \",@args)", "", "See \"help $puppet_strings\" for information on how to directly access the :_force() verb.", "", "--WANDER--", "The 'wander' verb tells the puppet to look for a random exit and take it.", "If the '.terrain_only' property is turned on, the puppet will only wander within a terrain.", "puppet:_force(\"wander\")", "", "--@ADDLANG @RMLANG--", "\"@addlang*uage/@add-lang*uage <language> to <puppet>\" => makes $puppet proficient.", "\"@rmlang*uage/@rm-lang*uage <language> from <puppet>\" => removes proficiency.", "", "--@START @STOP <puppet>--", "\"@start <puppet>\" schedules the puppet to wander using the $scheduler.", "\"@stop <puppet>\" removes the task from the $scheduler.", "\"@set puppet.wait_seconds to <seconds>\" to alter the rate of wandering.", "Default wait is 8 minutes.", "", "--WATCH IGNORE--", "'Watch' lets you get a glimpse at what the puppet is 'told'.", "You must be an administrator or the puppet's owner to watch a puppet.", "'Ignore' allows you to stop watching.", "watch <puppet>", "ignore <puppet>", "", "--BUILDING ON THE PUPPET--", "There are only a few things to know about building new puppets and automations(\"bots\") from the generic puppet:", "", "1) All normal player verbs can be called from puppet:_force(),", " no direct calls are needed.", " ", "2) If you don't want your puppet to hear its own actions, there is a property", " called 'my_tell' that is writable.", "", " \"Turn off listening.\";", " this.my_tell = 1;", " \"Puppet does something he doesn't want to hear himself do.\";", " puppet:_force(\"say \",keyword)", " \"Turn on listening.\";", " this.my_tell = 0;", " ", " If you write a custom 'tell' verb, make sure you pass(@args).", " If you write a custom 'tell' verb that invokes different responses, make sure", " you check 'my_tell' to keep the bot from invoking it's own responses and", " causing an endless loop. If an endless 'tell loop' happens, all you can do is", " erase the 'tell' verb to stop it.", " ", "3) You can set the props on the puppet that you own, such as stats, skills, alert,", " alive, race, org, description, etc. The '.gestate' property determines how many", " seconds it will be before a slain puppet is reborn at it's '.home'. You may wish", " to set <puppet>.home to an ooc area or the dead zone (#666) so you can put the", " puppet back into play manually.", " ", "4) The puppet will be viewed as 'awake' until you set its '.alert' prop to 0.", "", "5) The puppet has a '.hostility' property, set by default to 1. This means it", " will automatically retaliate an attack. A setting of 0 means the puppet", " responds by trying to escape. You can write verbs that use higher settings of", " hostility to increase the violence level of the puppet."}
key#1c#360
aliases#1r#2{"generic puppet", "puppet"}
description#1rc#36<clear>
object_size#1r#36{33312, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #91 generic gamer#40 Generic Mail Receiving Player#95 ANSI PC#6 generic player#102 subthing#1 Root Class

Children: #134 Salesperson

Call graph

calls n116_0 #116:take_hit n91_22 #91:damage n116_0->n91_22 n116_3 #116:_force n116_0->n116_3 n91_21 #91:armor n116_0->n91_21 n116_1 #116:die n116_0->n116_1 n20_56 #20:first_word n116_3->n20_56 n116_9 #116:say n116_3->n116_9 n52_6 #52:ancestors n116_1->n52_6 n116_15 #116:pass_out n116_1->n116_15 n20_34 #20:pronoun_sub n116_1->n20_34 n116_7 #116:tell n116_1->n116_7 n91_26 #91:title n116_1->n91_26 n91_10 #91:dump_goodies n116_1->n91_10 n6_9 #6:titlec n116_1->n6_9 n116_2 #116:birth n116_1->n116_2 n116_15->n20_34 n116_7->n116_9 n91_25 #91:tell n116_7->n91_25 n116_2->n20_34 n6_73 #6:moveto n116_2->n6_73 n116_9->n91_26 n116_9->n6_9 n116_9->n20_56 n6_18 #6:tell n116_9->n6_18 n32_23 #32:terminate_normal n116_9->n32_23 n116_10 #116:direct_say n116_9->n116_10 n20_73 #20:get_say_verb n116_9->n20_73 n116_4 #116:@start n116_4->n6_9 n52_5 #52:isa n116_4->n52_5 n116_4->n6_18 n99_4 #99:valid_task n116_4->n99_4 n99_17 #99:schedule n116_4->n99_17 n116_6 #116:to_defend n116_6->n91_21 n116_8 #116:watch n116_8->n52_5 n116_8->n6_18 n20_59 #20:name_and_number n116_8->n20_59 n116_10->n116_7 n116_10->n6_9 n116_10->n20_73 n20_72 #20:get_say_verb_prep n116_10->n20_72 n35_0 #35:verb_sub n116_10->n35_0 n41_2 #41:get_pronoun n116_10->n41_2 n116_11 #116:l*ook n116_11->n52_6 n116_11->n20_34 n116_11->n116_7 n116_11->n6_9 n116_11->n6_18 n20_6 #20:english_list n116_11->n20_6 n27_6 #27:equal n116_11->n27_6 n56_0 #56:object_match_failed n116_11->n56_0 n116_12 #116:go n116_12->n116_3 n116_12->n52_6 n116_12->n116_7 n116_13 #116:wander n116_13->n116_3 n116_13->n6_73 n116_13->n52_5 n52_0 #52:has_property n116_13->n52_0 n116_14 #116:look_self n116_14->n6_18 n91_36 #91:description n116_14->n91_36 n6_79 #6:tell_lines n116_14->n6_79 n41_7 #41:pronoun_sub n116_14->n41_7 n1_29 #1:contents n116_14->n1_29 n91_12 #91:tell_contents n116_14->n91_12 n116_5 #116:random_free n116_14->n116_5 n116_16 #116:init_for_core n91_0 #91:init_for_core n116_16->n91_0 n116_17 #116:_loot n116_17->n116_7 n116_17->n91_10 n116_17->n6_9 n116_17->n6_18

Showing 48 of 61 verbs; 13 not shown.

Source

take_hit

Spec this none thisFlags rxdOwner #2Definer #116

Referenced by

Source

1"USAGE: victim:take_hit(damage)";
2"       wiz-owned to prevent permission problems";
3damage = tofloat(args[1]);
4fork (2)
5if ((this.alive && this.alert) && this.mobile)
6if ((this in connected_players()) || (this.enemy == this))
7"Make your own descisions";
8elseif (this.hostility)
9`this.location:do_attack(tostr(this), tostr(this.enemy), this:damage(), 1) ! ANY => "invalid enemy or bad location"';
10else
11suspend(1);
12this:_force("wander");
13endif
14endif
15endfork
16if ((((caller == this.location) || (caller == this.owner)) || `caller.hostility ! E_PROPNF => 0') || `caller.weapon ! E_PROPNF => 0')
17damage = ((x = damage - this:armor()) > 0.1) ? x | 0.1;
18this.stats_current[2][4] = this.stats_current[2][4] - damage;
19if (this.stats_current[2][4] < 0.0)
20this:die();
21endif
22endif
23return this.stats_current[2][4];

die

Spec this none thisFlags rxdOwner #2Definer #116

Referenced by

Source

1"resets stats & skills, moves puppet to afterlife.";
2"wiz-owned";
3who = (length(callers()) < 2) ? player | callers()[2][3];
4trustees = {this.owner};
5for x in ($object_utils:ancestors(this))
6trustees = setadd(trustees, x.owner);
7endfor
8for x in ($object_utils:ancestors(this.location))
9trustees = setadd(trustees, x.owner);
10endfor
11if ((!(who in trustees)) && (!who.wizard))
12"Bogus killer";
13return;
14elseif (!this.alive)
15"already dead";
16return this:pass_out();
17endif
18this.alive = 0;
19if (valid(this.followed_by))
20this.followed_by.following = $nothing;
21endif
22if (valid(this.following))
23this.following.followed_by = $nothing;
24endif
25this.followed_by = $nothing;
26this.following = $nothing;
27this.location:announce_all_but({this}, $string_utils:pronoun_sub(this.death_msg, this));
28this:tell("The world around you fades to black, and you feel light as a feather.");
29this.alert = 0;
30this.location:announce_all_but({this}, $string_utils:pronoun_sub(this.death_msg, this));
31deathscene = this.location;
32fork (7)
33deathscene:announce_all("The corpse of ", this:title(), " dissolves quickly.");
34this:dump_goodies(1);
35move(this, $dead_zone);
36this.location:announce_all_but({this}, this:titlec(), "(yes, quite dead) has arrived.");
37fork (this.gestate)
38this:birth();
39endfork
40endfork
41this.free_points = 0.0;
42this.stats_current = {{"Strength", "Dexterity", "Intelligence", "Health"}, {0.0, 0.0, 0.0, 0.0}};

birth

Spec this none thisFlags rxdOwner #2Definer #116

Referenced by

Source

1"wiz-owned";
2this.alive = 1;
3this.alert = 1;
4this.stats_current = this.stats;
5try
6this:moveto(this.home);
7except v (ANY)
8this:moveto($dead_zone);
9endtry
10this.location:announce_all($string_utils:pronoun_sub(this.birth_msg, this));
11return;

_force

Spec this none thisFlags rxdOwner #2Definer #116

Referenced by

Source

1"Wizowned to accomodate force_input";
2{action, dpi} = $string_utils:first_word(tostr(@args));
3player = this;
4if (action[1] == ":")
5dpi = tostr(action[2..$], " ", dpi);
6action = "emote";
7elseif (action[1] in {"-", "`"})
8dpi = tostr(@args);
9action = "say";
10endif
11if (action == "say")
12return this:say(dpi);
13endif
14if (action in {"look", "l"})
15return this:l(dpi);
16endif
17if (action == "go")
18fork (1)
19this:l();
20endfork
21endif
22force_input(this, tostr(action, " ", dpi));

@start @stop

Spec this none noneFlags rdOwner #2Definer #116

Referenced by

none

Source

1"wiz-owned to allow scheduling";
2if (!$object_utils:isa(player, $frand_class))
3return;
4endif
5if (this.wander_task)
6if (verb == "@start")
7player:tell(this:titlec(), " is already wandering.");
8elseif ($scheduler:valid_task(call_function("tonum", this.wander_task)))
9$scheduler:kill_task(this.wander_task);
10this.wander_task = 0;
11player:tell(this:titlec(), " has stopped wandering.");
12else
13player:tell("Invalid wander task. Resetting wander_task to 0. ", this:titlec(), " can resume wandering at any time.");
14this.wander_task = 0;
15endif
16else
17if (verb == "@start")
18this.wander_task = $scheduler:schedule_every(this.wait_seconds, this, "wander");
19player:tell(this:titlec(), " is now wandering every ", this.wait_seconds, " seconds. \"@set ", this, ".wait_seconds to <seconds>\" to change the rate.");
20else
21player:tell(this:titlec(), " was not wandering.");
22endif
23endif

random_free

Spec this none thisFlags rxdOwner #2Definer #116

Referenced by

Source

1"WIZ PERMS";
2if (`player.free_points ! E_PROPNF => 0')
3player.free_points = player.free_points + 0.005;
4endif

to_defend

Spec this none thisFlags rxdOwner #36Definer #116

Referenced by

none

Source

1"Returns dexterity, modified by basic combat skill.";
2"Unlike the $rpgamer verb, does not check for connection.";
3combat = "combat" in this.skills[1];
4dex = ((!this.alert) || (!this.mobile)) ? 0.1 | this.stats_current[2][2];
5defense = (dex + (sqrt(this.skills[2][combat]) / 2.0)) + (this:armor() / 2.0);
6return (defense > 0.0) ? defense | 0.1;

tell

Spec this none thisFlags rxdOwner #36Definer #116

Referenced by

Source

1if ((!this.my_tell) || (this in connected_players()))
2pass(@args);
3if ($string_utils:index_delimited(tostr(@args), "asks you,") && $string_utils:index_delimited(tostr(@args), "name"))
4this:say(tostr("-", player, " My name is ", this.name, "."));
5endif
6endif
7for x in (this.watchers)
8x:tell("from ", this, ": ", @args);
9endfor

watch ignore

Spec this none noneFlags rxdOwner #36Definer #116

Referenced by

none

Source

1if (!$object_utils:isa(player, $frand_class))
2return player:tell("You're not allowed to watch ", $string_utils:nn(this), ".");
3endif
4if (player in this.watchers)
5if (verb == "watch")
6player:tell("You're already watching ", $string_utils:nn(this), ".");
7else
8this.watchers = setremove(this.watchers, player);
9player:tell("You're no longer watching ", $string_utils:nn(this), ".");
10endif
11else
12if (verb == "watch")
13this.watchers = setadd(this.watchers, player);
14player:tell("You're watching ", $string_utils:nn(this), ".");
15else
16player:tell("You weren't watching ", $string_utils:nn(this), ".");
17endif
18endif

say

Spec this none thisFlags rxdOwner #36Definer #116

Referenced by

Source

1this.my_tell = 1;
2argstr = $ansi_utils:terminate_normal(args[1]);
3if (!this.alert)
4this.my_tell = 0;
5return player:tell(this:title(), " is sleeping.");
6elseif (argstr[1] in {"-", "`"})
7this.my_tell = 0;
8return this:direct_say($string_utils:first_word(argstr));
9endif
10fork (2)
11"for realism, delayed response.";
12this.my_tell = 1;
13sayverb = $string_utils:get_say_verb(argstr);
14for ear in (this.location:contents())
15ear:tell(this:titlec(), " ", $gender_utils:get_conj(sayverb, this), ", \"", argstr, "\"");
16endfor
17this.my_tell = 0;
18endfork

direct_say

Spec this none thisFlags rxdOwner #36Definer #116

Referenced by

Source

1"USAGE: direct_say(name,words)";
2this.my_tell = 1;
3name = args[1][1][2..$];
4words = args[1][2];
5who = this.location:match_object(name);
6sayverb = $string_utils:get_say_verb(words);
7preppy = $string_utils:get_say_verb_prep(sayverb);
8fork (2)
9"for realism, delayed response.";
10this.my_tell = 1;
11if (!valid(who))
12this:tell("You ", $you:verb_sub(sayverb), preppy, name, ", \"", words, "\"");
13this.location:announce(tostr(this:titlec(), " ", $gender_utils:get_conj(sayverb, this), preppy, name, ", \"", words, "\""));
14else
15if (who == this)
16this:tell("You ", $you:verb_sub(sayverb), preppy, "yourself, \"", words, "\"");
17this.location:announce(tostr(this:titlec(), " ", $gender_utils:get_conj(sayverb, this), preppy, $gender_utils:get_pronoun("r", this), ", \"", words, "\""));
18else
19this:tell("You ", $you:verb_sub(sayverb), preppy, who:title(), ", \"", words, "\"");
20who:tell(tostr(this:titlec(), " ", $gender_utils:get_conj(sayverb, this), preppy, "you, \"", words, "\""));
21this.location:announce_all_but({this, who}, tostr(this:titlec(), " ", $gender_utils:get_conj(sayverb, this), preppy, who:title(), ", \"", words, "\""));
22endif
23endif
24this.my_tell = 0;
25endfork

l*ook

Spec this none thisFlags rxdOwner #36Definer #116

Referenced by

none

Source

1argstr = args ? tostr(args[1]) | "";
2if (!argstr)
3if (!valid(this.location))
4player:tell(this, " is nowhere!");
5elseif (!($room in $object_utils:ancestors(this.location)))
6this.location:look_self(@args);
7elseif ($terrain in $object_utils:ancestors(this.location))
8this:tell(this.location:title(), " => {", this.x_loc, ",", this.y_loc, "}");
9stuff = {};
10exitset = {};
11wayset = {};
12for OBJ in (this.location.contents)
13if ({OBJ.x_loc, OBJ.y_loc} == {this.x_loc, this.y_loc})
14stuff = {@stuff, OBJ:title()};
15endif
16endfor
17this:tell("Area contents: ", $string_utils:english_list(stuff));
18for ex in (this.location.exits)
19if (this.location:match_loc(this, ex))
20exitset = setadd(exitset, ex);
21endif
22endfor
23for w in (this.location.compass)
24if (this.location:loc_way(w, this.x_loc, this.y_loc) != {0, 0})
25wayset = setadd(wayset, this.location:parse_dir(w, "long"));
26endif
27endfor
28allways = $set_utils:diff(this.location.long_ways, {"up", "down"});
29if ($set_utils:equal(wayset, allways))
30this:tell("Exits: You can move horizontally in any direction.");
31elseif (wayset != {})
32this:tell("Exits: You can move ", $string_utils:english_list(wayset), ".");
33endif
34if (exitset != {})
35this:tell($string_utils:pronoun_sub(tostr(this.location.real_exit_msg, $string_utils:title_list(exitset), "."), this.location));
36endif
37return;
38else
39this:tell(".......................");
40this.location:look_self(@args);
41return this:tell(".......................");
42endif
43elseif (valid(thing = this.location:match(argstr)))
44return thing:look_self();
45elseif (thing == $ambiguous_match)
46player:tell("Which one?");
47elseif (!$command_utils:object_match_failed(this.location:match_exit(argstr), argstr))
48return player:tell(this:titlec(), " can't see past the exit.");
49endif
50return player:tell("(", this:titlec(), " is confused.)");

go

Spec any any anyFlags rxdOwner #36Definer #116

Referenced by

none

Source

1place = this.location;
2if ($terrain in $object_utils:ancestors(place))
3way = dobjstr;
4target = place:loc_way(way, this.x_loc, this.y_loc);
5if (target != {0, 0})
6return this:_force(way);
7endif
8if (valid(x = place:match_exit(dobjstr)))
9if (place:match_loc(x, this))
10return place:(verb)(@args);
11else
12return this:tell("You can't go that way.");
13endif
14endif
15endif
16place:(verb)(@args);

wander

Spec none none noneFlags rxdOwner #36Definer #116

Referenced by

none

Source

1"Finds and takes a random exit. If you want to repeat this act, you need to call the verb from within a timed loop.";
2"If his.terrain_only is true, it will stay in a terrain and never take a real exit.";
3if (!((this.alive && this.alert) && this.mobile))
4return "Can't move.";
5endif
6if ($object_utils:isa(this.location, $room) && (!$object_utils:isa(this.location, $terrain)))
7real = ((rlen = length(rexits = this.location:obvious_exits())) && (rexit = rexits[random(rlen)]):is_unlocked_for(this)) ? 1 | 0;
8if ($object_utils:has_property(this.location, "virtual_exits"))
9virtual = ((vlen = length(vexits = this.location.virtual_exits)) && (vexit = vexits[random(vlen)])) ? 1 | 0;
10else
11virtual = 0;
12endif
13if (real && virtual)
14if (random(2) == 2)
15rexit:move(this);
16elseif (this.location:exit_unlocked_for(vexit, this))
17this.location:match_exit(vexit[1][1]);
18this.location:move(this);
19endif
20elseif (real)
21rexit:move(this);
22elseif (virtual)
23this.location:match_exit(vexit[1][1]);
24this.location:move(this);
25else
26"No way out. Go home.";
27this:moveto(this.home);
28endif
29elseif ($object_utils:isa(this.location, $terrain))
30if (!this.terrain_only)
31real = (((rlen = length(rexits = this.location:obvious_exits())) && (rexit = rexits[random(rlen)]):is_unlocked_for(this)) && this.location:match_loc(rexit, this)) ? 1 | 0;
32if (real)
33return rexit:move(this);
34endif
35endif
36for t in (this.location.compass)
37way = this.location.compass[random($)];
38target = this.location:loc_way(way, this.x_loc, this.y_loc);
39if (target != {0, 0})
40return this:_force(way);
41endif
42endfor
43endif

look_self

Spec this none thisFlags rxdOwner #36Definer #116

Referenced by

none

Source

1desc = this:description();
2if (desc)
3player:tell_lines(desc);
4else
5player:Tell("You see nothing special.");
6endif
7health = this.stats_current[2][4] / (this.stats[2][4] + 0.0001);
8if (!this.alert)
9player:tell($gender_utils:pronoun_sub("%{:He} %{!is} unconscious.", this));
10elseif (!this.alive)
11player:tell($gender_utils:pronoun_sub("%{:He} %{!is} ethereal, as if dead.", this));
12elseif (health < 0.75)
13if (health < 0.25)
14player:tell($gender_utils:pronoun_sub("%{:He} %{!is} obviously in very poor health.", this));
15else
16player:tell($gender_utils:pronoun_sub("%{:He} %{!is} obviously in poor health.", this));
17endif
18else
19player:tell($gender_utils:pronoun_sub("%{:He} %{!is} awake and %{!looks} alert.", this));
20endif
21if (stuff = this:contents())
22player:Tell("");
23this:tell_contents(tstuff);
24endif
25this:random_free();

pass_out

Spec this none thisFlags rxdOwner #2Definer #116

Referenced by

Source

1"wiz-owned";
2if (this.alert)
3if (((player.wielded == $hand) || (player:damage(1) < 4.0)) || (this.enemy != player))
4this.location:announce_all_but({this}, $string_utils:pronoun_sub("%N %<becomes> dazed.", this));
5timeout = 20;
6wakeup = "%N %<regains> focus.";
7else
8this.location:announce_all_but({this}, $string_utils:pronoun_sub("%N %<falls> unconscious.", this));
9timeout = 40;
10wakeup = "%N %<awakens> from unconsciousness.";
11endif
12this.alert = 0;
13fork (timeout)
14this.alert = 1;
15if (this.alive)
16this.location:announce_all_but({this}, $string_utils:pronoun_sub(wakeup, this));
17endif
18endfork
19endif

init_for_core

Spec this none thisFlags rxdOwner #2Definer #116

Referenced by

Source

1if (caller_perms().wizard)
2if (this == $puppet)
3this.watchers = {};
4this.wielded = $hand;
5this.free_points = 0.0;
6this.stats = {{"Strength", "Dexterity", "Intelligence", "Health"}, {10.0, 10.0, 10.5, 10.0}};
7this.stats_current = this.stats;
8else
9for p in (properties($puppet))
10if ((!p) in {"build_help", "help_msg"})
11clear_property(this, p);
12endif
13endfor
14endif
15return pass(@args);
16endif

_loot

Spec this none thisFlags rxdOwner #2Definer #116

Referenced by

none

Source

1"USAGE: loot/rob/pilfer/roll/search/strip <person> => if person is knocked out, moves person.contents to the room.";
2if (!`player.free_points ! E_PROPNF => 0')
3return player:tell("Both parties must be roleplaying to do that.");
4endif
5"NEEDS WIZ PERMS";
6if (player.location == this.location)
7if ((this in connected_players()) || (!is_player(this)))
8if ((!this.alert) || (!this.mobile))
9this:dump_goodies(1);
10$you:say_action("%N %<searches> %d for valuable goods.");
11this.location:tell_contents(setremove(this.location:contents(), player), this.location.ctype);
12else
13this:tell("You cautiously dodge ", player:title(), ", who is trying to steal from you.");
14player:tell(this:titlec(), " cautiously dodges your advance.");
15this.location:announce_all_but({this, player}, tostr(this:titlec(), " cautiously avoids ", player:title(), "."));
16endif
17else
18$you:say_action("%N %<attempts> to search %d for valuable goods, but %<is/are> deflected by a stasis field.");
19endif
20else
21player:tell("There is no \"", dobjstr, "\" here.");
22endif

@addlang*uage @add-lang*uage

Spec any at/to thisFlags rdOwner #36Definer #116

Referenced by

none

Source

1if ((!player.wizard) && (player != this.owner))
2return player:tell(E_PERM);
3endif
4lang = $string_utils:match(dobjstr, $object_utils:descendants($lang), "lang_name");
5if (!valid(lang))
6return player:tell("That is an unknown language.");
7elseif (!(lang in this.languages[1]))
8this.languages = {{@this.languages[1], lang}, {@this.languages[2], 2.0}};
9player:tell(lang.lang_name, " added to languages known by ", this:title(), ".");
10else
11player:tell(this:titlec(), " already knows ", lang.lang_name, ".");
12endif

@rmlang*uage @rm-lang*uage

Spec any out of/from inside/from thisFlags rdOwner #36Definer #116

Referenced by

none

Source

1if ((!player.wizard) && (player != this.owner))
2return player:tell(E_PERM);
3endif
4lang = $string_utils:match(dobjstr, $object_utils:descendants($lang), "lang_name");
5if (!valid(lang))
6return player:tell("That is an unknown language.");
7elseif (!(lin = lang in this.languages[1]))
8player:tell(this:titlec(), " doesn't know ", lang.lang_name, ".");
9else
10this.languages[1] = listdelete(this.languages[1], lin);
11this.languages[2] = listdelete(this.languages[2], lin);
12player:tell(lang.lang_name, " removed from languages known by ", this:title(), ".");
13endif

ask

Spec this any anyFlags rxdOwner #2Definer #116

Referenced by

Source

1if ((!player.wizard) && (!(player.location == this.location)))
2return player:tell(this:titlec(), " is not here.");
3endif
4if (((((iobjstr[1] in {"-", ":"}) && this.alive) && this.alert) && this.mobile) && (player.wizard || (player == this.owner)))
5return this:_force(iobjstr);
6else
7this.my_tell = 1;
8if (iobjstr && ($string_utils:words(iobjstr)[$] == "me"))
9iobjstr = $string_utils:subst(iobjstr, {{" me", tostr(" ", player)}});
10endif
11niobjstr = $string_utils:substitute(iobjstr, {{tostr(player), "%o"}});
12$you:say_action(tostr("%N %<asks> ", this:title(), " ", prepstr, " ", iobjstr, "."));
13this.my_tell = 0;
14if (!((this.alive && this.alert) && this.mobile))
15return player:tell(this:titlec(), " is in no condition to respond.");
16elseif (prepstr == "to")
17if (iobjstr in {"shut up", "be quiet", "hush"})
18this.my_tell = 1;
19this:_force(":nods sullenly.");
20this.my_tell = 0;
21return;
22endif
23cmdtarg = $string_utils:first_word(iobjstr);
24cmd = cmdtarg[1];
25targ = cmdtarg[2];
26this.my_tell = 1;
27if (player in this.bosses)
28if (cmd in {"attack", "hit", "fight", "kill", "destroy", "punch", "kick", "stun", "disable", "shoot", "stab"})
29if (!targ)
30this:say(tostr("-", player, " ", $string_utils:capitalize(cmd), " who?"));
31elseif (valid(target = this.location:match(targ)))
32this.enemy = target;
33this:_force(iobjstr);
34this.hostility = 2;
35fork (24)
36this.hostility = 1;
37endfork
38elseif (target == $ambiguous_match)
39this:say(tostr("-", player, " Which ", targ, "?"));
40elseif (this.location:match_fake(targ))
41this.location:announce_all(tostr(this:titlec(), " half-heartedly ", cmd, "s ", targ, "."));
42else
43this.location:announce_all(tostr(this:titlec(), " looks confused."));
44endif
45elseif (cmd in {"stop", "quit"})
46this.hostility = 0;
47this:say(tostr("-", player, " Yessir. :("));
48fork (2)
49this:_release();
50if ($scheduler:valid_task(call_function("tonum", this.wander_task)))
51$scheduler:kill_task(this.wander_task);
52this.wander_task = 0;
53player:tell(this:titlec(), " has stopped wandering.");
54endif
55endfork
56fork (12)
57this.hostility = 1;
58endfork
59elseif ((cmd in {"hand", "give"}) && ($string_utils:words(targ)[$] == tostr(player)))
60theitem = $string_utils:from_list($string_utils:words(targ)[1..$ - 2], " ");
61player:tell(theitem);
62this:give_item(theitem, player);
63elseif (cmd == "follow")
64this:_force(tostr("follow ", player));
65this:_leash();
66else
67this:_force(tostr(cmd, " ", targ));
68endif
69else
70this:say(tostr("-", player, " Sorry... I have other priorities."));
71endif
72this.my_tell = 0;
73elseif (prepstr == "for")
74if ((!player.wizard) && (player != this.owner))
75return this:say(tostr("-", player, " I don't believe so."));
76endif
77if (iobjstr in {"boss", "commander", "owner"})
78this:say(tostr("-", player, " I follow orders from ", $string_utils:nn(this.owner), "."));
79elseif ($string_utils:words(iobjstr)[$] in $list_utils:slice($money_utils.currencies))
80this:_force(tostr("give ", iobjstr, " to ", player.name));
81else
82this:give_item(iobjstr, player);
83endif
84else
85player:tell("Try: \"ask ", this:title(), " to/for <something>\"");
86endif
87endif