https://www.youtube.com/watch?v=VdrTA5Lv_Rc
// アクターのすべてのステータスを表示するメソッド
Window_StatusBase.prototype.drawActorParameter = function(x, y, width) {
const lineHeight = this.lineHeight();
const attack_dr = $gameParty.leader().atk; // 攻撃力
const defense_dr = $gameParty.leader().def; // 防御力
const magicAttack_dr = $gameParty.leader().mat; // 魔法力
const magicDefense_dr = $gameParty.leader().mdf; // 魔法防御
const agility_dr = $gameParty.leader().agi; // 敏捷性
const luck_dr = $gameParty.leader().luk; // 運
const params = [
{ name: "攻撃力", value: attack_dr },
{ name: "防御力", value: defense_dr },
{ name: "魔法力", value: magicAttack_dr },
{ name: "魔法防御", value: magicDefense_dr },
{ name: "敏捷性", value: agility_dr },
{ name: "運", value: luck_dr }
];
params.forEach((param, index) => {
const paramText = `${param.name}:${param.value}`;
this.drawText(paramText, x, y + lineHeight * index, width, 'left');
});
};
Window_StatusBase.prototype.drawActorDetails = function(x, y, width) {
const lineHeight = this.lineHeight();
const actor_dr = $gameParty.leader(); // パーティーリーダーを取得
// 表示したい情報を配列にまとめる
const details = [
{ label: "職業", value: actor_dr.currentClass().name },
{ label: "二つ名", value: actor_dr.nickname() },
{ label: "現在の経験値", value: actor_dr.currentExp() - actor_dr.currentLevelExp() },
{ label: "次のレベルまで", value: actor_dr.nextRequiredExp() || '---' } // nextRequiredExpがundefinedの場合は'---'と表示
];
// 配列をループして、各情報を画面に表示
details.forEach(detail => {
this.drawText(`${detail.label}:${detail.value}`, x, y, width, 'left');
y += lineHeight; // 次の項目を表示する位置を下げる
});
};
Window_StatusBase.prototype.drawActorEquips = function(x, y, width) {
const lineHeight = this.lineHeight();
const actor_dr = $gameParty.leader(); // パーティーリーダーを取得
const equips = actor_dr.equips(); // 装備品の配列を取得
const equipTypes = ["武器", "盾", "頭", "身体", "装飾品"];
equipTypes.forEach((type, index) => {
// 装備品があればその名前を、なければ「なし」と表示
const equipName = equips[index] ? equips[index].name : "なし";
this.drawText(`${type}:${equipName}`, x, y, width, 'left');
y += lineHeight; // 次の項目を表示する位置を下げる
});
};
Window_StatusBase.prototype.exDrawActorSimpleStatus = function(actor, x, y, width) {
console.log(actor.atk); // アクターの攻撃力をログに出力
const lineHeight = this.lineHeight();
if (actorNameLH > -1) this.drawActorName(actor, x + actorNameX, y + lineHeight * actorNameLH, width - actorNameX);
if (actorLevelLH > -1) this.drawActorLevel(actor, x + actorLevelX, y + lineHeight * actorLevelLH);
if (actorIconLH > -1) this.drawActorIcons(actor, x + actorIconX, y + lineHeight * actorIconLH, width - actorIconX);
if (actorClassLH > -1) this.drawActorClass(actor, x + actorClassX, y + lineHeight * actorClassLH, width - actorClassX);
if (actorGaugeLH > -1) this.placeBasicGauges(actor, x + actorGaugeX, y + lineHeight * actorGaugeLH);
this.drawActorParameter(8, 250 + lineHeight * 1, width);
this.drawActorDetails(250,0 + lineHeight * 1, width);
this.drawActorEquips(250 ,250 + lineHeight * 1, width);
};統計データ: Posted by DoujinRuis — 2024年4月06日(土) 20:51
]]>