| 赞 | 10 |
| VIP | 0 |
| 好人卡 | 0 |
| 积分 | 47 |
| 经验 | 1000 |
| 最后登录 | 2026-5-22 |
| 在线时间 | 436 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 4722
- 在线时间
- 436 小时
- 注册时间
- 2008-1-18
- 帖子
- 459
|
10星屑
本帖最后由 红十字 于 2026-1-14 22:40 编辑
大家好.我想做一个首饰,希望他能够装备在任意一个我指定的装备类型槽位,例如金链子,可以装备左手,也可以装备右手,还可以装备在脚上,于是我让豆包帮我写了一个插件,但是在游戏中,还是只能装备在数据库指定的装备类型才能够生效,其他位置都不好用.下面是豆包写的插件,请大佬帮忙看看哪里的问题呗?感谢.
//=============================================================================
// MultiSlotEquip_Ultimate.js
// 彻底解除所有装备限制(槽位+类型+显示)
//=============================================================================
/*:
* @plugindesc 彻底解除装备槽、装备类型的所有限制,确保装备可正常穿戴
* @author 豆包
*
* @help
* 使用方法:装备备注栏写 <MultiEquip:槽位ID1,ID2>(如<MultiEquip:5,6,7>)
*/
(function() {
'use strict';
// 1. 跳过装备验证的所有限制
Game_Actor.prototype.isEquipValid = function(item) {
if (!item) return false;
// 标记了MultiEquip的装备,直接通过验证
if (item.meta.MultiEquip) {
return this.canEquip(item); // 仅保留角色是否可装备的基础校验
}
// 未标记的装备用原生逻辑
var slotId = this._lastValidSlotId || 0;
var slotType = this.equipSlots()[slotId];
return this.canEquip(item) && (item.etypeId === slotType);
};
// 2. 让装备显示在指定槽位的列表中
Window_EquipItem.prototype.includes = function(item) {
if (!item) return false;
if (item.meta.MultiEquip) {
var slotId = this._slotId + 1;
var allowedSlots = item.meta.MultiEquip.split(',').map(id => parseInt(id.trim()));
return allowedSlots.includes(slotId) && this._actor.canEquip(item);
}
return this._actor.canEquip(item) && (item.etypeId === this._actor.equipSlots()[this._slotId]);
};
// 3. 强制装备变更(跳过槽位类型校验)
Game_Actor.prototype.changeEquip = function(slotId, item) {
if (item && item.meta.MultiEquip) {
// 直接装备,忽略槽位类型
if (this.canEquip(item)) {
this._equips[slotId].setObject(item);
this.refresh();
return;
}
}
// 原生逻辑
if (this.canEquip(item) && (item.etypeId === this.equipSlots()[slotId])) {
this._equips[slotId].setObject(item);
this.refresh();
}
};
})(); |
-
1.png
(119.26 KB, 下载次数: 34)
护甲设定界面
最佳答案
查看完整内容
https://rpg.blue/thread-493776-1-1.html
试试这个插件能不能实现你需要的功能
|