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

Function encode_extended_achievements

src/topten.c:490–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488}
489
490staticfn char *
491encode_extended_achievements(char *buf)
492{
493 char rnkbuf[40];
494 const char *achievement = NULL;
495 int i, achidx, absidx;
496
497 buf[0] = '\0';
498 for (i = 0; u.uachieved[i]; i++) {
499 achidx = u.uachieved[i];
500 absidx = abs(achidx);
501 switch (absidx) {
502 case ACH_UWIN:
503 achievement = "ascended";
504 break;
505 case ACH_ASTR:
506 achievement = "entered_astral_plane";
507 break;
508 case ACH_ENDG:
509 achievement = "entered_elemental_planes";
510 break;
511 case ACH_AMUL:
512 achievement = "obtained_the_amulet_of_yendor";
513 break;
514 case ACH_INVK:
515 achievement = "performed_the_invocation_ritual";
516 break;
517 case ACH_BOOK:
518 achievement = "obtained_the_book_of_the_dead";
519 break;
520 case ACH_BELL:
521 achievement = "obtained_the_bell_of_opening";
522 break;
523 case ACH_CNDL:
524 achievement = "obtained_the_candelabrum_of_invocation";
525 break;
526 case ACH_HELL:
527 achievement = "entered_gehennom";
528 break;
529 case ACH_MEDU:
530 achievement = "defeated_medusa";
531 break;
532 case ACH_MINE_PRIZE:
533 achievement = "obtained_the_luckstone_from_the_mines";
534 break;
535 case ACH_SOKO_PRIZE:
536 achievement = "obtained_the_sokoban_prize";
537 break;
538 case ACH_ORCL:
539 achievement = "consulted_the_oracle";
540 break;
541 case ACH_NOVL:
542 achievement = "read_a_discworld_novel";
543 break;
544 case ACH_MINE:
545 achievement = "entered_the_gnomish_mines";
546 break;
547 case ACH_TOWN:

Callers 1

writexlentryFunction · 0.85

Calls 5

rank_ofFunction · 0.85
rank_to_xlevFunction · 0.85
strNsubstFunction · 0.85
lcaseFunction · 0.85
add_achieveXFunction · 0.85

Tested by

no test coverage detected