2024-09-30 12:05:19 +00:00
|
|
|
using System;
|
|
|
|
using BehaviorDesigner.Runtime.Tasks;
|
2025-02-10 02:13:46 +00:00
|
|
|
using DDD.Interfaces;
|
|
|
|
using DDD.Players.Tycoons;
|
2024-09-30 12:05:19 +00:00
|
|
|
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
|
|
|
|
2025-02-10 02:13:46 +00:00
|
|
|
namespace DDD.BehaviorTrees.Actions
|
2024-09-30 12:05:19 +00:00
|
|
|
{
|
|
|
|
[TaskCategory("Custom/Npc/Customer")]
|
|
|
|
[Serializable]
|
|
|
|
public class OrderFail : Action
|
|
|
|
{
|
|
|
|
private TycoonPlayer _tycoonPlayer;
|
|
|
|
|
|
|
|
public override void OnAwake()
|
|
|
|
{
|
|
|
|
_tycoonPlayer = GameManager.Instance.CurrentTycoonPlayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override TaskStatus OnUpdate()
|
|
|
|
{
|
|
|
|
var damageable = _tycoonPlayer.GetComponent<IDamageable>();
|
|
|
|
damageable?.TakeDamage(1);
|
|
|
|
|
|
|
|
return TaskStatus.Success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|