-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdice2000_YEP_X_InBattleStatusFanPatch.js
263 lines (252 loc) · 10.5 KB
/
dice2000_YEP_X_InBattleStatusFanPatch.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
//=============================================================================
// dice2000_YEP_X_InBattleStatusFanPatch.js
//=============================================================================
//
// YanflyEnginePluginのバグや仕様をああだこうだする
//
// ----------------------------------------------------------------------------
// NAK a.k.a. 22番目の素数
// [GitHub] : https://github.com/DICE2000
// ----------------------------------------------------------------------------
/*:
* @plugindesc YEPの戦闘内ステータスウィンドウの描画変更
* @author 22番目の素数(NAK)
*
* @param show BS help window
* @text ヘルプウィンドウを表示する
* @desc ヘルプウィンドウの表示を設定します。
* @default false
* @type boolean
*
* @param Select Key UpDown
* @text 上下でページ切替
* @desc カーソルキー上下でもページを切り替えられるようにします。
* @default true
* @type boolean
*
* @param Show MP
* @text MPの表示
* @desc MPを表示します。
* @default true
* @type boolean
*
* @param Show TP
* @text TPの表示
* @desc TPを表示します。
* @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シリーズの下に置いてください。
*
* 上下キーでもキャラクターを切り替えられるようにしました。
*
* ヘルプウィンドウが無内容なのですが
* とりあえずプラグインパラメータでON/OFFできるようにしました。
* (せめて状態異常のヘルプはメモ欄でも参照してくれないと使えない)
*
* ヘルプウィンドウ非表示&上下キー切り替え表示で
* 状態異常のカーソル表示が無効になります。
*
* 絶対に表示されるステータス
* 攻撃力・防御力・魔法攻撃・魔法防御・敏捷性
*
* 表示の有無が切り替えられる
* 運・命中率・物理回避率・魔法回避率
*
* 項目数が多いと二列で描画してくれますが判定はてきとうです
*
* 魔法回避率はデータベースで名前を設定できないので
* プラグインコマンドで設定してください。
*
*/
//グローバルに定義されている変数の存在チェック
var Imported = Imported || {};
var Yanfly = Yanfly || {};
var parameters = PluginManager.parameters('dice2000_YEP_X_InBattleStatusFanPatch');
var paramShowBSHelpWindow = (parameters['show BS help window'] === 'true');
var paramSelectKeyUpDownInBattleStatus = (parameters['Select Key UpDown'] === 'true');
var paramShowMpInBattleStatus = (parameters['Show MP'] === 'true');
var paramShowTpInBattleStatus = (parameters['Show TP'] === 'true');
var paramShowLukInBattleStatus = (parameters['Show luk'] === 'true');
var paramShowHitInBattleStatus = (parameters['Show hit rate'] === 'true');
var paramShowEvaInBattleStatus = (parameters['Show eva rate'] === 'true');
var paramShowMevInBattleStatus = (parameters['Show mev rate'] === 'true');
var paramMevNameInBattleStatus = String(parameters['Mev Name']);
if (Imported.YEP_X_InBattleStatus) {
if (Yanfly.IBS.version) {
if(paramSelectKeyUpDownInBattleStatus){
Window_InBattleStateList.prototype.cursorDown = function(wrap) {
var index = $gameParty.battleMembers().indexOf(this._battler);
var current = index;
index += 1;
index = index.clamp(0, $gameParty.battleMembers().length - 1);
if (current !== index) {
var battler = $gameParty.battleMembers()[index];
this.setBattler(battler);
SoundManager.playCursor();
}
};
Window_InBattleStateList.prototype.cursorUp = function(wrap) {
var index = $gameParty.battleMembers().indexOf(this._battler);
var current = index;
index -= 1;
index = index.clamp(0, $gameParty.battleMembers().length - 1);
if (current !== index) {
var battler = $gameParty.battleMembers()[index];
this.setBattler(battler);
SoundManager.playCursor();
}
};
}
var dice2000_Scene_Battle_commandInBattleStatus = Scene_Battle.prototype.commandInBattleStatus;
Scene_Battle.prototype.commandInBattleStatus = function() {
dice2000_Scene_Battle_commandInBattleStatus.apply(this, arguments);
this._helpWindow.visible = paramShowBSHelpWindow;
};
var Window_InBattleStateList_setBattler = Window_InBattleStateList.prototype.setBattler;
Window_InBattleStateList.prototype.setBattler = function(battler) {
if(!paramShowBSHelpWindow && paramSelectKeyUpDownInBattleStatus){
this._battler = battler;
this._parentWindow.setBattler(battler);
this.refresh();
this.deselect();
if (this._statusWindow) {
var index = $gameParty.battleMembers().indexOf(battler)
this._statusWindow.select(index);
}
}else{
Window_InBattleStateList_setBattler.apply(this, arguments);
}
};
//これはCoreEngineのdrawSimpleStatus
Window_InBattleStatus.prototype.drawActorSimpleStatus = function(actor, x, y, width) {
var lineHeight = this.lineHeight();
var xpad = Window_Base._faceWidth + (2 * Yanfly.Param.TextPadding);
var x2 = x + xpad;
var width2 = Math.max(180, width - xpad - this.textPadding());
this.drawActorName(actor, x, y);
this.drawActorLevel(actor, x, y + lineHeight * 1);
this.drawActorIcons(actor, x, y + lineHeight * 2);
this.drawActorClass(actor, x2, y, width2);
this.drawActorHp(actor, x2, y + lineHeight * 1, width2);
if (paramShowMpInBattleStatus){
this.drawActorMp(actor, x2, y + lineHeight * 2, width2);
}
if (paramShowTpInBattleStatus) {
this.drawActorTp(actor, x2, y + lineHeight * 3, width2);
}
};
Window_InBattleStatus.prototype.refresh = function() {
this.contents.clear();
if (!this._battler) return;
var x = this.standardPadding() + eval(Yanfly.Param.IBSStatusListWidth);
this.drawActorFace(this._battler, x, 0, Window_Base._faceWidth);
var x2 = x + Window_Base._faceWidth + this.standardPadding();
var w = this.contents.width - x2;
this.drawActorSimpleStatus(this._battler, x2, 0, w);
w = this.contents.width - x;
var y = Math.ceil(this.lineHeight() * 4.5);
var h = this.contents.height - y;
//攻撃・防御・魔法攻撃・魔法防御・敏捷性は確定で描画
var number_status = 5;
if(paramShowLukInBattleStatus) number_status++;
if(paramShowHitInBattleStatus) number_status++;
if(paramShowEvaInBattleStatus) number_status++;
if(paramShowMevInBattleStatus) number_status++;
//6項目以上描画する場合
if(number_status > 6){
w = Math.floor(w / 2);
}
for (var i = 2; i < 7; ++i) {
this.drawParam(i, x, y, w, this.lineHeight());
y += this.lineHeight();
}
if(number_status > 6){
x += w;
y = Math.ceil(this.lineHeight() * 4.5);
}
//運
var i = 7;
if(paramShowLukInBattleStatus){
this.drawParam(i, x, y, w, this.lineHeight());
y += this.lineHeight();
}
//命中率
i = 8;
if(paramShowHitInBattleStatus){
this.drawParam(i, x, y, w, this.lineHeight());
y += this.lineHeight();
}
//回避率
i = 9;
if(paramShowEvaInBattleStatus){
this.drawParam(i, x, y, w, this.lineHeight());
y += this.lineHeight();
}
//魔法回避率
//ちなみに10は会心率、11は会心回避率
i = 12;
if(paramShowMevInBattleStatus){
this.drawParam(i, x, y, w, this.lineHeight());
y += this.lineHeight();
}
};
var dice2000_Window_InBattleStatus_drawParam = Window_InBattleStatus.prototype.drawParam;
Window_InBattleStatus.prototype.drawParam = function(paramId, dx, dy, dw, dh) {
if (paramId >= 8){
//命中率、回避率
this.drawDarkRect(dx, dy, dw, dh);
var level = this._battler._buffs[paramId];
var icon = this._battler.buffIconIndex(level, paramId);
this.drawIcon(icon, dx + 2, dy + 2);
dx += Window_Base._iconWidth + 4;
dw -= Window_Base._iconWidth + 4 + this.textPadding() + 2;
this.changeTextColor(this.systemColor());
if(paramId <= 9){
this.drawText(TextManager.param(paramId), dx, dy, dw);
}else{
this.drawText(paramMevNameInBattleStatus, dx, dy, dw);
}
//丸める
var value = Math.round(this._battler.xparam(paramId - 8) * 100);
this.changeTextColor(this.paramchangeTextColor(level));
this.drawText(Yanfly.Util.toGroup(value) + '%', dx, dy, dw, 'right');
}else{
dice2000_Window_InBattleStatus_drawParam.apply(this, arguments);
}
};
} // Yanfly.IBS.version
}; // YEP_X_InBattleStatus
//=============================================================================
// FILE NO OWARI
//=============================================================================