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;
227 const char *code, *
value;
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;
800 if (getenv(
"CF_DEBUG_PROCESS")) {
818 || (
op->temp_animation &&
op->temp_anim_speed == 0)) {
840 if (
op->env != NULL &&
op->env->type ==
PLAYER) {
848 if (used_up_message != NULL) {
851 "The %s %s.",
op->name, used_up_message->
value);
object * stop_item(object *op)
#define HAS_RANDOM_ITEMS(op)
void change_object(object *op)
void object_free(object *ob, int flags)
void make_sure_seen(const object *op)
sstring add_string(const char *str)
void object_remove(object *op)
void remove_friendly_object(object *op)
object * object_create_clone(object *asrc)
void object_update(object *op, int action)
#define QUERY_FLAG(xyz, p)
#define FLAG_CONTENT_ON_GEN
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
object * fix_stopped_arrow(object *op)
#define MSG_TYPE_ATTRIBUTE
#define SET_ANIMATION(ob, newanim)
int move_player(object *op, int dir)
int process_object(object *op)
#define FOR_ABOVE_PREPARE(op_, it_)
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)
struct treasureliststruct * randomitems
method_ret ob_process(object *op)
short freearr_x[SIZEOFFREE]
int free_no_drop(object *op)
short freearr_y[SIZEOFFREE]
void animate_object(object *op, int dir)
#define INS_ABOVE_FLOOR_ONLY
object * object_merge(object *op, object *top)
const char * object_get_value(const object *op, const char *const key)
#define FLAG_IS_A_TEMPLATE
void free_string(sstring str)
void remove_door(object *op)
void legacy_animate_trigger(object *op)
static event_registration m
void move_player_mover(object *op)
key_value * object_get_key_value(const object *ob, const char *key)
void object_unset_flag_inv(object *op, int flag)
void move_firewall(object *op)
#define FOR_ABOVE_FINISH()
static int generate_monster_inv(object *gen)
void object_fix_multipart(object *tmp)
int should_director_abort(const object *op, const object *victim)
void query_short_name(const object *op, char *buf, size_t size)
void generate_artifact(object *op, int difficulty)
#define FORCE_TRANSFORMED_ITEM
void fix_object(object *op)
struct archt * other_arch
void fix_stopped_item(object *op, mapstruct *map, object *originator)
const typedef char * sstring
int object_set_value(object *op, const char *key, const char *value, int add_key)
int rndm(int min, int max)
#define FLAG_UNAGGRESSIVE
static void animate_trigger(object *op)
#define FREE_OBJ_DROP_ABOVE_FLOOR
int object_find_multi_free_spot_around(const object *ob, const object *gen, int16_t *hx, int16_t *hy)
method_ret ob_move_on(object *op, object *victim, object *originator)
void object_set_owner(object *op, object *owner)
static std::shared_ptr< inja::Environment > env
static void remove_force(object *op)
void object_insert_to_free_spot_or_free(object *op, mapstruct *map, int x, int y, int start, int stop, object *originator)
void monster_check_apply_all(object *monster)
int move_object(object *op, int dir)
#define FREE_AND_CLEAR_STR(xyz)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
static void move_hole(object *op)
void legacy_move_hole(object *op)
#define SCRIPT_FIX_NOTHING
void add_friendly_object(object *op)
#define MSG_TYPE_ITEM_REMOVE
void LOG(LogLevel logLevel, const char *format,...)
object * object_insert_in_map(object *op, mapstruct *m, object *originator, int flag)
bool object_value_set(const object *op, const char *const key)
#define GENERATE_SPEED(xyz)
object * map_find_by_type(mapstruct *m, int x, int y, uint8_t type)
#define CLEAR_FLAG(xyz, p)
#define NUM_ANIMATIONS(ob)
object * object_insert_in_ob(object *op, object *where)
void object_update_speed(object *op)
void object_handle_death_animation(object *op)
void check_spell_expiry(object *spell)
object * arch_to_object(archetype *at)
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END
#define FLAG_SEE_ANYWHERE
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
int monster_move(object *op)
void object_free_drop_inventory(object *ob)
int object_find_multi_free_spot_within_radius(const object *ob, const object *gen, int *hx, int *hy)
static int generate_monster_arch(object *gen)
#define MSG_TYPE_ITEM_CHANGE
#define FREE_OBJ_FREE_INVENTORY
void make_sure_not_seen(const object *op)
static void generate_monster(object *gen)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
object * object_get_player_container(object *op)
int change_abil(object *op, object *tmp)
#define FOR_INV_PREPARE(op_, it_)
void remove_locked_door(object *op)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
void legacy_remove_force(object *op)
void object_clear_owner(object *op)
object * object_get_owner(object *op)