internal static bool buy_cure(int cost, string cure_name) /* buy_cure */ { string text = string.Format("{0} will only cost {1} gold pieces.", cure_name, cost); Seg041.press_any_key(text, true, 10, TextRegion.NormalBottom); bool buy = false; if ('Y' == ovr027.yes_no(gbl.defaultMenuColors, "pay for cure ")) { if (cost <= gbl.SelectedPlayer.Money.GetGoldWorth()) { gbl.SelectedPlayer.Money.SubtractGoldWorth(cost); buy = true; } else if (cost <= gbl.pooled_money.GetGoldWorth()) { gbl.pooled_money.SubtractGoldWorth(cost); buy = true; } else { ovr025.string_print01("Not enough money."); buy = false; } } if (buy) { ovr025.ClearPlayerTextArea(); ovr025.DisplayPlayerStatusString(true, 0, "is cured.", gbl.SelectedPlayer); } return(buy); }
DisplayPlayerStatusString(bool clearDisplay, int lineY, string text, Player player) /* sub_67788 */ { if (gbl.game_state == GameState.Combat) { seg037.draw8x8_clear_area(0x15, 0x26, lineY, 0x17); displayPlayerName(false, lineY, 0x17, player); Seg041.press_any_key(text, true, 10, 0x15, 0x26, lineY + 1, 0x17); } else { int line_y = gbl.displayPlayerStatusLine18 ? 18 : 17; seg037.draw8x8_clear_area(0x16, 0x26, line_y, 1); displayPlayerName(false, line_y + 1, 1, player); Seg041.press_any_key(text, true, 10, 0x16, 0x26, line_y + 2, 1); } if (clearDisplay == true) { Seg041.GameDelay(); ovr025.ClearPlayerTextArea(); } }
internal static void AfterCombatExpAndTreasure() // sub_2E7A2 { gbl.area2_ptr.field_58E = 0; gbl.byte_1AB14 = false; if (gbl.inDemo == false) { CleanupPlayersStateAfterCombat(); } gbl.game_state = GameState.AfterCombat; DeallocateNonTeamMemebers(); if (gbl.inDemo == false) { foreach (Player player in gbl.TeamList) { ovr025.reclac_player_values(player); } if (gbl.party_killed == false || gbl.combat_type == CombatType.duel) { if (gbl.party_fled == true) { gbl.items_pointer.Clear(); } if (gbl.inDemo == false) { distributeNpcTreasure(); displayCombatResults(gbl.exp_to_add); distributeCombatTreasure(); } gbl.items_pointer.Clear(); } else { gbl.area2_ptr.field_58E = 0x80; seg037.DrawFrame_Outer(); gbl.textXCol = 2; gbl.textYCol = 6; Seg041.press_any_key("The monsters rejoice for the party has been destroyed", true, 10, 0x16, 0x25, 5, 2); Seg041.DisplayAndPause("Press any key to continue", 13); } gbl.DelayBetweenCharacters = true; gbl.area2_ptr.field_6E0 = 0; gbl.area2_ptr.field_6E2 = 0; gbl.area2_ptr.field_6E4 = 0; gbl.area2_ptr.field_5C6 = 0; gbl.area2_ptr.isDuel = false; } }
internal static void distributeNpcTreasure() /*sub_2E50E*/ { bool treasureTaken = false; int npcParts = 0; int totalParts = 0; foreach (Player player in gbl.TeamList) { if (player.control_morale >= Control.NPC_Base && player.health_status == Status.okey) { npcParts += player.npcTreasureShareCount & 7; totalParts += player.npcTreasureShareCount & 7; } else { totalParts++; } } if (npcParts > 0) { treasureTaken = gbl.pooled_money.ScaleAll(npcParts / totalParts); } if (treasureTaken) { seg037.DrawFrame_Outer(); int yCol = 0; foreach (Player player in gbl.TeamList) { if (player.control_morale >= Control.NPC_Base && player.health_status == Status.okey && player.npcTreasureShareCount > 0) { string output = player.name + " takes and hides " + ((player.sex == 0) ? "his" : "her") + " share."; Seg041.press_any_key(output, true, 10, 0x16, 0x22, yCol + 5, 5); yCol += 2; } } ovr027.displayInput(false, 1, new MenuColorSet(15, 15, 15), "press <enter>/<return> to continue", string.Empty); } }
internal static void CombatDisplayPlayerSummary(Player player) /* hitpoint_ac */ { if (gbl.display_hitpoints_ac == true) { gbl.display_hitpoints_ac = false; seg037.draw8x8_clear_area(TextRegion.CombatSummary); int line = 1; DisplayPlayerStatusString(false, line, " ", player); line++; Seg041.DisplayString("Hitpoints", 0, 10, line + 1, 0x17); display_hp(false, line + 1, 0x21, player); line += 2; Seg041.DisplayString("AC", 0, 10, line + 1, 0x17); display_AC(line + 1, 0x1A, player); gbl.textYCol = line + 1; if (player.activeItems.primaryWeapon != null) { line += 2; /*var_1 = 0x17;*/ ItemDisplayNameBuild(false, false, 0, 0, player.activeItems.primaryWeapon); Seg041.press_any_key(player.activeItems.primaryWeapon.name, true, 10, line + 3, 0x26, line + 1, 0x17); } line = gbl.textYCol + 1; if (player.in_combat == false) { Seg041.DisplayString(ovr020.statusString[(int)player.health_status], 0, 15, line + 1, 0x17); } else if (player.IsHeld() == true) { Seg041.DisplayString("(Helpless)", 0, 15, line + 1, 0x17); } } }
internal static void sub_32200(Player player, int damage) /* sub_32200 */ { if (player.health_status != Status.dead) { string text; bool clear_text_area = false; if ((player.hit_point_current + 10) < damage) { text = string.Format(" {0} dies. ", player.name); } else { text = string.Format(" {0} is hit FOR {1} points of Damage.", player.name, damage); } if (gbl.textYCol > 0x16) { gbl.textYCol = 0x11; clear_text_area = true; Seg041.DisplayAndPause("press <enter>/<return> to continue", 15); } else { clear_text_area = false; } gbl.textXCol = 0x26; Seg041.press_any_key(text, clear_text_area, 15, 0x16, 0x26, 17, 1); ovr025.damage_player(damage, player); seg037.draw8x8_clear_area(0x0f, 0x26, 1, 0x11); ovr025.PartySummary(player); } }
internal static void end_game_text() { gbl.last_game_state = gbl.game_state; gbl.game_state = GameState.EndGame; Seg041.press_any_key(aTyranthraxusSp, true, 10, TextRegion.NormalBottom); Seg041.press_any_key(aStormGiant_You, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aTheAmuletOfLyt, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aYouOfYourVicto, false, 10, TextRegion.NormalBottom); Seg041.DisplayAndPause("Press any key to continue.", 13); Seg041.press_any_key(aAsYouReachForT, true, 10, TextRegion.NormalBottom); Seg041.press_any_key(aOutKeepTheGaun, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aWillUnleashDan, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aGauntletContac, false, 10, TextRegion.NormalBottom); ShowAnimation(1, 0x4a, 3, 3); Seg041.DisplayAndPause("Press any key to continue.", 13); ovr027.ClearPromptArea(); Seg041.press_any_key(aIAmTrappedWith, true, 10, TextRegion.NormalBottom); Seg041.press_any_key(aWhereArmiesHav, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aIsSlainThisDay, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aNothingness_, false, 10, TextRegion.NormalBottom); ShowAnimation(1, 0x4B, 3, 3); Seg041.DisplayAndPause("Press any key to continue.", 13); ovr027.ClearPromptArea(); Seg041.press_any_key(aYouAreCertainH, true, 10, TextRegion.NormalBottom); Seg041.press_any_key(aFinalBondFades, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aHasFinallyBeen, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aLast, false, 10, TextRegion.NormalBottom); gbl.area_ptr.picture_fade = 1; ShowAnimation((10 - gbl.game_speed_var) * 2, 0x4d, 3, 3); gbl.area_ptr.picture_fade = 0; ovr030.head_body(0x41, 0x41); ovr030.draw_head_and_body(true, 3, 3); Seg041.press_any_key(aTheKnightsOfMy, true, 10, TextRegion.NormalBottom); Seg041.press_any_key(aCongratulati_0, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aWithThePowerOf, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aThisFoulPlaceT, false, 10, TextRegion.NormalBottom); Seg041.DisplayAndPause("Press any key to continue.", 13); ovr027.ClearPromptArea(); ovr030.load_bigpic(0x7A); ovr030.draw_bigpic(); Seg041.press_any_key(aYouAreTeleport, true, 10, TextRegion.NormalBottom); Seg041.press_any_key(aHaveAlreadyBeg, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aGharriAndNacac, false, 10, TextRegion.NormalBottom); Seg041.press_any_key(aFromTheNearbyS, false, 10, TextRegion.NormalBottom); endgame_529F4(); gbl.game_state = gbl.last_game_state; ovr025.LoadPic(); }
internal static void temple_shop() { bool reloadPics = false; gbl.game_state = GameState.Shop; gbl.redrawBoarder = (gbl.area_ptr.inDungeon == 0); ovr025.LoadPic(); gbl.redrawBoarder = true; ovr025.PartySummary(gbl.SelectedPlayer); gbl.pooled_money.ClearAll(); bool stop_loop = false; do { bool items_present; bool money_present; ovr022.treasureOnGround(out items_present, out money_present); string text; if (money_present == true) { text = "Heal View Take Pool Share Appraise Exit"; } else { text = "Heal View Pool Appraise Exit"; } bool ctrl_key; char input_key = ovr027.displayInput(out ctrl_key, false, 1, gbl.defaultMenuColors, text, string.Empty); switch (input_key) { case 'H': if (ctrl_key == false) { temple_heal(); } break; case 'V': ovr020.viewPlayer(); break; case 'T': ovr022.TakePoolMoney(); break; case 'P': if (ctrl_key == false) { ovr022.poolMoney(); } break; case 'S': ovr022.share_pooled(); break; case 'A': reloadPics = ovr022.appraiseGemsJewels(); break; case 'E': ovr022.treasureOnGround(out items_present, out money_present); if (money_present == true) { string prompt = "~Yes ~No"; Seg041.press_any_key( "As you leave a priest says, \"Excuse me but you have left some money here\" ", true, 10, TextRegion.NormalBottom); Seg041.press_any_key("Do you want to go back and retrieve your money?", true, 10, TextRegion.NormalBottom); int menu_selected = ovr008.sub_317AA(false, false, gbl.defaultMenuColors, prompt, ""); if (menu_selected == 1) { stop_loop = true; } else { seg037.draw8x8_clear_area(0x16, 0x26, 17, 1); } } else { stop_loop = true; } break; case 'G': ovr020.scroll_team_list(input_key); break; case 'O': ovr020.scroll_team_list(input_key); break; } if (input_key == 'B' || input_key == 'T') { ovr025.LoadPic(); } else if (reloadPics == true) { ovr025.LoadPic(); reloadPics = false; } ovr025.PartySummary(gbl.SelectedPlayer); } while (stop_loop == false); }
internal static void CityShop() // sub_2F6E7 { bool reloadPics = false; /* Simeon */ bool items_on_ground; bool money_on_ground; char inputKey; gbl.game_state = GameState.Shop; gbl.redrawBoarder = (gbl.area_ptr.inDungeon == 0); ovr025.LoadPic(); gbl.redrawBoarder = true; ovr025.PartySummary(gbl.SelectedPlayer); gbl.pooled_money.ClearAll(); bool exitShop = false; gbl.items_pointer.ForEach(item => ovr025.ItemDisplayNameBuild(false, false, 0, 0, item)); do { ovr022.treasureOnGround(out items_on_ground, out money_on_ground); string text; if (money_on_ground == true) { text = "Buy View Take Pool Share Appraise Exit"; } else { text = "Buy View Pool Appraise Exit"; } bool controlKey; inputKey = ovr027.displayInput(out controlKey, false, 1, gbl.defaultMenuColors, text, string.Empty); switch (inputKey) { case 'B': shop_buy(); break; case 'V': ovr020.viewPlayer(); break; case 'T': ovr022.TakePoolMoney(); break; case 'P': if (controlKey == false) { ovr022.poolMoney(); } break; case 'S': ovr022.share_pooled(); break; case 'A': reloadPics = ovr022.appraiseGemsJewels(); break; case 'E': ovr022.treasureOnGround(out items_on_ground, out money_on_ground); if (money_on_ground == true) { Seg041.press_any_key( "As you Leave the Shopkeeper says, \"Excuse me but you have Left Some Money here.\" ", true, 10, TextRegion.NormalBottom); Seg041.press_any_key("Do you want to go back and get your Money?", false, 15, TextRegion.NormalBottom); int menu_selected = ovr008.sub_317AA(false, false, gbl.defaultMenuColors, "~Yes ~No", ""); if (menu_selected == 1) { exitShop = true; } else { seg037.draw8x8_clear_area(0x16, 0x26, 17, 1); } } else { exitShop = true; } break; case 'G': ovr020.scroll_team_list(inputKey); break; case 'O': ovr020.scroll_team_list(inputKey); break; } if (inputKey == 'B' || inputKey == 'T') { ovr025.LoadPic(); } else if (reloadPics == true) { ovr025.LoadPic(); reloadPics = false; } ovr025.PartySummary(gbl.SelectedPlayer); } while (exitShop == false); }
internal static void distributeCombatTreasure() /* sub_2E0C3 */ { byte spellId = 0; /* Simeon */ ovr025.LoadPic(); bool done = false; do { bool items_present; bool money_present; ovr022.treasureOnGround(out items_present, out money_present); string text = "View Pool Exit"; string suffix = " Exit"; bool can_detect_magic = false; if (items_present == true) { foreach (int id in gbl.SelectedPlayer.spellList.IdList()) { if ((id == 5 || id == 11 || id == 0x4d) && gbl.SelectedPlayer.in_combat == true) { can_detect_magic = true; spellId = (byte)id; break; } } } if (can_detect_magic == true) { suffix = " Detect Exit"; } if (money_present == true) { text = "View Take Pool Share" + suffix; } else if (items_present == true) { text = "View Take Pool" + suffix; } bool ctrl_key; char input_key = ovr027.displayInput(out ctrl_key, true, 1, gbl.defaultMenuColors, text, ""); switch (input_key) { case 'V': ovr020.viewPlayer(); break; case 'T': take_treasure(ref items_present, ref money_present); break; case 'P': if (ctrl_key == false) { ovr022.poolMoney(); } break; case 'S': ovr022.share_pooled(); break; case 'D': ovr023.sub_5D2E1(false, QuickFight.False, spellId); break; case 'E': case '\0': ovr022.treasureOnGround(out items_present, out money_present); if (money_present == true || items_present == true) { Seg041.press_any_key("There is still treasure left. ", true, 10, TextRegion.NormalBottom); Seg041.press_any_key("Do you want to go back and claim your treasure?", false, 15, TextRegion.NormalBottom); int menu_selected = ovr008.sub_317AA(false, false, gbl.defaultMenuColors, "~Yes ~No", ""); if (menu_selected == 1) { done = true; } else { seg037.draw8x8_clear_area(0x16, 0x26, 17, 1); } } else { done = true; } break; case 'G': ovr020.scroll_team_list(input_key); ovr025.PartySummary(gbl.SelectedPlayer); break; case 'O': ovr020.scroll_team_list(input_key); ovr025.PartySummary(gbl.SelectedPlayer); break; } } while (done == false); }