| 3656 | } |
| 3657 | |
| 3658 | staticfn int |
| 3659 | mkroll_launch( |
| 3660 | struct trap *ttmp, |
| 3661 | coordxy x, |
| 3662 | coordxy y, |
| 3663 | short otyp, |
| 3664 | long ocount) |
| 3665 | { |
| 3666 | struct obj *otmp; |
| 3667 | coord cc = UNDEFINED_VALUES; |
| 3668 | boolean success = FALSE; |
| 3669 | |
| 3670 | success = find_random_launch_coord(ttmp, &cc); |
| 3671 | |
| 3672 | if (!success) { |
| 3673 | /* create the trap without any ammo, launch pt at trap location */ |
| 3674 | cc.x = x; |
| 3675 | cc.y = y; |
| 3676 | } else { |
| 3677 | otmp = mksobj(otyp, TRUE, FALSE); |
| 3678 | otmp->quan = ocount; |
| 3679 | otmp->owt = weight(otmp); |
| 3680 | place_object(otmp, cc.x, cc.y); |
| 3681 | stackobj(otmp); |
| 3682 | } |
| 3683 | ttmp->launch.x = cc.x; |
| 3684 | ttmp->launch.y = cc.y; |
| 3685 | if (ttmp->ttyp == ROLLING_BOULDER_TRAP) { |
| 3686 | ttmp->launch2.x = x - (cc.x - x); |
| 3687 | ttmp->launch2.y = y - (cc.y - y); |
| 3688 | } else |
| 3689 | ttmp->launch_otyp = otyp; |
| 3690 | newsym(ttmp->launch.x, ttmp->launch.y); |
| 3691 | return 1; |
| 3692 | } |
| 3693 | |
| 3694 | staticfn boolean |
| 3695 | isclearpath( |
no test coverage detected