41 for (i = 1; i < 9; i += 2)
67 for (i = 1; i < 9; i += 2) {
99 object *op, *head = NULL;
107 if (gen->
map == NULL) {
117 LOG(
llevError,
"Generator (%s) has no inventory in generate_monster_inv?\n", gen->
name);
120 qty =
rndm(0, qty-1);
166 object *op, *head = NULL, *prev = NULL;
178 if (gen->
map == NULL) {
229 int8_t children, max_children;
231 const char *code, *value;
239 max_children = (
int8_t)strtol(value, NULL, 10);
240 if (max_children < 1)
252 if (value && value == code) {
259 if (children >= max_children+1)
268 }
else if (gen->
name) {
288 if (value && did_gen) {
289 int limit = atoi(value), num_generated = 0;
293 num_generated = atoi(value);
295 if (num_generated++ >= limit) {
301 snprintf(buf,
sizeof(buf),
"%d", num_generated);
322 if (op->
env != NULL) {
326 "You regain your senses.");
332 if (op->
env != NULL && op->
inv != NULL) {
333 object *inv = op->
inv;
345 "Your %s recovers its original form.",
363 if (op->
env != NULL) {
459 object *payload = op->
inv;
529 if (op->
skill != NULL)
642 LOG(
llevInfo,
"change_object: Failed to find a spot to put changing multipart object\n");
711 LOG(
llevError,
"move_player_mover: mover not in a map at undefinite location!");
724 && (victim->move_type&op->
move_type || !victim->move_type)) {
725 victim =
HEAD(victim);
736 LOG(
llevError,
"move_player_mover: Trying to push player off the map! map=%s (%d, %d)\n", m->
path, op->
x, op->
y);
745 nextmover->speed_left = -.99;
751 if (victim->type ==
PLAYER) {
759 victim->contr->fire_on = 0;
760 victim->speed_left = -
FABS(victim->speed);
778 if (victim->speed_left < -5.0)
779 victim->speed_left = -5.0;
837 if (used_up_message != NULL) {
840 "The %s %s.", op->
name, used_up_message->
value);
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
#define MSG_TYPE_ITEM_CHANGE
int move_player(object *op, int dir)
int free_no_drop(object *op)
void object_clear_owner(object *op)
static void generate_monster(object *gen)
static int generate_monster_inv(object *gen)
void free_string(sstring str)
#define SET_ANIMATION(ob, newanim)
void object_fix_multipart(object *tmp)
const char * object_get_value(const object *op, const char *const key)
struct treasureliststruct * randomitems
short freearr_x[SIZEOFFREE]
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)
void check_spell_expiry(object *spell)
method_ret ob_process(object *op)
void fix_stopped_item(object *op, mapstruct *map, object *originator)
#define FLAG_SEE_ANYWHERE
int monster_move(object *op)
void remove_friendly_object(object *op)
void change_object(object *op)
void object_update(object *op, int action)
#define MSG_TYPE_ITEM_REMOVE
void make_sure_seen(const object *op)
static void animate_trigger(object *op)
struct archt * other_arch
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
uint16_t temp_animation_id
void remove_locked_door(object *op)
short freearr_y[SIZEOFFREE]
static void remove_force(object *op)
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
int object_find_multi_free_spot_around(const object *ob, const object *gen, int16_t *hx, int16_t *hy)
int rndm(int min, int max)
void object_set_owner(object *op, object *owner)
int object_set_value(object *op, const char *key, const char *value, int add_key)
object * stop_item(object *op)
void object_free_drop_inventory(object *ob)
int change_abil(object *op, object *tmp)
key_value * object_get_key_value(const object *ob, const char *key)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END
#define FREE_OBJ_FREE_INVENTORY
static void move_hole(object *op)
object * object_insert_in_ob(object *op, object *where)
#define FOR_ABOVE_FINISH()
#define FLAG_UNAGGRESSIVE
void monster_check_apply_all(object *monster)
#define MSG_TYPE_ATTRIBUTE
void add_friendly_object(object *op)
#define FOR_ABOVE_PREPARE(op_, it_)
object * fix_stopped_arrow(object *op)
#define FLAG_IS_A_TEMPLATE
object * object_create_clone(object *asrc)
object * object_insert_in_map(object *op, mapstruct *m, object *originator, int flag)
#define FREE_AND_CLEAR_STR(xyz)
#define QUERY_FLAG(xyz, p)
#define CLEAR_FLAG(xyz, p)
#define INS_ABOVE_FLOOR_ONLY
void legacy_remove_force(object *op)
#define GENERATE_SPEED(xyz)
void generate_artifact(object *op, int difficulty)
method_ret ob_move_on(object *op, object *victim, object *originator)
void move_firewall(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 animate_object(object *op, int dir)
void legacy_animate_trigger(object *op)
void move_player_mover(object *op)
#define NUM_ANIMATIONS(ob)
void object_free2(object *ob, int flags)
int move_object(object *op, int dir)
object * object_merge(object *op, object *top)
void query_short_name(const object *op, char *buf, size_t size)
object * object_get_player_container(object *op)
int execute_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
void object_unset_flag_inv(object *op, int flag)
sstring add_string(const char *str)
#define FORCE_TRANSFORMED_ITEM
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
void LOG(LogLevel logLevel, const char *format,...)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
#define FREE_OBJ_DROP_ABOVE_FLOOR
int should_director_abort(const object *op, const object *victim)
void make_sure_not_seen(const object *op)
void fix_object(object *op)
void legacy_move_hole(object *op)
object * arch_to_object(archetype *at)
#define FLAG_CONTENT_ON_GEN
void object_update_speed(object *op)
#define SCRIPT_FIX_NOTHING
object * object_get_owner(object *op)
#define HAS_RANDOM_ITEMS(op)
#define FOR_INV_PREPARE(op_, it_)
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
void object_remove(object *op)
object * map_find_by_type(mapstruct *m, int x, int y, uint8_t type)
int process_object(object *op)
void remove_door(object *op)