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

Project1

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

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
292
在线时间
203 小时
注册时间
2009-10-3
帖子
9
跳转到指定楼层
1
发表于 2019-5-11 23:15:31 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
120星屑
如何判断当前使用的技能是否为编号X的技能?

<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 号技能

Lv5.捕梦者

梦石
0
星屑
32082
在线时间
5083 小时
注册时间
2012-11-19
帖子
4877

开拓者

2
发表于 2019-5-11 23:15:32 | 只看该作者
if (action.isSkill() && action.item().id === 5)

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
12157
在线时间
4435 小时
注册时间
2014-4-11
帖子
5955

开拓者

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


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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
292
在线时间
203 小时
注册时间
2009-10-3
帖子
9
4
 楼主| 发表于 2019-5-16 12:36:23 | 只看该作者
芯☆淡茹水 发表于 2019-5-15 06:29
if (action.isSkill() && action.item().id === 5)

比如 5 号技能

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
17 小时
注册时间
2019-5-17
帖子
28
5
发表于 2019-5-18 12:43:43 | 只看该作者
拿走了QAQ
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
53
在线时间
28 小时
注册时间
2019-4-22
帖子
22
6
发表于 2019-7-5 16:13:50 | 只看该作者
很厉害(ง •̀_•́)ง
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-15 18:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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