-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMoogle_X_EquipSkillSystem_JpAddOn.js
164 lines (143 loc) · 5.53 KB
/
Moogle_X_EquipSkillSystem_JpAddOn.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
//=============================================================================
// Equip Skill System - JP Add-On by Moogle_X
// Moogle_X_EquipSkillSystem_JpAddOn.js
// Created on: November 19th 2015
//=============================================================================
var Imported = Imported || {};
Imported.Moogle_X_EQS_JP = true;
var Moogle_X = Moogle_X || {};
Moogle_X.EQS_JP = Moogle_X.EQS_JP || {};
//=============================================================================
/*:
* @plugindesc v1.2 Replace Equip Limit with Job Points.
* @author Moogle_X
*
* @help
* ============================================================================
* Introduction
* ============================================================================
* This plugin is an add-on for Equip Skill System plugin. You must put this
* plugin below both "Moogle_X_EquipSkillSystem" and "YEP_JobPoints".
*
* What this plugin does is replacing actor's Equip Limit parameter with their
* total Job Points. More Job Points means more access to skills with higher
* Equip Cost.
*
* Some of the original functions from "Moogle_X_EquipSkillSystem" are removed.
* Here is the list of removed features:
*
* 1. Notetags
* <EQS Max Limit x: n>
* <EQS Max Limit x to y: n>
* <EQS Limit Plus: x>
* <EQS Limit Grow: x>
*
* 2. Plugin Command
* EQS Actor x Limit Grow y
*
* ============================================================================
* Terms of Use
* ============================================================================
* Free to use in both commercial and non-commercial project as long as credit
* is given.
*
* ============================================================================
* Change Log
* ============================================================================
* Version 1.2:
* - Compatibility with Equip Skill System plugin v1.4.
*
* Version 1.0:
* - Completed plugin.
*
*
*/
//=============================================================================
(function() { // IIFE
//=============================================================================
// Game_Actor
//=============================================================================
Game_Actor.prototype.totalEqsLimit = function() {
return this.jp();
};
Game_Actor.prototype.addEqsLimit = function(limitIncrease) {
// Empty.
};
Moogle_X.EQS_JP.Game_Actor_setJp = Game_Actor.prototype.setJp;
Game_Actor.prototype.setJp = function(value, classId) {
Moogle_X.EQS_JP.Game_Actor_setJp.call(this, value, classId);
this.refresh();
};
//=============================================================================
// Game_Action
//=============================================================================
Game_Action.prototype.canGrowEqs = function(target) {
if (target.isActor()) {
var slotGrow = this.item().eqsSlotGrow.grow;
var limitGrow = 0; // Changed to 0 for JP compatibility purpose.
return (slotGrow > 0 || limitGrow > 0) ? true : false;
} else {
return false; // Target is not actor.
}
};
Game_Action.prototype.applyEqsLimitGrow = function(target) {
// Empty.
};
//=============================================================================
// Window_EquipSkillPool
//=============================================================================
Window_EquipSkillPool.prototype.drawEquipCost = function(skill, x, y, width) {
if (skill.eqsCost > 0) {
this.drawEquipJpCost(skill, x, y, width, 'right');
}
};
Window_EquipSkillPool.prototype.drawEquipJpCost = function(skill, wx, wy, ww, align) {
var jp = skill.eqsCost;
var icon = '\\i[' + Yanfly.Icon.Jp + ']';
var fmt = Yanfly.Param.JpMenuFormat;
var text = fmt.format(Yanfly.Util.toGroup(jp), Yanfly.Param.Jp, icon);
if (align === 'left') {
wx = 0;
} else if (align === 'center') {
wx += (ww - this.textWidthEx(text)) / 2;
} else {
wx += ww - this.textWidthEx(text);
}
this.drawTextEx(text, wx, wy);
};
//=============================================================================
// Window_EqsLimit
//=============================================================================
Window_EqsLimit.prototype.drawCurrentEqsLimit = function() {
if (this._actor) {
var rect = this.itemRectForText(0);
var wx = rect.width / 2;
this.changeTextColor(this.textColor(Moogle_X.EQS.limitColor));
this.changePaintOpacity(true);
this.drawText(Moogle_X.EQS.limitText, rect.x, rect.y, rect.width);
//this.changeTextColor(this.textColor(Moogle_X.EQS.limitNumberColor))
//var text = this._actor.currentEqsLimit() + "/" + this._actor._eqsMaxLimit;
//this.drawText(text, wx, rect.y, rect.width - wx, 'right');
this.drawCurrentJpLimit(wx, rect.y, rect.width - wx, 'right')
}
};
Window_EqsLimit.prototype.drawCurrentJpLimit = function(wx, wy, ww, align) {
var jp1 = this._actor.currentEqsLimit();
var jp2 = this._actor._eqsMaxLimit;
var jp = jp1 + "/" + jp2;
var icon = '\\i[' + Yanfly.Icon.Jp + ']';
var fmt = Yanfly.Param.JpMenuFormat;
var text = fmt.format(Yanfly.Util.toGroup(jp), Yanfly.Param.Jp, icon);
if (align === 'left') {
wx = 0;
} else if (align === 'center') {
wx += (ww - this.textWidthEx(text)) / 2;
} else {
wx += ww - this.textWidthEx(text);
}
this.drawTextEx(text, wx, wy);
};
})(); // IIFE
//=============================================================================
// End of File
//=============================================================================