Ejemplo n.º 1
0
    //------------------------------------------------------------------------------------------------------------------/

    void OnTileSelected(Tile tile)
    {
        if (!isActive)
        {
            return;
        }

        if (!availableTiles.Contains(tile))
        {
            End();
            return;
        }

        Buffer.consumeTriggerSpell = true;
        Owner.IncreaseBusiness();
        isWaiting = true;

        current.onCastDone += OnCastDone;

        if (Player.Active.Navigator.Current != tile)
        {
            Player.Active.SetOrientation((tile.GetWorldPosition() - Player.Active.transform.position).xy().ComputeOrientation());
        }
        Buffer.caster = nav;
        current.CastFrom(tile, castArgs);

        if (current.IsDone)
        {
            if (!isStatic)
            {
                RemainingUse--;
            }

            Events.ZipCall(GameEvent.OnSpellUsed, current, isStatic);
            Events.ZipCall(ChallengeEvent.OnSpellUse, 1);

            Shutdown();
        }
        else
        {
            Setup();
        }
    }