public void EvalDeath(UnitProxy unit) { TileProxy tle = BoardProxy.instance.GetTileAtPosition(unit.GetPosition()); tle.CreateAnimation(Glossary.fx.bloodExplosions); //tle.FloatUp(Skill.Actions.None,"Death", Color.red,"Character died"); AnimationInteractionController.InteractionAnimationGameobject( BoardProxy.instance.glossary.GetComponent <Glossary>().skull, tle.gameObject, AnimationInteractionController.NO_WAIT, true); tle.RemoveGridObjectProxy(unit); Destroy(unit.gameObject); EvaluateGame(); }
public override void OnTileSelected(TileProxy tile) { if (currentUnit != null && visitableTiles.Contains(tile)) { TileProxy startTile = BoardProxy.instance.GetTileAtPosition(currentUnit.GetPosition()); if (startTile != tile) { UnitProxy unit = startTile.GetUnit(); if (unit.GetData().GetTurnActions().CanMove()) { unit.GetData().GetTurnActions().Move(); PanelController.SwitchChar(unit); StartCoroutine(currentUnit.CreatePathToTileAndLerpToPosition(tile, () => { tile.ReceiveGridObjectProxy(currentUnit); startTile.RemoveGridObjectProxy(currentUnit); UnHighlightTiles(); InteractivityManager.instance.EnterDefaultMode(); })); } else { Debug.Log("Out of actions. Send signal to player they can't move unit."); } } else { StartCoroutine(currentUnit.CreatePathToTileAndLerpToPosition(tile, () => { StartCoroutine(ResetTiles()); })); } } else if (currentUnit != null) { //Select all the tiles with opp team in all tiles //List<TileProxy> visitableTiles = allTiles.Where(tl => tl.GetUnit().GetData().GetTeam() != currentUnit.GetData().GetTeam()).ToList<TileProxy>(); if (!allTiles.Where(tl => tl.HasUnit() && (tl.GetUnit().GetData().GetTeam() != currentUnit.GetData().GetTeam())).ToList <TileProxy>().Contains(tile)) { BoardProxy.instance.FlushTiles(); PanelController.SwitchChar(null); } ////Player clicked out of unit range, reset tiles/UI so player can click somewhere else instead //BoardProxy.instance.FlushTiles(); //PanelController.SwitchChar(null); } }
IEnumerator WaitForZap(TileProxy newTl, TileProxy oldTl, string actStr) { yield return(new WaitForSeconds(AnimationInteractionController.ANIMATION_WAIT_TIME_LIMIT)); newTl.ReceiveGridObjectProxy(this); //newTl.FloatUp(Skill.Actions.None, "whabam!", Color.blue, actStr); newTl.CreateAnimation(Glossary.fx.laser, 0); oldTl.RemoveGridObjectProxy(this); //oldTl.FloatUp(Skill.Actions.None, "poof", Color.cyan, actStr); oldTl.CreateAnimation(Glossary.fx.laser, 0); SetPosition(newTl.GetPosition()); SnapToCurrentPosition(); }