Browse Source

modding[#1616]: The warnblast spell will now use a specific row for its attackAnimation if one is defined

tags/v0.8.2
Shaun 3 years ago
parent
commit
a57a55228d
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      src/server/config/spells/spellWarnBlast.js

+ 10
- 4
src/server/config/spells/spellWarnBlast.js View File

@@ -17,7 +17,10 @@ module.exports = {

radius: 1,

row: null,
col: 4,
rowOptions: [10, 10, 10, 10, 10, 10, 10, 8, 8, 8, 7, 7, 7],
spriteSheet: 'attacks',

cast: function (action) {
let obj = this.obj;
@@ -84,20 +87,23 @@ module.exports = {
},

onWarningOver: function (x, y) {
let obj = this.obj;
const { obj, spriteSheet, rowOptions, col, row } = this;

let physics = obj.instance.physics;
let syncer = obj.instance.syncer;

const useRow = (row !== null) ? row : rowOptions[~~(Math.random() * rowOptions.length)];

let effect = {
x: x,
y: y,
components: [{
type: 'attackAnimation',
destroyObject: true,
row: this.rowOptions[~~(Math.random() * this.rowOptions.length)],
col: 4,
frameDelay: 4 + ~~(Math.random() * 7)
row: useRow,
col,
frameDelay: 4 + ~~(Math.random() * 7),
spriteSheet
}]
};



Loading…
Cancel
Save