Example #1
0
    override public void NodeUpdate(int currentFrame, float clipTime, AttackBuffer buffer)
    {
        if (buffer.ready && (cancelable || currentFrame >= IASA))
        {
            if (currentFrame >= IASA)
            {
                MoveNextNode(buffer, allowReEntry: true);
                return;
            }
            else if (cancelable)
            {
                MoveNextNode(buffer);
                return;
            }
        }

        if (currentFrame >= IASA && InputManager.HasHorizontalInput())
        {
            attackGraph.ExitGraph();
            return;
        }

        if (clipTime >= 1)
        {
            attackGraph.ExitGraph();
            return;
        }
    }
Example #2
0
 public void Initialize(Animator anim, AttackBuffer buffer, Rigidbody2D rb, AirAttackTracker airAttackTracker)
 {
     this.anim             = anim;
     this.buffer           = buffer;
     this.rb2d             = rb;
     this.airAttackTracker = airAttackTracker;
 }
Example #3
0
 public void Initialize(Animator anim, AttackBuffer buffer, Rigidbody2D rb, AirAttackTracker airAttackTracker)
 {
     this.anim             = anim;
     this.buffer           = buffer;
     this.rb2d             = rb;
     this.airAttackTracker = airAttackTracker;
     this.playerController = anim.GetComponent <PlayerController>();
 }
Example #4
0
 override public void NodeUpdate(int currentFrame, float clipTime, AttackBuffer buffer)
 {
     if (buffer.ready && (currentFrame >= IASA || cancelable))
     {
         MoveNextNode(buffer);
     }
     else if (clipTime >= 1)
     {
         attackGraph.ExitGraph();
     }
 }
Example #5
0
    protected void MoveNextNode(AttackBuffer buffer, bool allowReEntry = false)
    {
        CombatNode next = GetNextNode(buffer);

        if (next != null)
        {
            attackGraph.MoveNode(next);
            return;
        }

        if (allowReEntry)
        {
            attackGraph.EnterGraph(null);
        }
    }
Example #6
0
    override public CombatNode GetNextNode(AttackBuffer buffer)
    {
        CombatNode next = null;

        if (speedBarrier > 0 && (Mathf.Abs(attackGraph.rb2d.velocity.x) >= speedBarrier))
        {
            next = MatchAttackNode(buffer, speedLinks, portListName: "speedLinks");
        }

        if (next == null)
        {
            next = MatchAttackNode(buffer, links);
        }

        return(next);
    }
Example #7
0
    // directional attacks are prioritized in order, then the first any-directional link is used
    protected CombatNode MatchAttackNode(AttackBuffer buffer, AttackLink[] attackLinks, string portListName = "links")
    {
        directionalLinks.Clear();
        anyDirectionNode = null;

        for (int i = 0; i < attackLinks.Length; i++)
        {
            AttackLink link = attackLinks[i];
            if (link.type == buffer.type && buffer.HasDirection(link.direction))
            {
                CombatNode next = GetPort(portListName + " " + i).Connection.node as CombatNode;
                if (next.Enabled())
                {
                    if (link.direction != AttackDirection.ANY)
                    {
                        directionalLinks.Add(new Tuple <AttackLink, CombatNode>(link, next));
                    }
                    else if (anyDirectionNode == null)
                    {
                        anyDirectionNode = next;
                    }
                }
            }
        }

        if (directionalLinks.Count > 0)
        {
            return(directionalLinks[0].Item2);
        }

        if (anyDirectionNode != null)
        {
            return(anyDirectionNode);
        }

        return(null);
    }
Example #8
0
 virtual public CombatNode GetNextNode(AttackBuffer buffer)
 {
     return(MatchAttackNode(buffer, this.links));
 }
Example #9
0
 virtual public void NodeUpdate(int currentFrame, float clipTime, AttackBuffer buffer)
 {
 }