Browse Source

modding[#1613]: Added a beforeSpawnWhirlwind event that allows mods to modify how whirlwind looks

tags/v0.8.2
Shaun 3 years ago
parent
commit
fd9aa992ef
2 changed files with 9 additions and 3 deletions
  1. +6
    -2
      src/client/js/components/whirlwind.js
  2. +3
    -1
      src/server/config/spells/spellWhirlwind.js

+ 6
- 2
src/client/js/components/whirlwind.js View File

@@ -11,6 +11,8 @@ define([
row: null,
col: null,
frames: 4,
frameDelay: 4,
spriteSheet: null,

delay: 32,
coordinates: [],
@@ -44,7 +46,7 @@ define([
},

spawnThing: function (x, y) {
const { frames: frameCount, row, col } = this;
const { frames: frameCount, row, col, spriteSheet, frameDelay } = this;

this.objects.buildObject({
x,
@@ -53,7 +55,9 @@ define([
type: 'attackAnimation',
row,
col,
frames: frameCount
frames: frameCount,
spriteSheet,
frameDelay
}]
});
},


+ 3
- 1
src/server/config/spells/spellWhirlwind.js View File

@@ -60,7 +60,7 @@ module.exports = {

const coordinates = coordinateDeltas[this.range - 1].map(([x, y]) => [x + playerX, y + playerY]);

let blueprint = {
const blueprint = {
caster: id,
components: [{
idSource: id,
@@ -78,6 +78,8 @@ module.exports = {
y: playerY - 1
});

obj.fireEvent('beforeSpawnWhirlwind', blueprint);

instance.syncer.queue('onGetObject', blueprint, -1);

dealDamage(this, obj, coordinates);


Loading…
Cancel
Save