赞 | 118 |
VIP | 2 |
好人卡 | 13 |
积分 | 42 |
经验 | 63030 |
最后登录 | 2021-5-30 |
在线时间 | 594 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 4150
- 在线时间
- 594 小时
- 注册时间
- 2014-1-12
- 帖子
- 476
|
- <Custom React Effect>
- // Check if the action dealt HP damage
- if (this.isHpEffect() && value > 0) {
- // Get the target's allies
- var members = target.friendsUnit().aliveMembers();
- // Get the Aura's Origin State ID
- var auraOriginId = 246;
- // Make the origin user undefined
- var auraOriginUser = undefined;
- // Loop through each member
- for (var i = 0; i < members.length; ++i) {
- // Get the currently looped member
- var member = members[i];
- // Check if the member exists, isn't the target, and is the aura holder
- if (member && member !== target && member.isStateAffected(auraOriginId)) {
- // Set the origin user to that member
- auraOriginUser = member;
- // Break the loop
- break;
- }
- }
- // Check if the origin user exists
- if (auraOriginUser) {
- // Calculate the amount of reduction
- var reduction = Math.ceil(0.50 * value);
- // Set the damage to the target to 0.
- value = 0;
- // Make the origin user take damage instead.
- auraOriginUser.gainHp(-reduction);
- // Display an animation on the origin user.
- auraOriginUser.startAnimation(2);
- // Make the origin user display a damage popup.
- auraOriginUser.startDamagePopup();
- // Check if the origin user is dead
- if (auraOriginUser.isDead()) {
- // Collapse the origin user if dead
- auraOriginUser.performCollapse();
- }
- // Clear the origin user's results
- auraOriginUser.clearResult();
- }
- }
- </Custom React Effect>
复制代码 |
|