Exemplo n.º 1
0
 public Object(string typeName, Vector3 pos, double angle) : base()
 {
     if ((Asset.map.majorAssets["StandingWaterAreas"] as StandingWaterAreas).areas.Length > 0)
     {
         float num    = (float)(Asset.map.majorAssets["StandingWaterAreas"] as StandingWaterAreas).areas[0].waterHeight;
         int   index1 = (int)((double)pos[0] / 10.0);
         int   index2 = (int)((double)pos[1] / 10.0);
         if (index1 >= 0 && index1 < Asset.map.mapWidth && (index2 >= 0 && index2 < Asset.map.mapHeight) && (double)Asset.map.heightMap.elevations[index1, index2] < (double)num)
         {
             pos[2] = num - pos[2];
         }
     }
     this.typeName             = typeName;
     this.position             = pos;
     this.angle                = (float)angle;
     this.objectInitialHealth  = new SubAsset <int>("objectInitialHealth", 100, this.namedSubAssets);
     this.objectEnabled        = new SubAsset <bool>("objectEnabled", true, this.namedSubAssets);
     this.objectIndestructible = new SubAsset <bool>("objectIndestructible", false, this.namedSubAssets);
     this.objectUnsellable     = new SubAsset <bool>("objectUnsellable", false, this.namedSubAssets);
     this.objectPowered        = new SubAsset <bool>("objectPowered", true, this.namedSubAssets);
     this.objectRecruitableAI  = new SubAsset <bool>("objectRecruitableAI", true, this.namedSubAssets);
     this.objectTargetable     = new SubAsset <bool>("objectTargetable", false, this.namedSubAssets);
     this.objectSleeping       = new SubAsset <bool>("objectSleeping", false, this.namedSubAssets);
     this.objectBasePriority   = new SubAsset <int>("objectBasePriority", 40, this.namedSubAssets);
     this.objectBasePhase      = new SubAsset <int>("objectBasePhase", 1, this.namedSubAssets);
     this.objectLayer          = new SubAsset <string>("objectLayer", "", this.namedSubAssets);
 }
Exemplo n.º 2
0
 public Team(string name, string owner, bool singleton)
 {
     this.namedSubAssets  = new Dictionary <string, SubAsset>();
     this.teamName        = new SubAsset <string>("teamName", name, this.namedSubAssets);
     this.teamOwner       = new SubAsset <string>("teamOwner", owner, this.namedSubAssets);
     this.teamIsSingleton = new SubAsset <bool>("teamIsSingleton", singleton, this.namedSubAssets);
 }
Exemplo n.º 3
0
        public override void Default()
        {
            foreach (SubAsset subAsset in this.namedSubAssets.Values)
            {
                subAsset.Clear();
            }
            this.namedSubAssets.Clear();

            /*
             * switch (this.game)
             * {
             *  case Game.RA3:
             *      this.musicZone = new SubAsset<string>("musicZone", "MusicPalette:MusicPalette_NotSet", this.namedSubAssets);
             *      this.cameraMinHeight = new SubAsset<float>("cameraMinHeight", 40f, this.namedSubAssets);
             *      this.cameraMaxHeight = new SubAsset<float>("cameraMaxHeight", 650f, this.namedSubAssets);
             *      this.terrainTextureStrings = new SubAsset<string>("terrainTextureStrings", "RA3Grid1;RA3Grid1_NRM;", this.namedSubAssets);
             *      break;
             *  case Game.CC3:
             *      this.musicZone = new SubAsset<string>("musicZone", "MusicPalette_NotSet", this.namedSubAssets);
             *      this.cameraMinHeight = new SubAsset<float>("cameraMinHeight", 40f, this.namedSubAssets);
             *      this.cameraMaxHeight = new SubAsset<float>("cameraMaxHeight", 500f, this.namedSubAssets);
             *      break;
             *  default:
             *      Console.WriteLine("!\t Asset: WorldInfo does not know how to create default data for Game." + (object)this.game);
             *      break;
             * }
             */
            this.weather               = new SubAsset <WorldInfo.WeatherType>("weather", WorldInfo.WeatherType.Normal, this.namedSubAssets);
            this.mapName               = new SubAsset <string>("mapName", "random", this.namedSubAssets);
            this.mapDescription        = new SubAsset <string>("mapDescription", "map created with map generator by KOS4U2C", this.namedSubAssets);
            this.compression           = new SubAsset <WorldInfo.CompressionType>("compression", WorldInfo.CompressionType.None, this.namedSubAssets);
            this.cameraGroundMinHeight = new SubAsset <float>("cameraGroundMinHeight", 0.0f, this.namedSubAssets);
            this.cameraGroundMaxHeight = new SubAsset <float>("cameraGroundMaxHeight", 2560f, this.namedSubAssets);
            this.isScenarioMultiplayer = new SubAsset <bool>("isScenarioMultiplayer", false, this.namedSubAssets);
        }
Exemplo n.º 4
0
        public Team(BinaryReader br)
        {
            short num1 = br.ReadInt16();

            this.namedSubAssets = new Dictionary <string, SubAsset>((int)num1);
            uint num2 = 0U;

            for (int index = 0; index < (int)num1; ++index)
            {
                string name = SubAsset.PeekSubAssetName(br);
                if (name.StartsWith("teamUnitType"))
                {
                    SubAsset <string> subAsset1 = new SubAsset <string>(br, name, this.namedSubAssets);
                }
                else if (name.StartsWith("teamUnitMaxCount"))
                {
                    SubAsset <int> subAsset2 = new SubAsset <int>(br, name, this.namedSubAssets);
                }
                else if (name.StartsWith("teamUnitMinCount"))
                {
                    SubAsset <int> subAsset3 = new SubAsset <int>(br, name, this.namedSubAssets);
                }
                else
                {
                    switch (name)
                    {
                    case "teamName":
                        this.teamName = new SubAsset <string>(br, name, this.namedSubAssets);
                        continue;

                    case "teamOwner":
                        this.teamOwner = new SubAsset <string>(br, name, this.namedSubAssets);
                        continue;

                    case "teamIsSingleton":
                        this.teamIsSingleton = new SubAsset <bool>(br, name, this.namedSubAssets);
                        continue;

                    case "exportWithScript":
                        SubAsset <bool> subAsset4 = new SubAsset <bool>(br, name, this.namedSubAssets);
                        continue;

                    default:
                        SubAsset.ReadAsBytes(br, name);
                        ++num2;
                        continue;
                    }
                }
            }
            if (num2 <= 0U)
            {
                return;
            }
            Console.WriteLine("!\t Asset: {0} skipped parsing {1} SubAssets", (object)this, (object)num2);
        }
Exemplo n.º 5
0
 public Player()
 {
     this.namedSubAssets    = new Dictionary <string, SubAsset>();
     this.playerName        = new SubAsset <string>("playerName", "", this.namedSubAssets);
     this.playerIsHuman     = new SubAsset <bool>("playerIsHuman", false, this.namedSubAssets);
     this.playerDisplayName = new SubAsset <string>("playerDisplayName", "Neutral", this.namedSubAssets);
     this.playerFaction     = new SubAsset <string>("playerFaction", "", this.namedSubAssets);
     this.playerAllies      = new SubAsset <string>("playerAllies", "", this.namedSubAssets);
     this.playerEnemies     = new SubAsset <string>("playerEnemies", "", this.namedSubAssets);
     this.trailer           = 0;
 }
Exemplo n.º 6
0
 public Player(string name, string faction)
 {
     this.namedSubAssets = new Dictionary <string, SubAsset>();
     Player.AIDifficulty data = Player.AIDifficulty.Easy | Player.AIDifficulty.Normal | Player.AIDifficulty.Hard | Player.AIDifficulty.Brutal;
     this.playerName        = new SubAsset <string>("playerName", name, this.namedSubAssets);
     this.playerIsHuman     = new SubAsset <bool>("playerIsHuman", false, this.namedSubAssets);
     this.playerDisplayName = new SubAsset <string>("playerDisplayName", name, this.namedSubAssets);
     this.playerFaction     = new SubAsset <string>("playerFaction", faction, this.namedSubAssets);
     this.playerAllies      = new SubAsset <string>("playerAllies", "", this.namedSubAssets);
     this.playerEnemies     = new SubAsset <string>("playerEnemies", "", this.namedSubAssets);
     this.aiBaseBuilder     = new SubAsset <Player.AIDifficulty>("aiBaseBuilder", data, this.namedSubAssets);
     this.aiUnitBuilder     = new SubAsset <Player.AIDifficulty>("aiUnitBuilder", data, this.namedSubAssets);
     this.aiTeamBuilder     = new SubAsset <Player.AIDifficulty>("aiTeamBuilder", data, this.namedSubAssets);
     this.aiEconomyBuilder  = new SubAsset <Player.AIDifficulty>("aiEconomyBuilder", data, this.namedSubAssets);
     this.aiWallBuilder     = new SubAsset <Player.AIDifficulty>("aiWallBuilder", data, this.namedSubAssets);
     this.aiUnitUpgrader    = new SubAsset <Player.AIDifficulty>("aiUnitUpgrader", data, this.namedSubAssets);
     this.aiScienceUpgrader = new SubAsset <Player.AIDifficulty>("aiScienceUpgrader", data, this.namedSubAssets);
     this.aiTactical        = new SubAsset <Player.AIDifficulty>("aiTactical", data, this.namedSubAssets);
     this.aiOpeningMover    = new SubAsset <Player.AIDifficulty>("aiOpeningMover", data, this.namedSubAssets);
     this.trailer           = 0;
 }
Exemplo n.º 7
0
        public Object(BinaryReader br) : base(br)
        {
            this.position    = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            this.angle       = (float)((double)br.ReadSingle() * 180.0 / 3.14159274101257);
            this.roadOptions = (Object.RoadOptions)br.ReadInt32();
            this.typeName    = IOUtility.ReadString(br);
            short num1 = br.ReadInt16();
            uint  num2 = 0U;

            for (int index = 0; index < (int)num1; ++index)
            {
                string name = SubAsset.PeekSubAssetName(br);
                switch (name)
                {
                case "objectInitialHealth":
                    this.objectInitialHealth = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "objectEnabled":
                    this.objectEnabled = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectIndestructible":
                    this.objectIndestructible = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectUnsellable":
                    this.objectUnsellable = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectPowered":
                    this.objectPowered = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectRecruitableAI":
                    this.objectRecruitableAI = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectTargetable":
                    this.objectTargetable = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectSleeping":
                    this.objectSleeping = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectBasePriority":
                    this.objectBasePriority = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "objectBasePhase":
                    this.objectBasePhase = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "originalOwner":
                    this.originalOwner = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "uniqueID":
                    this.uniqueID = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "objectLayer":
                    this.objectLayer = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "objectName":
                    this.objectName = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "objectPrototypeScale":
                    this.objectPrototypeScale = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "alignToTerrain":
                    this.alignToTerrain = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectTime":
                    this.objectTime = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "objectWeather":
                    this.objectWeather = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "objectEventsList":
                    this.objectEventsList = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "objectInitialStance":
                    this.objectInitialStance = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "exportWithScript":
                    this.exportWithScript = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectSoundAmbient":
                    this.objectSoundAmbient = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "scorchType":
                    this.scorchType = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "objectRadius":
                    this.objectRadius = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "objectSoundAmbientEnabled":
                    SubAsset <bool> subAsset1 = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectSoundAmbientCustomized":
                    SubAsset <bool> subAsset2 = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "objectSoundAmbientVolume":
                    SubAsset <float> subAsset3 = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "objectSoundAmbientMaxRange":
                    SubAsset <float> subAsset4 = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "objectSoundAmbientMinRange":
                    SubAsset <float> subAsset5 = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "waypointID":
                    this.waypointID = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "waypointName":
                    this.waypointName = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "waypointTypeOption":
                    this.waypointTypeOption = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "waypointPathLabel1":
                    this.waypointPathLabel1 = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "waypointPathLabel2":
                    this.waypointPathLabel2 = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "waypointPathLabel3":
                    this.waypointPathLabel3 = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "waypointPathBiDirectional":
                    this.waypointPathBiDirectional = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "waypointType":
                    this.waypointType = new SubAsset <Object.WaypointType>(br, name, this.namedSubAssets);
                    break;

                default:
                    SubAsset.ReadAsBytes(br, name);
                    ++num2;
                    break;
                }
            }
            if (num2 > 0U)
            {
                Console.WriteLine("!\t Asset: {0} skipped parsing {1} SubAssets", (object)this.GetType().Name, (object)num2);
            }
            if (this.roadOptions == (Object.RoadOptions) 0)
            {
                return;
            }
            Console.WriteLine("!\t Asset: Object - {0} roadOptions = {1}", (object)this.uniqueID.data, (object)this.roadOptions);
        }
Exemplo n.º 8
0
        public Player(BinaryReader br)
        {
            short num1 = br.ReadInt16();

            this.namedSubAssets = new Dictionary <string, SubAsset>((int)num1);
            uint num2 = 0U;

            for (int index = 0; index < (int)num1; ++index)
            {
                string name = SubAsset.PeekSubAssetName(br);
                switch (name)
                {
                case "playerName":
                    this.playerName = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "playerIsHuman":
                    this.playerIsHuman = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "playerDisplayName":
                    this.playerDisplayName = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "playerFaction":
                    this.playerFaction = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "playerAllies":
                    this.playerAllies = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "playerEnemies":
                    this.playerEnemies = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "aiBaseBuilder":
                    this.aiBaseBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiUnitBuilder":
                    this.aiUnitBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiTeamBuilder":
                    this.aiTeamBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiEconomyBuilder":
                    this.aiEconomyBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiWallBuilder":
                    this.aiWallBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiUnitUpgrader":
                    this.aiUnitUpgrader = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiScienceUpgrader":
                    this.aiScienceUpgrader = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiTactical":
                    this.aiTactical = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiOpeningMover":
                    this.aiOpeningMover = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets);
                    break;

                case "aiPersonality":
                    this.aiPersonality = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "playerColor":
                    this.playerColor = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                case "playerRadarColor":
                    this.playerRadarColor = new SubAsset <int>(br, name, this.namedSubAssets);
                    break;

                default:
                    SubAsset.ReadAsBytes(br, name);
                    ++num2;
                    break;
                }
            }
            if (num2 > 0U)
            {
                Console.WriteLine("!\t Asset: {0} skipped parsing {1} SubAssets", (object)this.GetType().Name, (object)num2);
            }
            this.trailer = br.ReadInt32();
            if (this.trailer == 0)
            {
                return;
            }
            Console.WriteLine("!\t Asset: Player expected int 0 for trailer");
        }
Exemplo n.º 9
0
        public WorldInfo(BinaryReader br, string[] assetStrings)
            : base(br)
        {
            short num1 = br.ReadInt16();
            uint  num2 = 0U;

            for (int index = 0; index < (int)num1; ++index)
            {
                string name = SubAsset.PeekSubAssetName(br);
                switch (name)
                {
                case "musicZone":
                    this.musicZone = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "terrainTextureStrings":
                    this.terrainTextureStrings = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "weather":
                    this.weather = new SubAsset <WorldInfo.WeatherType>(br, name, this.namedSubAssets);
                    break;

                case "mapName":
                    this.mapName = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "mapDescription":
                    this.mapDescription = new SubAsset <string>(br, name, this.namedSubAssets);
                    break;

                case "compression":
                    this.compression = new SubAsset <WorldInfo.CompressionType>(br, name, this.namedSubAssets);
                    break;

                case "cameraGroundMinHeight":
                    this.cameraGroundMinHeight = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "cameraGroundMaxHeight":
                    this.cameraGroundMaxHeight = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "cameraMinHeight":
                    this.cameraMinHeight = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "cameraMaxHeight":
                    this.cameraMaxHeight = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "isScenarioMultiplayer":
                    this.isScenarioMultiplayer = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                case "cameraPitchAngle":
                    this.cameraPitchAngle = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "cameraYawAngle":
                    this.cameraYawAngle = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "cameraScrollSpeedScalar":
                    this.cameraScrollSpeedScalar = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "cameraMapHeightSmoothnessScalar":
                    this.cameraMapHeightSmoothnessScalar = new SubAsset <float>(br, name, this.namedSubAssets);
                    break;

                case "isLivingWorldScriptHolder":
                    SubAsset <bool> subAsset = new SubAsset <bool>(br, name, this.namedSubAssets);
                    break;

                default:
                    SubAsset.ReadAsBytes(br, name);
                    ++num2;
                    break;
                }
            }
            if (num2 > 0U)
            {
                Console.WriteLine("!\t Asset: {0} skipped parsing {1} SubAssets", (object)this.GetType().Name, (object)num2);
            }
            this.CheckParsedSize(br);
            if (this.mapName != null)
            {
                return;
            }
            this.mapName = new SubAsset <string>("mapName", "", this.namedSubAssets);
        }