public override void Parse(ICsvParser parser)
            {
                base.Parse(parser);
                this.ChildRotateLeft             = parser.GetInt();
                this.ChildRotateRight            = parser.GetInt();
                this.ChildParentRelativeRotation = parser.GetShort();
                this.ChildAngleStart             = parser.GetShort();
                this.ChildAngleLength            = parser.GetShort();
                this.ChildCenterDeltaX           = parser.GetShort();
                this.ChildCenterDeltaY           = parser.GetShort();
                this.ChildCenterDeltaZ           = (this.Version >= 27) ? parser.GetShort() : (short)0;
                this.ChildSortAdjust             = parser.GetShort();
                this.ChildDisableWhenParentDead  = (this.Version >= 14) ? parser.GetShort() : (short)0;
                this.ChildDisableWhenParentEmpty = (this.Version >= 38) ? parser.GetShort() : (short)0;
                this.ChildElevationLowAngle      = (this.Version >= 44) ? parser.GetShort() : (short)0;
                this.ChildEelevationHighAngle    = (this.Version >= 44) ? parser.GetShort() : (short)0;
                this.ChildElevationSpeed         = (this.Version >= 44) ? parser.GetShort() : (short)0;
                this.Unknown6D0 = (this.Version >= 44) ? parser.GetQuotedString() : "";
                this.Unknown6E8 = (this.Version >= 44) ? parser.GetQuotedString() : "";
                this.Unknown700 = (this.Version >= 44) ? parser.GetShort() : (short)0;
                this.Unknown702 = (this.Version >= 44) ? parser.GetShort() : (short)0;

                if (this.Version >= 30)
                {
                    this.SpriteOccupied.ParseV3(parser);
                    this.SpriteEmpty.ParseV3(parser);
                    this.SpriteBroken.ParseV3(parser);
                }
                else if (this.Version >= 12)
                {
                    this.SpriteOccupied.ParseV2(parser);
                    this.SpriteEmpty.ParseV2(parser);
                    this.SpriteBroken.ParseV2(parser);
                }
                else
                {
                    this.SpriteOccupied.ParseV1(parser);
                    this.SpriteEmpty.ParseV1(parser);
                    this.SpriteBroken.ParseV1(parser);
                }

                this.SoundRotate = parser.GetInstance <SoundBlob>();

                if (this.Version < 3)
                {
                    this.SpriteOccupied.FixUnknown18();
                    this.SpriteEmpty.FixUnknown18();
                    this.SpriteBroken.FixUnknown18();
                    this.SoundRotate.FixBlobId();
                }


                base.blofiles.Add(SpriteOccupied.BlobName);
                base.blofiles.Add(SpriteEmpty.BlobName);
                base.blofiles.Add(SpriteBroken.BlobName);
                base.blofiles.Add(SoundRotate.BlobName);
            }
            public short Confirm;                // C0

            public void Parse(int version, ICsvParser parser)
            {
                this.Title                    = parser.GetString();
                this.ProductToCreate          = parser.GetShort();
                this.Quantity                 = parser.GetShort();
                this.Team                     = parser.GetInt();
                this.Time                     = parser.GetInt();
                this.PlayerItemNeededId       = parser.GetShort();
                this.PlayerItemNeededQuantity = parser.GetInt();
                this.Cost                     = parser.GetInt();
                this.SkillLogic               = parser.GetQuotedString();
                this.TeamItemNeededId         = parser.GetShort();
                this.TeamItemNeededQuantity   = parser.GetShort();
                this.TeamBuildingLogic        = parser.GetQuotedString();
                this.TeamQueueRequest         = parser.GetInt();
                this.Confirm                  = (version >= 51) ? parser.GetShort() : (short)0;
            }
Example #3
0
        public virtual void Parse(ICsvParser parser)
        {
            this.Version      = parser.GetInt('v');
            this.Id           = parser.GetInt();
            this.Name         = parser.GetString();
            this.SkillLogic   = parser.GetQuotedString();
            this.Description  = parser.GetString();
            this.Hitpoints    = parser.GetInt();
            this.Weight       = parser.GetInt();
            this.ClassId      = this.Version < 31 ? 0 : parser.GetInt();
            this.Armors       = parser.GetInstances <ArmorValues>(6);
            this.BarrelLength = parser.GetShort();
            this.FireHeight   = parser.GetShort();

            if (this.Version >= 34)
            {
                this.PhysicalRadius = parser.GetShort();
                this.TriggerRadius  = parser.GetShort();
            }
            else
            {
                short dummy = parser.GetShort();

                this.PhysicalRadius = dummy;
                this.TriggerRadius  = dummy;

                if (dummy != -1)
                {
                    dummy -= 8;
                    this.PhysicalRadius = (dummy >= 1) ? dummy : (short)1;
                }
            }

            if (this.Version >= 11)
            {
                this.VehiclePhysicsOwned   = parser.GetShort();
                this.VehiclePhysicsUnowned = parser.GetShort();
                this.WeaponPhysicsOwned    = parser.GetShort();
                this.WeaponPhysicsUnowned  = parser.GetShort();
            }
            else
            {
                parser.Skip();
                parser.Skip();
            }

            this.LowZ              = parser.GetShort();
            this.HighZ             = parser.GetShort();
            this.PickupItemId      = parser.GetShort();
            this.IsControllable    = parser.GetShort() == 1;
            this.IsWarpable        = ((this.Version >= 8) ? parser.GetShort() : (short)1) == 1;
            this.EnergyCostPerTick = parser.GetInt();
            this.NormalWeight      = parser.GetInt();
            this.StopWeight        = parser.GetInt();
            this.DisplayHealth     = (this.Version >= 1) ? parser.GetShort() : (short)0;
            this.InventoryItems    = parser.GetInts(6);
            this.ChildVehicles     = parser.GetInts(8);

            if (this.Version >= 6 && this.Version < 31)
            {
                parser.Skip(31);
            }

            this.ExplodeItemId    = (this.Version >= 17) ? parser.GetShort() : (short)0;
            this.RadarPrize       = (this.Version >= 35) ? parser.GetInt() : -1;
            this.VehicleGetInMode = (this.Version >= 36) ? parser.GetInt() : 0;
            this.VisualHeight     = (this.Version >= 37) ? parser.GetShort() : (short)0;
            this.DropItemId       = (this.Version >= 46) ? parser.GetShort() : (short)0;
            this.DropItemQuantity = (this.Version >= 46) ? parser.GetShort() : (short)0;

            if (this.Version >= 5)
            {
                this.Sprites[0].Parse(this.Version, parser);
                this.Sprites[1].Parse(this.Version, parser);
                blofiles.Add(Sprites[0].Blob.BlobName);
                blofiles.Add(Sprites[1].Blob.BlobName);
            }

            this.EnergyMax  = (this.Version >= 5) ? parser.GetInt() : -1;
            this.EnergyRate = (this.Version >= 5) ? parser.GetInt() : -1;
            this.EnergyMin  = (this.Version >= 21) ? parser.GetInt() : -1;
            this.ThrowTime  = (this.Version >= 9) ? parser.GetShort() : (short)-1;

            if (this.Version >= 9 && this.Version < 24)
            {
                parser.Skip();
            }

            this.AllowWeapons        = (this.Version >= 9) ? parser.GetShort() : (short)-1;
            this.Style1BallSpeed     = (this.Version >= 9) ? parser.GetShort() : (short)0;
            this.Style1LowFireAngle  = (this.Version >= 9) ? parser.GetShort() : (short)45;
            this.Style1HighFireAngle = (this.Version >= 9) ? parser.GetShort() : (short)45;
            this.Style1KeyAssignment = (this.Version >= 15) ? parser.GetShort() : (short)1;
            this.Style1BallFriction  = (this.Version >= 15) ? parser.GetShort() : (short)-1;
            this.Style2BallSpeed     = (this.Version >= 15) ? parser.GetShort() : (short)0;
            this.Style2LowFireAngle  = (this.Version >= 15) ? parser.GetShort() : (short)0;
            this.Style2HighFireAngle = (this.Version >= 15) ? parser.GetShort() : (short)0;
            this.Style2KeyAssignment = (this.Version >= 15) ? parser.GetShort() : (short)0;
            this.Style2BallFriction  = (this.Version >= 9) ? parser.GetShort() : (short)1;

            if (this.Version >= 24)
            {
                this.TerrainModifiers = parser.GetShorts(16);
            }
            else
            {
                this.TerrainModifiers = new short[16];
                for (int i = 0; i < this.TerrainModifiers.Length; i++)
                {
                    this.TerrainModifiers[i] = -1;
                }
            }

            if (this.Version >= 9 && this.Version < 23)
            {
                parser.Skip();
            }

            this.BallCarryRollVehicleItem  = (this.Version >= 29) ? parser.GetShort() : (short)0;
            this.BallCarryArmorVehicleItem = (this.Version >= 29) ? parser.GetShort() : (short)0;
            this.FlagCarryRollVehicleItem  = (this.Version >= 29) ? parser.GetShort() : (short)0;
            this.FlagCarryArmorVehicleItem = (this.Version >= 29) ? parser.GetShort() : (short)0;
            this.EventString1           = (this.Version >= 33) ? parser.GetString() : "";
            this.EventString2           = (this.Version >= 38) ? parser.GetString() : "";
            this.EventString3           = (this.Version >= 38) ? parser.GetString() : "";
            this.LosDistance            = (this.Version >= 42) ? parser.GetInt() : 0;
            this.LosAngle               = (this.Version >= 42) ? parser.GetInt() : 0;
            this.LosXRay                = (this.Version >= 42) ? parser.GetInt() : 0;
            this.CombatAwarenessTime    = (this.Version >= 42) ? parser.GetInt() : 0;
            this.SiblingKillsShared     = (this.Version >= 42) ? parser.GetShort() : (short)0;
            this.RelativeId             = (this.Version >= 47) ? parser.GetShort() : (short)0;
            this.DisplayOnFriendlyRadar = (this.Version >= 52) ? parser.GetInt() : 1;
            this.FriendlyRadarColor     = (this.Version >= 50) ? parser.GetInt() : -1;
            this.DisplayOnEnemyRadar    = (this.Version >= 52) ? parser.GetInt() : 1;
            this.EnemyRadarColor        = (this.Version >= 50) ? parser.GetInt() : -1;

            if (this.Version >= 48)
            {
                for (int i = 0; i < 30; i++)
                {
                    this.HoldItemLimits[i]         = parser.GetShort();
                    this.HoldItemExtendedLimits[i] = parser.GetShort();
                }
            }
        }
Example #4
0
            public override void Parse(ICsvParser parser)
            {
                base.Parse(parser);

                this.RotateSpeed                = parser.GetInt();
                this.AngleStart                 = parser.GetShort();
                this.AngleLength                = parser.GetShort();
                this.TrackingTime               = parser.GetShort();
                this.TrackingRadius             = parser.GetShort();
                this.TrackingWeightLow          = (this.Version >= 30) ? parser.GetInt() : 0;
                this.TrackingWeightHigh         = (this.Version >= 30) ? parser.GetInt() : 100000;
                this.FireRadius                 = parser.GetShort();
                this.RepairRate                 = parser.GetShort();
                this.HitpointsRequiredToOperate = parser.GetShort();
                this.RemoveGlobalTimer          = (this.Version >= 7) ? parser.GetShort() : (short)0;
                this.RandomizeAim               = (this.Version >= 7) ? parser.GetShort() : (short)0;
                this.ObeyLos            = (this.Version >= 7) ? parser.GetShort() : (short)0;
                this.ComputerEnergyMax  = (this.Version >= 7) ? parser.GetShort() : (short)0;
                this.ComputerEnergyRate = (this.Version >= 7) ? parser.GetShort() : (short)0;
                this.Destroyable        = (this.Version >= 10) ? parser.GetShort() : (short)0;
                this.DensityRadius      = (this.Version >= 13) ? parser.GetShort() : (short)800;
                this.DensityMaxType     = (this.Version >= 13) ? parser.GetShort() : (short)2;
                this.DensityMaxActive   = (this.Version >= 13) ? parser.GetShort() : (short)2;
                this.DensityMaxInactive = (this.Version >= 13) ? parser.GetShort() : (short)-1;
                this.MaxTypeByPlayerRegardlessOfTeam = (this.Version >= 53) ? parser.GetShort() : (short)-1;
                this.FrequencyMaxType                  = (this.Version >= 13) ? parser.GetShort() : (short)10;
                this.FrequencyMaxActive                = (this.Version >= 13) ? parser.GetShort() : (short)10;
                this.FrequencyMaxInactive              = (this.Version >= 13) ? parser.GetShort() : (short)-1;
                this.FrequencyDensityMaxType           = (this.Version >= 39) ? parser.GetShort() : (short)-1;
                this.FrequencyDensityMaxActive         = (this.Version >= 39) ? parser.GetShort() : (short)-1;
                this.FrequencyDensityMaxInactive       = (this.Version >= 39) ? parser.GetShort() : (short)-1;
                this.ChainedTurretRequiredForBuilding  = (this.Version >= 53) ? parser.GetInt() : (short)0;
                this.ChainedTurretRequiredForOperation = (this.Version >= 53) ? parser.GetInt() : (short)0;
                this.ChainedTurretId           = (this.Version >= 53) ? parser.GetShort() : (short)-1;
                this.ChainedTurretRadius       = (this.Version >= 53) ? parser.GetShort() : (short)0;
                this.NumChainedTurretsRequired = (this.Version >= 53) ? parser.GetShort() : (short)0;
                this.LogicTakeOwnership        = (this.Version >= 49) ? parser.GetQuotedString() : "1&!1";
                this.LogicStealOwnership       = (this.Version >= 49) ? parser.GetQuotedString() : "1&!1";
                this.SpriteTurretZAdjust       = (this.Version >= 27) ? parser.GetShort() : (short)0;

                if (this.Version >= 30)
                {
                    this.SpriteBase.ParseV3(parser);
                    this.SpriteTurret.ParseV3(parser);
                }
                else if (this.Version >= 12)
                {
                    this.SpriteBase.ParseV2(parser);
                    this.SpriteTurret.ParseV2(parser);
                }
                else
                {
                    this.SpriteBase.ParseV1(parser);
                    this.SpriteTurret.ParseV1(parser);
                }

                if (this.Version < 3)
                {
                    this.SpriteBase.FixUnknown18();
                    this.SpriteTurret.FixUnknown18();
                }

                base.blofiles.Add(SpriteBase.BlobName);
                base.blofiles.Add(SpriteTurret.BlobName);

                if (this.Version >= 22)
                {
                    for (int i = 0; i < 16; i++)
                    {
                        this.Products[i].Parse(this.Version, parser);
                    }
                }
            }