お疲れ様ですにゃ。
やりたい事は分かりましたにゃ。ただその場合、ねこ様の設計がWindow_EquipStatusの仕様の相性が悪いにゃ。
Window_EquipStatusは、装備した前のユーザーデータ(this._actor)と、装備した後のユーザーデータ(this._tempActor)を用意して、それぞれdrawCurrentActorとdrawNewParamで描画する仕様にゃ。
ねこ様のdrawCurrentParamを見る限り、設置した追加パラメーターが各ユーザーデータと紐づいていにゃいにゃ。($系は全ゲーム、全アクターでの共有ですにゃ)
これでは装備した後の追加パラメーターを表示する事は難しいにゃ…
変数名から何をしようとしてるのかを読み取ってコードを書き換えてみるとこうにゃるにゃ。
コード: 全て選択
Window_EquipStatus.prototype.drawCurrentParam = function(x, y, paramId) {
this.resetTextColor();
var mainWeapon = this._actor.equips()[0];
var sideWeapon = this._actor.equips()[1];
this.drawText(mainWeapon ? mainWeapon.params[2] : 0, x, 36, 48, 'right'); //$gameBaseStr = 主武器攻撃力?
this.drawText(sideWeapon ? sideWeapon.params[2] : 0, x, 72, 48, 'right'); //$gameOffPower = サブ武器攻撃力?
this.drawText(mainWeapon ? mainWeapon.params[3] : 0, x, 108, 48, 'right'); //$gameBaseDef = 主武器防御力?
this.drawText(sideWeapon ? sideWeapon.params[3] : 0, x, 144, 48, 'right'); //$gameDefPower = サブ武器防御力?
this.drawText(this._actor.mhp, x, 180, 48, 'right'); //$gameMaxHp = 最大HP?
this.drawText(this._actor.hp, x, 216, 48, 'right'); //$gameCurrentHp = 現在HP?
};
コード: 全て選択
Window_EquipStatus.prototype.drawNewParam = function(x, y, paramId) {
this.resetTextColor();
var mainWeapon = this._tempActor.equips()[0];
var sideWeapon = this._tempActor.equips()[1];
this.drawText(mainWeapon ? mainWeapon.params[2] : 0, x, 36, 48, 'right'); //$gameBaseStr = 主武器攻撃力?
this.drawText(sideWeapon ? sideWeapon.params[2] : 0, x, 72, 48, 'right'); //$gameOffPower = サブ武器攻撃力?
this.drawText(mainWeapon ? mainWeapon.params[3] : 0, x, 108, 48, 'right'); //$gameBaseDef = 主武器防御力?
this.drawText(sideWeapon ? sideWeapon.params[3] : 0, x, 144, 48, 'right'); //$gameDefPower = サブ武器防御力?
this.drawText(this._tempActor.mhp, x, 180, 48, 'right'); //$gameMaxHp = 最大HP?
this.drawText(this._tempActor.hp, x, 216, 48, 'right'); //$gameCurrentHp = 現在HP?
};
各パラメーターが何を意味しているのかはこちらの推測にゃのでミスしている可能性が高いにゃ。その場合はそのパラメーターの意味合いを教えてくださいにゃ。
また、どうしてもswitch caseでやらにゃきゃいけにゃい理由があるにゃら止めはしませんにゃ。
その場合は「選択された武器ID」の部分で前に話した
コード: 全て選択
this._tempActor.equips()[0]._itemId
をお使いくださいにゃ。