public void MgrLtTulYorvesInner(List <Delta> deltas, GameManager gm, UnitDelta ud) { System.Tuple <int, int, int> targetLSP = Lane.GetLaneSidePosOf(ud.Target, gm.Lanes); System.Tuple <int, int, int> sourceLSP = Lane.GetLaneSidePosOf(Source, gm.Lanes); if (targetLSP != null && sourceLSP != null) { if (targetLSP.Item2 == sourceLSP.Item2) { int side = targetLSP.Item2; Lane targetLane = gm.Lanes[targetLSP.Item1]; deltas.Add(new UnitHealthDelta(ud.Target, Source, 1, Damage.Type.HEAL)); if (targetLane.IsOccupied(1 - side, 0)) { deltas.Add(new UnitHealthDelta(targetLane.Units[1 - side, 0], Source, 1, Damage.Type.ABILITY)); } else if (targetLane.IsOccupied(1 - side, 1)) { deltas.Add(new UnitHealthDelta(targetLane.Units[1 - side, 1], Source, 1, Damage.Type.ABILITY)); } else { deltas.Add(new TowerDamageDelta(targetLane.Towers[1 - side], 1, Damage.Type.ABILITY)); } } } }
public void AddBoardUpdate(List <Delta> deltas, GMWithLocation gmLoc) { gmLoc.GameManager.AddPersistentDeltas += RushInner; Tuple <int, int, int> lsp = Lane.GetLaneSidePosOf(gmLoc.SubjectUnit, gmLoc.Lanes); Lane = gmLoc.Lanes[lsp.Item1]; Unit = gmLoc.SubjectUnit; Side = lsp.Item2; }
protected override bool ApplyTo(int lane, int side, int pos, Lane[] lanes, Unit source) { int?sourceSide = Lane.GetLaneSidePosOf(source, lanes)?.Item2; if (sourceSide == null) { throw new Exception($"Source Unit \"{source.ID}\" not found"); } return(false); // TODO Supporting Myxori Persistent…Center: The supported unit gains Absorb. Flank: When the supported Unit dies, Beta Swarm. }
public Coroutine UnitDamage(Unit source, Unit target, int damageAmount) { UnitUI sourceUI = FindUnitUI(source); UnitUI targetUI = FindUnitUI(target); targetUI.RenderUnit(); return(StartCoroutine(ParallelCoroutine( () => sourceUI.AttackMove(AttackDirection(Lane.GetLaneSidePosOf(source, Driver.instance.gameManager.Lanes).Item2)), () => damageTextManager.DamageTextPopup(targetUI.transform.position, $"-{damageAmount}") ))); }
protected override bool ApplyTo(int lane, int side, int pos, Lane[] lanes, Unit source) { int?sourceSide = Lane.GetLaneSidePosOf(source, lanes)?.Item2; if (sourceSide == null) { throw new Exception($"Source Unit \"{source.ID}\" not found"); } bool b = pos == 0 && lanes[lane].Units[side, pos].Card.UnitType.Contains("Elite") && sourceSide == side && lanes[lane].Units[side, pos] != source; Console.WriteLine($" -l{lane} s{side} p{pos} apply{b}- "); return(b); }
private (int, int, int) GetPositionIdentifier(Unit unit) { Tuple <int, int, int> laneSidePos = Lane.GetLaneSidePosOf(unit, Driver.instance.gameManager.Lanes); return(laneSidePos.Item1, laneSidePos.Item2, laneSidePos.Item3); }