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) {
261 int16_t new_x, new_y;
266 if (--
op->range <= 0) {
267 if (
op->other_arch) {
288 if (
op->other_arch) {
325 if (--(
op->duration) < 0) {
334 for (i = 1; i < 9; i++) {
346 tmp->speed_left = -0.21;
351 if (Dx==-1 && Dy==-1){
354 if (Dx==0 && Dy==-1){
357 if (Dx==1 && Dy==-1){
369 if (Dx==-1 && Dy==-1){
372 if (Dx==-1 && Dy==0){
399 LOG(
llevError,
"Tried to move_cone object %s without a map.\n",
op->name ?
op->name :
"unknown");
423 if ((
op->duration--) < 0) {
433 if (--
op->range < 0) {
438 for (i = -1; i < 2; i++) {
446 tmp->duration =
op->duration+1;
449 tmp->stats.maxhp =
op->stats.maxhp;
472 if (
env->map == NULL)
486 for (i = 1; i < 9; i++) {
491 tmp->range =
op->range;
492 tmp->stats.dam =
op->stats.dam;
493 tmp->duration =
op->duration;
494 tmp->attacktype =
op->attacktype;
496 if (
op->skill &&
op->skill !=
tmp->skill) {
527 if (dir > 0 && dir !=
op->direction) {
560 int i, j, dam_save, dir, mflags;
561 int16_t nx, ny, hx, hy;
576 for (i = 1; i <= 9; i++) {
581 int offset = ((i^j)&1) ? (i/2) : -(i/2);
582 int tmpdir =
absdir(
op->direction+offset);
601 dam_save =
op->stats.dam;
608 for (j = 0; j < 9; j++) {
626 op->stats.dam = dam_save/2;
638 op->stats.dam = dam_save;
659 static int cardinal_adjust[9] = { -3, -2, -1, 0, 0, 0, 1, 2, 3 };
660 static int diagonal_adjust[10] = { -3, -2, -2, -1, 0, 0, 1, 2, 2, 3 };
661 int16_t target_x, target_y, origin_x, origin_y;
662 int basedir, adjustdir;
667 if (
op->duration == 0 || owner == NULL || owner->
x !=
op->x || owner->
y !=
op->y) {
674 basedir =
op->direction;
685 adjustdir = cardinal_adjust[
rndm(0, 8)];
687 adjustdir = diagonal_adjust[
rndm(0, 9)];
732 uint8_t aura_animation_state = 0;
733 sstring whole_aura_animation = NULL;
734 char aura_animation_name[200];
737 if (whole_aura_animation) {
738 snprintf(aura_animation_name,
sizeof(aura_animation_name),
"%s_0_0", whole_aura_animation);
741 aura_animation_state = aura->
duration % (
anim->num_animations /
anim->facings);
743 whole_aura_animation = NULL;
763 if (caster == NULL || caster->
map == NULL) {
768 for (i = -aura->
range; i <= aura->range; i++) {
769 for (j = -aura->
range; j <= aura->range; ++j) {
786 if (aura->
attacktype != 0 && (i != 0 || j != 0)) {
807 if (new_ob && whole_aura_animation) {
808 snprintf(aura_animation_name,
sizeof(aura_animation_name),
"%s_%d_%d", whole_aura_animation, i + aura->
range, j + aura->
range);
813 new_ob->
state = aura_animation_state;
818 else if (i != 0 || j != 0) {
861 if (
rndm(0, 99) <
tmp->stats.Con)
880 tmp->stats.Dex -= 10;
909 weight_move =
op->weight+(
op->weight*
op->level)/3;
913 int num_sections = 1;
928 for (tmp2 =
tmp; tmp2 != NULL; tmp2 = tmp2->
more)
940 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)
object * object_get_owner(object *op)
#define FREE_OBJ_NO_DESTROY_CALLBACK
object * object_get_env_recursive(object *op)
void object_update_turn_face(object *op)
static method_ret spell_effect_type_move_on(object *trap, object *victim, object *originator)
void LOG(LogLevel logLevel, const char *format,...)
#define QUERY_FLAG(xyz, p)
static void check_spell_knockback(object *op)
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
static void move_cone(object *op)
void check_bullet(object *op)
void register_move_on(int ob_type, move_on_func method)
void explode_bullet(object *op)
void object_copy(const object *src_ob, object *dest_ob)
int hit_map(object *op, int dir, uint32_t type, int full_hit)
int rndm(int min, int max)
void register_process(int ob_type, process_func method)
int fire_arch_from_position(object *op, object *caster, int16_t x, int16_t y, int dir, object *spell)
const char * object_get_value(const object *op, const char *const key)
int ok_to_put_more(mapstruct *m, int16_t x, int16_t y, object *op, uint32_t immune_stop)
void object_merge_spell(object *op, int16_t x, int16_t y)
object * object_insert_in_ob(object *op, object *where)
static object * move_bullet(object *op)
static event_registration m
void object_free_drop_inventory(object *ob)
int spell_find_dir(mapstruct *m, int x, int y, object *exclude)
sstring add_refcount(sstring str)
int adjust_dir(int dir, int destination_dir)
short freearr_y[SIZEOFFREE]
void remove_unpaid_objects(object *op, object *env, int free_items)
static void move_ball_spell(object *op)
void cone_drop(object *op)
method_ret common_pre_ob_move_on(object *trap, object *victim, object *originator)
static method_ret spell_effect_type_process(object *op)
int out_of_map(mapstruct *m, int x, int y)
void object_update_speed(object *op)
static void move_swarm_spell(object *op)
void object_free(object *ob, int flags)
#define GET_MAP_MOVE_BLOCK(M, X, Y)
#define FLAG_UNAGGRESSIVE
static void move_bolt(object *op)
const Animations * animation
static void execute_word_of_recall(object *op)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
struct archetype * other_arch
static void forklightning(object *op, object *tmp)
static std::shared_ptr< inja::Environment > env
object * object_new(void)
void free_string(sstring str)
Animations * try_find_animation(const char *name)
int move_object(object *op, int dir)
static bool IS_PLAYER(object *op)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
static void explosion(object *op)
static void animate_bomb(object *op)
method_ret ob_process(object *op)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
void enter_exit(object *op, object *exit_ob)
const typedef char * sstring
void animate_object(object *op, int dir)
archetype * find_archetype(const char *name)
static void move_aura(object *aura)
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
int on_same_map(const object *op1, const object *op2)
#define NUM_ANIMATIONS(ob)
void check_spell_expiry(object *spell)
object * arch_to_object(archetype *at)
void object_remove(object *op)
int reflwall(mapstruct *m, int x, int y, object *sp_op)
#define OB_TYPE_MOVE_BLOCK(ob1, type)
#define FREE_OBJ_FREE_INVENTORY
void object_copy_owner(object *op, object *clone)
short freearr_x[SIZEOFFREE]
void save_throw_object(object *op, uint32_t type, object *originator)
void common_post_ob_move_on(object *trap, object *victim, object *originator)
void init_type_spell_effect(void)
#define SP_WORD_OF_RECALL
static void move_missile(object *op)