예제 #1
0
 /// <summary>
 /// Reloads the shop tiers of all instance meta shop controllers
 /// </summary>
 public static void ReloadInstanceMetaShopTiers()
 {
     foreach (MetaShopController meta in UnityEngine.Object.FindObjectsOfType <MetaShopController>())
     {
         meta.metaShopTiers = SaveTools.CloneList(BaseMetaShopController.metaShopTiers);
     }
 }
예제 #2
0
        /// <summary>
        /// Builds a new <see cref="MonsterHuntQuest"/> and adds it to the quest list
        /// </summary>
        /// <param name="questFlag">The flag that will be used to check if the quest is complete and will be set to true when the quest is completed</param>
        /// <param name="questIntroConversation">The list of text Frifle will say when giving the player the quest</param>
        /// <param name="targetEnemyName">The name that will be used when Frifle or Grey Mauser say how much enemies are remaining</param>
        /// <param name="targetEnemies">List of enemies that can progress the quest</param>
        /// <param name="numberKillsRequired">Amount of kills that are required for the quest to be completed</param>
        /// <param name="rewardFlags">Flags that will be set when the player talks to Frifle or the Grey Mauser after completing the quest</param>
        /// <param name="customRewardFlags">Custom flags that will be set when the player talks to Frifle or the Grey Mauser after completing the quest</param>
        /// <param name="requiredState">Enemy state that will be required for the quest to count the kill</param>
        /// <param name="validTargetCheck">Custom check function that will be used to check if a kill is valid</param>
        /// <param name="index">Index to add the quest at</param>
        /// <returns>The built quest</returns>
        public static MonsterHuntQuest AddQuest(GungeonFlags questFlag, List <string> questIntroConversation, string targetEnemyName, List <AIActor> targetEnemies, int numberKillsRequired, List <GungeonFlags> rewardFlags = null,
                                                List <CustomDungeonFlags> customRewardFlags = null, JammedEnemyState requiredState = JammedEnemyState.NoCheck, Func <AIActor, MonsterHuntProgress, bool> validTargetCheck = null, int?index = null)
        {
            string questStringPrefix      = "#CUSTOMQUEST_" + questFlag.ToString() + "_" + Guid.NewGuid().ToString().ToUpper();
            string questIntroString       = questStringPrefix + "_INTRO";
            string questTargetEnemyString = questStringPrefix + "_TARGET";

            ETGMod.Databases.Strings.Core.SetComplex(questIntroString, questIntroConversation.ToArray());
            ETGMod.Databases.Strings.Core.Set(questTargetEnemyString, targetEnemyName);
            return(AddQuest(new CustomHuntQuest()
            {
                QuestFlag = questFlag,
                QuestIntroString = questIntroString,
                TargetStringKey = questTargetEnemyString,
                ValidTargetMonsterGuids = targetEnemies.Convert(delegate(AIActor enemy) { return enemy.EnemyGuid; }),
                FlagsToSetUponReward = rewardFlags != null ? SaveTools.CloneList(rewardFlags) : new List <GungeonFlags>(),
                CustomFlagsToSetUponReward = customRewardFlags != null ? SaveTools.CloneList(customRewardFlags) : new List <CustomDungeonFlags>(),
                NumberKillsRequired = numberKillsRequired,
                RequiredEnemyState = requiredState,
                ValidTargetCheck = validTargetCheck,
                CustomQuestFlag = CustomDungeonFlags.NONE
            }, index));
        }