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

Project1

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

[有事请教] 请问镜子类的反弹伤害技能怎么做呢?

[复制链接]

Lv2.观梦者

梦石
0
星屑
367
在线时间
124 小时
注册时间
2023-1-19
帖子
61
跳转到指定楼层
1
发表于 2024-6-2 17:00:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
20星屑
就是类似镜子精灵一类的技能,能反弹一次伤害,不管物理还是魔法伤害都能100%反弹,而且被攻击的人不会受任何伤害。用状态核心怎么写呢?

最佳答案

查看完整内容

// The number of hits before the effect wears off. user._KyrieHits = 1; // Make sure _KyrieHits is a valid finite number. user._KyrieHits = Math.max(user._KyrieHits, 0); // Check to see if any HP damage is dealt. if (value > 0 && (this.isPhysical() || this.isMagical())) { target._KyrieHits -= 1; // Store the original damage value. var originalDamage = value; // Sets the Recoi ...

Lv2.观梦者

梦石
0
星屑
349
在线时间
25 小时
注册时间
2022-12-28
帖子
9
2
发表于 2024-6-2 17:00:55 | 只看该作者
haohaoniu 发表于 2024-6-3 14:50
这个好像不能只挡一次就消失,看来只能把伤害从0调成1之后再设置受伤时解除了 ...


<Custom Apply Effect>
  // The number of hits before the effect wears off.
  user._KyrieHits = 1;
  // Make sure _KyrieHits is a valid finite number.
  user._KyrieHits = Math.max(user._KyrieHits, 0);
</Custom Apply Effect>

<Custom React Effect>
// Check to see if any HP damage is dealt.
if (value > 0 && (this.isPhysical() || this.isMagical())) {
  target._KyrieHits -= 1;
  // Store the original damage value.
  var originalDamage = value;
  // Sets the Recoil Rate to 100%.
  var rate = 1.0;
  // Determines the amount of recoil damage dealt.
  var recoil = originalDamage * rate;
  // Rounds up the recoil damage.
  var dmg = Math.ceil(recoil);
  // Makes the attacker lose damage equal to the dmg variable.
  user.gainHp(-1 * dmg);
  // Check to see if the attacker is dead.
  if (user.isDead()) {
    // If the attacker is dead, make it collapse.
    user.performCollapse();
  }
  // Set the target's received damage to 0.
  value = 0;
  
  // Reduce the _KyrieHits counter by 1.
  if (target._KyrieHits <= 0) {
    // Then remove the state.
    target.removeState(stateId);
  }
}
</Custom React Effect>

<Custom Remove Effect>
  // Reset the number of hits to expire the effect.
  user._KyrieHits = 0;
</Custom Remove Effect>

这样也能无伤挡一次
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9512
在线时间
1858 小时
注册时间
2020-1-2
帖子
1086
3
发表于 2024-6-2 22:59:30 | 只看该作者
用YEP_buff&statescore   这是LOL反甲效果你可以参考一下
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
349
在线时间
25 小时
注册时间
2022-12-28
帖子
9
4
发表于 2024-6-3 04:52:26 | 只看该作者
本帖最后由 Z8K 于 2024-6-3 04:54 编辑

<Custom React Effect>
// Check to see if any HP damage is dealt.
if (value > 0 && (this.isPhysical() || this.isMagical())) {
  // Store the original damage value.
  var originalDamage = value;
  // Sets the Recoil Rate to 100%.
  var rate = 1.0;
  // Determines the amount of recoil damage dealt.
  var recoil = originalDamage * rate;
  // Rounds up the recoil damage.
  var dmg = Math.ceil(recoil);
  // Makes the attacker lose damage equal to the dmg variable.
  user.gainHp(-1 * dmg);
  // Check to see if the attacker is dead.
  if (user.isDead()) {
    // If the attacker is dead, make it collapse.
    user.performCollapse();
  }
  // Set the target's received damage to 0.
  value = 0;
}
</Custom React Effect>

这样就可以了 只是如果要有反弹动画好像就不行

範例:https://imgur.com/5dpDLGe
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
367
在线时间
124 小时
注册时间
2023-1-19
帖子
61
5
 楼主| 发表于 2024-6-3 14:50:14 | 只看该作者
Z8K 发表于 2024-6-3 04:52
// Check to see if any HP damage is dealt.
if (value > 0 && (this.isPhysical() || this.isMagical()) ...

这个好像不能只挡一次就消失,看来只能把伤害从0调成1之后再设置受伤时解除了
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
367
在线时间
124 小时
注册时间
2023-1-19
帖子
61
6
 楼主| 发表于 2024-6-3 21:59:47 | 只看该作者
xiamumomo 发表于 2024-6-2 22:59
用YEP_buff&statescore   这是LOL反甲效果你可以参考一下

谢谢帮忙,反伤甲我会写,但是我想要的是镜反那种效果
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
367
在线时间
124 小时
注册时间
2023-1-19
帖子
61
7
 楼主| 发表于 2024-6-3 22:01:23 | 只看该作者
Z8K 发表于 2024-6-2 17:00
// The number of hits before the effect wears off.
  user._KyrieHits = 1;
  // Make sure _Kyrie ...

感谢,动画我再试试行不行
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-26 07:01

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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