Exemplo n.º 1
0
        public virtual void read(IFormattedFileReader reader)
        {
            if (reader.containsKey("Available_Instance_ID"))
            {
                LevelHierarchy.availableInstanceID = reader.readValue <uint>("Available_Instance_ID");
            }
            else
            {
                LevelHierarchy.availableInstanceID = 1u;
            }
            int num = reader.readArrayLength("Items");

            for (int i = 0; i < num; i++)
            {
                IFormattedFileReader formattedFileReader = reader.readObject(i);
                Type type = formattedFileReader.readValue <Type>("Type");
                if (type == null)
                {
                    Debug.LogError(string.Concat(new object[]
                    {
                        "Level hierarchy item index ",
                        i,
                        " missing type: ",
                        formattedFileReader.readValue("Type")
                    }));
                }
                else
                {
                    IDevkitHierarchyItem devkitHierarchyItem;
                    if (typeof(MonoBehaviour).IsAssignableFrom(type))
                    {
                        devkitHierarchyItem = (new GameObject
                        {
                            name = type.Name
                        }.AddComponent(type) as IDevkitHierarchyItem);
                    }
                    else
                    {
                        devkitHierarchyItem = (Activator.CreateInstance(type) as IDevkitHierarchyItem);
                    }
                    if (devkitHierarchyItem != null)
                    {
                        if (formattedFileReader.containsKey("Instance_ID"))
                        {
                            devkitHierarchyItem.instanceID = formattedFileReader.readValue <uint>("Instance_ID");
                        }
                        if (devkitHierarchyItem.instanceID == 0u)
                        {
                            devkitHierarchyItem.instanceID = LevelHierarchy.generateUniqueInstanceID();
                        }
                        formattedFileReader.readKey("Item");
                        devkitHierarchyItem.read(formattedFileReader);
                    }
                }
            }
        }
        protected override void readAsset(IFormattedFileReader reader)
        {
            base.readAsset(reader);
            int num = reader.readArrayLength("Foliage");

            for (int i = 0; i < num; i++)
            {
                this.elements.Add(reader.readValue <FoliageInfoCollectionAsset.FoliageInfoCollectionElement>(i));
            }
        }
        // Token: 0x06001B5F RID: 7007 RVA: 0x0009788C File Offset: 0x00095C8C
        protected override void readAsset(IFormattedFileReader reader)
        {
            base.readAsset(reader);
            int num = reader.readArrayLength("Materials");

            for (int i = 0; i < num; i++)
            {
                this.materials.Add(reader.readValue <ContentReference <Material> >(i));
            }
        }
Exemplo n.º 4
0
        // Token: 0x06001B5A RID: 7002 RVA: 0x00097780 File Offset: 0x00095B80
        protected override void readAsset(IFormattedFileReader reader)
        {
            base.readAsset(reader);
            this.defaultGameMode = reader.readValue <TypeReference <GameMode> >("Default_Game_Mode");
            int num = reader.readArrayLength("Supported_Game_Modes");

            for (int i = 0; i < num; i++)
            {
                this.supportedGameModes.Add(reader.readValue <TypeReference <GameMode> >(i));
            }
        }
Exemplo n.º 5
0
        // Token: 0x06000CC7 RID: 3271 RVA: 0x0005E2F4 File Offset: 0x0005C6F4
        public override void read(IFormattedFileReader reader)
        {
            reader = reader.readObject();
            int num = reader.readArrayLength("Tiles");

            for (int i = 0; i < num; i++)
            {
                reader.readArrayIndex(i);
                FoliageTile foliageTile = new FoliageTile(FoliageCoord.ZERO);
                foliageTile.read(reader);
                FoliageSystem.tiles.Add(foliageTile.coord, foliageTile);
            }
        }
Exemplo n.º 6
0
        public virtual void read(IFormattedFileReader reader)
        {
            reader     = reader.readObject();
            this.coord = reader.readValue <LandscapeCoord>("Coord");
            int num = reader.readArrayLength("Materials");

            for (int i = 0; i < num; i++)
            {
                this.materials[i] = reader.readValue <AssetReference <LandscapeMaterialAsset> >(i);
            }
            this.updatePrototypes();
            this.readHeightmaps();
            this.readSplatmaps();
        }
Exemplo n.º 7
0
        public virtual void read(IFormattedFileReader reader)
        {
            if (reader == null)
            {
                return;
            }
            reader           = reader.readObject();
            this.itemID      = reader.readValue <ushort>("Item_ID");
            this.primarySkin = reader.readValue <SkinInfo>("Primary_Skin");
            int num = reader.readArrayLength("Secondary_Skins");

            this.secondarySkins = new InspectableList <SecondarySkinInfo>(num);
            for (int i = 0; i < num; i++)
            {
                this.secondarySkins.Add(reader.readValue <SecondarySkinInfo>(i));
            }
            this.tertiarySkin   = reader.readValue <SkinInfo>("Tertiary_Skin");
            this.attachmentSkin = reader.readValue <SkinInfo>("Attachment_Skin");
        }
 // Token: 0x060015EA RID: 5610 RVA: 0x000835A8 File Offset: 0x000819A8
 public virtual void read(IFormattedFileReader reader)
 {
     reader = reader.readObject();
     if (reader.containsKey("Windows"))
     {
         reader.readKey("Windows");
         int num = reader.readArrayLength();
         for (int i = 0; i < num; i++)
         {
             reader.readArrayIndex(i);
             IFormattedFileReader formattedFileReader = reader.readObject();
             if (formattedFileReader != null)
             {
                 Type type = formattedFileReader.readValue <Type>("Type");
                 if (type != null)
                 {
                     Sleek2Window sleek2Window = Activator.CreateInstance(type) as Sleek2Window;
                     if (sleek2Window != null)
                     {
                         this.addWindow(sleek2Window);
                         formattedFileReader.readKey("Window");
                         sleek2Window.read(formattedFileReader);
                     }
                 }
             }
         }
     }
     else
     {
         reader.readKey("Direction");
         Separator.EDirection edirection = reader.readValue <Separator.EDirection>();
         reader.readKey("Split");
         float value = reader.readValue <float>();
         Sleek2WindowPartition sleek2WindowPartition;
         Sleek2WindowPartition sleek2WindowPartition2;
         this.split((edirection != Separator.EDirection.HORIZONTAL) ? ESleek2PartitionDirection.UP : ESleek2PartitionDirection.RIGHT, out sleek2WindowPartition, out sleek2WindowPartition2);
         this.separator.handle.value = value;
         reader.readKey("First");
         sleek2WindowPartition.read(reader);
         reader.readKey("Second");
         sleek2WindowPartition2.read(reader);
     }
 }
Exemplo n.º 9
0
        // Token: 0x06000E0E RID: 3598 RVA: 0x00062BD8 File Offset: 0x00060FD8
        public override void read(IFormattedFileReader reader)
        {
            reader = reader.readObject();
            int num = reader.readArrayLength("Tiles");

            for (int i = 0; i < num; i++)
            {
                reader.readArrayIndex(i);
                LandscapeTile landscapeTile = new LandscapeTile(LandscapeCoord.ZERO);
                landscapeTile.enable();
                landscapeTile.applyGraphicsSettings();
                landscapeTile.read(reader);
                if (Landscape.tiles.ContainsKey(landscapeTile.coord))
                {
                    Debug.LogError("Duplicate landscape coord read: " + landscapeTile.coord);
                }
                else
                {
                    Landscape.tiles.Add(landscapeTile.coord, landscapeTile);
                }
            }
            Landscape.linkNeighbors();
            Landscape.applyLOD();
        }
Exemplo n.º 10
0
        // Token: 0x06001A3E RID: 6718 RVA: 0x000930C0 File Offset: 0x000914C0
        protected override void readAsset(IFormattedFileReader reader)
        {
            base.readAsset(reader);
            this.isPro  = reader.readValue <bool>("Is_Pro");
            this.type   = reader.readValue <EItemType>("Type");
            this.rarity = reader.readValue <EItemRarity>("Rarity");
            if (this.isPro)
            {
                if (this.type == EItemType.SHIRT)
                {
                    this._proPath = "/Shirts";
                }
                else if (this.type == EItemType.PANTS)
                {
                    this._proPath = "/Pants";
                }
                else if (this.type == EItemType.HAT)
                {
                    this._proPath = "/Hats";
                }
                else if (this.type == EItemType.BACKPACK)
                {
                    this._proPath = "/Backpacks";
                }
                else if (this.type == EItemType.VEST)
                {
                    this._proPath = "/Vests";
                }
                else if (this.type == EItemType.MASK)
                {
                    this._proPath = "/Masks";
                }
                else if (this.type == EItemType.GLASSES)
                {
                    this._proPath = "/Glasses";
                }
                else if (this.type == EItemType.KEY)
                {
                    this._proPath = "/Keys";
                }
                else if (this.type == EItemType.BOX)
                {
                    this._proPath = "/Boxes";
                }
                this._proPath = this._proPath + "/" + this.name;
            }
            this.size_x = reader.readValue <byte>("Size_X");
            if (this.size_x < 1)
            {
                this.size_x = 1;
            }
            this.size_y = reader.readValue <byte>("Size_Y");
            if (this.size_y < 1)
            {
                this.size_y = 1;
            }
            this.size_z  = reader.readValue <float>("Size_Z");
            this.size2_z = reader.readValue <float>("Size2_Z");
            this.amount  = reader.readValue <byte>("Amount");
            if (this.amount < 1)
            {
                this.amount = 1;
            }
            this.countMin = reader.readValue <byte>("Count_Min");
            if (this.countMin < 1)
            {
                this.countMin = 1;
            }
            this.countMax = reader.readValue <byte>("Count_Max");
            if (this.countMax < 1)
            {
                this.countMax = 1;
            }
            this.qualityMin = reader.readValue <byte>("Quality_Min");
            this.qualityMax = reader.readValue <byte>("Quality_Max");
            this.isBackward = reader.readValue <bool>("Backward");
            this.useable    = reader.readValue <string>("Useable");
            this.isUseable  = !string.IsNullOrEmpty(this.useable);
            this.slot       = reader.readValue <ESlotType>("Slot");
            int num = reader.readArrayLength("Blueprints");

            this._blueprints = new List <Blueprint>(num);
            for (int i = 0; i < num; i++)
            {
                IFormattedFileReader formattedFileReader = reader.readObject(i);
                EBlueprintType       newType             = formattedFileReader.readValue <EBlueprintType>("Type");
                int num2 = formattedFileReader.readArrayLength("Supplies");
                BlueprintSupply[] array = new BlueprintSupply[num2];
                for (int j = 0; j < num2; j++)
                {
                    IFormattedFileReader formattedFileReader2 = formattedFileReader.readObject(j);
                    ushort newID       = formattedFileReader2.readValue <ushort>("ID");
                    bool   newCritical = formattedFileReader2.readValue <bool>("Critical");
                    byte   newAmount   = formattedFileReader2.readValue <byte>("Amount");
                    array[j] = new BlueprintSupply(newID, newCritical, newAmount);
                }
                int num3 = formattedFileReader.readArrayLength("Output");
                BlueprintOutput[] array2 = new BlueprintOutput[num3];
                for (int k = 0; k < num3; k++)
                {
                    IFormattedFileReader formattedFileReader3 = formattedFileReader.readObject(k);
                    ushort newID2     = formattedFileReader3.readValue <ushort>("ID");
                    byte   newAmount2 = formattedFileReader3.readValue <byte>("Amount");
                    array2[k] = new BlueprintOutput(newID2, newAmount2);
                }
                ushort          newTool          = formattedFileReader.readValue <ushort>("Tool");
                bool            newToolCritical  = formattedFileReader.readValue <bool>("Tool_Critical");
                ushort          newBuild         = formattedFileReader.readValue <ushort>("Build");
                byte            newLevel         = formattedFileReader.readValue <byte>("Level");
                EBlueprintSkill newSkill         = formattedFileReader.readValue <EBlueprintSkill>("Skill");
                bool            newTransferState = formattedFileReader.readValue <bool>("Transfer_State");
                string          newMap           = formattedFileReader.readValue("Map");
                this.blueprints.Add(new Blueprint(this.id, (byte)i, newType, array, array2, newTool, newToolCritical, newBuild, newLevel, newSkill, newTransferState, newMap, null, null));
            }
            int num4 = reader.readArrayLength("Actions");

            this._actions = new List <Action>(num4);
            byte b = 0;

            while ((int)b < num4)
            {
                IFormattedFileReader formattedFileReader4 = reader.readObject((int)b);
                EActionType          newType2             = formattedFileReader4.readValue <EActionType>("Type");
                int num5 = formattedFileReader4.readArrayLength("Blueprints");
                ActionBlueprint[] array3 = new ActionBlueprint[num5];
                byte b2 = 0;
                while ((int)b2 < array3.Length)
                {
                    IFormattedFileReader formattedFileReader5 = formattedFileReader4.readObject((int)b2);
                    byte newID3  = formattedFileReader5.readValue <byte>("Index");
                    bool newLink = formattedFileReader5.readValue <bool>("Is_Link");
                    array3[(int)b2] = new ActionBlueprint(newID3, newLink);
                    b2 += 1;
                }
                string newText    = formattedFileReader4.readValue <string>("Text");
                string newTooltip = formattedFileReader4.readValue <string>("Tooltip");
                string newKey     = formattedFileReader4.readValue <string>("Key");
                ushort num6       = formattedFileReader4.readValue <ushort>("Source");
                if (num6 == 0)
                {
                    num6 = this.id;
                }
                this.actions.Add(new Action(num6, newType2, array3, newText, newTooltip, newKey));
                b += 1;
            }
            if (num4 == 0)
            {
                bool flag = false;
                byte b3   = 0;
                while ((int)b3 < this.blueprints.Count)
                {
                    Blueprint blueprint = this.blueprints[(int)b3];
                    if (blueprint.type == EBlueprintType.REPAIR)
                    {
                        Action item = new Action(this.id, EActionType.BLUEPRINT, new ActionBlueprint[]
                        {
                            new ActionBlueprint(b3, true)
                        }, null, null, "Repair");
                        this.actions.Insert(0, item);
                    }
                    else if (blueprint.type == EBlueprintType.AMMO)
                    {
                        flag = true;
                    }
                    else if (blueprint.supplies.Length == 1 && blueprint.supplies[0].id == this.id)
                    {
                        Action item2 = new Action(this.id, EActionType.BLUEPRINT, new ActionBlueprint[]
                        {
                            new ActionBlueprint(b3, this.type == EItemType.GUN || this.type == EItemType.MELEE)
                        }, null, null, "Salvage");
                        this.actions.Add(item2);
                    }
                    b3 += 1;
                }
                if (flag)
                {
                    List <ActionBlueprint> list = new List <ActionBlueprint>();
                    byte b4 = 0;
                    while ((int)b4 < this.blueprints.Count)
                    {
                        Blueprint blueprint2 = this.blueprints[(int)b4];
                        if (blueprint2.type == EBlueprintType.AMMO)
                        {
                            ActionBlueprint item3 = new ActionBlueprint(b4, true);
                            list.Add(item3);
                        }
                        b4 += 1;
                    }
                    Action item4 = new Action(this.id, EActionType.BLUEPRINT, list.ToArray(), null, null, "Refill");
                    this.actions.Add(item4);
                }
            }
            this._shouldVerifyHash = reader.readValue <bool>("Should_Verify_Hash");
        }
Exemplo n.º 11
0
        protected override void readAsset(IFormattedFileReader reader)
        {
            base.readAsset(reader);
            this.ammoMin    = reader.readValue <byte>("Ammo_Min");
            this.ammoMax    = reader.readValue <byte>("Ammo_Max");
            this.sightID    = reader.readValue <ushort>("Sight_ID");
            this.tacticalID = reader.readValue <ushort>("Tactical_ID");
            this.gripID     = reader.readValue <ushort>("Grip_ID");
            this.barrelID   = reader.readValue <ushort>("Barrel_ID");
            this.magazineID = reader.readValue <ushort>("Magazine_ID");
            this.unplace    = reader.readValue <float>("Unplace");
            this.replace    = reader.readValue <float>("Replace");
            if ((double)this.replace < 0.01)
            {
                this.replace = 1f;
            }
            this.hasSight    = reader.readValue <bool>("Hook_Sight");
            this.hasTactical = reader.readValue <bool>("Hook_Tactical");
            this.hasGrip     = reader.readValue <bool>("Hook_Grip");
            this.hasBarrel   = reader.readValue <bool>("Hook_Barrel");
            int num = reader.readArrayLength("Magazine_Calibers");

            if (num > 0)
            {
                this.magazineCalibers = new ushort[num];
                for (int i = 0; i < num; i++)
                {
                    this.magazineCalibers[i] = reader.readValue <ushort>(i);
                }
                int num2 = reader.readArrayLength("Attachment_Calibers");
                if (num2 > 0)
                {
                    this.attachmentCalibers = new ushort[num2];
                    for (int j = 0; j < num2; j++)
                    {
                        this.attachmentCalibers[j] = reader.readValue <ushort>(j);
                    }
                }
                else
                {
                    this.attachmentCalibers = this.magazineCalibers;
                }
            }
            else
            {
                this.magazineCalibers    = new ushort[1];
                this.magazineCalibers[0] = reader.readValue <ushort>("Caliber");
                this.attachmentCalibers  = this.magazineCalibers;
            }
            this.firerate             = reader.readValue <byte>("Firerate");
            this.action               = reader.readValue <EAction>("Action");
            this.deleteEmptyMagazines = reader.readValue <bool>("Delete_Empty_Magazines");
            this.bursts               = reader.readValue <int>("Bursts");
            this.hasSafety            = reader.readValue <bool>("Safety");
            this.hasSemi              = reader.readValue <bool>("Semi");
            this.hasAuto              = reader.readValue <bool>("Auto");
            this.hasBurst             = (this.bursts > 0);
            this.isTurret             = reader.readValue <bool>("Turret");
            if (this.hasAuto)
            {
                this.firemode = EFiremode.AUTO;
            }
            else if (this.hasSemi)
            {
                this.firemode = EFiremode.SEMI;
            }
            else if (this.hasBurst)
            {
                this.firemode = EFiremode.BURST;
            }
            else if (this.hasSafety)
            {
                this.firemode = EFiremode.SAFETY;
            }
            this.spreadAim       = reader.readValue <float>("Spread_Aim");
            this.spreadHip       = reader.readValue <float>("Spread_Hip");
            this.recoilAim       = reader.readValue <float>("Recoil_Aim");
            this.useRecoilAim    = reader.readValue <bool>("Use_Recoil_Aim");
            this.recoilMin_x     = reader.readValue <float>("Recoil_Min_X");
            this.recoilMin_y     = reader.readValue <float>("Recoil_Min_Y");
            this.recoilMax_x     = reader.readValue <float>("Recoil_Max_X");
            this.recoilMax_y     = reader.readValue <float>("Recoil_Max_Y");
            this.recover_x       = reader.readValue <float>("Recover_X");
            this.recover_y       = reader.readValue <float>("Recover_Y");
            this.shakeMin_x      = reader.readValue <float>("Shake_Min_X");
            this.shakeMin_y      = reader.readValue <float>("Shake_Min_Y");
            this.shakeMin_z      = reader.readValue <float>("Shake_Min_Z");
            this.shakeMax_x      = reader.readValue <float>("Shake_Max_X");
            this.shakeMax_y      = reader.readValue <float>("Shake_Max_Y");
            this.shakeMax_z      = reader.readValue <float>("Shake_Max_Z");
            this.ballisticSteps  = reader.readValue <byte>("Ballistic_Steps");
            this.ballisticTravel = (float)reader.readValue <byte>("Ballistic_Travel");
            this.ballisticDrop   = reader.readValue <float>("Ballistic_Drop");
            this.ballisticForce  = reader.readValue <float>("Ballistic_Force");
            this.reloadTime      = reader.readValue <float>("Reload_Time");
            this.hammerTime      = reader.readValue <float>("Hammer_Time");
            this.muzzle          = reader.readValue <ushort>("Muzzle");
            this.explosion       = reader.readValue <ushort>("Explosion");
            this.shell           = reader.readValue <ushort>("Shell");
            if (reader.containsKey("Alert_Radius"))
            {
                this.alertRadius = reader.readValue <float>("Alert_Radius");
            }
            else
            {
                this.alertRadius = 48f;
            }
        }