Browse Source

bug[#1548]: Self stuns caused by charging are no longer resistable and physics.removeObject is now only called at the end of a charge and fireblast (to ensure the right position is used)

tags/v0.8.5^2
Shaun Kichenbrand 3 years ago
parent
commit
6ea12fecb5
2 changed files with 17 additions and 10 deletions
  1. +5
    -3
      src/server/config/spells/spellCharge.js
  2. +12
    -7
      src/server/config/spells/spellFireblast.js

+ 5
- 3
src/server/config/spells/spellCharge.js View File

@@ -65,7 +65,9 @@ module.exports = {

let selfEffect = this.obj.effects.addEffect({
type: 'stunned',
noMsg: true
noMsg: true,
force: true,
new: true
});

const moveAnimationEffect = {
@@ -92,8 +94,6 @@ module.exports = {
}, -1);
}

physics.removeObject(obj, obj.x, obj.y);

this.queueCallback(this.reachDestination.bind(this, target, targetPos, targetEffect, selfEffect), ttl - 50);

return true;
@@ -104,6 +104,8 @@ module.exports = {

let obj = this.obj;

obj.instance.physics.removeObject(obj, obj.x, obj.y);

obj.x = targetPos.x;
obj.y = targetPos.y;



+ 12
- 7
src/server/config/spells/spellFireblast.js View File

@@ -113,6 +113,16 @@ module.exports = {
if (!eventMsg.success)
continue;

const targetEffect = m.effects.addEffect({
type: 'stunned',
noMsg: true,
new: true
});

//If targetEffect is undefined, it means that the target has become resistant
if (!targetEffect)
continue;

this.sendAnimation({
id: m.id,
components: [{
@@ -123,13 +133,6 @@ module.exports = {
}]
});

let targetEffect = m.effects.addEffect({
type: 'stunned',
noMsg: true,
new: true
});

physics.removeObject(m, m.x, m.y);
this.queueCallback(this.endEffect.bind(this, m, targetPos, targetEffect), ttl, null, m);
}
}
@@ -146,6 +149,8 @@ module.exports = {
endEffect: function (target, targetPos, targetEffect) {
target.effects.removeEffect(targetEffect, true);

target.instance.physics.removeObject(target, target.x, target.y);

target.x = targetPos.x;
target.y = targetPos.y;



Loading…
Cancel
Save