TActionclass
action.t[1559], english.t[5497], signals.t[336], sysrules.t[476]
A TAction is an action that applies to a single direct object. Other action classes that apply to more than one object, such as TIAction, inherit from this class so some of the code needs to take that into account.
class
TAction
:
Action
Superclass Tree (in declaration order)
TAction
Action
ReplaceRedirector
Redirector
` object`
Subclass Tree
TAction
LiteralTAction
NumericTAction
TIAction
TIAAction
TopicTAction
Global Objects
Attach
Attack
Board
Break
Burn
Clean
Climb
ClimbDown
ClimbUp
Close
Cut
Detach
Dig
Doff
Drink
Drop
Eat
Enter
Examine
ExamineOrGoTo
Extinguish
Fasten
Feel
Flip
Follow
GetOff
GetOutOf
GiveToImplicit
GoAlong
GoNear
GoThrough
GoTo
JumpOff
JumpOver
Kiss
LieIn
LieOn
Light
ListenTo
Lock
LookBehind
LookIn
LookThrough
LookUnder
Move
Open
PlugIn
Pour
Pull
Purloin
Push
PushTravelDir
Read
Remove
Screw
Search
Set
ShowToImplicit
SitIn
SitOn
SmellSomething
StandIn
StandOn
Strike
SwitchOff
SwitchOn
SwitchVague
Take
TalkTo
Taste
Throw
ThrowDir
TravelVia
Turn
TypeOnVague
Unfasten
Unlock
Unplug
Unscrew
Wear
Summary of Properties
actionList
announceMultiAction
announceMultiCheck
announceMultiVerify
aqinfo
curDobj
curObj
dqinfo
gActor
haltOnMessageInCheck
iqinfo
lastVerifyMsg
reportFailureAfterSuccess
reportList
signal
verifyTab
Inherited from Action
:
actionFailed
advanceOnFailure
againRepeatsParse
allowAll
extraMessageParams
failCheckMsg
failedActionCountsAsTurn
implicitTimeTaken
includeInUndo
isConversational
isImplicit
isRepeatable
oldRoom
parentAction
parentAllowAll
preCond
redirectParent
reportImplicitActions
scopeList
spellingPriority
synthParamID
timeTaken
turnsTaken
unhides
verifyObj
wasIlluminated
Summary of Methods
addVerifyResult
check
checkAction
checkPreCond
doAction
doActionOnce
execAction
execCycle
execResolvedAction
getAll
getMessageParam
getVerbPhrase
getVerbPhrase1
makeScopeUniversal
reportAction
reset
resolvedObjectsInScope
setResolvedObjects
Inherited from Action
:
acknowledgeNotifyStatus
addExtraScopeItems
addImplicitTime
advanceTime
afterAction
announceObject
beforeAction
buildImplicitActionAnnouncement
buildScopeList
checkActionPreconditions
commandNotPresent
exec
execGroup
getAllUnhidden
implicitAnnouncement
scoreObjects
setMessageParam
setMessageParams
spPrefix
spSuffix
synthMessageParam
turnSequence
verify
verifyObjRole
wrapObjectsNP
Inherited from ReplaceRedirector
:
redirect
Inherited from Redirector
:
doInstead
doNested
doOtherAction
Properties
actionList
A list of the direct objects of this action that make it to the action stage.
announceMultiAction
set this property to true if you want to announce the object before the action result when there’s more than one object. If the action routine summarizes the result at the end you don’t want to do this so you should then set this to nil.
announceMultiCheck
Flag: do we want the object name to appear before a check stage failure message if multiple objects are involved in the action. By default we do, otherwise it might not be clear which object the message referes to.
announceMultiVerify
Flag, do we want to announce the object name before the verify message in cases where there’s more direct object in the command? By default we don’t since verify messages generally make it clear enough which objects they refer to.
aqinfo
no description available
curDobj
The current direct object of this action
curObj
The current object being processed (in a TAction, always the curDObj; in a TI Action either the curDobj or the curIOoj).
dqinfo
Information to allow the DEBUG ACTIONS command to express a complete topic phrase
gActor
Set the current actor to the player character at the start of the game (to ensure we have a current actor defined).
haltOnMessageInCheck
This flag is used internally by the library to track whether the output of any text from a check() should stop the action, which it normally should. Game code should not directly override this property or change its value, other than indrectly via the noHalt() function.
iqinfo
no description available
lastVerifyMsg
Store the last verify failure message so that if we get several identical ones in a row, we don’t keep repeating them
reportFailureAfterSuccess
Flag: when a command processes multiple direct objects, do we want any failed attempts to be reported after successful ones?
reportList
A list of the direct objects of this action that make it to the report stage.
signal
The signal (if any) )o be emitted by the direct object of this action. [SIGNALS EXTENSION]
verifyTab
A LookupTable containing the verify results for this action. This is keyes on the object being verified, with the value being the worst verify result encountered for that object so far.
Methods
addVerifyResult (verRes)
Add a verify result to this action’s verify table. This method is normally called by one of the macros (logical, illogical, logicalRank, etc.) use in an object’s verify routine.
check (obj, checkProp)
Call the check method (checkProp) on the appropriate object (obj). Return true to indicate that the action succeeds or nil otherwise
checkAction (cmd)
OVERRIDDEN
Run the check phase of the action, both on the direct object and on any preconditions.
checkPreCond (obj, preCondProp)
Run the check stage on the preCondProp of obj
doAction ( )
action.t[2040], signals.t[347]
Return true to tell our caller we succesfully completed the action.
Modified in
signals.t[347]:
If this action defines an associated signal, then have the direct object
emit the signal after carrrying out out inherited handling. [SIGNALS
EXTENSION]
doActionOnce ( )
Carry out the action phase on the direct object
execAction (cmd)
OVERRIDDEN
Execute this action
execCycle (cmd)
OVERRIDDEN
Execute the command cycle for this action. This differs from the base Action class in not calling beforeAction directly, since the beforeAction() notifications occur within the execResolvedAction method.
execResolvedAction ( )
Execute this action with a known direct object or objects. Call this method when there’s no need to resolve the objects used in the command but we still want it to pass through every stage
getAll (cmd, role)
OVERRIDDEN
Return a list of direct objects corresponding to the word ALL in the player’s command. By default we return everything in scope that isn’t a a Room.
getMessageParam (objName)
OVERRIDDEN
Get a message parameter object for the action. We define ‘dobj’ as the direct object, in addition to any inherited targets.
getVerbPhrase (inf, ctx)
get the verb phrase in infinitive or participle form
getVerbPhrase1 (inf, vp, dobjText, dobjIsPronoun)
Given the text of the direct object phrase, build the verb phrase for a one-object verb. This is a class method that can be used by other kinds of verbs (i.e., non-TActions) that use phrasing like a single object.
‘inf’ is a flag indicating whether to use the infinitive form (true) or the present participle form (nil); ‘vp’ is the verbPhrase string; ‘dobjText’ is the direct object phrase’s text; and ‘dobjIsPronoun’ is true if the dobj text is rendered as a pronoun.
makeScopeUniversal ( )
A convenience method for putting every game object in scope, which may be appropriate for certain commands (not least, certain debugging commands). It’s intended to be called from addExtraScopeItems when
reportAction ( )
OVERRIDDEN
action.t[2122], sysrules.t[494]
reportAction() is called only after all the action routines have been run and the list of dobjs acted on is known. It only does anything if the action is not implicit. It can thus be used to summarize a list of identical actions carried out on every object in reportList or to print a report that is not wanted if the action is implicit. By default we call the dobj’s reportDobjProp to handle the report.
Note that this method is usually called from the current Command object after its finished iterated over all the direct objects involved in the command.
Modified in
sysrules.t[494]:
MODIFIED FOR SYSRULES EXTENSION
reportAction() is called only after all the action routines have been run and the list of dobjs acted on is known. It only does anything if the action is not implicit. It can thus be used to summarize a list of identical actions carried out on every object in reportList or to print a report that is not wanted if the action is implicit. By default we call the dobj’s reportDobjProp to handle the report.
Note that this method is usually called from the current Command object after its finished iterated over all the direct objects involved in the command.
This modified version uses the reportRules rulebook to make it easy to insert differently worded summary reports.
reset ( )
Reset values to their starting state when an action is used to execute a new command.
resolvedObjectsInScope ( )
Check whether the resolved objects for this action are in scope
setResolvedObjects (dobj)
install the resolved objects in the action
Adv3Lite Library Reference Manual
Generated on 15/03/2023 from adv3Lite version 1.6.1