diff --git a/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs b/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs index 9f78c1a0..0a89754a 100644 --- a/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs +++ b/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs @@ -9,6 +9,7 @@ using StardustCore.Events.Preconditions; using StardustCore.Events.Preconditions.TimeSpecific; using StardewValley; using Microsoft.Xna.Framework; +using StardustCore.Events.Preconditions.PlayerSpecific; namespace Omegasis.HappyBirthday.Framework { @@ -22,20 +23,34 @@ namespace Omegasis.HappyBirthday.Framework conditions.Add(new FarmerBirthdayPrecondition()); conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter"))); conditions.Add(new TimePrecondition(600, 2600)); + //conditions.Add(new HasUnlockedCommunityCenter()); //Infered by the fact that you must enter the community center to trigger this event anyways. EventHelper e = new EventHelper("CommunityCenterBirthday",19950, conditions, new EventStartData(EventStartData.MusicToPlayType.Continue, 32, 16, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up),new List())); - e.AddInJunimoActor("Juni", new Microsoft.Xna.Framework.Vector2(32, 14), Color.Blue); + e.AddInJunimoActor("Juni", new Microsoft.Xna.Framework.Vector2(32, 14), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor()); + e.AddInJunimoActor("Juni2", new Microsoft.Xna.Framework.Vector2(30, 15), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor()); + e.AddInJunimoActor("Juni3", new Microsoft.Xna.Framework.Vector2(34, 15), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor()); + + e.globalFadeIn(); e.moveFarmerUp(6, EventHelper.FacingDirection.Up, false); - e.ViewportLerpTileOffset(new Microsoft.Xna.Framework.Point(0,-6),60*6,true); - e.moveActorLeft("Juni", 1, EventHelper.FacingDirection.Down, false); + //e.moveActorLeft("Juni", 1, EventHelper.FacingDirection.Down, false); + e.animate("Juni", true, true, 70, new List() + { + 28, + 29, + 30, + 31 + }); + + // + e.playSound("junimoMeep1"); //e.addObjectToPlayersInventory(64, 22,true); //e.addTemporaryActor_NPC("Junimo", 16, 16, 32, 14, EventHelper.FacingDirection.Down, false); - + e.ViewportLerpTileOffset(new Microsoft.Xna.Framework.Point(0, -6), 60 * 6, false); e.showMessage("Community center birthday here."); //Notes diff --git a/GeneralMods/StardustCore/Events/EventHelper.cs b/GeneralMods/StardustCore/Events/EventHelper.cs index 86f89d9b..ef4747f0 100644 --- a/GeneralMods/StardustCore/Events/EventHelper.cs +++ b/GeneralMods/StardustCore/Events/EventHelper.cs @@ -672,9 +672,9 @@ namespace StardustCore.Events b.Append("animate "); b.Append(ActorName); b.Append(" "); - b.Append(Flip); + b.Append(Flip.ToString().ToLowerInvariant()); b.Append(" "); - b.Append(Loop); + b.Append(Loop.ToString().ToLowerInvariant()); b.Append(" "); b.Append(FrameDuration); b.Append(" "); diff --git a/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/HasUnlockedCommunityCenter.cs b/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/HasUnlockedCommunityCenter.cs new file mode 100644 index 00000000..4e108e75 --- /dev/null +++ b/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/HasUnlockedCommunityCenter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using StardewValley; + +namespace StardustCore.Events.Preconditions.PlayerSpecific +{ + public class HasUnlockedCommunityCenter:EventPrecondition + { + + + public HasUnlockedCommunityCenter() + { + + } + + public override bool meetsCondition() + { + return Game1.player.eventsSeen.Contains(611439); + } + } +} diff --git a/GeneralMods/StardustCore/IlluminateFramework/Colors.cs b/GeneralMods/StardustCore/IlluminateFramework/Colors.cs index 18713cbc..65a18f44 100644 --- a/GeneralMods/StardustCore/IlluminateFramework/Colors.cs +++ b/GeneralMods/StardustCore/IlluminateFramework/Colors.cs @@ -608,6 +608,34 @@ namespace StardustCore.IlluminateFramework return new Color(r, g, b, a); } + /// + /// Gets a random junimo color from the possible junimo colors. + /// + /// + public static Color getRandomJunimoColor() + { + List colors = new List(); + colors.Add(Color.Red); + colors.Add(Color.Goldenrod); + colors.Add(Color.Yellow); + colors.Add(Color.Lime); + colors.Add(Color.MediumPurple); + colors.Add(Color.Salmon); + colors.Add(Color.White); + colors.Add(Color.LimeGreen); + colors.Add(Color.Orange); + colors.Add(Color.LightGreen); + colors.Add(Color.Tan); + colors.Add(Color.GreenYellow); + colors.Add(Color.LawnGreen); + colors.Add(Color.PaleGreen); + colors.Add(Color.Turquoise); + colors.Add(Color.Gold); + colors.Add(Color.BlanchedAlmond); + colors.Add(new Color(160, 20, 220)); //??? + return colors[Game1.random.Next(0, colors.Count)]; + } + /// Invert the color passed in. public static Color invertColor(Color c, int alpha = 255) { diff --git a/GeneralMods/StardustCore/StardustCore.csproj b/GeneralMods/StardustCore/StardustCore.csproj index 4dc41659..641f2bdb 100644 --- a/GeneralMods/StardustCore/StardustCore.csproj +++ b/GeneralMods/StardustCore/StardustCore.csproj @@ -114,6 +114,7 @@ +