Added CRB Staves

This commit is contained in:
Russell Champoux committed 2015-03-11 18:07:35 -04:00
1 parent 6028b7a3fe
commit 1b4176c5f1
4 files changed
+32 -83

No files matched your search

+6 -3
View File
@@ -195,8 +195,8 @@ var Grimoire = function(config) {
//***EVERYTHING ELSE***
//*********************
else {
if(type == TYPES.RODS && quality == QUALITIES.MINOR) {
console.log('Error! There are no ' + QUALITIES.MINOR + ' ' + TYPES.RODS);
if((type == TYPES.RODS || type == TYPES.STAVES) && quality == QUALITIES.MINOR) {
console.log('Error! There are no ' + QUALITIES.MINOR + ' ' + type);
return;
}
//Determine which source to use
@@ -272,7 +272,10 @@ var Grimoire = function(config) {
source = selectSource(sources, quality, itemType, options);
item = _.clone(chance.pick(source.data[itemType].data[quality]));
item.source = source.shortName;
if(options.allIntelligent || (!options.disableIntelligent && chance.d100() == 1)) {
//make an intelligent item if we either want ALL intelligent items
//OR intelligent items are NOT disabled AND we roll under the chance threshold
if(options.allIntelligent || (!options.disableIntelligent && chance.d100() <= (options.intelligenceChance || 1))) {
item.intelligence = 'WOOHOO I AM INTELLIGENT!';
}
}