Beispiel #1
0
    public override bool Run()
    {
        Transform Dragon = DragonManager.Instance.transform;
        Transform Player = DragonManager.Instance.Player;

        Vector3 Target = (Player.position - Dragon.position).normalized;

        float Dot = Vector3.Dot(Dragon.forward, Target);

        if (Dot >= Mathf.Cos(Mathf.Deg2Rad * 180.0f * 0.5f))
        {
            Vector3 cross  = Vector3.Cross(Dragon.forward, Target);
            float   result = Vector3.Dot(cross, Vector3.up);

            bool IsLeftPowAttack  = BlackBoard.Instance.IsLeftPowAttack;
            bool IsRightPowAttack = BlackBoard.Instance.IsRightPowAttack;
            bool IsTailAttack     = BlackBoard.Instance.IsTailAttack;

            if ((result < 0.0f && !IsRightPowAttack && !IsTailAttack) || IsLeftPowAttack)
            {
                Debug.Log("Left_Pow_Decorator");
                return(ChildNode.Run());
            }
        }
        return(true);
    }
Beispiel #2
0
 public override bool Run()
 {
     if (DragonManager.Stat.HP <= 0)
     {
         return(ChildNode.Run());
     }
     return(false);
 }
    public override bool Run()
    {
        bool IsGround = BlackBoard.Instance.IsGround;

        if (IsGround)
        {
            return(ChildNode.Run());
        }
        return(true);
    }
        protected override ENodeReturn OnUpdate(BehaviourTree tree)
        {
            ENodeReturn result = ChildNode.Run(tree);

            if (result != ENodeReturn.Running)
            {
                result = ENodeReturn.Success;
            }
            return(result);
        }
Beispiel #5
0
    public override bool Run()
    {
        bool isAttack = BlackBoard.Instance.IsAttack;

        if (isAttack)
        {
            return(ChildNode.Run());
        }
        return(false);
    }
    public override bool Run()
    {
        bool IsEnsuingAttack = BlackBoard.Instance.IsEnsuingAttack;

        if (IsEnsuingAttack)
        {
            Debug.Log("Ensuing_OverLap_Decorator");
            return(ChildNode.Run());
        }
        return(false);
    }
Beispiel #7
0
    public override bool Run()
    {
        int CurWeakPointCount = BlackBoard.Instance.CurWeakPointCount;
        int MaxWeakPointCount = BlackBoard.Instance.MaxWeakPointCount;

        if (CurWeakPointCount >= MaxWeakPointCount)
        {
            return(ChildNode.Run());
        }
        return(true);
    }
    public override bool Run()
    {
        bool IsHovering = BlackBoard.Instance.IsHovering;
        bool IsFlying   = BlackBoard.Instance.IsFlying;

        if (IsHovering || IsFlying)
        {
            return(ChildNode.Run());
        }

        return(false);
    }
    public override bool Run()
    {
        float CurHP         = DragonManager.Stat.HP;
        float MaxHP         = DragonManager.Stat.MaxHP;
        float SecondPhaseHP = DragonManager.Stat.SecondPhaseHpPercent;

        if (CurHP >= MaxHP * SecondPhaseHP)
        {
            return(ChildNode.Run());
        }
        return(true);
    }
    public override bool Run()
    {
        float CurTime = BlackBoard.Instance.GetGroundTime().CurIdleTime;
        float MaxTime = BlackBoard.Instance.GetGroundTime().MaxIdleTime;

        if (CurTime < MaxTime)
        {
            return(ChildNode.Run());
        }

        return(true);
    }
    public override bool Run()
    {
        bool IsFlying             = BlackBoard.Instance.IsFlying;
        bool IsGroundPatternAct   = BlackBoard.Instance.IsGroundPatternAct;
        bool IsHoveringPatternAct = BlackBoard.Instance.IsHoveringPatternAct;

        if (IsFlying && !IsGroundPatternAct && !IsHoveringPatternAct)
        {
            return(ChildNode.Run());
        }
        return(false);
    }
    public override bool Run()
    {
        Transform Dragon = DragonManager.Instance.transform;
        Transform Player = DragonManager.Instance.Player;

        bool IsEnsuingAttack = BlackBoard.Instance.IsEnsuingAttack;

        if (IsEnsuingAttack)
        {
            return(ChildNode.Run());
        }
        return(true);
    }
Beispiel #13
0
    public override bool Run()
    {
        float CurHP        = DragonManager.Stat.HP;
        float MaxHP        = DragonManager.Stat.MaxHP;
        float ThirdPhaseHP = DragonManager.Stat.ThirdPhaseHpPercent;

        if (CurHP < MaxHP * ThirdPhaseHP)
        {
            Debug.Log("ThridPhaseDecorator");
            return(ChildNode.Run());
        }
        return(true);
    }
Beispiel #14
0
    public override bool Run()
    {
        bool  IsWalk             = BlackBoard.Instance.IsWalk;
        bool  IsGround           = BlackBoard.Instance.IsGround;
        bool  IsGroundPatternAct = BlackBoard.Instance.IsGroundPatternAct;
        float CurWalkTime        = BlackBoard.Instance.GetGroundTime().CurWalkTime;
        float MaxWalkTime        = BlackBoard.Instance.GetGroundTime().MaxWalkTime;

        if (IsWalk && IsGround && !IsGroundPatternAct && CurWalkTime < MaxWalkTime)
        {
            Debug.Log("Walk");
            return(ChildNode.Run());
        }
        return(true);
    }
Beispiel #15
0
    public override bool Run()
    {
        Transform Dragon = DragonManager.Instance.transform;
        Transform Player = DragonManager.Instance.Player;

        Vector3 Target = (Player.position - Dragon.position).normalized;

        float Dot = Vector3.Dot(Dragon.forward, Target);

        bool IsLeftPowAttack  = BlackBoard.Instance.IsLeftPowAttack;
        bool IsRightPowAttack = BlackBoard.Instance.IsRightPowAttack;
        bool IsTailAttack     = BlackBoard.Instance.IsTailAttack;

        if ((Dot < Mathf.Cos(Mathf.Deg2Rad * 180.0f * 0.5f) &&
             !IsLeftPowAttack && !IsRightPowAttack) || IsTailAttack)
        {
            return(ChildNode.Run());
        }
        return(true);
    }
    public override bool Run()
    {
        Transform Dragon = DragonManager.Instance.transform;
        Transform Player = DragonManager.Instance.Player;

        float Distance = BlackBoard.Instance.BulletBreathDistance;

        bool IsOverLapPattern    = BlackBoard.Instance.IsOverLapPattern;
        bool IsRushPattern       = BlackBoard.Instance.IsRushPattern;
        bool IsIceBringUpPattern = BlackBoard.Instance.IsIceBringUpPattern;
        bool IsBulletBreath      = BlackBoard.Instance.IsBulletBreath;

        if ((BlackBoard.Instance.DistanceCalc(Dragon, Player, Distance) &&
             !IsIceBringUpPattern && IsOverLapPattern && IsRushPattern) ||
            IsBulletBreath)
        {
            return(ChildNode.Run());
        }

        return(true);
    }
Beispiel #17
0
    public override bool Run()
    {
        Transform Dragon = DragonManager.Instance.transform;
        Transform Player = DragonManager.Instance.Player;

        float Distance = BlackBoard.Instance.TakeOffDistance;

        bool IsTakeOff    = !BlackBoard.Instance.DistanceCalc(Dragon, Player, Distance);
        bool IsTakeOffEnd = BlackBoard.Instance.IsTakeOffEnd;
        bool IsTakeOffAct = BlackBoard.Instance.IsTakeOffAct;

        bool IsGround           = BlackBoard.Instance.IsGround;
        bool IsGroundPatternAct = BlackBoard.Instance.IsGroundPatternAct;
        bool IsLandingAct       = BlackBoard.Instance.IsLandingAct;

        if ((IsTakeOff && !IsGroundPatternAct && IsGround && !IsLandingAct &&
             !IsTakeOffEnd) || IsTakeOffAct)
        {
            Debug.Log("TakeOff_Decorator");
            return(ChildNode.Run());
        }

        return(true);
    }
Beispiel #18
0
 public override bool Run()
 {
     return(!ChildNode.Run());
 }
Beispiel #19
0
 public override bool Run()
 {
     ChildNode.Run();
     return(true);
 }