| 赞 | 8 |
| VIP | |
| 好人卡 | |
| 积分 | 26 |
| 经验 | |
| 最后登录 | 2022-11-7 |
| 在线时间 | 297 小时 |
- 梦石
- 0
- 星屑
- 2585
- 在线时间
- 297 小时
- 注册时间
- 2021-5-4
- 回帖
- 97
|
发表于 2021-8-29 11:54:12
|
显示全部楼层
不清楚你会不会用
[pre lang="js"]
Window_ItemList.prototype.drawItemNumber = function(item, x, y, width) {
if (this.needsNumber()) {
if(item.consumable===true){
this.drawText(":", x, y, width - this.textWidth("00"), "right");
this.drawText($gameParty.numItems(item), x, y, width, "right");
}
}
};
Game_Party.prototype.hasItem = function(item) {
if (this.numItems(item) > 0) {
return true;
} else if (this.isAnyMemberEquipped(item)) {
return true;
} else {
return false;
}
};
Game_Party.prototype.gainItem = function(item, amount, includeEquip) {
const container = this.itemContainer(item);
console.log(item)
if (container) {
const lastNumber = this.numItems(item);
const newNumber = lastNumber + amount;
container[item.id] = newNumber.clamp(0, this.maxItems(item));
if (container[item.id] === 0 && item.consumable===true) {
delete container[item.id];
}
if (includeEquip && newNumber < 0) {
this.discardMembersEquip(item, 0);
}
$gameMap.requestRefresh();
}
}
Game_Party.prototype.maxItems = function(item) {
if(item.consumable===true){
return 99;
}
return 1;//武器和装备最大的上限
};
[/pre] |
|