mirror of
https://github.com/RussellChamp/GrimoireJS.git
synced 2026-10-27 22:42:32 +00:00
Added disableRecursiveSpecials option to armorandshields
This commit is contained in:
1 parent
c368663ee6
commit
86304961c3
1 file changed
+5
-1
+5
-1
@@ -669,7 +669,8 @@ var Grimoire = function(config) { // jshint ignore:line
|
|||||||
} else if(/GET_ENERGY_RESISTANCE_TYPE/.test(special.name)) {
|
} else if(/GET_ENERGY_RESISTANCE_TYPE/.test(special.name)) {
|
||||||
special.name = special.name.replace(/GET_ENERGY_RESISTANCE_TYPE/, self.getEnergyType(options));
|
special.name = special.name.replace(/GET_ENERGY_RESISTANCE_TYPE/, self.getEnergyType(options));
|
||||||
}
|
}
|
||||||
} while(options.excludeSpecials.indexOf(special) != -1); //if we get something from our exclusions, try again
|
|
||||||
|
} while(_.chain(options.excludeSpecials).map(function(s) { return s.name; }).includes(special.name).value()); //if we get something from our exclusions, try again
|
||||||
specials.push(special);
|
specials.push(special);
|
||||||
|
|
||||||
var roll = chance.d100();
|
var roll = chance.d100();
|
||||||
@@ -861,6 +862,7 @@ var Grimoire = function(config) { // jshint ignore:line
|
|||||||
options.uniqueType = (options.type == 'armor' ? 'uniqueArmors' :
|
options.uniqueType = (options.type == 'armor' ? 'uniqueArmors' :
|
||||||
options.type == 'shield' ? 'uniqueShields' :
|
options.type == 'shield' ? 'uniqueShields' :
|
||||||
chance.pick(['uniqueArmors', 'uniqueShields'])); //50-50 chance if type is not selected
|
chance.pick(['uniqueArmors', 'uniqueShields'])); //50-50 chance if type is not selected
|
||||||
|
options.disableRecursiveSpecials = options.disableRecursiveSpecials || false;
|
||||||
|
|
||||||
var sources = options.sources ? options.sources : self.SOURCES;
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
|
||||||
@@ -1013,6 +1015,7 @@ var Grimoire = function(config) { // jshint ignore:line
|
|||||||
item.url = unique.url;
|
item.url = unique.url;
|
||||||
}
|
}
|
||||||
else if(action == 'getSpecial') {
|
else if(action == 'getSpecial') {
|
||||||
|
if(item.specials.length === 0 || options.disableRecursiveSpecials === false) {
|
||||||
item = self.getArmorOrShield(quality, options);
|
item = self.getArmorOrShield(quality, options);
|
||||||
var specialsBonus = _.chain(item.specials).map(function(s) { return s.bonus; }).sum().value();
|
var specialsBonus = _.chain(item.specials).map(function(s) { return s.bonus; }).sum().value();
|
||||||
|
|
||||||
@@ -1033,6 +1036,7 @@ var Grimoire = function(config) { // jshint ignore:line
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var totalBonus = item.bonus + _.sum(_.map(item.specials, function(s) { return s.bonsu; }));
|
var totalBonus = item.bonus + _.sum(_.map(item.specials, function(s) { return s.bonsu; }));
|
||||||
|
|||||||
Reference in new issue
Block a user