Exemple #1
0
        public void Spawn(Map.ID id, Vector3Int p)
        {
            var t = map.GetThing(id, p, true);

            t.prevPos = pos;
            t.dir     = DirTo(p);
            t.FaceDir();
        }
Exemple #2
0
        public Act Shoot(Vector3Int d, Map.ID block = 0)
        {
            var t = map.GetThing(Map.ID.SHOT | team, pos, true);

            t.dir        = d;
            t.blockMask |= block;
            return(Act.SHOOT);
        }
Exemple #3
0
        public void SetID(Map.ID id)
        {
            gameObject.SetActive(true);
            this.id      = id;
            fabId        = (id & Map.PREFAB_MASK);
            team         = (id & Map.TEAM_MASK);
            countId      = (int)(id & Map.COUNT_MASK);
            name         = fabId.ToString() + " c" + countId + " " + thingCount++;
            dir          = UP;
            face         = UP;
            hp           = hpTotal = 1;
            blockMask    = Map.ID.HARD_WALL;
            roundCreated = map.roundCount;


            switch (fabId)
            {
            case Map.ID.PLAYER:
                hp = hpTotal = 3;
                break;

            case Map.ID.MON:
                switch ((Mon)countId)
                {
                case Mon.SPAWNER:
                    spriteRenderer.sprite = map.lib.monSpawner;
                    break;

                case Mon.HUNTER:
                    spriteRenderer.sprite = map.lib.monHunter;
                    break;

                case Mon.FLEE:
                    spriteRenderer.sprite = map.lib.monFlee;
                    break;
                }
                blockMask |= team;
                break;
            }
        }