MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | #include <commands.h> |
| 3 | #include <sent.h> |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 4 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 5 | mixed * query_actions(object ob, mixed mask_or_verb) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 6 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 7 | DESCRIPTION |
| 8 | query_actions takes either an object or a filename as first |
| 9 | argument and a bitmask (int) or string as a second argument. |
| 10 | If the second argument is a string, query_actions() will return |
| 11 | an array containing information (see below) on the verb or |
| 12 | zero if the living object "ob" cannot use the verb. If the |
| 13 | second argument is a bitmask, query_actions() will return a |
| 14 | flat array containing information on all verbs added to ob. |
| 15 | The second argument is optional (default is QA_VERB). |
| 16 | QA_VERB ( 1): the verb |
| 17 | QA_TYPE ( 2): type |
| 18 | QA_SHORT_VERB ( 4): short_verb |
| 19 | QA_OBJECT ( 8): object |
| 20 | QA_FUNCTION (16): function |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 21 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 22 | "type" is one of the values defined in <sent.h> |
| 23 | (which is provided with the parser source). |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 24 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 25 | SENT_PLAIN added with add_action (fun, cmd); |
| 26 | SENT_SHORT_VERB added with add_action (fun, cmd, AA_SHORT); |
| 27 | SENT_NO_SPACE added with add_action (fun, AA_NOSPACE); |
| 28 | SENT_MARKER internal, won't be in the returned array |
| 29 | negative value: The verb given by the player has to match only |
| 30 | the leading -<value> characters of the action's verb. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 31 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 32 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 33 | add_action(E), init(A) |