public void ResetFlags()
 {
     build_flag       = Building.Building_Type.NOTHING;
     terra_flag       = Terrain.TerrainType.NOTHING;
     magic_cast_flag  = MagicController.SpellType.NOTHING;
     round_bonus_flag = RoundBonusManager.RoundBonusType.NOTHING;
 }
Ejemplo n.º 2
0
    void ReplaceTerrainModel(Terrain.TerrainType t_type) //These extra two methods are required until all terrain models are completed
    {
        Destroy(transform.GetChild(0).gameObject);
        GameObject go = Instantiate(terrainModels[(int)t_type], transform);

        go.transform.SetAsFirstSibling();
    }
Ejemplo n.º 3
0
    public bool CheckCanTerraform(Terrain.TerrainType target, Terrain.TerrainType tile)
    {
        int distance = Terrain.GetDistance(target, tile);

        //If player has either enough shovels or has enough resources to buy shovels
        if (distance <= shovel_count || distance - shovel_count * faction.Get_Cost_Terraform(current_upgrade_terraform).Worker <= publicPlayerAttributes.PlayerWorkers)
        {
            return(true);
        }
        return(false);
    }
Ejemplo n.º 4
0
    //Only resets locally, prevents turns being executed twice.
    public void ResetData()
    {
        CoordinateX        = 0; CoordinateY = 0;
        Built              = Building.Building_Type.NOTHING;
        Terraformed        = Terrain.TerrainType.NOTHING;
        PickedRoundBonus   = RoundBonusManager.RoundBonusType.NOTHING;
        ReturnedRoundBonus = RoundBonusManager.RoundBonusType.NOTHING;
        FoundedCityBonus   = TownFoundingBonusManager.TownTiletype.NOTHING;
        CastedSpell        = MagicController.SpellType.NOTHING;

        Change = ChangeFlag.NOTHING;
    }
Ejemplo n.º 5
0
    public void Terraform(Terrain.TerrainType target, Terrain.TerrainType tile)
    {
        int distance = Terrain.GetDistance(target, tile);

        for (int i = 0; i < distance; i++)
        {
            if (shovel_count > 0)
            {
                shovel_count--;
            }
            else //If we still need to terraform, convert workers into shovels and then use them
            {
                AddSingleIncome(faction.Get_Cost_Terraform(current_upgrade_terraform).Reciprocal());
                CheckPoints(PointBonus.Action_Type.Terraform);
            }
        }

        ui.UpdatePoints(publicPlayerAttributes.PlayerPoints);
    }
Ejemplo n.º 6
0
    public void Terraform(Terrain.TerrainType t_type)
    {
        switch (t_type) //Switch until all models are created
        {
        case Terrain.TerrainType.Forest: ReplaceTerrainModel(t_type); break;

        case Terrain.TerrainType.Mountain: ReplaceTerrainModel(t_type); break;

        case Terrain.TerrainType.Wasteland: ReplaceTerrainModel(t_type); break;

        case Terrain.TerrainType.Desert: ReplaceTerrainModel(t_type); break;

        case Terrain.TerrainType.Plains: ReplaceTerrainModel(t_type); break;

        case Terrain.TerrainType.Swamp: ReplaceTerrainModel(t_type); break;

        case Terrain.TerrainType.Lakes: ReplaceTerrainModel(t_type); break;
        }

        terrain.Set(t_type);
    }
Ejemplo n.º 7
0
        public static ITerrain GetTerrain(TerrainType type, Game game)
        {
            ITerrain terrain = null;

            switch (type)
            {
            case TerrainType.Quadtree:
                terrain = new Quadtree.Terrain(game);
                break;

            case TerrainType.GeoMipMap:
                terrain = new GeoMipMap.Terrain(game);
                break;

            case TerrainType.ROAM:
                terrain = new ROAM.Terrain(game);
                break;
            }

            return(terrain);
        }
Ejemplo n.º 8
0
 public void SendTerraformData(int[] coordinate, Terrain.TerrainType newTerrain)
 {
     Cmd_ChangeTerraformFlagData(newTerrain);
     Cmd_ChangeCoordinateData(coordinate[0], coordinate[1]);
     Cmd_SetChangeFlag(ChangeFlag.Terraform);
 }
Ejemplo n.º 9
0
 void Rpc_ChangeTerraformFlagData(Terrain.TerrainType newTerrain)
 {
     Terraformed = newTerrain;
 }
Ejemplo n.º 10
0
 void Cmd_ChangeTerraformFlagData(Terrain.TerrainType newTerrain)
 {
     Rpc_ChangeTerraformFlagData(newTerrain);
 }
Ejemplo n.º 11
0
    public bool CheckNeighbourSettleable(List <Coordinate> buildingLocs, Tile target, Terrain.TerrainType habitat, int shipping)
    {
        HashSet <Tile> neighbours = GetAllNeighbours(buildingLocs, shipping);

        foreach (Tile t in neighbours)
        {
            if (t.GetCoordinates().Equals(target.GetCoordinates()) && Terrain.TerrainEquals(t.GetTerrainType(), habitat))
            {
                return(true);
            }
        }
        return(false);
    }
 void Terraform(Terrain.TerrainType t_type, Tile t)
 {
     localPlayer.Terraform(t_type, t.GetTerrainType());
     endTurnOrBuild = true;
 }
 public void Set_Terraform_Flag(int flag_)
 {
     ResetFlags();
     terra_flag = (Terrain.TerrainType)flag_;
 }
Ejemplo n.º 14
0
 void Awake()
 {
     terrain_flag = Terrain.TerrainType.NOTHING;
 }
Ejemplo n.º 15
0
 public void ResetFlag()
 {
     terrain_flag = Terrain.ParseInt(7);
 }
Ejemplo n.º 16
0
 public void SetTerraformFlag(int terrain_type)
 {
     terrain_flag = Terrain.ParseInt(terrain_type);
 }
Ejemplo n.º 17
0
 void ReplaceMaterialViaRenderer(Terrain.TerrainType t_type)
 {
     GetRenderer().material = terrains[(int)t_type];
     terrain.Set(t_type);
 }
Ejemplo n.º 18
0
 //Takes a coordinate, type of terrain and player information and simulates
 //the terraforming of the given tile. Ownership of this tile is not given at this point
 public void SimulateTerraform(int[] coordinate, Terrain.TerrainType terrain)
 {
     tileMap.GetTile(coordinate).Terraform(terrain);
 }