How would I go about doing that ?
I want to make it so instead of increasing TP while taking damage, it instead decreases.
RPG Maker MZ Supportyou'll need a plugin for that.
Look for plugins that provide different TP modes or something similar.
Look for plugins that provide different TP modes or something similar.
What are you doing to give it a starting value to decrease from? If you're using a plugin for that, you should be able to swap the values in there.
Just to make damage subtract instead of add, you'd change this function:
Paste that into a text editor, save as a *.js file, include as a plugin.
Just to make damage subtract instead of add, you'd change this function:
Code:
Game_Battler.prototype.chargeTpByDamage = function(damageRate) {
var value = Math.floor(50 * damageRate * this.tcr);
value = Math.min(value, this.tp);
this.gainSilentTp(-value);
};
Paste that into a text editor, save as a *.js file, include as a plugin.
Thank you this worked to make attacks subtract TP. A one problem however has arised, when the player deals damage the TP still increases while I'd like it not to. Is there a way to make it this way ?
player skills have the TP gain field in the database, they only gain TP if that contains a number greater than zero
And this has worked as well. Is there a way to make it so only specific enemy attacks can lower TP of the player ?
you should have specified that with the first post, because it would require a change to the small plugin above.
and then it depends on how that is changed - one option would be to include elemental damage rate there, then create different elements for TP-damage.
or a few other options, all of them would have to be implemented as changes to the plugin.
and then it depends on how that is changed - one option would be to include elemental damage rate there, then create different elements for TP-damage.
or a few other options, all of them would have to be implemented as changes to the plugin.
Ah I apologize for not mentioning it earlier then. How would I go about modifying the plugin ?
Code:
Game_Battler.prototype.chargeTpByDamage = function(damageRate) {
var value = Math.floor(50 * damageRate * this.tcr);
value = Math.min(value, this.tp);
if (BattleManager._action.item().meta.hurttp)
this.gainSilentTp(-value);
};
That will make it only affect the target's TP if the skill has the <hurttp> notetag.
Thank you very much. Works perfectly. If I want some moves to deal more damage to TP all I gotta do is to change the 50 in " var value = Math.floor(50 * damageRate * this.tcr);" to different numbers right ?
Original thread: https://forums.rpgmakerweb.com/threads/i-want-to-make-it-so-instead-of-increasing-tp-while-taking-damage-it-instead-decreases.160390/