Hello.
I’ve been making a game that uses spells. However, these spells require what I call mana. Now, to charge your mana, you must acquire it, and once you first acquire it, it is intended to be slow.
But the catch this, you can train how fast your mana charges by charging it fully many times.
This training process will be a long process, but over the course of 1000 max charges, you will have a very fast charge.
I have attempted to make a base of what is needed, however, I don’t have a good idea on how to proceed.
What I am basically trying to do is get an interger between the values 0.25 and 2, by using the amount of charges that a player has, which is 1 to 1000.
local BASE_MANA_CHARGE = .25
local MAX_MANA_CHARGE = 2
local function calculateChargeVal()
local fullCharges = playerData.FullCharges.Value
local total = BASE_MANA_CHARGE
local startingNum = fullCharges == 0 and BASE_MANA_CHARGE or fullCharges
total = (startingNum - BASE_MANA_CHARGE) / (MAX_MANA_CHARGE - BASE_MANA_CHARGE)
-- process of getting total charge amount here
total = math.clamp(total, BASE_MANA_CHARGE, MAX_MANA_CHARGE)
return total
end
Please tell me if there’s anything that is confusing.
