Go to the documentation of this file.
107 switch (
op->subtype) {
162 if (--(
op->duration) < 0) {
174 if (--
op->range < 0) {
203 if (
op->direction&1) {
233 tmp->speed_left = -0.1;
242 if (
rndm(0, 99) <
tmp->stats.Dex) {
260 int16_t new_x, new_y;
265 if (--
op->range <= 0) {
266 if (
op->other_arch) {
287 if (
op->other_arch) {
318 if (--(
op->duration) < 0) {
327 for (i = 1; i < 9; i++) {
339 tmp->speed_left = -0.21;
344 if (Dx==-1 && Dy==-1){
347 if (Dx==0 && Dy==-1){
350 if (Dx==1 && Dy==-1){
362 if (Dx==-1 && Dy==-1){
365 if (Dx==-1 && Dy==0){
392 LOG(
llevError,
"Tried to move_cone object %s without a map.\n",
op->name ?
op->name :
"unknown");
416 if ((
op->duration--) < 0) {
426 if (--
op->range < 0) {
431 for (i = -1; i < 2; i++) {
439 tmp->duration =
op->duration+1;
442 tmp->stats.maxhp =
op->stats.maxhp;
465 if (
env->map == NULL)
479 for (i = 1; i < 9; i++) {
484 tmp->range =
op->range;
485 tmp->stats.dam =
op->stats.dam;
486 tmp->duration =
op->duration;
487 tmp->attacktype =
op->attacktype;
489 if (
op->skill &&
op->skill !=
tmp->skill) {
509 int16_t new_x, new_y;
512 if (
op->range-- <= 0) {
547 if (i > 0 && i !=
op->direction) {
581 int i, j, dam_save, dir, mflags;
582 int16_t nx, ny, hx, hy;
597 for (i = 1; i <= 9; i++) {
602 int offset = ((i^j)&1) ? (i/2) : -(i/2);
603 int tmpdir =
absdir(
op->direction+offset);
622 dam_save =
op->stats.dam;
629 for (j = 0; j < 9; j++) {
647 op->stats.dam = dam_save/2;
659 op->stats.dam = dam_save;
680 static int cardinal_adjust[9] = { -3, -2, -1, 0, 0, 0, 1, 2, 3 };
681 static int diagonal_adjust[10] = { -3, -2, -2, -1, 0, 0, 1, 2, 2, 3 };
682 int16_t target_x, target_y, origin_x, origin_y;
683 int basedir, adjustdir;
688 if (
op->duration == 0 || owner == NULL || owner->
x !=
op->x || owner->
y !=
op->y) {
695 basedir =
op->direction;
706 adjustdir = cardinal_adjust[
rndm(0, 8)];
708 adjustdir = diagonal_adjust[
rndm(0, 9)];
753 uint8_t aura_animation_state = 0;
754 sstring whole_aura_animation = NULL;
755 char aura_animation_name[200];
758 if (whole_aura_animation) {
759 snprintf(aura_animation_name,
sizeof(aura_animation_name),
"%s_0_0", whole_aura_animation);
762 aura_animation_state = aura->
duration % (
anim->num_animations /
anim->facings);
764 whole_aura_animation = NULL;
784 if (
env == NULL ||
env->map == NULL) {
789 for (i = -aura->
range; i <= aura->range; i++) {
790 for (j = -aura->
range; j <= aura->range; ++j) {
807 if (aura->
attacktype != 0 && (i != 0 || j != 0)) {
828 if (new_ob && whole_aura_animation) {
829 snprintf(aura_animation_name,
sizeof(aura_animation_name),
"%s_%d_%d", whole_aura_animation, i + aura->
range, j + aura->
range);
834 new_ob->
state = aura_animation_state;
839 else if (i != 0 || j != 0) {
882 if (
rndm(0, 99) <
tmp->stats.Con)
901 tmp->stats.Dex -= 10;
930 weight_move =
op->weight+(
op->weight*
op->level)/3;
934 int num_sections = 1;
949 for (tmp2 =
tmp; tmp2 != NULL; tmp2 = tmp2->
more)
961 if (
rndm(0, weight_move-1) > ((
tmp->weight/num_sections)*frictionmod)) {
#define object_was_destroyed(op, old_tag)
#define GET_MAP_OB(M, X, Y)
#define FREE_OBJ_NO_DESTROY_CALLBACK
sstring add_refcount(sstring str)
void object_free(object *ob, int flags)
static method_ret spell_effect_type_process(object *op)
void object_remove(object *op)
int adjust_dir(int dir, int destination_dir)
void object_copy_owner(object *op, object *clone)
#define QUERY_FLAG(xyz, p)
void register_process(int ob_type, process_func method)
int out_of_map(mapstruct *m, int x, int y)
object * object_new(void)
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
void check_bullet(object *op)
void object_merge_spell(object *op, int16_t x, int16_t y)
void explode_bullet(object *op)
int hit_map(object *op, int dir, uint32_t type, int full_hit)
int fire_arch_from_position(object *op, object *caster, int16_t x, int16_t y, int dir, object *spell)
int ok_to_put_more(mapstruct *m, int16_t x, int16_t y, object *op, uint32_t immune_stop)
static void check_spell_knockback(object *op)
method_ret ob_process(object *op)
short freearr_x[SIZEOFFREE]
static void move_bullet(object *op)
short freearr_y[SIZEOFFREE]
void animate_object(object *op, int dir)
const char * object_get_value(const object *op, const char *const key)
void free_string(sstring str)
static event_registration m
int spell_find_dir(mapstruct *m, int x, int y, object *exclude)
static void move_swarm_spell(object *op)
static method_ret spell_effect_type_move_on(object *trap, object *victim, object *originator)
void object_copy(const object *src_ob, object *dest_ob)
void object_update_turn_face(object *op)
void remove_unpaid_objects(object *op, object *env, int free_items)
void cone_drop(object *op)
method_ret common_pre_ob_move_on(object *trap, object *victim, object *originator)
static void move_cone(object *op)
static void explosion(object *op)
void register_move_on(int ob_type, move_on_func method)
#define GET_MAP_MOVE_BLOCK(M, X, Y)
struct archt * other_arch
const typedef char * sstring
int rndm(int min, int max)
#define FLAG_UNAGGRESSIVE
const Animations * animation
static std::shared_ptr< inja::Environment > env
static void execute_word_of_recall(object *op)
static void move_aura(object *aura)
Animations * try_find_animation(const char *name)
int move_object(object *op, int dir)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
void LOG(LogLevel logLevel, const char *format,...)
void enter_exit(object *op, object *exit_ob)
archetype * find_archetype(const char *name)
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
#define NUM_ANIMATIONS(ob)
object * object_insert_in_ob(object *op, object *where)
void object_update_speed(object *op)
void check_spell_expiry(object *spell)
object * object_get_env_recursive(object *op)
object * arch_to_object(archetype *at)
static void move_ball_spell(object *op)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void object_free_drop_inventory(object *ob)
int reflwall(mapstruct *m, int x, int y, object *sp_op)
static void move_bolt(object *op)
#define OB_TYPE_MOVE_BLOCK(ob1, type)
#define FREE_OBJ_FREE_INVENTORY
static void move_missile(object *op)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
void save_throw_object(object *op, uint32_t type, object *originator)
void common_post_ob_move_on(object *trap, object *victim, object *originator)
static void forklightning(object *op, object *tmp)
int on_same_map(const object *op1, const object *op2)
void init_type_spell_effect(void)
static void animate_bomb(object *op)
#define SP_WORD_OF_RECALL
object * object_get_owner(object *op)