StatusValue.SetValue C# (CSharp) Method

SetValue() public method

public SetValue ( int val, bool checkDeath, bool checkLevelUp, bool showText ) : void
val int
checkDeath bool
checkLevelUp bool
showText bool
return void
    public void SetValue(int val, bool checkDeath, bool checkLevelUp, bool showText)
    {
        if(this.owner.CanChangeStatusValue(this.realID))
        {
            if(showText)
            {
                int add = val - this.currentValue;
                if(add < 0 && this.subText.active)
                {
                    if(this.subText.IsShowNumber()) this.subText.ShowNumber(-add, this.owner);
                    else this.subText.ShowText((-add).ToString(), this.owner);
                }
                else if(add >= 0 && this.addText.active)
                {
                    if(this.addText.IsShowNumber()) this.addText.ShowNumber(add, this.owner);
                    else this.addText.ShowText(add.ToString(), this.owner);
                }
            }
            this.currentValue = val;
            this.CheckBounds(checkDeath, checkLevelUp);
        }
        else
        {
            DataHolder.BattleSystemData().blockTextSettings.ShowText("", this.owner);
        }
    }