Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: craud on November 09, 2012, 02:27:01 pm

Title: [XP] Characters have shared MP pools.
Post by: craud on November 09, 2012, 02:27:01 pm
Hi,

This system might take a while to explain properly, so bear with me:

Characters don't have individual MP scores. Instead, the party has a shared MP pool that everyone uses. Regardless of who casts the spell, it comes out of the pool. If it's empty, nobody can cast anything.

That's the simple part, and if it stopped there I'd just take a shot at coding it myself, but I want something slightly more in-depth.

What I want is four pools. The spells are divided into four categories (elements, schools, whatever) and each one draws from its corresponding MP pool. So, for example, a character casts Fireball, it costs 5 MP, it's a Fire spell, so the Fire MP pool goes down by 5. Next character does the same thing, reducing it by a further 5. If this goes on for long enough, the Fire MP pool will be exhausted and nobody will be able to use Fire spells of any kind until it's restored.

As for the pools themselves, if they were just held in database variables that would be ideal.

Thanks to anyone who can help me out with this.
Title: Re: [XP] Characters have shared MP pools.
Post by: Apidcloud on November 14, 2012, 09:39:26 pm
I have no time to do it right now, but the idea is pretty easy.
You need 4 actor-global-wide variables, instead of having one mp variable per each. Each skill has a category (rmxp database already has that function, correct?) You could fill every skill with the desired category, and in code, you would just need to decrement the variables according to their category(if's most likely).

Think of the 4 actor-global-wide pools either as a vector with 4 float/int values or as being 4 independent variables. Any of the stated options, would be GameParty Class attributes (accessors).

Hope it helps  :)


Title: Re: [XP] Characters have shared MP pools.
Post by: KK20 on November 14, 2012, 10:16:58 pm
I was thinking of creating 8 accessors in Game_Party (max values and current values) and modify the method can_use_skill?. As for determining what pool each skill draws from, I think that would just be easily checked with the skill's element affinity. After that it would be a matter of modifying the windows to display these 4 values while removing the default actor MP.

Now there are some possible extras such as items that restore MP (to specific pools or all 4 pools) and increasing the pool sizes via items, events, or leveling up through battles. Other things to consider are skills that drain or damage MP (I guess just don't have this feature) and when two or more actors call upon the same elemental skill but there's only enough MP to cast one skill (make it the player's fault for not thinking things through and 'fail' to cast the spell).