private static List <string> PrintMoves(MoveLink link, List <string> combos) { foreach (LinkCondition c in link.conditions) { if (c.conditionType == ConditionType.weaponCondition) { string s = combos[combos.Count]; if (c.weapon == "HandWraps") { s += "P"; } else if (c.weapon == "Sword") { s += "S"; } s += ","; break; } } if (link.move.links.Count > 0) { combos = PrintMoves(link.move.links[0], combos); } if (link.move.links.Count > 1) { for (int i = 1; i < link.move.links.Count; i++) { combos = PrintMoves(link.move.links[i], combos); } } return(combos); }
public static List <string> PrintMoves(MoveLink link) { List <string> combos = new List <string>(); combos.Add(""); return(PrintMoves(link, combos)); }
public void ExecuteConditions(MoveLink link) { foreach (LinkCondition condition in link.conditions) { ExecuteCondition(condition); } }
public bool CheckLink(MoveLink link) { foreach (LinkCondition lk in link.conditions) { if (!CheckCondition(lk)) { return(false); } } return(true); }
public void CheckMoves(List <MoveLink> moveLinks) { List <MoveLink> links = new List <MoveLink>(); links.AddRange(moveLinks); if (currentMove != null) { foreach (MoveLink l in currentMove.links) { if ((l.minTime <= moveTime) && (l.maxTime >= moveTime)) { links.Add(l); } } } int nextMoveIndex = -1; int priority = -100; for (int i = 0; i < links.Count; i++) { MoveLink currentLink = links[i]; if (currentLink.priority >= priority) { bool meetsConditions = false; for (int j = 0; j < currentLink.conditions.Count; j++) { LinkCondition condition = currentLink.conditions[j]; meetsConditions = CheckCondition(condition); if (!meetsConditions) { break; } } if (meetsConditions) { nextMoveIndex = i; priority = currentLink.priority; } } } if (nextMoveIndex != -1) { foreach (LinkCondition l in links[nextMoveIndex].conditions) { ExecuteCondition(l); } StartMove(links[nextMoveIndex].move); } }
public bool CheckMove(MoveLink link) { bool meetsConditions = false; for (int j = 0; j < link.conditions.Count; j++) { LinkCondition condition = link.conditions[j]; meetsConditions = CheckCondition(condition); if (!meetsConditions) { break; } } return(meetsConditions); }