public static void AnimateMessingStart(Body b, bool voluntary, bool inUnderwear, bool inToilet) { Game1.playSound("slosh"); if (b.sleeping || !voluntary && !RegressionMod.config.AlwaysNoticeAccidents && (double)b.bowelContinence + 0.449999988079071 <= RegressionMod.rnd.NextDouble()) { return; } if (!inUnderwear) { if (inToilet) { Animations.Say(Animations.t.Poop_Toilet, b); } else { Animations.Say(Animations.t.Poop_Voluntary, b); } } else if (voluntary) { Animations.Say(Animations.t.Mess_Voluntary, b); } else { Animations.Say(Animations.t.Mess_Accident, b); } Animations.player1.forceCanMove(); Animations.player1.completelyStopAnimatingOrDoingAction(); Animations.player1.jitterStrength = 1f; Game1.currentLocation.temporarySprites.Add(new TemporaryAnimatedSprite("TileSheets\\animations", new Microsoft.Xna.Framework.Rectangle(192, 1152, Game1.tileSize, Game1.tileSize), 50f, 4, 0, (Vector2)Animations.player1.position - new Vector2(Animations.player1.FacingDirection == 1 ? 0.0f : (float)-Game1.tileSize, (float)(Game1.tileSize * 2)), false, Animations.player1.FacingDirection == 1, (float)Animations.player1.getStandingY() / 10000f, 0.01f, Microsoft.Xna.Framework.Color.White, 1f, 0.0f, 0.0f, 0.0f, false)); Animations.player1.doEmote(12, false); Animations.player1.freezePause = 20000; Animations.player1.CanMove = false; }
public static void AnimatePoopAttempt(Body b, bool inUnderwear, bool inToilet) { if (inUnderwear) { Animations.Say(Animations.t.Mess_Attempt, b); } else if (inToilet) { Animations.Say(Animations.t.Poop_Toilet_Attempt, b); } else { Animations.Say(Animations.t.Poop_Attempt, b); } }
public static void AnimatePeeAttempt(Body b, bool inUnderwear, bool inToilet) { if (inUnderwear) { Animations.Say(Animations.t.Wet_Attempt, b); } else if (inToilet) { Animations.Say(Animations.t.Pee_Toilet_Attempt, b); } else { Animations.Say(Animations.t.Pee_Attempt, b); } }
//Switches to new underwear and returns old underwear public Underwear ChangeUnderwear(Underwear underwear) { Underwear oldUnderwear = this.underwear; this.underwear = underwear; //TODO: Make this take from clothes bottoms = new Underwear((int)UnderwearType.Pants); CleanPants(); //RegressionMod.monitor.Log(underwear.name, StardewModdingAPI.LogLevel.Debug); Animations.Say(RegressionMod.data.Change, this); return(oldUnderwear); }
public static void AnimateDrinking(bool waterSource = false) { if (Animations.player1.getFacingDirection() != 2) { Animations.player1.faceDirection(2); } Animations.player1.forceCanMove(); Animations.player1.completelyStopAnimatingOrDoingAction(); Animations.player1.FarmerSprite.animateOnce(294, 80f, 8, new AnimatedSprite.endOfAnimationBehavior(Animations.EndDrinking)); Animations.player1.freezePause = 20000; Animations.player1.CanMove = false; if (!waterSource) { return; } Animations.Say(Animations.t.Drink_Water_Source, (Body)null); }
public static void AnimateWettingStart(Body b, bool voluntary, bool inUnderwear, bool inToilet) { Game1.playSound("wateringCan"); if (b.sleeping || !voluntary && !RegressionMod.config.AlwaysNoticeAccidents && (double)b.bladderContinence + 0.200000002980232 <= RegressionMod.rnd.NextDouble()) { return; } if (!inUnderwear) { if (inToilet) { Animations.Say(Animations.t.Pee_Toilet, b); } else { Animations.Say(Animations.t.Pee_Voluntary, b); } } else if (voluntary) { Animations.Say(Animations.t.Wet_Voluntary, b); } else { Animations.Say(Animations.t.Wet_Accident, b); } Animations.player1.forceCanMove(); Animations.player1.completelyStopAnimatingOrDoingAction(); Animations.player1.jitterStrength = 0.5f; Animations.player1.doEmote(28, false); if (!inUnderwear) { Animations.player1.currentLocation.temporarySprites.Add(new TemporaryAnimatedSprite(13, (Vector2)Game1.player.position, Microsoft.Xna.Framework.Color.White, 10, Game1.random.NextDouble() < 0.5, 70f, 0, Game1.tileSize, 0.05f, -1, 0)); if ((Animations.player1.currentLocation.terrainFeatures).ContainsKey(Animations.player1.getTileLocation()) && (Animations.player1.currentLocation.terrainFeatures)[Animations.player1.getTileLocation()] is HoeDirt terrainFeature) { terrainFeature.performToolAction((Tool)waterCan, 0, player1.Position, player1.currentLocation); } } Animations.player1.freezePause = 20000; Animations.player1.CanMove = false; }
public static void CheckUnderwear(Body b) { Animations.Say(Animations.t.PeekWaistband[0] + " " + Strings.DescribeUnderwear(b.underwear, (string)null) + ".", b); }
public static void CheckPants(Body b) { Animations.Say(Animations.t.LookPants[0] + " " + Strings.DescribeUnderwear(b.bottoms, (string)null) + ".", b); }
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); }
public static void Say(string[] msgs, Body b = null) { Animations.Say(Strings.RandString(msgs), b); }
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); }