… | |
… | |
1329 | * Processing will happen if the head runs into the pit |
1329 | * Processing will happen if the head runs into the pit |
1330 | */ |
1330 | */ |
1331 | if (victim->head) |
1331 | if (victim->head) |
1332 | return; |
1332 | return; |
1333 | |
1333 | |
1334 | fprintf (stderr, "range %d\n", trap->range);//D |
|
|
1335 | // now find all possible locations and randomly pick one |
1334 | // now find all possible locations and randomly pick one |
1336 | int dir = find_free_spot (victim, trap->map, EXIT_X (trap), EXIT_Y (trap), 0, |
1335 | int dir = find_free_spot (victim, trap->map, EXIT_X (trap), EXIT_Y (trap), 0, |
1337 | trap->range >= 3 ? SIZEOFFREE3 |
1336 | trap->range >= 3 ? SIZEOFFREE3 + 1 |
1338 | : trap->range >= 2 ? SIZEOFFREE2 |
1337 | : trap->range >= 2 ? SIZEOFFREE2 + 1 |
1339 | : trap->range >= 1 ? SIZEOFFREE1 |
1338 | : trap->range >= 1 ? SIZEOFFREE1 + 1 |
1340 | : 0); |
1339 | : SIZEOFFREE0 + 1); |
1341 | |
1340 | |
1342 | if (dir < 0) |
1341 | if (dir < 0) |
1343 | return; |
1342 | return; |
1344 | |
1343 | |
1345 | victim->play_sound (trap->sound ? trap->sound : sound_find ("fall_hole")); |
1344 | victim->play_sound (trap->sound ? trap->sound : sound_find ("fall_hole")); |