Browse Source

when item reroll generates a new kind of implicit, the old one is returned

tags/v0.4^2
Big Bad Waffle 4 years ago
parent
commit
c2f7624c90
4 changed files with 53 additions and 34 deletions
  1. +6
    -1
      src/server/config/itemEffects/castSpellOnHit.js
  2. +26
    -26
      src/server/config/maps/sewer/map.json
  3. +6
    -6
      src/server/config/maps/sewer/zone.js
  4. +15
    -1
      src/server/items/enchanter.js

+ 6
- 1
src/server/config/itemEffects/castSpellOnHit.js View File

@@ -5,10 +5,15 @@ module.exports = {
onGetText: function (item) {
const { rolls: { chance, spell } } = item.effects.find(e => (e.type === 'castSpellOnHit'));

return `${chance}% chance on cast ${spell} on hit`;
return `${chance}% chance to cast ${spell} on hit`;
},

afterDealDamage: function (item, damage, target) {
//Should only proc for attacks...this is kind of a hack
const { element } = damage;
if (element)
return;

const { rolls: { chance, spell } } = item.effects.find(e => (e.type === 'castSpellOnHit'));

const chanceRoll = Math.random() * 100;


+ 26
- 26
src/server/config/maps/sewer/map.json
File diff suppressed because it is too large
View File


+ 6
- 6
src/server/config/maps/sewer/zone.js View File

@@ -77,13 +77,13 @@ module.exports = {
i_chance: [20, 60],
spell: 'smokeBomb'
}
}, {
chance: 100,
type: 'recipe',
name: 'Recipe: Rune of Whirlwind',
profession: 'etching',
teaches: 'runeWhirlwind'
}]
}, {
chance: 100,
type: 'recipe',
name: 'Recipe: Rune of Whirlwind',
profession: 'etching',
teaches: 'runeWhirlwind'
}]
}
},


+ 15
- 1
src/server/items/enchanter.js View File

@@ -8,7 +8,9 @@ let configSlots = require('./config/slots');
let generator = require('./generator');

const reroll = (item, msg) => {
let enchantedStats = item.enchantedStats;
const enchantedStats = item.enchantedStats;
const implicitStats = item.implicitStats;

delete item.enchantedStats;
delete item.implicitStats;
delete msg.addStatMsgs;
@@ -45,6 +47,18 @@ const reroll = (item, msg) => {
}
}
item.enchantedStats = enchantedStats || null;

//Some items have special implicits (different stats than their types imply)
// We add the old one back in if this is the case. Ideally we'd like to reroll
// these but that'd be a pretty big hack. We'll solve this one day
if (
item.implicitStats &&
implicitStats &&
item.implicitStats[0] &&
implicitStats[0] &&
item.implicitStats[0].stat !== implicitStats[0].stat
)
item.implicitStats = implicitStats;
};

const relevel = item => {


Loading…
Cancel
Save