96 lines
3.4 KiB
C#
96 lines
3.4 KiB
C#
using BlueWater.Interfaces;
|
|
|
|
namespace BlueWater.Npcs.Customers
|
|
{
|
|
public class IdleState : IStateMachine<Customer>
|
|
{
|
|
public void EnterState(Customer character)
|
|
{
|
|
if (character.IsVomited)
|
|
{
|
|
if (character.CustomerSkin == CustomerSkin.Cat)
|
|
{
|
|
character.SpineController.PlayAnimation(CatSpineAnimation.VomitingIdle, true);
|
|
}
|
|
else
|
|
{
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.VomitingIdle, true);
|
|
}
|
|
}
|
|
else if (character.IsReceivedItem)
|
|
{
|
|
if (character.IsOrderedCorrected)
|
|
{
|
|
if (character.CustomerSkin == CustomerSkin.Cat)
|
|
{
|
|
character.SpineController.PlayAnimation(CatSpineAnimation.Happy, true);
|
|
}
|
|
else if (character.CustomerSkin == CustomerSkin.Witch)
|
|
{
|
|
character.SpineController.PlayAnimation(WitchSpineAnimation.Happy, true);
|
|
}
|
|
else
|
|
{
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.Happy, true);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (character.CustomerSkin == CustomerSkin.Cat)
|
|
{
|
|
character.SpineController.PlayAnimation(CatSpineAnimation.Upset, true);
|
|
}
|
|
else if (character.CustomerSkin == CustomerSkin.Witch)
|
|
{
|
|
character.SpineController.PlayAnimation(WitchSpineAnimation.Upset, true);
|
|
}
|
|
else
|
|
{
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.Upset, true);
|
|
}
|
|
}
|
|
}
|
|
else if (!character.IsReceivedItem)
|
|
{
|
|
if (character.CustomerSkin == CustomerSkin.Cat)
|
|
{
|
|
character.SpineController.PlayAnimation(CatSpineAnimation.Idle, true);
|
|
}
|
|
else if (character.CustomerSkin == CustomerSkin.Witch)
|
|
{
|
|
character.SpineController.PlayAnimation(WitchSpineAnimation.Idle, true);
|
|
}
|
|
else
|
|
{
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.Idle, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void UpdateState(Customer character)
|
|
{
|
|
if (character.IsMoving)
|
|
{
|
|
if (character.CustomerSkin == CustomerSkin.Cat)
|
|
{
|
|
character.SpineController.PlayAnimation(CatSpineAnimation.Idle, true);
|
|
}
|
|
else if (character.CustomerSkin == CustomerSkin.Witch)
|
|
{
|
|
character.SpineController.PlayAnimation(WitchSpineAnimation.Idle, true);
|
|
}
|
|
else
|
|
{
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.Idle, true);
|
|
}
|
|
character.StateMachineController.TransitionToState(character.WalkingState, character);
|
|
}
|
|
}
|
|
|
|
public void ExitState(Customer character)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|