diff --git a/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs b/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs index d16ff1d5..1637a1de 100644 --- a/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs +++ b/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs @@ -20,9 +20,9 @@ namespace Omegasis.HappyBirthday.Framework conditions.Add(new FarmerBirthdayPrecondition()); conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter"))); conditions.Add(new TimePrecondition(600, 2600)); - EventHelper e = new EventHelper("CommunityCenterBirthday",19950, conditions, new EventStartData(EventStartData.MusicToPlayType.Continue, 10, 10, new EventStartData.FarmerData(10, 10, EventHelper.FacingDirection.Up),new List())); - e.setViewportPosition(10, 10); + EventHelper e = new EventHelper("CommunityCenterBirthday",19950, conditions, new EventStartData(EventStartData.MusicToPlayType.Continue, 32, 22, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up),new List())); e.globalFadeIn(); + e.moveFarmerUp(6, EventHelper.FacingDirection.Up, false); e.showMessage("Community center birthday here."); e.end(); diff --git a/GeneralMods/HappyBirthday/Framework/Events/EventHelper.cs b/GeneralMods/HappyBirthday/Framework/Events/EventHelper.cs index 584b280c..1a36f5bd 100644 --- a/GeneralMods/HappyBirthday/Framework/Events/EventHelper.cs +++ b/GeneralMods/HappyBirthday/Framework/Events/EventHelper.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; using Microsoft.Xna.Framework; using Omegasis.HappyBirthday.Framework.Events.Preconditions; using Omegasis.HappyBirthday.Framework.Events.Preconditions.TimeSpecific; @@ -1190,6 +1188,63 @@ namespace Omegasis.HappyBirthday.Framework.Events this.add(b); } + public virtual void moveNPCUp(NPC npc, int TileAmount, FacingDirection FinishingFacingDirection,bool EventDoesntPause) + { + this.moveNPC(npc, 0, -TileAmount, FinishingFacingDirection, EventDoesntPause); + } + + public virtual void moveNPCDown(NPC npc, int TileAmount, FacingDirection FinishingFacingDirection, bool EventDoesntPause) + { + this.moveNPC(npc, 0, TileAmount, FinishingFacingDirection, EventDoesntPause); + } + + public virtual void moveNPCLeft(NPC npc, int TileAmount, FacingDirection FinishingFacingDirection, bool EventDoesntPause) + { + this.moveNPC(npc, TileAmount,0,FinishingFacingDirection, EventDoesntPause); + } + + public virtual void moveNPCRight(NPC npc, int TileAmount, FacingDirection FinishingFacingDirection, bool EventDoesntPause) + { + this.moveNPC(npc,-TileAmount,0,FinishingFacingDirection, EventDoesntPause); + } + + public virtual void moveFarmer(int xOffset, int yOffset, FacingDirection Dir, bool Continue) + { + StringBuilder b = new StringBuilder(); + b.Append("move "); + b.Append("farmer"); + b.Append(" "); + b.Append(xOffset); + b.Append(" "); + b.Append(yOffset); + b.Append(" "); + b.Append(this.getFacingDirectionNumber(Dir)); + b.Append(" "); + b.Append(Continue); + this.add(b); + } + + public virtual void moveFarmerUp(int TileAmount, FacingDirection FinishingFacingDirection, bool EventDoesntPause) + { + this.moveFarmer(0, -TileAmount, FinishingFacingDirection, EventDoesntPause); + } + public virtual void moveFarmerDown(int TileAmount, FacingDirection FinishingFacingDirection, bool EventDoesntPause) + { + this.moveFarmer(0, TileAmount, FinishingFacingDirection, EventDoesntPause); + } + + public virtual void moveFarmerLeft(int TileAmount, FacingDirection FinishingFacingDirection, bool EventDoesntPause) + { + this.moveFarmer(-TileAmount,0,FinishingFacingDirection, EventDoesntPause); + } + + public virtual void moveFarmerRight(int TileAmount, FacingDirection FinishingFacingDirection, bool EventDoesntPause) + { + this.moveFarmer(TileAmount, 0,FinishingFacingDirection, EventDoesntPause); + } + + + /// /// Pause the game for the given number of milliseconds. ///