示例#1
0
 public static void CheckPants(Body b)
 {
     Animations.Say(Animations.t.LookPants[0] + " " + Strings.DescribeUnderwear(b.bottoms, (string)null) + ".", b);
 }
示例#2
0
 public static void CheckUnderwear(Body b)
 {
     Animations.Say(Animations.t.PeekWaistband[0] + " " + Strings.DescribeUnderwear(b.underwear, (string)null) + ".", b);
 }
示例#3
0
        public static bool HandleVillager(Body body, bool mess, bool inUnderwear, bool overflow, bool attempt = false, int baseFriendshipLoss = 20, int radius = 3)
        {
            //List of NPCs that don't care if they see you wet/mess
            //TODO: Make an ABDL NPCs list
            List <string> IgnoreNPC = new List <string>()
            {
                "Linus",
                "Krobus",
                "Dwarf"
            };

            string animalName     = "";
            int    friendshipLoss = -baseFriendshipLoss;

            //If it's a mess radius and friendship loss are doubled
            if (mess)
            {
                radius         *= 2;
                friendshipLoss *= 2;
            }

            //If it's on the ground radius times 4, friendship loss doubled
            if (!inUnderwear)
            {
                radius         *= 4;
                friendshipLoss *= 2;
            }

            //If it's just an attempt then radius is unchanged and friendship loss is halved
            if (attempt)
            {
                friendshipLoss /= 2;
            }

            //If it overflows the radius is doubled
            if (overflow)
            {
                radius *= 2;
            }

            //Max -> radius * 18, friendshipLoss * 4 for mess on the ground

            //If no one is around or they are from  who don't care then don't do anything
            if (!(Utility.isThereAFarmerOrCharacterWithinDistance(Animations.player1.getTileLocation(), radius, Game1.currentLocation) is NPC npc) || IgnoreNPC.Contains((string)npc.name))
            {
                return(false);
            }

            //Current heart level with the npc that saw player
            int heartLevelForNpc = Animations.player1.getFriendshipHeartLevelForNPC(npc.getName());

            //TODO: test better bedmas
            int heartLossAmount = friendshipLoss + (heartLevelForNpc - 2) / 2 * baseFriendshipLoss;

            List <string> NPCString = new List <string>();

            //Is the npc an animal
            if (npc is Horse || npc is Cat || npc is Dog)
            {
                NPCString.Add("animal");
                animalName += string.Format("{0}: ", (object)npc.name);
            }
            else
            {
                //Add age then name
                switch (npc.age)
                {
                case 0:
                    NPCString.Add("adult");
                    break;

                case 1:
                    NPCString.Add("teen");
                    break;

                case 2:
                    NPCString.Add("kid");
                    break;
                }
                NPCString.Add(npc.getName().ToLower());
            }

            string reactionType;

            if (!inUnderwear)
            {
                reactionType = attempt ? "ground_attempt" : "ground";
            }
            else
            {
                //Animals and villagers above 8 hearts don't lose hearts
                if (NPCString.Contains("animal"))
                {
                    reactionType    = "soiled_nice";
                    heartLossAmount = 0;
                }
                else if (heartLevelForNpc >= 8)
                {
                    reactionType    = "soiled_verynice";
                    heartLossAmount = 0;
                }
                else
                {
                    reactionType = heartLossAmount < 0 ? "soiled_mean" : "soiled_nice";
                }

                //ABDL NPCs don't lose hearts
                if (npc.getName() == "Abigail" || npc.getName() == "Jodi")
                {
                    heartLossAmount = 0;
                }
            }

            if (RegressionMod.config.Debug)
            {
                Animations.Say(string.Format("{0} ({1}) changed friendship from {2} by {3}.", (object)npc.name, (object)(int)npc.age, (object)heartLevelForNpc, (object)heartLossAmount), (Body)null);
            }

            if (heartLossAmount < 0 && !RegressionMod.config.NoFriendshipPenalty)
            {
                Animations.player1.changeFriendship(heartLossAmount, npc);
            }

            List <string> reactionStrings = new List <string>();

            foreach (string npcType in NPCString)
            {
                Dictionary <string, string[]> dictionary;
                string[] strArray;

                if (Animations.t.Villager_Reactions.TryGetValue(npcType, out dictionary) && dictionary.TryGetValue(reactionType, out strArray))
                {
                    reactionStrings.AddRange(strArray);
                }
            }

            string dialogueString = animalName + Strings.InsertVariables(
                Strings.ReplaceAndOr(Strings.RandString(reactionStrings.ToArray()), !mess, mess, "&"),
                body, (Underwear)null);

            npc.setNewDialogue(dialogueString, true, true);
            Game1.drawDialogue(npc);
            return(true);
        }
示例#4
0
 public static void Write(string[] msgs, Body b = null)
 {
     Animations.Write(Strings.RandString(msgs), b);
 }
示例#5
0
 public static void DrawUnderwearIcon(Underwear underwear, int x, int y)
 {
     if (underwear.CleanStatus == 1)
     {
         Game1.spriteBatch.Draw(Animations.sprites, new Microsoft.Xna.Framework.Rectangle(x, y, 64, 64), new Microsoft.Xna.Framework.Rectangle?(Animations.UnderwearRectangle(underwear, "drying", 16)), Microsoft.Xna.Framework.Color.White);
     }
     else
     {
         Game1.spriteBatch.Draw(Animations.sprites, new Microsoft.Xna.Framework.Rectangle(x, y, 64, 64), new Microsoft.Xna.Framework.Rectangle?(Animations.UnderwearRectangle(underwear, "clean", 16)), Microsoft.Xna.Framework.Color.White);
         int height1 = Math.Min((int)((double)underwear.Wetness / (double)underwear.absorbency * 16.0), 16);
         int height2 = Math.Min((int)((double)underwear.Messiness / (double)underwear.containment * 16.0), 16);
         if (height1 > 0 && height1 >= height2)
         {
             Game1.spriteBatch.Draw(Animations.sprites, new Microsoft.Xna.Framework.Rectangle(x, y + (64 - height1 * 4), 64, height1 * 4), new Microsoft.Xna.Framework.Rectangle?(Animations.UnderwearRectangle(underwear, "wet", height1)), Microsoft.Xna.Framework.Color.White);
         }
         if (height2 > 0)
         {
             Game1.spriteBatch.Draw(Animations.sprites, new Microsoft.Xna.Framework.Rectangle(x, y + (64 - height2 * 4), 64, height2 * 4), new Microsoft.Xna.Framework.Rectangle?(Animations.UnderwearRectangle(underwear, "messy", height2)), Microsoft.Xna.Framework.Color.White);
         }
         if (height1 > 0 && height1 < height2)
         {
             Game1.spriteBatch.Draw(Animations.sprites, new Microsoft.Xna.Framework.Rectangle(x, y + (64 - height1 * 4), 64, height1 * 4), new Microsoft.Xna.Framework.Rectangle?(Animations.UnderwearRectangle(underwear, "wet", height1)), Microsoft.Xna.Framework.Color.White);
         }
         if (Game1.getMouseX() >= x && Game1.getMouseX() <= x + 64 && Game1.getMouseY() >= y && Game1.getMouseY() <= y + 64)
         {
             string source = Strings.DescribeUnderwear(underwear, (string)null);
             string text   = source.First <char>().ToString().ToUpper() + source.Substring(1);
             int    width  = Game1.tileSize * 6 + Game1.tileSize / 6;
             IClickableMenu.drawHoverText(Game1.spriteBatch, Game1.parseText(text, Game1.tinyFont, width), Game1.smallFont, 0, 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null);
         }
     }
 }
示例#6
0
 public static void Say(string[] msgs, Body b = null)
 {
     Animations.Say(Strings.RandString(msgs), b);
 }
示例#7
0
 public static Texture2D LoadTexture(string file)
 {
     return(Animations.Bitmap2Texture(new Bitmap(Image.FromFile(Path.Combine(RegressionMod.helper.DirectoryPath, "Assets", file)))));
 }
示例#8
0
 public static void AnimateWashingUnderwear(Underwear underwear)
 {
     Animations.Write(Strings.InsertVariables(Strings.RandString(Animations.t.Washing_Underwear), (Body)null, underwear), (Body)null);
 }
示例#9
0
 public static void AnimateDryingBedding(Body b)
 {
     Animations.Write(Animations.t.Bedding_Still_Wet, b);
 }
示例#10
0
 public static void AnimateStillSoiled(Body b)
 {
     Animations.Say(Strings.ReplaceAndOr(Strings.RandString(Animations.t.Still_Soiled), (double)b.underwear.Wetness > 0.0, (double)b.underwear.Messiness > 0.0, "&"), b);
 }
示例#11
0
 //Public access to add drink to body
 public void DrinkWaterSource()
 {
     AddWater(Math.Max(maxWater - water, Body.glassOfWater), 0.65f);
     Animations.AnimateDrinking(true);
 }