Kaynağa Gözat

fixes #557

tags/v0.2.0^2
big bad waffle 6 yıl önce
ebeveyn
işleme
79386a07e0
9 değiştirilmiş dosya ile 29 ekleme ve 118 silme
  1. +2
    -2
      src/client/ui/templates/equipment/equipment.js
  2. +1
    -1
      src/server/components/inventory.js
  3. +1
    -2
      src/server/components/player.js
  4. +22
    -13
      src/server/components/stats.js
  5. +0
    -72
      src/server/config/classes.js
  6. +1
    -4
      src/server/config/spirits.js
  7. +0
    -22
      src/server/mods/class-necromancer/index.js
  8. +1
    -1
      src/server/startup.js
  9. +1
    -1
      src/server/world/worker.js

+ 2
- 2
src/client/ui/templates/equipment/equipment.js Dosyayı Görüntüle

@@ -359,8 +359,8 @@ define([
'chance to block attacks': stats.blockAttackChance + '%',
'chance to block spells': stats.blockSpellChance + '%',
gap1: '',
'chance to dodge attacks': stats.dodgeAttackChance + '%',
'chance to dodge spells': stats.dodgeSpellChance + '%',
'chance to dodge attacks': (~~(stats.dodgeAttackChance * 10) / 10) + '%',
'chance to dodge spells': (~~(stats.dodgeSpellChance * 10) / 10) + '%',
gap2: '',
'arcane resist': stats.elementArcaneResist,
'fire resist': stats.elementFireResist,


+ 1
- 1
src/server/components/inventory.js Dosyayı Görüntüle

@@ -3,7 +3,7 @@ define([
'items/salvager',
'items/enchanter',
'objects/objects',
'config/classes',
'config/spirits',
'mtx/mtx',
'config/factions',
'items/itemEffects'


+ 1
- 2
src/server/components/player.js Dosyayı Görüntüle

@@ -1,6 +1,6 @@
define([
'world/atlas',
'config/classes',
'config/spirits',
'config/roles',
'config/serverConfig'
], function (
@@ -62,7 +62,6 @@ define([
for (var s in blueprintStats.stats) {
stats.stats[s] = blueprintStats.stats[s];
}
stats.vitScale = blueprintStats.vitScale;

var gainStats = classes.stats[character.class].gainStats;
for (var s in gainStats) {


+ 22
- 13
src/server/components/stats.js Dosyayı Görüntüle

@@ -1,6 +1,6 @@
define([
'config/animations',
'config/classes',
'config/spirits',
'misc/scheduler'
], function (
animations,
@@ -82,7 +82,12 @@ define([
values: baseStats,
originalValues: null,

vitScale: 10,
statScales: {
vitToHp: 10,
strToArmor: 1,
intToMana: (1 / 6),
dexToDodge: (1 / 12)
},

syncer: null,

@@ -184,12 +189,16 @@ define([
},

addStat: function (stat, value) {
var values = this.values;

if (['lvlRequire', 'allAttributes'].indexOf(stat) == -1)
this.values[stat] += value;
values[stat] += value;

var sendOnlyToSelf = (['hp', 'hpMax', 'mana', 'manaMax', 'vit'].indexOf(stat) == -1);

this.obj.syncer.setObject(sendOnlyToSelf, 'stats', 'values', stat, this.values[stat]);
this.obj.syncer.setObject(sendOnlyToSelf, 'stats', 'values', stat, values[stat]);
if (sendOnlyToSelf)
this.obj.syncer.setObject(false, 'stats', 'values', stat, values[stat]);

if (['addCritChance', 'addAttackCritChance', 'addSpellCritChance'].indexOf(stat) > -1) {
var morphStat = stat.substr(3);
@@ -200,22 +209,22 @@ define([
morphStat = morphStat[0].toLowerCase() + morphStat.substr(1);
this.addStat(morphStat, value);
} else if (stat == 'vit') {
this.values.hpMax += (value * this.vitScale);
this.obj.syncer.setObject(true, 'stats', 'values', 'hpMax', this.values.hpMax);
this.obj.syncer.setObject(false, 'stats', 'values', 'hpMax', this.values.hpMax);
this.addStat('hpMax', (value * this.statScales.vitToHp));
} else if (stat == 'allAttributes') {
['int', 'str', 'dex'].forEach(function (s) {
this.values[s] += value;
this.obj.syncer.setObject(true, 'stats', 'values', s, this.values[s]);
this.addStat(s, value)
}, this);
} else if (stat == 'elementAllResist') {
['arcane', 'frost', 'fire', 'holy', 'poison'].forEach(function (s) {
var element = 'element' + (s[0].toUpperCase() + s.substr(1)) + 'Resist';

this.values[element] += value;
this.obj.syncer.setObject(true, 'stats', 'values', element, this.values[element]);
this.addStat(element, value);
}, this);
}
} else if (stat == 'str')
this.addStat('armor', (value * this.statScales.strToArmor));
else if (stat == 'int')
this.addStat('manaMax', (value * this.statScales.intToMana));
else if (stat == 'dex')
this.addStat('dodgeAttackChance', (value * this.statScales.dexToDodge));
},

calcXpMax: function () {


+ 0
- 72
src/server/config/classes.js Dosyayı Görüntüle

@@ -1,72 +0,0 @@
define([
'../misc/events'
], function (
events
) {
var classes = {
list: ['bear', 'owl', 'lynx'],
portraits: {
bear: {
x: 0,
y: 0
},
owl: {
x: 2,
y: 0
},
lynx: {
x: 3,
y: 0
}
},
spells: {
owl: ['magic missile', 'ice spear'],
bear: ['slash', 'charge'],
lynx: ['flurry', 'smokebomb']
},
stats: {
owl: {
values: {
hpMax: 50
},
vitScale: 10,
gainStats: {
int: 1
}
},
bear: {
values: {
hpMax: 80
},
vitScale: 10,
gainStats: {
str: 1
}
},
lynx: {
values: {
hpMax: 70
},
vitScale: 10,
gainStats: {
dex: 1
}
}
},
weapons: {
owl: 'Gnarled Staff',
lynx: 'Dagger',
bear: 'Sword'
},

getSpritesheet: function (className) {
return this.stats[className].spritesheet || 'characters';
},

init: function () {
events.emit('onBeforeGetClasses', classes);
}
};

return classes;
});

+ 1
- 4
src/server/config/spirits.js Dosyayı Görüntüle

@@ -29,7 +29,6 @@ define([
values: {
hpMax: 50
},
vitScale: 10,
gainStats: {
int: 1
}
@@ -38,7 +37,6 @@ define([
values: {
hpMax: 80
},
vitScale: 10,
gainStats: {
str: 1
}
@@ -47,7 +45,6 @@ define([
values: {
hpMax: 70
},
vitScale: 10,
gainStats: {
dex: 1
}
@@ -64,7 +61,7 @@ define([
},

init: function () {
events.emit('onBeforeGetClasses', spirits);
events.emit('onBeforeGetSpirits', spirits);
}
};



+ 0
- 22
src/server/mods/class-necromancer/index.js Dosyayı Görüntüle

@@ -13,7 +13,6 @@ define([
],

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));
@@ -109,27 +108,6 @@ define([
list.push(`${this.folderName}/images/mobs.png`);
},

beforeGetClasses: function (classes) {
/*classes.spells.necromancer = ['harvest life', 'summon skeleton'];
classes.stats.necromancer = {
values: {
hpMax: 65
},
vitScale: 10,
gainStats: {
int: 1,
str: 1
},
spritesheet: `${this.folderName}/images/inGameSprite.png`
};
classes.weapons.necromancer = 'Sickle';
classes.portraits.necromancer = {
spritesheet: `${this.folderName}/images/avatar.png`,
x: 0,
y: 0
};*/
},

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


+ 1
- 1
src/server/startup.js Dosyayı Görüntüle

@@ -10,7 +10,7 @@ define([
'config/animations',
'config/skins',
'config/factions',
'config/classes',
'config/spirits',
'config/spellsConfig',
'config/spells',
'items/config/types',


+ 1
- 1
src/server/world/worker.js Dosyayı Görüntüle

@@ -19,7 +19,7 @@ requirejs([
'config/animations',
'config/skins',
'config/factions',
'config/classes',
'config/spirits',
'config/spellsConfig',
'config/spells',
'items/config/types',


Yükleniyor…
İptal
Kaydet