Project1

标题: 问一下这个yep公式怎么错了 [打印本页]

作者: 忧郁答辩    时间: 2024-9-15 20:41
标题: 问一下这个yep公式怎么错了


式子:
  <Help Description>
:消耗该状态使用特殊技能。每5充能状态升级。
充能一级:双攻+20%
充能二级:额外提升敏捷+35%,命中率+5%
充能三级:tp恢复率+30%
当充能为20时,发生过载,双攻-50%
</Help Description>

// 这里是大佬写的子弹公式,我拿来用
<Custom Battle Effect>
user._ammunition1 = 1;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Battle Effect>

<Custom Turn Start Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Turn Start Effect>

<Custom Action Start Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Action Start Effect>

<Custom Action End Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Action End Effect>

<Custom Initiate Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Initiate Effect>

<Custom Select Effect>
target._ammunition1 = target._ammunition1 || 0;
target.setStateCounter(166, target._ammunition1);
target.clampStateCounter(166, 0, 20);
</Custom Select Effect>

<Custom Confirm Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Confirm Effect>

<Custom React Effect>
target._ammunition1 = target._ammunition1 || 0;
target.setStateCounter(166, target._ammunition1);
target.clampStateCounter(166, 0, 20);
</Custom React Effect>

<Custom Respond Effect>
target._ammunition1 = target._ammunition1 || 0;
target.setStateCounter(166, target._ammunition1);
target.clampStateCounter(166, 0, 20);
</Custom Respond Effect>

<Custom Establish Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Establish Effect>

<Custom Deselect Effect>
target._ammunition1 = target._ammunition1 || 0;
target.setStateCounter(166, target._ammunition1);
target.clampStateCounter(166, 0, 20);
</Custom Deselect Effect>

<Custom Conclude Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Conclude Effect>

// 这下面是不同层不同增益的(我自己照葫芦画瓢写的)

<Custom Turn Start Effect>
if (user._ammunition1>=20) {
user.addState(170)
user.removeState(167)
user.removeState(168)
user.removeState(169);
} else if (user._ammunition1>=15) {
user.addState(169)
user.removeState(167)
user.removeState(168)
user.removeState(170);
} else if (user._ammunition1>=10) {
user.addState(168)
user.removeState(167)
user.removeState(169)
user.removeState(170);
} else if (user._ammunition1>=5) {
user.addState(167)
user.removeState(168)
user.removeState(169)
user.removeStateState(170);
}
</Custom Turn Start Effect>

<Custom Remove Effect>
user.removeState(167)
user.removeState(168)
user.removeState(169)
user.removeStateState(170);
</Custom Remove Effect>

作者: 忧郁答辩    时间: 2024-9-15 20:44
这个式子错误的地方是,假如我有12层,我释放技能减了4层,然后当人物回合时候就报错了。不知道怎么做,我这是按着大佬照葫芦画瓢写的,如果有更简单的式子更好了
作者: KB.Driver    时间: 2024-9-15 20:50
有两处 user.removeStateState,看上去是拼写错误
改成 user.removeState 之后看看:

<Help Description>
:消耗该状态使用特殊技能。每5充能状态升级。
充能一级:双攻+20%
充能二级:额外提升敏捷+35%,命中率+5%
充能三级:tp恢复率+30%
当充能为20时,发生过载,双攻-50%
</Help Description>

// 这里是大佬写的子弹公式,我拿来用
<Custom Battle Effect>
user._ammunition1 = 1;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Battle Effect>

<Custom Turn Start Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Turn Start Effect>

<Custom Action Start Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Action Start Effect>

<Custom Action End Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Action End Effect>

<Custom Initiate Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Initiate Effect>

<Custom Select Effect>
target._ammunition1 = target._ammunition1 || 0;
target.setStateCounter(166, target._ammunition1);
target.clampStateCounter(166, 0, 20);
</Custom Select Effect>

<Custom Confirm Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Confirm Effect>

<Custom React Effect>
target._ammunition1 = target._ammunition1 || 0;
target.setStateCounter(166, target._ammunition1);
target.clampStateCounter(166, 0, 20);
</Custom React Effect>

<Custom Respond Effect>
target._ammunition1 = target._ammunition1 || 0;
target.setStateCounter(166, target._ammunition1);
target.clampStateCounter(166, 0, 20);
</Custom Respond Effect>

<Custom Establish Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Establish Effect>

<Custom Deselect Effect>
target._ammunition1 = target._ammunition1 || 0;
target.setStateCounter(166, target._ammunition1);
target.clampStateCounter(166, 0, 20);
</Custom Deselect Effect>

<Custom Conclude Effect>
user._ammunition1 = user._ammunition1 || 0;
user.setStateCounter(166, user._ammunition1);
user.clampStateCounter(166, 0, 20);
</Custom Conclude Effect>

// 这下面是不同层不同增益的(我自己照葫芦画瓢写的)

<Custom Turn Start Effect>
if (user._ammunition1>=20) {
user.addState(170)
user.removeState(167)
user.removeState(168)
user.removeState(169);
} else if (user._ammunition1>=15) {
user.addState(169)
user.removeState(167)
user.removeState(168)
user.removeState(170);
} else if (user._ammunition1>=10) {
user.addState(168)
user.removeState(167)
user.removeState(169)
user.removeState(170);
} else if (user._ammunition1>=5) {
user.addState(167)
user.removeState(168)
user.removeState(169)
user.removeState(170); //user.removeStateState(170);
}
</Custom Turn Start Effect>

<Custom Remove Effect>
user.removeState(167)
user.removeState(168)
user.removeState(169)
user.removeState(170); //user.removeStateState(170);
</Custom Remove Effect>
作者: 忧郁答辩    时间: 2024-9-15 20:54
KB.Driver 发表于 2024-9-15 20:50
有两处 user.removeStateState,看上去是拼写错误
改成 user.removeState 之后看看:

好的!谢谢了!我不小心复制粘贴两个state了!




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1