43 #define sqr(x) ((x)*(x))
66 int write_rune(
object *op,
object *caster,
object *spell,
int dir,
const char *runename) {
67 object *tmp, *rune_spell, *rune;
82 "Can't make a rune there!", NULL);
91 "You can't write a rune there.", NULL);
102 int bestmatch = 0, ms;
104 if (!runename || *runename == 0) {
106 "Write a rune of what?", NULL);
111 for (tmp = op->
inv; tmp; tmp = tmp->
below) {
114 if (ms > bestmatch) {
123 "You don't know any spell named %s",
124 "You don't know any spell named %s",
131 "You can't cast %s with %s",
132 "You can't cast %s with %s",
138 "%s belongs to a spell path denied to you.",
139 "%s belongs to a spell path denied to you.",
145 "%s is beyond your ability to cast!",
146 "%s is beyond your ability to cast!",
152 "You don't have enough mana.", NULL);
157 "You don't have enough grace.", NULL);
168 snprintf(buf,
sizeof(buf),
"You set off a rune of %s\n", rune_spell->
name);
207 object *disease = op->
inv;
323 int dispel_rune(
object *op,
object *caster,
object *spell,
object *skill,
int dir) {
325 int searchflag = 1, mflags;
340 "There's nothing there!", NULL);
364 "You wipe out the rune of marking!", NULL);
371 for (tmp2 = tmp->
inv; tmp2 != NULL; tmp2 = tmp2->
below) {
385 "There's nothing there!", NULL);
459 int trap_disarm(
object *disarmer,
object *trap,
int risk,
object *skill) {
470 "You successfully disarm the %s!",
471 "You successfully disarm the %s!",
484 "You fail to disarm the %s.",
485 "You fail to disarm the %s.",
491 "In fact, you set it off!", NULL);
530 for (i = 0; i < difficulty; i++)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, sint16 x, sint16 y, sint16 *nx, sint16 *ny)
void set_owner(object *op, object *owner)
int caster_level(const object *caster, const object *spell)
object * object_get_env_recursive(object *op)
#define MSG_TYPE_SPELL_FAILURE
struct treasureliststruct * randomitems
#define MSG_TYPE_COMMAND_SUCCESS
int item_matched_string(object *pl, object *op, const char *name)
short freearr_x[SIZEOFFREE]
void draw_ext_info(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage)
#define MSG_TYPE_SPELL_ERROR
#define GET_ANIMATION(ob, anim)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
struct archt * other_arch
#define MSG_TYPE_COMMAND_FAILURE
short freearr_y[SIZEOFFREE]
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
int rndm(int min, int max)
void remove_ob(object *op)
object * create_archetype(const char *name)
void get_rangevector(object *op1, const object *op2, rv_vector *retval, int flags)
int trap_disarm(object *disarmer, object *trap, int risk, object *skill)
int hit_map(object *op, int dir, uint32 type, int full_hit)
int infect_object(object *victim, object *disease, int force)
#define QUERY_FLAG(xyz, p)
int write_rune(object *op, object *caster, object *spell, int dir, const char *runename)
object * insert_ob_in_ob(object *op, object *where)
void trap_adjust(object *trap, int difficulty)
void spring_trap(object *trap, object *victim)
#define MSG_TYPE_APPLY_TRAP
object * get_object(void)
object * insert_ob_in_map(object *op, mapstruct *m, object *originator, int flag)
int snprintf(char *dest, int max, const char *format,...)
int dispel_rune(object *op, object *caster, object *spell, object *skill, int dir)
void set_spell_skill(object *op, object *caster, object *spob, object *dest)
void destroy_object(object *op)
sint16 SP_level_spellpoint_cost(object *caster, object *spell, int flags)
static void rune_attack(object *op, object *victim)
#define MSG_TYPE_SPELL_SUCCESS
int trap_see(object *op, object *trap)
sstring add_string(const char *str)
#define GET_MAP_OB(M, X, Y)
#define was_destroyed(op, old_tag)
void copy_object(object *op2, object *op)
int trap_show(object *trap, object *where)
void free_object(object *ob)
int random_roll(int min, int max, const object *op, int goodbad)
object * arch_to_object(archetype *at)
int hit_player(object *op, int dam, object *hitter, uint32 type, int full_hit)
#define HAS_RANDOM_ITEMS(op)
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)