Forastero

Villager
Member
Joined
Aug 3, 2015
Messages
7
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
Hi.
I'm trying to create a skill in MZ with a conditional MP cost based on the target applied status.

In short:
The skill A has a 10 MP cost, but if the target has the Poison state, then the cost will be zero.

I tried config this with my limited coding skill, but have no success. :frown:
Someone knows how to do this?

Ps: I'm currently using the VisuStella Core plugins.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,503
Reaction score
8,144
First Language
German
Primarily Uses
RMMV
there is a simple way to do this even without a plugin, if you allow for a slight limitation:
have the skill cost always be 10 MP (set in the database) and refund 10 MP by damage formula coding if the target is found to have that state.

The limitation is that this only works for single-target-skills, because a multiple-target-skill would have the risk of refunding multiple times.
 

Forastero

Villager
Member
Joined
Aug 3, 2015
Messages
7
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
there is a simple way to do this even without a plugin, if you allow for a slight limitation:
have the skill cost always be 10 MP (set in the database) and refund 10 MP by damage formula coding if the target is found to have that state.

The limitation is that this only works for single-target-skills, because a multiple-target-skill would have the risk of refunding multiple times.

Thanks for the quick response.
Yeah, that's a problematic limitation, cause I intended to create multiple-target skills.
Other limitation would be if the user has no MP, he couldn't use the skill. :frown:
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,167
Reaction score
7,371
First Language
Indonesian
Primarily Uses
RMVXA
cause I intended to create multiple-target skills.
Then you don't explain if ANY or ALL of the target has the state. Your explanation is for a single target attack.
 

Forastero

Villager
Member
Joined
Aug 3, 2015
Messages
7
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
I was able to solve my problem using damage formula:

if ( b.isStateAffected(4) ) { a.atk * 1.25; } else { a.gainMp(-50); a.atk * 1.25; }

And in the database, I set the skill to zero MP cost.

However, when the MP is deducted there is a "MP damage" popup. I'll try to hide it.
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
474
Reaction score
687
First Language
German
Primarily Uses
RMMV
@Forastero But wouldn't the skill then be able to be used at 0 MP? Players could cheat the system in that case.
 

Forastero

Villager
Member
Joined
Aug 3, 2015
Messages
7
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
@Forastero But wouldn't the skill then be able to be used at 0 MP? Players could cheat the system in that case.

Thanks for the reply!

Actually, thats more or less my intention. :D
In my game the MP is replaced by stamina, and the "stamina cost" refers to "the difficulty to overcome the enemy defense".

The status that I want to check refers to the "defense exposure".
So, if the target has that status, there is no defense to overcome, then the character will not use stamina to perform the skill.

Btw, the players wouldnt be able to abuse this system because that status does not occur frequently.

Basically that.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,503
Reaction score
8,144
First Language
German
Primarily Uses
RMMV
if ( b.isStateAffected(4) ) { a.atk * 1.25; } else { a.gainMp(-50); a.atk * 1.25; }
but this will have the same problem as my solution with multiple targets as the damage formula gets executed on every target.
 

Forastero

Villager
Member
Joined
Aug 3, 2015
Messages
7
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
but this will have the same problem as my solution with multiple targets as the damage formula gets executed on every target.

I noticed that too.

So, I ll have to adapt to that. o_O
 

Latest Threads

Latest Posts

Latest Profile Posts

Alisa: Prophecy of the Falling Stars. Join Alisa, a quiet girl with a heart filled with love and hope, on her journey to prevent a calamity. My next RPG Maker music pack is my largest and most focused pack yet. It's a musical story that focuses on a young heroine named Alisa who has been assigned the ultimate task to prevent a calamity.

SnJj_O.png
Alien Worlds, Minecraft Blocks, Extend Options, Fine Speed Control, Art by Muggu | RPG Maker News #33

Rest in Peace vlog gun...
vloggunsmallface.png
Another unnamed character, and probably last one for now.
She's a dragon girl inspired by fafnir dragon. as always, name suggestion is welcomed.
Dragon_Girl.jpg

Dragon_Girl_1.png

Forum statistics

Threads
111,164
Messages
1,058,885
Members
144,408
Latest member
Bretzel68440
Top