Gain Extra Stats (HP, MP) after each Battle

Gilles

Veteran
Veteran
Joined
Oct 31, 2015
Messages
41
Reaction score
33
First Language
German
GainExtrasAfterBattle

Introduction


With this Plugin it is possible to regain some hp/mp for each actor after the battle. You have many options to choose if dead people should be revived or some actors should not be healed.

Video





Options


- Amount of HP healed in percent- Is the percent taken from the max hp or the current hp

Download

Version 1.3: https://raw.githubusercontent.com/gamedevtutorials/gamedev-learnjs/master/js/plugins/GainExtrasAfterBattle.js


Credit and Thanks
- Gilles
You can use and edit this plugin as you want. This plugin is open for non commercial and commercial use. Just give me a little credit =)

Changelog:

v 1.3:

- Conditional Regain for Classes and Actors (Actors have a higher priority)

v 1.2:

- Conditional Regaining Stats via Switch. Only regain stats if the switch for the actor is on (can be combined with equipment regain) (see the help for example)

- Regain with equipment. You can use a note-tag in your equip to gain hp/mp (see help for more detail)

- Small bugfix with hp heal for dead

v 1.1:

- Plugin Name changed

- MP healing is possible

- Switching HP or MP Healing on/off is possible

- Healing dead can be switched on

- a specific amount for healing dead can be switched on
 
Last edited:

gokuby

Veteran
Veteran
Joined
Nov 2, 2015
Messages
96
Reaction score
14
First Language
German
Primarily Uses
N/A
Nice useful PlugIn, since I need a MP reg as well, I edited it, also I found a little problem with uneven numbers.

/*: * @plugindesc Regains Some HP after each battle * @author Gilles Meyer * * @param useMaxHp * @desc Use Max Hp for regain HP? Else current hp will be used 1:yes 0:no * @default 1 * * @param useMaxMp * @desc Use Max Mp for regain MP? Else current hp will be used 1:yes 0:no * @default 1 * * @param percentageHP * @desc How many percent HP should be healed * @default 10 * * @param percentageMP * @desc How many percent MP should be healed * @default 10 * * @help This plugin does not provide plugin commands. * * */(function() { var parameters = PluginManager.parameters('HealHPAfterBattle'); var useMaxHp = Number(parameters['useMaxHp'] || 1); var percentageHP = Number(parameters['percentageHP'] || 10); var useMaxMp = Number(parameters['useMaxMp'] || 1); var percentageMP = Number(parameters['percentageMP'] || 10);var _Game_Battler_onBattleEnd = Game_Battler.prototype.onBattleEnd;Game_Battler.prototype.onBattleEnd = function() { // Only gain HP if not dead if(!this.isDead()) { var regainHP = this.mhp; var regainMP = this.mmp; if(useMaxHp < 1) { regainHP = this.hp; } if(useMaxMp < 1) { regainMP = this.mp; } var onePercentHP = regainHP/100; var onePercentMP = regainMP/100; var HealHP = Math.round(onePercentHP * percentageHP) var HealMP = Math.round(onePercentMP * percentageMP) this.gainHp(HealHP); this.gainMp(HealMP); } _Game_Battler_onBattleEnd.call(this,arguments);};})();
This one works fine for me, if there are any problems, please let me know.
 
Last edited by a moderator:

SOC

"God is my Judge"
Veteran
Joined
Mar 22, 2012
Messages
555
Reaction score
478
First Language
English
Primarily Uses
RMMV
Can you make it visible with +numbers of how much HP is recovered at the end of the battle during the victory pose on the actors? Can you make this work with MP as well?
 

Halrawk

Veteran
Veteran
Joined
Dec 14, 2012
Messages
97
Reaction score
24
First Language
English
Primarily Uses
I would love to see this added to equipment. So as long as armor X is equipped, you'll regenerate.
 
  • Like
Reactions: SOC

Gilles

Veteran
Veteran
Joined
Oct 31, 2015
Messages
41
Reaction score
33
First Language
German
Can you make it visible with +numbers of how much HP is recovered at the end of the battle during the victory pose on the actors? Can you make this work with MP as well?
Thanks for you suggestion. The MP part is easy. But i tried a bit to show the popup and i'm still stuck there. But im going to solve it :)
 
  • Like
Reactions: SOC

Gilles

Veteran
Veteran
Joined
Oct 31, 2015
Messages
41
Reaction score
33
First Language
German
I would love to see this added to equipment. So as long as armor X is equipped, you'll regenerate.
Your idea is the next one i'm going to implement. Thanks for it :)
 

wrigty12

Veteran
Veteran
Joined
Jan 11, 2014
Messages
533
Reaction score
77
First Language
English
Primarily Uses
Can this also be applied to a state or skill in the future? also, can you use tags on actors to determine who can ignore the effect?
 
  • Like
Reactions: SOC

BloodletterQ

Chaotic Neutral Assassin
Veteran
Joined
Aug 15, 2012
Messages
1,466
Reaction score
1,067
First Language
English
Primarily Uses
N/A
Good to have although the others have good suggestions, even though it isn't necessary for on-touch battles.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,807
Reaction score
12,225
First Language
English
Primarily Uses
RMMV
spoiler:

Code:
[spoiler]stuff goes here[/spoiler]
We have a Site Feedback forum, where you can post "how to do stuff on the site" questions, rather than going off topic in someone's thread.
 
Joined
Mar 9, 2013
Messages
224
Reaction score
25
First Language
Spanish
Primarily Uses
N/A
Also would be good if you do that the dead actors are healed too but either by a different percentage amount or just with 1HP.

Thank you :)
 

Gilles

Veteran
Veteran
Joined
Oct 31, 2015
Messages
41
Reaction score
33
First Language
German
I added a new version. Seems like this plugin is going to be an extra Status After battle plugin after all :D

The new file was added to my first post inclusive a changelog.

I try my best to implement your stuff. Next Progress will be conditional healing for different characters when a character has a specific note.
 

SOC

"God is my Judge"
Veteran
Joined
Mar 22, 2012
Messages
555
Reaction score
478
First Language
English
Primarily Uses
RMMV
Does it show +HP/MP on the actors after the battle yet?

I tried it, but it didn't seem to work for me. I had HP and MP on and set to percentage and also 5% for both, but my actors didn't get any HP or MP back. It was after an evented battle, not a random battle, haven't tried random.
 

Gilles

Veteran
Veteran
Joined
Oct 31, 2015
Messages
41
Reaction score
33
First Language
German
Does it show +HP/MP on the actors after the battle yet?

I tried it, but it didn't seem to work for me. I had HP and MP on and set to percentage and also 5% for both, but my actors didn't get any HP or MP back. It was after an evented battle, not a random battle, haven't tried random.
The heal Popup after victory is a bit tricky so im going to try it on sunday. But have you looked in to your character menu after the fight? It should work like this.

Btw: I will release a new version in a few minutes. Just needs some testing right now.

The next version will include:

- Equip which regains HP or MP after each Battle (Tags in the Equipment Note)

- Conditional Regain: a switch for each character. If the switch is set on, the character will regain hp & mp (if hp and mp is set to on). Can be combined with Equip regain
 
  • Like
Reactions: SOC

SOC

"God is my Judge"
Veteran
Joined
Mar 22, 2012
Messages
555
Reaction score
478
First Language
English
Primarily Uses
RMMV
Yep, I cast a spell for 5 MP that finished the battle and that character still was missing exactly 5 MP at the end when I opened the menu.
 

Gilles

Veteran
Veteran
Joined
Oct 31, 2015
Messages
41
Reaction score
33
First Language
German
Yep, I cast a spell for 5 MP that finished the battle and that character still was missing exactly 5 MP at the end when I opened the menu.
Hmm i tried it with the current version. I casted a spell which costs 40 MP and ended the battle. And my character got 33% back (i set the value to 33)

Can you try the new version please. If it still does not work. could you please show me your plugin options?

-----------

A new version has been release. See the first post! Press like if you like the new features :)
 
Last edited by a moderator:

SOC

"God is my Judge"
Veteran
Joined
Mar 22, 2012
Messages
555
Reaction score
478
First Language
English
Primarily Uses
RMMV
Sure! I updated to the newest version. Can you not include the version number in the plugin name it self, please? It makes it a hassle when we're trying to only update to your newest version and don't need your older versions any more. Instead, you could put the version number at the beginning of the plugin manager description.









 
Last edited by a moderator:

Gilles

Veteran
Veteran
Joined
Oct 31, 2015
Messages
41
Reaction score
33
First Language
German
@SOC: Please rename the js File to GainExtrasAfterBattle.js . I think the RPG Maker is case sensitive. Im going to put the number in the description
 

RogdagoR

Veteran
Veteran
Joined
Oct 1, 2015
Messages
127
Reaction score
29
First Language
Italian
Is it possible to modify the reg value of hp/mp over a class parameter?

For example i rename the Luck parameter(that i don't need) as Regeneration, and the more regeneration i have, the more my character get hp/mp after each battle.
 

gekigengar

Villager
Member
Joined
Oct 27, 2015
Messages
23
Reaction score
5
First Language
English
The heal Popup after victory is a bit tricky so im going to try it on sunday. But have you looked in to your character menu after the fight? It should work like this.

Btw: I will release a new version in a few minutes. Just needs some testing right now.

The next version will include:

- Equip which regains HP or MP after each Battle (Tags in the Equipment Note)

- Conditional Regain: a switch for each character. If the switch is set on, the character will regain hp & mp (if hp and mp is set to on). Can be combined with Equip regain
Tags on equipment note? that's awesome!

Can the tag be used in class note?
 

SOC

"God is my Judge"
Veteran
Joined
Mar 22, 2012
Messages
555
Reaction score
478
First Language
English
Primarily Uses
RMMV
Thanks, it works now, but instead of healing 1.75 MP when she has 35 max MP and 30 MP remaining, it just restored her back to full 35 MP. I have it set to max MP true and 5%.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Writing out an idea for the No Travel Game Jam. I have a general plot and challenge written out, it's just a matter of filling the rest in and making it interesting.
A definite difficult time right now. How is everyone doing during this pandemic? I already have seen furloughs and layoffs.
Hollow 1977 wrote on Archeia's profile.
Hope you and your family are doing well during this difficult time. :)
My elderly neighbor whom I've been buying groceries for just got carried out of his home on a stretcher by guys with hazmat suits. Considering I've been his only point of contact for the past month it's probably safe to say my boss was right to tell me to stay home once I developed a mild cough after all.
Damn. All these new features to the forums. Takes some getting used to.

Forum statistics

Threads
95,642
Messages
930,673
Members
125,962
Latest member
seogenics
Top