Exemplo n.º 1
0
        private void TakeAndIdentifyFlag()
        {
            if (!PlayerHasUnidentifiedFlagInInventory(Game1.player))
            {
                return;
            }

            // Get the count of possible flags
            int uniqueFlagTypes = Enum.GetNames(typeof(FlagType)).Length;

            // Remove the ancient flag, then add the randomly identified one
            AncientFlag ancientFlag = Game1.player.items.FirstOrDefault(i => i is AncientFlag && (i as AncientFlag).FlagType == FlagType.Unknown) as AncientFlag;

            Game1.player.removeItemFromInventory(ancientFlag);
            Game1.player.addItemByMenuIfNecessary(new AncientFlag((FlagType)Game1.random.Next(1, uniqueFlagTypes)));
        }
Exemplo n.º 2
0
        private void WhatFlagIsHoisted(Farmer who)
        {
            string flagName = AncientFlag.GetFlagName(ModEntry.GetHoistedFlag());

            if (ModEntry.modHelper.Translation.LocaleEnum == LocalizedContentManager.LanguageCode.en)
            {
                flagName = flagName.Replace("The", "the");
                if (!flagName.Contains("the"))
                {
                    flagName = String.Concat("the", " ", flagName);
                }
            }

            this.CurrentDialogue.Push(new Dialogue(GetDialogue("dialogue.what_flag_is_hoisted" + (ModEntry.GetHoistedFlag() == FlagType.Unknown ? "_None" : ""), flagName), this));
            Game1.drawDialogue(this);
        }