1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcsid_attack_c = |
3 | * static char *rcsid_attack_c = |
4 | * "$Id: attack.C,v 1.14 2006/09/14 17:10:25 root Exp $"; |
4 | * "$Id: attack.C,v 1.15 2006/09/14 20:46:10 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 | |
… | |
… | |
242 | else |
242 | else |
243 | replace_insert_ob_in_map ("burnout", originator); |
243 | replace_insert_ob_in_map ("burnout", originator); |
244 | |
244 | |
245 | return; |
245 | return; |
246 | } |
246 | } |
|
|
247 | |
247 | /* The value of 50 is arbitrary. */ |
248 | /* The value of 50 is arbitrary. */ |
248 | if (type & AT_COLD && (op->resist[ATNR_COLD] < 50) && !QUERY_FLAG (op, FLAG_NO_PICK) && (RANDOM () & 2)) |
249 | if (type & AT_COLD && (op->resist[ATNR_COLD] < 50) && !QUERY_FLAG (op, FLAG_NO_PICK) && (RANDOM () & 2)) |
249 | { |
250 | { |
250 | object *tmp; |
251 | object *tmp; |
251 | archetype *at = find_archetype ("icecube"); |
252 | archetype *at = find_archetype ("icecube"); |
252 | |
253 | |
253 | if (at == NULL) |
254 | if (at == NULL) |
254 | return; |
255 | return; |
|
|
256 | |
255 | op = stop_item (op); |
257 | op = stop_item (op); |
256 | if (op == NULL) |
258 | if (op == NULL) |
257 | return; |
259 | return; |
|
|
260 | |
258 | if ((tmp = present_arch (at, op->map, op->x, op->y)) == NULL) |
261 | if ((tmp = present_arch (at, op->map, op->x, op->y)) == NULL) |
259 | { |
262 | { |
260 | tmp = arch_to_object (at); |
263 | tmp = arch_to_object (at); |
261 | tmp->x = op->x, tmp->y = op->y; |
264 | tmp->x = op->x, tmp->y = op->y; |
262 | /* This was in the old (pre new movement code) - |
265 | /* This was in the old (pre new movement code) - |
… | |
… | |
265 | */ |
268 | */ |
266 | tmp->move_slow_penalty = 0; |
269 | tmp->move_slow_penalty = 0; |
267 | tmp->move_slow = 0; |
270 | tmp->move_slow = 0; |
268 | insert_ob_in_map (tmp, op->map, originator, 0); |
271 | insert_ob_in_map (tmp, op->map, originator, 0); |
269 | } |
272 | } |
|
|
273 | |
270 | if (!QUERY_FLAG (op, FLAG_REMOVED)) |
274 | if (!QUERY_FLAG (op, FLAG_REMOVED)) |
271 | remove_ob (op); |
275 | remove_ob (op); |
|
|
276 | |
272 | (void) insert_ob_in_ob (op, tmp); |
277 | insert_ob_in_ob (op, tmp); |
273 | return; |
278 | return; |
274 | } |
279 | } |
275 | } |
280 | } |
276 | |
281 | |
277 | /* Object op is hitting the map. |
282 | /* Object op is hitting the map. |