コード例 #1
0
    public void MoveNode(CombatNode node)
    {
        buffer.Clear();

        currentNode.OnNodeExit();
        currentNode = node;
        currentNode.OnNodeEnter();
    }
コード例 #2
0
 public void EnterAttackGraph(PlayerAttackGraph graph, CombatNode startNode = null)
 {
     if (attackGraph == graph && startNode == null)
     {
         return;
     }
     attackGraph = graph;
     attackGraph.Initialize(anim, GetComponent <AttackBuffer>(), rb2d, airAttackTracker);
     attackGraph.EnterGraph(startNode);
 }
コード例 #3
0
ファイル: PreviewUIPanel.cs プロジェクト: Tathomp/TacticsGame
    public void InitText(CombatNode c)
    {
        sourceLabel.text = "Source" + "\n" + c.source.actorData.Name;
        damageLabel.text = "Damage: \n";
        c.UpDatePreview(this);

        if (c.target != null)
        {
            targetLabel.text  = c.target.actorData.Name + "\n";
            targetLabel.text += c.target.GetCurrentStats(StatTypes.Health) + " / " + c.target.GetMaxStats(StatTypes.Health);
        }
    }
コード例 #4
0
 public void ExitGraph(bool quiet = false)
 {
     if (currentNode != null)
     {
         currentNode.OnNodeExit();
     }
     currentNode = null;
     GlobalController.pc.ExitAttackGraph(); // bad
     if (!quiet)
     {
         anim.Play(exitNodeName, 0);
     }
 }
コード例 #5
0
    override public void OnNodeEnter()
    {
        base.OnNodeEnter();
        CombatNode next = GetNextNode(attackGraph.buffer);

        if (next != null)
        {
            attackGraph.MoveNode(GetNextNode(attackGraph.buffer));
        }
        else
        {
            attackGraph.ExitGraph();
        }
    }
コード例 #6
0
ファイル: AttackNode.cs プロジェクト: garzaa/vapor-trails
    protected void MoveNextNode(AttackBuffer buffer, bool allowReEntry = false)
    {
        CombatNode next = GetNextNode(buffer);

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

        if (allowReEntry)
        {
            attackGraph.EnterGraph(null);
        }
    }
コード例 #7
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);
    }
コード例 #8
0
ファイル: AttackNode.cs プロジェクト: garzaa/vapor-trails
    // 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);
    }
コード例 #9
0
ファイル: BuffEffect.cs プロジェクト: Tathomp/TacticsGame
 public virtual void ReactionEffect(Combat combat, CombatNode node)
 {
 }
コード例 #10
0
 public void EnterGraph(Node entryNode)
 {
     currentNode = (entryNode == null) ? GetRootNode() : entryNode as CombatNode;
     anim.SetInteger("SubState", this.stateNum);
     currentNode.OnNodeEnter();
 }