Exemplo n.º 1
0
        internal static void InitCraftedItemObject(
            ref ItemObject itemObject,
            TextObject name,
            BasicCultureObject culture,
            ItemFlags itemProperties,
            float weight,
            float appearance,
            WeaponDesign craftedData)
        {
            BladeData bladeData = craftedData.UsedPieces[0].CraftingPiece.BladeData;

            itemObject.Weight                    = weight;
            itemObject.Name                      = name;
            itemObject.MultiMeshName             = "";
            itemObject.HolsterMeshName           = "";
            itemObject.HolsterWithWeaponMeshName = "";
            itemObject.ItemHolsters              = (string[])craftedData.Template.ItemHolsters.Clone();
            itemObject.HolsterPositionShift      = craftedData.HolsterShiftAmount;
            itemObject.FlyingMeshName            = "";
            itemObject.BodyName                  = bladeData?.BodyName;
            itemObject.HolsterBodyName           = bladeData?.HolsterBodyName ?? bladeData?.BodyName;
            itemObject.CollisionBodyName         = "";
            itemObject.RecalculateBody           = true;
            itemObject.Culture                   = culture;
            itemObject.Difficulty                = 0;
            itemObject.ScaleFactor               = 1f;
            itemObject.Type                      = WeaponComponentData.GetItemTypeFromWeaponClass(craftedData.Template.WeaponUsageDatas.First <WeaponUsageData>().WeaponClass);
            itemObject.ItemFlags                 = itemProperties;
            itemObject.Appearance                = appearance;
            itemObject.WeaponDesign              = craftedData;
        }
Exemplo n.º 2
0
 public void AddWeapon(
     WeaponComponentData weaponComponentData,
     ItemModifierGroup itemModifierGroup)
 {
     this.ItemModifierGroup = itemModifierGroup;
     this._weaponList.Add(weaponComponentData);
 }
Exemplo n.º 3
0
 public void AddWeapon(WeaponComponentData weapon, ItemModifierGroup itemModifierGroup)
 {
     if (this.WeaponComponent == null)
     {
         this.ItemComponent = (ItemComponent) new WeaponComponent(this);
     }
     this.WeaponComponent.AddWeapon(weapon, itemModifierGroup);
 }
Exemplo n.º 4
0
        private float CalculateTierMeleeWeapon(WeaponComponent weaponComponent)
        {
            WeaponComponentData weapon = weaponComponent.Weapons[0];
            float num1 = Math.Max((float)weapon.ThrustDamage * this.GetFactor(weapon.ThrustDamageType) * MathF.Pow((float)weapon.ThrustSpeed * 0.01f, 1.5f), (float)weapon.SwingDamage * this.GetFactor(weapon.SwingDamageType) * MathF.Pow((float)weapon.SwingSpeed * 0.01f, 1.5f) * 1.1f);

            if (weapon.WeaponFlags.HasAnyFlag <WeaponFlags>(WeaponFlags.NotUsableWithOneHand))
            {
                num1 *= 0.8f;
            }
            if (weapon.WeaponClass == WeaponClass.ThrowingKnife || weapon.WeaponClass == WeaponClass.ThrowingKnife || weapon.WeaponClass == WeaponClass.Javelin)
            {
                num1 *= 1.2f;
            }
            float num2 = (float)weapon.WeaponLength * 0.01f;

            return((float)(0.0599999986588955 * ((double)num1 * (1.0 + (double)num2)) - 3.5));
        }
Exemplo n.º 5
0
        private float CalculateRangedWeaponTier(WeaponComponent weaponComponent)
        {
            WeaponComponentData weapon     = weaponComponent.Weapons[0];
            ItemObject          itemObject = weaponComponent.Item;
            double num1;

            switch (itemObject != null ? itemObject.ItemType : ItemObject.ItemTypeEnum.Invalid)
            {
            case ItemObject.ItemTypeEnum.Crossbow:
                num1 = 0.699999988079071;
                break;

            case ItemObject.ItemTypeEnum.Musket:
                num1 = 0.5;
                break;

            default:
                num1 = 1.0;
                break;
            }
            double num2 = (double)weapon.ThrustDamage * 0.200000002980232 + (double)weapon.ThrustSpeed * 0.0199999995529652 + (double)weapon.Accuracy * 0.0199999995529652;

            return((float)(num1 * num2 - 11.0));
        }
Exemplo n.º 6
0
        private float CalculateAmmoTier(WeaponComponent weaponComponent)
        {
            WeaponComponentData weapon = weaponComponent.Weapons[0];

            return((float)weapon.MissileDamage + (float)Math.Max(0, (int)weapon.MaxDataValue - 20) * 0.1f);
        }
Exemplo n.º 7
0
        private float CalculateShieldTier(WeaponComponent weaponComponent)
        {
            WeaponComponentData weapon = weaponComponent.Weapons[0];

            return((float)(((double)weapon.MaxDataValue + 3.0 * (double)weapon.BodyArmor + (double)weapon.ThrustSpeed) / (6.0 + (double)weaponComponent.Item.Weight) * 0.129999995231628 - 3.0));
        }