Files
BH3/Assets/Scripts/Assembly-CSharp/MoleMole/IsLeaderDead.cs
2025-08-13 09:26:42 +08:00

36 lines
814 B
C#

using BehaviorDesigner.Runtime.Tasks;
using MoleMole.Config;
namespace MoleMole
{
[TaskCategory("Group")]
public class IsLeaderDead : Conditional
{
public SharedEntity targetEntity;
public SharedGroupAttackType attackType;
public SharedGroupMoveType moveType;
public override void OnAwake()
{
base.OnAwake();
}
public override TaskStatus OnUpdate()
{
if (targetEntity.Value != null && targetEntity.Value.IsActive())
{
return TaskStatus.Failure;
}
if (attackType.Value != ConfigGroupAIMinionOld.AttackType.Free || moveType.Value != ConfigGroupAIMinionOld.MoveType.Free)
{
attackType.Value = ConfigGroupAIMinionOld.AttackType.Free;
moveType.Value = ConfigGroupAIMinionOld.MoveType.Free;
return TaskStatus.Success;
}
return TaskStatus.Failure;
}
}
}