[RMMV] Potion/Elixir effect help

bonanzaa

Just swinging by
Member
Joined
Jul 1, 2020
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello there.

Am trying to implement potion/elixir system in the game, which does exactly what it needs to - various potions grant various effects.
Though I've encountered a problem - let's say player can buy a very strong potion that grants them +1000 HP (a lot). Well now, player can just keep using it to (virtually) infinitely increase their MHP.

So is there a way (through states, I believe, but I haven't figured it out) to limit the number of a certain potion type effects that can be active at once.

Example: If player uses this "Potion of +1000HP" (which wears off in 10 turns), they can't get this buff again if they use another "Potion of +1000HP". So that they can't stack up HP infinitely. And so on for various effects, just so that 1 certain potion effect could be active at one time.

Would appreciate any help, thanks in advance.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
378
Reaction score
148
First Language
english
Primarily Uses
RMMV
how are you having this potion increase MaxHP by flat value? event? whats removing this flat increase?
why cant it be state with MHP % increase? same state doesn't stack on itself (normally) just overwrites.
 

bonanzaa

Just swinging by
Member
Joined
Jul 1, 2020
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
how are you having this potion increase MaxHP by flat value? event? whats removing this flat increase?
why cant it be state with MHP % increase? same state doesn't stack on itself (normally) just overwrites.
1) Well, I'm yet to figure it out, how to make a potion increase MHP of the user. I don't know which way it is better, I'm currently looking through YEP Buff&States Core for some help in the notetags
2)Potion state gets removed after a certain amount of turns, as it is in the state removal conditions.
3) I really need this HP buff to be a certain number, rather then MHP% increase
 

bonanzaa

Just swinging by
Member
Joined
Jul 1, 2020
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
1596365069360.png
This is a perfect example of the effect I am trying to achieve
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
378
Reaction score
148
First Language
english
Primarily Uses
RMMV
i think the custom apply and custom leave tags could do this but in clueless with those "code" scriptings.

(im using absorption barrier for a different temp MHP system)
 

bonanzaa

Just swinging by
Member
Joined
Jul 1, 2020
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
i think the custom apply and custom leave tags could do this but in clueless with those "code" scriptings.

(im using absorption barrier for a different temp MHP system)
Thanks for the reply.
But I couldn't make "user.maxhp" work. I am not that familiar with JS. Any suggestions?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,379
Reaction score
1,558
First Language
English
Primarily Uses
RMMV
Code:
<Custom Apply Effect>
if (!user._flaskEffectActive) {
  user.addParam(0, 1000);
  user._flaskEffectActive = true;
}
</Custom Apply Effect>
<Custom Remove Effect>
  user.addParam(0, -1000);
  delete user._flaskEffectActive;
</Custom Remove Effect>
The good thing with this is you can use the same _flaskEffectActive flag in other flask items and only one will be able to be active at a time.
 

bonanzaa

Just swinging by
Member
Joined
Jul 1, 2020
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
Code:
<Custom Apply Effect>
if (!user._flaskEffectActive) {
  user.addParam(0, 1000);
  user._flaskEffectActive = true;
}
</Custom Apply Effect>
<Custom Remove Effect>
  user.addParam(0, -1000);
  delete user._flaskEffectActive;
</Custom Remove Effect>
The good thing with this is you can use the same _flaskEffectActive flag in other flask items and only one will be able to be active at a time.
Wow, thank you so much! It works beautifully. Really great.

From what i could gather, if I add this:
Code:
var ACTORID = 1;
var rhp = 100;
var recoverhp = Math.round($gameActors.actor(ACTORID).mhp * rhp / 100);
$gameParty.leader().gainHp(recoverhp);
when the flask is being applied, then it will also heal the user to 100%HP, correct?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,379
Reaction score
1,558
First Language
English
Primarily Uses
RMMV
You could just do

Code:
var actor = $gameParty.leader();
actor.gainHp(actor.mhp);
 

bonanzaa

Just swinging by
Member
Joined
Jul 1, 2020
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
You could just do

Code:
var actor = $gameParty.leader();
actor.gainHp(actor.mhp);
Thank you very much.
One more question - is there a way to get the "var" value of other members in party, besides the leader?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,379
Reaction score
1,558
First Language
English
Primarily Uses
RMMV
$gameParty.members()[index] or $gameParty.aliveMembers()[index]
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Currently without internet due to storm damage and most of our state is devastated. No idea how long I'll be unable to log onto here, but I'll answer questions as soon as I can.
This is supposed to be pso2 photon blast inspired animation
I'm sure this question's been asked before, but I can't find an answer: is there any way to run the Steam version of RPGMaker *without* being logged into Steam? It's a frustrating extra step sometimes.
Been seeing bright flashes in the sky for a while, and thought it was my eyes playing tricks on me. Nope! Lightning. Now it's raining heavily. Seeing lightning, but not hearing thunder, is weird.
Small Update for myself:
>Two Dungeon maps are done, Dungeon 3 is in progress. Dungeon 4 needs work.
>4 characters set up out of a possible 6 but those come later.
>Hub area needs work.
>Game completion..., 20-25% maybe?

Forum statistics

Threads
100,713
Messages
978,670
Members
132,329
Latest member
mdealba92
Top