Ver a proveniência

Started putting everything together

tags/v0.1.4^2
Big Bad Waffle há 7 anos
ascendente
cometimento
10b8e8b912
19 ficheiros alterados com 422 adições e 1 eliminações
  1. BIN
     
  2. BIN
     
  3. BIN
     
  4. BIN
     
  5. +9
    -0
      src/server/components/inventory.js
  6. +1
    -1
      src/server/config/spells.js
  7. +2
    -0
      src/server/items/generators/spellbook.js
  8. BIN
     
  9. BIN
     
  10. BIN
     
  11. BIN
     
  12. BIN
     
  13. BIN
     
  14. BIN
     
  15. +219
    -0
      src/server/mods/class-necromancer/index.js
  16. +66
    -0
      src/server/mods/class-necromancer/spells/spellBloodBarrier.js
  17. +54
    -0
      src/server/mods/class-necromancer/spells/spellHarvestLife.js
  18. +71
    -0
      src/server/mods/class-necromancer/spells/spellSummonSkeleton.js
  19. BIN
     




+ 9
- 0
src/server/components/inventory.js Ver ficheiro

@@ -342,6 +342,15 @@ define([
item.eq = true;
item.noSalvage = true;
this.getItem(item);

item = generator.generate({
spell: true,
spellQuality: 'basic',
spellName: classes.spells[this.obj.class][1]
});
item.eq = true;
item.noSalvage = true;
this.getItem(item);
}
},



+ 1
- 1
src/server/config/spells.js Ver ficheiro

@@ -290,7 +290,7 @@ define([
description: 'Jagged Crystals break ground at your target destination',
type: 'warnBlast',
animation: 'raiseHands',
icon: [4, 0],
icon: [0, 7],
particles: {
color: {
start: ['c0c3cf', '929398'],


+ 2
- 0
src/server/items/generators/spellbook.js Ver ficheiro

@@ -31,6 +31,8 @@ define([
else if (statType instanceof Array) {
if ((statType.indexOf('dex') > -1) && (statType.indexOf('int') > -1))
sprite = [10, 3];
else if ((statType.indexOf('str') > -1) && (statType.indexOf('int') > -1))
sprite = [10, 4];
}

item.name = 'Rune of ' + spellAesthetic.name;









+ 219
- 0
src/server/mods/class-necromancer/index.js Ver ficheiro

@@ -0,0 +1,219 @@
define([

], function(

) {
return {
name: 'Necormancer Class',

extraScripts: [
'spells/spellHarvestLife',
'spells/spellSummonSkeleton',
'spells/spellBloodBarrier'
],

init: function() {
this.events.on('onBeforeGetClasses', this.beforeGetClasses.bind(this));
this.events.on('onBeforeGetSkins', this.beforeGetSkins.bind(this));
this.events.on('onBeforeGetItemTypes', this.beforeGetItemTypes.bind(this));
this.events.on('onBeforeGetSpellsInfo', this.beforeGetSpellsInfo.bind(this));
this.events.on('onBeforeGetSpellsConfig', this.beforeGetSpellsConfig.bind(this));
this.events.on('onBeforeGetSpellTemplate', this.beforeGetSpellTemplate.bind(this));
this.events.on('onBeforeGetResourceList', this.beforeGetResourceList.bind(this));
},

beforeGetResourceList: function(list) {
list.push(`${this.folderName}/images/inGameSprite.png`);
list.push(`${this.folderName}/images/abilityIcons.png`);
},

beforeGetClasses: function(classes) {
classes.spells.necromancer = ['summon skeleton', 'blood barrier'];
classes.stats.necromancer = {
values: {
hpMax: 95
},
vitScale: 10,
spritesheet: `${this.folderName}/images/inGameSprite.png`
};
classes.weapons.necromancer = 'Sickle';
},

beforeGetSpellTemplate: function(spell) {
if (spell.type == 'HarvestLife')
spell.template = require(`${this.relativeFolderName}/spells/spellHarvestLife`);
else if (spell.type == 'SummonSkeleton')
spell.template = require(`${this.relativeFolderName}/spells/spellSummonSkeleton`);
else if (spell.type == 'BloodBarrier')
spell.template = require(`${this.relativeFolderName}/spells/spellBloodBarrier`);
},

beforeGetSkins: function(skins) {
skins['necromancer 1'] = {
name: 'Necromancer 1',
sprite: [0, 0],
class: 'necromancer',
spritesheet: `${this.folderName}/images/classSprite.png`,
default: true
};
},

beforeGetItemTypes: function(types) {
['Sickle', 'Jade Sickle', 'Golden Sickle', 'Bone Sickle'].forEach(function(s, i) {
types.twoHanded[s] = {
sprite: [i, 0],
spellName: 'harvest life',
spritesheet: `${this.folderName}/images/items.png`
};
}, this);
},

beforeGetSpellsConfig: function(spells) {
spells['harvest life'] = {
statType: ['str', 'int'],
statMult: 0.1,
element: 'arcane',
auto: true,
cdMax: 7,
manaCost: 0,
range: 9,
random: {
damage: [2, 4]
}
};

spells['summon skeleton'] = {
statType: ['str', 'int'],
statMult: 0.1,
element: 'arcane',
auto: true,
cdMax: 7,
manaCost: 0,
range: 9,
random: {
damage: [2, 4]
}
};

spells['blood barrier'] = {
statType: ['str', 'int'],
statMult: 0.1,
element: 'arcane',
auto: true,
cdMax: 7,
manaCost: 0,
range: 9,
random: {
damage: [2, 4]
}
};
},

beforeGetSpellsInfo: function(spells) {
spells.push({
name: 'Harvest Life',
description: 'Absorbs the life-force of your enemies.',
type: 'harvestLife',
icon: [0, 0],
spritesheet: `${this.folderName}/images/abilityIcons.png`,
particles: {
color: {
start: ['ff4252', 'b34b3a'],
end: ['b34b3a', 'ff4252']
},
scale: {
start: {
min: 2,
max: 14
},
end: {
min: 0,
max: 8
}
},
lifetime: {
min: 1,
max: 3
},
alpha: {
start: 0.7,
end: 0
},
randomScale: true,
randomColor: true,
chance: 0.6
}
});

spells.push({
name: 'Summon Skeleton',
description: 'Absorbs the life-force of your enemies.',
type: 'summonSkeleton',
icon: [1, 0],
spritesheet: `${this.folderName}/images/abilityIcons.png`,
particles: {
color: {
start: ['ff4252', 'b34b3a'],
end: ['b34b3a', 'ff4252']
},
scale: {
start: {
min: 2,
max: 14
},
end: {
min: 0,
max: 8
}
},
lifetime: {
min: 1,
max: 3
},
alpha: {
start: 0.7,
end: 0
},
randomScale: true,
randomColor: true,
chance: 0.6
}
});

spells.push({
name: 'Blood Barrier',
description: 'Absorbs the life-force of your enemies.',
type: 'bloodBarrier',
icon: [2, 0],
spritesheet: `${this.folderName}/images/abilityIcons.png`,
particles: {
color: {
start: ['ff4252', 'b34b3a'],
end: ['b34b3a', 'ff4252']
},
scale: {
start: {
min: 2,
max: 14
},
end: {
min: 0,
max: 8
}
},
lifetime: {
min: 1,
max: 3
},
alpha: {
start: 0.7,
end: 0
},
randomScale: true,
randomColor: true,
chance: 0.6
}
});
}
};
});

+ 66
- 0
src/server/mods/class-necromancer/spells/spellBloodBarrier.js Ver ficheiro

@@ -0,0 +1,66 @@
define([
], function(
) {
return {
type: 'bloodBarrier',

cdMax: 7,
manaCost: 0,

range: 9,

speed: 150,
damage: 1,

row: 3,
col: 0,

needLos: true,

cast: function(action) {
var obj = this.obj;
var target = action.target;

var ttl = (Math.sqrt(Math.pow(target.x - obj.x, 2) + Math.pow(target.y - obj.y, 2)) * this.speed) - 50;

this.sendAnimation({
caster: this.obj.id,
components: [{
idSource: this.obj.id,
idTarget: target.id,
type: 'projectile',
ttl: ttl,
projectileOffset: this.projectileOffset,
particles: this.particles
}, {
type: 'attackAnimation',
layer: 'projectiles',
loop: -1,
row: this.row,
col: this.col
}]
});

this.sendBump(target);

this.queueCallback(this.explode.bind(this, target), ttl, null, target);

return true;
},
explode: function(target) {
if ((this.obj.destroyed) || (target.destroyed))
return;

var damage = this.getDamage(target);

if (!target.stats) {
console.log('has no stats???');
console.log(target);
return;
}
target.stats.takeDamage(damage, this.threatMult, this.obj);
}
};
});

+ 54
- 0
src/server/mods/class-necromancer/spells/spellHarvestLife.js Ver ficheiro

@@ -0,0 +1,54 @@

define([

], function(

) {
return {
type: 'harvestLife',
cdMax: 5,
manaCost: 0,
range: 1,

damage: 1,

col: 4,
row: 1,

init: function() {
if (this.range > 1)
this.needLos = true;
},

cast: function(action) {
var target = action.target;

var row = this.row;
var col = this.col;

this.sendAnimation({
id: target.id,
components: [{
type: 'attackAnimation',
new: true,
row: row,
col: col
}]
});

this.sendBump(target);

this.queueCallback(this.explode.bind(this, target), 100);

return true;
},
explode: function(target) {
if ((this.obj.destroyed) || (target.destroyed))
return;
var damage = this.getDamage(target);
target.stats.takeDamage(damage, this.threatMult, this.obj);
}
};
});

+ 71
- 0
src/server/mods/class-necromancer/spells/spellSummonSkeleton.js Ver ficheiro

@@ -0,0 +1,71 @@
define([
], function(
) {
return {
type: 'summonSkeleton',

cdMax: 7,
manaCost: 0,

range: 9,

speed: 70,
damage: 1,

freezeDuration: 10,

needLos: true,

cast: function(action) {
var obj = this.obj;
var target = action.target;

var ttl = Math.sqrt(Math.pow(target.x - obj.x, 2) + Math.pow(target.y - obj.y, 2)) * this.speed;

this.sendAnimation({
caster: this.obj.id,
components: [{
idSource: this.obj.id,
idTarget: target.id,
type: 'projectile',
row: 3,
col: 0,
ttl: ttl,
particles: this.particles
}, {
type: 'attackAnimation',
layer: 'projectiles',
loop: -1,
row: 3,
col: 4
}]
});

this.sendBump(target);

this.queueCallback(this.explode.bind(this, target), ttl);

return true;
},
explode: function(target) {
if (this.obj.destroyed)
return;

var targetEffect = target.effects.addEffect({
type: 'slowed',
ttl: this.freezeDuration
});

this.obj.instance.syncer.queue('onGetDamage', {
id: target.id,
event: true,
text: 'slowed'
});

var damage = this.getDamage(target);
target.stats.takeDamage(damage, this.threatMult, this.obj);
}
};
});


Carregando…
Cancelar
Guardar