generic puppet #116
Aliases: generic puppet, puppet
22 verbs · 116 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
take_hit | this none this | rxd | #116 | 23 |
die | this none this | rxd | #116 | 42 |
birth | this none this | rxd | #116 | 11 |
_force | this none this | rxd | #116 | 22 |
@start @stop | this none none | rd | #116 | 23 |
random_free | this none this | rxd | #116 | 4 |
to_defend | this none this | rxd | #116 | 6 |
tell | this none this | rxd | #116 | 9 |
watch ignore | this none none | rxd | #116 | 18 |
say | this none this | rxd | #116 | 18 |
direct_say | this none this | rxd | #116 | 25 |
l*ook | this none this | rxd | #116 | 50 |
go | any any any | rxd | #116 | 16 |
wander | none none none | rxd | #116 | 43 |
look_self | this none this | rxd | #116 | 26 |
pass_out | this none this | rxd | #116 | 19 |
init_for_core | this none this | rxd | #116 | 16 |
_loot | this none this | rxd | #116 | 22 |
@addlang*uage @add-lang*uage | any at/to this | rd | #116 | 12 |
@rmlang*uage @rm-lang*uage | any out of/from inside/from this | rd | #116 | 13 |
ask | this any any | rxd | #116 | 87 |
infobar | this none this | rxd | #116 | 0 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
my_tell | #116 | rw | #36 | 0 |
watchers | #116 | r | #36 | {} |
terrain_only | #116 | rc | #36 | 0 |
enemy | #116 | r | #36 | #-1 |
hostility | #116 | rc | #36 | 1 |
gestate | #116 | rc | #36 | 30 |
birth_msg | #116 | rc | #36 | "%N %<unfades> from non-being." |
wander_task | #116 | r | #36 | 0 |
wait_seconds | #116 | rc | #36 | 480 |
controller | #116 | rc | #36 | #-1 |
death_msg | #91 | rc | #36 | <clear> |
alive | #91 | r | #36 | <clear> |
alert | #91 | r | #36 | <clear> |
mobile | #91 | r | #36 | <clear> |
wielded | #91 | r | #36 | #110 |
last_paged | #91 | r | #36 | <clear> |
last_healed | #91 | r | #36 | <clear> |
followed_by | #91 | r | #36 | <clear> |
following | #91 | r | #36 | <clear> |
free_points | #91 | r | #36 | 0.0 |
stats | #91 | r | #36 | <clear> |
stats_current | #91 | r | #36 | <clear> |
skills | #91 | r | #36 | <clear> |
race | #91 | r | #36 | <clear> |
org | #91 | r | #36 | "" |
money | #91 | r | #36 | <clear> |
follow_msg | #91 | rc | #36 | <clear> |
stopfollow_msg | #91 | rc | #36 | <clear> |
searching | #91 | r | #36 | <clear> |
languages | #91 | r | #36 | {{#142}, {2.0}} |
speaking | #91 | r | #36 | <clear> |
remembered_names | #91 | r | #36 | {} |
short_desc_msg | #91 | r | #36 | "" |
knowledge | #91 | rc | #36 | <clear> |
magic_immunity | #91 | rc | #36 | <clear> |
roomnum | #91 | rwc | #36 | <clear> |
killcount | #91 | rc | #36 | <clear> |
pkill | #91 | rc | #36 | <clear> |
level | #91 | rc | #36 | <clear> |
experience | #91 | rc | #36 | <clear> |
adv_points | #91 | rc | #36 | <clear> |
resets | #91 | rc | #36 | <clear> |
exp | #91 | rc | #36 | <clear> |
class | #91 | rc | #36 | <clear> |
map | #91 | rc | #36 | <clear> |
used_spells | #91 | rc | #36 | <clear> |
_mail_task | #40 | rc | #36 | <clear> |
messages_going | #40 | c | #36 | <clear> |
mail_lists | #40 | rc | #36 | <clear> |
mail_notify | #40 | r | #2 | <clear> |
mail_forward | #40 | rc | #36 | <clear> |
mail_options | #40 | rc | #36 | {} |
message_keep_date | #40 | rc | #36 | <clear> |
messages_kept | #40 | rc | #36 | <clear> |
current_message | #40 | c | #36 | {0, -1300000000} |
messages | #40 | c | #36 | <clear> |
ansi_options | #95 | r | #36 | <clear> |
replace_codes | #95 | r | #36 | <clear> |
features | #6 | r | #36 | <clear> |
previous_connection | #6 | | #2 | <clear> |
email_address | #6 | | #2 | <clear> |
last_disconnect_time | #6 | r | #2 | <clear> |
help | #6 | rc | #36 | 0 |
more_msg | #6 | rc | #36 | <clear> |
linetask | #6 | r | #36 | <clear> |
linesleft | #6 | r | #36 | <clear> |
linebuffer | #6 | | #36 | <clear> |
pagelen | #6 | r | #36 | <clear> |
owned_objects | #6 | r | #2 | <clear> |
linelen | #6 | r | #36 | <clear> |
current_folder | #6 | c | #36 | <clear> |
all_connect_places | #6 | | #2 | <clear> |
last_connect_place | #6 | | #2 | <clear> |
brief | #6 | rc | #36 | <clear> |
lines | #6 | c | #36 | <clear> |
page_absent_msg | #6 | rc | #36 | <clear> |
pq | #6 | rc | #36 | <clear> |
pqc | #6 | rc | #36 | <clear> |
page_origin_msg | #6 | rc | #36 | <clear> |
page_echo_msg | #6 | rc | #36 | <clear> |
edit_options | #6 | rc | #36 | <clear> |
last_connect_time | #6 | r | #2 | <clear> |
ownership_quota | #6 | | #36 | <clear> |
gender | #6 | rc | #36 | <clear> |
prc | #6 | rc | #36 | <clear> |
ppc | #6 | rc | #36 | <clear> |
poc | #6 | rc | #36 | <clear> |
psc | #6 | rc | #36 | <clear> |
pr | #6 | rc | #36 | <clear> |
pp | #6 | rc | #36 | <clear> |
po | #6 | rc | #36 | <clear> |
ps | #6 | rc | #36 | <clear> |
home | #6 | rc | #36 | #62 |
password | #6 | | #2 | <clear> |
gaglist | #6 | rc | #36 | <clear> |
paranoid | #6 | rc | #36 | <clear> |
display_options | #6 | rc | #36 | <clear> |
verb_subs | #6 | rc | #36 | <clear> |
first_connect_time | #6 | r | #2 | <clear> |
size_quota | #6 | | #36 | <clear> |
last_password_time | #6 | | #2 | <clear> |
last_connect_attempt | #6 | | #2 | <clear> |
page_count_start_time | #6 | r | #2 | <clear> |
ping_task | #6 | r | #36 | <clear> |
infobar | #6 | rc | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #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 | #1 | c | #36 | 0 |
aliases | #1 | r | #2 | {"generic puppet", "puppet"} |
description | #1 | rc | #36 | <clear> |
object_size | #1 | r | #36 | {33312, -1090650497} |
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
Showing 48 of 61 verbs; 13 not shown.
Source
take_hit
Referenced by
- #134:take_hit line 14:
pass(
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
Referenced by
- #116:take_hit line 20:
this:die
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
Referenced by
- #116:die line 38:
this:birth
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
Referenced by
- #116:take_hit line 12:
this:_force - #116:go line 6:
this:_force - #116:wander line 40:
this:_force - #116:ask line 5:
this:_force - #116:ask line 19:
this:_force - #116:ask line 33:
this:_force - #116:ask line 64:
this:_force - #116:ask line 67:
this:_force - #116:ask line 80:
this:_force - #134:tell line 16:
this:_force - #134:sell_product line 35:
this:_force - #134:sell_product line 48:
this:_force - #134:sell_product line 51:
this:_force
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
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(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
Referenced by
- #116:look_self line 26:
this:random_free - #134:tell line 34:
this:random_free
Source
1"WIZ PERMS"; 2if (`player.free_points ! E_PROPNF => 0') 3player.free_points = player.free_points + 0.005; 4endif
to_defend
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
Referenced by
- #116:die line 28:
this:tell - #116:direct_say line 12:
this:tell - #116:direct_say line 16:
this:tell - #116:direct_say line 19:
this:tell - #116:l*ook line 8:
this:tell - #116:l*ook line 17:
this:tell - #116:l*ook line 30:
this:tell - #116:l*ook line 32:
this:tell - #116:l*ook line 35:
this:tell - #116:l*ook line 39:
this:tell - #116:l*ook line 41:
this:tell - #116:go line 12:
this:tell - #116:_loot line 13:
this:tell - #134:tell line 2:
pass( - #134:tell line 5:
pass( - #134:tell line 8:
pass( - #134:tell line 28:
pass( - #134:tell line 31:
pass( - #134:tell line 43:
pass(
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
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
Referenced by
- #116:_force line 12:
this:say - #116:tell line 4:
this:say - #116:ask line 30:
this:say - #116:ask line 39:
this:say - #116:ask line 47:
this:say - #116:ask line 70:
this:say - #116:ask line 75:
this:say - #116:ask line 78:
this:say - #134:take_hit line 16:
this:say - #134:tell line 15:
this:say - #134:tell line 24:
this:say - #134:tell line 40:
this:say - #134:list line 5:
this:say - #134:list line 9:
this:say - #134:sell line 13:
this:say - #134:sell line 14:
this:say - #134:sell line 16:
this:say - #134:sell line 21:
this:say - #134:sell line 24:
this:say - #134:ask line 23:
this:say - #134:collect_cash line 2:
this:say - #134:collect_cash line 10:
this:say - #134:sell_product line 8:
this:say - #134:sell_product line 10:
this:say - #134:sell_product line 13:
this:say - #134:sell_product line 19:
this:say - #134:sell_product line 20:
this:say - #134:sell_product line 26:
this:say - #134:sell_product line 28:
this:say - #134:sell_product line 37:
this:say - #134:sell_product line 56:
this:say
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
Referenced by
- #116:say line 8:
this:direct_say
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
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
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
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
Referenced by
none
Source
1player:tell("You look at ", this.name, "."); 2desc = this:description(); 3if (desc) 4player:tell_lines(desc); 5else 6player:Tell("You see nothing special."); 7endif 8health = this.stats_current[2][4] / (this.stats[2][4] + 0.0001); 9if (!this.alert) 10player:tell($gender_utils:pronoun_sub("%{:He} %{!is} unconscious.", this)); 11elseif (!this.alive) 12player:tell($gender_utils:pronoun_sub("%{:He} %{!is} ethereal, as if dead.", this)); 13elseif (health < 0.75) 14if (health < 0.25) 15player:tell($gender_utils:pronoun_sub("%{:He} %{!is} obviously in very poor health.", this)); 16else 17player:tell($gender_utils:pronoun_sub("%{:He} %{!is} obviously in poor health.", this)); 18endif 19else 20player:tell($gender_utils:pronoun_sub("%{:He} %{!is} awake and %{!looks} alert.", this)); 21endif 22if (stuff = this:contents()) 23player:Tell(""); 24this:tell_contents(stuff); 25endif 26this:random_free();
pass_out
Referenced by
- #116:die line 16:
this:pass_out
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
Referenced by
- #134:init_for_core line 19:
pass(
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
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
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
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
Referenced by
- #134:ask line 2:
pass(
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(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
infobar
Referenced by
none
Source
No program (verb defined but unprogrammed).