Переглянути джерело

more work to more slottsS

tags/v0.1.9^2
Big Bad Waffle 6 роки тому
джерело
коміт
dd189791f1
12 змінених файлів з 35 додано та 27 видалено
  1. BIN
     
  2. BIN
     
  3. +5
    -4
      src/client/js/components/spellbook.js
  4. +2
    -2
      src/client/ui/templates/equipment/equipment.js
  5. +1
    -1
      src/client/ui/templates/equipment/styles.less
  6. +1
    -1
      src/client/ui/templates/equipment/template.html
  7. +1
    -1
      src/server/components/equipment.js
  8. +11
    -8
      src/server/components/inventory.js
  9. +3
    -3
      src/server/items/config/slots.js
  10. +1
    -1
      src/server/items/config/types.js
  11. +9
    -5
      src/server/items/generators/slots.js
  12. +1
    -1
      src/server/mods/class-necromancer/index.js


+ 5
- 4
src/client/js/components/spellbook.js Переглянути файл

@@ -81,10 +81,11 @@ define([
return;
}

if (this.spells.length - 1 >= s.id)
this.spells.splice(s.id, 0, s);
else
this.spells.push(s);
this.spells.push(s);

this.spells = this.spells.sort(function (a, b) {
return (a.id - b.id);
});
}, this);

events.emit('onGetSpells', this.spells);


+ 2
- 2
src/client/ui/templates/equipment/equipment.js Переглянути файл

@@ -167,8 +167,8 @@ define([
return ((!item.slot) && (item.spell) && (!item.eq));
else {
var checkSlot = (slot.indexOf('finger') == 0) ? 'finger' : slot;
if (slot == 'mainHand')
return ((!item.eq) && ((item.slot == 'mainHand') || (item.slot == 'twoHanded')));
if (slot == 'oneHanded')
return ((!item.eq) && ((item.slot == 'oneHanded') || (item.slot == 'twoHanded')));

return ((item.slot == checkSlot) && (!item.eq));
}


+ 1
- 1
src/client/ui/templates/equipment/styles.less Переглянути файл

@@ -94,7 +94,7 @@
&[slot="legs"] .icon { background-position: -384px -448px; }
&[slot="feet"] .icon { background-position: -448px -448px; }
&[slot="trinket"] .icon { background-position: -448px -384px; }
&[slot="mainHand"] .icon { background-position: -384px -384px; }
&[slot="oneHanded"] .icon { background-position: -384px -384px; }
&[slot="offHand"] .icon { background-position: -192px -384px; }
&[slot="tool"] .icon { background-position: -256px -384px; }
&[slot^="rune"] .icon { background-position: -320px -384px; }


+ 1
- 1
src/client/ui/templates/equipment/template.html Переглянути файл

@@ -76,7 +76,7 @@
<div class="icon"></div>
<div class="info"></div>
</div>
<div class="slot" slot="mainHand">
<div class="slot" slot="oneHanded">
<div class="icon"></div>
<div class="info"></div>
</div>


+ 1
- 1
src/server/components/equipment.js Переглянути файл

@@ -79,7 +79,7 @@ define([
if (currentEqId != null)
this.unequip(currentEqId);

slot = 'mainHand';
slot = 'oneHanded';
}

var equipMsg = {


+ 11
- 8
src/server/components/inventory.js Переглянути файл

@@ -59,8 +59,10 @@ define([
i--;
iLen--;
continue;
} else if ((item.slot != 'twoHanded') && (item.spell) && (!item.ability))
} else if (((item.slot != 'twoHanded') && (item.slot != 'oneHanded')) && (item.spell) && (!item.ability))
delete item.spell;
else if (item.slot == 'mainHand')
item.slot = 'oneHanded';

while (item.name.indexOf(`''`) > -1) {
item.name = item.name.replace(`''`, `'`);
@@ -175,13 +177,15 @@ define([

var spellbook = this.obj.spellbook;

if (item.slot == 'twoHanded')
if ((item.slot == 'twoHanded') || (item.slot == 'oneHanded'))
runeSlot = 0;
else if (runeSlot == null) {
if (!this.items.some(i => (i.runeSlot == 2)))
runeSlot = 2;
else
runeSlot = 1;
for (var i = 1; i < 3; i++) {
if (!this.items.some(i => (i.runeSlot == i))) {
runeSlot = i;
break;
}
}
}

var currentEq = this.items.find(i => (i.runeSlot == runeSlot));
@@ -495,13 +499,12 @@ define([
(i.spell) &&
(i.spell.rolls) &&
(i.spell.rolls.damage != null) &&
(i.slot == 'twoHanded')
((i.slot == 'twoHanded') || (i.slot == 'oneHanded'))
);
});

if (!hasWeapon) {
var item = generator.generate({
slot: 'twoHanded',
type: classes.weapons[this.obj.class],
quality: 0,
spellQuality: 'mid'


+ 3
- 3
src/server/items/config/slots.js Переглянути файл

@@ -14,7 +14,7 @@ define([
'legs',
'feet',
'trinket',
'mainHand',
'oneHanded',
'twoHanded',
'offHand',
'tool'
@@ -30,7 +30,7 @@ define([
legs: 100,
feet: 90,
trinket: 35,
mainHand: 60,
oneHanded: 60,
twoHanded: 60,
offHand: 40,
tool: 0
@@ -46,7 +46,7 @@ define([
legs: 0.2,
feet: 0.1,
trinket: 0,
mainHand: 0,
oneHanded: 0,
twoHanded: 0,
offHand: 0,
tool: 0


+ 1
- 1
src/server/items/config/types.js Переглянути файл

@@ -157,7 +157,7 @@ define([
sprite: [8, 4]
}
},
mainHand: {
oneHanded: {
'Sword': {
sprite: [9, 0],
spellName: 'slash'


+ 9
- 5
src/server/items/generators/slots.js Переглянути файл

@@ -1,7 +1,9 @@
define([
'../config/slots'
], function(
configSlots
'../config/slots',
'../config/types'
], function (
configSlots,
configTypes
) {
var chances = [];
for (var c in configSlots.chance) {
@@ -12,9 +14,11 @@ define([
}

var generator = {
generate: function(item, blueprint) {
generate: function (item, blueprint) {
if (blueprint.slot)
item.slot = blueprint.slot;
else if (blueprint.type)
item.slot = Object.keys(configTypes.types).find(c => configTypes.types[c][blueprint.type]);
else
item.slot = chances[~~(Math.random() * chances.length)];

@@ -26,4 +30,4 @@ define([
};

return generator;
});
});

+ 1
- 1
src/server/mods/class-necromancer/index.js Переглянути файл

@@ -122,7 +122,7 @@ define([

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


Завантаження…
Відмінити
Зберегти