public void Spawn(Map.ID id, Vector3Int p) { var t = map.GetThing(id, p, true); t.prevPos = pos; t.dir = DirTo(p); t.FaceDir(); }
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); }
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; } }