diff --git a/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/CommunityCenterCompleted.cs b/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/CommunityCenterCompleted.cs new file mode 100644 index 00000000..ea6b00af --- /dev/null +++ b/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/CommunityCenterCompleted.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using StardewValley; + +namespace StardustCore.Events.Preconditions.PlayerSpecific +{ + public class CommunityCenterCompleted: EventPrecondition + { + /// + /// False means the community center doesn't need to be completed. + /// + bool needsToBeCompleted; + + public CommunityCenterCompleted() + { + + } + + public CommunityCenterCompleted(bool NeedsToBeCompleted) + { + this.needsToBeCompleted = NeedsToBeCompleted; + } + + public override string ToString() + { + return "Omegasis.EventFramework.Preconditions.Player.CommunityCenterCompleted?"; + } + + public override bool meetsCondition() + { + return this.needsToBeCompleted == Game1.player.hasCompletedCommunityCenter(); + } + + } +} diff --git a/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/NotDatingAnyone.cs b/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/NotDatingAnyone.cs new file mode 100644 index 00000000..68f4383b --- /dev/null +++ b/GeneralMods/StardustCore/Events/Preconditions/PlayerSpecific/NotDatingAnyone.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using StardewValley; + +namespace StardustCore.Events.Preconditions.PlayerSpecific +{ + public class NotDatingAnyone: EventPrecondition + { + public NotDatingAnyone() + { + + } + + public override string ToString() + { + return "Omegasis.EventFramework.Precondition.NotDatingAnyone"; + } + + + public override bool meetsCondition() + { + foreach(GameLocation loc in Game1.locations) + { + foreach (NPC npc in loc.getCharacters()) + { + if (Game1.player.friendshipData[npc.Name].IsDating()) return false; + } + } + return true; + } + + } +} diff --git a/GeneralMods/StardustCore/StardustCore.csproj b/GeneralMods/StardustCore/StardustCore.csproj index 34aa5a8c..6175872e 100644 --- a/GeneralMods/StardustCore/StardustCore.csproj +++ b/GeneralMods/StardustCore/StardustCore.csproj @@ -104,6 +104,7 @@ + @@ -112,6 +113,7 @@ +