![]() |
Crossfire Server, Trunk
1.75.0
|
Go to the source code of this file.
Functions | |
static void | animate_trigger (object *op) |
Animate a TRIGGER. More... | |
void | change_object (object *op) |
Replaces op with its other_arch if it has reached its end of life. More... | |
object * | fix_stopped_arrow (object *op) |
An ARROW stops moving. More... | |
void | fix_stopped_item (object *op, mapstruct *map, object *originator) |
Put stopped item where stop_item() had found it. More... | |
int | free_no_drop (object *op) |
Check whether the given object is FLAG_NO_DROP. More... | |
static void | generate_monster (object *gen) |
Main generator function. More... | |
static int | generate_monster_arch (object *gen) |
Generate a monster from the other_arch field. More... | |
static int | generate_monster_inv (object *gen) |
Will generate a monster according to parameters of generator. More... | |
void | legacy_animate_trigger (object *op) |
void | legacy_move_hole (object *op) |
void | legacy_remove_force (object *op) |
void | move_firewall (object *op) |
Move for FIREWALL. More... | |
static void | move_hole (object *op) |
Move a HOLE. More... | |
void | move_player_mover (object *op) |
This function takes a PLAYERMOVER as an argument, and performs the function of a player mover, which is: More... | |
void | process_object (object *op) |
Main object move function. More... | |
void | remove_door (object *op) |
Remove non locked doors. More... | |
static void | remove_force (object *op) |
Move for FORCE objects. More... | |
void | remove_locked_door (object *op) |
Same as remove_door() but for locked doors. More... | |
object * | stop_item (object *op) |
An item (ARROW or such) stops moving. More... | |
Routines that is executed from objects based on their speed have been collected in this file.
Definition in file time.cpp.
|
static |
Animate a TRIGGER.
op | trigger. |
Definition at line 383 of file time.cpp.
References check_trigger(), NUM_ANIMATIONS, object_update(), SET_ANIMATION, object::stats, UP_OBJ_FACE, and living::wc.
Referenced by legacy_animate_trigger().
void change_object | ( | object * | op | ) |
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 592 of file time.cpp.
References add_friendly_object(), object::arch, arch_to_object(), object::attack_movement, archetype::clone, object::env, env, FLAG_ALIVE, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, living::food, friendly, living::hp, INS_ABOVE_FLOOR_ONLY, INS_NO_MERGE, INS_NO_WALK_ON, LAMP, llevError, llevInfo, LOG(), object::map, archetype::more, object::name, object_find_multi_free_spot_around(), object_fix_multipart(), object_free_drop_inventory(), object_get_owner(), object_insert_in_map(), object_insert_in_ob(), object_insert_to_free_spot_or_free(), object_remove(), object_set_owner(), object::other_arch, PETMOVE, QUERY_FLAG, remove_friendly_object(), SET_FLAG, SIZEOFFREE1, object::stats, object::type, object::x, and object::y.
Referenced by hit_player(), and process_object().
An ARROW stops moving.
op | arrow stopping. |
Definition at line 512 of file time.cpp.
References add_string(), animate_object(), object::attacktype, living::dam, object::direction, living::food, FREE_AND_CLEAR_STR, free_no_drop(), living::grace, living::hp, object::level, object::move_on, object::move_type, object_clear_owner(), object_free_drop_inventory(), object_remove(), object_update(), object_update_speed(), rndm(), object::skill, object::slaying, living::sp, object::speed, object::spellarg, object::stats, UP_OBJ_FACE, and living::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 495 of file time.cpp.
References ARROW, FLAG_REMOVED, object_insert_in_map(), object_merge(), QUERY_FLAG, and object::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 565 of file time.cpp.
References FLAG_NO_DROP, FLAG_REMOVED, FREE_OBJ_FREE_INVENTORY, object_free(), object_remove(), and QUERY_FLAG.
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 224 of file time.cpp.
References buf, code, FLAG_CONTENT_ON_GEN, FOR_MAP_FINISH, FOR_MAP_PREPARE, generate_monster_arch(), generate_monster_inv(), GENERATE_SPEED, object::map, MAP_HEIGHT, MAP_WIDTH, object::name, object_free_drop_inventory(), object_get_value(), object_handle_death_animation(), object_remove(), object_set_value(), object_value_set(), QUERY_FLAG, and rndm().
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 164 of file time.cpp.
References archetype::clone, code, create_treasure(), mapstruct::difficulty, FALSE, FLAG_FREED, FLAG_MONSTER, generate_artifact(), HAS_RANDOM_ITEMS, llevError, LOG(), object::map, monster_check_apply_all(), object::name, object_create_clone(), object_find_multi_free_spot_within_radius(), object_get_value(), object_insert_in_map_at(), object_set_value(), object::other_arch, QUERY_FLAG, object::randomitems, rndm(), and TRUE.
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 97 of file time.cpp.
References CLEAR_FLAG, code, create_treasure(), mapstruct::difficulty, FALSE, FLAG_FREED, FLAG_IS_A_TEMPLATE, FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, generate_artifact(), HAS_RANDOM_ITEMS, llevError, LOG(), object::map, monster_check_apply_all(), object::name, object_create_clone(), object_find_multi_free_spot_within_radius(), object_fix_multipart(), object_get_value(), object_insert_in_map_at(), object_set_value(), object_unset_flag_inv(), QUERY_FLAG, object::randomitems, rndm(), and TRUE.
Referenced by generate_monster().
void legacy_animate_trigger | ( | object * | op | ) |
Definition at line 871 of file time.cpp.
References animate_trigger().
Referenced by legacy_ob_process().
void legacy_move_hole | ( | object * | op | ) |
Definition at line 875 of file time.cpp.
References move_hole().
Referenced by legacy_ob_process().
void legacy_remove_force | ( | object * | op | ) |
Definition at line 867 of file time.cpp.
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->direction. walls can have hp, so they can be torn down.
op | firewall. |
Definition at line 678 of file time.cpp.
References cast_spell(), object::direction, get_random_dir(), object::inv, llevError, LOG(), object::map, object::name, mapstruct::path, spell, object::x, and object::y.
Referenced by legacy_ob_process(), and trigger_connected().
|
static |
Move a HOLE.
op | hole to move. |
Definition at line 399 of file time.cpp.
References animate_object(), FOR_ABOVE_FINISH, FOR_ABOVE_PREPARE, object::move_on, MOVE_WALK, NUM_ANIMATIONS, ob_move_on(), object_update(), object_update_speed(), object::speed, object::state, object::stats, UP_OBJ_FACE, object::value, and living::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 707 of file time.cpp.
References object::attacktype, object::env, FABS, FLAG_ALIVE, FLAG_LIFESAVE, FLAG_WIZPASS, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_random_dir(), HEAD, living::hp, object::level, llevError, LOG(), m, object::map, living::maxsp, move_object(), move_player(), object::move_type, object_free_drop_inventory(), object_remove(), object_update_speed(), P_OUT_OF_MAP, mapstruct::path, PLAYER, PLAYERMOVER, QUERY_FLAG, should_director_abort(), living::sp, object::speed, object::speed_left, object::stats, object::x, and object::y.
Referenced by legacy_ob_process().
void process_object | ( | object * | op | ) |
Main object move function.
op | object to move. |
Definition at line 796 of file time.cpp.
References add_string(), object::anim_speed, animate_object(), change_object(), object::count, object::direction, draw_ext_info_format(), object::duration, object::env, EVENT_TIME, events_execute_object_event(), object::facing, FLAG_ANIMATE, FLAG_APPLIED, FLAG_CHANGING, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_IS_A_TEMPLATE, FLAG_IS_USED_UP, FLAG_MONSTER, FLAG_REMOVED, FLAG_SEE_ANYWHERE, living::food, FREE_OBJ_DROP_ABOVE_FLOOR, free_string(), generate_monster(), llevDebug, LOG(), make_sure_not_seen(), make_sure_seen(), monster_move(), MSG_TYPE_ITEM, MSG_TYPE_ITEM_REMOVE, object::name, NDI_BLACK, ob_process(), object_free(), object_get_key_value(), object_remove(), PLAYER, QUERY_FLAG, remove_force(), SCRIPT_FIX_NOTHING, object::speed, sstring, object::state, object::stats, object::temp_anim_speed, object::temp_animation, object::type, and key_value::value.
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 38 of file time.cpp.
References arch_to_object(), DOOR, freearr_x, freearr_y, object::level, object::map, map_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_speed(), object::other_arch, object::speed, object::speed_left, object::x, and object::y.
Referenced by attempt_pick_lock(), legacy_ob_process(), and player_attack_door().
|
static |
Move for FORCE objects.
op | force to test. |
Definition at line 313 of file time.cpp.
References change_abil(), check_spell_expiry(), CLEAR_FLAG, draw_ext_info, draw_ext_info_format(), object::duration, object::env, fix_object(), FLAG_APPLIED, FLAG_CONFUSED, FLAG_NO_PICK, FORCE_CONFUSION, FORCE_TRANSFORMED_ITEM, HUGE_BUF, object::inv, object::map, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_ITEM, MSG_TYPE_ITEM_CHANGE, name, NDI_UNIQUE, object::nrof, object_free_drop_inventory(), object_get_player_container(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), query_short_name(), object::subtype, object::weight, object::x, and object::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 64 of file time.cpp.
References arch_to_object(), freearr_x, freearr_y, object::level, LOCKED_DOOR, object::map, map_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_speed(), object::other_arch, object::slaying, object::speed, object::speed_left, object::x, and object::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 455 of file time.cpp.
References ARROW, fix_stopped_arrow(), free_no_drop(), object::inv, object::map, MIN_ACTIVE_SPEED, object_free_drop_inventory(), object_remove(), object::speed, THROWN_OBJ, and object::type.
Referenced by pick_up(), put_in_icecube(), and save_throw_object().