forked from MoogleX/MV_Plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMoogle_X_ConstantMpCost.js
73 lines (64 loc) · 2.76 KB
/
Moogle_X_ConstantMpCost.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//=============================================================================
// Constant MP Cost by Moogle_X
// Moogle_X_ConstantMpCost.js
// Created on: October 30th 2015
//=============================================================================
var Imported = Imported || {};
Imported.Moogle_X_ConstantMpCost = true;
var Moogle_X = Moogle_X || {};
Moogle_X.ConstMp = Moogle_X.ConstMp || {};
//=============================================================================
/*:
* @plugindesc v1.00 All skills have constant MP cost whenever a certain
* in-game switch is ON.
* @author Moogle_X
*
* @param Constant MP Cost
* @desc Whenever the predetermined in-game switch is ON. All skills's MP Cost
* becomes this number.
* @default 0
*
* @param Special Switch ID
* @desc Decide on your in-game switch id number here.
* @default 1
*
* @help
* ============================================================================
* Introduction
* ============================================================================
* This is pretty much my first JS plugin attempt.
* What it does is pretty simple. You can create some sort of common event
* that turn on the special in-game switch. As long as that switch is ON,
* all skills' MP cost become a certain amount (you decide).
* This could be useful for some unique and creative skills like field effect
* or something.
*
* IMPORTANT NOTE!
* It doesn't affect normal attack's MP cost (skill #1 in database).
* It doesn't affect guard's MP cost (skill #2 in database).
* Enemy skills' MP cost are affected too.
*/
//=============================================================================
(function() { // IIFE
//=============================================================================
// Parameter Variables
//=============================================================================
var parameters = PluginManager.parameters('Moogle_X_ConstantMpCost');
var constantMpCost = Number(parameters['Constant MP Cost'] || '0');
var specialSwitchID = Number(parameters['Special Switch ID'] || '0');
//=============================================================================
// Game_BattlerBase
//=============================================================================
Moogle_X.ConstMp.Game_BattlerBase_skillMpCost =
Game_BattlerBase.prototype.skillMpCost;
Game_BattlerBase.prototype.skillMpCost = function(skill) {
if ($gameSwitches.value(specialSwitchID) && skill.id !== 1 && skill.id !== 2) {
return constantMpCost;
} else { // if
return Moogle_X.ConstMp.Game_BattlerBase_skillMpCost.call(this,skill);
} // else
};
})(); // IIFE
//=============================================================================
// End of File
//=============================================================================