From: Joe Wreschnig Date: Sat, 6 Apr 2013 21:32:16 +0000 (+0200) Subject: Win logic, but doesn't trigger right yet. X-Git-Url: https://git.yukkurigames.com/?p=rogue-pphs.git;a=commitdiff_plain;h=93bb426202ba92c389aae65c0c8ab6eb3d325eae Win logic, but doesn't trigger right yet. --- diff --git a/command.c b/command.c index 52e7e62..eaa3648 100644 --- a/command.c +++ b/command.c @@ -518,7 +518,7 @@ u_level() { level--; if (level == 0) - total_winner(); + total_loner(); new_level(); msg("You feel a wrenching sensation in your gut."); return; diff --git a/rip.c b/rip.c index 77bf78d..1e2250d 100644 --- a/rip.c +++ b/rip.c @@ -102,7 +102,9 @@ char monst; static char *reason[] = { "killed", "quit", - "A total winner", + "A total loner", + "left for a date", + "got the amulet and left" }; char scoreline[100]; char score_file[PATH_MAX]; @@ -182,7 +184,7 @@ char monst; scp->sc_score = amount; strcpy(scp->sc_name, whoami); scp->sc_flags = flags; - if (flags == 2) + if (flags >= 2) scp->sc_level = max_level; else scp->sc_level = level; @@ -231,6 +233,15 @@ char monst; scp--; } } + else if (prflags >= 3) + { + printf(" with a"); + killer = killname(scp->sc_monster); + if (*killer == 'a' || *killer == 'e' || *killer == 'i' || + *killer == 'o' || *killer == 'u') + putchar('n'); + printf(" %s", killer); + } else printf(".\n"); } @@ -253,30 +264,53 @@ char monst; fclose(outf); } -total_winner() +total_loner(monster) +char monster; { - register struct linked_list *item; - register struct object *obj; - register int worth; - register char c; - register int oldpurse; + clear(); + standout(); + addstr(" \n"); + addstr(" You escaped from the caverns, but alone. \n"); + standend(); + addstr("\nYou have joined the elite ranks of those who have escaped the\n"); + addstr("Cavern of Cuties alive, but failed to meet anyone while there.\n"); + addstr("You journey home and sell all your loot at a great profit and\n"); + addstr("continue your life alone.\n"); + total_something(2, 0); +} +total_winner(monster) +char monster; +{ clear(); standout(); addstr(" \n"); - addstr(" @ @ @ @ @ @@@ @ @ \n"); - addstr(" @ @ @@ @@ @ @ @ @ \n"); - addstr(" @ @ @@@ @ @ @ @ @ @@@ @@@@ @@@ @ @@@ @ \n"); - addstr(" @@@@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ \n"); - addstr(" @ @ @ @ @ @ @ @@@@ @ @ @@@@@ @ @ @ \n"); - addstr(" @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @ \n"); - addstr(" @@@ @@@ @@ @ @ @ @@@@ @@@@ @@@ @@@ @@ @ \n"); + addstr(" You got the amulet and a hot date. \n"); + standend(); + total_something(4, monster); +} + +mostly_winner(monster) +char monster; +{ + clear(); + standout(); addstr(" \n"); - addstr(" Congratulations, you have made it to the light of day! \n"); + addstr(" You got a hot date. \n"); standend(); - addstr("\nYou have joined the elite ranks of those who have escaped the\n"); - addstr("Dungeons of Doom alive. You journey home and sell all your loot at\n"); - addstr("a great profit and are admitted to the fighters guild.\n"); + total_something(3, monster); +} + +total_something(flags, monster) +int flags; +char monster; +{ + register struct linked_list *item; + register struct object *obj; + register int worth; + register char c; + register int oldpurse; + mvaddstr(LINES - 1, 0, "--Press space to continue--"); refresh(); wait_for(' '); @@ -356,7 +390,7 @@ total_winner() } mvprintw(c - 'a' + 1, 0," %5d Gold Peices ", oldpurse); refresh(); - score(purse, 2, 0); + score(purse, flags, monster); getch(); endwin(); exit(0); diff --git a/romance.c b/romance.c index 7f5da0c..3c5c2e1 100644 --- a/romance.c +++ b/romance.c @@ -166,4 +166,14 @@ int ydelta, xdelta; embrace() { + // Figure out if the player is near something w/ enough interest. + // Otherwise, hug something random, and make things worse. + if (amulet) + { + total_winner('K'); + } + else + { + mostly_winner('K'); + } }