Crossfire Server, Trunk
|
Go to the source code of this file.
Functions | |
static void | animate_trigger (object *op) |
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 int | generate_monster_arch (object *gen) |
static int | 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) |
void | 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.cpp.
|
static |
Animate a TRIGGER.
op | trigger. |
Definition at line 383 of file time.cpp.
References check_trigger(), NUM_ANIMATIONS, object_update(), give::op, SET_ANIMATION, and UP_OBJ_FACE.
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(), arch_to_object(), env, FLAG_ALIVE, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, INS_ABOVE_FLOOR_ONLY, INS_NO_MERGE, INS_NO_WALK_ON, LAMP, llevError, llevInfo, LOG(), 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(), give::op, PETMOVE, QUERY_FLAG, remove_friendly_object(), SET_FLAG, SIZEOFFREE1, and Ice::tmp.
Referenced by do_monster_change(), 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(), FREE_AND_CLEAR_STR, free_no_drop(), object_clear_owner(), object_free_drop_inventory(), object_remove(), object_update(), object_update_speed(), give::op, rndm(), and UP_OBJ_FACE.
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, disinfect::map, object_insert_in_map(), object_merge(), give::op, and QUERY_FLAG.
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(), give::op, 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, 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, rndm(), Ice::tmp, autojail::value, diamondslots::x, and diamondslots::y.
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, 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(), give::op, object::other_arch, QUERY_FLAG, 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, 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(), give::op, QUERY_FLAG, object::randomitems, rndm(), Ice::tmp, and TRUE.
Referenced by generate_monster().
void legacy_animate_trigger | ( | object * | op | ) |
Definition at line 866 of file time.cpp.
References animate_trigger(), and give::op.
Referenced by legacy_ob_process().
void legacy_move_hole | ( | object * | op | ) |
Definition at line 870 of file time.cpp.
References move_hole(), and give::op.
Referenced by legacy_ob_process().
void legacy_remove_force | ( | object * | op | ) |
Definition at line 862 of file time.cpp.
References give::op, and 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(), get_random_dir(), llevError, LOG(), and give::op.
|
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, MOVE_WALK, NUM_ANIMATIONS, ob_move_on(), object_update(), object_update_speed(), give::op, Ice::tmp, and UP_OBJ_FACE.
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 FABS, FLAG_ALIVE, FLAG_LIFESAVE, FLAG_WIZPASS, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_random_dir(), HEAD, llevError, LOG(), m, move_object(), move_player(), object_free_drop_inventory(), object_remove(), object_update_speed(), give::op, P_OUT_OF_MAP, PLAYER, PLAYERMOVER, QUERY_FLAG, should_director_abort(), and sword_of_souls::victim.
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(), animate_object(), change_object(), draw_ext_info_format(), EVENT_TIME, events_execute_object_event(), 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, FREE_OBJ_DROP_ABOVE_FLOOR, free_string(), generate_monster(), castle_read::key, llevDebug, LOG(), make_sure_not_seen(), make_sure_seen(), monster_move(), MSG_TYPE_ITEM, MSG_TYPE_ITEM_REMOVE, NDI_BLACK, ob_process(), object_free(), object_get_key_value(), object_remove(), give::op, PLAYER, QUERY_FLAG, remove_force(), SCRIPT_FIX_NOTHING, sstring, 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, map_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_speed(), give::op, and Ice::tmp.
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(), fix_object(), FLAG_APPLIED, FLAG_CONFUSED, FLAG_NO_PICK, FORCE_CONFUSION, FORCE_TRANSFORMED_ITEM, HUGE_BUF, commongive::inv, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_ITEM, MSG_TYPE_ITEM_CHANGE, give::name, NDI_UNIQUE, object_free_drop_inventory(), object_get_player_container(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), give::op, altar_valkyrie::pl, and query_short_name().
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, LOCKED_DOOR, map_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_speed(), give::op, and Ice::tmp.
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(), MIN_ACTIVE_SPEED, object_free_drop_inventory(), object_remove(), give::op, and THROWN_OBJ.
Referenced by pick_up(), put_in_icecube(), and save_throw_object().