Beispiel #1
0
 public clsUnitType.clsAttachment CopyAttachment(clsUnitType.clsAttachment Other)
 {
     clsUnitType.clsAttachment newItem = new clsUnitType.clsAttachment {
         Pos_Offset = Other.Pos_Offset
     };
     this.Attachments.Add(newItem);
     Matrix3DMath.MatrixCopy(Other.AngleOffsetMatrix, newItem.AngleOffsetMatrix);
     newItem.Models.AddSimpleList(Other.Models);
     newItem.Attachments.AddSimpleList(Other.Attachments);
     return newItem;
 }
Beispiel #2
0
 public static void CreateGeneratorTilesets()
 {
     Generator_TilesetArizona = new clsGeneratorTileset();
     Generator_TilesetArizona.Tileset = modProgram.Tileset_Arizona;
     Generator_TilesetUrban = new clsGeneratorTileset();
     Generator_TilesetUrban.Tileset = modProgram.Tileset_Urban;
     Generator_TilesetRockies = new clsGeneratorTileset();
     Generator_TilesetRockies.Tileset = modProgram.Tileset_Rockies;
     UnitType_OilResource = GetUnitTypeFromCode("OilResource");
     UnitType_CommandCentre = GetUnitTypeFromCode("A0CommandCentre");
     UnitType_Truck = GetUnitTypeFromCode("ConstructionDroid");
     UnitType_Factory = GetUnitTypeFromCode("A0LightFactory");
     UnitType_FactoryModule = GetUnitTypeFromCode("A0FacMod1");
     UnitType_CyborgFactory = GetUnitTypeFromCode("A0CyborgFactory");
     UnitType_ResearchFacility = GetUnitTypeFromCode("A0ResearchFacility");
     UnitType_ResearchModule = GetUnitTypeFromCode("A0ResearchModule1");
     UnitType_PowerGenerator = GetUnitTypeFromCode("A0PowerGenerator");
     UnitType_PowerModule = GetUnitTypeFromCode("A0PowMod1");
     UnitType_Derrick = GetUnitTypeFromCode("A0ResourceExtractor");
     UnitType_Boulder1 = GetUnitTypeFromCode("Boulder1");
     UnitType_Boulder2 = GetUnitTypeFromCode("Boulder2");
     UnitType_Boulder3 = GetUnitTypeFromCode("Boulder3");
     UnitType_Ruin1 = GetUnitTypeFromCode("Ruin1");
     UnitType_Ruin3 = GetUnitTypeFromCode("Ruin3");
     UnitType_Ruin4 = GetUnitTypeFromCode("Ruin4");
     UnitType_Ruin5 = GetUnitTypeFromCode("Ruin5");
     UnitType_5Trees = GetUnitTypeFromCode("Tree1");
     UnitType_4Trees = GetUnitTypeFromCode("Tree2");
     UnitType_1Tree = GetUnitTypeFromCode("Tree3");
     UnitType_5TreesSnowy = GetUnitTypeFromCode("TreeSnow1");
     UnitType_4TreesSnowy = GetUnitTypeFromCode("TreeSnow2");
     UnitType_1TreeSnowy = GetUnitTypeFromCode("TreeSnow3");
     UnitType_Highrise1 = GetUnitTypeFromCode("building1");
     UnitType_Highrise2 = GetUnitTypeFromCode("building2");
     UnitType_Highrise3 = GetUnitTypeFromCode("building3");
     UnitType_HalfHighrise = GetUnitTypeFromCode("building11");
     UnitType_HighriseStump1 = GetUnitTypeFromCode("building7");
     UnitType_HighriseStump2 = GetUnitTypeFromCode("building8");
     UnitType_BuildingStump = GetUnitTypeFromCode("WreckedBuilding9");
     UnitType_SmallBuilding1 = GetUnitTypeFromCode("building10");
     UnitType_SmallBuilding2 = GetUnitTypeFromCode("building12");
     UnitType_SmallBuilding3 = GetUnitTypeFromCode("WreckedBuilding17");
     UnitType_LogCabin1 = GetUnitTypeFromCode("LogCabin1");
     UnitType_LogCabin2 = GetUnitTypeFromCode("LogCabin2");
     UnitType_LogCabin3 = GetUnitTypeFromCode("LogCabin3");
     UnitType_LogCabin4 = GetUnitTypeFromCode("LogCabin4");
     UnitType_LogCabin5 = GetUnitTypeFromCode("LogCabin5");
     UnitType_Crane = GetUnitTypeFromCode("Crane");
     UnitType_OilDrum = GetUnitTypeFromCode("OilDrum");
     clsGeneratorTileset.sUnitChance newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Boulder1, 1);
     Generator_TilesetArizona.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Boulder2, 1);
     Generator_TilesetArizona.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Boulder3, 1);
     Generator_TilesetArizona.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Ruin1, 1);
     Generator_TilesetArizona.ClusteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Ruin3, 1);
     Generator_TilesetArizona.ClusteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Ruin4, 1);
     Generator_TilesetArizona.ClusteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Ruin5, 1);
     Generator_TilesetArizona.ClusteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Highrise1, 3);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Highrise2, 3);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Highrise3, 3);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_HalfHighrise, 1);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_SmallBuilding1, 3);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_SmallBuilding2, 3);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_SmallBuilding3, 3);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_HighriseStump1, 1);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_HighriseStump2, 1);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_BuildingStump, 1);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_Crane, 2);
     Generator_TilesetUrban.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_5Trees, 1);
     Generator_TilesetRockies.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_4Trees, 1);
     Generator_TilesetRockies.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_1Tree, 2);
     Generator_TilesetRockies.ScatteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_LogCabin1, 3);
     Generator_TilesetRockies.ClusteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_LogCabin2, 1);
     Generator_TilesetRockies.ClusteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_LogCabin3, 1);
     Generator_TilesetRockies.ClusteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_LogCabin4, 1);
     Generator_TilesetRockies.ClusteredUnit_Add(newUnit);
     newUnit = new clsGeneratorTileset.sUnitChance(UnitType_LogCabin5, 3);
     Generator_TilesetRockies.ClusteredUnit_Add(newUnit);
     int index = 0;
     TerrainStyle_Arizona.LayerCount = 5;
     index = 0;
     TerrainStyle_Arizona.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Arizona.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Arizona.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Arizona.Layers[index].TileNum = 0x30;
     TerrainStyle_Arizona.Layers[index].TerrainmapDensity = 1f;
     TerrainStyle_Arizona.Layers[index].TerrainmapScale = 0f;
     TerrainStyle_Arizona.Layers[index].HeightMax = 256f;
     TerrainStyle_Arizona.Layers[index].AvoidLayers = new bool[(TerrainStyle_Arizona.LayerCount - 1) + 1];
     TerrainStyle_Arizona.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Arizona.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Arizona.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Arizona.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Arizona.Layers[index].TileNum = 11;
     TerrainStyle_Arizona.Layers[index].TerrainmapDensity = 0.5f;
     TerrainStyle_Arizona.Layers[index].TerrainmapScale = 2f;
     TerrainStyle_Arizona.Layers[index].HeightMax = 256f;
     TerrainStyle_Arizona.Layers[index].AvoidLayers = new bool[(TerrainStyle_Arizona.LayerCount - 1) + 1];
     TerrainStyle_Arizona.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Arizona.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Arizona.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Arizona.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Arizona.Layers[index].TileNum = 5;
     TerrainStyle_Arizona.Layers[index].TerrainmapDensity = 0.4f;
     TerrainStyle_Arizona.Layers[index].TerrainmapScale = 1.5f;
     TerrainStyle_Arizona.Layers[index].HeightMax = 256f;
     TerrainStyle_Arizona.Layers[index].AvoidLayers = new bool[(TerrainStyle_Arizona.LayerCount - 1) + 1];
     TerrainStyle_Arizona.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Arizona.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Arizona.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Arizona.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Arizona.Layers[index].TileNum = 0x17;
     TerrainStyle_Arizona.Layers[index].TerrainmapDensity = 0.75f;
     TerrainStyle_Arizona.Layers[index].TerrainmapScale = 1.5f;
     TerrainStyle_Arizona.Layers[index].HeightMax = 256f;
     TerrainStyle_Arizona.Layers[index].AvoidLayers = new bool[(TerrainStyle_Arizona.LayerCount - 1) + 1];
     TerrainStyle_Arizona.Layers[index].WithinLayer = index - 1;
     index++;
     TerrainStyle_Arizona.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Arizona.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Arizona.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Arizona.Layers[index].TileNum = 0x12;
     TerrainStyle_Arizona.Layers[index].TerrainmapDensity = 1f;
     TerrainStyle_Arizona.Layers[index].TerrainmapScale = 0f;
     TerrainStyle_Arizona.Layers[index].HeightMax = 256f;
     TerrainStyle_Arizona.Layers[index].IsCliff = true;
     TerrainStyle_Arizona.Layers[index].AvoidLayers = new bool[(TerrainStyle_Arizona.LayerCount - 1) + 1];
     TerrainStyle_Arizona.Layers[index].WithinLayer = -1;
     TerrainStyle_Arizona.Tileset = Generator_TilesetArizona;
     Generator_TilesetArizona.BorderTextureNum = 0x12;
     TerrainStyle_Urban.LayerCount = 6;
     index = 0;
     TerrainStyle_Urban.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Urban.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Urban.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Urban.Layers[index].TileNum = 7;
     TerrainStyle_Urban.Layers[index].TerrainmapDensity = 1f;
     TerrainStyle_Urban.Layers[index].HeightMax = 256f;
     TerrainStyle_Urban.Layers[index].AvoidLayers = new bool[(TerrainStyle_Urban.LayerCount - 1) + 1];
     TerrainStyle_Urban.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Urban.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Urban.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Urban.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Urban.Layers[index].TileNum = 0;
     TerrainStyle_Urban.Layers[index].TerrainmapDensity = 0.5f;
     TerrainStyle_Urban.Layers[index].TerrainmapScale = 1.5f;
     TerrainStyle_Urban.Layers[index].HeightMax = 256f;
     TerrainStyle_Urban.Layers[index].AvoidLayers = new bool[(TerrainStyle_Urban.LayerCount - 1) + 1];
     TerrainStyle_Urban.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Urban.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Urban.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Urban.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Urban.Layers[index].TileNum = 0x16;
     TerrainStyle_Urban.Layers[index].TerrainmapDensity = 0.333f;
     TerrainStyle_Urban.Layers[index].TerrainmapScale = 1.5f;
     TerrainStyle_Urban.Layers[index].HeightMax = 256f;
     TerrainStyle_Urban.Layers[index].AvoidLayers = new bool[(TerrainStyle_Urban.LayerCount - 1) + 1];
     TerrainStyle_Urban.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Urban.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Urban.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Urban.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Urban.Layers[index].TileNum = 50;
     TerrainStyle_Urban.Layers[index].TerrainmapDensity = 0.333f;
     TerrainStyle_Urban.Layers[index].TerrainmapScale = 1.5f;
     TerrainStyle_Urban.Layers[index].HeightMax = 256f;
     TerrainStyle_Urban.Layers[index].AvoidLayers = new bool[(TerrainStyle_Urban.LayerCount - 1) + 1];
     TerrainStyle_Urban.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Urban.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Urban.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Urban.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Urban.Layers[index].TileNum = 0x33;
     TerrainStyle_Urban.Layers[index].TerrainmapDensity = 0.4f;
     TerrainStyle_Urban.Layers[index].TerrainmapScale = 1.5f;
     TerrainStyle_Urban.Layers[index].HeightMax = 256f;
     TerrainStyle_Urban.Layers[index].AvoidLayers = new bool[(TerrainStyle_Urban.LayerCount - 1) + 1];
     TerrainStyle_Urban.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Urban.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Urban.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Urban.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Urban.Layers[index].TileNum = 70;
     TerrainStyle_Urban.Layers[index].TerrainmapDensity = 1f;
     TerrainStyle_Urban.Layers[index].TerrainmapScale = 0f;
     TerrainStyle_Urban.Layers[index].HeightMax = 256f;
     TerrainStyle_Urban.Layers[index].IsCliff = true;
     TerrainStyle_Urban.Layers[index].AvoidLayers = new bool[(TerrainStyle_Urban.LayerCount - 1) + 1];
     TerrainStyle_Urban.Layers[index].WithinLayer = -1;
     TerrainStyle_Urban.Tileset = Generator_TilesetUrban;
     Generator_TilesetUrban.BorderTextureNum = 70;
     TerrainStyle_Rockies.LayerCount = 7;
     index = 0;
     TerrainStyle_Rockies.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Rockies.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Rockies.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Rockies.Layers[index].TileNum = 0;
     TerrainStyle_Rockies.Layers[index].TerrainmapDensity = 1f;
     TerrainStyle_Rockies.Layers[index].TerrainmapScale = 0f;
     TerrainStyle_Rockies.Layers[index].HeightMax = 256f;
     TerrainStyle_Rockies.Layers[index].AvoidLayers = new bool[(TerrainStyle_Rockies.LayerCount - 1) + 1];
     TerrainStyle_Rockies.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Rockies.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Rockies.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Rockies.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Rockies.Layers[index].TileNum = 0x35;
     TerrainStyle_Rockies.Layers[index].TerrainmapDensity = 0.4f;
     TerrainStyle_Rockies.Layers[index].TerrainmapScale = 1.5f;
     TerrainStyle_Rockies.Layers[index].HeightMax = 256f;
     TerrainStyle_Rockies.Layers[index].AvoidLayers = new bool[(TerrainStyle_Rockies.LayerCount - 1) + 1];
     TerrainStyle_Rockies.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Rockies.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Rockies.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Rockies.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Rockies.Layers[index].TileNum = 0x17;
     TerrainStyle_Rockies.Layers[index].TerrainmapDensity = 0.333f;
     TerrainStyle_Rockies.Layers[index].TerrainmapScale = 1.5f;
     TerrainStyle_Rockies.Layers[index].HeightMin = 85f;
     TerrainStyle_Rockies.Layers[index].HeightMax = 256f;
     TerrainStyle_Rockies.Layers[index].AvoidLayers = new bool[(TerrainStyle_Rockies.LayerCount - 1) + 1];
     TerrainStyle_Rockies.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Rockies.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Rockies.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Rockies.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Rockies.Layers[index].TileNum = 0x40;
     TerrainStyle_Rockies.Layers[index].TerrainmapDensity = 0.5f;
     TerrainStyle_Rockies.Layers[index].TerrainmapScale = 1f;
     TerrainStyle_Rockies.Layers[index].HeightMin = 85f;
     TerrainStyle_Rockies.Layers[index].HeightMax = 256f;
     TerrainStyle_Rockies.Layers[index].AvoidLayers = new bool[(TerrainStyle_Rockies.LayerCount - 1) + 1];
     TerrainStyle_Rockies.Layers[index].WithinLayer = index - 1;
     index++;
     TerrainStyle_Rockies.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Rockies.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Rockies.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Rockies.Layers[index].TileNum = 0x29;
     TerrainStyle_Rockies.Layers[index].TerrainmapDensity = 1f;
     TerrainStyle_Rockies.Layers[index].TerrainmapScale = 0f;
     TerrainStyle_Rockies.Layers[index].HeightMin = 170f;
     TerrainStyle_Rockies.Layers[index].HeightMax = 256f;
     TerrainStyle_Rockies.Layers[index].AvoidLayers = new bool[(TerrainStyle_Rockies.LayerCount - 1) + 1];
     TerrainStyle_Rockies.Layers[index].WithinLayer = -1;
     index++;
     TerrainStyle_Rockies.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Rockies.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Rockies.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Rockies.Layers[index].TileNum = 0x40;
     TerrainStyle_Rockies.Layers[index].TerrainmapDensity = 0.875f;
     TerrainStyle_Rockies.Layers[index].TerrainmapScale = 1f;
     TerrainStyle_Rockies.Layers[index].HeightMin = 170f;
     TerrainStyle_Rockies.Layers[index].HeightMax = 256f;
     TerrainStyle_Rockies.Layers[index].AvoidLayers = new bool[(TerrainStyle_Rockies.LayerCount - 1) + 1];
     TerrainStyle_Rockies.Layers[index].WithinLayer = index - 1;
     index++;
     TerrainStyle_Rockies.Layers = (clsMap.sGenerateMasterTerrainArgs.clsLayer[]) Utils.CopyArray((Array) TerrainStyle_Rockies.Layers, new clsMap.sGenerateMasterTerrainArgs.clsLayer[index + 1]);
     TerrainStyle_Rockies.Layers[index] = new clsMap.sGenerateMasterTerrainArgs.clsLayer();
     TerrainStyle_Rockies.Layers[index].TileNum = 30;
     TerrainStyle_Rockies.Layers[index].TerrainmapDensity = 1f;
     TerrainStyle_Rockies.Layers[index].TerrainmapScale = 0f;
     TerrainStyle_Rockies.Layers[index].HeightMax = 256f;
     TerrainStyle_Rockies.Layers[index].IsCliff = true;
     TerrainStyle_Rockies.Layers[index].AvoidLayers = new bool[(TerrainStyle_Rockies.LayerCount - 1) + 1];
     TerrainStyle_Rockies.Layers[index].WithinLayer = -1;
     TerrainStyle_Rockies.Tileset = Generator_TilesetRockies;
     Generator_TilesetRockies.BorderTextureNum = 30;
 }
Beispiel #3
0
 public clsUnitType.clsAttachment AddCopyOfAttachment(clsUnitType.clsAttachment AttachmentToCopy)
 {
     IEnumerator enumerator;
     clsUnitType.clsAttachment newItem = new clsUnitType.clsAttachment();
     this.Attachments.Add(newItem);
     Matrix3DMath.MatrixCopy(AttachmentToCopy.AngleOffsetMatrix, newItem.AngleOffsetMatrix);
     newItem.Models.AddSimpleList(AttachmentToCopy.Models);
     try
     {
         enumerator = AttachmentToCopy.Attachments.GetEnumerator();
         while (enumerator.MoveNext())
         {
             clsUnitType.clsAttachment current = (clsUnitType.clsAttachment) enumerator.Current;
             newItem.AddCopyOfAttachment(current);
         }
     }
     finally
     {
         if (enumerator is IDisposable)
         {
             (enumerator as IDisposable).Dispose();
         }
     }
     return newItem;
 }
Beispiel #4
0
 public clsMap.clsUnit PlaceUnitNear(clsUnitType Type, modMath.sXY_int Pos, clsMap.clsUnitGroup UnitGroup, int Clearance, int Rotation, int MaxDistFromPos)
 {
     modMath.sXY_int _int;
     modMath.sXY_int _int3;
     modMath.sXY_int _int4;
     PathfinderNode node = this.GetNearestNodeConnection(this.TilePathMap, Pos, Clearance, (float) MaxDistFromPos);
     if (node == null)
     {
         return null;
     }
     clsNodeTag tag = (clsNodeTag) node.Tag;
     modMath.sXY_int _int5 = Pos - tag.Pos;
     if (_int5.ToDoubles().GetMagnitude() > MaxDistFromPos)
     {
         return null;
     }
     clsMap.clsUnitAdd add = new clsMap.clsUnitAdd {
         Map = this.Map,
         StoreChange = true
     };
     clsMap.clsUnit unit2 = new clsMap.clsUnit();
     add.NewUnit = unit2;
     unit2.Type = Type;
     unit2.UnitGroup = UnitGroup;
     _int.X = (int) Math.Round(((double) (((double) tag.Pos.X) / 128.0)));
     _int.Y = (int) Math.Round(((double) (((double) tag.Pos.Y) / 128.0)));
     modMath.sXY_int _int2 = Type.get_GetFootprintSelected(Rotation);
     int num = _int2.X % 2;
     if (num > 0)
     {
         unit2.Pos.Horizontal.X = tag.Pos.X;
     }
     else if (App.Random.Next() >= 0.5f)
     {
         unit2.Pos.Horizontal.X = tag.Pos.X - 0x40;
     }
     else
     {
         unit2.Pos.Horizontal.X = tag.Pos.X + 0x40;
     }
     num = _int2.Y % 2;
     if (num > 0)
     {
         unit2.Pos.Horizontal.Y = tag.Pos.Y;
     }
     else if (App.Random.Next() >= 0.5f)
     {
         unit2.Pos.Horizontal.Y = tag.Pos.Y - 0x40;
     }
     else
     {
         unit2.Pos.Horizontal.Y = tag.Pos.Y + 0x40;
     }
     _int3.X = (int) Math.Round(((double) (((((double) unit2.Pos.Horizontal.X) / 128.0) - (((double) _int2.X) / 2.0)) + 0.5)));
     _int3.Y = (int) Math.Round(((double) (((((double) unit2.Pos.Horizontal.Y) / 128.0) - (((double) _int2.Y) / 2.0)) + 0.5)));
     _int4.X = (int) Math.Round(((double) (((((double) unit2.Pos.Horizontal.X) / 128.0) + (((double) _int2.X) / 2.0)) - 0.5)));
     _int4.Y = (int) Math.Round(((double) (((((double) unit2.Pos.Horizontal.Y) / 128.0) + (((double) _int2.Y) / 2.0)) - 0.5)));
     unit2.Rotation = Rotation;
     add.Perform();
     int num4 = Math.Min(_int4.Y, this.Map.Terrain.TileSize.Y - 1);
     for (int i = Math.Max(_int3.Y, 0); i <= num4; i++)
     {
         int num5 = Math.Min(_int4.X, this.Map.Terrain.TileSize.X - 1);
         for (int j = Math.Max(_int3.X, 0); j <= num5; j++)
         {
             this.TileNodeBlock(j, i);
         }
     }
     this.TilePathMap.FindCalc();
     return unit2;
 }
Beispiel #5
0
 public clsMap.clsUnit PlaceUnit(clsUnitType Type, modProgram.sWorldPos Pos, clsMap.clsUnitGroup UnitGroup, int Rotation)
 {
     modMath.sXY_int _int;
     modMath.sXY_int _int3;
     modMath.sXY_int _int4;
     clsMap.clsUnitAdd add = new clsMap.clsUnitAdd {
         Map = this.Map,
         StoreChange = true
     };
     clsMap.clsUnit unit = new clsMap.clsUnit();
     add.NewUnit = unit;
     unit.Type = Type;
     unit.UnitGroup = UnitGroup;
     _int.X = (int) Math.Round(((double) (((double) Pos.Horizontal.X) / 128.0)));
     _int.Y = (int) Math.Round(((double) (((double) Pos.Horizontal.Y) / 128.0)));
     modMath.sXY_int _int2 = Type.get_GetFootprintSelected(Rotation);
     unit.Pos = Pos;
     _int3.X = (int) Math.Round(((double) (((((double) unit.Pos.Horizontal.X) / 128.0) - (((double) _int2.X) / 2.0)) + 0.5)));
     _int3.Y = (int) Math.Round(((double) (((((double) unit.Pos.Horizontal.Y) / 128.0) - (((double) _int2.Y) / 2.0)) + 0.5)));
     _int4.X = (int) Math.Round(((double) (((((double) unit.Pos.Horizontal.X) / 128.0) + (((double) _int2.X) / 2.0)) - 0.5)));
     _int4.Y = (int) Math.Round(((double) (((((double) unit.Pos.Horizontal.Y) / 128.0) + (((double) _int2.Y) / 2.0)) - 0.5)));
     unit.Rotation = Rotation;
     add.Perform();
     int num3 = Math.Min(_int4.Y, this.Map.Terrain.TileSize.Y - 1);
     for (int i = Math.Max(_int3.Y, 0); i <= num3; i++)
     {
         int num4 = Math.Min(_int4.X, this.Map.Terrain.TileSize.X - 1);
         for (int j = Math.Max(_int3.X, 0); j <= num4; j++)
         {
             this.TileNodeBlock(j, i);
         }
     }
     this.TilePathMap.FindCalc();
     return unit;
 }
 public sUnitChance(clsUnitType Type, uint Chance)
 {
     this = new clsGeneratorTileset.sUnitChance();
     this.Type = Type;
     this.Chance = Chance;
 }
Beispiel #7
0
        public clsUnitType FindOrCreateUnitType(string Code, clsUnitType.enumType Type, int WallType)
        {
            switch (Type)
            {
                case clsUnitType.enumType.Feature:
                    clsFeatureType current;
                    IEnumerator enumerator;
                    try
                    {
                        enumerator = this.FeatureTypes.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            current = (clsFeatureType) enumerator.Current;
                            if (current.Code == Code)
                            {
                                return current;
                            }
                        }
                    }
                    finally
                    {
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    current = new clsFeatureType {
                        IsUnknown = true,
                        Code = Code
                    };
                    current.Footprint.X = 1;
                    current.Footprint.Y = 1;
                    return current;

                case clsUnitType.enumType.PlayerStructure:
                    clsStructureType type3;
                    IEnumerator enumerator2;
                    try
                    {
                        enumerator2 = this.StructureTypes.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            type3 = (clsStructureType) enumerator2.Current;
                            if (type3.Code == Code)
                            {
                                if (WallType < 0)
                                {
                                    return type3;
                                }
                                if (type3.WallLink.IsConnected && (type3.WallLink.ArrayPosition == WallType))
                                {
                                    return type3;
                                }
                            }
                        }
                    }
                    finally
                    {
                        if (enumerator2 is IDisposable)
                        {
                            (enumerator2 as IDisposable).Dispose();
                        }
                    }
                    type3 = new clsStructureType {
                        IsUnknown = true,
                        Code = Code
                    };
                    type3.Footprint.X = 1;
                    type3.Footprint.Y = 1;
                    return type3;

                case clsUnitType.enumType.PlayerDroid:
                    IEnumerator enumerator3;
                    try
                    {
                        enumerator3 = this.DroidTemplates.GetEnumerator();
                        while (enumerator3.MoveNext())
                        {
                            clsDroidTemplate template = (clsDroidTemplate) enumerator3.Current;
                            if (template.IsTemplate && (template.Code == Code))
                            {
                                return template;
                            }
                        }
                    }
                    finally
                    {
                        if (enumerator3 is IDisposable)
                        {
                            (enumerator3 as IDisposable).Dispose();
                        }
                    }
                    return new clsDroidTemplate { IsUnknown = true, Code = Code };
            }
            return null;
        }