Browse Source

fixed a bug caused by #1447 that made weapon abilities always common (colour, not damage)

tags/v0.6^2
Shaun 4 years ago
parent
commit
e1862b08ac
1 changed files with 17 additions and 16 deletions
  1. +17
    -16
      src/server/items/generators/spellbook.js

+ 17
- 16
src/server/items/generators/spellbook.js View File

@@ -5,21 +5,7 @@ let configTypes = require('../config/types');
const qualityGenerator = require('./quality');
const qualityCount = qualityGenerator.qualities.length;

const buildRolls = (item, blueprint, { random: spellProperties, negativeStats = [] }) => {
//If the item has a slot, we need to generate a new quality for the rune
let quality = item.quality;
if (item.slot) {
const tempItem = {};

const tempBlueprint = extend(blueprint);
delete tempBlueprint.quality;
tempBlueprint.quality = blueprint.spellQuality;

qualityGenerator.generate(tempItem, tempBlueprint);

quality = tempItem.quality;
}

const buildRolls = (item, blueprint, { random: spellProperties, negativeStats = [] }, quality) => {
//We randomise the order so a random property gets to 'pick first'
// otherwise it's easier for earlier properties to use more of the valuePool
const propKeys = Object
@@ -107,7 +93,22 @@ module.exports = {
extend(spell, typeConfig.spellConfig);
}

const rolls = buildRolls(item, blueprint, spell);
//If the item has a slot, we need to generate a new quality for the rune
let quality = item.quality;
if (item.slot) {
const tempItem = {};

const tempBlueprint = extend(blueprint);
delete tempBlueprint.quality;
tempBlueprint.quality = blueprint.spellQuality;

qualityGenerator.generate(tempItem, tempBlueprint);

quality = tempItem.quality;
item.spell.quality = quality;
}

const rolls = buildRolls(item, blueprint, spell, quality);
Object.entries(spell.random || {}).forEach(entry => {
const [ property, range ] = entry;


Loading…
Cancel
Save