1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcsid_attack_c = |
3 | * static char *rcsid_attack_c = |
4 | * "$Id: attack.C,v 1.10 2006/09/11 11:46:52 root Exp $"; |
4 | * "$Id: attack.C,v 1.11 2006/09/11 20:26:41 root Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
316 | |
316 | |
317 | int mflags = get_map_flags (map, &map, x, y, &x, &y); |
317 | int mflags = get_map_flags (map, &map, x, y, &x, &y); |
318 | |
318 | |
319 | // elmex: a safe map tile can't be hit! |
319 | // elmex: a safe map tile can't be hit! |
320 | // this should prevent most harmful effects on items and players there. |
320 | // this should prevent most harmful effects on items and players there. |
321 | if ((mflags & P_OUT_OF_MAP) || (mflags & P_SAFE)) |
321 | if (mflags & (P_OUT_OF_MAP | P_SAFE)) |
322 | return 0; |
322 | return 0; |
323 | |
323 | |
324 | /* peterm: a few special cases for special attacktypes --counterspell |
324 | /* peterm: a few special cases for special attacktypes --counterspell |
325 | * must be out here because it strikes things which are not alive |
325 | * must be out here because it strikes things which are not alive |
326 | */ |
326 | */ |
… | |
… | |
331 | |
331 | |
332 | /* If the only attacktype is counterspell or magic, don't need |
332 | /* If the only attacktype is counterspell or magic, don't need |
333 | * to do any further processing. |
333 | * to do any further processing. |
334 | */ |
334 | */ |
335 | if (!(type & ~(AT_COUNTERSPELL | AT_MAGIC))) |
335 | if (!(type & ~(AT_COUNTERSPELL | AT_MAGIC))) |
336 | { |
|
|
337 | return 0; |
336 | return 0; |
338 | } |
337 | |
339 | type &= ~AT_COUNTERSPELL; |
338 | type &= ~AT_COUNTERSPELL; |
340 | } |
339 | } |
341 | |
340 | |
342 | if (type & AT_CHAOS) |
341 | if (type & AT_CHAOS) |
343 | { |
342 | { |
… | |
… | |
364 | * below was spamming the logs for absolutely no reason. |
363 | * below was spamming the logs for absolutely no reason. |
365 | */ |
364 | */ |
366 | /* LOG (llevDebug, "hit_map(): next object destroyed\n"); */ |
365 | /* LOG (llevDebug, "hit_map(): next object destroyed\n"); */ |
367 | break; |
366 | break; |
368 | } |
367 | } |
|
|
368 | |
369 | tmp = next; |
369 | tmp = next; |
370 | next = tmp->above; |
370 | next = tmp->above; |
|
|
371 | |
371 | if (next) |
372 | if (next) |
372 | next_tag = next->count; |
373 | next_tag = next->count; |
373 | |
374 | |
374 | if (QUERY_FLAG (tmp, FLAG_FREED)) |
375 | if (QUERY_FLAG (tmp, FLAG_FREED)) |
375 | { |
376 | { |
… | |
… | |
389 | hit_player (tmp, op->stats.dam, op, type, full_hit); |
390 | hit_player (tmp, op->stats.dam, op, type, full_hit); |
390 | retflag |= 1; |
391 | retflag |= 1; |
391 | if (was_destroyed (op, op_tag)) |
392 | if (was_destroyed (op, op_tag)) |
392 | break; |
393 | break; |
393 | } |
394 | } |
|
|
395 | |
394 | /* Here we are potentially destroying an object. If the object has |
396 | /* Here we are potentially destroying an object. If the object has |
395 | * NO_PASS set, it is also immune - you can't destroy walls. Note |
397 | * NO_PASS set, it is also immune - you can't destroy walls. Note |
396 | * that weak walls have is_alive set, which prevent objects from |
398 | * that weak walls have is_alive set, which prevent objects from |
397 | * passing over/through them. We don't care what type of movement |
399 | * passing over/through them. We don't care what type of movement |
398 | * the wall blocks - if it blocks any type of movement, can't be |
400 | * the wall blocks - if it blocks any type of movement, can't be |
… | |
… | |
403 | save_throw_object (tmp, type, op); |
405 | save_throw_object (tmp, type, op); |
404 | if (was_destroyed (op, op_tag)) |
406 | if (was_destroyed (op, op_tag)) |
405 | break; |
407 | break; |
406 | } |
408 | } |
407 | } |
409 | } |
|
|
410 | |
408 | return 0; |
411 | return 0; |
409 | } |
412 | } |
410 | |
413 | |
411 | void |
414 | void |
412 | attack_message (int dam, int type, object *op, object *hitter) |
415 | attack_message (int dam, int type, object *op, object *hitter) |