-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdice2000_YEP_EquipCoreFanPatch.js
More file actions
188 lines (180 loc) · 7.31 KB
/
dice2000_YEP_EquipCoreFanPatch.js
File metadata and controls
188 lines (180 loc) · 7.31 KB
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
//=============================================================================
// dice2000_YEP_EquipCoreFanPatch.js
//=============================================================================
//
// YanflyEnginePluginのバグや仕様をああだこうだする
//
//
// ----------------------------------------------------------------------------
// NAK a.k.a. 22番目の素数
// [GitHub] : https://github.com/DICE2000
// ----------------------------------------------------------------------------
/*:
* @plugindesc YEPのEquipCore導入時の比較ウィンドウ変更
* @author 22番目の素数(NAK)
*
* @param Show HP and MP
* @text HPとMPの表示
* @desc 装備変更時にHPとMPを比較表示します。
* @default true
* @type boolean
*
* @param Show luk
* @text 運の表示
* @desc 装備変更時に運の値を比較表示します。
* @default true
* @type boolean
*
* @param Show hit rate
* @text 命中率の表示
* @desc 装備変更時に命中率を比較表示します。
* @default false
* @type boolean
*
* @param Show eva rate
* @text 回避率の表示
* @desc 装備変更時に回避率を比較表示します。
* @default false
* @type boolean
*
* @param Show mev rate
* @text 魔法回避率の表示
* @desc 装備変更時に魔法回避率を比較表示します。
* @default false
* @type boolean
*
* @param Mev Name
* @text 魔法回避率の名前
* @desc 魔法回避率の名前を設定します。
* @default 魔法回避率
* @type string
*
* @help このスクリプトはYEPシリーズの下に置いてください。
*
* 装備変更時のウィンドウに表示されるステータスを変更するプラグインです。
* ・HPとMPは要らない(ゲージ描画でわかる)
* ・回避率を表示したい
* という需要が自分にあったので作りました。
*
*/
//グローバルに定義されている変数の存在チェック
var Imported = Imported || {};
var Yanfly = Yanfly || {};
var parameters = PluginManager.parameters('dice2000_YEP_EquipCoreFanPatch');
var paramShowHpMpInEquip = (parameters['Show HP and MP'] === 'true');
var paramShowLukInEquip = (parameters['Show luk'] === 'true');
var paramShowHitInEquip = (parameters['Show hit rate'] === 'true');
var paramShowEvaInEquip = (parameters['Show eva rate'] === 'true');
var paramShowMevInEquip = (parameters['Show mev rate'] === 'true');
var paramMevNameInEquip = String(parameters['Mev Name']);
if (Imported.YEP_EquipCore) {
if (Yanfly.Equip.version) {
Window_StatCompare.prototype.refresh = function() {
this.contents.clear();
if (!this._actor) return;
var y = 0;
//HPとMPの表示がある場合
if(paramShowHpMpInEquip){
for (var i = 0; i < 7; ++i) {
this.drawItem(0, this.lineHeight() * i, i);
}
y = 7;
}else{
//攻撃・防御・魔攻・魔防・敏捷
for (var i = 2; i < 7; ++i) {
this.drawItem(0, this.lineHeight() * (i - 2), i);
}
y = 5;
}
var ItemId = 7;
if(paramShowLukInEquip){
this.drawItem(0, this.lineHeight() * y, ItemId);
y++;
}
var ItemId = 8;
if(paramShowHitInEquip){
this.drawItem(0, this.lineHeight() * y, ItemId);
y++;
}
var ItemId = 9;
if(paramShowEvaInEquip){
this.drawItem(0, this.lineHeight() * y, ItemId);
y++;
}
var ItemId = 12;
if(paramShowMevInEquip){
this.drawItem(0, this.lineHeight() * y, ItemId);
y++;
}
};
Window_StatCompare.prototype.drawParamName = function(y, paramId) {
var x = this.textPadding();
this.changeTextColor(this.systemColor());
if(paramId === 12){
this.drawText(paramMevNameInEquip, x, y, this._paramNameWidth);
}else{
this.drawText(TextManager.param(paramId), x, y, this._paramNameWidth);
}
};
Window_StatCompare.prototype.drawCurrentParam = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._paramValueWidth * 2 + this._arrowWidth + this._bonusValueWidth;
this.resetTextColor();
var actorparam = 0;
var str_percent = '';
if(paramId >= 8){
str_percent = '%';
var value = this._actor.xparam(paramId - 8) * 100;
actorparam = Yanfly.Util.toGroup(value);
}else{
actorparam = Yanfly.Util.toGroup(this._actor.param(paramId));
}
this.drawText(actorparam + str_percent, x, y, this._paramValueWidth, 'right');
};
Window_StatCompare.prototype.drawNewParam = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._paramValueWidth + this._bonusValueWidth;
var newValue = 0;
var diffvalue = 0;
var str_percent = '';
if(paramId >= 8){
str_percent = '%';
newValue = this._tempActor.xparam(paramId - 8) * 100;
diffvalue = newValue - this._actor.xparam(paramId - 8) * 100;
}else{
newValue = this._tempActor.param(paramId);
diffvalue = newValue - this._actor.param(paramId);
}
var actorparam = Yanfly.Util.toGroup(newValue);
this.changeTextColor(this.paramchangeTextColor(diffvalue));
this.drawText(actorparam + str_percent, x, y, this._paramValueWidth, 'right');
};
Window_StatCompare.prototype.drawParamDifference = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._bonusValueWidth;
var newValue = 0;
var diffvalue = 0;
var str_percent = '';
if(paramId >= 8){
newValue = this._tempActor.xparam(paramId - 8) * 100;
diffvalue = newValue - this._actor.xparam(paramId - 8) * 100;
}else{
newValue = this._tempActor.param(paramId);
diffvalue = newValue - this._actor.param(paramId);
}
if (diffvalue === 0) return;
var actorparam = Yanfly.Util.toGroup(newValue);
this.changeTextColor(this.paramchangeTextColor(diffvalue));
var text = Yanfly.Util.toGroup(diffvalue);
if (diffvalue > 0) {
text = ' (+' + text + ')';
} else {
text = ' (' + text + ')';
}
this.drawText(text, x, y, this._bonusValueWidth, 'left');
};
} // Yanfly.Equip.version
}; // YEP_EquipCore
//=============================================================================
// FILE NO OWARI
//=============================================================================