Ejemplo n.º 1
0
        private void HandleSpawned(CreatureStats creature, MapPosition at)
        {
            if (creature != ownerStats)
            {
                return;
            }

            switch (ownerStats.OwnedBy)
            {
            case Owner.PLAYER:
                ownerStats.AddAttackDirection(Direction.DOWNLEFT);
                ownerStats.AddAttackDirection(Direction.UPLEFT);
                break;

            case Owner.ENEMY:
                ownerStats.AddAttackDirection(Direction.DOWNRIGHT);
                ownerStats.AddAttackDirection(Direction.UPRIGHT);
                break;
            }
        }
Ejemplo n.º 2
0
    private void Start()
    {
        GM = GameObject.FindWithTag("GM");

        stats = GetComponent <CreatureStats>();
        stats.MakeImobile();

        // Make them able to attack everywhere
        Direction[] dirs = { Direction.DOWNLEFT, Direction.DOWNRIGHT, Direction.UPLEFT, Direction.UPRIGHT };

        foreach (Direction dir in dirs)
        {
            stats.AddAttackDirection(dir);
        }


        EventManager.OnPermanentDestroyed += OnPermanentDestroyed;
    }