1 /* src/server/thing_actions.h
3 * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
4 * or any later version. For details on its copyright, license, and warranties,
5 * see the file NOTICE in the root directory of the PlomRogue source package.
7 * Actions that can be performed by living things / "actors". Note that apart
8 * from the consequences described below, each action may also trigger log
9 * messages and other minor stuff if the actor is equal to the player.
12 #ifndef THING_ACTIONS_H
13 #define THING_ACTIONS_H
19 /* Actor "t" does nothing. */
20 extern void actor_wait(struct Thing * t);
22 /* Actor "t" tries to move one step in direction described by char t->arg (where
23 * north-east is 'e', east 'd' etc.) Move either succeeds, or another actor is
24 * encountered and hit (which leads ot its lifepoint decreasing by one and
25 * eventually death), or the move fails due to an impassable target square. On
26 * success, update thing's field of view map.
28 extern void actor_move(struct Thing * t);
30 /* Actor "t" tries to drop from inventory thing indexed by number t->args. */
31 extern void actor_drop(struct Thing * t);
33 /* Actor "t" tries to pick up topmost thing from ground into its inventory. */
34 extern void actor_pick(struct Thing * t);
36 /* Actor "t" tries to use thing in inventory indexed by number t->args.
37 * (Currently the only valid use is consuming items defined as consumable.)
39 extern void actor_use(struct Thing * t);
41 /* Increment "t"'s lifepoints to a 1/32 chance if its .satiation is positive,
42 * its lifepoints are below "t"'s type's .lifepoints, and "t"'s .command is the
43 * ID of the waiting action. On success, also decrement .satiation by by 32.
45 extern void try_healing(struct Thing * t);
47 /* Decrement "t"'s satiation and trigger a chance (dependent on over-/under-
48 * satiation value) of lifepoint decrement.
50 extern void hunger(struct Thing * t);