Adding an ammo mechanic?

Hi everyone,

been thinking about adding a mechanic where the number of bullets left in the chamber would affect the skills available, but at the same time I'd like to keep using stamina as my main feature.

I came up with the idea of having MaxMP of every character set to 0, rename mana ''Ammo'', have each gun +X MaxMP. Then set each fight to heal full MP for each character at the beginning of every fight to represent a full magazine. Then each ''shooting'' skill would use up X MP and once MP hits 0 the character needs to ''reload'' for one turn to regain full MP the next turn.

I thought that I may check all actors for MP at the beginning of each turn, if it's equal to 0% then apply a state called ''Reloading''. That would limit the´skills available by locking some types. Then as the state goes away automatically at the start of next turn, I'd set MP to 100%.

I'm not sure how I'd implement i though, how do I apply the state at 0% MP? How do I heal MP when the state goes away? Also, is there a way to change the duration of the ''reloading'' state depending on the weapon type? As in minigun 2 turns, pistol 1 turn, etc.

Thanks in advance.
Why would you automatically set MP to 100%? If the character is using something else than your Reload skill (Guard, for example), he would get a free reload this way, or not?


You can do probably do this with a troop event that runs at the start of each turns, checks each actor and adds/removes the state if the character has 0 MP/1 or more MP.


You could use Yanfly's script so you don't have to add this event to every troop: https://yanflychannel.wordpress.com/rmvxa/utility-scripts/base-troop-events/


/edit: I somehow skipped the last few sentences. But you could have multiple Reload skills, which are learned by equipping the weapons, which add a X turn stun on use (X = turns needed for reload).
I was thinking about doing this for a game, but had no idea how to implement it.

This is a good idea and seems relatively simple.
I would need to double check but I think you could also tie it to variables for each character and have the skills check themselves against what the variable currently is...

Original thread: https://forums.rpgmakerweb.com/threads/adding-an-ammo-mechanic.40525/