MCPcopy Create free account
hub / github.com/NetHack/NetHack / antholemon

Function antholemon

src/mkroom.c:501–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501struct permonst *
502antholemon(void)
503{
504 int mtyp, indx, trycnt = 0;
505
506 /* casts are for dealing with time_t */
507 indx = (int) ((long) ubirthday % 3L);
508 indx += level_difficulty();
509 /* Same monsters within a level, different ones between levels */
510 do {
511 switch ((indx + trycnt) % 3) {
512 case 0:
513 mtyp = PM_SOLDIER_ANT;
514 break;
515 case 1:
516 mtyp = PM_FIRE_ANT;
517 break;
518 default:
519 mtyp = PM_GIANT_ANT;
520 break;
521 }
522 /* try again if chosen type has been genocided or used up */
523 } while (++trycnt < 3 && (svm.mvitals[mtyp].mvflags & G_GONE));
524
525 return ((svm.mvitals[mtyp].mvflags & G_GONE) ? (struct permonst *) 0
526 : &mons[mtyp]);
527}
528
529staticfn void
530mkswamp(void) /* Michiel Huisjes & Fred de Wilde */

Callers 2

fill_zooFunction · 0.85
makelevelFunction · 0.85

Calls 1

level_difficultyFunction · 0.85

Tested by

no test coverage detected