-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathMrTS_MinimumDamage.js
35 lines (31 loc) · 1.28 KB
/
MrTS_MinimumDamage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//==============================================================================
// MrTS_MinimumDamage.js
//==============================================================================
/*:
* @plugindesc Changes minimum damage from 0.
* @author Mr. Trivel
*
* @param Minimum Damage
* @desc Minimum Damage possible.
* @default 1
*
* @help
* --------------------------------------------------------------------------------
* Terms of Use
* --------------------------------------------------------------------------------
* Don't remove the header or claim that you wrote this plugin.
* Credit Mr. Trivel if using this plugin in your project.
* Free for commercial and non-commercial projects.
* --------------------------------------------------------------------------------
* Version 1.1
* --------------------------------------------------------------------------------
*/
(function() {
var parameters = PluginManager.parameters('MrTS_DamagePostfix');
var minDamage = Number(parameters['Minimum Damage'] || 1);
var _Game_Action_makeDamageValue = Game_Action.prototype.makeDamageValue;
Game_Action.prototype.makeDamageValue = function(target, critical) {
var value = _Game_Action_makeDamageValue.call(this, target, critical);
return (value >= 0 ? Math.max(value, minDamage) : value);
};
})();