static int user_character_iq_test (void) { int num = 0; cinema_blank(); if ('y' == cinema_ynq_line(0, "Took an official IQ test? [yn] ")) { num = (int)cinema_getnum_line(1, "So, whadja get? "); num /= 10; if (num > 18) { num = 18; cinema_scene("I'm not convinced...", "If you're so smart, why aren't you rich?", 0); } } return num; }
static int user_character_strength (void) { int num; cinema_blank(); num = (int)cinema_getnum_line(0, "How many pounds can you bench press? "); if (num < 30) return 3; if (num < 90) return num / 10; num = (num - 120) / 30 + 9; if (num > 18) { num = 18; cinema_scene("Right, make me believe THAT's true.", "Even if it's true, I don't believe it.", 0); } return num; }
static int user_character_graduate_exam (void) { int num = 0; char * prompt = "Took Graduate entrance exams? [yn] "; cinema_blank(); if ('y' == cinema_ynq_line(0, prompt)) { while (1) { num = (int)cinema_getnum_line(1, "So, what percentile? "); if (num < 100) break; cinema_scene("That's impossible!", 0, 0); cinema_print_line(0, prompt); } num = 9 * (num - 49) / 50 + 9; } return num; }
void user_character_stats(void) { int num; int iqpts = 0; int agipts = 0; int dexpts = 0; int powpts = 0; int conpts = 0; int numints = 0; cinema_scene("OK, now try to answer the following questions honestly:", 0, 0); Player.str = Player.maxstr = user_character_strength(); num = user_character_iq_test(); if (num) ++numints; iqpts += num; num = user_character_undergraduate_exam(); if (num) ++numints; iqpts += num; num = user_character_graduate_exam(); if (num) ++numints; iqpts += num; if (0 == numints) Player.iq = user_character_dumb(); else Player.iq = iqpts / numints; Player.maxiq = Player.iq; agipts += user_character_dance(); agipts += user_character_martial_art(); agipts += user_character_field_sport(); agipts += user_character_cave(); agipts += user_character_skate(); agipts += user_character_handicapped(); agipts += user_character_accident_prone(); agipts += user_character_bicycle(); Player.agi = Player.maxagi = 9 + agipts / 2; dexpts += user_character_video_games(); dexpts += user_character_archer(); dexpts += user_character_picked_lock(); dexpts += user_character_typing_speed(); dexpts += user_character_hand_shakes(); dexpts += user_character_ambidextrous(); dexpts += user_character_can_cut_deck(); dexpts += user_character_can_tie_shoes(); Player.dex = Player.maxdex = 6 + dexpts / 2; conpts += user_character_colds(); conpts += user_character_recent_accident(); conpts += user_character_chronic_disease(); conpts += user_character_overweight(); conpts += user_character_high_blood_pressure(); conpts += user_character_smoke(); conpts += user_character_aerobics(); conpts += user_character_miles_run(); Player.con = Player.maxcon = 12 + conpts / 3; powpts += user_character_animals(); powpts += user_character_auras(); powpts += user_character_out_of_body(); powpts += user_character_spell(); powpts += user_character_esp(); powpts += user_character_pk(); powpts += user_character_ghosts(); powpts += user_character_irish(); Player.pow = Player.maxpow = 3 + powpts / 2; Player.preference = cinema_interact("mfyn", "Are you sexually interested in males or females? ", 0, 0); }
void l_merc_guild(void) { print1("Legion of Destiny, Mercenary Guild, Inc."); if (nighttime()) { print2("The barracks are under curfew right now."); return; } print2("You enter Legion HQ, "); if (Player.rank[LEGION] == COMMANDANT) { nprint2("Your aide follows you to the staff room."); morewait(); clearmsg(); } else if (Player.rank[LEGION] > 0) { nprint2("and report to your commander."); morewait(); } switch (Player.rank[LEGION]) { case 0: nprint2("and see the Recruiting Centurion."); morewait(); print2("Do you wish to join the Legion? [yn] "); if ('y' == ynq2()) { clearmsg(); if (Player.rank[ARENA] > 0) { print1("The Centurion checks your record, and gets angry:"); print2("'The legion don't need any Arena Jocks. Git!'"); } else if (Player.rank[ORDER] > 0) { print1("The Centurion checks your record, and is amused:"); print2("'A paladin in the ranks? You must be joking.'"); } else if (Player.con < 12) { print1("The Centurion looks you over, sadly."); print2("You are too fragile to join the legion."); } else if (Player.str < 10) { print1("The Centurion looks at you contemptuously."); print2("Your strength is too low to pass the physical!"); } else { Object* newitem; bank_account * account; print1("You are tested for strength and stamina..."); morewait(); nprint1(" and you pass!"); print2("Commandant "); nprint2(Commandant); nprint2(" shakes your hand."); morewait(); print1("You are also issued a shortsword and leather."); print2("You are now a Legionaire."); morewait(); clearmsg(); /* gain shortsword */ newitem = (Object*) checkmalloc(sizeof(Object)); *newitem = Objects[OB_SHORT_SWORD]; gain_item(newitem); /* gain leather armor */ newitem = (Object*) checkmalloc(sizeof(Object)); *newitem = Objects[OB_LEATHER]; gain_item(newitem); cinema_scene("Your starting salary will be 500 AU per month paid into an account the", "legion has set up for you. The password is \"loyalty\". Don't lose your card!", 0); /* gain bank card for salary account */ account = bank_create_account(true, 0, "loyalty"); account->balance = 500; Objects[OB_DEBIT_CARD].known = 1; newitem = bank_create_card(account->number, OB_DEBIT_CARD); gain_item(newitem); clearmsg(); SalaryAmount = 500; SalaryAccount = account->number; Player.rank[LEGION] = LEGIONAIRE; Player.guildxp[LEGION] = 1; Player.str++; Player.con++; Player.maxstr++; Player.maxcon++; } } break; case COMMANDANT: print1("You find the disposition of your forces satisfactory."); break; case COLONEL: if ((Player.level > Commandantlevel) && find_and_remove_item(CORPSEID, DEMON_EMP)) { print1("You liberated the Demon Emperor's Regalia!"); morewait(); clearmsg(); print1("The Legion is assembled in salute to you!"); print2("The Regalia is held high for all to see and admire."); morewait(); clearmsg(); print1("Commandant "); nprint1(Commandant); nprint1(" promotes you to replace him,"); print2("and announces his own overdue retirement."); morewait(); clearmsg(); print1("You are the new Commandant of the Legion!"); print2("The Emperor's Regalia is sold for a ridiculous sum."); morewait(); clearmsg(); print1("You now know the Spell of Regeneration."); print2("Your training is complete. You get top salary."); strcpy(Commandant, Player.name); Commandantlevel = Player.level; Commandantbehavior = fixnpc(4); save_hiscore_npc(8); Spells[S_REGENERATE].known = true; Player.rank[LEGION] = COMMANDANT; Player.str += 2; Player.con += 2; Player.maxstr += 2; Player.maxcon += 2; SalaryAmount = 10000; } else if (Player.level <= Commandantlevel) { clearmsg(); print1("Your CO expresses satisfaction with your progress."); print2("But your service record does not yet permit promotion."); } else { clearmsg(); print1("Why do you come empty handed?"); print2("You must return with the Regalia of the Demon Emperor!"); } break; case FORCE_LEADER: clearmsg(); print1("Your CO expresses satisfaction with your progress."); if (Player.guildxp[LEGION] < merc_xps[Player.rank[LEGION]]) { print2("But your service record does not yet permit promotion."); } else { print2("You have been promoted to Legion Colonel!"); morewait(); print1("Your next promotion is contingent on the return of"); print2("the Regalia of the Demon Emperor."); morewait(); print1("The Demon Emperor holds court at the base of a volcano"); print2("to the far south, in the heart of a swamp."); morewait(); clearmsg(); print1("You have been taught the spell of heroism!"); print2("You are given advanced training, and a raise."); Spells[S_HERO].known = true; Player.rank[LEGION]=COLONEL; Player.str++; Player.con++; Player.maxstr++; Player.maxcon++; SalaryAmount = 5000; } break; case CENTURION: clearmsg(); print1("Your CO expresses satisfaction with your progress."); if (Player.guildxp[LEGION] < merc_xps[Player.rank[LEGION]]) { print2("But your service record does not yet permit promotion."); } else { print2("You are now a Legion Force-Leader!"); morewait(); clearmsg(); print1("You receive more training, and another raise."); Player.rank[LEGION]=FORCE_LEADER; Player.maxstr++; Player.str++; SalaryAmount = 2000; } break; case LEGIONAIRE: clearmsg(); print1("Your CO expresses satisfaction with your progress."); if (Player.guildxp[LEGION] < merc_xps[Player.rank[LEGION]]) { print2("But your service record does not yet permit promotion."); } else { print2("You are promoted to Legion Centurion!"); morewait(); clearmsg(); print1("You get advanced training, and a higher salary."); Player.rank[LEGION] = CENTURION; Player.maxcon++; Player.con++; SalaryAmount = 1000; } break; } }