Exemplo n.º 1
0
        public static void AddTreasureAndBountiesPage(TextsDialog textsDialog, Player player)
        {
            var t = new StringBuilder();

            var saveData = player.GetAdventureSaveData();

            t.AppendLine("<color=orange><size=30>$mod_epicloot_merchant_treasuremaps</size></color>");
            t.AppendLine();

            var sortedTreasureMaps = saveData.TreasureMaps.Where(x => x.State == TreasureMapState.Purchased).OrderBy(x => GetBiomeOrder(x.Biome));

            foreach (var treasureMap in sortedTreasureMaps)
            {
                t.AppendLine(Localization.instance.Localize($"$mod_epicloot_merchant_treasuremaps: <color={GetBiomeColor(treasureMap.Biome)}>$biome_{treasureMap.Biome.ToString().ToLower()} #{treasureMap.Interval + 1}</color>"));
            }

            t.AppendLine();
            t.AppendLine();
            t.AppendLine("<color=orange><size=30>$mod_epicloot_activebounties</size></color>");
            t.AppendLine();

            var sortedBounties = saveData.Bounties.OrderBy(x => x.State);

            foreach (var bounty in sortedBounties)
            {
                if (bounty.State == BountyState.Claimed)
                {
                    continue;
                }

                var targetName = AdventureDataManager.GetBountyName(bounty);
                t.AppendLine($"<size=24>{targetName}</size>");
                t.Append($"  <color=silver>$mod_epicloot_activebounties_classification: <color=#d66660>{AdventureDataManager.GetMonsterName(bounty.Target.MonsterID)}</color>, ");
                t.AppendLine($" $mod_epicloot_activebounties_biome: <color={GetBiomeColor(bounty.Biome)}>$biome_{bounty.Biome.ToString().ToLower()}</color></color>");

                var status = "";
                switch (bounty.State)
                {
                case BountyState.InProgress:
                    status = ("<color=#00f0ff>$mod_epicloot_bounties_tooltip_inprogress</color>");
                    break;

                case BountyState.Complete:
                    status = ("<color=#70f56c>$mod_epicloot_bounties_tooltip_vanquished</color>");
                    break;
                }

                t.Append($"  <color=silver>$mod_epicloot_bounties_tooltip_status {status}");

                var iron = bounty.RewardIron;
                var gold = bounty.RewardGold;
                t.AppendLine($", $mod_epicloot_bounties_tooltip_rewards {(iron > 0 ? $"<color=white>{MerchantPanel.GetIronBountyTokenName()} x{iron}</color>" : "")}{(iron > 0 && gold > 0 ? ", " : "")}{(gold > 0 ? $"<color=#f5da53>{MerchantPanel.GetGoldBountyTokenName()} x{gold}</color>" : "")}</color>");
                t.AppendLine();
            }

            textsDialog.m_texts.Insert(EpicLoot.HasAuga ? 2 : 4,
                                       new TextsDialog.TextInfo(
                                           Localization.instance.Localize($"{EpicLoot.GetMagicEffectPip(false)} $mod_epicloot_adventure_title"),
                                           Localization.instance.Localize(t.ToString())));
        }
Exemplo n.º 2
0
        private static void AddTreasureAndBountiesPage(TextsDialog textsDialog, Player player)
        {
            var t = new StringBuilder();

            var saveData = player.GetAdventureSaveData();

            t.AppendLine("<color=orange><size=30>Treasure Maps</size></color>");
            t.AppendLine();

            var sortedTreasureMaps = saveData.TreasureMaps.Where(x => x.State == TreasureMapState.Purchased).OrderBy(x => GetBiomeOrder(x.Biome));

            foreach (var treasureMap in sortedTreasureMaps)
            {
                t.AppendLine(Localization.instance.Localize($"Treasure Map: <color={GetBiomeColor(treasureMap.Biome)}>$biome_{treasureMap.Biome.ToString().ToLower()} #{treasureMap.Interval + 1}</color>"));
            }

            t.AppendLine();
            t.AppendLine();
            t.AppendLine("<color=orange><size=30>Active Bounties</size></color>");
            t.AppendLine();

            var sortedBounties = saveData.Bounties.OrderBy(x => x.State);

            foreach (var bounty in sortedBounties)
            {
                if (bounty.State == BountyState.Claimed)
                {
                    continue;
                }

                var targetName = AdventureDataManager.GetBountyName(bounty);
                t.AppendLine($"<size=24>{targetName}</size>");
                t.Append($"  <color=silver>Classification: <color=#d66660>{AdventureDataManager.GetMonsterName(bounty.Target.MonsterID)}</color>, ");
                t.AppendLine($" Biome: <color={GetBiomeColor(bounty.Biome)}>$biome_{bounty.Biome.ToString().ToLower()}</color>");

                var status = "";
                switch (bounty.State)
                {
                case BountyState.InProgress:
                    status = ("<color=#00f0ff>In Progress</color>");
                    break;

                case BountyState.Complete:
                    status = ("<color=#70f56c>Vanquished!</color>");
                    break;
                }

                t.Append($"  Status: {status}");

                var iron = bounty.RewardIron;
                var gold = bounty.RewardGold;
                t.AppendLine($", Reward: {(iron > 0 ? $"<color=white>{MerchantPanel.GetIronBountyTokenName()} x{iron}</color>" : "")}{(iron > 0 && gold > 0 ? ", " : "")}{(gold > 0 ? $"<color=#f5da53>{MerchantPanel.GetGoldBountyTokenName()} x{gold}</color>" : "")}</color>");
                t.AppendLine();
            }

            textsDialog.m_texts.Insert(3, new TextsDialog.TextInfo("Treasure & Bounties", t.ToString()));
        }
Exemplo n.º 3
0
 public static void InitializeConfig()
 {
     LootRoller.Initialize(_lootConfigFile.Value);
     MagicItemEffectDefinitions.Initialize(_magicEffectsConfigFile.Value);
     GatedItemTypeHelper.Initialize(_itemInfoConfigFile.Value);
     RecipesHelper.Initialize(_recipesConfigFile.Value);
     EnchantCostsHelper.Initialize(_enchantCostsConfigFile.Value);
     MagicItemNames.Initialize(_itemNamesConfigFile.Value);
     AdventureDataManager.Initialize(_adventureDataConfigFile.Value);
 }
Exemplo n.º 4
0
 public static bool Prefix(ZNet __instance)
 {
     AdventureDataManager.OnWorldSave();
     return(true);
 }
Exemplo n.º 5
0
 public static void Postfix(ZNet __instance)
 {
     AdventureDataManager.OnZNetDestroyed();
 }
Exemplo n.º 6
0
 public static void Postfix(ZNet __instance)
 {
     AdventureDataManager.OnZNetStart();
 }