| 814 | |
| 815 | /* return soldier types. */ |
| 816 | staticfn struct permonst * |
| 817 | squadmon(void) |
| 818 | { |
| 819 | int sel_prob, i, cpro, mndx; |
| 820 | |
| 821 | sel_prob = rnd(80 + level_difficulty()); |
| 822 | |
| 823 | cpro = 0; |
| 824 | for (i = 0; i < SIZE(squadprob); i++) { |
| 825 | cpro += squadprob[i].prob; |
| 826 | if (cpro > sel_prob) { |
| 827 | mndx = squadprob[i].pm; |
| 828 | goto gotone; |
| 829 | } |
| 830 | } |
| 831 | mndx = ROLL_FROM(squadprob).pm; |
| 832 | gotone: |
| 833 | if (!(svm.mvitals[mndx].mvflags & G_GONE)) |
| 834 | return &mons[mndx]; |
| 835 | else |
| 836 | return (struct permonst *) 0; |
| 837 | } |
| 838 | |
| 839 | /* |
| 840 | * save_room : A recursive function that saves a room and its subrooms |
no test coverage detected