Example #1
0
    public void FinishBandage()
    {
        this.bandageStartTime = -1f;
        RPOS.SetActionProgress(false, null, 0f);
        int numWant = 1;

        if (base.Consume(ref numWant))
        {
            base.inventory.RemoveItem(base.slot);
        }
        base.itemRepresentation.Action(3, uLink.RPCMode.Server);
    }
Example #2
0
    public virtual void Primary(ref HumanController.InputSample sample)
    {
        this.lastFramePrimary = true;
        sample.crouch         = true;
        sample.walk           = 0f;
        sample.strafe         = 0f;
        sample.jump           = false;
        sample.sprint         = false;
        if (this.bandageStartTime == -1f)
        {
            this.StartBandage();
        }
        float  num      = Time.time - this.bandageStartTime;
        float  progress = Mathf.Clamp((float)(num / base.datablock.bandageDuration), (float)0f, (float)1f);
        string label    = string.Empty;
        bool   flag     = base.datablock.DoesGiveBlood();
        bool   flag2    = base.datablock.DoesBandage();

        if (flag2 && !flag)
        {
            label = "Bandaging...";
        }
        else if (flag2 && flag)
        {
            label = "Bandage + Transfusion...";
        }
        else if (!flag2 && flag)
        {
            label = "Transfusing...";
        }
        RPOS.SetActionProgress(true, label, progress);
        if (progress >= 1f)
        {
            this.FinishBandage();
        }
    }
Example #3
0
    public virtual void Primary(ref HumanController.InputSample sample)
    {
        this.lastFramePrimary = true;
        sample.crouch         = true;
        sample.walk           = 0f;
        sample.strafe         = 0f;
        sample.jump           = false;
        sample.sprint         = false;
        if (this.bandageStartTime == -1f)
        {
            this.StartBandage();
        }
        float  single  = Time.time - this.bandageStartTime;
        float  single1 = Mathf.Clamp(single / (T)this.datablock.bandageDuration, 0f, 1f);
        string empty   = string.Empty;
        bool   flag    = this.datablock.DoesGiveBlood();
        bool   flag1   = this.datablock.DoesBandage();

        if (flag1 && !flag)
        {
            empty = "Bandaging...";
        }
        else if (flag1 && flag)
        {
            empty = "Bandage + Transfusion...";
        }
        else if (!flag1 && flag)
        {
            empty = "Transfusing...";
        }
        RPOS.SetActionProgress(true, empty, single1);
        if (single1 >= 1f)
        {
            this.FinishBandage();
        }
    }
Example #4
0
 public void CancelBandage()
 {
     RPOS.SetActionProgress(false, null, 0f);
     this.bandageStartTime = -1f;
 }