Пример #1
0
    // Token: 0x060003EE RID: 1006 RVA: 0x000128DC File Offset: 0x00010ADC
    private void CheckBeltUsage()
    {
        if (global::UIUnityEvents.shouldBlockButtonInput)
        {
            return;
        }
        if (!base.enabled)
        {
            return;
        }
        if (global::ConsoleWindow.IsVisible())
        {
            return;
        }
        global::Inventory inventory = this.inventory;

        if (!inventory)
        {
            return;
        }
        global::InventoryHolder inventoryHolder = inventory.inventoryHolder;

        if (!inventoryHolder)
        {
            return;
        }
        int num = global::HumanController.InputSample.PollItemButtons();

        if (num != -1)
        {
            inventoryHolder.BeltUse(num);
        }
    }
Пример #2
0
    // Token: 0x06000426 RID: 1062 RVA: 0x00014C84 File Offset: 0x00012E84
    private static bool GetCharacterStuff(ref global::ConsoleSystem.Arg args, out global::Character character, out global::CameraMount camera, out global::ItemRepresentation itemRep, out global::ArmorModelRenderer armor)
    {
        character = null;
        itemRep   = null;
        armor     = null;
        camera    = global::CameraMount.current;
        if (!camera)
        {
            args.ReplyWith("Theres no active camera mount.");
            return(false);
        }
        character = (IDBase.GetMain(camera) as global::Character);
        if (!character)
        {
            args.ReplyWith("theres no character for the current mounted camera");
            return(false);
        }
        armor = character.GetLocal <global::ArmorModelRenderer>();
        global::InventoryHolder local = character.GetLocal <global::InventoryHolder>();

        if (local)
        {
            itemRep = local.itemRepresentation;
        }
        return(true);
    }
Пример #3
0
    // Token: 0x060003FF RID: 1023 RVA: 0x000136E4 File Offset: 0x000118E4
    protected override void OnLocalPlayerPreRender()
    {
        global::InventoryHolder inventoryHolder = this.inventoryHolder;

        if (inventoryHolder)
        {
            inventoryHolder.InvokeInputItemPreRender();
        }
    }
Пример #4
0
    // Token: 0x06003A9D RID: 15005 RVA: 0x000CDBB8 File Offset: 0x000CBDB8
    public override void Refresh()
    {
        global::InventoryHolder inventoryHolder = base.inventoryHolder;

        if (inventoryHolder)
        {
            inventoryHolder.InventoryModified();
        }
    }
Пример #5
0
    // Token: 0x060003D4 RID: 980 RVA: 0x000122BC File Offset: 0x000104BC
    public void CalculateArmor()
    {
        global::InventoryHolder      inventoryHolder = this.inventoryHolder;
        global::ProtectionTakeDamage takeDamage      = this.takeDamage;

        if (inventoryHolder && takeDamage)
        {
            global::DamageTypeList damageTypeList = new global::DamageTypeList();
            for (int i = 36; i < 40; i++)
            {
                global::IInventoryItem inventoryItem;
                global::ArmorDataBlock armorDataBlock;
                if (inventoryHolder.inventory.GetItem(i, out inventoryItem) && (armorDataBlock = (inventoryItem.datablock as global::ArmorDataBlock)))
                {
                    armorDataBlock.AddToDamageTypeList(damageTypeList);
                }
            }
            if (takeDamage)
            {
                takeDamage.SetArmorValues(damageTypeList);
            }
        }
    }
Пример #6
0
    // Token: 0x060003EF RID: 1007 RVA: 0x00012948 File Offset: 0x00010B48
    protected void UpdateInput()
    {
        global::InventoryHolder inventoryHolder = this.inventoryHolder;

        global::PlayerClient.InputFunction(base.gameObject);
        bool noLamp;
        bool noLaser;

        if (inventoryHolder)
        {
            global::ItemModFlags modFlags = inventoryHolder.modFlags;
            noLamp  = ((modFlags & global::ItemModFlags.Lamp) == global::ItemModFlags.Other);
            noLaser = ((modFlags & global::ItemModFlags.Laser) == global::ItemModFlags.Other);
        }
        else
        {
            noLaser = (noLamp = true);
        }
        global::HumanController.InputSample inputSample = global::HumanController.InputSample.Poll(noLamp, noLaser);
        inputSample.info__crouchBlocked = this.crouch_was_blocked;
        bool flag = base.GetLocal <global::FallDamage>().GetLegInjury() > 0f;

        if (flag)
        {
            inputSample.crouch = true;
            inputSample.jump   = false;
        }
        if (inputSample.walk <= 0f || Mathf.Abs(inputSample.strafe) >= 0.05f || inputSample.attack2 || this._inventory.isCrafting || flag)
        {
            inputSample.sprint = false;
        }
        float num = 1f;

        if (this._inventory.isCrafting)
        {
            num *= 0.5f;
        }
        if (flag)
        {
            num *= 0.5f;
        }
        global::HumanController.InputSample.MovementScale = num;
        if (inventoryHolder)
        {
            object item = inventoryHolder.InvokeInputItemPreFrame(ref inputSample);
            this.ProcessInput(ref inputSample);
            inventoryHolder.InvokeInputItemPostFrame(item, ref inputSample);
        }
        else
        {
            this.ProcessInput(ref inputSample);
        }
        this.CheckBeltUsage();
        if (this.wasSprinting && !inputSample.sprint)
        {
            this.SprintingStopped();
        }
        else if (!this.wasSprinting && inputSample.sprint)
        {
            this.SprintingStarted();
        }
    }