Added in a few more preconditions. Time to make events.
This commit is contained in:
parent
03e338e279
commit
b553aff0d2
|
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// False means the community center doesn't need to be completed.
|
||||
/// </summary>
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -104,6 +104,7 @@
|
|||
<Compile Include="Events\Preconditions\NPCSpecific\NotMarriedTo.cs" />
|
||||
<Compile Include="Events\Preconditions\NPCSpecific\NPCInThisLocation.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\AnsweredDialogueOptions.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\CommunityCenterCompleted.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\CurrentMoney.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\DaysPlayedFor.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\EmptyInventorySlots.cs" />
|
||||
|
@ -112,6 +113,7 @@
|
|||
<Compile Include="Events\Preconditions\PlayerSpecific\HasNotRecievedLetter.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\HasRecievedLetter.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\MineBottomHit.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\NotDatingAnyone.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\PetPreference.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\PlayerOnThisTile.cs" />
|
||||
<Compile Include="Events\Preconditions\PlayerSpecific\SeenEvents.cs" />
|
||||
|
|
Loading…
Reference in New Issue