大佬们
rpgmaker吧
全部回复
仅看楼主
level 1
怎么才能制作一种药品只有一部分人能用呢?
2021年06月27日 01点06分 1
level 11
//如果是rmmz。
var hsy10jsid=[1,22,32,41] //不能用物品的角色id
var hsy10wpid=[1,2,3,4] //不能用的物品id
var hsy10wptype=true //true默认判断物品(false判断技能)
/** 使用项目 (非菜单里)(技能/物品通用)*/
var hsy10useItem=Scene_ItemBase.prototype.useItem
Scene_ItemBase.prototype.useItem = function() {
const action = new Game_Action(this.user());/** this.user()使用者(Base里留空)*/
action.setItemObject(this.item());//分歧类型,判断是否空值和设置id
if (action.isForFriend()) {//如果行动.是 对队友使用
aa=hsy10jsid.includes($gameParty.members()[this._actorWindow.index()].actorId())
}
var a=(hsy10wptype==true) ? DataManager.isItem(this.item()) : DataManager.isSkill(this.item())
if ( this.user().isActor()&&aa&& a &&hsy10wpid.includes( this.item().id ) ){
}else{
hsy10useItem.call(this)
} //if( this.user().isActor()&&a )
};
2021年06月28日 22点06分 2
MV呢
2021年06月28日 22点06分
@病娇妹控💍 不行,mv1.61测试出现bug:第二行“不能”用的物品id 变成了“能”用的物品id。 也就是说没在这个括号里的id所有人都不能用
2021年06月28日 23点06分
@黄老六 所以说MV不能写这种代码吗
2021年06月28日 23点06分
@病娇妹控💍 九成以上代码一样,猜测可能是第14行的.id在mv的写法可能不是这样
2021年06月28日 23点06分
1