… | |
… | |
56 | |
56 | |
57 | nx = op->x + freearr_x[dir]; |
57 | nx = op->x + freearr_x[dir]; |
58 | ny = op->y + freearr_y[dir]; |
58 | ny = op->y + freearr_y[dir]; |
59 | m = op->map; |
59 | m = op->map; |
60 | |
60 | |
61 | if (get_map_flags (m, &m, nx, ny, &nx, &ny)) |
61 | if (get_map_flags (m, &m, nx, ny, &nx, &ny) && (P_OUT_OF_MAP | P_SAFE | P_NO_MAGIC | P_NO_CLERIC)) |
62 | { |
62 | { |
63 | new_draw_info (NDI_UNIQUE, 0, op, "Can't make a rune there!"); |
63 | new_draw_info (NDI_UNIQUE, 0, op, "Can't make a rune there!"); |
64 | return 0; |
64 | return 0; |
65 | } |
65 | } |
66 | |
66 | |
67 | for (tmp = GET_MAP_OB (m, nx, ny); tmp != NULL; tmp = tmp->above) |
67 | for (tmp = m->at (nx, ny).bot; tmp; tmp = tmp->above) |
68 | if (tmp->type == RUNE) |
68 | if (tmp->type == RUNE) |
69 | break; |
69 | break; |
70 | |
70 | |
71 | if (tmp) |
71 | if (tmp) |
72 | { |
72 | { |
… | |
… | |
181 | rune->maxhp : number of spells the rune casts |
181 | rune->maxhp : number of spells the rune casts |
182 | */ |
182 | */ |
183 | void |
183 | void |
184 | move_rune (object *op) |
184 | move_rune (object *op) |
185 | { |
185 | { |
186 | int det = 0; |
186 | /* runes of level zero cannot detonate. */ |
187 | |
|
|
188 | if (!op->level) |
187 | if (!op->level) |
189 | { |
|
|
190 | return; |
188 | return; |
191 | } /* runes of level zero cannot detonate. */ |
189 | |
192 | det = op->invisible; |
190 | int det = op->invisible; |
|
|
191 | |
193 | if (!(rndm (0, MAX (1, (op->stats.Cha)) - 1))) |
192 | if (!(rndm (0, MAX (1, (op->stats.Cha)) - 1))) |
194 | { |
193 | { |
195 | op->invisible = 0; |
194 | op->invisible = 0; |
196 | op->speed_left -= 1; |
195 | op->speed_left -= 1; |
197 | } |
196 | } |
198 | else |
197 | else |
199 | op->invisible = 1; |
198 | op->invisible = 1; |
|
|
199 | |
200 | if (op->invisible != det) |
200 | if (op->invisible != det) |
201 | update_object (op, UP_OBJ_FACE); |
201 | update_object (op, UP_OBJ_FACE); |
202 | } |
202 | } |
203 | |
203 | |
204 | |
204 | |