… | |
… | |
246 | return !other_teleporter->map->insert ( |
246 | return !other_teleporter->map->insert ( |
247 | user, other_teleporter->x + freearr_x[k], other_teleporter->y + freearr_y[k] |
247 | user, other_teleporter->x + freearr_x[k], other_teleporter->y + freearr_y[k] |
248 | ); |
248 | ); |
249 | } |
249 | } |
250 | |
250 | |
251 | void |
|
|
252 | recursive_roll (object *op, int dir, object *pusher) |
|
|
253 | { |
|
|
254 | if (!roll_ob (op, dir, pusher)) |
|
|
255 | { |
|
|
256 | new_draw_info_format (NDI_UNIQUE, 0, pusher, "You fail to push the %s.", query_name (op)); |
|
|
257 | return; |
|
|
258 | } |
|
|
259 | |
|
|
260 | move_ob (pusher, dir, pusher); |
|
|
261 | new_draw_info_format (NDI_BLACK, 0, pusher, "You move the %s.", query_name (op)); |
|
|
262 | return; |
|
|
263 | } |
|
|
264 | |
|
|
265 | /* |
251 | /* |
266 | * This is a new version of blocked, this one handles objects |
252 | * This is a new version of blocked, this one handles objects |
267 | * that can be passed through by monsters with the CAN_PASS_THRU defined. |
253 | * that can be passed through by monsters with the CAN_PASS_THRU defined. |
268 | * |
254 | * |
269 | * very new version handles also multipart objects |
255 | * very new version handles also multipart objects |
270 | * This is currently only used for the boulder roll code. |
256 | * This is currently only used for the boulder roll code. |
271 | * Returns 1 if object does not fit, 0 if it does. |
257 | * Returns 1 if object does not fit, 0 if it does. |
272 | */ |
258 | */ |
273 | |
259 | static int |
274 | int |
|
|
275 | try_fit (object *op, maptile *m, int x, int y) |
260 | try_fit (object *op, maptile *m, int x, int y) |
276 | { |
261 | { |
277 | object *tmp, *more; |
262 | object *tmp, *more; |
278 | sint16 tx, ty; |
263 | sint16 tx, ty; |
279 | int mflags; |
264 | int mflags; |
… | |
… | |
311 | /* |
296 | /* |
312 | * this is not perfect yet. |
297 | * this is not perfect yet. |
313 | * it does not roll objects behind multipart objects properly. |
298 | * it does not roll objects behind multipart objects properly. |
314 | * Support for rolling multipart objects is questionable. |
299 | * Support for rolling multipart objects is questionable. |
315 | */ |
300 | */ |
316 | int |
301 | static int |
317 | roll_ob (object *op, int dir, object *pusher) |
302 | roll_ob (object *op, int dir, object *pusher) |
318 | { |
303 | { |
319 | sint16 x, y; |
304 | sint16 x, y; |
320 | int flags; |
305 | int flags; |
321 | maptile *m; |
306 | maptile *m; |
… | |
… | |
357 | return 0; |
342 | return 0; |
358 | |
343 | |
359 | op->move (dir); |
344 | op->move (dir); |
360 | |
345 | |
361 | return 1; |
346 | return 1; |
|
|
347 | } |
|
|
348 | |
|
|
349 | void |
|
|
350 | recursive_roll (object *op, int dir, object *pusher) |
|
|
351 | { |
|
|
352 | if (!roll_ob (op, dir, pusher)) |
|
|
353 | { |
|
|
354 | new_draw_info_format (NDI_UNIQUE, 0, pusher, "You fail to push the %s.", query_name (op)); |
|
|
355 | return; |
|
|
356 | } |
|
|
357 | |
|
|
358 | move_ob (pusher, dir, pusher); |
|
|
359 | new_draw_info_format (NDI_BLACK, 0, pusher, "You move the %s.", query_name (op)); |
|
|
360 | return; |
362 | } |
361 | } |
363 | |
362 | |
364 | /* returns 1 if pushing invokes a attack, 0 when not */ |
363 | /* returns 1 if pushing invokes a attack, 0 when not */ |
365 | int |
364 | int |
366 | push_ob (object *who, int dir, object *pusher) |
365 | push_ob (object *who, int dir, object *pusher) |