public void MoveNode(CombatNode node) { buffer.Clear(); currentNode.OnNodeExit(); currentNode = node; currentNode.OnNodeEnter(); }
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); }
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); } }
public void ExitGraph(bool quiet = false) { if (currentNode != null) { currentNode.OnNodeExit(); } currentNode = null; GlobalController.pc.ExitAttackGraph(); // bad if (!quiet) { anim.Play(exitNodeName, 0); } }
override public void OnNodeEnter() { base.OnNodeEnter(); CombatNode next = GetNextNode(attackGraph.buffer); if (next != null) { attackGraph.MoveNode(GetNextNode(attackGraph.buffer)); } else { attackGraph.ExitGraph(); } }
protected void MoveNextNode(AttackBuffer buffer, bool allowReEntry = false) { CombatNode next = GetNextNode(buffer); if (next != null) { attackGraph.MoveNode(next); return; } if (allowReEntry) { attackGraph.EnterGraph(null); } }
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); }
// 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); }
public virtual void ReactionEffect(Combat combat, CombatNode node) { }
public void EnterGraph(Node entryNode) { currentNode = (entryNode == null) ? GetRootNode() : entryNode as CombatNode; anim.SetInteger("SubState", this.stateNum); currentNode.OnNodeEnter(); }