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!';
}
}
+1
View File
@@ -7,6 +7,7 @@
{"name": "Rings", "source": "CRB/Rings.json"},
{"name": "Rods", "source": "CRB/Rods.json"},
{"name": "Spells", "source": "CRB/Spells.json"},
{"name": "Staves", "source": "CRB/Staves.json"},
{"name": "Wands"},
{"name": "Wondrous Items", "source": "CRB/Wondrous Items.json"}
]
+25
View File
@@ -0,0 +1,25 @@
{
"data": [
{"name": "Staff of Charming", "cost": 17600, "url": "#staff-of-charming", "weight": { "medium": 15, "major": 3} },
{"name": "Staff of Fire", "cost": 18950, "url": "", "weight": { "medium": 15, "major": 6} },
{"name": "Staff of Swarming Insects", "cost": 22800, "url": "", "weight": { "medium": 15, "major": 2} },
{"name": "Staff of Size Alteration", "cost": 26150, "url": "", "weight": { "medium": 15, "major": 2} },
{"name": "Staff of Healing", "cost": 29600, "url": "", "weight": { "medium": 20, "major": 6} },
{"name": "Staff of Frost", "cost": 41400, "url": "", "weight": { "medium": 15, "major": 4} },
{"name": "Staff of Illumination", "cost": 51500, "url": "", "weight": { "medium": 5, "major": 7} },
{"name": "Staff of Defense", "cost": 62000, "url": "", "weight": { "medium": 5, "major": 7} },
{"name": "Staff of Abjuration", "cost": 82000, "url": "", "weight": { "medium": 0, "major": 7} },
{"name": "Staff of Conjuration", "cost": 82000, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Divination", "cost": 82000, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Enchantment", "cost": 82000, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Evocation", "cost": 82000, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Illusion", "cost": 82000, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Necromancy", "cost": 82000, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Transmutation", "cost": 82000, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Earth and Stone", "cost": 85800, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Woodlands", "cost": 100400, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Life", "cost": 109400, "url": "", "weight": { "medium": 0, "major": 5} },
{"name": "Staff of Passage", "cost": 206900, "url": "", "weight": { "medium": 0, "major": 3} },
{"name": "Staff of Power", "cost": 235000, "url": "", "weight": { "medium": 0, "major": 2} }
]
}
-80
View File
@@ -1,80 +0,0 @@
/*global _:false, console: true */
'use strict';
var Staves = {};
Staves.baseUrl = 'http://paizo.com/pathfinderRPG/prd/magicItems/staves.html';
Staves.getStaves = function() {
return [
{'name': 'Staff of Charming', 'cost': 17600, 'url': '#staff-of-charming'},
{'name': 'Staff of Fire', 'cost': 18950, 'url': ''},
{'name': 'Staff of Swarming Insects', 'cost': 22800, 'url': ''},
{'name': 'Staff of Size Alteration', 'cost': 26150, 'url': ''},
{'name': 'Staff of Healing', 'cost': 29600, 'url': ''},
{'name': 'Staff of Frost', 'cost': 41400, 'url': ''},
{'name': 'Staff of Illumination', 'cost': 51500, 'url': ''},
{'name': 'Staff of Defense', 'cost': 62000, 'url': ''},
{'name': 'Staff of Abjuration', 'cost': 82000, 'url': ''},
{'name': 'Staff of Conjuration', 'cost': 82000, 'url': ''},
{'name': 'Staff of Divination', 'cost': 82000, 'url': ''},
{'name': 'Staff of Enchantment', 'cost': 82000, 'url': ''},
{'name': 'Staff of Evocation', 'cost': 82000, 'url': ''},
{'name': 'Staff of Illusion', 'cost': 82000, 'url': ''},
{'name': 'Staff of Necromancy', 'cost': 82000, 'url': ''},
{'name': 'Staff of Transmutation', 'cost': 82000, 'url': ''},
{'name': 'Staff of Earth and Stone', 'cost': 85800, 'url': ''},
{'name': 'Staff of Woodlands', 'cost': 100400, 'url': ''},
{'name': 'Staff of Life', 'cost': 109400, 'url': ''},
{'name': 'Staff of Passage', 'cost': 206900, 'url': ''},
{'name': 'Staff of Power', 'cost': 235000, 'url': ''},
];
};
Staves.getStaff = function(type) {
var roll = _.random(1,100);
var staff = {};
if(type == 'minor') {
console.log('Error: There are no minor staves');
return;
}
else if(type == 'medium') {
switch(true) {
case (roll <= 15): staff = Staves.getStaves()[0]; break;
case (roll <= 30): staff = Staves.getStaves()[1]; break;
case (roll <= 40): staff = Staves.getStaves()[2]; break;
case (roll <= 55): staff = Staves.getStaves()[3]; break;
case (roll <= 75): staff = Staves.getStaves()[4]; break;
case (roll <= 90): staff = Staves.getStaves()[5]; break;
case (roll <= 95): staff = Staves.getStaves()[6]; break;
case (roll <= 100): staff = Staves.getStaves()[7]; break;
}
}
else if(type == 'major') {
switch(true) {
case (roll <= 3): staff = Staves.getStaves()[0]; break;
case (roll <= 9): staff = Staves.getStaves()[1]; break;
case (roll <= 11): staff = Staves.getStaves()[2]; break;
case (roll <= 13): staff = Staves.getStaves()[3]; break;
case (roll <= 19): staff = Staves.getStaves()[4]; break;
case (roll <= 24): staff = Staves.getStaves()[5]; break;
case (roll <= 31): staff = Staves.getStaves()[6]; break;
case (roll <= 38): staff = Staves.getStaves()[7]; break;
case (roll <= 45): staff = Staves.getStaves()[8]; break;
case (roll <= 50): staff = Staves.getStaves()[9]; break;
case (roll <= 55): staff = Staves.getStaves()[10]; break;
case (roll <= 60): staff = Staves.getStaves()[11]; break;
case (roll <= 65): staff = Staves.getStaves()[12]; break;
case (roll <= 70): staff = Staves.getStaves()[13]; break;
case (roll <= 75): staff = Staves.getStaves()[14]; break;
case (roll <= 80): staff = Staves.getStaves()[15]; break;
case (roll <= 85): staff = Staves.getStaves()[16]; break;
case (roll <= 90): staff = Staves.getStaves()[17]; break;
case (roll <= 95): staff = Staves.getStaves()[18]; break;
case (roll <= 98): staff = Staves.getStaves()[19]; break;
case (roll <= 100): staff = Staves.getStaves()[20]; break;
}
}
if(_.random(1,100) <= 30) {
staff.name += ' (with a clue as to its purpose)';
}
return staff;
};