Merge pull request #58 from janavarro95/SMAPI3.0

Smapi3.0
This commit is contained in:
Joshua Navarro 2019-12-13 16:06:45 -08:00 committed by GitHub
commit 56313d7505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
331 changed files with 11026 additions and 1064 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,3 +1,7 @@
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Omegasis.BillboardAnywhere.Framework;
using StardewModdingAPI;
using StardewModdingAPI.Events;
@ -15,6 +19,23 @@ namespace Omegasis.BillboardAnywhere
/// <summary>The mod configuration.</summary>
private ModConfig Config;
/// <summary>
/// The texture for the calendar button.
/// </summary>
private Texture2D calendarTexture;
/// <summary>
/// The texture for the quest button.
/// </summary>
private Texture2D questTexture;
/// <summary>
/// The button for the calendar menu.
/// </summary>
public ClickableTextureComponent billboardButton;
/// <summary>
/// The button for the quest menu.
/// </summary>
public ClickableTextureComponent questButton;
/*********
** Public methods
@ -25,9 +46,24 @@ namespace Omegasis.BillboardAnywhere
{
this.Config = helper.ReadConfig<ModConfig>();
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.ReloadConfig", "Reloads the config file for BillboardAnywhere to reposition the button for the inventory menu page.", this.reloadConfig);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonX", "<int>Sets the x position for the calendar button in the game menu.", this.setcalendarButtonX);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonY", "<int> Sets the y position for the calendar button in the game menu.", this.setcalendarButtonY);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonPosition", "<int,int> Sets the position for the calendar button in the game menu.", this.setcalendarButtonPosition);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonX", "<int>Sets the x position for the quest button in the game menu.", this.setQuestButtonX);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonY", "<int> Sets the y position for the quest button in the game menu.", this.setQuestButtonX);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonPosition", "<int,int> Sets the position for the quest button in the game menu.", this.setQuestButtonPosition);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonVisibility", "<bool> Sets the visibility for the billboard button in the game menu.", this.setcalendarButtonVisibility);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonVisibility", "<bool> Sets the visibility for the quest button in the game menu.", this.setQuestButtonVisibility);
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
}
helper.Events.Display.RenderedActiveMenu += this.RenderBillboardMenuButton;
helper.Events.Input.ButtonPressed += this.Input_ButtonPressed;
this.calendarTexture = helper.Content.Load<Texture2D>(Path.Combine("Assets", "Billboard.png"));
this.questTexture= helper.Content.Load<Texture2D>(Path.Combine("Assets", "Quest.png"));
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
}
/*********
** Private methods
@ -38,8 +74,214 @@ namespace Omegasis.BillboardAnywhere
public void OnButtonPressed(object sender, ButtonPressedEventArgs e)
{
// load menu if key pressed
if (Context.IsPlayerFree && e.Button == this.Config.KeyBinding)
if (Context.IsPlayerFree && e.Button == this.Config.CalendarKeyBinding)
Game1.activeClickableMenu = new Billboard();
if (Context.IsPlayerFree && e.Button == this.Config.QuestBoardKeyBinding)
{
Game1.RefreshQuestOfTheDay();
Game1.activeClickableMenu = new Billboard(true);
}
}
/// <summary>
/// Checks to see if the billboard button is clicked.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Input_ButtonPressed(object sender, ButtonPressedEventArgs e)
{
if (Game1.activeClickableMenu == null) return;
if (e.Button == SButton.MouseLeft)
{
if (this.isInventoryPage())
{
if (this.billboardButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
{
if (this.Config.EnableInventoryCalendarButton == false) return;
Game1.activeClickableMenu = new Billboard(false);
}
if (this.questButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
{
if (this.Config.EnableInventoryQuestButton == false) return;
Game1.activeClickableMenu = new Billboard(true);
}
}
}
}
/// <summary>
/// Renders the billboard button to the menu.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void RenderBillboardMenuButton(object sender, RenderedActiveMenuEventArgs e)
{
if (this.isInventoryPage())
{
this.billboardButton.bounds = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + (int)this.Config.CalendarOffsetFromMenu.X, Game1.activeClickableMenu.yPositionOnScreen + (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height);
this.questButton.bounds = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + (int)this.Config.QuestOffsetFromMenu.X, Game1.activeClickableMenu.yPositionOnScreen + (int)this.Config.QuestOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height);
if(this.Config.EnableInventoryQuestButton) this.questButton.draw(Game1.spriteBatch);
if (this.Config.EnableInventoryCalendarButton) this.billboardButton.draw(Game1.spriteBatch);
GameMenu activeMenu = (Game1.activeClickableMenu as GameMenu);
activeMenu.drawMouse(Game1.spriteBatch);
if (this.billboardButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
{
//My deepest appologies for not being able to personally translate more text.
if (Game1.content.GetCurrentLanguage() == LocalizedContentManager.LanguageCode.en)
{
if (this.Config.EnableInventoryCalendarButton == false) return;
IClickableMenu.drawHoverText(Game1.spriteBatch, "Open Billboard Menu", Game1.smallFont);
}
}
if (this.questButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
{
//My deepest appologies once again for not being able to personally translate more text.
if (Game1.content.GetCurrentLanguage() == LocalizedContentManager.LanguageCode.en)
{
if (this.Config.EnableInventoryQuestButton == false) return;
IClickableMenu.drawHoverText(Game1.spriteBatch, "Open Quest Menu", Game1.smallFont);
}
}
}
}
/// <summary>
/// Checks to see if the current active menu is the game menu and the current page is the inventory page.
/// </summary>
/// <returns></returns>
private bool isInventoryPage()
{
if (Game1.activeClickableMenu == null) return false;
if (Game1.activeClickableMenu is StardewValley.Menus.GameMenu)
{
GameMenu activeMenu = (Game1.activeClickableMenu as GameMenu);
IClickableMenu currentTab = activeMenu.GetCurrentPage();
if (currentTab is InventoryPage)
{
return true;
}
}
return false;
}
/// <summary>
/// Reloads the mod's config and repositions the menu button as necessary.
/// </summary>
private void reloadConfig(string Name, string[] Params)
{
this.Config = this.Helper.ReadConfig<ModConfig>();
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
}
/// <summary>
/// Reloads the mod's config and repositions the menu button as necessary.
/// </summary>
private void reloadConfig()
{
this.Config = this.Helper.ReadConfig<ModConfig>();
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
}
/// <summary>
/// Sets the x position of the menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setcalendarButtonX(string Name, string[] Params)
{
this.Config.CalendarOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), this.Config.CalendarOffsetFromMenu.Y);
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the y position of the menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setcalendarButtonY(string Name, string[] Params)
{
this.Config.CalendarOffsetFromMenu = new Vector2(this.Config.CalendarOffsetFromMenu.X, Convert.ToInt32(Params[0]));
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the position of the menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setcalendarButtonPosition(string Name, string[] Params)
{
this.Config.CalendarOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), Convert.ToInt32(Params[1]));
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the x position of the quest menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setQuestButtonX(string Name, string[] Params)
{
this.Config.QuestOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), this.Config.QuestOffsetFromMenu.Y);
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the y position of the quest menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setQuestButtonY(string Name, string[] Params)
{
this.Config.QuestOffsetFromMenu = new Vector2(this.Config.QuestOffsetFromMenu.X, Convert.ToInt32(Params[0]));
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the position of the quest menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setQuestButtonPosition(string Name, string[] Params)
{
this.Config.QuestOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), Convert.ToInt32(Params[1]));
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the visibility and functionality of the billboard menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setcalendarButtonVisibility(string Name, string[] Params)
{
this.Config.EnableInventoryCalendarButton = Convert.ToBoolean(Params[0]);
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the visibility and functionality of the quest menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setQuestButtonVisibility(string Name, string[] Params)
{
this.Config.EnableInventoryQuestButton = Convert.ToBoolean(Params[0]);
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
}
}

View File

@ -86,6 +86,14 @@
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Billboard.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Quest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\deploy.targets" />
</Project>

View File

@ -1,3 +1,4 @@
using Microsoft.Xna.Framework;
using StardewModdingAPI;
namespace Omegasis.BillboardAnywhere.Framework
@ -6,6 +7,21 @@ namespace Omegasis.BillboardAnywhere.Framework
internal class ModConfig
{
/// <summary>The key which shows the billboard menu.</summary>
public SButton KeyBinding { get; set; } = SButton.B;
public SButton CalendarKeyBinding { get; set; } = SButton.B;
/// <summary>The key which shows the quest menu.</summary>
public SButton QuestBoardKeyBinding { get; set; } = SButton.H;
/// <summary>The offset for the calendar button from the active menu</summary>
public Vector2 CalendarOffsetFromMenu { get; set; } = new Vector2(-100, 0);
/// <summary>The offset for the quest button from the active menu</summary>
public Vector2 QuestOffsetFromMenu { get; set; } = new Vector2(-200, 0);
/// <summary>
/// If true the calendar button is enabled for the in-game menu.
/// </summary>
public bool EnableInventoryCalendarButton { get; set; } = true;
/// <summary>
/// If true the quest button is enabled for the in-game menu.
/// </summary>
public bool EnableInventoryQuestButton { get; set; } = true;
}
}

View File

@ -1,10 +1,10 @@
{
"Name": "Billboard Anywhere",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.10.1",
"Description": "Lets you view the billboard from anywhere.",
"UniqueID": "Omegasis.BillboardAnywhere",
"EntryDll": "BillboardAnywhere.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:492" ]
}

View File

@ -158,7 +158,7 @@ namespace Omegasis.BuildEndurance
if (this.PlayerData.CurrentLevel < this.Config.MaxLevel)
{
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel)
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel && this.PlayerData.CurrentLevel<this.Config.MaxLevel)
{
this.PlayerData.CurrentLevel += 1;
this.PlayerData.CurrentExp = this.PlayerData.CurrentExp - this.PlayerData.ExpToNextLevel;

View File

@ -1,10 +1,10 @@
{
"Name": "Build Endurance",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.8.2",
"Description": "Increase your health as you play.",
"UniqueID": "Omegasis.BuildEndurance",
"EntryDll": "BuildEndurance.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:445" ]
}

View File

@ -149,7 +149,7 @@ namespace Omegasis.BuildHealth
if (this.PlayerData.CurrentLevel < this.Config.MaxLevel)
{
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel)
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel && this.PlayerData.CurrentLevel<this.Config.MaxLevel)
{
this.PlayerData.CurrentLevel += 1;
this.PlayerData.CurrentExp = this.PlayerData.CurrentExp - this.PlayerData.ExpToNextLevel;

View File

@ -1,10 +1,10 @@
{
"Name": "Build Health",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.8.1",
"Description": "Increase your health as you play.",
"UniqueID": "Omegasis.BuildHealth",
"EntryDll": "BuildHealth.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:446" ]
}

View File

@ -92,8 +92,8 @@ namespace Omegasis.BuyBackCollectables.Framework
this.Collections.Add(BuyBackMenu.MineralsTab, new List<List<ClickableTextureComponent>>());
this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 6, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Cooking"), Game1.mouseCursors, new Rectangle(688, 64, 16, 16), Game1.pixelZoom));
this.Collections.Add(BuyBackMenu.CookingTab, new List<List<ClickableTextureComponent>>());
this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 7, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Achievements"), Game1.mouseCursors, new Rectangle(656, 80, 16, 16), Game1.pixelZoom));
this.Collections.Add(BuyBackMenu.AchievementsTab, new List<List<ClickableTextureComponent>>());
//this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 7, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Achievements"), Game1.mouseCursors, new Rectangle(656, 80, 16, 16), Game1.pixelZoom));
//this.Collections.Add(BuyBackMenu.AchievementsTab, new List<List<ClickableTextureComponent>>());
this.BackButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize * 3 / 4, this.yPositionOnScreen + this.height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(352, 495, 12, 11), Game1.pixelZoom);
this.ForwardButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width - Game1.tileSize / 2 - 15 * Game1.pixelZoom, this.yPositionOnScreen + this.height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(365, 495, 12, 11), Game1.pixelZoom);
int[] array = new int[this.SideTabs.Count];
@ -155,8 +155,9 @@ namespace Omegasis.BuyBackCollectables.Framework
this.Collections[selectedTab].Last().Add(new ClickableTextureComponent(entry.Key + " " + drawShadow, new Rectangle(x2, num5, Game1.tileSize, Game1.tileSize), null, "", Game1.objectSpriteSheet, Game1.getSourceRectForStandardTileSheet(Game1.objectSpriteSheet, entry.Key, 16, 16), Game1.pixelZoom, drawShadow));
array[selectedTab]++;
}
if (this.Collections[5].Count == 0)
this.Collections[5].Add(new List<ClickableTextureComponent>());
/*
//if (this.Collections[5].Count == 0)
//this.Collections[5].Add(new List<ClickableTextureComponent>());
foreach (KeyValuePair<int, string> current2 in Game1.achievements)
{
bool flag = Game1.player.achievements.Contains(current2.Key);
@ -169,6 +170,7 @@ namespace Omegasis.BuyBackCollectables.Framework
array[5]++;
}
}
*/
}
@ -221,9 +223,9 @@ namespace Omegasis.BuyBackCollectables.Framework
}
foreach (ClickableTextureComponent current2 in this.Collections[this.CurrentTab][this.CurrentPage])
{
if (current2.containsPoint(x, y) && this.NewItem != null && Game1.player.money >= this.Value)
if (current2.containsPoint(x, y) && this.NewItem != null && Game1.player.Money >= this.Value)
{
Game1.player.money -= this.Value;
Game1.player.Money -= this.Value;
Game1.playSound("coin");
Game1.player.addItemByMenuIfNecessary(this.NewItem);
}
@ -236,9 +238,9 @@ namespace Omegasis.BuyBackCollectables.Framework
/// <param name="playSound">Whether to enable sound.</param>
public override void receiveRightClick(int x, int y, bool playSound = true)
{
if (this.NewItem != null && Game1.player.money >= this.Value)
if (this.NewItem != null && Game1.player.Money >= this.Value)
{
Game1.player.money -= this.Value;
Game1.player.Money -= this.Value;
Game1.player.addItemByMenuIfNecessary(this.NewItem);
Game1.playSound("coin");
}

View File

@ -1,10 +1,10 @@
{
"Name": "Buy Back Collectables",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.8.0",
"Description": "Lets you buy back any obtained collectable.",
"UniqueID": "Omegasis.BuyBackCollectables",
"EntryDll": "BuyBackCollectables.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:507" ]
}

View File

@ -1,7 +1,7 @@
{
"Name": "Fall 28 Snow Day",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.7.1",
"Description": "Makes it snow on Fall 28, which makes a good explanation for all the snow on the next day.",
"UniqueID": "Omegasis.Fall28SnowDay",
"EntryDll": "Fall28SnowDay.dll",

View File

@ -1,26 +0,0 @@
using StardewValley;
namespace Omegasis.HappyBirthday
{
// TODO: Make all the events
// Resources:https://stardewvalleywiki.com/Modding:Event_data
public class BirthdayEvents
{
public Event communityCenterJunimoEvent;
public Event marriedNoKidsEvent;
public Event surpriseBirthdayPartyEvent;
public Event marriedWithOneKidEvent;
public Event marriedWithTwoKidsEvent;
public BirthdayEvents()
{
this.initializeEvents();
}
public void initializeEvents()
{
Event e = new Event("", -1, Game1.player);
Game1.player.currentLocation.currentEvent = new Event();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
{
"Robin": "嘿,@,生日快乐!我很高兴你选择搬到这里来。",
"Demetrius": "生日快乐@!记得偶尔要抽出时间来好好享受一下。$h",
"Maru": "生日快乐@。我本来想给我做个永恒不灭的蜡烛,但是好像行不通。也许明年再给你吧?$h",
"Sebastian": "生日快乐@。又是平静的一年。",
"Linus": "生日快乐@。谢谢你在你生日的这天依旧来看我。这让我很开心。",
"Pierre": "嘿@,生日快乐!希望你的下一年会更好!",
"Caroline": "生日快乐@。谢谢你为这个社区做的一切。我相信你的父母一定都很为你骄傲。$h",
"Abigail": "生日快乐@!希望之后的一年我们可以一起去更多的地方冒险!$h",
"Alex": "哟@,生日快乐!也许这会是你有生以来最棒的一年。$h",
"George": "等你到我的年纪,生日就像其他的日子一样来去匆匆。不过还是祝你生日快乐,@。",
"Evelyn": "生日快乐@。你成长成为了一个优秀的人,我相信你还会继续成长的。",
"Lewis": "生日快乐@!我很感激你为这个小镇做的一切,我相信你爷爷也会为你骄傲的。",
"Clint": "嘿生日快乐@。我相信接下来对你来说会是很棒的一年。",
"Penny": "生日快乐@。希望你这一年都能得到所有的祝福。",
"Pam": "生日快乐孩子。我们应该一起去喝一杯,庆祝你生命的又一年。",
"Emily": "我今天感受到了很多关于你的正能量,所以一定是你的生日到了。生日快乐@$h",
"Haley": "生日快乐@。希望你今年能收到些很棒的礼物!$h",
"Jas": "生日快乐@。希望你过个愉快的生日。",
"Vincent": "嘿@,你是来玩的……哦今天是你的生日?生日快乐!",
"Jodi": "你好啊@。听说今天是你的生日。既然如此,祝你生日快乐!$h",
"Kent": "乔迪告诉我今天是你的生日,@。生日快乐,记得要珍惜每一天。",
"Sam": "哟@,生日快乐!有机会我们来给你办个生日派对吧!$h",
"Leah": "嘿@,生日快乐!我们今晚去酒吧庆祝一下吧!$h",
"Shane": "生日快乐@。继续努力工作,我相信你接下来的这一年会更好。",
"Marnie": "你好@。今天大家都在谈论你的生日,我也想跟你说一声生日快乐,那么,生日快乐!$h",
"Elliott": "真是美好的一天不是吗,@?尤其今天是你的生日。我本想给你写一首诗,但我觉得简单的才是最好的,生日快乐。$h",
"Gus": "嘿@,生日快乐!希望你今天过得愉快,酒吧永远都欢迎你!",
"Dwarf": "生日快乐@。我希望我给你的东西是人类可以接受的。",
"Wizard": "有精灵告诉我今天是你的生日。这么说,生日快乐@。希望你下一年辉煌灿烂!",
"Harvey": "嘿@,生日快乐!有空记得到我这来做检查,这能让你多活很多年!",
"Sandy": "你好啊@。我听说今天是你的生日,我可不想让你觉得被冷落了。生日快乐!",
"Willy": "哎@,生日快乐。看到你让我想起了我曾经一个人漂在海上的日子。继续享受青春吧年轻人。$h",
"Krobus": "我听说在别人生日的时候送一份礼物是传统。那么,生日快乐@。"
}

View File

@ -1,35 +0,0 @@
{
"Robin": "Hey @, happy birthday! I'm glad you choose this town to move here to. ",
"Demetrius": "Happy birthday @! Make sure you take some time off today to enjoy yourself. $h",
"Maru": "Happy birthday @. I tried to make you an everlasting candle for you, but sadly that didn't work out. Maybe next year right? $h",
"Sebastian": "Happy birthday @. Here's to another year of chilling. ",
"Linus": "Happy birthday @. Thanks for visiting me even on your birthday. It makes me really happy. ",
"Pierre": "Hey @, happy birthday! Hopefully this next year for you will be a great one! ",
"Caroline": "Happy birthday @. Thank you for all that you've done for our community. I'm sure your parents must be proud of you.$h",
"Abigail": "Happy birthday @! Hopefully this year we can go on even more adventures together $h!",
"Alex": "Yo @, happy birthday! Maybe this will be your best year yet.$h",
"George": "When you get to my age birthdays come and go. Still happy birthday @.",
"Evelyn": "Happy birthday @. You have grown up to be such a fine individual and I'm sure you'll continue to grow. ",
"Lewis": "Happy birthday @! I'm thankful for what you have done for the town and I'm sure your grandfather would be proud of you.",
"Clint": "Hey happy birthday @. I'm sure this year is going to be great for you.",
"Penny": "Happy birthday @. May you enjoy all of life's blessings this year. ",
"Pam": "Happy birthday kid. We should have a drink to celebrate another year of life for you! $h",
"Emily": "I'm sensing a strong positive life energy about you, so it must be your birthday. Happy birthday @!$h",
"Haley": "Happy birthday @. Hopefully this year you'll get some good presents!$h",
"Jas": "Happy birthday @. I hope you have a good birthday.",
"Vincent": "Hey @ have you come to pl...oh it's your birthday? Happy birthday! ",
"Jodi": "Hello there @. Rumor has it that today is your birthday. In that case, happy birthday!$h",
"Kent": "Jodi told me that it was your birthday today @. Happy birthday and make sure to cherish every single day.",
"Sam": "Yo @ happy birthday! We'll have to have a birthday jam session for you some time!$h ",
"Leah": "Hey @ happy birthday! We should go to the saloon tonight and celebrate!$h ",
"Shane": "Happy birthday @. Keep working hard and I'm sure this next year for you will be a great one.",
"Marnie": "Hello there @. Everyone is talking about your birthday today and I wanted to make sure that I wished you a happy birthday as well, so happy birthday! $h ",
"Elliott": "What a wonderful day isn't it @? Especially since today is your birthday. I tried to make you a poem but I feel like the best way of putting it is simply, happy birthday. $h ",
"Gus": "Hey @ happy birthday! Hopefully you enjoy the rest of the day and make sure you aren't a stranger at the saloon!",
"Dwarf": "Happy birthday @. I hope that what I got you is acceptable for humans as well. ",
"Wizard": "The spirits told me that today is your birthday. In that case happy birthday @. May your year shine bright! ",
"Harvey": "Hey @, happy birthday! Make sure to come in for a checkup some time to make sure you live many more years! ",
"Sandy": "Hello there @. I heard that today was your birthday and I didn't want you feeling left out, so happy birthday!",
"Willy": "Aye @ happy birthday. Looking at you reminds me of ye days when I was just a guppy swimming out to sea. Continue to enjoy them youngin.$h",
"Krobus": "I have heard that it is tradition to give a gift to others on their birthday. In that case, happy birthday @."
}

View File

@ -1,6 +0,0 @@
{
"Mail:birthdayMom": "Dear @,^ Happy birthday sweetheart. It's been amazing watching you grow into the kind, hard working person that I've always dreamed that you would become. I hope you continue to make many more fond memories with the ones you love. ^ Love, Mom ^ P.S. Here's a little something that I made for you. %item object 221 1 %%",
"Mail:birthdayDad": "Dear @,^ Happy birthday kiddo. It's been a little quiet around here on your birthday since you aren't around, but your mother and I know that you are making both your grandpa and us proud. We both know that living on your own can be tough but we believe in you one hundred percent, just keep following your dreams.^ Love, Dad ^ P.S. Here's some spending money to help you out on the farm. Good luck! %item money 5000 5001 %%",
"Happy Birthday: Star Message": "It's your birthday today! Happy birthday!",
"Happy Birthday: Farmhand Birthday Message": "It's @'s birthday! Happy birthday to them!"
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,14 @@
{
"Alex": "",
"Elliott": "",
"Harvey": "",
"Sam": "",
"Sebastian": "",
"Shane": "",
"Abigail": "",
"Emily": "",
"Haley": "",
"Leah": "",
"Maru": "",
"Penny": ""
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,14 @@
{
"Alex": "",
"Elliott": "",
"Harvey": "",
"Sam": "",
"Sebastian": "",
"Shane": "",
"Abigail": "",
"Emily": "",
"Haley": "",
"Leah": "",
"Maru": "",
"Penny": ""
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "ƒорогой @,^ — днем рождени¤, мо¤ радость. Ёто были замечательные моменты, когда ты выростал в доброго, трудолюбивого человека. я надеюсь, в твоей жизни будет куча превосходных моментов. ^ — любовью, мама ^ P.S. «десь находить небольшой подарок, который ¤ сделала дл¤ теб¤. %item object 221 1 %%",
"Mail:birthdayDad": "ƒорогой @,^ — днем рождени¤, мой ребенок. «десь немного тихо в твой день рождени¤ с тех пор, как ты уехал на ферму, но тво¤ мать и ¤ знаем, что ты со своим дедушкой делаешь нас гордыми. ћы оба знаем, что жить на ферме может быть трудно, но мы верим в теб¤ на все 100%, просто продолжай следовать своим мечтам.^ — любовью папа ^ P.S. “ут есть немного денег, которые помогут тебе на ферме. ”дачи! %item money 5000 5001%%",
"Happy Birthday: Star Message": "Ёто твой день рождени¤! — днем рождени¤!",
"Happy Birthday: Farmhand Birthday Message": "Ёто твой день рождени¤! ѕоздравл¤ю с этим!",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,14 @@
{
"Alex": "",
"Elliott": "",
"Harvey": "",
"Sam": "",
"Sebastian": "",
"Shane": "",
"Abigail": "",
"Emily": "",
"Haley": "",
"Leah": "",
"Maru": "",
"Penny": ""
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,14 @@
{
"Alex": "",
"Elliott": "",
"Harvey": "",
"Sam": "",
"Sebastian": "",
"Shane": "",
"Abigail": "",
"Emily": "",
"Haley": "",
"Leah": "",
"Maru": "",
"Penny": ""
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "亲爱的@^ 生日快乐宝贝。看着你成长成为一个善良努力的人,就如我一直梦想着你成为的样子,我感到十分欣喜。我希望你能继续跟你爱的人制造更多美好的回忆。 ^ 爱你的,妈妈 ^ 附言:这是我给你做的一点小礼物。 %item object 221 1 %%",
"Mail:birthdayDad": "亲爱的@^ 生日快乐孩子。你生日的这天没有你,我们这儿还挺寂寞的,但我和你妈妈都知道你让我们和你爷爷感到骄傲。我们知道你一个人生活可能会很艰难,但我们百分百相信你能做到,所以继续追求你的梦想吧。^ 爱你的,爸爸 ^ 附言:这是能在农场上帮到你的一些零用钱。祝你好运! %item money 5000 5001 %%",
"Happy Birthday: Star Message": "今天是你的生日!生日快乐!",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,811 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Omegasis.HappyBirthday.Framework.EventPreconditions;
using StardustCore.Events;
using StardustCore.Events.Preconditions;
using StardustCore.Events.Preconditions.TimeSpecific;
using StardewValley;
using Microsoft.Xna.Framework;
using StardustCore.Events.Preconditions.PlayerSpecific;
namespace Omegasis.HappyBirthday.Framework
{
public class BirthdayEvents
{
/// <summary>
/// Creates the junimo birthday party event.
/// </summary>
/// <returns></returns>
public static EventHelper CommunityCenterJunimoBirthday()
{
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 CanReadJunimo());
conditions.Add(new StardustCore.Events.Preconditions.PlayerSpecific.JojaMember(false));
conditions.Add(new CommunityCenterCompleted(false));
//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("playful", 32, 12, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>()));
e.AddInJunimoActor("Juni", new Microsoft.Xna.Framework.Vector2(32, 10), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni2", new Microsoft.Xna.Framework.Vector2(30, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni3", new Microsoft.Xna.Framework.Vector2(34, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni4", new Microsoft.Xna.Framework.Vector2(26, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni5", new Microsoft.Xna.Framework.Vector2(28, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni6Tank", new Vector2(38, 10), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni7", new Vector2(27, 16), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni8", new Vector2(40, 15), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddJunimoAdvanceMoveTiles(new StardustCore.Utilities.JunimoAdvanceMoveData("Juni6Tank", new List<Point>()
{
new Point(38,10),
new Point(38,11),
new Point(39,11),
new Point(40,11),
new Point(41,11),
new Point(42,11),
new Point(42,10),
new Point(41,10),
new Point(40,10),
new Point(39,10),
}, 60, 1, true)); ;
e.FlipJunimoActor("Juni5", true);
e.junimoFaceDirection("Juni4", EventHelper.FacingDirection.Right); //Make a junimo face right.
e.junimoFaceDirection("Juni5", EventHelper.FacingDirection.Left);
e.junimoFaceDirection("Juni7", EventHelper.FacingDirection.Down);
e.animate("Juni", true, true, 250, new List<int>()
{
28,
29,
30,
31
});
e.animate("Juni7", false, true, 250, new List<int>()
{
44,45,46,47
});
e.animate("Juni8", false, true, 250, new List<int>()
{
12,13,14,15
});
e.globalFadeIn();
e.moveFarmerUp(10, EventHelper.FacingDirection.Up, true);
e.junimoFaceDirection("Juni4", EventHelper.FacingDirection.Down);
e.junimoFaceDirection("Juni5", EventHelper.FacingDirection.Down);
e.RemoveJunimoAdvanceMove("Juni6Tank");
e.junimoFaceDirection("Juni6Tank", EventHelper.FacingDirection.Down);
e.junimoFaceDirection("Juni7", EventHelper.FacingDirection.Right);
e.FlipJunimoActor("Juni8", true);
e.junimoFaceDirection("Juni8", EventHelper.FacingDirection.Left);
e.playSound("junimoMeep1");
e.emoteFarmer_ExclamationMark();
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:JunimoBirthdayParty_0"));
e.emoteFarmer_Heart();
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:JunimoBirthdayParty_1"));
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.addObjectToPlayersInventory(220, 1, false);
e.end();
return e;
}
/// <summary>
/// Birthday event for when the player is dating Penny.
/// Status: Completed.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Penny()
{
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")));
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", 19951, conditions, new EventStartData("playful", 12, 8, new EventStartData.FarmerData(12, 9, 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(1, 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;
}
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.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Maru()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ScienceHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC maru = Game1.getCharacterFromName("Maru");
NPC sebastian = Game1.getCharacterFromName("Sebastian");
NPC robin = Game1.getCharacterFromName("Robin");
NPC demetrius = Game1.getCharacterFromName("Demetrius");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(maru));
EventHelper e = new EventHelper("BirthdayDating:Maru", 19952, conditions, new EventStartData("playful", 28, 12, new EventStartData.FarmerData(23, 12, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(maru,27,11, EventHelper.FacingDirection.Down),
new EventStartData.NPCData(sebastian,26,13, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(robin,28,9, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(demetrius,30,11, EventHelper.FacingDirection.Left)
}));
e.globalFadeIn();
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, true);
e.npcFaceDirection(maru, EventHelper.FacingDirection.Left);
e.npcFaceDirection(demetrius, EventHelper.FacingDirection.Left);
//Seb is already facing up.
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
//Dialogue goes here.
//Seriously improve dialogue lines. Maru is probably the NPC I know the least about.
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:0")); //maru 0
e.speak(demetrius, GetTranslatedString("Event:DatingMaruBirthday_Demetrius:0")); //demetrius 0
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:1"));//Maru 1 //Spoiler she doesn't.
e.speak(sebastian, GetTranslatedString("Event:DatingMaruBirthday_Sebastian:0")); //sebastian 0
e.speak(robin, GetTranslatedString("Event:DatingMaruBirthday_Robin:0")); //robin 0
e.speak(demetrius, GetTranslatedString("Event:DatingMaruBirthday_Demetrius:1")); //demetrius 1
e.emote_ExclamationMark("Robin");
e.npcFaceDirection(robin, EventHelper.FacingDirection.Up);
e.speak(robin, GetTranslatedString("Event:DatingMaruBirthday_Robin:1")); //robin 1
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
e.moveActorDown("Robin", 1, EventHelper.FacingDirection.Down, false);
e.addObject(27, 12, 220);
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:2")); //maru 2
e.emoteFarmer_Thinking();
e.speak(sebastian, GetTranslatedString("Event:DatingMaruBirthday_Sebastian:1")); //Sebastian 1
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:3")); //maru 3
//Event finish commands.
e.emoteFarmer_Heart();
e.emote_Heart("Maru");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingMaruBirthday_Finish:0")); //maru party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingMaruBirthday_Finish:1")); //maru party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Birthday event for when the player is dating Leah.
/// Finished.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Leah()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("LeahHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC leah = Game1.getCharacterFromName("Leah");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(leah));
EventHelper e = new EventHelper("BirthdayDating:Leah", 19954, conditions, new EventStartData("playful", 12, 7, new EventStartData.FarmerData(7, 9, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(leah,14,11, EventHelper.FacingDirection.Left),
}));
e.addObject(11, 11, 220);
e.globalFadeIn();
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
e.moveFarmerRight(5, EventHelper.FacingDirection.Down, false);
e.npcFaceDirection(leah, EventHelper.FacingDirection.Up);
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:0")); //0
e.moveFarmerDown(2, EventHelper.FacingDirection.Down, false);
e.moveFarmerRight(1, EventHelper.FacingDirection.Down, false);
e.moveFarmerDown(1, EventHelper.FacingDirection.Down, false);
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:1")); //1
e.emoteFarmer_Happy();
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:2"));//2
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:3"));//3
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:4"));//4
e.emoteFarmer_Heart();
e.emote_Heart("Leah");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingLeahBirthday_Finish:0")); //maru party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingLeahBirthday_Finish:1")); //maru party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Birthday event for when the player is dating Abigail.
/// Finished.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Abigail()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("SeedShop")));
conditions.Add(new TimePrecondition(600, 2600));
NPC abigail = Game1.getCharacterFromName("Abigail");
NPC pierre = Game1.getCharacterFromName("Pierre");
NPC caroline = Game1.getCharacterFromName("Caroline");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(abigail));
EventHelper e = new EventHelper("BirthdayDating:Abigail", 19955, conditions, new EventStartData("playful", 35, 7, new EventStartData.FarmerData(31, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(abigail,36,9, EventHelper.FacingDirection.Left),
new EventStartData.NPCData(pierre,33,6, EventHelper.FacingDirection.Down),
new EventStartData.NPCData(caroline,35,5, EventHelper.FacingDirection.Up),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerUp(2, EventHelper.FacingDirection.Right, false);
e.moveFarmerRight(4, EventHelper.FacingDirection.Right, false);
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:0")); //abi 0
e.npcFaceDirection(caroline, EventHelper.FacingDirection.Down);
e.speak(pierre, GetTranslatedString("Event:DatingAbigailBirthday_Pierre:0")); //pie 0
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:0")); //car 0
e.addObject(35, 5, 220);
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:1")); //abi 1
e.speak(pierre, GetTranslatedString("Event:DatingAbigailBirthday_Pierre:1")); //pie 1
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:1")); //car 1
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:2")); //car 2
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:2")); //abi 2
e.emoteFarmer_Thinking();
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:3"));//abi 3
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:4"));///abi 4
e.emoteFarmer_Heart();
e.emote_Heart("Abigail");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAbigailBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAbigailBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Emily()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HaleyHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC emily = Game1.getCharacterFromName("Emily");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(emily));
EventHelper e = new EventHelper("BirthdayDating:Emily", 19956, conditions, new EventStartData("playful", 20, 18, new EventStartData.FarmerData(11, 20, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(emily,20,17, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerRight(9, EventHelper.FacingDirection.Up, false);
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:0")); //emi 0
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:1")); //emi 0
e.emoteFarmer_Happy();
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:2")); //emi 0
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:3")); //emi 0
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:4")); //emi 0
e.emoteFarmer_Thinking();
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:5")); //emi 0
e.emoteFarmer_Heart();
e.emote_Heart("Emily");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingEmilyBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingEmilyBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Haley()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HaleyHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC haley = Game1.getCharacterFromName("Haley");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(haley));
EventHelper e = new EventHelper("BirthdayDating:Haley", 19957, conditions, new EventStartData("playful", 20, 18, new EventStartData.FarmerData(11, 20, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(haley,20,17, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerRight(9, EventHelper.FacingDirection.Up, false);
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:0"));
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:1"));
e.emoteFarmer_Happy();
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:2"));
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:3"));
e.emoteFarmer_Thinking();
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:4"));
e.emoteFarmer_Heart();
e.emote_Heart("Haley");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHaleyBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHaleyBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(221, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Sam()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("SamHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC sam = Game1.getCharacterFromName("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),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerUp(4, EventHelper.FacingDirection.Up, false);
e.moveFarmerLeft(3, EventHelper.FacingDirection.Left, false);
e.npcFaceDirection(sam, EventHelper.FacingDirection.Right);
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:0"));
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:1"));
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:2"));
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:3"));
e.emoteFarmer_Heart();
e.emote_Heart("Sam");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSamBirthday_Finish:0")); //sam party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSamBirthday_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>
/// Event that occurs when the player is dating Sebastian.
/// Status: Finished.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Sebastian()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ScienceHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC maru = Game1.getCharacterFromName("Maru");
NPC sebastian = Game1.getCharacterFromName("Sebastian");
NPC robin = Game1.getCharacterFromName("Robin");
NPC demetrius = Game1.getCharacterFromName("Demetrius");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(sebastian));
EventHelper e = new EventHelper("BirthdayDating:Sebastian", 19952, conditions, new EventStartData("playful", 28, 12, new EventStartData.FarmerData(23, 12, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(maru,27,11, EventHelper.FacingDirection.Down),
new EventStartData.NPCData(sebastian,26,13, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(robin,28,9, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(demetrius,30,11, EventHelper.FacingDirection.Left)
}));
e.globalFadeIn();
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, true);
e.npcFaceDirection(maru, EventHelper.FacingDirection.Left);
e.npcFaceDirection(demetrius, EventHelper.FacingDirection.Left);
//Seb is already facing up.
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
//Dialogue goes here.
//Seriously improve dialogue lines. Maru is probably the NPC I know the least about.
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:0")); //sebastian 0
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:0")); //maru 0
e.speak(maru, GetTranslatedString("Event:DatingSebastianBirthday_Maru:0"));//Maru 0
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:1")); //robin 0
e.speak(demetrius, GetTranslatedString("Event:DatingSebastianBirthday_Demetrius:0")); //demetrius 0
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:1")); //Sebastian 1
e.emote_ExclamationMark("Robin");
e.npcFaceDirection(robin, EventHelper.FacingDirection.Up);
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:2")); //robin 1
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
e.moveActorDown("Robin", 1, EventHelper.FacingDirection.Down, false);
e.addObject(27, 12, 220);
e.speak(demetrius, GetTranslatedString("Event:DatingSebastianBirthday_Demetrius:1")); //maru 2
e.emoteFarmer_Thinking();
e.speak(maru, GetTranslatedString("Event:DatingSebastianBirthday_Maru:1")); //maru 3
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:2")); //Sebastian 1
//Event finish commands.
e.emoteFarmer_Heart();
e.emote_Heart("Sebastian");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSebastianBirthday_Finish:0")); //maru party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSebastianBirthday_Finish:1")); //maru party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Elliott()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ElliottHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC elliott = Game1.getCharacterFromName("Elliott");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(elliott));
EventHelper e = new EventHelper("BirthdayDating:Elliott", 19958, conditions, new EventStartData("playful", 3, 5, new EventStartData.FarmerData(3, 8, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(elliott,3,5, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:0"));
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:1"));
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:2"));
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:3"));
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:4"));
e.emoteFarmer_Thinking();
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:5"));
e.emoteFarmer_Heart();
e.emote_Heart("Elliott");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingElliottBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingElliottBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
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,25,16, 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>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HarveyRoom")));
conditions.Add(new TimePrecondition(600, 2600));
NPC harvey = Game1.getCharacterFromName("Harvey");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(harvey));
EventHelper e = new EventHelper("BirthdayDating:Harvey", 19957, conditions, new EventStartData("playful", 6, 6, new EventStartData.FarmerData(6, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(harvey,3,6, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerUp(5, EventHelper.FacingDirection.Up, false);
e.moveFarmerLeft(2, EventHelper.FacingDirection.Left, false);
e.npcFaceDirection(harvey, EventHelper.FacingDirection.Right);
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:0"));
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:1"));
e.emoteFarmer_QuestionMark();
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:2"));
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:3"));
e.emoteFarmer_Heart();
e.emote_Heart("Harvey");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHarveyBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHarveyBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(237, 1, false);
e.addObjectToPlayersInventory(348, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
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 JojaBirthday()
{
}
*/
public static string GetTranslatedString(string Key)
{
return HappyBirthday.Config.translationInfo.getTranslatedString(Key);
}
}
}

View File

@ -27,6 +27,7 @@ namespace Omegasis.HappyBirthday.Framework
/// <summary>The player's current birthday season.</summary>
private string BirthdaySeason;
private string seasonName;
/// <summary>The player's current birthday day.</summary>
private int BirthdayDay;
@ -45,7 +46,8 @@ namespace Omegasis.HappyBirthday.Framework
public BirthdayMenu(string season, int day, Action<string, int> onChanged)
: base(Game1.viewport.Width / 2 - (632 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2 - Game1.tileSize, 632 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2 + Game1.tileSize)
{
this.BirthdaySeason = season;
this.BirthdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString(season);
this.seasonName = season;
this.BirthdayDay = day;
this.OnChanged = onChanged;
this.SetUpPositions();
@ -73,13 +75,14 @@ namespace Omegasis.HappyBirthday.Framework
this.DayButtons.Clear();
this.OkButton = new ClickableTextureComponent("OK", new Rectangle(this.xPositionOnScreen + this.width - IClickableMenu.borderWidth - IClickableMenu.spaceToClearSideBorder - Game1.tileSize, this.yPositionOnScreen + this.height - IClickableMenu.borderWidth - IClickableMenu.spaceToClearTopBorder + Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), "", null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46), 1f);
this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 8, 1, 1), "Birthday Season: " + this.BirthdaySeason));
this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize, Game1.tileSize * 2, Game1.tileSize), "Birthday Date: " + this.BirthdayDay));
this.SeasonButtons.Add(new ClickableTextureComponent("Spring", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(188, 438, 32, 9), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Summer", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(220, 438, 32, 8), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Fall", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(188, 447, 32, 10), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Winter", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 7 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(220, 448, 32, 8), Game1.pixelZoom));
string bdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString("Birthday") + " " + HappyBirthday.Config.translationInfo.getTranslatedString("Season");
string bdayDay= HappyBirthday.Config.translationInfo.getTranslatedString("Birthday") + " " + HappyBirthday.Config.translationInfo.getTranslatedString("Date");
this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 8, 1, 1), bdaySeason+": " + this.BirthdaySeason));
this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize, Game1.tileSize * 2, Game1.tileSize), bdayDay+": " + this.BirthdayDay));
this.SeasonButtons.Add(new ClickableTextureComponent("Spring", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, this.getSpringButton(), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Summer", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, this.getSummerButton(), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Fall", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, this.getFallButton(), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Winter", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 7 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, this.getWinterButton(), Game1.pixelZoom));
this.DayButtons.Add(new ClickableTextureComponent("1", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
this.DayButtons.Add(new ClickableTextureComponent("2", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 2 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
@ -128,6 +131,7 @@ namespace Omegasis.HappyBirthday.Framework
this.DayButtons.Add(new ClickableTextureComponent("27", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(56, 16, 8, 12), Game1.pixelZoom));
this.DayButtons.Add(new ClickableTextureComponent("28", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
this.DayButtons.Add(new ClickableTextureComponent("28", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 7.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), Game1.pixelZoom));
}
/// <summary>Handle a button click.</summary>
@ -144,9 +148,10 @@ namespace Omegasis.HappyBirthday.Framework
case "Summer":
case "Fall":
case "Winter":
this.BirthdaySeason = name.ToLower();
this.OnChanged(this.BirthdaySeason, this.BirthdayDay);
Game1.activeClickableMenu = new BirthdayMenu(this.BirthdaySeason, this.BirthdayDay, this.OnChanged);
this.BirthdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString(name);
this.seasonName = name;
this.OnChanged(this.seasonName, this.BirthdayDay);
Game1.activeClickableMenu = new BirthdayMenu(this.seasonName, this.BirthdayDay, this.OnChanged);
break;
// OK button
@ -158,8 +163,8 @@ namespace Omegasis.HappyBirthday.Framework
default:
this.BirthdayDay = Convert.ToInt32(name);
this.OnChanged(this.BirthdaySeason, this.BirthdayDay);
Game1.activeClickableMenu = new BirthdayMenu(this.BirthdaySeason, this.BirthdayDay, this.OnChanged);
this.OnChanged(this.seasonName, this.BirthdayDay);
Game1.activeClickableMenu = new BirthdayMenu(this.seasonName, this.BirthdayDay, this.OnChanged);
break;
}
Game1.playSound("coin");
@ -172,7 +177,7 @@ namespace Omegasis.HappyBirthday.Framework
public override void receiveLeftClick(int x, int y, bool playSound = true)
{
//If the season is not selected then the day buttons can't be clicked. Thanks to @Potato#5266 on the SDV discord for this tip.
if (this.BirthdaySeason == "spring" || this.BirthdaySeason == "summer" || this.BirthdaySeason == "fall" || this.BirthdaySeason == "winter")
if (string.IsNullOrEmpty(this.seasonName)==false)
{
foreach (ClickableTextureComponent button in this.DayButtons)
{
@ -197,7 +202,7 @@ namespace Omegasis.HappyBirthday.Framework
if (this.OkButton.containsPoint(x, y))
{
if (this.BirthdaySeason == "" || this.BirthdayDay == 0) return;
if (this.seasonName == "" || this.BirthdayDay == 0) return;
this.HandleButtonClick(this.OkButton.name);
this.OkButton.scale -= 0.25f;
this.OkButton.scale = Math.Max(0.75f, this.OkButton.scale);
@ -241,10 +246,11 @@ namespace Omegasis.HappyBirthday.Framework
{
// draw menu box
Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true);
b.Draw(Game1.daybg, new Vector2((this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)), Color.White);
//b.Draw(Game1.daybg, new Vector2((this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)), Color.White);
//Game1.player.FarmerSprite.draw(b, new Vector2((this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)),1f);
// draw day buttons
if (this.BirthdaySeason == "spring" || this.BirthdaySeason == "summer" || this.BirthdaySeason == "fall" || this.BirthdaySeason == "winter")
if (string.IsNullOrEmpty(this.seasonName)==false)
{
foreach (ClickableTextureComponent button in this.DayButtons)
button.draw(b);
@ -270,7 +276,7 @@ namespace Omegasis.HappyBirthday.Framework
}
// draw OK button
if (this.BirthdayDay != 0 && this.BirthdaySeason != "")
if (this.BirthdayDay != 0 && this.seasonName != "")
this.OkButton.draw(b);
else
{
@ -281,5 +287,31 @@ namespace Omegasis.HappyBirthday.Framework
// draw cursor
this.drawMouse(b);
}
public Rectangle getSpringButton()
{
//For some reason turkish and italian don't use translated words for the seasons???
if (HappyBirthday.Config.translationInfo.CurrentTranslation == TranslationInfo.LanguageName.Chinese)
{
return new Rectangle(188, 437, 32, 9);
}
else
{
return new Rectangle(188, 438, 32, 9);
}
}
public Rectangle getSummerButton()
{
return new Rectangle(220, 438, 32, 8);
}
public Rectangle getFallButton()
{
return new Rectangle(188, 447, 32, 10);
}
public Rectangle getWinterButton()
{
return new Rectangle(220, 448, 32, 8);
}
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StardustCore.Events.Preconditions;
namespace Omegasis.HappyBirthday.Framework.EventPreconditions
{
public class FarmerBirthdayPrecondition:EventPrecondition
{
public FarmerBirthdayPrecondition()
{
}
public override string ToString()
{
return "Omegasis.HappyBirthday";
}
public override bool meetsCondition()
{
return HappyBirthday.Instance.IsBirthday();
}
}
}

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StardustCore.Events.Preconditions;
using StardewValley;
namespace Omegasis.HappyBirthday.Framework.EventPreconditions
{
public class SpouseBirthdayPrecondition:EventPrecondition
{
public SpouseBirthdayPrecondition()
{
}
public override bool meetsCondition()
{
if (Game1.player.getSpouse() == null) return false;
else
{
NPC spouse = Game1.player.getSpouse();
if (spouse.isBirthday(Game1.currentSeason, Game1.dayOfMonth)){
return true;
}
else
{
return false;
}
}
}
}
}

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

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using StardewValley;
namespace Omegasis.HappyBirthday.Framework
@ -7,195 +9,187 @@ namespace Omegasis.HappyBirthday.Framework
/// <summary>A class which deals with handling different translations for Vocalization should other voice teams ever wish to voice act for that language.</summary>
public class TranslationInfo
{
/// <summary>The list of all supported translations by this mod.</summary>
public List<string> translations;
public enum LanguageName
{
English,
Spanish,
Chinese,
Japanese,
Russian,
German,
Portuguese,
Italian,
French,
Korean,
Turkish,
Hungarian
}
public enum FileType
{
XNB,
JSON
}
/*********
** Accessors
*********/
/// <summary>The language names supported by this mod.</summary>
public LanguageName[] LanguageNames { get; } = (from LanguageName language in Enum.GetValues(typeof(LanguageName)) select language).ToArray();
/// <summary>The current translation mode for the mod, so that it knows what files to load at the beginning of the game.</summary>
public string currentTranslation;
public LanguageName CurrentTranslation { get; set; } = LanguageName.English;
/// <summary>Holds the info for what translation has what file extension.</summary>
public Dictionary<string, string> translationFileInfo;
public Dictionary<LanguageName, string> TranslationFileExtensions { get; } = new Dictionary<LanguageName, string>();
public Dictionary<string, LocalizedContentManager.LanguageCode> translationCodes;
public Dictionary<LanguageName, LocalizedContentManager.LanguageCode> TranslationCodes { get; } = new Dictionary<LanguageName, LocalizedContentManager.LanguageCode>();
/// <summary>Construct an instance..</summary>
/*********
** Public methods
*********/
/// <summary>Construct an instance.</summary>
public TranslationInfo()
{
this.translations = new List<string>();
this.translationFileInfo = new Dictionary<string, string>();
this.translationCodes = new Dictionary<string, LocalizedContentManager.LanguageCode>();
this.translations.Add("English");
this.translations.Add("Spanish");
this.translations.Add("Chinese");
this.translations.Add("Japanese");
this.translations.Add("Russian");
this.translations.Add("German");
this.translations.Add("Brazillian Portuguese");
this.currentTranslation = "English";
this.translationFileInfo.Add("English", ".json");
this.translationFileInfo.Add("Spanish", ".es-ES.json");
this.translationFileInfo.Add("Chinese", ".zh-CN.json");
this.translationFileInfo.Add("Japanese", ".ja-JP.json");
this.translationFileInfo.Add("Russian", ".ru-RU.json");
this.translationFileInfo.Add("German", ".de-DE.json");
this.translationFileInfo.Add("Brazillian Portuguese", ".pt-BR.json");
this.TranslationFileExtensions.Add(LanguageName.English, "en-US");
this.TranslationFileExtensions.Add(LanguageName.Spanish, "es-ES");
this.TranslationFileExtensions.Add(LanguageName.Chinese, "zh-CN");
this.TranslationFileExtensions.Add(LanguageName.Japanese, "ja-JP");
this.TranslationFileExtensions.Add(LanguageName.Russian, "ru-RU");
this.TranslationFileExtensions.Add(LanguageName.German, "de-DE");
this.TranslationFileExtensions.Add(LanguageName.Portuguese, "pt-BR");
//1.3 languages.
this.TranslationFileExtensions.Add(LanguageName.Italian, "it-IT");
this.TranslationFileExtensions.Add(LanguageName.French, "fr-FR");
this.TranslationFileExtensions.Add(LanguageName.Hungarian, "hu-HU");
this.TranslationFileExtensions.Add(LanguageName.Turkish, "tr-TR");
this.TranslationFileExtensions.Add(LanguageName.Korean, "ko-KR");
this.translationCodes.Add("English", LocalizedContentManager.LanguageCode.en);
this.translationCodes.Add("Spanish", LocalizedContentManager.LanguageCode.es);
this.translationCodes.Add("Chinese", LocalizedContentManager.LanguageCode.zh);
this.translationCodes.Add("Japanese", LocalizedContentManager.LanguageCode.ja);
this.translationCodes.Add("Russian", LocalizedContentManager.LanguageCode.ru);
this.translationCodes.Add("German", LocalizedContentManager.LanguageCode.de);
this.translationCodes.Add("Brazillian Portuguese", LocalizedContentManager.LanguageCode.pt);
this.TranslationCodes.Add(LanguageName.English, LocalizedContentManager.LanguageCode.en);
this.TranslationCodes.Add(LanguageName.Spanish, LocalizedContentManager.LanguageCode.es);
this.TranslationCodes.Add(LanguageName.Chinese, LocalizedContentManager.LanguageCode.zh);
this.TranslationCodes.Add(LanguageName.Japanese, LocalizedContentManager.LanguageCode.ja);
this.TranslationCodes.Add(LanguageName.Russian, LocalizedContentManager.LanguageCode.ru);
this.TranslationCodes.Add(LanguageName.German, LocalizedContentManager.LanguageCode.de);
this.TranslationCodes.Add(LanguageName.Portuguese, LocalizedContentManager.LanguageCode.pt);
//1.3 languages
this.TranslationCodes.Add(LanguageName.Italian, LocalizedContentManager.LanguageCode.it);
this.TranslationCodes.Add(LanguageName.French, LocalizedContentManager.LanguageCode.fr);
this.TranslationCodes.Add(LanguageName.Hungarian, LocalizedContentManager.LanguageCode.hu);
this.TranslationCodes.Add(LanguageName.Turkish, LocalizedContentManager.LanguageCode.tr);
this.TranslationCodes.Add(LanguageName.Korean, LocalizedContentManager.LanguageCode.ko);
}
/// <summary>
/// Gets the current SDV translation code.
/// </summary>
/// <returns></returns>
public LocalizedContentManager.LanguageCode getCurrrentLanguageCode()
{
return this.TranslationCodes[this.CurrentTranslation];
}
public string getTranslationNameFromPath(string fullPath)
public void setTranslationFromLanguageCode(LocalizedContentManager.LanguageCode code)
{
return Path.GetFileName(fullPath);
}
public void changeLocalizedContentManagerFromTranslation(string translation)
{
string tra = this.getTranslationNameFromPath(translation);
bool f = this.translationCodes.TryGetValue(tra, out LocalizedContentManager.LanguageCode code);
if (!f) LocalizedContentManager.CurrentLanguageCode = LocalizedContentManager.LanguageCode.en;
else LocalizedContentManager.CurrentLanguageCode = code;
return;
}
public void resetLocalizationCode()
{
LocalizedContentManager.CurrentLanguageCode = LocalizedContentManager.LanguageCode.en;
foreach (var v in this.TranslationCodes)
{
if (v.Value.Equals(code))
{
this.CurrentTranslation = v.Key;
HappyBirthday.ModHelper.WriteConfig<ModConfig>(HappyBirthday.Config);
return;
}
}
}
/// <summary>Gets the proper file extension for the current translation.</summary>
/// <param name="path"></param>
public string getFileExtentionForTranslation(string path)
/// <param name="language">The translation language name.</param>
public string getFileExtentionForTranslation(LanguageName language, FileType File)
{
/*
bool f = translationFileInfo.TryGetValue(translation, out string value);
if (!f) return ".json";
else return value;
*/
string translation = Path.GetFileName(path);
try
{
return this.translationFileInfo[translation];
if (language == LanguageName.English)
{
return this.getFileExtensionForFileType(File);
}
return "."+this.TranslationFileExtensions[language] + this.getFileExtensionForFileType(File);
}
catch
catch (Exception err)
{
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log(err.ToString());
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log($"Attempted to get translation: {language}");
return ".xnb";
}
}
public string getFileExtensionForFileType(FileType Type)
{
if (Type == FileType.JSON)
{
HappyBirthday.ModMonitor.Log("WTF SOMETHING IS WRONG!", StardewModdingAPI.LogLevel.Warn);
//Vocalization.ModMonitor.Log(err.ToString());
//Vocalization.ModMonitor.Log("Attempted to get translation: " + translation);
return ".json";
}
}
/// <summary>Gets the proper json for Buildings (aka Blueprints) from the data folder.</summary>
public string getBuildingjsonForTranslation(string translation)
{
string buildings = "Blueprints";
return buildings + this.getFileExtentionForTranslation(translation);
}
/// <summary>Gets the proper json file for the name passed in. Combines the file name with it's proper translation extension.</summary>
/// <param name="jsonFileName"></param>
/// <param name="translation"></param>
public string getjsonForTranslation(string jsonFileName, string translation)
{
return jsonFileName + this.getFileExtentionForTranslation(translation);
}
/// <summary>Loads an json file from StardewValley/Content</summary>
/// <param name="jsonFileName"></param>
/// <param name="key"></param>
/// <param name="translation"></param>
public string LoadjsonFile(string jsonFileName, string key, string translation)
{
string json = jsonFileName + this.getFileExtentionForTranslation(translation);
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(json);
bool f = loadedDict.TryGetValue(key, out string loaded);
if (!f)
else
{
//Vocalization.ModMonitor.Log("Big issue: Key not found in file:" + json + " " + key);
return ".xnb";
}
}
public string getFileExtentionForDirectory(LanguageName language)
{
try
{
string s = this.TranslationFileExtensions[language];
return s;
}
catch (Exception err)
{
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log(err.ToString());
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log($"Attempted to get translation: {language}");
return "";
}
else return loaded;
}
/// <summary>Loads a string dictionary from a json file.</summary>
/// <param name="jsonFileName"></param>
/// <param name="translation"></param>
public Dictionary<string, string> LoadJsonFileDictionary(string jsonFileName, string translation)
{
string json = jsonFileName + this.getFileExtentionForTranslation(translation);
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(json);
return loadedDict;
}
public virtual string LoadString(string path, string translation, object sub1, object sub2, object sub3)
/// <summary>
/// Gets the json file for the translation.
/// </summary>
/// <param name="FileName"></param>
/// <param name="language"></param>
/// <returns></returns>
public string getJSONForTranslation(string FileName, LanguageName language)
{
string format = this.LoadString(path, translation);
try
if (language != LanguageName.English)
{
return string.Format(format, sub1, sub2, sub3);
return FileName + this.getFileExtentionForTranslation(language, FileType.JSON);
}
catch { }
return format;
}
public virtual string LoadString(string path, string translation, object sub1, object sub2)
{
string format = this.LoadString(path, translation);
try
else
{
return string.Format(format, sub1, sub2);
return FileName + this.getFileExtentionForTranslation(language, FileType.JSON);
}
catch { }
return format;
}
public virtual string LoadString(string path, string translation, object sub1)
/// <summary>Loads an XNB file from StardewValley/Content</summary>
public string LoadStringFromXNBFile(string xnbFileName, string key, LanguageName language)
{
string format = this.LoadString(path, translation);
try
{
return string.Format(format, sub1);
}
catch { }
string xnb = xnbFileName + this.getFileExtentionForTranslation(language, FileType.XNB);
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(xnb);
return format;
if (!loadedDict.TryGetValue(key, out string loaded))
{
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log("Big issue: Key not found in file:" + xnb + " " + key);
return "";
}
return loaded;
}
public virtual string LoadString(string path, string translation)
public virtual string LoadString(string path, LanguageName language)
{
this.parseStringPath(path, out string assetName, out string key);
return this.LoadjsonFile(assetName, key, translation);
}
public virtual string LoadString(string path, string translation, params object[] substitutions)
{
string format = this.LoadString(path, translation);
if (substitutions.Length != 0)
{
try
{
return string.Format(format, substitutions);
}
catch { }
}
return format;
return this.LoadStringFromXNBFile(assetName, key, language);
}
private void parseStringPath(string path, out string assetName, out string key)
@ -204,5 +198,63 @@ namespace Omegasis.HappyBirthday.Framework
assetName = path.Substring(0, length);
key = path.Substring(length + 1, path.Length - length - 1);
}
/// <summary>
/// Gets a translated string from the the dictionary with the proper translation; Returns an empty string if this fails somehow.
/// </summary>
/// <param name="Language"></param>
/// <param name="Key"></param>
/// <returns></returns>
public string getTranslatedString(LocalizedContentManager.LanguageCode Language, string Key)
{
try
{
return HappyBirthday.Instance.messages.translatedStrings[Language][Key];
}
catch (Exception err)
{
return "";
}
}
public string getTranslatedString(string Key)
{
if (string.IsNullOrEmpty(Key)) return "";
if (Key.Equals("Birthday"))
{
string s = Game1.content.LoadString("Strings\\UI:Profile_Birthday");
return s;
}
if (Key.Equals("Spring") || Key.Equals("spring"))
{
string file = Path.Combine("Strings", "StringsFromCSFiles");
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5680", HappyBirthday.Config.translationInfo.CurrentTranslation);
}
if (Key.Equals("Summer") || Key.Equals("summer"))
{
string file = Path.Combine("Strings", "StringsFromCSFiles");
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5681", HappyBirthday.Config.translationInfo.CurrentTranslation);
}
if (Key.Equals("Fall") || Key.Equals("fall"))
{
string file = Path.Combine("Strings", "StringsFromCSFiles");
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5682", HappyBirthday.Config.translationInfo.CurrentTranslation);
}
if (Key.Equals("Winter") || Key.Equals("winter"))
{
string file = Path.Combine("Strings", "StringsFromCSFiles");
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5683", HappyBirthday.Config.translationInfo.CurrentTranslation);
}
try
{
return HappyBirthday.Instance.messages.translatedStrings[this.getCurrrentLanguageCode()][Key];
}
catch (Exception err)
{
return "";
}
}
}
}

View File

@ -5,12 +5,14 @@ using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Omegasis.HappyBirthday.Framework;
using StardustCore.Events;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
using StardewValley.Characters;
using StardewValley.Menus;
using StardewValley.Monsters;
using StardustCore.Utilities;
namespace Omegasis.HappyBirthday
{
@ -69,6 +71,8 @@ namespace Omegasis.HappyBirthday
private NPC lastSpeaker;
private EventManager eventManager;
/*********
** Public methods
*********/
@ -78,8 +82,6 @@ namespace Omegasis.HappyBirthday
{
Instance = this;
//helper.Content.AssetLoaders.Add(new PossibleGifts());
Config = helper.ReadConfig<ModConfig>();
helper.Events.GameLoop.DayStarted += this.OnDayStarted;
@ -88,23 +90,102 @@ namespace Omegasis.HappyBirthday
helper.Events.GameLoop.Saving += this.OnSaving;
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
helper.Events.Display.MenuChanged += this.OnMenuChanged;
helper.Events.Display.RenderedActiveMenu += this.OnRenderedActiveMenu;
helper.Events.Display.RenderedHud += this.OnRenderedHud;
//MultiplayerSupport.initializeMultiplayerSupport();
helper.Events.Multiplayer.ModMessageReceived += this.Multiplayer_ModMessageReceived;
helper.Events.Multiplayer.PeerDisconnected += this.Multiplayer_PeerDisconnected;
helper.Events.GameLoop.GameLaunched += this.GameLoop_GameLaunched;
helper.Events.Player.Warped += this.Player_Warped;
helper.Events.GameLoop.ReturnedToTitle += this.GameLoop_ReturnedToTitle;
ModHelper = this.Helper;
ModMonitor = this.Monitor;
this.othersBirthdays = new Dictionary<long, PlayerData>();
this.eventManager = new EventManager();
}
private void GameLoop_ReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
{
this.eventManager = new EventManager();
}
private void Player_Warped(object sender, WarpedEventArgs e)
{
if (e.NewLocation == Game1.getLocationFromName("CommunityCenter"))
{
EventHelper eve=this.eventManager.getEvent("CommunityCenterBirthday");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("Trailer"))
{
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"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Maru");
eve.startEventAtLocationifPossible();
EventHelper eve2 = this.eventManager.getEvent("BirthdayDating:Sebastian");
eve2.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("LeahHouse"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Leah");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("SeedShop"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Abigail");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("HaleyHouse"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Emily");
eve.startEventAtLocationifPossible();
EventHelper eve2 = this.eventManager.getEvent("BirthdayDating:Haley");
eve2.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("HarveyRoom"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Harvey");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("ElliottHouse"))
{
EventHelper eve = this.eventManager.getEvent("BirthdayDating:Elliott");
eve.startEventAtLocationifPossible();
}
if (e.NewLocation == Game1.getLocationFromName("SamHouse"))
{
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)
{
this.messages = new BirthdayMessages();
this.giftManager = new GiftManager();
this.isDailyQuestBoard = false;
ModHelper.Events.Multiplayer.ModMessageReceived += this.Multiplayer_ModMessageReceived;
ModHelper.Events.Multiplayer.PeerDisconnected += this.Multiplayer_PeerDisconnected;
this.othersBirthdays = new Dictionary<long, PlayerData>();
}
/// <summary>Get whether this instance can edit the given asset.</summary>
@ -120,11 +201,21 @@ namespace Omegasis.HappyBirthday
{
IDictionary<string, string> data = asset.AsDictionary<string, string>().Data;
string momMail = BirthdayMessages.GetTranslatedString("Mail:birthdayMom");
string dadMail = BirthdayMessages.GetTranslatedString("Mail:birthdayDad");
data["birthdayMom"] = momMail;
data["birthdayDad"] = dadMail;
data["birthdayMom"] = BirthdayMessages.GetTranslatedString("Mail:birthdayMom");
data["birthdayDad"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDad");
data["birthdayJunimos"] = BirthdayMessages.GetTranslatedString("Mail:birthdayJunimos");
data["birthdayDatingPenny"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingPenny");
data["birthdayDatingMaru"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingMaru");
data["birthdayDatingSebastian"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingSebastian");
data["birthdayDatingLeah"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingLeah");
data["birthdayDatingAbigail"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingAbigail");
data["birthdayDatingEmily"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingEmily");
data["birthdayDatingHaley"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingHaley");
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");
}
@ -179,8 +270,6 @@ namespace Omegasis.HappyBirthday
if (this.isDailyQuestBoard || billboard.calendarDays == null)
return;
//Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 1f, 4f, 2, Game1.player);
string hoverText = "";
List<string> texts = new List<string>();
@ -301,8 +390,11 @@ namespace Omegasis.HappyBirthday
if (this.PlayerData.BirthdaySeason.ToLower() == Game1.currentSeason.ToLower())
{
int index = this.PlayerData.BirthdayDay;
string bdayDisplay = Game1.content.LoadString("Strings\\UI:Billboard_Birthday");
Rectangle birthdayRect = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 200 + (index - 1) / 7 * 32 * 4, 124, 124);
billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", $"{Game1.player.Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", string.Format(bdayDisplay, Game1.player.Name), text, new Rectangle(0, 0, 124, 124), 1f, false));
//billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", $"{Game1.player.Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
}
}
@ -310,8 +402,10 @@ namespace Omegasis.HappyBirthday
{
if (pair.Value.BirthdaySeason != Game1.currentSeason.ToLower()) continue;
int index = pair.Value.BirthdayDay;
string bdayDisplay = Game1.content.LoadString("Strings\\UI:Billboard_Birthday");
Rectangle otherBirthdayRect = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 200 + (index - 1) / 7 * 32 * 4, 124, 124);
billboard.calendarDays.Add(new ClickableTextureComponent("", otherBirthdayRect, "", $"{Game1.getFarmer(pair.Key).Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
billboard.calendarDays.Add(new ClickableTextureComponent("", otherBirthdayRect, "", string.Format(bdayDisplay, Game1.getFarmer(pair.Key).Name), text, new Rectangle(0, 0, 124, 124), 1f, false));
}
break;
@ -328,104 +422,8 @@ namespace Omegasis.HappyBirthday
if ((Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.Name) < Config.minimumFriendshipLevelForBirthdayWish)) return;
if (Game1.activeClickableMenu is StardewValley.Menus.DialogueBox && this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayWish==false && (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.Name) >= Config.minimumFriendshipLevelForBirthdayWish))
{
IReflectedField < Dialogue > cDialogue= this.Helper.Reflection.GetField<Dialogue>((Game1.activeClickableMenu as DialogueBox), "characterDialogue", true);
IReflectedField<List<string>> dialogues = this.Helper.Reflection.GetField<List<string>>((Game1.activeClickableMenu as DialogueBox), "dialogues", true);
string dialogueMessage = "";
if (Game1.player.getSpouse() != null)
{
if (this.messages.spouseBirthdayWishes.ContainsKey(Game1.currentSpeaker.Name))
{
dialogueMessage = this.messages.spouseBirthdayWishes[Game1.currentSpeaker.Name];
}
else
{
dialogueMessage = "Happy Birthday @!";
}
}
else
{
if (this.messages.birthdayWishes.ContainsKey(Game1.currentSpeaker.Name))
{
dialogueMessage = this.messages.birthdayWishes[Game1.currentSpeaker.Name];
}
else
{
dialogueMessage = "Happy Birthday @!";
}
}
dialogueMessage = dialogueMessage.Replace("@", Game1.player.Name);
if (dialogues.GetValue().Contains(dialogueMessage))
{
string name = Game1.currentSpeaker.Name;
this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayWish = true;
/*
if (this.IsBirthday() && this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayGift==false && Game1.player.getFriendshipHeartLevelForNPC(name) >= Config.minNeutralFriendshipGiftLevel)
{
try
{
this.giftManager.SetNextBirthdayGift(Game1.currentSpeaker.Name);
this.Monitor.Log("Setting next birthday gift.");
}
catch (Exception ex)
{
this.Monitor.Log(ex.ToString(), LogLevel.Error);
}
}
*/
return;
}
if (cDialogue.GetValue() != null)
{
if (cDialogue.GetValue().getCurrentDialogue() == dialogueMessage)
{
string name = Game1.currentSpeaker.Name;
this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayWish = true;
if (this.IsBirthday() && this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayGift == false && Game1.player.getFriendshipHeartLevelForNPC(name) >= Config.minNeutralFriendshipGiftLevel)
{
try
{
this.giftManager.SetNextBirthdayGift(Game1.currentSpeaker.Name);
this.Monitor.Log("Setting next birthday gift. 3");
}
catch (Exception ex)
{
this.Monitor.Log(ex.ToString(), LogLevel.Error);
}
}
return;
}
}
Dialogue d;
if (Game1.player.getSpouse() != null)
{
if (this.messages.spouseBirthdayWishes.ContainsKey(Game1.currentSpeaker.Name))
{
d = new Dialogue(this.messages.spouseBirthdayWishes[Game1.currentSpeaker.Name], Game1.currentSpeaker);
}
else
{
d = new Dialogue("Happy Birthday @!", Game1.currentSpeaker);
}
}
else
{
if (this.messages.birthdayWishes.ContainsKey(Game1.currentSpeaker.Name))
{
d = new Dialogue(this.messages.birthdayWishes[Game1.currentSpeaker.Name], Game1.currentSpeaker);
}
else
{
d = new Dialogue("Happy Birthday @!", Game1.currentSpeaker);
}
}
//IReflectedField < Dialogue > cDialogue= this.Helper.Reflection.GetField<Dialogue>((Game1.activeClickableMenu as DialogueBox), "characterDialogue", true);
//IReflectedField<List<string>> dialogues = this.Helper.Reflection.GetField<List<string>>((Game1.activeClickableMenu as DialogueBox), "dialogues", true);
Game1.currentSpeaker.resetCurrentDialogue();
Game1.currentSpeaker.resetSeasonalDialogue();
this.Helper.Reflection.GetMethod(Game1.currentSpeaker, "loadCurrentDialogue", true).Invoke();
@ -442,7 +440,8 @@ namespace Omegasis.HappyBirthday
this.Monitor.Log(ex.ToString(), LogLevel.Error);
}
}
Game1.activeClickableMenu = new DialogueBox(d);
Game1.activeClickableMenu = new DialogueBox(new Dialogue(this.messages.getBirthdayMessage(Game1.currentSpeaker.Name),Game1.currentSpeaker));
this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayWish = true;
// Set birthday gift for the player to recieve from the npc they are currently talking with.
@ -496,18 +495,164 @@ namespace Omegasis.HappyBirthday
this.CheckedForBirthday = false;
// load settings
this.MigrateLegacyData();
//
//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)
{
ModMonitor.Log("Send all birthday information from " + Game1.player.Name);
//ModMonitor.Log("Send all birthday information from " + Game1.player.Name);
MultiplayerSupport.SendBirthdayInfoToOtherPlayers();
}
//this.SeenEvent = false;
//this.Dialogue = new Dictionary<string, Dialogue>();
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");
}
if (Game1.player.mailReceived.Contains("birthdayDatingPenny"))
{
Game1.player.mailReceived.Remove("birthdayDatingPenny");
}
if (Game1.player.mailReceived.Contains("birthdayDatingMaru"))
{
Game1.player.mailReceived.Remove("birthdayDatingMaru");
}
if (Game1.player.mailReceived.Contains("birthdayDatingSebastian"))
{
Game1.player.mailReceived.Remove("birthdayDatingSebastian");
}
if (Game1.player.mailReceived.Contains("birthdayDatingLeah"))
{
Game1.player.mailReceived.Remove("birthdayDatingLeah");
}
if (Game1.player.mailReceived.Contains("birthdayDatingAbigail"))
{
Game1.player.mailReceived.Remove("birthdayDatingAbigail");
}
if (Game1.player.mailReceived.Contains("birthdayDatingEmily"))
{
Game1.player.mailReceived.Remove("birthdayDatingEmily");
}
if (Game1.player.mailReceived.Contains("birthdayDatingHaley"))
{
Game1.player.mailReceived.Remove("birthdayDatingHaley");
}
if (Game1.player.mailReceived.Contains("birthdayDatingHarvey"))
{
Game1.player.mailReceived.Remove("birthdayDatingHarvey");
}
if (Game1.player.mailReceived.Contains("birthdayDatingElliott"))
{
Game1.player.mailReceived.Remove("birthdayDatingElliott");
}
if (Game1.player.mailReceived.Contains("birthdayDatingSam"))
{
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();
EventHelper birthdayDating_Abigail = BirthdayEvents.DatingBirthday_Abigail();
EventHelper birthdayDating_Emily = BirthdayEvents.DatingBirthday_Emily();
EventHelper birthdayDating_Haley = BirthdayEvents.DatingBirthday_Haley();
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);
this.eventManager.addEvent(birthdayDating_Abigail);
this.eventManager.addEvent(birthdayDating_Emily);
this.eventManager.addEvent(birthdayDating_Haley);
this.eventManager.addEvent(birthdayDating_Harvey);
this.eventManager.addEvent(birthdayDating_Elliott);
this.eventManager.addEvent(birthdayDating_Sam);
this.eventManager.addEvent(birthdayDating_Alex);
this.eventManager.addEvent(birthdayDating_Shane);
if (Game1.player.eventsSeen.Contains(communityCenterJunimoBirthday.getEventID()))
{
Game1.player.eventsSeen.Remove(communityCenterJunimoBirthday.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Penny.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Penny.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Maru.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Maru.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Sebastian.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Sebastian.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Leah.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Leah.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Abigail.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Abigail.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Emily.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Emily.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Haley.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Haley.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Harvey.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Harvey.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Elliott.getEventID()))
{
Game1.player.eventsSeen.Remove(birthdayDating_Elliott.getEventID()); //Repeat the event.
}
if (Game1.player.eventsSeen.Contains(birthdayDating_Sam.getEventID()))
{
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>
@ -525,8 +670,19 @@ namespace Omegasis.HappyBirthday
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
{
if (!Context.IsWorldReady || Game1.eventUp || Game1.isFestival())
if (!Context.IsWorldReady || Game1.isFestival())
{
return;
}
if (Game1.eventUp)
{
if (this.eventManager != null)
{
this.eventManager.update();
}
return;
}
if (!this.HasChosenBirthday && Game1.activeClickableMenu == null && Game1.player.Name.ToLower() != "unnamed farmhand")
{
@ -544,7 +700,7 @@ namespace Omegasis.HappyBirthday
string starMessage = BirthdayMessages.GetTranslatedString("Happy Birthday: Star Message");
ModMonitor.Log(starMessage);
//ModMonitor.Log(starMessage);
Messages.ShowStarMessage(starMessage);
MultiplayerSupport.SendBirthdayMessageToOtherPlayers();
@ -552,6 +708,100 @@ namespace Omegasis.HappyBirthday
Game1.player.mailbox.Add("birthdayMom");
Game1.player.mailbox.Add("birthdayDad");
if (Game1.player.friendshipData.ContainsKey("Penny"))
{
if (Game1.player.friendshipData["Penny"].IsDating()){
Game1.player.mailbox.Add("birthdayDatingPenny");
}
}
if (Game1.player.friendshipData.ContainsKey("Maru"))
{
if (Game1.player.friendshipData["Maru"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingMaru");
}
}
if (Game1.player.friendshipData.ContainsKey("Leah"))
{
if (Game1.player.friendshipData["Leah"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingLeah");
}
}
if (Game1.player.friendshipData.ContainsKey("Abigail"))
{
if (Game1.player.friendshipData["Abigail"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingAbigail");
}
}
if (Game1.player.friendshipData.ContainsKey("Emily"))
{
if (Game1.player.friendshipData["Emily"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingEmily");
}
}
if (Game1.player.friendshipData.ContainsKey("Haley"))
{
if (Game1.player.friendshipData["Haley"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingHaley");
}
}
if (Game1.player.friendshipData.ContainsKey("Sebastian"))
{
if (Game1.player.friendshipData["Sebastian"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingSebastian");
}
}
if (Game1.player.friendshipData.ContainsKey("Harvey"))
{
if (Game1.player.friendshipData["Harvey"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingHarvey");
}
}
if (Game1.player.friendshipData.ContainsKey("Elliott"))
{
if (Game1.player.friendshipData["Elliott"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingElliott");
}
}
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())
{
Game1.player.mailbox.Add("birthdayJunimos");
}
foreach (GameLocation location in Game1.locations)
{
@ -559,47 +809,10 @@ namespace Omegasis.HappyBirthday
{
if (npc is Child || npc is Horse || npc is Junimo || npc is Monster || npc is Pet)
continue;
//Add in birthday dialogues for npc.
try
{
if (Game1.player.getFriendshipHeartLevelForNPC(npc.Name) >= Config.minimumFriendshipLevelForBirthdayWish)
{
bool spouseMessage = false; //Used to determine if there is a valid spouse message for the player. If false load in the generic birthday wish.
//Check if npc name is spouse's name. If no spouse then add in generic dialogue.
if (this.messages.spouseBirthdayWishes.ContainsKey(npc.Name) && Game1.player.isMarried())
{
//this.Monitor.Log("Spouse Checks out");
//Check to see if spouse message exists.
if (!string.IsNullOrEmpty(this.messages.spouseBirthdayWishes[npc.Name]))
{
spouseMessage = true;
Dialogue d = new Dialogue(this.messages.spouseBirthdayWishes[npc.Name], npc);
npc.CurrentDialogue.Push(d);
if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(this.messages.spouseBirthdayWishes[npc.Name]);
}
else
this.Monitor.Log("No spouse message???", LogLevel.Warn);
}
if (!spouseMessage)
{
//Load in
Dialogue d = new Dialogue(this.messages.birthdayWishes[npc.Name], npc);
npc.CurrentDialogue.Push(d);
if (npc.CurrentDialogue.Peek() != d) npc.setNewDialogue(this.messages.birthdayWishes[npc.Name]);
}
}
}
catch
{
if (Game1.player.getFriendshipHeartLevelForNPC(npc.Name) >= Config.minimumFriendshipLevelForBirthdayWish)
{
Dialogue d = new Dialogue("Happy Birthday @!", npc);
npc.CurrentDialogue.Push(d);
if (npc.CurrentDialogue.Peek() != d)
npc.setNewDialogue("Happy Birthday @!");
}
}
string message = this.messages.getBirthdayMessage(npc.Name);
Dialogue d = new Dialogue(message, npc);
npc.CurrentDialogue.Push(d);
if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(message);
}
}
}
@ -647,13 +860,14 @@ namespace Omegasis.HappyBirthday
}
/// <summary>Get whether today is the player's birthday.</summary>
private bool IsBirthday()
public bool IsBirthday()
{
return
this.PlayerData.BirthdayDay == Game1.dayOfMonth
&& this.PlayerData.BirthdaySeason == Game1.currentSeason;
&& this.PlayerData.BirthdaySeason.ToLower().Equals(Game1.currentSeason.ToLower());
}
/*
/// <summary>Migrate the legacy settings for the current player.</summary>
private void MigrateLegacyData()
{
@ -689,5 +903,6 @@ namespace Omegasis.HappyBirthday
}
}
}
*/
}
}

View File

@ -73,6 +73,9 @@
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="StardustCore">
<HintPath>$(GamePath)\Mods\StardustCore\StardustCore.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
@ -80,12 +83,14 @@
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="BirthdayEvents.cs" />
<Compile Include="BirthdayMessages.cs" />
<Compile Include="Framework\BirthdayEvents.cs" />
<Compile Include="Framework\BirthdayMenu.cs" />
<Compile Include="Framework\ModConfig.cs" />
<Compile Include="Framework\MultiplayerSupport.cs" />
<Compile Include="Framework\PlayerData.cs" />
<Compile Include="Framework\EventPreconditions\FarmerBirthdayPrecondition.cs" />
<Compile Include="Framework\EventPreconditions\SpouseBirthdayPrecondition.cs" />
<Compile Include="Framework\TranslationInfo.cs" />
<Compile Include="Framework\VillagerInfo.cs" />
<Compile Include="HappyBirthday.cs" />
@ -95,48 +100,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Content\Dialogue\Brazillian Portuguese\BirthdayWishes.pt-BR.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Brazillian Portuguese\SpouseBirthdayWishes.pt-BR.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Chinese\BirthdayWishes.zh-CN.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Chinese\SpouseBirthdayWishes.zh-CN.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\English\BirthdayWishes.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\English\SpouseBirthdayWishes.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\German\BirthdayWishes.de-DE.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\German\SpouseBirthdayWishes.de-DE.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Japanese\BirthdayWishes.ja-JP.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Japanese\SpouseBirthdayWishes.ja-JP.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Russian\BirthdayWishes.ru-RU.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Russian\SpouseBirthdayWishes.ru-RU.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Spanish\BirthdayWishes.es-ES.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Spanish\SpouseBirthdayWishes.es-ES.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Gifts\BirthdayGifts.json" />
<None Include="Content\Gifts\SpouseBirthdayGifts.json" />
<None Include="manifest.json" />
@ -147,6 +110,7 @@
<ItemGroup>
<Content Include="Changelog.txt" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\deploy.targets" />
</Project>

View File

@ -1,10 +1,13 @@
{
"Name": "Happy Birthday",
"Author": "Alpha_Omegasis",
"Version": "1.9.1",
"Version": "1.10.4",
"Description": "Adds the farmer's birthday to the game.",
"UniqueID": "Omegasis.HappyBirthday",
"EntryDll": "HappyBirthday.dll",
"MinimumApiVersion": "2.10.1",
"UpdateKeys": [ "Nexus:520" ]
"UpdateKeys": [ "Nexus:520" ],
"Dependencies": [
{ "UniqueID": "Omegasis.StardustCore" },
]
}

View File

@ -9,21 +9,65 @@ namespace Omegasis.MoreRain.Framework
/// <summary>The chance out of 100 that it will storm tomorrow if it's spring.</summary>
public int SpringThunderChance { get; set; } = 5;
/// <summary>
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
/// False = The mod will try to set a normal rainy day first.
/// True = The mod will try to set a thunderstorm (stormy) day first.
/// Default:False
/// </summary>
public bool PrioritizeSpringStorms { get; set; } = false;
/// <summary>The chance out of 100 that it will rain tomorrow if it's summer.</summary>
public int SummerRainChance { get; set; } = 5;
/// <summary>The chance out of 100 that it will storm tomorrow if it's summer.</summary>
public int SummerThunderChance { get; set; } = 10;
/// <summary>
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
/// False = The mod will try to set a normal rainy day first.
/// True = The mod will try to set a thunderstorm (stormy) day first.
/// Default:True
/// </summary>
public bool PrioritizeSummerStorms { get; set; } = true;
/// <summary>The chance out of 100 that it will rain tomorrow if it's fall.</summary>
public int FallRainChance { get; set; } = 15;
/// <summary>The chance out of 100 that it will storm tomorrow if it's fall.</summary>
public int FallThunderChance { get; set; } = 5;
/// <summary>
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
/// False = The mod will try to set a normal rainy day first.
/// True = The mod will try to set a thunderstorm (stormy) day first.
/// Default:False
/// </summary>
public bool PrioritizeFallStorms { get; set; } = false;
/// <summary>
/// If set to true the mod will try to make it snow in fall just for fun.
/// </summary>
public bool SnowInFall { get; set; } = false;
/// <summary>
/// The chance amouunt for it to snow in the fall.
/// </summary>
public int FallSnowChance { get; set; } = 5;
/// <summary>The chance out of 100 that it will snow tomorrow if it's winter.</summary>
public int WinterSnowChance { get; set; } = 15;
/// <summary>
/// If set to true then the mod will check to set rainy days in the winter. Default: False
/// </summary>
public bool RainInWinter { get; set; } = false;
/// <summary>
/// The chance that it will rain on a winter day. Only checked if the RainInWinter config option is true.
/// </summary>
public int WinterRainChance { get; set; } = 10;
/// <summary>Whether to suppress verbose logging.</summary>
public bool SuppressLog { get; set; } = true;
}

View File

@ -75,55 +75,130 @@ namespace Omegasis.MoreRain
{
case "spring":
// set rain
if (chance <= this.Config.SpringRainChance)
if (this.Config.PrioritizeSpringStorms)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
if (chance <= this.Config.SpringThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
if (chance <= this.Config.SpringRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
}
if (chance <= this.Config.SpringThunderChance)
else
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
if (chance <= this.Config.SpringRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
if (chance <= this.Config.SpringThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
}
break;
case "summer":
// set rain
if (chance <= this.Config.SummerRainChance)
if (this.Config.PrioritizeSummerStorms)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
if (chance <= this.Config.SummerThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
if (chance <= this.Config.SummerRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
}
else
{
if (chance <= this.Config.SummerRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
if (chance <= this.Config.SummerThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
}
if (chance <= this.Config.SummerThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
break;
case "fall":
case "autumn":
// set rain
if (chance <= this.Config.FallRainChance)
if (this.Config.PrioritizeFallStorms)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
if (chance <= this.Config.FallThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
if (this.Config.SnowInFall)
{
if (chance <= this.Config.FallSnowChance)
{
Game1.weatherForTomorrow = Game1.weather_snow;
this.VerboseLog("It will snow tomorrow.");
}
}
if (chance <= this.Config.FallRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
}
else
{
if (chance <= this.Config.FallRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
if (this.Config.SnowInFall)
{
if (chance <= this.Config.FallSnowChance)
{
Game1.weatherForTomorrow = Game1.weather_snow;
this.VerboseLog("It will snow tomorrow.");
}
}
if (chance <= this.Config.FallThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
}
if (chance <= this.Config.FallThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
break;
case "winter":
@ -133,10 +208,13 @@ namespace Omegasis.MoreRain
Game1.weatherForTomorrow = Game1.weather_snow;
this.VerboseLog("It will snow tomorrow.");
}
else
if (this.Config.RainInWinter)
{
//StardewValley.Game1.weatherForTomorrow = StardewValley.Game1.weather_sunny;
this.VerboseLog("It will not snow tomorrow.");
if (chance <= this.Config.WinterRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will snow tomorrow.");
}
}
break;
}

View File

@ -1,7 +1,7 @@
{
"Name": "More Rain",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.9.0",
"Description": "Change how much it rains in the game.",
"UniqueID": "Omegasis.MoreRain",
"EntryDll": "MoreRain.dll",

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Omegasis.NightOwl.Framework
{
public class NightOwlAPI
{
/// <summary>
/// Adds an event that triggers after the player has been warped to their pre-collapse position.
/// </summary>
/// <param name="ID">The id of the event.</param>
/// <param name="Action">The code that triggers.</param>
public void addPostWarpEvent(string ID,Func<bool> Action)
{
NightOwl.PostWarpCharacter.Add(ID, Action);
}
/// <summary>
/// Removes an event that triggers when the player has been warped to their pre-collapse position.
/// </summary>
/// <param name="ID"></param>
public void removePostWarpEvent(string ID)
{
if (NightOwl.PostWarpCharacter.ContainsKey(ID))
{
NightOwl.PostWarpCharacter.Remove(ID);
}
}
/// <summary>
/// Adds an event that triggers when the player has stayed up all night until 6:00 A.M.
/// </summary>
/// <param name="ID">The id of the event.</param>
/// <param name="Action">The code that triggers.</param>
public void addPlayerUpLateEvent(string ID, Func<bool> Action)
{
NightOwl.OnPlayerStayingUpLate.Add(ID, Action);
}
/// <summary>
/// Removes an event that triggers when the player has stayed up all night.
/// </summary>
/// <param name="ID"></param>
public void removePlayerUpLateEvent(string ID)
{
if (NightOwl.OnPlayerStayingUpLate.ContainsKey(ID))
{
NightOwl.OnPlayerStayingUpLate.Remove(ID);
}
}
}
}

View File

@ -20,6 +20,19 @@ namespace Omegasis.NightOwl
/// <summary>The mod entry point.</summary>
public class NightOwl : Mod
{
/*********
** Static Fields
*********/
/// <summary>
/// Events that are handled after the player has warped after they have stayed up late.
/// </summary>
public static Dictionary<string, Func<bool>> PostWarpCharacter = new Dictionary<string, Func<bool>>();
/// <summary>
/// Events that are handled when the player has stayed up late and are going to collapse.
/// </summary>
public static Dictionary<string, Func<bool>> OnPlayerStayingUpLate = new Dictionary<string, Func<bool>>();
/*********
** Fields
*********/
@ -71,12 +84,13 @@ namespace Omegasis.NightOwl
/// <summary>Determines whehther or not to rewarp the player's horse to them.</summary>
private bool shouldWarpHorse;
/// <summary>Event in the night taht simulates the earthquake event that should happen.</summary>
/// <summary>Event in the night that simulates the earthquake event that should happen.</summary>
StardewValley.Events.SoundInTheNightEvent eve;
private List<NetByte> oldAnimalHappiness;
/*********
** Public methods
*********/
@ -98,6 +112,10 @@ namespace Omegasis.NightOwl
this.shouldWarpHorse = false;
}
public override object GetApi()
{
return new NightOwlAPI();
}
/*********
** Private methods
@ -117,7 +135,13 @@ namespace Omegasis.NightOwl
if (Context.IsWorldReady && this.JustStartedNewDay && this.Config.KeepPositionAfterCollapse)
{
if (this.PreCollapseMap != null)
{
Game1.warpFarmer(this.PreCollapseMap, this.PreCollapseTile.X, this.PreCollapseTile.Y, false);
foreach (var v in PostWarpCharacter)
{
v.Value.Invoke();
}
}
this.PreCollapseMap = null;
this.JustStartedNewDay = false;
@ -148,7 +172,7 @@ namespace Omegasis.NightOwl
}
if (this.Config.KeepMoneyAfterCollapse)
Game1.player.money += collapseFee;
Game1.player.Money += collapseFee;
}
/// <summary>Raised after the player loads a save slot and the world is initialised.</summary>
@ -183,7 +207,13 @@ namespace Omegasis.NightOwl
if (this.Config.KeepPositionAfterCollapse)
{
if (!Game1.weddingToday)
{
Game1.warpFarmer(this.PreCollapseMap, this.PreCollapseTile.X, this.PreCollapseTile.Y, false);
foreach(var v in PostWarpCharacter)
{
v.Value.Invoke();
}
}
}
if (this.horse != null && this.shouldWarpHorse)
@ -196,7 +226,7 @@ namespace Omegasis.NightOwl
if (this.isBathing)
Game1.player.swimming.Value = true;
//Reflction to ensure that the railroad becomes properly unblocked.
//Reflection to ensure that the railroad becomes properly unblocked.
if (Game1.dayOfMonth == 1 && Game1.currentSeason == "summer" && Game1.year == 1)
{
Mountain mountain = (Mountain)Game1.getLocationFromName("Mountain");
@ -304,7 +334,7 @@ namespace Omegasis.NightOwl
this.PreCollapseMap = Game1.player.currentLocation.Name;
this.PreCollapseStamina = Game1.player.stamina;
this.PreCollapseHealth = Game1.player.health;
this.PreCollapseMoney = Game1.player.money;
this.PreCollapseMoney = Game1.player.Money;
this.isInSwimSuit = Game1.player.bathingClothes.Value;
this.isBathing = Game1.player.swimming.Value;
@ -314,7 +344,7 @@ namespace Omegasis.NightOwl
if (Game1.activeClickableMenu != null) Game1.activeClickableMenu.exitThisMenu(true); //Exit menus.
Game1.timeOfDay += 2400; //Recalculate for the sake of technically being up a whole day.
//Game1.timeOfDay += 2400; //Recalculate for the sake of technically being up a whole day. Why did I put this here?
//Reset animal happiness since it drains over night.
for (int i = 0; i < this.oldAnimalHappiness.Count; i++)
@ -322,6 +352,11 @@ namespace Omegasis.NightOwl
Game1.getFarm().getAllFarmAnimals()[i].happiness.Value = this.oldAnimalHappiness[i].Value;
}
foreach(var v in OnPlayerStayingUpLate)
{
v.Value.Invoke();
}
Game1.player.startToPassOut();
}
}

View File

@ -78,6 +78,7 @@
</Compile>
<Compile Include="Framework\ModConfig.cs" />
<Compile Include="Framework\NightFishing.cs" />
<Compile Include="Framework\NightOwlAPI.cs" />
<Compile Include="NightOwl.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

View File

@ -1,10 +1,10 @@
{
"Name": "Night Owl",
"Author": "Alpha_Omegasis",
"Version": "1.9.0",
"Version": "1.10.0",
"Description": "Lets you stay up all night.",
"UniqueID": "Omegasis.NightOwl",
"EntryDll": "NightOwl.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:433" ]
}

Some files were not shown because too many files have changed in this diff Show More