设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1506|回复: 2
打印 上一主题 下一主题

[有事请教] 某个物品只在队伍中有某个角色时才会掉落

[复制链接]

Lv2.观梦者

梦石
0
星屑
310
在线时间
158 小时
注册时间
2022-1-8
帖子
52
跳转到指定楼层
1
发表于 2022-9-9 16:06:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1星屑
求助怎么设置某个物品只在队伍中有某个角色时才会掉落

最佳答案

查看完整内容

Game_Enemy.prototype.makeDropItems = function() { const rate = this.dropItemRate(); return this.enemy().dropItems.reduce((r, di) => { if (di.kind > 0 && Math.random() * di.denominator < rate) { let item = this.itemObject(di.kind, di.dataId); if (item.name === '道具名' && !$gameParty._actors.includes(3)) item = []; // 某某名称的道具在队伍中没 ...

Lv4.逐梦者

梦石
0
星屑
5549
在线时间
405 小时
注册时间
2021-12-4
帖子
432
2
发表于 2022-9-9 16:06:02 | 只看该作者
Game_Enemy.prototype.makeDropItems = function() {
    const rate = this.dropItemRate();
    return this.enemy().dropItems.reduce((r, di) => {
        if (di.kind > 0 && Math.random() * di.denominator < rate) {

            let item = this.itemObject(di.kind, di.dataId);
            if (item.name === '道具名' && !$gameParty._actors.includes(3))
                item = []; // 某某名称的道具在队伍中没有3号角色时不掉落
            return r.concat(item);

        } else {
            return r;
        }
    }, []);
};
rmmz_objects.js第5000行左右,对掉落道具的名称(或者编号等任何属性)进行判断,再判断队伍的成员,就能控制是否不获得该道具了。
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
310
在线时间
158 小时
注册时间
2022-1-8
帖子
52
3
 楼主| 发表于 2022-9-10 10:15:20 | 只看该作者
小秋橙 发表于 2022-9-9 19:52
Game_Enemy.prototype.makeDropItems = function() {
    const rate = this.dropItemRate();
    return t ...

大佬,这个掉落物需要加在敌人掉落里面么
还有就是我用的是mv应该是一样的吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-13 11:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表