Finished happy birthday update.

This commit is contained in:
JoshuaNavarro 2019-12-10 17:16:25 -08:00
parent ad88e5537d
commit b4b1f79816
4 changed files with 1777 additions and 22 deletions

File diff suppressed because it is too large Load Diff

View File

@ -165,6 +165,62 @@ namespace Omegasis.HappyBirthday.Framework
return e;
}
public static EventHelper DatingBirthday_Penny_BigHome()
{
NPC penny = Game1.getCharacterFromName("Penny");
NPC pam = Game1.getCharacterFromName("Pam");
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("Trailer_Big")));
conditions.Add(new TimePrecondition(600, 2600));
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(penny));
//conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(Game1.getCharacterFromName("Penny"));
EventHelper e = new EventHelper("BirthdayDating:Penny_BigHome", 19951, conditions, new EventStartData("playful", 14, 8, new EventStartData.FarmerData(12, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(penny,12,7, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(pam,15,4, EventHelper.FacingDirection.Down)
}));
e.globalFadeIn();
e.moveFarmerUp(3, EventHelper.FacingDirection.Up, false);
e.actorFaceDirection("Penny", EventHelper.FacingDirection.Down);
//starting = starting.Replace("@", Game1.player.Name);
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:0"));
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:0"));
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:1"));
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:1"));
e.emote_Angry("Penny");
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:2")); //penny2
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:3")); //penny3
e.moveActorLeft("Penny", 3, EventHelper.FacingDirection.Up, true);
e.moveFarmerRight(2, EventHelper.FacingDirection.Up, false);
e.moveFarmerUp(3, EventHelper.FacingDirection.Down, false);
e.moveActorRight("Penny", 5, EventHelper.FacingDirection.Up, true);
e.moveActorUp("Penny", 1, EventHelper.FacingDirection.Up, true);
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:2")); //pam2
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:4"));//penny4
e.emoteFarmer_Heart();
e.emote_Heart("Penny");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:0")); //penny party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:1"));// penny party finish 1
e.addObjectToPlayersInventory(220, 1, false);
e.addObjectToPlayersInventory(346, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Birthday event for when the player is dating Maru.
/// Finished.
@ -422,7 +478,7 @@ namespace Omegasis.HappyBirthday.Framework
return e;
}
public static EventHelper DatingBirthday_Sam()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
@ -432,7 +488,7 @@ namespace Omegasis.HappyBirthday.Framework
NPC sam = Game1.getCharacterFromName("Sam");
//conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(sam));
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(sam));
EventHelper e = new EventHelper("BirthdayDating:Sam", 19959, conditions, new EventStartData("playful", 3, 6, new EventStartData.FarmerData(7, 9, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(sam,3,5, EventHelper.FacingDirection.Down),
@ -460,7 +516,7 @@ namespace Omegasis.HappyBirthday.Framework
e.end();
return e;
}
/// <summary>
/// Event that occurs when the player is dating Sebastian.
/// Status: Finished.
@ -528,7 +584,7 @@ namespace Omegasis.HappyBirthday.Framework
}
public static EventHelper DatingBirthday_Elliott()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
@ -565,13 +621,48 @@ namespace Omegasis.HappyBirthday.Framework
e.end();
return e;
}
/*
public static EventHelper DatingBirthday_Shane()
{
}
*/
public static EventHelper DatingBirthday_Shane()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("AnimalShop")));
conditions.Add(new TimePrecondition(600, 2600));
NPC shane = Game1.getCharacterFromName("Shane");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(shane));
EventHelper e = new EventHelper("BirthdayDating:Shane", 19960, conditions, new EventStartData("playful", 26, 15, new EventStartData.FarmerData(19, 18, EventHelper.FacingDirection.Left), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(shane,3,19, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, false);
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
e.moveFarmerRight(2, EventHelper.FacingDirection.Right, false);
e.npcFaceDirection(shane, EventHelper.FacingDirection.Left);
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:0"));
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:1"));
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:2"));
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:3"));
e.emoteFarmer_Heart();
e.emote_Heart("Shane");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingShaneBirthday_Finish:0")); //sam party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingShaneBirthday_Finish:1")); //sam party finish 0
e.addObjectToPlayersInventory(206, 1, false);
e.addObjectToPlayersInventory(167, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Harvey()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
@ -612,23 +703,97 @@ namespace Omegasis.HappyBirthday.Framework
return e;
}
/*
public static EventHelper DatingBirthday_Alex()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("JoshHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC alex = Game1.getCharacterFromName("Alex");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(alex));
EventHelper e = new EventHelper("BirthdayDating:Alex", 19959, conditions, new EventStartData("playful", 3, 20, new EventStartData.FarmerData(7, 19, EventHelper.FacingDirection.Left), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(alex,3,19, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerLeft(3, EventHelper.FacingDirection.Left, false);
e.npcFaceDirection(alex, EventHelper.FacingDirection.Right);
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:0"));
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:1"));
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:2"));
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:3"));
e.emoteFarmer_Heart();
e.emote_Heart("Alex");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAlexBirthday_Finish:0")); //sam party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAlexBirthday_Finish:1")); //sam party finish 0
e.addObjectToPlayersInventory(206, 1, false);
e.addObjectToPlayersInventory(167, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Todo: Finish this.
/// </summary>
/// <returns></returns>
public static EventHelper CommunityBirthday()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter")));
conditions.Add(new TimePrecondition(600, 2600));
conditions.Add(new StardustCore.Events.Preconditions.PlayerSpecific.JojaMember(false));
conditions.Add(new CommunityCenterCompleted(true));
//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", 19961, conditions, new EventStartData("playful", -100, -100, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>()
{
new EventStartData.NPCData(Game1.getCharacterFromName("Lewis"),32,12, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
e.moveFarmerUp(10, EventHelper.FacingDirection.Up, true);
e.showMessage("Shhh. I think they are here.");
e.showMessage("Somebody turn on the lights.");
e.setViewportPosition(32, 12);
e.emoteFarmer_ExclamationMark();
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:CommunityBirthdayParty_0"));
e.emoteFarmer_Heart();
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:CommunityBirthdayParty_1"));
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.addObjectToPlayersInventory(220, 1, false);
e.end();
return e;
}
/*
public static EventHelper MarriedBirthday()
{
}
public static EventHelper CommunityBirthday()
{
}
public static EventHelper JojaBirthday()
{

View File

@ -28,12 +28,15 @@ namespace Omegasis.HappyBirthday.Framework
/// <summary>The minimum amount of friendship needed to get a happy birthday greeting from an npc.</summary>
public int minimumFriendshipLevelForBirthdayWish = 2;
public bool autoSetTranslation { get; set; } = true;
/// <summary>Handles different translations of files.</summary>
public TranslationInfo translationInfo;
/// <summary>Whether or not to load from the old BirthdayGifts.xnb located in StardewValley/Data or from the new BirthdayGifts.json located in the mod directory.</summary>
public bool useLegacyBirthdayFiles;
/// <summary>Construct an instance.</summary>
public ModConfig()
{

View File

@ -117,6 +117,11 @@ namespace Omegasis.HappyBirthday
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Penny");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("Trailer_Big"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Penny_BigHome");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("ScienceHouse"))
{
@ -157,6 +162,16 @@ namespace Omegasis.HappyBirthday
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Sam");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("JoshHouse"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Alex");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("AnimalShop"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Shane");
eve.startEventAtLocationifPossible();
}
}
private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
@ -193,6 +208,8 @@ namespace Omegasis.HappyBirthday
data["birthdayDatingHarvey"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingHarvey");
data["birthdayDatingElliott"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingElliott");
data["birthdayDatingSam"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingSam");
data["birthdayDatingAlex"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingAlex");
data["birthdayDatingShane"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingShane");
}
@ -598,7 +615,10 @@ namespace Omegasis.HappyBirthday
this.MigrateLegacyData();
this.PlayerData = this.Helper.Data.ReadJsonFile<PlayerData>(this.DataFilePath) ?? new PlayerData();
if (HappyBirthday.Config.autoSetTranslation)
{
HappyBirthday.Config.translationInfo.setTranslationFromLanguageCode(Game1.content.GetCurrentLanguage());
}
if (PlayerBirthdayData != null)
{
@ -658,10 +678,19 @@ namespace Omegasis.HappyBirthday
{
Game1.player.mailReceived.Remove("birthdayDatingSam");
}
if (Game1.player.mailReceived.Contains("birthdayDatingAlex"))
{
Game1.player.mailReceived.Remove("birthdayDatingAlex");
}
if (Game1.player.mailReceived.Contains("birthdayDatingShane"))
{
Game1.player.mailReceived.Remove("birthdayDatingShane");
}
EventHelper communityCenterJunimoBirthday = BirthdayEvents.CommunityCenterJunimoBirthday();
EventHelper birthdayDating_Penny = BirthdayEvents.DatingBirthday_Penny();
EventHelper birthdayDating_Penny_Big = BirthdayEvents.DatingBirthday_Penny_BigHome();
EventHelper birthdayDating_Maru = BirthdayEvents.DatingBirthday_Maru();
EventHelper birthdayDating_Sebastian = BirthdayEvents.DatingBirthday_Sebastian();
EventHelper birthdayDating_Leah = BirthdayEvents.DatingBirthday_Leah();
@ -671,9 +700,12 @@ namespace Omegasis.HappyBirthday
EventHelper birthdayDating_Harvey = BirthdayEvents.DatingBirthday_Harvey();
EventHelper birthdayDating_Elliott = BirthdayEvents.DatingBirthday_Elliott();
EventHelper birthdayDating_Sam = BirthdayEvents.DatingBirthday_Sam();
EventHelper birthdayDating_Alex = BirthdayEvents.DatingBirthday_Alex();
EventHelper birthdayDating_Shane = BirthdayEvents.DatingBirthday_Shane();
this.eventManager.addEvent(communityCenterJunimoBirthday);
this.eventManager.addEvent(birthdayDating_Penny);
this.eventManager.addEvent(birthdayDating_Penny_Big);
this.eventManager.addEvent(birthdayDating_Maru);
this.eventManager.addEvent(birthdayDating_Sebastian);
this.eventManager.addEvent(birthdayDating_Leah);
@ -683,6 +715,7 @@ namespace Omegasis.HappyBirthday
this.eventManager.addEvent(birthdayDating_Harvey);
this.eventManager.addEvent(birthdayDating_Elliott);
this.eventManager.addEvent(birthdayDating_Sam);
this.eventManager.addEvent(birthdayDating_Shane);
if (Game1.player.eventsSeen.Contains(communityCenterJunimoBirthday.getEventID()))
{
Game1.player.eventsSeen.Remove(communityCenterJunimoBirthday.getEventID()); //Repeat the event.
@ -727,6 +760,14 @@ namespace Omegasis.HappyBirthday
{
Game1.player.eventsSeen.Remove(birthdayDating_Sam.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Alex.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Alex.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Shane.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Shane.getEventID()); //Repeat the event.
}
}
/// <summary>Raised before the game begins writes data to the save file (except the initial save creation).</summary>
@ -849,6 +890,28 @@ namespace Omegasis.HappyBirthday
}
}
if (Game1.player.friendshipData.ContainsKey("Sam"))
{
if (Game1.player.friendshipData["Sam"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingSam");
}
}
if (Game1.player.friendshipData.ContainsKey("Alex"))
{
if (Game1.player.friendshipData["Alex"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingAlex");
}
}
if (Game1.player.friendshipData.ContainsKey("Shane"))
{
if (Game1.player.friendshipData["Shane"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingShane");
}
}
if (Game1.player.CanReadJunimo())
{