Added in all of the event requirements for the community center birthday event.

This commit is contained in:
JoshuaNavarro 2019-12-06 15:04:48 -08:00
parent aed54a63ff
commit 650bfdc84b
6 changed files with 259 additions and 26 deletions

View File

@ -16,13 +16,18 @@ namespace Omegasis.HappyBirthday.Framework
public class BirthdayEvents public class BirthdayEvents
{ {
/// <summary>
/// Creates the junimo birthday party event.
/// </summary>
/// <returns></returns>
public static EventHelper CommunityCenterBirthday() public static EventHelper CommunityCenterBirthday()
{ {
//TODO Junimos
List<EventPrecondition> conditions = new List<EventPrecondition>(); List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition()); conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter"))); conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter")));
conditions.Add(new TimePrecondition(600, 2600)); conditions.Add(new TimePrecondition(600, 2600));
conditions.Add(new CanReadJunimo());
conditions.Add(new StardustCore.Events.Preconditions.PlayerSpecific.JojaMember(false));
//conditions.Add(new HasUnlockedCommunityCenter()); //Infered by the fact that you must enter the community center to trigger this event anyways. //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<EventStartData.NPCData>())); EventHelper e = new EventHelper("CommunityCenterBirthday",19950, conditions, new EventStartData(EventStartData.MusicToPlayType.Continue, 32, 16, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up),new List<EventStartData.NPCData>()));
@ -30,13 +35,11 @@ namespace Omegasis.HappyBirthday.Framework
e.AddInJunimoActor("Juni2", new Microsoft.Xna.Framework.Vector2(30, 15), 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.AddInJunimoActor("Juni3", new Microsoft.Xna.Framework.Vector2(34, 15), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.globalFadeIn(); e.globalFadeIn();
e.moveFarmerUp(6, EventHelper.FacingDirection.Up, false); e.moveFarmerUp(6, EventHelper.FacingDirection.Up, 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<int>() e.animate("Juni", true, true, 250, new List<int>()
{ {
28, 28,
29, 29,
@ -47,25 +50,15 @@ namespace Omegasis.HappyBirthday.Framework
// //
e.playSound("junimoMeep1"); e.playSound("junimoMeep1");
//e.addObjectToPlayersInventory(64, 22,true); //
e.emoteFarmer_ExclamationMark();
//e.addTemporaryActor_NPC("Junimo", 16, 16, 32, 14, EventHelper.FacingDirection.Down, false); e.showMessage("It looks like the junimos wanted to throw you a party!"); //TODO get this from translated strings. NOT hard coded.
e.ViewportLerpTileOffset(new Microsoft.Xna.Framework.Point(0, -6), 60 * 6, false); e.emoteFarmer_Heart();
e.showMessage("Community center birthday here."); e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
//Notes e.showMessage("It looks like there was some cake left over too!");//TODO get this from translated strings. NOT hard coded.
//Add a temporary actor (or sprite) to the screen. e.showMessage("That was a fun party. Back to work!");//TODO get this from translated strings. NOT hard coded.
//Use the attachCharacterToTempSprite command to stitch them together? e.addObjectToPlayersInventory(220, 1, false);
/*
*
*
* else if (strArray[index].Equals("Junimo"))
{
}
*/
e.end(); e.end();

View File

@ -12,6 +12,7 @@ using StardewValley;
using StardewValley.Characters; using StardewValley.Characters;
using StardewValley.Menus; using StardewValley.Menus;
using StardewValley.Monsters; using StardewValley.Monsters;
using StardustCore.Utilities;
namespace Omegasis.HappyBirthday namespace Omegasis.HappyBirthday
{ {
@ -144,6 +145,7 @@ namespace Omegasis.HappyBirthday
data["birthdayMom"] = momMail; data["birthdayMom"] = momMail;
data["birthdayDad"] = dadMail; data["birthdayDad"] = dadMail;
data["birthdayJunimos"] = "Please come to the community center. ^ Sincerly,^ -The Junimos";
} }
@ -558,6 +560,18 @@ namespace Omegasis.HappyBirthday
} }
this.eventManager.addEvent(BirthdayEvents.CommunityCenterBirthday()); this.eventManager.addEvent(BirthdayEvents.CommunityCenterBirthday());
if (Game1.player.mailReceived.Contains("birthdayMom"))
{
Game1.player.mailReceived.Remove("birthdayMom");
}
if (Game1.player.mailReceived.Contains("birthdayDad"))
{
Game1.player.mailReceived.Remove("birthdayDad");
}
if (Game1.player.mailReceived.Contains("birthdayJunimos"))
{
Game1.player.mailReceived.Remove("birthdayJunimos");
}
} }
/// <summary>Raised before the game begins writes data to the save file (except the initial save creation).</summary> /// <summary>Raised before the game begins writes data to the save file (except the initial save creation).</summary>
@ -613,6 +627,11 @@ namespace Omegasis.HappyBirthday
Game1.player.mailbox.Add("birthdayMom"); Game1.player.mailbox.Add("birthdayMom");
Game1.player.mailbox.Add("birthdayDad"); Game1.player.mailbox.Add("birthdayDad");
if (Game1.player.CanReadJunimo())
{
Game1.player.mailbox.Add("birthdayJunimos");
}
foreach (GameLocation location in Game1.locations) foreach (GameLocation location in Game1.locations)
{ {

View File

@ -925,13 +925,176 @@ namespace StardustCore.Events
{ {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
b.Append("emote "); b.Append("emote ");
b.Append(Actor); b.Append(Actor);
b.Append(" "); b.Append(" ");
b.Append(EmoteID); b.Append(EmoteID*4);
this.add(b); this.add(b);
} }
public virtual void emoteFarmer(int EmoteID)
{
this.emote("farmer", EmoteID);
}
public virtual void emote_Empty(string Actor)
{
this.emote(Actor, 0);
}
public virtual void emote_NoWater(string Actor)
{
this.emote(Actor, 1);
}
public virtual void emote_QuestionMark(string Actor)
{
this.emote(Actor, 2);
}
public virtual void emote_Angry(string Actor)
{
this.emote(Actor, 3);
}
public virtual void emote_ExclamationMark(string Actor)
{
this.emote(Actor, 4);
}
public virtual void emote_Heart(string Actor)
{
this.emote(Actor, 5);
}
public virtual void emote_Sleeping(string Actor)
{
this.emote(Actor, 6);
}
public virtual void emote_Sad(string Actor)
{
this.emote(Actor, 7);
}
public virtual void emote_Happy(string Actor)
{
this.emote(Actor, 8);
}
public virtual void emote_No(string Actor)
{
this.emote(Actor, 9);
}
public virtual void emote_Pause(string Actor)
{
this.emote(Actor,10);
}
public virtual void emote_Thinking(string Actor)
{
this.emote(Actor, 10);
}
public virtual void emote_Fishing(string Actor)
{
this.emote(Actor, 11);
}
public virtual void emote_CommunityCenterTablet(string Actor)
{
this.emote(Actor, 12);
}
public virtual void emote_Gaming(string Actor)
{
this.emote(Actor, 13);
}
public virtual void emote_MusicNote(string Actor)
{
this.emote(Actor, 14);
}
public virtual void emote_Blushing(string Actor)
{
this.emote(Actor, 15);
}
public virtual void emote_Embarrased(string Actor)
{
this.emote_Blushing(Actor);
}
public virtual void emoteFarmer_Empty()
{
this.emoteFarmer(0);
}
public virtual void emoteFarmer_NoWater()
{
this.emoteFarmer(1);
}
public virtual void emoteFarmer_QuestionMark()
{
this.emoteFarmer(2);
}
public virtual void emoteFarmer_Angry()
{
this.emoteFarmer(3);
}
public virtual void emoteFarmer_ExclamationMark()
{
this.emoteFarmer(4);
}
public virtual void emoteFarmer_Heart()
{
this.emoteFarmer(5);
}
public virtual void emoteFarmer_Sleeping()
{
this.emoteFarmer(6);
}
public virtual void emoteFarmer_Sad()
{
this.emoteFarmer(7);
}
public virtual void emoteFarmer_Happy()
{
this.emoteFarmer(8);
}
public virtual void emoteFarmer_No()
{
this.emoteFarmer(9);
}
public virtual void emoteFarmer_Pause()
{
this.emoteFarmer(10);
}
public virtual void emoteFarmer_Thinking()
{
this.emoteFarmer_Pause();
}
public virtual void emoteFarmer_Fishing()
{
this.emoteFarmer(11);
}
public virtual void emoteFarmer_CommunityCenterTablet()
{
this.emoteFarmer(12);
}
public virtual void emoteFarmer_Gaming()
{
this.emoteFarmer(13);
}
public virtual void emoteFarmer_MusicNote()
{
this.emoteFarmer(14);
}
public virtual void emoteFarmer_Blushing()
{
this.emoteFarmer(15);
}
public virtual void emote_Embarrased()
{
this.emoteFarmer_Blushing();
}
/// <summary> /// <summary>
/// Ends the current event by fading out, then resumes the game world and places the player on the square where they entered the zone. All end parameters do this by default unless otherwise stated. /// Ends the current event by fading out, then resumes the game world and places the player on the square where they entered the zone. All end parameters do this by default unless otherwise stated.
/// </summary> /// </summary>

View File

@ -0,0 +1,37 @@
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 JojaMember:EventPrecondition
{
public bool isMember;
public JojaMember()
{
}
public JojaMember(bool IsMember)
{
this.isMember = IsMember;
}
public override bool meetsCondition()
{
if (this.isMember)
{
return Game1.player.mailReceived.Contains("JojaMember") == true;
}
else
{
return Game1.player.mailReceived.Contains("JojaMember") == false;
}
}
}
}

View File

@ -115,6 +115,7 @@
<Compile Include="Events\Preconditions\PlayerSpecific\HasNotRecievedLetter.cs" /> <Compile Include="Events\Preconditions\PlayerSpecific\HasNotRecievedLetter.cs" />
<Compile Include="Events\Preconditions\PlayerSpecific\HasRecievedLetter.cs" /> <Compile Include="Events\Preconditions\PlayerSpecific\HasRecievedLetter.cs" />
<Compile Include="Events\Preconditions\PlayerSpecific\HasUnlockedCommunityCenter.cs" /> <Compile Include="Events\Preconditions\PlayerSpecific\HasUnlockedCommunityCenter.cs" />
<Compile Include="Events\Preconditions\PlayerSpecific\JojaMember.cs" />
<Compile Include="Events\Preconditions\PlayerSpecific\MineBottomHit.cs" /> <Compile Include="Events\Preconditions\PlayerSpecific\MineBottomHit.cs" />
<Compile Include="Events\Preconditions\PlayerSpecific\NotDatingAnyone.cs" /> <Compile Include="Events\Preconditions\PlayerSpecific\NotDatingAnyone.cs" />
<Compile Include="Events\Preconditions\PlayerSpecific\PetPreference.cs" /> <Compile Include="Events\Preconditions\PlayerSpecific\PetPreference.cs" />
@ -162,6 +163,7 @@
<Compile Include="UIUtilities\Texture2DExtended.cs" /> <Compile Include="UIUtilities\Texture2DExtended.cs" />
<Compile Include="UIUtilities\TextureManager.cs" /> <Compile Include="UIUtilities\TextureManager.cs" />
<Compile Include="Utilities\HexDumper.cs" /> <Compile Include="Utilities\HexDumper.cs" />
<Compile Include="Utilities\PlayerExtensions.cs" />
<Compile Include="Utilities\Serializer.cs" /> <Compile Include="Utilities\Serializer.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StardewValley;
namespace StardustCore.Utilities
{
public static class PlayerExtensions
{
public static bool CanReadJunimo(this Farmer Farmer)
{
return Farmer.mailReceived.Contains("canReadJunimoText");
}
}
}