查看: 4791|回复: 5

[有事请教] 如何判断当前使用的技能是否为编号X的技能?

[复制链接]
梦石
0
星屑
368
在线时间
222 小时
注册时间
2009-10-3
回帖
5
发表于 2019-5-11 23:15:31 | 显示全部楼层 |阅读模式
悬赏120星屑已解决
如何判断当前使用的技能是否为编号X的技能?
未标题-1.png
<Custom Action Start Effect>
// If a chained action is stored...
if ($gameTemp._chainAction === undefined) {
  // ...then set the action to the user's current action.
  $gameTemp._chainAction = user.currentAction();
} else {
  // ...then clear the stored action.
  $gameTemp._chainAction = undefined;
}
</Custom Action Start Effect>

<Custom Action End Effect>
// If a chained action is stored...
if ($gameTemp._chainAction) {
  // Set the 'action' variable to the chained action.
  var action = $gameTemp._chainAction;
  // Check if the action exists, is a skill, and is a magical attack.
  if (【【【action.isSkill(1)???】】】) {
    // Get the skill used for that action.
    var skill = action.item();
    // Check if the user can pay the skill cost.
    if (user.canPaySkillCost(skill)) {
      // Check if the battle system is DTB.
      if (BattleManager.isDTB()) {
        // If it is, add the action to queue.
        user.setAction(0, action);
      // If the battle system isn't DTB...
      } else {
        // ...make it a forced forced.
        BattleManager.queueForceAction(user, skill.id, -2);
      }
    }
  }
}
</Custom Action End Effect>

<Custom Remove Effect>
// Clear the chained action effect.
$gameTemp._chainAction = undefined;
</Custom Remove Effect>

最佳答案

查看完整内容

if (action.isSkill() && action.item().id === 5) 比如 5 号技能
梦石
0
星屑
34466
在线时间
5096 小时
注册时间
2012-11-19
回帖
4715

开拓者

发表于 2019-5-11 23:15:32 | 显示全部楼层
if (action.isSkill() && action.item().id === 5)

比如 5 号技能
xp vx va mv  va mz 各类型脚本/插件定制
回复

使用道具 举报

梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 2019-5-12 09:35:10 | 显示全部楼层
当是action的情况下。
action是行动,他本身是包含了要使用的技能的
他的isskill函数是不需要在括号里加东西就能判断的

而
DataManager.isSkill(item)
这个是需要在括号里带上技能,是技能,不是ID
回复

使用道具 举报

梦石
0
星屑
368
在线时间
222 小时
注册时间
2009-10-3
回帖
5
 楼主| 发表于 2019-5-16 12:36:23 | 显示全部楼层
芯☆淡茹水 发表于 2019-5-15 06:29
if (action.isSkill() && action.item().id === 5)

比如 5 号技能

:)感谢 您的正解 而且还很清晰
回复

使用道具 举报

梦石
0
星屑
55
在线时间
17 小时
注册时间
2019-5-17
回帖
28
发表于 2019-5-18 12:43:43 | 显示全部楼层
拿走了QAQ
回复

使用道具 举报

梦石
0
星屑
53
在线时间
28 小时
注册时间
2019-4-22
回帖
18
发表于 2019-7-5 16:13:50 | 显示全部楼层
很厉害(ง •̀_•́)ง
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部