Best way to make a NumbericUpDown take 5 from an int if over alotted amount of use, and give back the exact amount if number goes down
<p>This is going to be a rather long one to explain, but it's really just a logic question.</p>

<p>I've got a program that allows for a player to create a character with 7 points in a primary stack of attributes, 5 in a secondary, and 3 in a tertiary. Each stack has 3 NumbericUpDowns and can no higher than 5. (total of 9 NumbericUpDowns)</p>

<p>The player can spend either 7, 5, or 3 points in either of the 3 stacks, spread between any of the 3 numbericupdowns. After the 7, 5, and 3 are spent, if they player wishes to increase that stat further he can use "Freebie points".</p>

<p>Problem: I need a way that when the player adds more than his alotted points to his stats, it automatically draws from his "Freebie Points" variable until it is depleted.</p>

<p>Problem: I need a way that the player gets those "Freebie Points" back if he reduces the stat again.</p>

<p>Problem: I need to make sure the player can't break this system using logic.</p>

<p>Here is the current snippet of code.</p>

<pre><code>    private void freebie_spend_method()
    {
        //Mental Freebies
        if (attribute_spent_mental_dots &gt; attribute_mental_dots)
        {
            freebie -= 5;

        }
        else if (attribute_spent_mental_dots &lt; attribute_mental_dots)
        {
            freebie += 5;

        }
        //Physical Freebies
        if (attribute_spent_physical_dots &gt; attribute_physical_dots)
        {
            freebie -= 5;

        }
        else if (attribute_spent_physical_dots &lt; attribute_physical_dots)
        {
            freebie += 5;
        }
</code></pre>

<p>I already know how HORRIBLE an idea the above code is, why I'm trying to figure out how to do it best, unfortunately, the proper logic has been escaping me for the past week.</p>

<p>For those of you who play, this is obviously a WoD attribute set. So using classic World of Darkness rules, I need this system to be able to automatically take away and put back the players Freebie Points while they fiddle around.</p>

<p>Thank you for your time</p>
