查看: 4422|回复: 3

[有事请教] 动作序列状态概率

[复制链接]
梦石
0
星屑
626
在线时间
300 小时
注册时间
2018-7-28
回帖
160
发表于 2020-3-13 18:35:44 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×

有没有大佬知道怎么在动作序列里面写

状态成功概率,还有计算敌人的状态抵抗率。

就是和效果栏直接添加状态xx%一样的效果。


<setup action>
display action
immortal: targets, true
</setup action>
<target action>
animation 20: target
wait for animation
If target.isStateAffected(500)
else
If target.isStateAffected(499)
Remove State 499: target
Add State 500: target
else
Add State 499: target
</target action>
菜鸟一只
头像被屏蔽
梦石
0
星屑
17103
在线时间
32 小时
注册时间
2020-3-16
回帖
29
发表于 2020-3-16 14:39:37 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

梦石
0
星屑
2787
在线时间
216 小时
注册时间
2017-9-28
回帖
255
发表于 2020-3-23 18:22:20 | 显示全部楼层
估计你要的东东跟下面的源程序有关
Game_Action.prototype.itemEffectAddState = function(target, effect) {
    if (effect.dataId === 0) {
        this.itemEffectAddAttackState(target, effect);
    } else {
        this.itemEffectAddNormalState(target, effect);
    }
};

Game_Action.prototype.itemEffectAddAttackState = function(target, effect) {
    this.subject().attackStates().forEach(function(stateId) {
        var chance = effect.value1;
        chance *= target.stateRate(stateId);
        chance *= this.subject().attackStatesRate(stateId);
        chance *= this.lukEffectRate(target);
        if (Math.random() < chance) {
            target.addState(stateId);
            this.makeSuccess(target);
        }
    }.bind(this), target);
};

Game_Action.prototype.itemEffectAddNormalState = function(target, effect) {
    var chance = effect.value1;
    if (!this.isCertainHit()) {
        chance *= target.stateRate(effect.dataId);
        chance *= this.lukEffectRate(target);
    }
    if (Math.random() < chance) {
        target.addState(effect.dataId);
        this.makeSuccess(target);
    }
};
stateRate(stateId)估计就是状态有效度吧,这里面还有幸运值修正

点评

谢谢大佬解答!  发表于 2020-3-31 06:18
回复 2 0

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部