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

Project1

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

[有事请教] 关于插件Visu Skills States Core的问题(已解决)

[复制链接]

Lv2.观梦者

梦石
0
星屑
936
在线时间
191 小时
注册时间
2023-7-14
帖子
86
跳转到指定楼层
1
发表于 2023-8-5 21:56:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 catxiaolang 于 2023-8-6 13:02 编辑

来自Visu Skills States Core 的一个功能,可以在状态消失时执行一些东西

原文如下:

<JS On Erase State> code code </JS On Erase State>

Used for: State Notetags
When a state is erased, run the code added by this notetag.
The 'user' variable refers to the current active battler.
The 'target' variable refers to the battler affected by this state.
The 'origin' variable refers to the one who applied this state.
The 'state' variable refers to the current state being affected.

由于不懂代码,
我试着让GPT-4帮忙解释了一下它的意思,
并设计了一个DEBUFF技能让它实现,以便理解。
于是整出了这个:


技能:延迟爆炸
给敌方单体埋入一颗定时炸弹,2回合后爆炸,对敌方全体造成施法者150%法术攻击力的伤害。


于是制作了一个持续2回合的状态,下面是GPT给出的代码,把它粘贴在状态备注里:

<JS On Erase State>
  const damageMultiplier = 1.5; // 伤害倍率,150%为1.5
  const spellPower = origin.mat; // 获取状态来源的法术攻击力
  const damage = Math.floor(spellPower * damageMultiplier); // 计算伤害值

  const allies = target.friendsUnit().members(); // 获取状态目标的所有队友
  allies.forEach(function(actor) {
    actor.gainHp(-damage); // 对每个队友造成伤害
  });
</JS On Erase State>


定时炸弹的基本功能还是能顺利执行的,
但是衍生了新的问题:

1.敌人受到伤害时没有飙数字;
2.受到这个伤害而死亡的敌人图像不会消失,而是和它的空血条一起残留在场上;
3.不知如何给这个爆炸赋予音效和动画特效

求教各位大佬了

===编辑===

已解决,让GPT-4添加了缺失的代码就可以了
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-5-4 07:45

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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