Hello.
Am doing a rpg turn based battle system, and currently i am battling the values calculation after i added buffs to the game.
Question:
Is there any code you could share that shows how its already done, or a tutorial on concept how it should be done.
What i would like is the concept, i would build it my self, but what i cant think off is a efficient way to structure this all,
yet so many games achieved this already.
What kind of battle system i am talking about, well think off. One example would be Heroes of might and magic.
They have items, passive bonuses that add values to units. Units have primary hp but gain from specific items and passive bonuses extra hp. This is what trouble me how many variables i need and in what order to calculate hp
Story:
What i have is what i call a Squad that consists of 1 to 6 units. Units have inventory(items add stats) stats(Hit points. Round time(Time until this unit acts), Physical armor, Magical armor, Attack power, Spell power, Spell limit(Spells able to cast per battle)).
When the game starts player gets 2 units and can setup their names,stats,look. Then they are put on a Map where they move on a world map(I am looking intro making a static world that will have stuff happen as you move but this is planed for later later on) in this world map you move square by square. When entering 1 square proximity of a (town, enemy unit ...) you get moved intro a corresponding event(if enemy unit, you are moved intro battle with the "collided" enemy. Or if town you can chose to "shop" or "quests")
If event is battle they are moving intro a battle loop. Where units Round time fills up until its it time to act, units actions consist of (Actions(attack, rest), Buffs(defend, heal), Spells(fire ball, double strike)) Buffs and spells can be acquired by using a spell/buff scroll, or learning at town in exchange for stat point.
And that would be the short intro
when the calculations from stats/item stats are turned intro values for battle and then the problem starts i need to add buff values intro that in mid battle.