Crossfire Server, Branches 1.12
R18729
|
Go to the source code of this file.
Functions | |
static void | animate_trigger (object *op) |
static void | change_object (object *op) |
object * | fix_stopped_arrow (object *op) |
void | fix_stopped_item (object *op, mapstruct *map, object *originator) |
int | free_no_drop (object *op) |
static void | generate_monster (object *gen) |
static void | generate_monster_arch (object *gen) |
static void | generate_monster_inv (object *gen) |
void | legacy_animate_trigger (object *op) |
void | legacy_move_hole (object *op) |
void | legacy_remove_force (object *op) |
void | move_firewall (object *op) |
static void | move_hole (object *op) |
void | move_player_mover (object *op) |
int | process_object (object *op) |
void | remove_door (object *op) |
static void | remove_force (object *op) |
void | remove_locked_door (object *op) |
object * | stop_item (object *op) |
Routines that is executed from objects based on their speed have been collected in this file.
Definition in file time.c.
|
static |
Animate a TRIGGER.
op | trigger. |
Definition at line 351 of file time.c.
References check_trigger(), NUM_ANIMATIONS, SET_ANIMATION, obj::stats, UP_OBJ_FACE, update_object(), and liv::wc.
Referenced by legacy_animate_trigger().
|
static |
Replaces op with its other_arch if it has reached its end of life.
This routine doesnt seem to work for "inanimate" objects that are being carried, ie a held torch leaps from your hands!. Modified this routine to allow held objects. b.t.
op | object to change. Will be removed and replaced. |
Definition at line 559 of file time.c.
References arch_to_object(), obj::env, find_first_free_spot(), FLAG_ALIVE, liv::food, free_object(), freearr_x, freearr_y, liv::hp, insert_ob_in_map(), insert_ob_in_ob(), LAMP, llevError, LOG(), obj::map, obj::name, NROFNEWOBJS, obj::other_arch, QUERY_FLAG, remove_ob(), obj::stats, obj::type, obj::x, and obj::y.
Referenced by process_object().
An ARROW stops moving.
op | arrow stopping. |
Definition at line 483 of file time.c.
References add_string(), obj::arch, obj::attacktype, archt::clone, liv::dam, obj::direction, obj::face, liv::food, FREE_AND_CLEAR_STR, free_no_drop(), free_object(), liv::grace, liv::hp, obj::level, obj::move_on, obj::move_type, obj::owner, remove_ob(), rndm(), obj::skill, obj::slaying, liv::sp, obj::speed, obj::spellarg, obj::stats, UP_OBJ_FACE, update_ob_speed(), update_object(), and liv::wc.
Referenced by hit_with_arrow(), stop_item(), and stop_projectile().
Put stopped item where stop_item() had found it. Inserts item into the old map, or merges it if it already is on the map.
op | object to stop. |
map | must be the value of op->map before stop_item() was called. |
originator | what caused op to be stopped. |
Definition at line 466 of file time.c.
References ARROW, FLAG_REMOVED, insert_ob_in_map(), merge_ob(), QUERY_FLAG, and obj::type.
Referenced by save_throw_object().
int free_no_drop | ( | object * | op | ) |
Check whether the given object is FLAG_NO_DROP. If so, (optionally) remove and free it.
op | the object to check |
Definition at line 536 of file time.c.
References FLAG_NO_DROP, FLAG_REMOVED, free_object2(), QUERY_FLAG, and remove_ob().
Referenced by fix_stopped_arrow(), hit_with_arrow(), and stop_item().
|
static |
Main generator function. Will generate a monster based on the parameters.
gen | generator. |
Definition at line 222 of file time.c.
References obj::above, FLAG_CONTENT_ON_GEN, generate_monster_arch(), generate_monster_inv(), GENERATE_SPEED, GET_MAP_OB, get_ob_key_value(), obj::map, MAP_HEIGHT, MAP_WIDTH, obj::name, QUERY_FLAG, rndm(), set_ob_key_value(), and strtol().
Referenced by process_object().
|
static |
Generate a monster from the other_arch field.
See generate_monster() for the main generator function.
gen | generator. |
Definition at line 168 of file time.c.
References arch_to_object(), archt::clone, create_treasure(), mapdef::difficulty, find_multi_free_spot_within_radius(), FLAG_FREED, generate_artifact(), get_ob_key_value(), GT_APPLY, HAS_RANDOM_ITEMS, obj::head, insert_ob_in_map(), llevError, LOG(), obj::map, obj::more, archt::more, obj::name, obj::other_arch, QUERY_FLAG, obj::randomitems, rndm(), set_ob_key_value(), obj::x, and obj::y.
Referenced by generate_monster().
|
static |
Will generate a monster according to parameters of generator.
What is generated should be in the generator's inventory.
See generate_monster() for the main generator function.
gen | generator. |
Definition at line 114 of file time.c.
References obj::below, CLEAR_FLAG, create_treasure(), mapdef::difficulty, find_multi_free_spot_within_radius(), fix_multipart_object(), FLAG_FREED, FLAG_IS_A_TEMPLATE, generate_artifact(), get_ob_key_value(), GT_APPLY, HAS_RANDOM_ITEMS, insert_ob_in_map_at(), obj::inv, llevError, LOG(), obj::map, obj::name, object_create_clone(), QUERY_FLAG, obj::randomitems, rndm(), set_ob_key_value(), and unflag_inv().
Referenced by generate_monster().
void legacy_animate_trigger | ( | object * | op | ) |
Definition at line 772 of file time.c.
References animate_trigger().
Referenced by legacy_ob_process().
void legacy_move_hole | ( | object * | op | ) |
Definition at line 776 of file time.c.
References move_hole().
Referenced by legacy_ob_process().
void legacy_remove_force | ( | object * | op | ) |
Definition at line 768 of file time.c.
References remove_force().
Referenced by legacy_ob_process().
void move_firewall | ( | object * | op | ) |
Move for FIREWALL.
firewalls fire other spells. The direction of the wall is stored in op->stats.sp. walls can have hp, so they can be torn down.
op | firewall. |
Definition at line 610 of file time.c.
References cast_spell(), obj::inv, llevError, LOG(), obj::map, obj::name, mapdef::name, rndm(), liv::sp, obj::stats, obj::x, and obj::y.
|
static |
Move a HOLE.
op | hole to move. |
Definition at line 367 of file time.c.
References obj::above, animate_object(), obj::move_on, MOVE_WALK, NUM_ANIMATIONS, ob_move_on(), obj::speed, obj::state, obj::stats, UP_OBJ_FACE, update_ob_speed(), update_object(), obj::value, and liv::wc.
Referenced by legacy_move_hole().
void move_player_mover | ( | object * | op | ) |
This function takes a PLAYERMOVER as an argument, and performs the function of a player mover, which is:
a player mover finds any players that are sitting on it. It moves them in the op->stats.sp direction. speed is how often it'll move.
op | mover. |
Definition at line 639 of file time.c.
References obj::above, obj::attacktype, obj::contr, FABS, pl::fire_on, FLAG_ALIVE, FLAG_LIFESAVE, FLAG_WIZPASS, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, liv::hp, obj::level, llevError, LOG(), obj::map, liv::maxsp, move_object(), move_player(), obj::move_type, P_OUT_OF_MAP, mapdef::path, PLAYER, PLAYERMOVER, QUERY_FLAG, remove_ob(), rndm(), should_director_abort(), liv::sp, obj::speed, obj::speed_left, obj::stats, obj::type, obj::x, and obj::y.
Referenced by legacy_ob_process().
int process_object | ( | object * | op | ) |
Main object move function.
op | object to move. |
Definition at line 724 of file time.c.
References obj::anim_speed, animate_object(), change_object(), obj::direction, EVENT_TIME, execute_event(), obj::facing, FLAG_ANIMATE, FLAG_APPLIED, FLAG_CHANGING, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_IS_A_TEMPLATE, FLAG_IS_USED_UP, FLAG_MONSTER, FLAG_SEE_ANYWHERE, liv::food, free_object(), generate_monster(), make_sure_not_seen(), make_sure_seen(), METHOD_OK, move_monster(), ob_process(), PLAYER, QUERY_FLAG, remove_force(), remove_ob(), SCRIPT_FIX_NOTHING, obj::state, obj::stats, obj::temp_anim_speed, obj::temp_animation_id, and obj::type.
Referenced by attack_ob_simple(), and process_events().
void remove_door | ( | object * | op | ) |
Remove non locked doors. The functions check to see if similar doors are next to the one that is being removed, and if so, set it so those will be removed shortly (in a cascade like fashion.)
op | door to remove. |
Definition at line 51 of file time.c.
References arch_to_object(), DOOR, free_object(), freearr_x, freearr_y, insert_ob_in_map(), obj::level, obj::map, obj::other_arch, present(), remove_ob(), obj::speed, obj::speed_left, update_ob_speed(), obj::x, and obj::y.
Referenced by attempt_pick_lock(), and legacy_ob_process().
|
static |
Move for FORCE objects.
op | force to test. |
Definition at line 284 of file time.c.
References change_abil(), check_spell_expiry(), CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), obj::duration, obj::env, fix_object(), FLAG_APPLIED, FLAG_CONFUSED, FORCE_CONFUSION, FORCE_TRANSFORMED_ITEM, free_object(), get_player_container(), HUGE_BUF, insert_ob_in_map(), insert_ob_in_ob(), obj::inv, obj::map, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_ITEM, MSG_TYPE_ITEM_CHANGE, NDI_UNIQUE, obj::nrof, query_short_name(), remove_ob(), obj::subtype, obj::weight, obj::x, and obj::y.
Referenced by legacy_remove_force(), and process_object().
void remove_locked_door | ( | object * | op | ) |
Same as remove_door() but for locked doors.
op | door to remove. |
Definition at line 80 of file time.c.
References arch_to_object(), free_object(), freearr_x, freearr_y, insert_ob_in_map(), obj::level, LOCKED_DOOR, obj::map, obj::other_arch, present(), remove_ob(), obj::slaying, obj::speed, obj::speed_left, update_ob_speed(), obj::x, and obj::y.
Referenced by legacy_ob_process(), and player_attack_door().
An item (ARROW or such) stops moving.
stop_item() returns a pointer to the stopped object. The stopped object may or may not have been removed from maps or inventories. It will not have been merged with other items.
This function assumes that only items on maps need special treatment.
If the object can't be stopped, or it was destroyed while trying to stop it, NULL is returned.
fix_stopped_item() should be used if the stopped item should be put on the map.
op | object to check. |
Definition at line 426 of file time.c.
References ARROW, fix_stopped_arrow(), free_no_drop(), free_object(), obj::inv, obj::map, MIN_ACTIVE_SPEED, remove_ob(), obj::speed, THROWN_OBJ, and obj::type.
Referenced by pick_up(), and save_throw_object().