Go to the documentation of this file.
28 #define sqr(x) ((x)*(x))
50 int write_rune(
object *
op,
object *caster,
object *spell,
int dir,
const char *runename) {
51 object *rune_spell, *rune;
66 "Can't make a rune there!");
72 "You can't write a rune there.");
84 int bestmatch = 0, ms;
86 if (!runename || *runename == 0) {
88 "Write a rune of what?");
105 "You don't know any spell named %s",
112 "You can't cast %s with %s",
118 "%s belongs to a spell path denied to you.",
124 "%s is beyond your ability to cast!",
130 "You don't have enough mana.");
134 if ((gr > 0) && (gr >
op->stats.grace)) {
136 "You don't have enough grace.");
139 op->stats.grace -= gr;
149 snprintf(
buf,
sizeof(
buf),
"You set off a rune of %s\n", rune_spell->
name);
185 object *disease =
op->inv;
312 "There's nothing there!");
337 if (
tmp->type ==
SIGN && !strcmp(
tmp->arch->name,
"rune_mark")) {
341 "You wipe out the rune of marking!");
358 "There's nothing there!");
383 || (chance >
MIN(95,
MAX(5, ((
int)((
float)(
op->map->difficulty+trap->
level+trap->
stats.
Cha-
op->level)/10.0*50.0)))))) {
433 int trap_disarm(
object *disarmer,
object *trap,
int risk,
object *skill) {
446 "You successfully disarm the %s!",
453 if (owner != NULL && owner->
type !=
PLAYER && risk)
460 "You fail to disarm the %s.",
466 "In fact, you set it off!");
#define object_was_destroyed(op, old_tag)
#define HAS_RANDOM_ITEMS(op)
void set_spell_skill(object *op, object *caster, object *spob, object *dest)
void object_remove(object *op)
int dispel_rune(object *op, object *skill, int dir)
object * object_find_by_type2(const object *who, int type1, int type2)
#define MSG_TYPE_COMMAND_SUCCESS
#define GET_ANIMATION(ob, anim)
#define QUERY_FLAG(xyz, p)
object * object_new(void)
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
int infect_object(object *victim, object *disease, int force)
int object_matches_string(object *pl, object *op, const char *name)
int trap_see(object *op, object *trap)
void destroy_object(object *op)
int trap_show(object *trap, object *where)
int hit_map(object *op, int dir, uint32_t type, int full_hit)
int get_rangevector(object *op1, const object *op2, rv_vector *retval, int flags)
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
short freearr_x[SIZEOFFREE]
short freearr_y[SIZEOFFREE]
#define MSG_TYPE_SPELL_SUCCESS
static event_registration m
void object_copy(const object *src_ob, object *dest_ob)
static void rune_attack(object *op, object *victim)
#define MSG_TYPE_APPLY_TRAP
struct archt * other_arch
int caster_level(const object *caster, const object *spell)
int16_t SP_level_spellpoint_cost(object *caster, object *spell, int flags)
const Animations * animation
void object_set_owner(object *op, object *owner)
static std::shared_ptr< inja::Environment > env
object * create_archetype(const char *name)
int random_roll(int min, int max, const object *op, int goodbad)
#define MSG_TYPE_COMMAND_FAILURE
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
void object_set_msg(object *op, const char *msg)
const Animations * temp_animation
#define MSG_TYPE_SPELL_FAILURE
#define MSG_TYPE_SPELL_ERROR
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
object * object_insert_in_ob(object *op, object *where)
object * object_get_env_recursive(object *op)
object * arch_to_object(archetype *at)
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)
int trap_disarm(object *disarmer, object *trap, int risk, object *skill)
void spring_trap(object *trap, object *victim)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
int write_rune(object *op, object *caster, object *spell, int dir, const char *runename)
#define FOR_INV_PREPARE(op_, it_)
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)