Go to the documentation of this file.
42 for (i = 1; i < 9; i += 2)
46 tmp->speed_left = -0.2;
51 tmp->level =
op->level;
68 for (i = 1; i < 9; i += 2) {
70 if (
tmp &&
tmp->slaying ==
op->slaying) {
73 tmp->speed_left = -0.2;
78 tmp->level =
op->level;
100 object *
op, *head = NULL;
108 if (gen->
map == NULL) {
118 LOG(
llevError,
"Generator (%s) has no inventory in generate_monster_inv?\n", gen->
name);
121 qty =
rndm(0, qty-1);
178 if (gen->
map == NULL) {
225 int8_t children, max_children;
235 max_children = (int8_t)strtol(
value, NULL, 10);
236 if (max_children < 1)
255 if (children >= max_children+1)
264 }
else if (gen->
name) {
285 if (
value && did_gen) {
286 int limit = atoi(
value), num_generated = 0;
290 num_generated = atoi(
value);
292 if (num_generated++ >= limit) {
299 snprintf(
buf,
sizeof(
buf),
"%d", num_generated);
314 if (--
op->duration > 0) {
319 switch (
op->subtype) {
321 if (
op->env != NULL) {
325 "You regain your senses.");
331 if (
op->env != NULL &&
op->inv != NULL) {
332 object *
inv =
op->inv;
342 inv->weight = (
inv->nrof ? (int32_t)(
op->env->weight/
inv->nrof) :
op->env->weight);
350 "Your %s recovers its original form.",
368 if (
op->env != NULL) {
401 if (--
op->stats.wc <= 0) {
413 op->state =
op->stats.wc;
425 op->state =
op->stats.wc;
464 object *payload =
op->inv;
516 if (
rndm(0, 99) <
op->stats.food) {
528 op->stats.wc =
op->stats.sp;
529 op->stats.dam =
op->stats.hp;
530 op->attacktype =
op->stats.grace;
531 if (
op->slaying != NULL)
534 if (
op->skill != NULL)
537 if (
op->spellarg != NULL) {
599 if (
op->other_arch == NULL) {
600 LOG(
llevError,
"Change object (%s) without other_arch error.\n",
op->name);
606 if (
op->stats.food-- > 0)
617 for (i = 0; i <
op->stats.food; i++) {
622 tmp->stats.food =
op->stats.food-1;
623 tmp->stats.hp =
op->stats.hp;
640 else if (
tmp->arch->more)
647 LOG(
llevInfo,
"change_object: Failed to find a spot to put changing multipart object\n");
686 LOG(
llevError,
"firewall '%s' in (%s, %d, %d) has no spell\n",
op->name,
op->map->path,
op->x,
op->y);
708 int dir =
op->stats.sp;
713 if (
op->env &&
op->env->map)
714 LOG(
llevError,
"move_player_mover: mover not in a map at %s %d %d!\n",
op->env->map->path,
op->env->x,
op->env->y);
716 LOG(
llevError,
"move_player_mover: mover not in a map at undefinite location!");
741 LOG(
llevError,
"move_player_mover: Trying to push player off the map! map=%s (%d, %d)\n",
m->path,
op->x,
op->y);
750 nextmover->speed_left = -.99;
752 op->speed_left = -1.1;
764 victim->contr->fire_on = 0;
772 if (!
op->stats.maxsp &&
op->attacktype)
773 op->stats.maxsp = 2.0;
775 if (
op->attacktype) {
783 if (
victim->speed_left < -5.0)
784 victim->speed_left = -5.0;
797 if (getenv(
"CF_DEBUG_PROCESS")) {
815 || (
op->temp_animation &&
op->temp_anim_speed == 0)) {
837 if (
op->env != NULL &&
op->env->type ==
PLAYER) {
845 if (used_up_message != NULL) {
848 "The %s %s.",
op->name, used_up_message->
value);
void remove_door(object *op)
bool object_value_set(const object *op, const char *const key)
#define HAS_RANDOM_ITEMS(op)
void make_sure_not_seen(const object *op)
object * object_get_owner(object *op)
int free_no_drop(object *op)
void object_clear_owner(object *op)
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be friendly
void remove_friendly_object(object *op)
void LOG(LogLevel logLevel, const char *format,...)
#define QUERY_FLAG(xyz, p)
#define FLAG_CONTENT_ON_GEN
object * object_merge(object *op, object *top)
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
void object_insert_to_free_spot_or_free(object *op, mapstruct *map, int x, int y, int start, int stop, object *originator)
void move_firewall(object *op)
void object_set_owner(object *op, object *owner)
void object_handle_death_animation(object *op)
#define MSG_TYPE_ATTRIBUTE
#define SET_ANIMATION(ob, newanim)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
int move_player(object *op, int dir)
void fix_object(object *op)
int object_find_multi_free_spot_within_radius(const object *ob, const object *gen, int *hx, int *hy)
static void move_hole(object *op)
#define FOR_ABOVE_PREPARE(op_, it_)
void fix_stopped_item(object *op, mapstruct *map, object *originator)
static void generate_monster(object *gen)
const char * object_get_value(const object *op, const char *const key)
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
static int generate_monster_arch(object *gen)
object * stop_item(object *op)
object * object_insert_in_ob(object *op, object *where)
method_ret ob_move_on(object *op, object *victim, object *originator)
Plugin animator file specs[Config] name
#define INS_ABOVE_FLOOR_ONLY
#define FLAG_IS_A_TEMPLATE
static event_registration m
void object_free_drop_inventory(object *ob)
void object_update(object *op, int action)
key_value * object_get_key_value(const object *ob, const char *key)
void move_player_mover(object *op)
short freearr_y[SIZEOFFREE]
object * map_find_by_type(mapstruct *m, int x, int y, uint8_t type)
#define FOR_ABOVE_FINISH()
sstring add_string(const char *str)
void query_short_name(const object *op, char *buf, size_t size)
int should_director_abort(const object *op, const object *victim)
void object_update_speed(object *op)
void legacy_remove_force(object *op)
void legacy_animate_trigger(object *op)
#define FORCE_TRANSFORMED_ITEM
with a maximum of six This is not so if you are wearing plate you receive no benefit Armour is additive with all the supplementry forms of which means that it lasts until the next semi permanent spell effect is cast upon the character spell
void object_free(object *ob, int flags)
#define FLAG_UNAGGRESSIVE
void process_object(object *op)
void legacy_move_hole(object *op)
int object_find_multi_free_spot_around(const object *ob, const object *gen, int16_t *hx, int16_t *hy)
#define FREE_OBJ_DROP_ABOVE_FLOOR
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
struct archetype * other_arch
object * object_create_clone(object *asrc)
static std::shared_ptr< inja::Environment > env
object * object_insert_in_map(object *op, mapstruct *m, object *originator, int flag)
void free_string(sstring str)
void monster_check_apply_all(object *monster)
int move_object(object *op, int dir)
#define FREE_AND_CLEAR_STR(xyz)
static void animate_trigger(object *op)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
int change_abil(object *op, object *tmp)
object * fix_stopped_arrow(object *op)
void change_object(object *op)
method_ret ob_process(object *op)
#define SCRIPT_FIX_NOTHING
void add_friendly_object(object *op)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
#define MSG_TYPE_ITEM_REMOVE
const typedef char * sstring
static int generate_monster_inv(object *gen)
void remove_locked_door(object *op)
void animate_object(object *op, int dir)
#define GENERATE_SPEED(xyz)
static void remove_force(object *op)
void object_unset_flag_inv(object *op, int flag)
#define CLEAR_FLAG(xyz, p)
#define NUM_ANIMATIONS(ob)
void check_spell_expiry(object *spell)
object * arch_to_object(archetype *at)
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END
void object_fix_multipart(object *tmp)
struct treasurelist * randomitems
#define FLAG_SEE_ANYWHERE
int monster_move(object *op)
void object_remove(object *op)
#define MSG_TYPE_ITEM_CHANGE
#define FREE_OBJ_FREE_INVENTORY
Crossfire Architecture the general intention is to enhance the enjoyability and playability of CF In this code
int rndm(int min, int max)
int object_set_value(object *op, const char *key, const char *value, int add_key)
short freearr_x[SIZEOFFREE]
object * object_get_player_container(object *op)
void generate_artifact(object *op, int difficulty)
#define FOR_INV_PREPARE(op_, it_)
void make_sure_seen(const object *op)