generic actor #92
Aliases: generic actor
16 verbs · 19 properties · 2 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
process_queue | this none this | rxd | #92 | 159 |
fork_process_queue | this none this | rx | #92 | 14 |
queue_action | this none this | rxd | #92 | 27 |
suggest_next_action | this none this | rxd | #92 | 1 |
qu*eue | any none none | rxd | #92 | 27 |
doing_msg | this none this | rxd | #92 | 14 |
clear_queue | this none this | rxd | #92 | 5 |
cancel_current_action | this none this | rxd | #92 | 32 |
jumpstart | this none this | rxd | #92 | 14 |
prequeue_action | this none this | rxd | #92 | 16 |
backup_queue | this none this | rxd | #92 | 12 |
is_doing | this none this | rxd | #92 | 24 |
cancel_if_possible | this none this | rxd | #92 | 5 |
take_damage | this none this | rxd | #92 | 0 |
iname | this none this | rxd | #92 | 20 |
floats | this none this | rxd | #92 | 2 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
queue | #92 | r | #361 | {} |
preemptible | #92 | r | #361 | 0 |
executing | #92 | r | #361 | {} |
process_queue | #92 | r | #361 | 0 |
help_msg | #92 | rc | #361 | list of 30{"A generic creature which can perform actions that take time to complete, queue those actions to be performed in order, and generate new actions to take when it has no more queued.", "", "A word about the action queue", "-----------------------------", "The action queue is meant to simulate the idea that it takes time to perform certain tasks, and you can't simply do things as fast as you can type their commands. The most obvious example, of course, is combat. A combat attack takes a certain amount of time to complete, and then (possibly) another attack happens. If the person attacking wants to also, say, use a medkit, or perform brain surgery, they can't very well be attacking at the same time.", "", "The way this works is this: the creator of the medkit, in his \"use medkit\" verb, does only one thing (after basic sanity-checking such as 'is the medkit usable'): it queues an action for the player to use the medkit. Then, the player's action queue gets to it just as soon as the player isn't busy with anything else. If the player wasn't already doing anything, she simply executes the medkit-using action immediately.", "", "This brings us to the first method on $actor, used by objects to tell the actor to do something:", "", "$actor:queue_action(OBJ action, LIST arguments, FLOAT duration, INT cancellable, STR typed-command)", "", "OBJ action : A child of $action, indicating the kind of action to be taken. These objects implement two basic methods - :_start() and :_finish(). These methods are passed the actor's obj#, and the arguments given by the second arg (LIST arguments). See 'help $action' for more details on this.", "", "LIST arguments: The specific parameters of the action. The format of this list is different for every action; for 'attack' it might be the weapon and the target, for 'use' it might be the item to be used.", "", "FLOAT duration: The number of real-time seconds between running the action's :_start and :_finish.", "", "INT cancellable: Whether this action can be cancelled by the player at will. This should be 1 for most things, but could be 0 for actions forced on the player by drugs or circumstances.", "", "STR typed-command: This is what is shown in the player's 'queue' command display. It has no other function.", "", "When this method is called, the actor immediately executes the action if it doesn't already have an action running. If it does, the action is added to the queue. Every time the actor finishes running an action, it grabs the next one off its queue and immediately starts executing that. When the queue empties, it asks the actor for its next suggested action via:", "", "$actor:suggest_next_action()", "", "This is the method you should override on your actors to have them spontaneously do things without external stimulus. By default, this method will keep you attacking anyone who is attacking you, so to preserve that behavior you may want to test pass(@args) and return it in your overridden method.", "", "The action system expects a two-element list to be returned: {LIST action, INT delay}. LIST action is an action specification, simply the arguments to be passed to :queue_action() (see above). INT delay is a number of seconds to hold off before actually executing this action. This lets your NPCs space out their actions when things aren't so urgent -- you don't want your wandering NPC to wander as fast as humanly possible.", ""} |
last_action | #92 | r | #361 | {} |
article | #92 | rc | #361 | 0 |
last_last_action | #92 | rc | #361 | {} |
action_count | #92 | rc | #361 | 0 |
aliases | #1 | r | #362 | {"generic actor"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {17687, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: #107 generic creature, #227 flywheel
Call graph
Source
process_queue
Referenced by
- #92:fork_process_queue line 10:
this:process_queue
Source
1":process_queue()"; 2"Keep running actions until we don't have any to run."; 3player = this; 4next_action_delay = 0; 5if (`this.location.no_actions ! ANY') 6this.queue = {}; 7return; 8endif 9if ((!this.queue) && (this.health > 0)) 10if (action = this:_suggest_next_action()) 11this.queue = {action[1], @this.queue}; 12next_action_delay = action[2]; 13endif 14endif 15continuation = {}; 16while (this.queue || continuation) 17this.preemptible = 0; 18pass_to_finish = 0; 19if (this.queue || continuation) 20if (continuation) 21action = continuation; 22startverb = "_continue"; 23continuation = 0; 24else 25action = this.queue[1]; 26this.queue = listdelete(this.queue, 1); 27startverb = "_start"; 28endif 29if (!is_a(action[1], #1)) 30continue; 31endif 32this.last_action && (this.last_last_action = this.last_action); 33this.last_action = action; 34debugtext = $su:print(action[2..$]); 35"...sanity check..."; 36if (((!action[2]) || (typeof(action[2][1]) != OBJ)) || (!is_a(action[2][1], $garbage))) 37if (is_a(this.location, $room) && (!this.location:check_forbid_action(this, @action))) 38"...nobody in here cancelled us..."; 39this.executing = {@action, @{$action, {}, 1, "", 0}[length(action) + 1..$]}; 40try 41result = action[1]:(startverb)(this, action[2]); 42if ($debug) 43$archwiz:tell($su:nn(this), " => ", $su:nn(action[1])); 44endif 45except e (ANY) 46if (e[1] == E_NONE) 47result = E_NONE; 48else 49extra_info = $su:nn(action[1]) + tostr(" args: ", toliteral(action[2])); 50$rpg:report_error(e, extra_info); 51result = E_INVARG; 52endif 53endtry 54status = this.executing[5]; 55this.executing[5] = 1; 56if (status in {2, 3}) 57"Something called the action while we were running _start, so abort now."; 58this:cancel_current_action(status == 3); 59"We're never going to end up here, as :cancel_current_action kills the task we are running in."; 60elseif (typeof(result) != ERR) 61if (typeof(result) == LIST) 62if (length(result) > 1) 63pass_to_finish = result[2]; 64else 65pass_to_finish = 0; 66endif 67do_continue = (length(result) > 2) ? result[3] | 0; 68durint = result[1]; 69if (typeof(durint) == FLOAT) 70"slow down if lots of people are acting..."; 71actors = -1; 72for x in (this.location:occupants($actor)) 73if (`x.executing ! ANY => 0') 74actors = actors + 1; 75endif 76endfor 77durint = durint * (1.0 + (tofloat(actors) * 0.2)); 78endif 79durint = $math_utils:gil_float_to_int(durint); 80else 81durint = 0; 82pass_to_finish = result; 83endif 84suspend(abs(durint)); 85if (!is_a(this, $actor)) 86return; 87endif 88if (has_callable_verb(action[1], "_finish")) 89this.executing[5] = 4; 90try 91continuation = action[1]:_finish(this, action[2], pass_to_finish); 92except e (ANY) 93if (e[1] != E_NONE) 94extra_info = $su:nn(action[1]) + tostr(" args: ", toliteral(action[2])); 95if (pass_to_finish) 96extra_info = {extra_info, tostr("pass_to_finish: ", toliteral(pass_to_finish))}; 97endif 98$rpg:report_error(e, extra_info); 99endif 100endtry 101status = this.executing[5]; 102endif 103endif 104`this._tohit_next = 0 ! ANY => 0'; 105this.executing = {}; 106else 107this:debug_tell("action", "forbid | ", $su:nn(action[1]), " ", debugtext); 108`action[1]:_forbidden(this, @action[2..$]) ! ANY => 0'; 109endif 110endif 111endif 112data = action; 113if ((typeof(continuation) == LIST) && continuation) 114"...make it look like we're executing the continued action. It'll execute back at the top."; 115this.executing = continuation = {@continuation, @{$action, {}, "", 1, 0}[length(continuation) + 1..$]}; 116if (status in {2, 3}) 117"Something called the action while we were running _finish, so abort instead of queuing continuation."; 118this:cancel_current_action(status == 3); 119continuation = 0; 120endif 121else 122continuation = 0; 123endif 124this.preemptible = next_action_delay > 0; 125suspend(next_action_delay); 126if (is_a(this, $garbage)) 127"we died..."; 128return; 129endif 130this.preemptible = 0; 131data = action; 132if (((!continuation) && (!this.queue)) && (!`this.possessors ! ANY => 0')) 133"...no more queued actions, do we have an auto-action?..."; 134if (has_callable_verb(this, "_suggest_next_action") && (result = this:_suggest_next_action())) 135action = result[1]; 136if (((action[1] in $rpg.repeatable_actions) || is_player(this)) || (action != this.last_action)) 137next_action_delay = result[2]; 138"...add our auto-action to the queue..."; 139this.queue = {action, @this.queue}; 140endif 141endif 142else 143next_action_delay = 0; 144endif 145this.action_count = this.action_count + 1; 146if ((this.action_count >= 90) && (!`this.no_action_warn ! ANY => 0')) 147next_action_delay = max(next_action_delay, 1); 148if (((time() - $nets.prognet.last_action_warning) > 10) && (!is_player(this))) 149debug_info = tostr($su:nn(data[1]), " args: ", $su:sv(data[2]), @pass_to_finish ? {" pass: " + toliteral(pass_to_finish)} | {}); 150$nets.bugnet:announce(#-1, tostr($su:nn(this), " reached action count of ", this.action_count, "!"), 1); 151$nets.bugnet:announce(#-1, tostr("with: ", debug_info), 1); 152$nets.prognet.last_action_warning = time(); 153if (`this.heart ! ANY' == 0) 154$heart:register(this); 155endif 156endif 157endif 158endwhile 159this.preemptible = 1;
fork_process_queue
Referenced by
- #92:queue_action line 26:
this:fork_process_queue - #92:cancel_current_action line 28:
this:fork_process_queue - #92:jumpstart line 8:
this:fork_process_queue - #92:jumpstart line 11:
this:fork_process_queue - #155:cancel_current_action line 14:
this:fork_process_queue
Source
1":fork_process_queue()"; 2"Fork off a process_queue task."; 3"If args[1], do it even if there's a valid one already."; 4force = args ? args[1] | 0; 5if ((!force) && task_valid(this.process_queue)) 6return; 7endif 8fork pq_task (0) 9player = this; 10this:process_queue(); 11endfork 12this.process_queue = pq_task; 13this.preemptible = 0; 14this.executing = {};
queue_action
Referenced by
- #3:go line 7:
player:queue_action - #3:e line 3:
player:queue_action - #3:cover line 10:
player:queue_action - #3:recline line 1:
player:queue_action - #3:search line 2:
player:queue_action - #5:give line 16:
player:queue_action - #5:give line 18:
player:queue_action - #5:hold line 2:
player:queue_action - #5:hold line 4:
player:queue_action - #5:throw line 9:
player:queue_action - #5:stash line 9:
player:queue_action - #5:break*down line 6:
player:queue_action - #5:improv*ise line 5:
player:queue_action - #5:improv*ise line 24:
player:queue_action - #5:_push line 21:
player:queue_action - #6:go line 11:
player:queue_action - #6:repair line 9:
player:queue_action - #6:teach line 35:
player:queue_action - #6:track line 6:
this:queue_action - #6:track line 8:
this:queue_action - #6:pee line 32:
this:queue_action - #6:_heartbeat_hunger line 10:
this:queue_action - #6:pose line 3:
player:queue_action - #6:scam line 11:
player:queue_action - #33:queue_action line 10:
pass( - #33:queue_action line 13:
pass( - #33:queue_action line 16:
pass( - #33:pick line 36:
player:queue_action - #50:paramedic line 70:
$flywheel:queue_action - #92:prequeue_action line 9:
this:queue_action - #95:at*tack line 12:
player:queue_action - #95:at*tack line 30:
player:queue_action - #95:brandish line 10:
player:queue_action - #100:beg_disabled line 10:
this:queue_action - #104:butch*er line 21:
player:queue_action - #104:cut line 23:
player:queue_action - #106:_pee line 24:
this:queue_action - #106:_pee line 27:
this:queue_action - #106:_pee line 33:
this:queue_action - #106:_pee line 42:
this:queue_action - #106:take_damage line 9:
this:queue_action - #107:start_fighting line 54:
this:queue_action - #107:stop_fighting line 14:
this:queue_action - #107:get_all line 27:
this:queue_action - #107:get_all line 37:
this:queue_action - #107:drop line 41:
this:queue_action - #107:stow line 3:
this:queue_action - #107:stow line 13:
this:queue_action - #107:stow line 15:
this:queue_action - #107:dress line 10:
player:queue_action - #107:get line 64:
this:queue_action - #107:bolt line 9:
this:queue_action - #107:brandish line 6:
player:queue_action - #107:junk line 25:
player:queue_action - #111:wear line 6:
player:queue_action - #111:rem*ove line 11:
player:queue_action - #119:open line 5:
player:queue_action - #119:close line 1:
player:queue_action - #119:pick_old line 25:
player:queue_action - #119:unlock line 7:
player:queue_action - #119:unlock line 12:
player:queue_action - #119:lock line 8:
player:queue_action - #119:lock line 10:
player:queue_action - #119:lock line 15:
player:queue_action - #119:knock line 1:
player:queue_action - #119:bash line 1:
player:queue_action - #119:listen line 5:
player:queue_action - #119:slam line 1:
player:queue_action - #127:install line 32:
player:queue_action - #128:light line 33:
player:queue_action - #128:light line 49:
player:queue_action - #135:pull line 1:
player:queue_action - #135:grenade line 13:
player:queue_action - #137:recline line 11:
player:queue_action - #138:eat line 8:
player:queue_action - #142:enter_room line 17:
this:queue_action - #143:hear_event_knock line 12:
this:queue_action - #146:open line 6:
player:queue_action - #146:open line 8:
player:queue_action - #146:open line 10:
player:queue_action - #146:lock line 17:
player:queue_action - #146:pick line 8:
player:queue_action - #146:bolt_old line 17:
player:queue_action - #146:unbolt_old line 10:
player:queue_action - #147:make_old line 9:
player:queue_action - #147:make line 37:
player:queue_action - #148:check*pulse line 1:
player:queue_action - #151:switch line 15:
player:queue_action - #154:feed line 14:
player:queue_action - #198:eat line 5:
player:queue_action - #227:start line 10:
this:queue_action - #267:disarm line 11:
player:queue_action - #335:use line 32:
player:queue_action - #338:drink line 1:
player:queue_action - #338:wash line 8:
player:queue_action - #338:drink line 1:
player:queue_action - #338:chug line 2:
player:queue_action - #342:copy line 7:
player:queue_action
Source
1":queue_action(OBJ action, LIST callback_args[, BOOL interruptable, STR command_strin])"; 2"Add an action to the queue, and start the queue if needed."; 3action = args[1]; 4cargs = args[2]; 5inter = (length(args) > 2) ? args[3] | 1; 6cmd = (length(args) > 3) ? args[4] | ""; 7if (length(this.queue) > 25) 8this:tell($ansi.cyan + "[ Sorry -- can't queue ", action.name, " (", cmd, "), more than 25 actions! ]" + $ansi.reset); 9return; 10endif 11if (this.programmer) 12`this:debug_tell("action", "queue | " + $su:nn(action)) ! ANY => 0'; 13endif 14queue_item = {action, cargs, inter, cmd}; 15this.queue = {@this.queue, queue_item}; 16if (task_valid(this.process_queue)) 17if (this.preemptible) 18"...we're already running a low-priority paused-before-action, so kill it..."; 19this:cancel_current_action(); 20else 21if (cmd) 22this:tell((($ansi.cyan + ("[ queued '" + args[4])) + "' ]") + $ansi.reset); 23endif 24endif 25else 26this:fork_process_queue(); 27endif
suggest_next_action
Referenced by
- #92:jumpstart line 9:
this:suggest_next_action
Source
1return;
qu*eue
Referenced by
none
Source
1if (dobjstr && player.programmer) 2if (!valid(dobj)) 3dobj = $su:match_player(dobjstr); 4if (!valid(dobj)) 5player:tell("queue who?"); 6return; 7endif 8endif 9if (!is_a(dobj, $actor)) 10player:tell("You can't queue that."); 11return; 12endif 13player:tell("Showing queue for ", $su:nn(dobj), ":"); 14else 15dobj = this; 16endif 17if ((!dobj.queue) && (!dobj.executing)) 18player:notify("You've got nothing to do."); 19else 20if (dobj.executing) 21player:notify(("At the moment, you're " + tostr(dobj:doing_msg())) + "."); 22endif 23for x in (dobj.queue) 24player:notify(" --> " + x[4]); 25endfor 26player:notify(" --> (end of queue)"); 27endif
doing_msg
Referenced by
- #6:who_doing_msg_old line 4:
this:doing_msg - #33:doing_msg line 2:
pass( - #92:backup_queue line 6:
this:doing_msg - #107:look_self line 23:
this:doing_msg - #107:posture_msg line 7:
who:doing_msg
Source
1if (this.executing) 2if (this.executing[1] == this) 3return "doing something"; 4elseif (is_a(this.executing[1], $action)) 5return this.executing[1]:(verb)(this, this.executing[2]); 6elseif ($ou:has_verb(this.executing[1], "action_" + verb)) 7return this.executing[1]:("action_" + verb)(this, this.executing[2]); 8else 9doingverb = is_a(this.executing[1], $action) ? "doing_msg" | "action_doing_msg"; 10$nets.gamenet:announce(#2, tostr($su:nn(this.executing[1]), " lacks a :", doingverb, "() => ", toliteral(this.executing)), 1); 11return "using " + this.executing[1]:iname(); 12endif 13return ""; 14endif
clear_queue
Referenced by
- #100:stop line 31:
this:clear_queue - #100:stop line 67:
this:clear_queue - #106:hear_event_arrive line 4:
this:clear_queue - #106:spared_by line 6:
this:clear_queue - #107:die line 16:
this:clear_queue - #107:die line 162:
this:clear_queue - #107:_knockout line 23:
this:clear_queue - #107:_wake line 25:
this:clear_queue - #142:die line 26:
this:clear_queue
Source
1":clear_queue()"; 2"Kill all queued actions."; 3this.queue = {}; 4this:cancel_current_action(1); 5this.preemptible = 1;
cancel_current_action
Referenced by
- #6:dodge_or_parry line 3:
this:cancel_current_action - #6:hear_event_move line 10:
this:cancel_current_action - #33:queue_action line 9:
this:cancel_current_action - #89:die line 12:
this:cancel_current_action - #92:process_queue line 58:
this:cancel_current_action - #92:process_queue line 118:
this:cancel_current_action - #92:queue_action line 19:
this:cancel_current_action - #92:clear_queue line 4:
this:cancel_current_action - #92:prequeue_action line 5:
this:cancel_current_action - #92:cancel_if_possible line 3:
this:cancel_current_action - #100:stop line 58:
this:cancel_current_action - #100:stop line 66:
this:cancel_current_action - #100:forbid_action line 14:
this:cancel_current_action - #106:spared_by line 5:
this:cancel_current_action - #107:take_damage line 61:
this:cancel_current_action - #107:take_damage line 68:
this:cancel_current_action - #107:die line 161:
this:cancel_current_action - #107:dodge_or_parry line 49:
this:cancel_current_action - #107:stop_fighting line 8:
this:cancel_current_action - #107:rescue line 26:
this:cancel_current_action - #107:rescue line 27:
player:cancel_current_action - #107:break_grasp line 3:
this:cancel_current_action - #142:_aggression line 12:
this:cancel_current_action
Source
1":cancel_current_action([INT dontabort])"; 2"If we're currently executing an action, abort it and immediately start our next action."; 3{?dontabort = 0} = args; 4if (this.executing && (length(this.executing) >= 5)) 5if (this.executing[5] == 0) 6"We are in _start, set a flag telling :process_queue to stop the action."; 7this.executing[5] = 2 + dontabort; 8return; 9elseif (this.executing[5] in {2, 3}) 10"Already asked to abort, nothing to do..."; 11return; 12elseif (this.executing[5] == 4) 13"Doing _finish, so we can't really cancel now, but if it a continuing action it might still want to do something..."; 14this.executing[5] = 2 + dontabort; 15return; 16elseif (this.executing[5] == 1) 17"We are between _start and _finish, cancel and move on."; 18if ((!dontabort) && has_callable_verb(this.executing[1], "_abort")) 19this.executing[1]:_abort(this, @this.executing[2..4]); 20endif 21this.executing = {}; 22"It is intentional that this case doesn't return."; 23endif 24endif 25old_pq = this.process_queue; 26if (this.queue) 27"Calling with a 1 to force it."; 28this:fork_process_queue(1); 29endif 30if (task_valid(old_pq)) 31kill_task(old_pq); 32endif
jumpstart
Referenced by
- #100:stop line 70:
this:jumpstart - #106:hear_event_arrive line 7:
this:jumpstart - #106:head_to line 33:
this:jumpstart - #107:heartbeat line 12:
this:jumpstart - #107:dodge_or_parry line 50:
this:jumpstart - #107:base_dodge line 4:
this:jumpstart - #107:_walk line 8:
this:jumpstart - #142:kill_target line 3:
this:jumpstart - #143:_wander line 4:
this:jumpstart - #155:plan_action line 6:
this:jumpstart
Source
1"See if we have an action from :suggest_next_action(). If so, throw it on the queue and fire it up."; 2"Don't do anything if we already have a valid process_queue."; 3if (!this.f) 4if (!task_valid(this.process_queue)) 5if (this.queue) 6this.owner:tell($ansi.yellow, " Restarting dead queue for ", $su:nn(this), ".", $ansi.reset); 7this.owner:tell($ansi.yellow, $su:from_list(this.queue[1], " "), $ansi.reset); 8this:fork_process_queue(); 9elseif (r = this:suggest_next_action()) 10this.queue = {r[1]}; 11this:fork_process_queue(); 12endif 13endif 14endif
prequeue_action
Referenced by
- #33:dodge line 10:
this:prequeue_action
Source
1":prequeue_action(OBJ action, LIST callback_args, BOOL interruptable, STR command_string, [INT no_cancel_current])"; 2"Insert an action at the head of the queue for immediate next execution, cancelling any action currently being executed (or not, with 5 args)."; 3if ((length(args) < 5) || (!args[5])) 4if (!`this.executing[1].unstoppable ! ANY') 5this:cancel_current_action(); 6endif 7endif 8if (!this.queue) 9this:queue_action(@args); 10else 11action = args[1]; 12cargs = args[2]; 13inter = (length(args) > 2) ? args[3] | 1; 14cmd = (length(args) > 3) ? args[4] | ""; 15this.queue = {{action, cargs, inter, cmd}, @this.queue}; 16endif
backup_queue
Referenced by
none
Source
1"Copied from generic actor (#716):queue by Gilmore (#98) Tue Aug 7 19:37:24 2007 CDT"; 2if ((!this.queue) && (!this.executing)) 3player:notify("You've got nothing to do."); 4else 5if (this.executing) 6player:notify(("At the moment, you're " + this:doing_msg()) + "."); 7endif 8for x in (this.queue) 9player:notify(" --> " + x[4]); 10endfor 11player:notify(" --> (end of queue)"); 12endif
is_doing
Referenced by
- #3:e line 2:
player:is_doing - #6:pee line 9:
this:is_doing - #6:hear_event_move line 7:
this:is_doing - #6:post_pee line 7:
this:is_doing - #33:dodge line 5:
this:is_doing - #100:stop line 9:
this:is_doing - #100:stop line 11:
this:is_doing - #100:stop line 15:
this:is_doing - #100:forbid_action line 4:
this:is_doing - #106:_allows line 1:
this:is_doing - #106:_allows line 1:
this:is_doing - #107:dodge_or_parry line 30:
this:is_doing - #107:_allows line 9:
this:is_doing - #107:_allows line 13:
this:is_doing - #107:break_grasp line 2:
this:is_doing - #107:reachable_by line 2:
this:is_doing - #227:start line 4:
this:is_doing
Source
1if (this.executing) 2doing = this.executing; 3elseif (this.queue) 4doing = this.queue[1]; 5else 6return args ? 0 | #-1; 7endif 8if (!args) 9return doing[1]; 10else 11{?action = #-1, ?target = #-1} = args; 12endif 13doing_target = `doing[2][1] ! ANY => #-1'; 14if (doing[1] == action) 15if (valid(target)) 16if (target == doing_target) 17return 1; 18else 19return 0; 20endif 21endif 22return 1; 23endif 24return 0;
cancel_if_possible
Referenced by
- #33:dodge line 9:
this:cancel_if_possible - #107:dodge_or_parry line 36:
this:cancel_if_possible
Source
1if (this.executing) 2if (!`this.executing[1].unstoppable ! ANY') 3return this:cancel_current_action(); 4endif 5endif
take_damage
Referenced by
none
Source
No program (verb defined but unprogrammed).
iname
Referenced by
- #107:iname line 2:
pass(
Source
1name = this:name(); 2if (!name) 3return ""; 4endif 5if (this.f) 6name = strsub(name, "generic ", ""); 7endif 8if ((this.article == "") || (has_property(this, "has_proper_name") && this.has_proper_name)) 9return name; 10elseif (!this.article) 11if (index("aeiou", name[1])) 12return "an " + name; 13elseif (index("bcdfghjklmnpqrstvwxyz", name[1])) 14return "a " + name; 15else 16return ($english_utils:article_for(name) + " ") + name; 17endif 18else 19return (this.article + " ") + name; 20endif
floats
Referenced by
none
Source
1"Copied from generic thing (#5):floats by Gilmore (#98) Sat Jun 27 05:19:29 2009 CDT"; 2return this.floats;