Esempio n. 1
0
    public void SpawnEgg(Position _currentPosition, Unit.Team _team)
    {
        Vector3    positionEgg = new Vector3(_currentPosition.X, 0, _currentPosition.Y);
        GameObject o           = Instantiate(_egg, positionEgg, Quaternion.identity);

        o.GetComponent <Egg>().eggTeam = _team;
        o.GetComponent <Egg>().Renderer();
    }
Esempio n. 2
0
    public static void PositionList(GameObject who, int acts, Unit.Team t)
    {
        float dist = Vector2.Distance(who.transform.position, Camera.main.transform.position);

        if (t == Unit.Team.player && acts > 0 && dist < lowDist)
        {
            whoSelect = who;
        }
    }
Esempio n. 3
0
 public static void reportActions(Unit.Team team, int acts)
 {
     if (team == Unit.Team.player)
     {
         playerRoundActions += acts;
     }
     else if (team == Unit.Team.enemy)
     {
         enemyRoundActions += acts;
     }
 }
 public bool NoMoreUnitsToMove(Unit.Team team)
 {
     foreach (Unit u in units)
     {
         if (u.team == team && !u.usedThisTurn)
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 5
0
        public static Transform GetSpawnLocation(Unit.Team team)
        {
            switch (team)
            {
            case Unit.Team.Blue:
                return(Instance.spawnLocations[1]);

            default:
                return(Instance.spawnLocations[0]);
            }
        }
Esempio n. 6
0
    public List <Unit> GetUnitsFromTeam(Unit.Team team)
    {
        List <Unit> teamList = new List <Unit>();

        foreach (Unit unit in units)
        {
            if (unit.team == team)
            {
                teamList.Add(unit);
            }
        }
        return(teamList);
    }
Esempio n. 7
0
        public void HandleJoinTeam(Unit.Team team)
        {
            playerTeam = team;

            spawnLocation = ArenaManager.GetSpawnLocation(playerTeam);

            transform.rotation = spawnLocation.rotation; // rotate clientManager to match spawnLocation

            SpawnPlayer();



            gameState = Global.GameState.Running;
        }
Esempio n. 8
0
    public Unit createUnitAt(int x, int y, Unit.Team team, UnitStats stats)
    {
        Tile       t  = GetComponent <StageManager>().tiles[x][y];
        GameObject go = Instantiate(UnitPrefab, t.transform.position, Quaternion.identity) as GameObject;

        go.transform.parent = transform;
        Unit u = go.GetComponent <Unit>();

        u.tile  = t;
        t.unit  = u;
        u.team  = team;
        u.stats = stats;

        return(u);
    }
Esempio n. 9
0
    public void SpawnUnit(MapTile mapTile, Unit.Team team, string name)
    {
        // IMPORTANT! Keep refence synced
        Unit unit = new Unit();

        unit.mapTile = mapTile;
        mapTile.unit = unit;

        unit.Init();
        unit.team = team;
        if (Unit.Team.AI == team)
        {
            unit.ai = new AIHunter(this, controller, unit);
        }

        // add unit to list
        units.Add(unit);

        // unit is spawned
        EventProxyManager.FireEvent(this, new UnitSpawnedEvent(unit));
    }
Esempio n. 10
0
    void startTurn()
    {
        TurnNumber++;
        WhoTurn = whoTurn(TurnNumber);

        if (WhoTurn == Unit.Team.player)
        {
            //give player control.  ALready done with WhoTurn?
            SelectNearest();
            //move camera if unit not on screen
        }
        else if (WhoTurn == Unit.Team.enemy)
        {
            //start AI processing for what unit to select and do action
            //camera follows AI movements / actions
        }
        else if (WhoTurn == Unit.Team.neutral)
        {
            //do nothing for now?
        }
    }
Esempio n. 11
0
    private void SpawnQueen(Transform _positionQueen, Unit.Team team)
    {
        GameObject o = Instantiate(_queen, _positionQueenRed.position, Quaternion.identity);

        o.GetComponent <Queen>().Init(_queenHealth, _queenDamage, _queenMoveSpeed, team);
    }
Esempio n. 12
0
    internal void SpawnSoldier(Vector3 position, Unit.Team eggTeam)
    {
        GameObject o = Instantiate(_soldier, position, Quaternion.identity);

        o.GetComponent <Soldier>().Init(_soldierHealth, _soldierDamage, _soldierMoveSpeed, eggTeam);
    }
Esempio n. 13
0
 void newRound()
 {
     TurnNumber = 0;
     WhoTurn    = whoTurn(TurnNumber);
 }