| 赞 | 0 |
| VIP | 0 |
| 好人卡 | 0 |
| 积分 | 1 |
| 经验 | 0 |
| 最后登录 | 2026-6-4 |
| 在线时间 | 22 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 82
- 在线时间
- 22 小时
- 注册时间
- 2026-5-1
- 帖子
- 2
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
// Declare Constants
const lineHeight = this.lineHeight();
const actor = this._actor;
const padding = this.itemPadding();
const labelFmt = '\\C[16]%1: \\C[0]%2';
const traitType1 = DataManager.traitSetType('Element');
const traitSet1 = actor.traitSet('Element');
const traitType2 = DataManager.traitSetType('SubElement');
const traitSet2 = actor.traitSet('SubElement');
const traitHeight = (this.innerHeight / Math.max(Window_StatusData.traitCol1.length, Window_StatusData.traitCol2.length)) - lineHeight;
let x = 0;
let y = 0;
let width = this.innerWidth / 2;
// Draw Actor Graphic
this.drawActorGraphic(0, width);
// Draw Element Trait Sets
if (traitType1.Visible || traitType2.Visible) {
this.drawItemDarkRect(x, y, width, lineHeight, 2);
this.drawItemDarkRect(width, y, width, lineHeight, 2);
if (traitType1.Visible) {
this.drawTextEx(labelFmt.format(traitType1.Label, traitSet1.Display), padding, y, width - padding * 2);
}
if (traitType2.Visible) {
this.drawTextEx(labelFmt.format(traitType2.Label, traitSet2.Display), width + padding, y, width - padding * 2);
}
y += lineHeight;
this.setDescriptionFontSizeToTraitSet();
this.drawItemDarkRect(x, y, width, traitHeight);
this.drawItemDarkRect(width, y, width, traitHeight);
if (traitType1.Visible) {
this.drawTextEx(traitSet1.Description, padding, y, width - padding * 2);
}
if (traitType2.Visible) {
this.drawTextEx(traitSet2.Description, width + padding, y, width - padding * 2);
}
this.resetDescriptionFontSize();
this.resetFontSettings();
y += traitHeight;
}
const topY = y;
// Prepare Elemental Data
const elementCol1 = this.getElementIDsCol1();
const elementCol2 = this.getElementIDsCol2();
let columnData;
if (elementCol2.length > 0) {
columnData = ['Resist','Resist','Bonus','Bonus'];
} else {
columnData = ['Resist','Bonus'];
}
const dataRows = Math.max(elementCol1.length, elementCol2.length, 1);
const dataCols = columnData.length;
// Draw Elemental Data
this.drawItemDarkRect(width * 0, y, width, lineHeight, 2);
this.drawItemDarkRect(width * 1, y, width, lineHeight, 2);
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.statusMenuDmgReceive, width * 0, y, width, 'center');
this.drawText(TextManager.statusMenuDmgDealt, width * 1, y, width, 'center');
y += lineHeight;
this.setDescriptionFontSizeToTraitSet();
const smallLineHeight = this.textSizeEx(' ').height;
// Draw Elemental Table
for (let i = 0; i < dataRows; i++) {
for (let j = 0; j < dataCols; j++) {
// Draw Dark Rect
const colWidth = this.innerWidth / dataCols;
this.drawItemDarkRect(colWidth * j, y, colWidth, smallLineHeight);
// Draw Element Name
let elementID = elementCol1[i];
if (dataCols === 4) {
elementID = (j % 2 === 0) ? elementCol1[i] : elementCol2[i];
}
if (!elementID) continue;
const name = $dataSystem.elements[elementID];
this.drawTextEx(name, colWidth * (j + 1/3) + padding, y, colWidth*2/3);
const type = columnData[j];
// Draw Resistance Data
this.resetFontSettings();
let drawText = '';
if (type === 'Resist') {
const rate = actor.elementRate(elementID);
const flippedRate = (rate - 1) * -1;
this.changeTextColor(ColorManager.paramchangeTextColor(flippedRate));
drawText = '%1%'.format(Math.round(flippedRate * 100));
if (actor.getAbsorbedElements().includes(elementID)) {
this.changeTextColor(ColorManager.powerUpColor());
drawText = TextManager.statusMenuDmgAbsorb.format(Math.round(rate * 100));
} else if (rate > 1) {
drawText = '%1'.format(drawText);
} else if (rate <= 1) {
drawText = '+%1'.format(drawText);
}
// Draw Bonus Damage Data
} else if (type === 'Bonus') {
const dealtPlus = actor.getDealtElementPlus(elementID);
const dealtRate = actor.getDealtElementRate(elementID);
const dealtFlat = actor.getDealtElementFlat(elementID);
const dealt = ((1 + dealtPlus) * dealtRate + dealtFlat) - 1;
this.changeTextColor(ColorManager.paramchangeTextColor(dealt));
drawText = '%1%'.format(Math.round(dealt * 100));
if (dealt >= 0) drawText = '+%1'.format(drawText);
}
// Draw Value
this.contents.drawText(drawText, colWidth * j, y, (colWidth/3) - padding, smallLineHeight, 'right');
}
y += smallLineHeight;
}
// Closing the Table
for (let j = 0; j < dataCols; j++) {
const colWidth = this.innerWidth / dataCols;
this.drawItemDarkRect(colWidth * j, y, colWidth, this.innerHeight - y);
} |
|