Go to the documentation of this file.
61 int fire_bolt(
object *
op,
object *caster,
int dir,
object *spob) {
125 if (
op->other_arch == NULL) {
126 LOG(
llevError,
"BUG: explode_bullet(): op without other_arch\n");
137 LOG(
llevError,
"BUG: explode_bullet(): env out of map\n");
145 LOG(
llevError,
"BUG: explode_bullet(): op out of map\n");
151 if (
op->attacktype) {
175 tmp->attacktype =
op->attacktype;
176 tmp->range =
op->range;
177 tmp->stats.dam =
op->stats.dam;
178 tmp->duration =
op->duration;
183 tmp->stats.dam =
op->dam_modifier;
184 tmp->range =
op->stats.maxhp;
185 tmp->duration =
op->stats.hp;
191 tmp->stats.maxhp =
op->count;
192 if (
tmp->stats.maxhp == 0)
193 tmp->stats.maxhp = 1;
197 tmp->stats.sp =
op->direction;
218 tag_t op_tag =
op->count, tmp_tag;
228 if (
op->other_arch) {
240 tmp_tag =
tmp->count;
272 if (
op->skill &&
op->skill != new_ob->
skill) {
297 int cast_cone(
object *
op,
object *caster,
int dir,
object *spell) {
299 int i, success = 0, range_min = -1, range_max = 1;
323 for (i = range_min; i <= range_max; i++) {
344 if (caster->
type !=
RUNE && d == 0) {
383 if (
tmp->range < 2 && spell->
range >= 2)
406 if (!
tmp->move_on &&
tmp->stats.dam) {
413 tmp->stats.maxhp =
tmp->count;
414 if (
tmp->stats.maxhp == 0)
415 tmp->stats.maxhp = 1;
505 for (dist = 1; dist < range; dist++) {
522 if (target != NULL) {
547 object *effect, *target;
567 || (target->
race && god && strstr(target->
race, god->
race))) {
583 "%s answers your call!",
610 "The %s looks stronger!",
674 tmp->stats.food = time;
676 tmp->glow_radius = radius;
685 if (
tmp->glow_radius >
op->glow_radius)
686 op->glow_radius =
tmp->glow_radius;
689 LOG(
llevError,
"make_object_glow() failed to insert glowing force in %s\n",
op->name);
708 int i, j, range, mflags, friendly = 0, dam, dur;
711 object *
tmp, *found_skill;
729 else if (caster->
skill)
738 for (i = -range; i < range; i++) {
739 for (j = -range; j < range; j++) {
800 int cast_curse(
object *
op,
object *caster,
object *spell_ob,
int dir) {
814 if (
inv->name == spell_ob->
name) {
817 }
else if (spell_ob->
race && spell_ob->
race ==
inv->name) {
820 "You can not cast %s while %s is in effect",
841 if (duration >
force->duration) {
842 force->duration = duration;
851 force->speed_left = -1.0;
860 "You are a victim of %s's curse!",
907 int done_one, range, mflags,
level, at, best_at, immunity_chance = 50;
908 int16_t
x,
y, nx, ny;
920 immunity_chance = atoi(race);
921 if (immunity_chance < 0 || immunity_chance > 100) {
922 LOG(
llevError,
"ignoring invalid immunity_chance %d for %s\n", immunity_chance, spell->
arch->
name);
923 immunity_chance = 50;
933 else if (god && !strcmp(spell->
race,
"GOD_SLAYING"))
935 else if (god && !strcmp(spell->
race,
"GOD_FRIEND"))
940 for (
x =
op->x-range; x <= op->
x+range;
x++)
941 for (
y =
op->y-range; y <= op->
y+range;
y++) {
958 if (race && head->
race && !strstr(race, head->
race))
968 if (best_at == -1 || head->
resist[at] > head->
resist[best_at])
974 if (head->
resist[best_at] == 100)
977 at = head->
resist[best_at]/5;
1102 tmp->attacktype =
tmp->spell->attacktype;
1109 for (i = 0; i < spell->
duration; i++)
1112 tmp->direction = dir;
1137 object *target = NULL, *
tmp = NULL;
1162 if (target != NULL) {
1178 LOG(
llevError,
"Error: spell arch for cast_light() missing.\n");
1182 if (
tmp->glow_radius) {
1209 int i, mflags, range, dam_mod, dur_mod;
1210 object *target_head;
1230 for (i = 1; i < range; i++) {
1249 target_head =
HEAD(walk);
1260 disease->
stats.
wc += dur_mod/2;
1262 if (disease->
magic > 0)
1263 disease->
magic += dur_mod/4;
1279 disease->
last_sp -= 2*dam_mod;
int SP_level_range_adjust(const object *caster, const object *spob)
#define object_was_destroyed(op, old_tag)
#define FORCE_CHANGE_ABILITY
void set_spell_skill(object *op, object *caster, object *spob, object *dest)
sstring add_refcount(sstring str)
void object_remove(object *op)
void remove_friendly_object(object *op)
void object_set_enemy(object *op, object *enemy)
void object_copy_owner(object *op, object *clone)
#define QUERY_FLAG(xyz, p)
int out_of_map(mapstruct *m, int x, int y)
int get_fear_bonus(int stat)
int tailor_god_spell(object *spellop, object *caster)
int get_turn_bonus(int stat)
void share_exp(object *op, int64_t exp, const char *skill, int flag)
int infect_object(object *victim, object *disease, int force)
#define MSG_TYPE_VICTIM_SPELL
int SP_level_duration_adjust(const object *caster, const object *spob)
int change_skill(object *who, object *new_skill, int flag)
int cast_curse(object *op, object *caster, object *spell_ob, int dir)
int hit_map(object *op, int dir, uint32_t type, int full_hit)
method_ret ob_process(object *op)
int mood_change(object *op, object *caster, object *spell)
static int make_object_glow(object *op, int radius, int time)
short freearr_x[SIZEOFFREE]
short freearr_y[SIZEOFFREE]
const object * find_god(const char *name)
static object * get_pointed_target(object *op, int dir, int range, int type)
#define MSG_TYPE_SPELL_SUCCESS
const char * object_get_value(const object *op, const char *const key)
void free_string(sstring str)
static event_registration m
const char * determine_god(object *op)
#define ARCH_DETECT_MAGIC
int cast_cone(object *op, object *caster, int dir, object *spell)
void query_name(const object *op, char *buf, size_t size)
void object_update_turn_face(object *op)
void fix_object(object *op)
object * map_find_by_flag(mapstruct *map, int x, int y, int flag)
#define GET_MAP_MOVE_BLOCK(M, X, Y)
struct archt * other_arch
int object_set_value(object *op, const char *key, const char *value, int add_key)
int caster_level(const object *caster, const object *spell)
#define FLAG_UNAGGRESSIVE
void cone_drop(object *op)
int create_bomb(object *op, object *caster, int dir, object *spell)
void object_set_owner(object *op, object *owner)
object * find_skill_by_name(object *who, const char *name)
static std::shared_ptr< inja::Environment > env
int cast_smite_spell(object *op, object *caster, int dir, object *spell)
object * create_archetype(const char *name)
int fire_bolt(object *op, object *caster, int dir, object *spob)
#define FREE_AND_CLEAR_STR(xyz)
int random_roll(int min, int max, const object *op, int goodbad)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
int cast_destruction(object *op, object *caster, object *spell_ob)
int die_roll(int num, int size, const object *op, int goodbad)
int cast_cause_disease(object *op, object *caster, object *spell, int dir)
int SP_level_dam_adjust(const object *caster, const object *spob)
#define MSG_TYPE_SPELL_FAILURE
void add_friendly_object(object *op)
void LOG(LogLevel logLevel, const char *format,...)
int did_make_save(const object *op, int level, int bonus)
bool object_value_set(const object *op, const char *const key)
#define MSG_TYPE_SPELL_ERROR
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
#define CLEAR_FLAG(xyz, p)
object * object_insert_in_ob(object *op, object *where)
void explode_bullet(object *op)
object * object_get_env_recursive(object *op)
object * arch_to_object(archetype *at)
int fire_swarm(object *op, object *caster, object *spell, int dir)
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)
void object_free_drop_inventory(object *ob)
void check_bullet(object *op)
#define OB_TYPE_MOVE_BLOCK(ob1, type)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
int change_abil(object *op, object *tmp)
int16_t resist[NROFATTACKS]
#define FOR_INV_PREPARE(op_, it_)
int cast_light(object *op, object *caster, object *spell, int dir)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
object * object_get_owner(object *op)