// Token: 0x06001C53 RID: 7251 RVA: 0x0009AAE8 File Offset: 0x00098EE8
 public ObjectNPCAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this.npcName    = localization.format("Character");
     this.npcName    = ItemTool.filterRarityRichText(this.npcName);
     this.shirt      = data.readUInt16("Shirt");
     this.pants      = data.readUInt16("Pants");
     this.hat        = data.readUInt16("Hat");
     this.backpack   = data.readUInt16("Backpack");
     this.vest       = data.readUInt16("Vest");
     this.mask       = data.readUInt16("Mask");
     this.glasses    = data.readUInt16("Glasses");
     this.face       = data.readByte("Face");
     this.hair       = data.readByte("Hair");
     this.beard      = data.readByte("Beard");
     this.skin       = Palette.hex(data.readString("Color_Skin"));
     this.color      = Palette.hex(data.readString("Color_Hair"));
     this.isBackward = data.has("Backward");
     this.primary    = data.readUInt16("Primary");
     this.secondary  = data.readUInt16("Secondary");
     this.tertiary   = data.readUInt16("Tertiary");
     if (data.has("Equipped"))
     {
         this.equipped = (ESlotType)Enum.Parse(typeof(ESlotType), data.readString("Equipped"), true);
     }
     else
     {
         this.equipped = ESlotType.NONE;
     }
     this.dialogue = data.readUInt16("Dialogue");
     if (data.has("Pose"))
     {
         this.pose = (ENPCPose)Enum.Parse(typeof(ENPCPose), data.readString("Pose"), true);
     }
     else
     {
         this.pose = ENPCPose.STAND;
     }
     if (data.has("Pose_Lean"))
     {
         this.poseLean = data.readSingle("Pose_Lean");
     }
     if (data.has("Pose_Pitch"))
     {
         this.posePitch = data.readSingle("Pose_Pitch");
     }
     else
     {
         this.posePitch = 90f;
     }
     if (data.has("Pose_Head_Offset"))
     {
         this.poseHeadOffset = data.readSingle("Pose_Head_Offset");
     }
     else if (this.pose == ENPCPose.CROUCH)
     {
         this.poseHeadOffset = 0.1f;
     }
 }
Esempio n. 2
0
 public ItemBarrelAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this._shoot      = (AudioClip)bundle.load("Shoot");
     this._barrel     = (GameObject)bundle.load("Barrel");
     this._isBraked   = data.has("Braked");
     this._isSilenced = data.has("Silenced");
     this._volume     = data.readSingle("Volume");
     this._durability = data.readByte("Durability");
     if (data.has("Ballistic_Drop"))
     {
         this._ballisticDrop = data.readSingle("Ballistic_Drop");
     }
     else
     {
         this._ballisticDrop = 1f;
     }
     bundle.unload();
 }
 // Token: 0x06001AD9 RID: 6873 RVA: 0x000965B0 File Offset: 0x000949B0
 public ItemMagazineAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this._magazine = (GameObject)bundle.load("Magazine");
     this._pellets  = data.readByte("Pellets");
     if (this.pellets < 1)
     {
         this._pellets = 1;
     }
     this._stuck          = data.readByte("Stuck");
     this._range          = data.readSingle("Range");
     this.playerDamage    = data.readSingle("Player_Damage");
     this.zombieDamage    = data.readSingle("Zombie_Damage");
     this.animalDamage    = data.readSingle("Animal_Damage");
     this.barricadeDamage = data.readSingle("Barricade_Damage");
     this.structureDamage = data.readSingle("Structure_Damage");
     this.vehicleDamage   = data.readSingle("Vehicle_Damage");
     this.resourceDamage  = data.readSingle("Resource_Damage");
     this._explosion      = data.readUInt16("Explosion");
     if (data.has("Object_Damage"))
     {
         this.objectDamage = data.readSingle("Object_Damage");
     }
     else
     {
         this.objectDamage = this.resourceDamage;
     }
     this._tracer = data.readUInt16("Tracer");
     this._impact = data.readUInt16("Impact");
     this._speed  = data.readSingle("Speed");
     if (this.speed < 0.01f)
     {
         this._speed = 1f;
     }
     this._isExplosive = data.has("Explosive");
     this._deleteEmpty = data.has("Delete_Empty");
     bundle.unload();
 }
Esempio n. 4
0
 public ItemChargeAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this._range2          = data.readSingle("Range2");
     this._playerDamage    = data.readSingle("Player_Damage");
     this._zombieDamage    = data.readSingle("Zombie_Damage");
     this._animalDamage    = data.readSingle("Animal_Damage");
     this._barricadeDamage = data.readSingle("Barricade_Damage");
     this._structureDamage = data.readSingle("Structure_Damage");
     this._vehicleDamage   = data.readSingle("Vehicle_Damage");
     this._resourceDamage  = data.readSingle("Resource_Damage");
     if (data.has("Object_Damage"))
     {
         this._objectDamage = data.readSingle("Object_Damage");
     }
     else
     {
         this._objectDamage = this.resourceDamage;
     }
     this._explosion2 = data.readUInt16("Explosion2");
 }
Esempio n. 5
0
 public ItemClothingAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     if (this.isPro)
     {
         this._armor = 1f;
     }
     else
     {
         this._armor = data.readSingle("Armor");
         if ((double)this.armor < 0.01)
         {
             this._armor = 1f;
         }
         this._proofWater = data.has("Proof_Water");
         this._proofFire  = data.has("Proof_Fire");
     }
 }
 // Token: 0x06001B42 RID: 6978 RVA: 0x000973B0 File Offset: 0x000957B0
 public ItemTrapAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this._range2         = data.readSingle("Range2");
     this.playerDamage    = data.readSingle("Player_Damage");
     this.zombieDamage    = data.readSingle("Zombie_Damage");
     this.animalDamage    = data.readSingle("Animal_Damage");
     this.barricadeDamage = data.readSingle("Barricade_Damage");
     this.structureDamage = data.readSingle("Structure_Damage");
     this.vehicleDamage   = data.readSingle("Vehicle_Damage");
     this.resourceDamage  = data.readSingle("Resource_Damage");
     if (data.has("Object_Damage"))
     {
         this.objectDamage = data.readSingle("Object_Damage");
     }
     else
     {
         this.objectDamage = this.resourceDamage;
     }
     this._explosion2  = data.readUInt16("Explosion2");
     this._isBroken    = data.has("Broken");
     this._isExplosive = data.has("Explosive");
     this.damageTires  = data.has("Damage_Tires");
 }
Esempio n. 7
0
 public ItemStructureAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     if (!Dedicator.isDedicated)
     {
         this._structure = (GameObject)bundle.load("Structure");
     }
     this._clip           = (GameObject)bundle.load("Clip");
     this._nav            = (GameObject)bundle.load("Nav");
     this._use            = (AudioClip)bundle.load("Use");
     this._construct      = (EConstruct)Enum.Parse(typeof(EConstruct), data.readString("Construct"), true);
     this._health         = data.readUInt16("Health");
     this._range          = data.readSingle("Range");
     this._explosion      = data.readUInt16("Explosion");
     this._isVulnerable   = data.has("Vulnerable");
     this._isRepairable   = !data.has("Unrepairable");
     this._proofExplosion = data.has("Proof_Explosion");
     this._isUnpickupable = data.has("Unpickupable");
     this._isSalvageable  = !data.has("Unsalvageable");
     this._isSaveable     = !data.has("Unsaveable");
     bundle.unload();
 }
Esempio n. 8
0
 // Token: 0x06001B33 RID: 6963 RVA: 0x000971E4 File Offset: 0x000955E4
 public ItemThrowableAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this._use             = (AudioClip)bundle.load("Use");
     this._throwable       = (GameObject)bundle.load("Throwable");
     this._explosion       = data.readUInt16("Explosion");
     this._isExplosive     = data.has("Explosive");
     this._isFlash         = data.has("Flash");
     this._isSticky        = data.has("Sticky");
     this._explodeOnImpact = data.has("Explode_On_Impact");
     if (data.has("Fuse_Length"))
     {
         this._fuseLength = data.readSingle("Fuse_Length");
     }
     else if (this.isExplosive || this.isFlash)
     {
         this._fuseLength = 2.5f;
     }
     else
     {
         this._fuseLength = 180f;
     }
     bundle.unload();
 }
Esempio n. 9
0
        // Token: 0x06001A67 RID: 6759 RVA: 0x00093D44 File Offset: 0x00092144
        public ItemCaliberAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
        {
            this._calibers = new ushort[(int)data.readByte("Calibers")];
            byte b = 0;

            while ((int)b < this.calibers.Length)
            {
                this._calibers[(int)b] = data.readUInt16("Caliber_" + b);
                b += 1;
            }
            this._recoil_x = data.readSingle("Recoil_X");
            if ((double)this.recoil_x < 0.01)
            {
                this._recoil_x = 1f;
            }
            this._recoil_y = data.readSingle("Recoil_Y");
            if ((double)this.recoil_y < 0.01)
            {
                this._recoil_y = 1f;
            }
            this._spread = data.readSingle("Spread");
            if ((double)this.spread < 0.01)
            {
                this._spread = 1f;
            }
            this._sway = data.readSingle("Sway");
            if ((double)this.sway < 0.01)
            {
                this._sway = 1f;
            }
            this._shake = data.readSingle("Shake");
            if ((double)this.shake < 0.01)
            {
                this._shake = 1f;
            }
            this._damage = data.readSingle("Damage");
            if ((double)this.damage < 0.01)
            {
                this._damage = 1f;
            }
            this._firerate    = data.readByte("Firerate");
            this._isPaintable = data.has("Paintable");
        }
Esempio n. 10
0
 public ItemGeneratorAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this._capacity  = data.readUInt16("Capacity");
     this._wirerange = data.readSingle("Wirerange");
     this._burn      = data.readSingle("Burn");
 }
Esempio n. 11
0
        // Token: 0x06001A26 RID: 6694 RVA: 0x00092038 File Offset: 0x00090438
        public ItemAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
        {
            this.isPro = data.has("Pro");
            if (id < 2000 && !bundle.hasResource && !this.isPro && !data.has("Bypass_ID_Limit"))
            {
                throw new NotSupportedException("ID < 2000");
            }
            if (!this.isPro)
            {
                this._itemName        = localization.format("Name");
                this._itemDescription = localization.format("Description");
                this._itemDescription = ItemTool.filterRarityRichText(this.itemDescription);
            }
            this.type = (EItemType)Enum.Parse(typeof(EItemType), data.readString("Type"), true);
            if (data.has("Rarity"))
            {
                this.rarity = (EItemRarity)Enum.Parse(typeof(EItemRarity), data.readString("Rarity"), true);
            }
            else
            {
                this.rarity = EItemRarity.COMMON;
            }
            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 = data.readByte("Size_X");
            if (this.size_x < 1)
            {
                this.size_x = 1;
            }
            this.size_y = data.readByte("Size_Y");
            if (this.size_y < 1)
            {
                this.size_y = 1;
            }
            this.size_z  = data.readSingle("Size_Z");
            this.size2_z = data.readSingle("Size2_Z");
            this.amount  = data.readByte("Amount");
            if (this.amount < 1)
            {
                this.amount = 1;
            }
            this.countMin = data.readByte("Count_Min");
            if (this.countMin < 1)
            {
                this.countMin = 1;
            }
            this.countMax = data.readByte("Count_Max");
            if (this.countMax < 1)
            {
                this.countMax = 1;
            }
            if (data.has("Quality_Min"))
            {
                this.qualityMin = data.readByte("Quality_Min");
            }
            else
            {
                this.qualityMin = 10;
            }
            if (data.has("Quality_Max"))
            {
                this.qualityMax = data.readByte("Quality_Max");
            }
            else
            {
                this.qualityMax = 90;
            }
            this.isBackward = data.has("Backward");
            this.useable    = data.readString("Useable");
            this.isUseable  = !string.IsNullOrEmpty(this.useable);
            if (this.isUseable)
            {
                this._equip = (AudioClip)bundle.load("Equip");
                if (!this.isPro)
                {
                    GameObject gameObject = (GameObject)bundle.load("Animations");
                    if (gameObject != null)
                    {
                        Animation component = gameObject.GetComponent <Animation>();
                        this._animations = new AnimationClip[component.GetClipCount()];
                        int         num        = 0;
                        IEnumerator enumerator = component.GetEnumerator();
                        try
                        {
                            while (enumerator.MoveNext())
                            {
                                object         obj            = enumerator.Current;
                                AnimationState animationState = (AnimationState)obj;
                                this.animations[num] = animationState.clip;
                                num++;
                            }
                        }
                        finally
                        {
                            IDisposable disposable;
                            if ((disposable = (enumerator as IDisposable)) != null)
                            {
                                disposable.Dispose();
                            }
                        }
                    }
                    else
                    {
                        this._animations = new AnimationClip[0];
                    }
                }
            }
            string text = data.readString("Slot");

            if (text == null)
            {
                this.slot = ESlotType.NONE;
            }
            else
            {
                this.slot = (ESlotType)Enum.Parse(typeof(ESlotType), text, true);
            }
            if (!Dedicator.isDedicated || this.type == EItemType.GUN || this.type == EItemType.MELEE)
            {
                this._item = (GameObject)bundle.load("Item");
                if (this.item == null)
                {
                    throw new NotSupportedException("Missing item gameobject");
                }
                if (this.item.transform.FindChild("Icon") != null && this.item.transform.FindChild("Icon").GetComponent <Camera>() != null)
                {
                    Assets.errors.Add(this.itemName + " icon has a camera attached!");
                }
                if (id < 2000 && (this.type == EItemType.GUN || this.type == EItemType.MELEE) && this.item.transform.FindChild("Stat_Tracker") == null)
                {
                    Assets.errors.Add(this.itemName + " missing stat tracker hook!");
                }
            }
            byte b  = data.readByte("Blueprints");
            byte b2 = data.readByte("Actions");

            this._blueprints = new List <Blueprint>((int)b);
            this._actions    = new List <Action>((int)b2);
            for (byte b3 = 0; b3 < b; b3 += 1)
            {
                if (!data.has("Blueprint_" + b3 + "_Type"))
                {
                    throw new NotSupportedException("Missing blueprint type");
                }
                EBlueprintType newType = (EBlueprintType)Enum.Parse(typeof(EBlueprintType), data.readString("Blueprint_" + b3 + "_Type"), true);
                byte           b4      = data.readByte("Blueprint_" + b3 + "_Supplies");
                if (b4 < 1)
                {
                    b4 = 1;
                }
                BlueprintSupply[] array = new BlueprintSupply[(int)b4];
                byte b5 = 0;
                while ((int)b5 < array.Length)
                {
                    ushort newID = data.readUInt16(string.Concat(new object[]
                    {
                        "Blueprint_",
                        b3,
                        "_Supply_",
                        b5,
                        "_ID"
                    }));
                    bool newCritical = data.has(string.Concat(new object[]
                    {
                        "Blueprint_",
                        b3,
                        "_Supply_",
                        b5,
                        "_Critical"
                    }));
                    byte b6 = data.readByte(string.Concat(new object[]
                    {
                        "Blueprint_",
                        b3,
                        "_Supply_",
                        b5,
                        "_Amount"
                    }));
                    if (b6 < 1)
                    {
                        b6 = 1;
                    }
                    array[(int)b5] = new BlueprintSupply(newID, newCritical, b6);
                    b5            += 1;
                }
                byte b7 = data.readByte("Blueprint_" + b3 + "_Outputs");
                BlueprintOutput[] array2;
                if (b7 > 0)
                {
                    array2 = new BlueprintOutput[(int)b7];
                    byte b8 = 0;
                    while ((int)b8 < array2.Length)
                    {
                        ushort newID2 = data.readUInt16(string.Concat(new object[]
                        {
                            "Blueprint_",
                            b3,
                            "_Output_",
                            b8,
                            "_ID"
                        }));
                        byte b9 = data.readByte(string.Concat(new object[]
                        {
                            "Blueprint_",
                            b3,
                            "_Output_",
                            b8,
                            "_Amount"
                        }));
                        if (b9 < 1)
                        {
                            b9 = 1;
                        }
                        array2[(int)b8] = new BlueprintOutput(newID2, b9);
                        b8 += 1;
                    }
                }
                else
                {
                    array2 = new BlueprintOutput[1];
                    ushort num2 = data.readUInt16("Blueprint_" + b3 + "_Product");
                    if (num2 == 0)
                    {
                        num2 = id;
                    }
                    byte b10 = data.readByte("Blueprint_" + b3 + "_Products");
                    if (b10 < 1)
                    {
                        b10 = 1;
                    }
                    array2[0] = new BlueprintOutput(num2, b10);
                }
                ushort          newTool         = data.readUInt16("Blueprint_" + b3 + "_Tool");
                bool            newToolCritical = data.has("Blueprint_" + b3 + "_Tool_Critical");
                ushort          newBuild        = data.readUInt16("Blueprint_" + b3 + "_Build");
                byte            b11             = data.readByte("Blueprint_" + b3 + "_Level");
                EBlueprintSkill newSkill        = EBlueprintSkill.NONE;
                if (b11 > 0)
                {
                    newSkill = (EBlueprintSkill)Enum.Parse(typeof(EBlueprintSkill), data.readString("Blueprint_" + b3 + "_Skill"), true);
                }
                bool            newTransferState = data.has("Blueprint_" + b3 + "_State_Transfer");
                string          newMap           = data.readString("Blueprint_" + b3 + "_Map");
                INPCCondition[] array3           = new INPCCondition[(int)data.readByte("Blueprint_" + b3 + "_Conditions")];
                NPCTool.readConditions(data, localization, "Blueprint_" + b3 + "_Condition_", array3, string.Concat(new object[]
                {
                    "item ",
                    id,
                    " blueprint ",
                    b3
                }));
                INPCReward[] array4 = new INPCReward[(int)data.readByte("Blueprint_" + b3 + "_Rewards")];
                NPCTool.readRewards(data, localization, "Blueprint_" + b3 + "_Reward_", array4, string.Concat(new object[]
                {
                    "item ",
                    id,
                    " blueprint ",
                    b3
                }));
                this.blueprints.Add(new Blueprint(id, b3, newType, array, array2, newTool, newToolCritical, newBuild, b11, newSkill, newTransferState, newMap, array3, array4));
            }
            for (byte b12 = 0; b12 < b2; b12 += 1)
            {
                if (!data.has("Action_" + b12 + "_Type"))
                {
                    throw new NotSupportedException("Missing action type");
                }
                EActionType newType2 = (EActionType)Enum.Parse(typeof(EActionType), data.readString("Action_" + b12 + "_Type"), true);
                byte        b13      = data.readByte("Action_" + b12 + "_Blueprints");
                if (b13 < 1)
                {
                    b13 = 1;
                }
                ActionBlueprint[] array5 = new ActionBlueprint[(int)b13];
                byte b14 = 0;
                while ((int)b14 < array5.Length)
                {
                    byte newID3 = data.readByte(string.Concat(new object[]
                    {
                        "Action_",
                        b12,
                        "_Blueprint_",
                        b14,
                        "_Index"
                    }));
                    bool newLink = data.has(string.Concat(new object[]
                    {
                        "Action_",
                        b12,
                        "_Blueprint_",
                        b14,
                        "_Link"
                    }));
                    array5[(int)b14] = new ActionBlueprint(newID3, newLink);
                    b14 += 1;
                }
                string newText    = data.readString("Action_" + b12 + "_Text");
                string newTooltip = data.readString("Action_" + b12 + "_Tooltip");
                string newKey     = data.readString("Action_" + b12 + "_Key");
                ushort num3       = data.readUInt16("Action_" + b12 + "_Source");
                if (num3 == 0)
                {
                    num3 = id;
                }
                this.actions.Add(new Action(num3, newType2, array5, newText, newTooltip, newKey));
            }
            if (b2 == 0)
            {
                bool flag = false;
                byte b15  = 0;
                while ((int)b15 < this.blueprints.Count)
                {
                    Blueprint blueprint = this.blueprints[(int)b15];
                    if (blueprint.type == EBlueprintType.REPAIR)
                    {
                        Action item = new Action(id, EActionType.BLUEPRINT, new ActionBlueprint[]
                        {
                            new ActionBlueprint(b15, 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 == id)
                    {
                        Action item2 = new Action(id, EActionType.BLUEPRINT, new ActionBlueprint[]
                        {
                            new ActionBlueprint(b15, this.type == EItemType.GUN || this.type == EItemType.MELEE)
                        }, null, null, "Salvage");
                        this.actions.Add(item2);
                    }
                    b15 += 1;
                }
                if (flag)
                {
                    List <ActionBlueprint> list = new List <ActionBlueprint>();
                    byte b16 = 0;
                    while ((int)b16 < this.blueprints.Count)
                    {
                        Blueprint blueprint2 = this.blueprints[(int)b16];
                        if (blueprint2.type == EBlueprintType.AMMO)
                        {
                            ActionBlueprint item3 = new ActionBlueprint(b16, true);
                            list.Add(item3);
                        }
                        b16 += 1;
                    }
                    Action item4 = new Action(id, EActionType.BLUEPRINT, list.ToArray(), null, null, "Refill");
                    this.actions.Add(item4);
                }
            }
            this._shouldVerifyHash   = !data.has("Bypass_Hash_Verification");
            this.overrideShowQuality = data.has("Override_Show_Quality");
            if (!Dedicator.isDedicated)
            {
                this._albedoBase   = (Texture2D)bundle.load("Albedo_Base");
                this._metallicBase = (Texture2D)bundle.load("Metallic_Base");
                this._emissionBase = (Texture2D)bundle.load("Emission_Base");
            }
        }
Esempio n. 12
0
        // Token: 0x060018FE RID: 6398 RVA: 0x0008CD50 File Offset: 0x0008B150
        public AnimalAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
        {
            if (id < 50 && !bundle.hasResource && !data.has("Bypass_ID_Limit"))
            {
                throw new NotSupportedException("ID < 50");
            }
            this._animalName = localization.format("Name");
            this._client     = (GameObject)bundle.load("Animal_Client");
            this._server     = (GameObject)bundle.load("Animal_Server");
            this._dedicated  = (GameObject)bundle.load("Animal_Dedicated");
            this._ragdoll    = (GameObject)bundle.load("Ragdoll");
            if (this.client == null)
            {
                Assets.errors.Add(this.animalName + " is missing client data. Highly recommended to fix.");
            }
            if (this.server == null)
            {
                Assets.errors.Add(this.animalName + " is missing server data. Highly recommended to fix.");
            }
            if (this.dedicated == null)
            {
                Assets.errors.Add(this.animalName + " is missing dedicated data. Highly recommended to fix.");
            }
            if (this.ragdoll == null)
            {
                Assets.errors.Add(this.animalName + " is missing ragdoll data. Highly recommended to fix.");
            }
            this._speedRun  = data.readSingle("Speed_Run");
            this._speedWalk = data.readSingle("Speed_Walk");
            this._behaviour = (EAnimalBehaviour)Enum.Parse(typeof(EAnimalBehaviour), data.readString("Behaviour"), true);
            this._health    = data.readUInt16("Health");
            this._regen     = data.readSingle("Regen");
            if (!data.has("Regen"))
            {
                this._regen = 10f;
            }
            this._damage   = data.readByte("Damage");
            this._meat     = data.readUInt16("Meat");
            this._pelt     = data.readUInt16("Pelt");
            this._rewardID = data.readUInt16("Reward_ID");
            if (data.has("Reward_Min"))
            {
                this._rewardMin = data.readByte("Reward_Min");
            }
            else
            {
                this._rewardMin = 3;
            }
            if (data.has("Reward_Max"))
            {
                this._rewardMax = data.readByte("Reward_Max");
            }
            else
            {
                this._rewardMax = 4;
            }
            this._roars = new AudioClip[(int)data.readByte("Roars")];
            byte b = 0;

            while ((int)b < this.roars.Length)
            {
                this.roars[(int)b] = (AudioClip)bundle.load("Roar_" + b);
                b += 1;
            }
            this._panics = new AudioClip[(int)data.readByte("Panics")];
            byte b2 = 0;

            while ((int)b2 < this.panics.Length)
            {
                this.panics[(int)b2] = (AudioClip)bundle.load("Panic_" + b2);
                b2 += 1;
            }
            this._rewardXP = data.readUInt32("Reward_XP");
            bundle.unload();
        }
Esempio n. 13
0
 // Token: 0x06001C8F RID: 7311 RVA: 0x0009B100 File Offset: 0x00099500
 public ResourceAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     if (id < 50 && !bundle.hasResource && !data.has("Bypass_ID_Limit"))
     {
         throw new NotSupportedException("ID < 50");
     }
     if (Dedicator.isDedicated || GraphicsSettings.treeMode == ETreeGraphicMode.LEGACY)
     {
         this.isSpeedTree = false;
     }
     else
     {
         this.isSpeedTree = data.has("SpeedTree");
     }
     this.defaultLODWeights = data.has("SpeedTree_Default_LOD_Weights");
     this._resourceName     = localization.format("Name");
     if (Dedicator.isDedicated)
     {
         this._modelGameObject = (GameObject)bundle.load("Resource_Clip");
         if (this.modelGameObject == null)
         {
             Assets.errors.Add(this.resourceName + " is missing collision data. Highly recommended to fix.");
         }
         this._stumpGameObject = (GameObject)bundle.load("Stump_Clip");
         if (this.stumpGameObject == null)
         {
             Assets.errors.Add(this.resourceName + " is missing collision data. Highly recommended to fix.");
         }
     }
     else
     {
         this._modelGameObject  = null;
         this._stumpGameObject  = null;
         this._skyboxGameObject = null;
         this._debrisGameObject = null;
         if (GraphicsSettings.treeMode == ETreeGraphicMode.LEGACY)
         {
             this._modelGameObject = (GameObject)bundle.load("Resource_Old");
         }
         if (this._modelGameObject == null)
         {
             this._modelGameObject = (GameObject)bundle.load("Resource");
         }
         if (this.defaultLODWeights)
         {
             Transform transform = this.modelGameObject.transform.FindChild("Billboard");
             if (transform != null)
             {
                 BillboardRenderer component = transform.GetComponent <BillboardRenderer>();
                 if (component != null)
                 {
                     component.shadowCastingMode = ShadowCastingMode.Off;
                 }
             }
         }
         if (GraphicsSettings.treeMode == ETreeGraphicMode.LEGACY)
         {
             this._stumpGameObject = (GameObject)bundle.load("Stump_Old");
         }
         if (this._stumpGameObject == null)
         {
             this._stumpGameObject = (GameObject)bundle.load("Stump");
         }
         if (GraphicsSettings.treeMode == ETreeGraphicMode.LEGACY)
         {
             this._skyboxGameObject = (GameObject)bundle.load("Skybox_Old");
         }
         if (this._skyboxGameObject == null)
         {
             this._skyboxGameObject = (GameObject)bundle.load("Skybox");
         }
         if (this.defaultLODWeights)
         {
             Transform transform2 = this.skyboxGameObject.transform.FindChild("Model_0");
             if (transform2 != null)
             {
                 BillboardRenderer component2 = transform2.GetComponent <BillboardRenderer>();
                 if (component2 != null)
                 {
                     component2.shadowCastingMode = ShadowCastingMode.Off;
                 }
             }
         }
         if (this.isSpeedTree)
         {
             this._debrisGameObject = (GameObject)bundle.load("Debris");
             if (this.modelGameObject != null)
             {
                 LODGroup component3 = this.modelGameObject.GetComponent <LODGroup>();
                 if (component3 != null)
                 {
                     if (GraphicsSettings.treeMode == ETreeGraphicMode.SPEEDTREE_FADE_SPEEDTREE)
                     {
                         component3.fadeMode = LODFadeMode.SpeedTree;
                         if (this.defaultLODWeights && GraphicsSettings.treeMode != ETreeGraphicMode.LEGACY)
                         {
                             this.applyDefaultLODs(component3, true);
                         }
                     }
                     else
                     {
                         component3.fadeMode = LODFadeMode.None;
                         if (this.defaultLODWeights && GraphicsSettings.treeMode != ETreeGraphicMode.LEGACY)
                         {
                             this.applyDefaultLODs(component3, false);
                         }
                     }
                 }
             }
             if (this.debrisGameObject != null)
             {
                 LODGroup component4 = this.debrisGameObject.GetComponent <LODGroup>();
                 if (component4 != null)
                 {
                     if (GraphicsSettings.treeMode == ETreeGraphicMode.SPEEDTREE_FADE_SPEEDTREE)
                     {
                         component4.fadeMode = LODFadeMode.SpeedTree;
                         if (this.defaultLODWeights && GraphicsSettings.treeMode != ETreeGraphicMode.LEGACY)
                         {
                             this.applyDefaultLODs(component4, true);
                         }
                     }
                     else
                     {
                         component4.fadeMode = LODFadeMode.None;
                         if (this.defaultLODWeights && GraphicsSettings.treeMode != ETreeGraphicMode.LEGACY)
                         {
                             this.applyDefaultLODs(component4, false);
                         }
                     }
                 }
             }
         }
         if (data.has("Auto_Skybox") && !this.isSpeedTree && this.skyboxGameObject)
         {
             Transform transform3 = this.modelGameObject.transform.FindChild("Model_0");
             if (transform3)
             {
                 ResourceAsset.meshes.Clear();
                 transform3.GetComponentsInChildren <MeshFilter>(true, ResourceAsset.meshes);
                 if (ResourceAsset.meshes.Count > 0)
                 {
                     Bounds bounds = default(Bounds);
                     for (int i = 0; i < ResourceAsset.meshes.Count; i++)
                     {
                         Mesh sharedMesh = ResourceAsset.meshes[i].sharedMesh;
                         if (!(sharedMesh == null))
                         {
                             Bounds bounds2 = sharedMesh.bounds;
                             bounds.Encapsulate(bounds2.min);
                             bounds.Encapsulate(bounds2.max);
                         }
                     }
                     if (bounds.min.y < 0f)
                     {
                         float num = Mathf.Abs(bounds.min.z);
                         bounds.center += new Vector3(0f, 0f, num / 2f);
                         bounds.size   -= new Vector3(0f, 0f, num);
                     }
                     float num2 = Mathf.Max(bounds.size.x, bounds.size.y);
                     float z    = bounds.size.z;
                     this.skyboxGameObject.transform.localScale = new Vector3(z, z, z);
                     Transform transform4 = UnityEngine.Object.Instantiate <GameObject>(this.modelGameObject).transform;
                     Transform transform5 = new GameObject().transform;
                     transform5.parent        = transform4;
                     transform5.localPosition = new Vector3(0f, z / 2f, -num2 / 2f);
                     transform5.localRotation = Quaternion.identity;
                     Transform transform6 = new GameObject().transform;
                     transform6.parent        = transform4;
                     transform6.localPosition = new Vector3(-num2 / 2f, z / 2f, 0f);
                     transform6.localRotation = Quaternion.Euler(0f, 90f, 0f);
                     if (!ResourceAsset.shader)
                     {
                         ResourceAsset.shader = Shader.Find("Custom/Card");
                     }
                     Texture2D card = ItemTool.getCard(transform4, transform5, transform6, 64, 64, z / 2f, num2);
                     this.skyboxMaterial             = new Material(ResourceAsset.shader);
                     this.skyboxMaterial.mainTexture = card;
                 }
             }
         }
     }
     this.health    = data.readUInt16("Health");
     this.radius    = data.readSingle("Radius");
     this.scale     = data.readSingle("Scale");
     this.explosion = data.readUInt16("Explosion");
     this.log       = data.readUInt16("Log");
     this.stick     = data.readUInt16("Stick");
     this.rewardID  = data.readUInt16("Reward_ID");
     this.rewardXP  = data.readUInt32("Reward_XP");
     if (data.has("Reward_Min"))
     {
         this.rewardMin = data.readByte("Reward_Min");
     }
     else
     {
         this.rewardMin = 6;
     }
     if (data.has("Reward_Max"))
     {
         this.rewardMax = data.readByte("Reward_Max");
     }
     else
     {
         this.rewardMax = 9;
     }
     this.bladeID   = data.readByte("BladeID");
     this.reset     = data.readSingle("Reset");
     this.isForage  = data.has("Forage");
     this.hasDebris = !data.has("No_Debris");
     bundle.unload();
 }
Esempio n. 14
0
        public ItemGunAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
        {
            this._shoot      = (AudioClip)bundle.load("Shoot");
            this._reload     = (AudioClip)bundle.load("Reload");
            this._hammer     = (AudioClip)bundle.load("Hammer");
            this._aim        = (AudioClip)bundle.load("Aim");
            this._minigun    = (AudioClip)bundle.load("Minigun");
            this._projectile = (GameObject)bundle.load("Projectile");
            this.ammoMin     = data.readByte("Ammo_Min");
            this.ammoMax     = data.readByte("Ammo_Max");
            this.sightID     = data.readUInt16("Sight");
            this.tacticalID  = data.readUInt16("Tactical");
            this.gripID      = data.readUInt16("Grip");
            this.barrelID    = data.readUInt16("Barrel");
            this.magazineID  = data.readUInt16("Magazine");
            int num = data.readInt32("Magazine_Replacements");

            this.magazineReplacements = new MagazineReplacement[num];
            for (int i = 0; i < num; i++)
            {
                ushort id2 = data.readUInt16("Magazine_Replacement_" + i + "_ID");
                string map = data.readString("Magazine_Replacement_" + i + "_Map");
                MagazineReplacement magazineReplacement = default(MagazineReplacement);
                magazineReplacement.id       = id2;
                magazineReplacement.map      = map;
                this.magazineReplacements[i] = magazineReplacement;
            }
            this.unplace = data.readSingle("Unplace");
            this.replace = data.readSingle("Replace");
            if ((double)this.replace < 0.01)
            {
                this.replace = 1f;
            }
            this.hasSight    = data.has("Hook_Sight");
            this.hasTactical = data.has("Hook_Tactical");
            this.hasGrip     = data.has("Hook_Grip");
            this.hasBarrel   = data.has("Hook_Barrel");
            int num2 = data.readInt32("Magazine_Calibers");

            if (num2 > 0)
            {
                this.magazineCalibers = new ushort[num2];
                for (int j = 0; j < num2; j++)
                {
                    this.magazineCalibers[j] = data.readUInt16("Magazine_Caliber_" + j);
                }
                int num3 = data.readInt32("Attachment_Calibers");
                if (num3 > 0)
                {
                    this.attachmentCalibers = new ushort[num3];
                    for (int k = 0; k < num3; k++)
                    {
                        this.attachmentCalibers[k] = data.readUInt16("Attachment_Caliber_" + k);
                    }
                }
                else
                {
                    this.attachmentCalibers = this.magazineCalibers;
                }
            }
            else
            {
                this.magazineCalibers    = new ushort[1];
                this.magazineCalibers[0] = data.readUInt16("Caliber");
                this.attachmentCalibers  = this.magazineCalibers;
            }
            this.firerate             = data.readByte("Firerate");
            this.action               = (EAction)Enum.Parse(typeof(EAction), data.readString("Action"), true);
            this.deleteEmptyMagazines = data.has("Delete_Empty_Magazines");
            this.bursts               = data.readInt32("Bursts");
            this.hasSafety            = data.has("Safety");
            this.hasSemi              = data.has("Semi");
            this.hasAuto              = data.has("Auto");
            this.hasBurst             = (this.bursts > 0);
            this.isTurret             = data.has("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 = data.readSingle("Spread_Aim");
            this.spreadHip = data.readSingle("Spread_Hip");
            if (data.has("Recoil_Aim"))
            {
                this.recoilAim    = data.readSingle("Recoil_Aim");
                this.useRecoilAim = true;
            }
            else
            {
                this.recoilAim    = 1f;
                this.useRecoilAim = false;
            }
            this.recoilMin_x     = data.readSingle("Recoil_Min_X");
            this.recoilMin_y     = data.readSingle("Recoil_Min_Y");
            this.recoilMax_x     = data.readSingle("Recoil_Max_X");
            this.recoilMax_y     = data.readSingle("Recoil_Max_Y");
            this.recover_x       = data.readSingle("Recover_X");
            this.recover_y       = data.readSingle("Recover_Y");
            this.shakeMin_x      = data.readSingle("Shake_Min_X");
            this.shakeMin_y      = data.readSingle("Shake_Min_Y");
            this.shakeMin_z      = data.readSingle("Shake_Min_Z");
            this.shakeMax_x      = data.readSingle("Shake_Max_X");
            this.shakeMax_y      = data.readSingle("Shake_Max_Y");
            this.shakeMax_z      = data.readSingle("Shake_Max_Z");
            this.ballisticSteps  = data.readByte("Ballistic_Steps");
            this.ballisticTravel = data.readSingle("Ballistic_Travel");
            if (data.has("Ballistic_Steps"))
            {
                this.ballisticSteps  = data.readByte("Ballistic_Steps");
                this.ballisticTravel = data.readSingle("Ballistic_Travel");
            }
            else
            {
                this.ballisticTravel = 10f;
                this.ballisticSteps  = (byte)Mathf.CeilToInt(this.range / this.ballisticTravel);
            }
            if (data.has("Ballistic_Drop"))
            {
                this.ballisticDrop = data.readSingle("Ballistic_Drop");
            }
            else
            {
                this.ballisticDrop = 0.002f;
            }
            if (data.has("Ballistic_Force"))
            {
                this.ballisticForce = data.readSingle("Ballistic_Force");
            }
            else
            {
                this.ballisticForce = 0.002f;
            }
            this.reloadTime = data.readSingle("Reload_Time");
            this.hammerTime = data.readSingle("Hammer_Time");
            this.muzzle     = data.readUInt16("Muzzle");
            this.explosion  = data.readUInt16("Explosion");
            if (data.has("Shell"))
            {
                this.shell = data.readUInt16("Shell");
            }
            else if (this.action == EAction.Pump || this.action == EAction.Break)
            {
                this.shell = 33;
            }
            else if (this.action != EAction.Rail)
            {
                this.shell = 1;
            }
            else
            {
                this.shell = 0;
            }
            if (data.has("Alert_Radius"))
            {
                this.alertRadius = data.readSingle("Alert_Radius");
            }
            else
            {
                this.alertRadius = 48f;
            }
            bundle.unload();
        }
Esempio n. 15
0
 public ObjectAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     if (id < 2000 && !bundle.hasResource && !data.has("Bypass_ID_Limit"))
     {
         throw new NotSupportedException("ID < 2000");
     }
     this._objectName = localization.format("Name");
     this.type        = (EObjectType)Enum.Parse(typeof(EObjectType), data.readString("Type"), true);
     if (this.type == EObjectType.NPC)
     {
         if (Dedicator.isDedicated)
         {
             this._modelGameObject = (GameObject)Resources.Load("Characters/NPC_Server");
         }
         else
         {
             this._modelGameObject = (GameObject)Resources.Load("Characters/NPC_Client");
         }
         this.useScale        = true;
         this.interactability = EObjectInteractability.NPC;
     }
     else if (this.type == EObjectType.DECAL)
     {
         float num  = data.readSingle("Decal_X");
         float num2 = data.readSingle("Decal_Y");
         float num3 = 1f;
         if (data.has("Decal_LOD_Bias"))
         {
             num3 = data.readSingle("Decal_LOD_Bias");
         }
         Texture2D texture2D = (Texture2D)bundle.load("Decal");
         this._modelGameObject           = Object.Instantiate <GameObject>(Resources.Load <GameObject>("Materials/Decal_Template"));
         this._modelGameObject.hideFlags = 61;
         Object.DontDestroyOnLoad(this._modelGameObject);
         BoxCollider component = this.modelGameObject.GetComponent <BoxCollider>();
         component.size = new Vector3(num2, num, 1f);
         Decal    component2 = this.modelGameObject.transform.FindChild("Decal").GetComponent <Decal>();
         Material material   = Object.Instantiate <Material>(component2.material);
         material.name      = "Decal_Deferred";
         material.hideFlags = 52;
         material.SetTexture("_MainTex", texture2D);
         component2.material             = material;
         component2.lodBias              = num3;
         component2.transform.localScale = new Vector3(num, num2, 1f);
         MeshRenderer component3 = this.modelGameObject.transform.FindChild("Mesh").GetComponent <MeshRenderer>();
         Material     material2  = Object.Instantiate <Material>(component3.sharedMaterial);
         material2.name      = "Decal_Forward";
         material2.hideFlags = 52;
         material2.SetTexture("_MainTex", texture2D);
         component3.sharedMaterial       = material2;
         component3.transform.localScale = new Vector3(num2, num, 1f);
         this.useScale = true;
     }
     else
     {
         if (Dedicator.isDedicated)
         {
             this._modelGameObject = (GameObject)bundle.load("Clip");
             if (this.modelGameObject == null && this.type != EObjectType.SMALL)
             {
                 Debug.LogError(this.objectName + " is missing collision data. Highly recommended to fix.");
             }
         }
         else
         {
             this._modelGameObject = (GameObject)bundle.load("Object");
             if (this.modelGameObject == null)
             {
                 throw new NotSupportedException("Missing object gameobject");
             }
             this._skyboxGameObject = (GameObject)bundle.load("Skybox");
         }
         if (this.modelGameObject != null)
         {
             if (Mathf.Abs(this.modelGameObject.transform.localScale.x - 1f) > 0.01f || Mathf.Abs(this.modelGameObject.transform.localScale.y - 1f) > 0.01f || Mathf.Abs(this.modelGameObject.transform.localScale.z - 1f) > 0.01f)
             {
                 this.useScale = false;
                 Assets.errors.Add(this.objectName + " should have a scale of one.");
             }
             else
             {
                 this.useScale = true;
             }
             Transform transform = this.modelGameObject.transform.FindChild("Block");
             if (transform != null && transform.GetComponent <Collider>() != null && transform.GetComponent <Collider>().sharedMaterial == null)
             {
                 Assets.errors.Add(this.objectName + " has a clip object but no physics material.");
             }
             Transform transform2 = this.modelGameObject.transform.FindChild("Model_0");
             if (this.type == EObjectType.SMALL)
             {
                 if (!this.modelGameObject.CompareTag("Small"))
                 {
                     Assets.errors.Add(this.objectName + " is set up as small, but is not tagged as small.");
                 }
                 if (this.modelGameObject.layer != LayerMasks.SMALL)
                 {
                     Assets.errors.Add(this.objectName + " is set up as small, but is not layered as small.");
                 }
                 if (transform2 != null)
                 {
                     if (!transform2.CompareTag("Small"))
                     {
                         Assets.errors.Add(this.objectName + " is set up as small, but is not tagged as small.");
                     }
                     if (transform2.gameObject.layer != LayerMasks.SMALL)
                     {
                         Assets.errors.Add(this.objectName + " is set up as small, but is not layered as small.");
                     }
                 }
             }
             else if (this.type == EObjectType.MEDIUM)
             {
                 if (!this.modelGameObject.CompareTag("Medium"))
                 {
                     Assets.errors.Add(this.objectName + " is set up as medium, but is not tagged as medium.");
                 }
                 if (this.modelGameObject.layer != LayerMasks.MEDIUM)
                 {
                     Assets.errors.Add(this.objectName + " is set up as medium, but is not layered as medium.");
                 }
                 if (transform2 != null)
                 {
                     if (!transform2.CompareTag("Medium"))
                     {
                         Assets.errors.Add(this.objectName + " is set up as medium, but is not tagged as medium.");
                     }
                     if (transform2.gameObject.layer != LayerMasks.MEDIUM)
                     {
                         Assets.errors.Add(this.objectName + " is set up as medium, but is not layered as medium.");
                     }
                 }
             }
             else if (this.type == EObjectType.LARGE)
             {
                 if (!this.modelGameObject.CompareTag("Large"))
                 {
                     Assets.errors.Add(this.objectName + " is set up as large, but is not tagged as large.");
                 }
                 if (this.modelGameObject.layer != LayerMasks.LARGE)
                 {
                     Assets.errors.Add(this.objectName + " is set up as large, but is not layered as large.");
                 }
                 if (transform2 != null)
                 {
                     if (!transform2.CompareTag("Large"))
                     {
                         Assets.errors.Add(this.objectName + " is set up as large, but is not tagged as large.");
                     }
                     if (transform2.gameObject.layer != LayerMasks.LARGE)
                     {
                         Assets.errors.Add(this.objectName + " is set up as large, but is not layered as large.");
                     }
                 }
             }
         }
         this._navGameObject = (GameObject)bundle.load("Nav");
         if (this.navGameObject == null && this.type == EObjectType.LARGE)
         {
             Assets.errors.Add(this.objectName + " is missing navigation data. Highly recommended to fix.");
         }
         if (this.navGameObject != null)
         {
             if (!this.navGameObject.CompareTag("Navmesh"))
             {
                 Assets.errors.Add(this.objectName + " is set up as navmesh, but is not tagged as navmesh.");
             }
             if (this.navGameObject.layer != LayerMasks.NAVMESH)
             {
                 Assets.errors.Add(this.objectName + " is set up as navmesh, but is not layered as navmesh.");
             }
         }
         this._slotsGameObject    = (GameObject)bundle.load("Slots");
         this._triggersGameObject = (GameObject)bundle.load("Triggers");
         this.isSnowshoe          = data.has("Snowshoe");
         if (data.has("Chart"))
         {
             this.chart = (EObjectChart)Enum.Parse(typeof(EObjectChart), data.readString("Chart"), true);
         }
         else
         {
             this.chart = EObjectChart.NONE;
         }
         this.isFuel               = data.has("Fuel");
         this.isRefill             = data.has("Refill");
         this.isSoft               = data.has("Soft");
         this.isCollisionImportant = data.has("Collision_Important");
         if (this.isFuel || this.isRefill)
         {
             Assets.errors.Add(this.objectName + " is using the legacy fuel/water system.");
         }
         if (data.has("LOD"))
         {
             this.lod     = (EObjectLOD)Enum.Parse(typeof(EObjectLOD), data.readString("LOD"), true);
             this.lodBias = data.readSingle("LOD_Bias");
             if (this.lodBias < 0.01f)
             {
                 this.lodBias = 1f;
             }
             this.lodCenter = data.readVector3("LOD_Center");
             this.lodSize   = data.readVector3("LOD_Size");
         }
         if (data.has("Interactability"))
         {
             this.interactability       = (EObjectInteractability)Enum.Parse(typeof(EObjectInteractability), data.readString("Interactability"), true);
             this.interactabilityRemote = data.has("Interactability_Remote");
             this.interactabilityDelay  = data.readSingle("Interactability_Delay");
             this.interactabilityReset  = data.readSingle("Interactability_Reset");
             if (data.has("Interactability_Hint"))
             {
                 this.interactabilityHint = (EObjectInteractabilityHint)Enum.Parse(typeof(EObjectInteractabilityHint), data.readString("Interactability_Hint"), true);
             }
             this.interactabilityEmission = data.has("Interactability_Emission");
             if (this.interactability == EObjectInteractability.NOTE)
             {
                 ushort        num4          = data.readUInt16("Interactability_Text_Lines");
                 StringBuilder stringBuilder = new StringBuilder();
                 for (ushort num5 = 0; num5 < num4; num5 += 1)
                 {
                     string value = localization.format("Interactability_Text_Line_" + num5);
                     stringBuilder.AppendLine(value);
                 }
                 this.interactabilityText = stringBuilder.ToString();
             }
             else
             {
                 this.interactabilityText = localization.read("Interact");
             }
             if (data.has("Interactability_Power"))
             {
                 this.interactabilityPower = (EObjectInteractabilityPower)Enum.Parse(typeof(EObjectInteractabilityPower), data.readString("Interactability_Power"), true);
             }
             else
             {
                 this.interactabilityPower = EObjectInteractabilityPower.NONE;
             }
             if (data.has("Interactability_Editor"))
             {
                 this.interactabilityEditor = (EObjectInteractabilityEditor)Enum.Parse(typeof(EObjectInteractabilityEditor), data.readString("Interactability_Editor"), true);
             }
             else
             {
                 this.interactabilityEditor = EObjectInteractabilityEditor.NONE;
             }
             if (data.has("Interactability_Nav"))
             {
                 this.interactabilityNav = (EObjectInteractabilityNav)Enum.Parse(typeof(EObjectInteractabilityNav), data.readString("Interactability_Nav"), true);
             }
             else
             {
                 this.interactabilityNav = EObjectInteractabilityNav.NONE;
             }
             this.interactabilityDrops = new ushort[(int)data.readByte("Interactability_Drops")];
             byte b = 0;
             while ((int)b < this.interactabilityDrops.Length)
             {
                 this.interactabilityDrops[(int)b] = data.readUInt16("Interactability_Drop_" + b);
                 b += 1;
             }
             this.interactabilityRewardID   = data.readUInt16("Interactability_Reward_ID");
             this.interactabilityEffect     = data.readUInt16("Interactability_Effect");
             this.interactabilityConditions = new INPCCondition[(int)data.readByte("Interactability_Conditions")];
             NPCTool.readConditions(data, localization, "Interactability_Condition_", this.interactabilityConditions);
             this.interactabilityRewards = new INPCReward[(int)data.readByte("Interactability_Rewards")];
             NPCTool.readRewards(data, localization, "Interactability_Reward_", this.interactabilityRewards);
             this.interactabilityResource      = data.readUInt16("Interactability_Resource");
             this.interactabilityResourceState = BitConverter.GetBytes(this.interactabilityResource);
         }
         else
         {
             this.interactability       = EObjectInteractability.NONE;
             this.interactabilityPower  = EObjectInteractabilityPower.NONE;
             this.interactabilityEditor = EObjectInteractabilityEditor.NONE;
         }
         if (this.interactability == EObjectInteractability.RUBBLE)
         {
             this.rubble               = EObjectRubble.DESTROY;
             this.rubbleReset          = data.readSingle("Interactability_Reset");
             this.rubbleHealth         = data.readUInt16("Interactability_Health");
             this.rubbleEffect         = data.readUInt16("Interactability_Effect");
             this.rubbleFinale         = data.readUInt16("Interactability_Finale");
             this.rubbleRewardID       = data.readUInt16("Interactability_Reward_ID");
             this.rubbleRewardXP       = data.readUInt32("Interactability_Reward_XP");
             this.rubbleIsVulnerable   = !data.has("Interactability_Invulnerable");
             this.rubbleProofExplosion = data.has("Interactability_Proof_Explosion");
         }
         else if (data.has("Rubble"))
         {
             this.rubble               = (EObjectRubble)Enum.Parse(typeof(EObjectRubble), data.readString("Rubble"), true);
             this.rubbleReset          = data.readSingle("Rubble_Reset");
             this.rubbleHealth         = data.readUInt16("Rubble_Health");
             this.rubbleEffect         = data.readUInt16("Rubble_Effect");
             this.rubbleFinale         = data.readUInt16("Rubble_Finale");
             this.rubbleRewardID       = data.readUInt16("Rubble_Reward_ID");
             this.rubbleRewardXP       = data.readUInt32("Rubble_Reward_XP");
             this.rubbleIsVulnerable   = !data.has("Rubble_Invulnerable");
             this.rubbleProofExplosion = data.has("Rubble_Proof_Explosion");
             if (data.has("Rubble_Editor"))
             {
                 this.rubbleEditor = (EObjectRubbleEditor)Enum.Parse(typeof(EObjectRubbleEditor), data.readString("Rubble_Editor"), true);
             }
             else
             {
                 this.rubbleEditor = EObjectRubbleEditor.ALIVE;
             }
         }
         if (data.has("Foliage"))
         {
             this.foliage = new AssetReference <FoliageInfoCollectionAsset>(new Guid(data.readString("Foliage")));
         }
         this.useWaterHeightTransparentSort = data.has("Use_Water_Height_Transparent_Sort");
         if (data.has("Material_Palette"))
         {
             this.materialPalette = new AssetReference <MaterialPaletteAsset>(data.readGUID("Material_Palette"));
         }
         if (data.has("Landmark_Quality"))
         {
             this.landmarkQuality = (EGraphicQuality)Enum.Parse(typeof(EGraphicQuality), data.readString("Landmark_Quality"), true);
         }
         else
         {
             this.landmarkQuality = EGraphicQuality.LOW;
         }
     }
     this.conditions = new INPCCondition[(int)data.readByte("Conditions")];
     NPCTool.readConditions(data, localization, "Condition_", this.conditions);
     bundle.unload();
 }
Esempio n. 16
0
 public EffectAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     if (id < 200 && !bundle.hasResource && !data.has("Bypass_ID_Limit"))
     {
         throw new NotSupportedException("ID < 200");
     }
     this._effect = (GameObject)bundle.load("Effect");
     if (this.effect == null)
     {
         throw new NotSupportedException("Missing effect gameobject");
     }
     this._gore      = data.has("Gore");
     this._splatters = new GameObject[(int)data.readByte("Splatter")];
     for (int i = 0; i < this.splatters.Length; i++)
     {
         this.splatters[i] = (GameObject)bundle.load("Splatter_" + i);
     }
     this._splatter       = data.readByte("Splatters");
     this._splatterLiquid = data.has("Splatter_Liquid");
     if (data.has("Splatter_Temperature"))
     {
         this._splatterTemperature = (EPlayerTemperature)Enum.Parse(typeof(EPlayerTemperature), data.readString("Splatter_Temperature"), true);
     }
     else
     {
         this._splatterTemperature = EPlayerTemperature.NONE;
     }
     this._splatterLifetime = data.readSingle("Splatter_Lifetime");
     if (data.has("Splatter_Lifetime_Spread"))
     {
         this._splatterLifetimeSpread = data.readSingle("Splatter_Lifetime_Spread");
     }
     else
     {
         this._splatterLifetimeSpread = 1f;
     }
     this._lifetime = data.readSingle("Lifetime");
     if (data.has("Lifetime_Spread"))
     {
         this._lifetimeSpread = data.readSingle("Lifetime_Spread");
     }
     else
     {
         this._lifetimeSpread = 4f;
     }
     this._isStatic = data.has("Static");
     if (data.has("Preload"))
     {
         this._preload = data.readByte("Preload");
     }
     else
     {
         this._preload = 1;
     }
     if (data.has("Splatter_Preload"))
     {
         this._splatterPreload = data.readByte("Splatter_Preload");
     }
     else
     {
         this._splatterPreload = (byte)(Mathf.CeilToInt((float)this.splatter / (float)this.splatters.Length) * (int)this.preload);
     }
     this._blast = data.readUInt16("Blast");
     bundle.unload();
 }
Esempio n. 17
0
        // Token: 0x06001CDC RID: 7388 RVA: 0x0009C460 File Offset: 0x0009A860
        public VehicleAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
        {
            if (id < 200 && !bundle.hasResource && !data.has("Bypass_ID_Limit"))
            {
                throw new NotSupportedException("ID < 200");
            }
            this._vehicleName = localization.format("Name");
            this._vehicle     = (GameObject)bundle.load("Vehicle");
            if (this.vehicle == null)
            {
                throw new NotSupportedException("Missing vehicle gameobject");
            }
            this._clip           = (GameObject)bundle.load("Clip");
            this._size2_z        = data.readSingle("Size2_Z");
            this._sharedSkinName = data.readString("Shared_Skin_Name");
            if (data.has("Shared_Skin_Lookup_ID"))
            {
                this._sharedSkinLookupID = data.readUInt16("Shared_Skin_Lookup_ID");
            }
            else
            {
                this._sharedSkinLookupID = id;
            }
            if (data.has("Engine"))
            {
                this._engine = (EEngine)Enum.Parse(typeof(EEngine), data.readString("Engine"), true);
                if (this.engine == EEngine.BOAT || this.engine == EEngine.BLIMP)
                {
                    if (this.vehicle.transform.FindChild("Buoyancy") == null)
                    {
                        this._engine = EEngine.CAR;
                    }
                }
                else if (this.engine != EEngine.CAR && this.engine != EEngine.TRAIN && this.vehicle.transform.FindChild("Rotors") == null)
                {
                    this._engine = EEngine.CAR;
                }
            }
            else
            {
                this._engine = EEngine.CAR;
            }
            if (data.has("Rarity"))
            {
                this._rarity = (EItemRarity)Enum.Parse(typeof(EItemRarity), data.readString("Rarity"), true);
            }
            else
            {
                this._rarity = EItemRarity.COMMON;
            }
            this._hasHeadlights = (this.vehicle.transform.FindChild("Headlights") != null);
            this._hasSirens     = (this.vehicle.transform.FindChild("Sirens") != null);
            this._hasHook       = (this.vehicle.transform.FindChild("Hook") != null);
            this._hasZip        = data.has("Zip");
            this._hasBicycle    = data.has("Bicycle");
            this.isReclined     = data.has("Reclined");
            this._hasCrawler    = data.has("Crawler");
            this._hasLockMouse  = data.has("LockMouse");
            this._hasTraction   = data.has("Traction");
            this._hasSleds      = data.has("Sleds");
            this._ignition      = (AudioClip)bundle.load("Ignition");
            this._horn          = (AudioClip)bundle.load("Horn");
            if (this.clip == null)
            {
                Assets.errors.Add(this.vehicleName + " is missing collision data. Highly recommended to fix.");
            }
            if (this.vehicle != null && this.vehicle.transform.FindChild("Seats") == null)
            {
                Assets.errors.Add(this.vehicleName + " vehicle is missing seats.");
            }
            if (this.clip != null && this.clip.transform.FindChild("Seats") == null)
            {
                Assets.errors.Add(this.vehicleName + " clip is missing seats.");
            }
            if (data.has("Pitch_Idle"))
            {
                this._pitchIdle = data.readSingle("Pitch_Idle");
            }
            else
            {
                this._pitchIdle = 0.5f;
                AudioSource component = this.vehicle.GetComponent <AudioSource>();
                if (component != null)
                {
                    AudioClip clip = component.clip;
                    if (clip != null)
                    {
                        if (clip.name == "Engine_Large")
                        {
                            this._pitchIdle = 0.625f;
                        }
                        else if (clip.name == "Engine_Small")
                        {
                            this._pitchIdle = 0.75f;
                        }
                    }
                    else
                    {
                        Assets.errors.Add(this.vehicleName + " missing engine audio!");
                    }
                }
            }
            if (data.has("Pitch_Drive"))
            {
                this._pitchDrive = data.readSingle("Pitch_Drive");
            }
            else
            {
                this._pitchDrive = 0.05f;
                AudioSource component2 = this.vehicle.GetComponent <AudioSource>();
                if (component2 != null)
                {
                    AudioClip clip2 = component2.clip;
                    if (clip2 != null)
                    {
                        if (clip2.name == "Engine_Large")
                        {
                            this._pitchDrive = 0.025f;
                        }
                        else if (clip2.name == "Engine_Small")
                        {
                            this._pitchDrive = 0.075f;
                        }
                    }
                    else
                    {
                        Assets.errors.Add(this.vehicleName + " missing engine audio!");
                    }
                }
            }
            this._speedMin = data.readSingle("Speed_Min");
            this._speedMax = data.readSingle("Speed_Max");
            if (this.engine != EEngine.TRAIN)
            {
                this._speedMax *= 1.25f;
            }
            this._steerMin  = data.readSingle("Steer_Min");
            this._steerMax  = data.readSingle("Steer_Max") * 0.75f;
            this._brake     = data.readSingle("Brake");
            this._lift      = data.readSingle("Lift");
            this._fuelMin   = data.readUInt16("Fuel_Min");
            this._fuelMax   = data.readUInt16("Fuel_Max");
            this._fuel      = data.readUInt16("Fuel");
            this._healthMin = data.readUInt16("Health_Min");
            this._healthMax = data.readUInt16("Health_Max");
            this._health    = data.readUInt16("Health");
            this._explosion = data.readUInt16("Explosion");
            if (data.has("Explosion_Min_Force_Y"))
            {
                this.minExplosionForce = data.readVector3("Explosion_Min_Force");
            }
            else
            {
                this.minExplosionForce = new Vector3(0f, 1024f, 0f);
            }
            if (data.has("Explosion_Max_Force_Y"))
            {
                this.maxExplosionForce = data.readVector3("Explosion_Max_Force");
            }
            else
            {
                this.maxExplosionForce = new Vector3(0f, 1024f, 0f);
            }
            if (data.has("Exit"))
            {
                this._exit = data.readSingle("Exit");
            }
            else
            {
                this._exit = 2f;
            }
            if (data.has("Cam_Follow_Distance"))
            {
                this._camFollowDistance = data.readSingle("Cam_Follow_Distance");
            }
            else
            {
                this._camFollowDistance = 5.5f;
            }
            this._camDriverOffset = data.readSingle("Cam_Driver_Offset");
            if (data.has("Bumper_Multiplier"))
            {
                this._bumperMultiplier = data.readSingle("Bumper_Multiplier");
            }
            else
            {
                this._bumperMultiplier = 1f;
            }
            if (data.has("Passenger_Explosion_Armor"))
            {
                this._passengerExplosionArmor = data.readSingle("Passenger_Explosion_Armor");
            }
            else
            {
                this._passengerExplosionArmor = 1f;
            }
            if (this.engine == EEngine.HELICOPTER || this.engine == EEngine.BLIMP)
            {
                this._sqrDelta = Mathf.Pow(this.speedMax * 0.125f, 2f);
            }
            else
            {
                this._sqrDelta = Mathf.Pow(this.speedMax * 0.1f, 2f);
            }
            this._turrets = new TurretInfo[(int)data.readByte("Turrets")];
            byte b = 0;

            while ((int)b < this.turrets.Length)
            {
                TurretInfo turretInfo = new TurretInfo();
                turretInfo.seatIndex    = data.readByte("Turret_" + b + "_Seat_Index");
                turretInfo.itemID       = data.readUInt16("Turret_" + b + "_Item_ID");
                turretInfo.yawMin       = data.readSingle("Turret_" + b + "_Yaw_Min");
                turretInfo.yawMax       = data.readSingle("Turret_" + b + "_Yaw_Max");
                turretInfo.pitchMin     = data.readSingle("Turret_" + b + "_Pitch_Min");
                turretInfo.pitchMax     = data.readSingle("Turret_" + b + "_Pitch_Max");
                turretInfo.useAimCamera = !data.has("Turret_" + b + "_Ignore_Aim_Camera");
                turretInfo.aimOffset    = data.readSingle("Turret_" + b + "_Aim_Offset");
                this._turrets[(int)b]   = turretInfo;
                b += 1;
            }
            this.isVulnerable              = !data.has("Invulnerable");
            this.isVulnerableToExplosions  = !data.has("Explosions_Invulnerable");
            this.isVulnerableToEnvironment = !data.has("Environment_Invulnerable");
            this.isVulnerableToBumper      = !data.has("Bumper_Invulnerable");
            this.canTiresBeDamaged         = !data.has("Tires_Invulnerable");
            if (data.has("Air_Turn_Responsiveness"))
            {
                this.airTurnResponsiveness = data.readSingle("Air_Turn_Responsiveness");
            }
            else
            {
                this.airTurnResponsiveness = 2f;
            }
            if (data.has("Air_Steer_Min"))
            {
                this.airSteerMin = data.readSingle("Air_Steer_Min");
            }
            else
            {
                this.airSteerMin = this.steerMin;
            }
            if (data.has("Air_Steer_Max"))
            {
                this.airSteerMax = data.readSingle("Air_Steer_Max");
            }
            else
            {
                this.airSteerMax = this.steerMax;
            }
            this.bicycleAnimSpeed         = data.readSingle("Bicycle_Anim_Speed");
            this.staminaBoost             = data.readSingle("Stamina_Boost");
            this.useStaminaBoost          = data.has("Stamina_Boost");
            this.isStaminaPowered         = data.has("Stamina_Powered");
            this.supportsMobileBuildables = data.has("Supports_Mobile_Buildables");
            this.trunkStorage_X           = data.readByte("Trunk_Storage_X");
            this.trunkStorage_Y           = data.readByte("Trunk_Storage_Y");
            this.trainTrackOffset         = data.readSingle("Train_Track_Offset");
            this.trainWheelOffset         = data.readSingle("Train_Wheel_Offset");
            this.trainCarLength           = data.readSingle("Train_Car_Length");
            this._shouldVerifyHash        = !data.has("Bypass_Hash_Verification");
            if (!Dedicator.isDedicated)
            {
                this._albedoBase   = (Texture2D)bundle.load("Albedo_Base");
                this._metallicBase = (Texture2D)bundle.load("Metallic_Base");
                this._emissionBase = (Texture2D)bundle.load("Emission_Base");
            }
            bundle.unload();
        }
Esempio n. 18
0
 public ItemCloudAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this._gravity = data.readSingle("Gravity");
     bundle.unload();
 }