예제 #1
0
    public void CalculateArmor()
    {
        IInventoryItem       inventoryItem;
        InventoryHolder      inventoryHolder      = this.inventoryHolder;
        ProtectionTakeDamage protectionTakeDamage = this.takeDamage;

        if (inventoryHolder && protectionTakeDamage)
        {
            DamageTypeList damageTypeList = new DamageTypeList();
            for (int i = 36; i < 40; i++)
            {
                if (inventoryHolder.inventory.GetItem(i, out inventoryItem))
                {
                    ArmorDataBlock armorDataBlock  = inventoryItem.datablock as ArmorDataBlock;
                    ArmorDataBlock armorDataBlock1 = armorDataBlock;
                    if (armorDataBlock)
                    {
                        armorDataBlock1.AddToDamageTypeList(damageTypeList);
                    }
                }
            }
            if (protectionTakeDamage)
            {
                protectionTakeDamage.SetArmorValues(damageTypeList);
            }
        }
    }
예제 #2
0
    protected void ArmorData(byte[] data)
    {
        DamageTypeList armor  = new DamageTypeList();
        BitStream      stream = new BitStream(data, false);

        for (int i = 0; i < 6; i++)
        {
            armor[i] = stream.ReadSingle();
        }
        ProtectionTakeDamage takeDamage = this.takeDamage;

        if (takeDamage != null)
        {
            takeDamage.SetArmorValues(armor);
        }
        if (base.localPlayerControlled)
        {
            RPOS.SetEquipmentDirty();
        }
    }
예제 #3
0
    protected void ArmorData(byte[] data)
    {
        DamageTypeList damageTypeList = new DamageTypeList();

        uLink.BitStream bitStream = new uLink.BitStream(data, false);
        for (int i = 0; i < 6; i++)
        {
            damageTypeList[i] = bitStream.ReadSingle();
        }
        ProtectionTakeDamage protectionTakeDamage = this.takeDamage;

        if (protectionTakeDamage)
        {
            protectionTakeDamage.SetArmorValues(damageTypeList);
        }
        if (base.localPlayerControlled)
        {
            RPOS.SetEquipmentDirty();
        }
    }
예제 #4
0
    public void CalculateArmor()
    {
        InventoryHolder      inventoryHolder = this.inventoryHolder;
        ProtectionTakeDamage takeDamage      = this.takeDamage;

        if ((inventoryHolder != null) && (takeDamage != null))
        {
            DamageTypeList damageList = new DamageTypeList();
            for (int i = 0x24; i < 40; i++)
            {
                ArmorDataBlock block;
                IInventoryItem item;
                if (inventoryHolder.inventory.GetItem(i, out item) && ((block = item.datablock as ArmorDataBlock) != null))
                {
                    block.AddToDamageTypeList(damageList);
                }
            }
            if (takeDamage != null)
            {
                takeDamage.SetArmorValues(damageList);
            }
        }
    }