56 object *payload = op->
inv;
83 if (op->
map == NULL) {
91 new_x = op->
x+
DIRX(op);
92 new_y = op->
y+
DIRY(op);
150 int left, right, mflags;
179 if (!(mflags&P_OUT_OF_MAP)
182 new_x = x1, new_y = y1;
204 if (op->
speed < 0.05) {
225 if (trap->
inv == NULL) {
method_ret common_process_projectile(object *op)
Move an arrow or thrown object along its course.
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
int8_t direction
Means the object is moving that way.
method_ret common_pre_ob_move_on(object *trap, object *victim, object *originator)
int rndm(int min, int max)
Returns a number between min and max.
#define OB_TYPE_MOVE_BLOCK(ob1, type)
Basic macro to see if if ob1 can not move onto a space based on the 'type' move_block parameter Add c...
#define EVENT_STOP
Thrown object stopped.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to...
void object_update_turn_face(object *op)
If an object with the IS_TURNABLE() flag needs to be turned due to the closest player being on the ot...
int16_t y
Position in the map for this object.
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
#define FLAG_REFLECTING
Object reflects from walls (lightning)
Global type definitions and header inclusions.
char method_ret
Define some standard return values for callbacks which don't need to return any other results...
#define SCRIPT_FIX_NOTHING
int16_t level
Level of creature or object.
void object_free(object *ob, int flags)
Frees everything allocated by an object, removes it from the list of used objects, and puts it on the list of free objects.
#define FREE_OBJ_FREE_INVENTORY
Free inventory objects; if not set, drop inventory.
#define FLAG_ALIVE
Object can fight (or be fought)
method_ret common_projectile_move_on(object *trap, object *victim, object *originator)
Move on this Thrown Object object.
float speed
Frequency of object 'moves' relative to server tick rate.
#define QUERY_FLAG(xyz, p)
object * hit_with_arrow(object *op, object *victim)
hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile...
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects, and puts it on the list of free objects.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
#define P_OUT_OF_MAP
This space is outside the map.
#define GET_MAP_MOVE_BLOCK(M, X, Y)
Gets the blocking state of a square.
uint8_t state
How the object was last drawn (animation)
uint32_t tag_t
Object tag, unique during the whole game.
struct mapstruct * map
Pointer to the map in which this object is present.
object * map_find_by_flag(mapstruct *map, int x, int y, int flag)
Finds an object in a map tile by flag number.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
object * object_merge(object *op, object *top)
This function goes through all objects below and including top, and merges op to the first matching o...
void common_post_ob_move_on(object *trap, object *victim, object *originator)
static event_registration m
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
This rolls up wall, blocks_magic, blocks_view, etc, all into one function that just returns a P_...
void stop_projectile(object *op)
Handle an arrow or thrown object stopping.
object * inv
Pointer to the first object in the inventory.
void object_clear_owner(object *op)
Clears the owner of specified object.
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Execute an event on the specified object.
int absdir(int d)
Computes an absolute direction.
#define P_IS_ALIVE
Something alive is on this space.
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Same as object_insert_in_map() except it handle separate coordinates and do a clean job preparing mul...
tag_t count
Unique object number for this object.
Object type functions and variables.
#define FLAG_REFL_MISSILE
Arrows will reflect from object.
object * fix_stopped_arrow(object *op)
An ARROW stops moving.