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