Pull out gear into separate modules

This commit is contained in:
Blade Barringer
2015-11-16 17:29:13 -06:00
parent 2b8cf178b0
commit 639dfb31d7
29 changed files with 3022 additions and 5567 deletions

View File

@@ -0,0 +1,5 @@
export function ownsItem (item) {
return (user) => {
return item && user.items.gear.owned[item];
};
}

View File

@@ -0,0 +1,84 @@
import {each, defaults} from 'lodash';
import moment from 'moment';
import {
CLASSES,
GEAR_TYPES,
} from '../constants';
import { ownsItem } from './gear-helper';
import weapon from './weapon';
import armor from './armor';
import head from './head';
import shield from './shield';
import back from './back';
import body from './body';
import headAccessory from './head-accessory';
import eyewear from './eyewear';
let gear = {
weapon,
armor,
head,
shield,
back,
body,
headAccessory,
eyewear,
};
/*
The gear is exported as a tree (defined above), and a flat list (eg, {weapon_healer_1: .., shield_special_0: ...}) since
they are needed in different forms at different points in the app
*/
let flat = {};
each(GEAR_TYPES, (type) => {
let allGearTypes = CLASSES.concat(['base', 'special', 'mystery', 'armoire']);
each(allGearTypes, (klass) => {
each(gear[type][klass], (item, index) => {
let key = `${type}_${klass}_${index}`;
defaults(item, {
type,
key,
klass,
index,
str: 0,
int: 0,
per: 0,
con: 0,
canBuy: () => {
return false;
},
});
if (item.event) {
let canOwnFuncTrue = () => {
return true;
};
let _canOwn = item.canOwn || canOwnFuncTrue;
item.canOwn = (user) => {
let userOwnsItem = Boolean(user.items.gear.owned[key]);
let eventIsCurrent = moment().isAfter(item.event.start) && moment().isBefore(item.event.end);
let compatibleWithUserClass = item.specialClass ? user.stats.class === item.specialClass : true;
return _canOwn(user) && (userOwnsItem || eventIsCurrent) && compatibleWithUserClass;
};
}
if (item.mystery) {
item.canOwn = ownsItem(key);
}
flat[key] = item;
});
});
});
export default {
tree: gear,
flat,
};

View File

@@ -0,0 +1,351 @@
import { ownsItem } from '../gear-helper';
import t from '../../translation';
let armor = {
lunarArmor: {
text: t('armorArmoireLunarArmorText'),
notes: t('armorArmoireLunarArmorNotes', { str: 7, int: 7 }),
value: 100,
str: 7,
int: 7,
set: 'soothing',
canOwn: ownsItem('armor_armoire_lunarArmor'),
},
gladiatorArmor: {
text: t('armorArmoireGladiatorArmorText'),
notes: t('armorArmoireGladiatorArmorNotes', { str: 7, per: 7 }),
value: 100,
str: 7,
per: 7,
set: 'gladiator',
canOwn: ownsItem('armor_armoire_gladiatorArmor '),
},
rancherRobes: {
text: t('armorArmoireRancherRobesText'),
notes: t('armorArmoireRancherRobesNotes', { str: 5, per: 5, int: 5 }),
value: 100,
str: 5,
per: 5,
int: 5,
set: 'rancher',
canOwn: ownsItem('armor_armoire_rancherRobes '),
},
goldenToga: {
text: t('armorArmoireGoldenTogaText'),
notes: t('armorArmoireGoldenTogaNotes', { attrs: 8 }),
value: 100,
str: 8,
con: 8,
set: 'goldenToga',
canOwn: ownsItem('armor_armoire_goldenToga '),
},
hornedIronArmor: {
text: t('armorArmoireHornedIronArmorText'),
notes: t('armorArmoireHornedIronArmorNotes', { con: 9, per: 7 }),
value: 100,
con: 9,
per: 7,
set: 'hornedIron',
canOwn: ownsItem('armor_armoire_hornedIronArmor '),
},
plagueDoctorOvercoat: {
text: t('armorArmoirePlagueDoctorOvercoatText'),
notes: t('armorArmoirePlagueDoctorOvercoatNotes', { int: 6, str: 5, con: 6 }),
value: 100,
int: 6,
str: 5,
con: 6,
set: 'plagueDoctor',
canOwn: ownsItem('armor_armoire_plagueDoctorOvercoat '),
},
shepherdRobes: {
text: t('armorArmoireShepherdRobesText'),
notes: t('armorArmoireShepherdRobesNotes', { attrs: 9 }),
value: 100,
str: 9,
per: 9,
set: 'shepherd',
canOwn: ownsItem('armor_armoire_shepherdRobes '),
},
royalRobes: {
text: t('armorArmoireRoyalRobesText'),
notes: t('armorArmoireRoyalRobesNotes', { attrs: 5 }),
value: 100,
con: 5,
per: 5,
int: 5,
set: 'royal',
canOwn: ownsItem('armor_armoire_royalRobes '),
},
};
let eyewear = {
plagueDoctorMask: {
text: t('eyewearArmoirePlagueDoctorMaskText'),
notes: t('eyewearArmoirePlagueDoctorMaskNotes'),
value: 100,
set: 'plagueDoctor',
canOwn: ownsItem('eyewear_armoire_plagueDoctorMask '),
},
};
let head = {
lunarCrown: {
text: t('headArmoireLunarCrownText'),
notes: t('headArmoireLunarCrownNotes', { con: 7, per: 7 }),
value: 100,
con: 7,
per: 7,
set: 'soothing',
canOwn: ownsItem('head_armoire_lunarCrown '),
},
redHairbow: {
text: t('headArmoireRedHairbowText'),
notes: t('headArmoireRedHairbowNotes', { str: 5, int: 5, con: 5 }),
value: 100,
str: 5,
int: 5,
con: 5,
canOwn: ownsItem('head_armoire_redHairbow '),
},
violetFloppyHat: {
text: t('headArmoireVioletFloppyHatText'),
notes: t('headArmoireVioletFloppyHatNotes', { per: 5, int: 5, con: 5 }),
value: 100,
per: 5,
int: 5,
con: 5,
canOwn: ownsItem('head_armoire_violetFloppyHat '),
},
gladiatorHelm: {
text: t('headArmoireGladiatorHelmText'),
notes: t('headArmoireGladiatorHelmNotes', { per: 7, int: 7 }),
value: 100,
per: 7,
int: 7,
set: 'gladiator',
canOwn: ownsItem('head_armoire_gladiatorHelm '),
},
rancherHat: {
text: t('headArmoireRancherHatText'),
notes: t('headArmoireRancherHatNotes', { str: 5, per: 5, int: 5 }),
value: 100,
str: 5,
per: 5,
int: 5,
set: 'rancher',
canOwn: ownsItem('head_armoire_rancherHat '),
},
royalCrown: {
text: t('headArmoireRoyalCrownText'),
notes: t('headArmoireRoyalCrownNotes', { str: 10 }),
value: 100,
str: 10,
set: 'royal',
canOwn: ownsItem('head_armoire_royalCrown '),
},
blueHairbow: {
text: t('headArmoireBlueHairbowText'),
notes: t('headArmoireBlueHairbowNotes', { per: 5, int: 5, con: 5 }),
value: 100,
per: 5,
int: 5,
con: 5,
canOwn: ownsItem('head_armoire_blueHairbow '),
},
goldenLaurels: {
text: t('headArmoireGoldenLaurelsText'),
notes: t('headArmoireGoldenLaurelsNotes', { attrs: 8 }),
value: 100,
per: 8,
con: 8,
set: 'goldenToga',
canOwn: ownsItem('head_armoire_goldenLaurels '),
},
hornedIronHelm: {
text: t('headArmoireHornedIronHelmText'),
notes: t('headArmoireHornedIronHelmNotes', { con: 9, str: 7 }),
value: 100,
con: 9,
str: 7,
set: 'hornedIron',
canOwn: ownsItem('head_armoire_hornedIronHelm '),
},
yellowHairbow: {
text: t('headArmoireYellowHairbowText'),
notes: t('headArmoireYellowHairbowNotes', { attrs: 5 }),
value: 100,
int: 5,
per: 5,
str: 5,
canOwn: ownsItem('head_armoire_yellowHairbow '),
},
redFloppyHat: {
text: t('headArmoireRedFloppyHatText'),
notes: t('headArmoireRedFloppyHatNotes', { attrs: 6 }),
value: 100,
con: 6,
int: 6,
per: 6,
canOwn: ownsItem('head_armoire_redFloppyHat '),
},
plagueDoctorHat: {
text: t('headArmoirePlagueDoctorHatText'),
notes: t('headArmoirePlagueDoctorHatNotes', { int: 5, str: 6, con: 5 }),
value: 100,
int: 5,
str: 6,
con: 5,
set: 'plagueDoctor',
canOwn: ownsItem('head_armoire_plagueDoctorHat '),
},
blackCat: {
text: t('headArmoireBlackCatText'),
notes: t('headArmoireBlackCatNotes', { attrs: 9 }),
value: 100,
int: 9,
per: 9,
canOwn: ownsItem('head_armoire_blackCat '),
},
orangeCat: {
text: t('headArmoireOrangeCatText'),
notes: t('headArmoireOrangeCatNotes', { attrs: 9 }),
value: 100,
con: 9,
str: 9,
canOwn: ownsItem('head_armoire_orangeCat '),
},
blueFloppyHat: {
text: t('headArmoireBlueFloppyHatText'),
notes: t('headArmoireBlueFloppyHatNotes', { attrs: 7 }),
value: 100,
per: 7,
int: 7,
con: 7,
canOwn: ownsItem('head_armoire_blueFloppyHat '),
},
shepherdHeaddress: {
text: t('headArmoireShepherdHeaddressText'),
notes: t('headArmoireShepherdHeaddressNotes', { int: 9 }),
value: 100,
int: 9,
set: 'shepherd',
canOwn: ownsItem('head_armoire_shepherdHeaddress '),
},
};
let shield = {
gladiatorShield: {
text: t('shieldArmoireGladiatorShieldText'),
notes: t('shieldArmoireGladiatorShieldNotes', { con: 5, str: 5 }),
value: 100,
con: 5,
str: 5,
set: 'gladiator',
canOwn: ownsItem('shield_armoire_gladiatorShield '),
},
midnightShield: {
text: t('shieldArmoireMidnightShieldText'),
notes: t('shieldArmoireMidnightShieldNotes', { con: 10, str: 2 }),
value: 100,
con: 10,
str: 2,
canOwn: ownsItem('shield_armoire_midnightShield '),
},
royalCane: {
text: t('shieldArmoireRoyalCaneText'),
notes: t('shieldArmoireRoyalCaneNotes', { attrs: 5 }),
value: 100,
con: 5,
int: 5,
per: 5,
set: 'royal',
canOwn: ownsItem('shield_armoire_royalCane '),
},
};
let weapon = {
basicCrossbow: {
text: t('weaponArmoireBasicCrossbowText'),
notes: t('weaponArmoireBasicCrossbowNotes', { str: 5, per: 5, con: 5 }),
value: 100,
str: 5,
per: 5,
con: 5,
canOwn: ownsItem('weapon_armoire_basicCrossbow '),
},
lunarSceptre: {
text: t('weaponArmoireLunarSceptreText'),
notes: t('weaponArmoireLunarSceptreNotes', { con: 7, int: 7 }),
value: 100,
con: 7,
int: 7,
set: 'soothing',
canOwn: ownsItem('weapon_armoire_lunarSceptre '),
},
rancherLasso: {
twoHanded: true,
text: t('weaponArmoireRancherLassoText'),
notes: t('weaponArmoireRancherLassoNotes', { str: 5, per: 5, int: 5 }),
value: 100,
str: 5,
per: 5,
int: 5,
set: 'rancher',
canOwn: ownsItem('weapon_armoire_rancherLasso '),
},
mythmakerSword: {
text: t('weaponArmoireMythmakerSwordText'),
notes: t('weaponArmoireMythmakerSwordNotes', { attrs: 6 }),
value: 100,
str: 6,
per: 6,
set: 'goldenToga',
canOwn: ownsItem('weapon_armoire_mythmakerSword '),
},
ironCrook: {
text: t('weaponArmoireIronCrookText'),
notes: t('weaponArmoireIronCrookNotes', { attrs: 7 }),
value: 100,
str: 7,
per: 7,
set: 'hornedIron',
canOwn: ownsItem('weapon_armoire_ironCrook '),
},
goldWingStaff: {
text: t('weaponArmoireGoldWingStaffText'),
notes: t('weaponArmoireGoldWingStaffNotes', { attrs: 4 }),
value: 100,
con: 4,
int: 4,
per: 4,
str: 4,
canOwn: ownsItem('weapon_armoire_goldWingStaff '),
},
batWand: {
text: t('weaponArmoireBatWandText'),
notes: t('weaponArmoireBatWandNotes', { int: 10, per: 2 }),
value: 100,
int: 10,
per: 2,
canOwn: ownsItem('weapon_armoire_batWand '),
},
shepherdsCrook: {
text: t('weaponArmoireShepherdsCrookText'),
notes: t('weaponArmoireShepherdsCrookNotes', { con: 9 }),
value: 100,
con: 9,
set: 'shepherd',
canOwn: ownsItem('weapon_armoire_shepherdsCrook '),
},
};
let armoireSet = {
armor,
eyewear,
head,
shield,
weapon,
};
export default armoireSet;

View File

@@ -0,0 +1,80 @@
import t from '../../translation';
let armor = {
0: {
text: t('armorBase0Text'),
notes: t('armorBase0Notes'),
value: 0,
},
};
let back = {
0: {
text: t('backBase0Text'),
notes: t('backBase0Notes'),
value: 0,
},
};
let body = {
0: {
text: t('bodyBase0Text'),
notes: t('bodyBase0Notes'),
value: 0,
},
};
let eyewear = {
0: {
text: t('eyewearBase0Text'),
notes: t('eyewearBase0Notes'),
value: 0,
last: true,
},
};
let head = {
0: {
text: t('headBase0Text'),
notes: t('headBase0Notes'),
value: 0,
},
};
let headAccessory = {
0: {
text: t('headAccessoryBase0Text'),
notes: t('headAccessoryBase0Notes'),
value: 0,
last: true,
},
};
let shield = {
0: {
text: t('shieldBase0Text'),
notes: t('shieldBase0Notes'),
value: 0,
},
};
let weapon = {
0: {
text: t('weaponBase0Text'),
notes: t('weaponBase0Notes'),
value: 0,
},
};
let baseSet = {
armor,
back,
body,
eyewear,
head,
headAccessory,
shield,
weapon,
};
export default baseSet;

View File

@@ -0,0 +1,158 @@
import t from '../../translation';
let armor = {
1: {
text: t('armorHealer1Text'),
notes: t('armorHealer1Notes', { con: 6 }),
con: 6,
value: 30,
},
2: {
text: t('armorHealer2Text'),
notes: t('armorHealer2Notes', { con: 9 }),
con: 9,
value: 45,
},
3: {
text: t('armorHealer3Text'),
notes: t('armorHealer3Notes', { con: 12 }),
con: 12,
value: 65,
},
4: {
text: t('armorHealer4Text'),
notes: t('armorHealer4Notes', { con: 15 }),
con: 15,
value: 90,
},
5: {
text: t('armorHealer5Text'),
notes: t('armorHealer5Notes', { con: 18 }),
con: 18,
value: 120,
last: true,
},
};
let head = {
1: {
text: t('headHealer1Text'),
notes: t('headHealer1Notes', { int: 2 }),
int: 2,
value: 15,
},
2: {
text: t('headHealer2Text'),
notes: t('headHealer2Notes', { int: 3 }),
int: 3,
value: 25,
},
3: {
text: t('headHealer3Text'),
notes: t('headHealer3Notes', { int: 5 }),
int: 5,
value: 40,
},
4: {
text: t('headHealer4Text'),
notes: t('headHealer4Notes', { int: 7 }),
int: 7,
value: 60,
},
5: {
text: t('headHealer5Text'),
notes: t('headHealer5Notes', { int: 9 }),
int: 9,
value: 80,
last: true,
},
};
let shield = {
1: {
text: t('shieldHealer1Text'),
notes: t('shieldHealer1Notes', { con: 2 }),
con: 2,
value: 20,
},
2: {
text: t('shieldHealer2Text'),
notes: t('shieldHealer2Notes', { con: 4 }),
con: 4,
value: 35,
},
3: {
text: t('shieldHealer3Text'),
notes: t('shieldHealer3Notes', { con: 6 }),
con: 6,
value: 50,
},
4: {
text: t('shieldHealer4Text'),
notes: t('shieldHealer4Notes', { con: 9 }),
con: 9,
value: 70,
},
5: {
text: t('shieldHealer5Text'),
notes: t('shieldHealer5Notes', { con: 12 }),
con: 12,
value: 90,
last: true,
},
};
let weapon = {
0: {
text: t('weaponHealer0Text'),
notes: t('weaponHealer0Notes'),
value: 0,
},
1: {
text: t('weaponHealer1Text'),
notes: t('weaponHealer1Notes', { int: 2 }),
int: 2,
value: 20,
},
2: {
text: t('weaponHealer2Text'),
notes: t('weaponHealer2Notes', { int: 3 }),
int: 3,
value: 30,
},
3: {
text: t('weaponHealer3Text'),
notes: t('weaponHealer3Notes', { int: 5 }),
int: 5,
value: 45,
},
4: {
text: t('weaponHealer4Text'),
notes: t('weaponHealer4Notes', { int: 7 }),
int: 7,
value: 65,
},
5: {
text: t('weaponHealer5Text'),
notes: t('weaponHealer5Notes', { int: 9 }),
int: 9,
value: 90,
},
6: {
text: t('weaponHealer6Text'),
notes: t('weaponHealer6Notes', { int: 11 }),
int: 11,
value: 120,
last: true,
},
};
let healerSet = {
armor,
head,
shield,
weapon,
};
export default healerSet;

View File

@@ -0,0 +1,340 @@
import t from '../../translation';
let armor = {
201402: {
text: t('armorMystery201402Text'),
notes: t('armorMystery201402Notes'),
mystery: '201402',
value: 0,
},
201403: {
text: t('armorMystery201403Text'),
notes: t('armorMystery201403Notes'),
mystery: '201403',
value: 0,
},
201405: {
text: t('armorMystery201405Text'),
notes: t('armorMystery201405Notes'),
mystery: '201405',
value: 0,
},
201406: {
text: t('armorMystery201406Text'),
notes: t('armorMystery201406Notes'),
mystery: '201406',
value: 0,
},
201407: {
text: t('armorMystery201407Text'),
notes: t('armorMystery201407Notes'),
mystery: '201407',
value: 0,
},
201408: {
text: t('armorMystery201408Text'),
notes: t('armorMystery201408Notes'),
mystery: '201408',
value: 0,
},
201409: {
text: t('armorMystery201409Text'),
notes: t('armorMystery201409Notes'),
mystery: '201409',
value: 0,
},
201410: {
text: t('armorMystery201410Text'),
notes: t('armorMystery201410Notes'),
mystery: '201410',
value: 0,
},
201412: {
text: t('armorMystery201412Text'),
notes: t('armorMystery201412Notes'),
mystery: '201412',
value: 0,
},
201501: {
text: t('armorMystery201501Text'),
notes: t('armorMystery201501Notes'),
mystery: '201501',
value: 0,
},
201503: {
text: t('armorMystery201503Text'),
notes: t('armorMystery201503Notes'),
mystery: '201503',
value: 0,
},
201504: {
text: t('armorMystery201504Text'),
notes: t('armorMystery201504Notes'),
mystery: '201504',
value: 0,
},
201506: {
text: t('armorMystery201506Text'),
notes: t('armorMystery201506Notes'),
mystery: '201506',
value: 0,
},
201508: {
text: t('armorMystery201508Text'),
notes: t('armorMystery201508Notes'),
mystery: '201508',
value: 0,
},
201509: {
text: t('armorMystery201509Text'),
notes: t('armorMystery201509Notes'),
mystery: '201509',
value: 0,
},
301404: {
text: t('armorMystery301404Text'),
notes: t('armorMystery301404Notes'),
mystery: '301404',
value: 0,
},
};
let back = {
201402: {
text: t('backMystery201402Text'),
notes: t('backMystery201402Notes'),
mystery: '201402',
value: 0,
},
201404: {
text: t('backMystery201404Text'),
notes: t('backMystery201404Notes'),
mystery: '201404',
value: 0,
},
201410: {
text: t('backMystery201410Text'),
notes: t('backMystery201410Notes'),
mystery: '201410',
value: 0,
},
201504: {
text: t('backMystery201504Text'),
notes: t('backMystery201504Notes'),
mystery: '201504',
value: 0,
},
201507: {
text: t('backMystery201507Text'),
notes: t('backMystery201507Notes'),
mystery: '201507',
value: 0,
},
201510: {
text: t('backMystery201510Text'),
notes: t('backMystery201510Notes'),
mystery: '201510',
value: 0,
},
};
let eyewear = {
201503: {
text: t('eyewearMystery201503Text'),
notes: t('eyewearMystery201503Notes'),
mystery: '201503',
value: 0,
},
201506: {
text: t('eyewearMystery201506Text'),
notes: t('eyewearMystery201506Notes'),
mystery: '201506',
value: 0,
},
201507: {
text: t('eyewearMystery201507Text'),
notes: t('eyewearMystery201507Notes'),
mystery: '201507',
value: 0,
},
301404: {
text: t('eyewearMystery301404Text'),
notes: t('eyewearMystery301404Notes'),
mystery: '301404',
value: 0,
},
301405: {
text: t('eyewearMystery301405Text'),
notes: t('eyewearMystery301405Notes'),
mystery: '301405',
value: 0,
},
};
let head = {
201402: {
text: t('headMystery201402Text'),
notes: t('headMystery201402Notes'),
mystery: '201402',
value: 0,
},
201405: {
text: t('headMystery201405Text'),
notes: t('headMystery201405Notes'),
mystery: '201405',
value: 0,
},
201406: {
text: t('headMystery201406Text'),
notes: t('headMystery201406Notes'),
mystery: '201406',
value: 0,
},
201407: {
text: t('headMystery201407Text'),
notes: t('headMystery201407Notes'),
mystery: '201407',
value: 0,
},
201408: {
text: t('headMystery201408Text'),
notes: t('headMystery201408Notes'),
mystery: '201408',
value: 0,
},
201411: {
text: t('headMystery201411Text'),
notes: t('headMystery201411Notes'),
mystery: '201411',
value: 0,
},
201412: {
text: t('headMystery201412Text'),
notes: t('headMystery201412Notes'),
mystery: '201412',
value: 0,
},
201501: {
text: t('headMystery201501Text'),
notes: t('headMystery201501Notes'),
mystery: '201501',
value: 0,
},
201505: {
text: t('headMystery201505Text'),
notes: t('headMystery201505Notes'),
mystery: '201505',
value: 0,
},
201508: {
text: t('headMystery201508Text'),
notes: t('headMystery201508Notes'),
mystery: '201508',
value: 0,
},
201509: {
text: t('headMystery201509Text'),
notes: t('headMystery201509Notes'),
mystery: '201509',
value: 0,
},
301404: {
text: t('headMystery301404Text'),
notes: t('headMystery301404Notes'),
mystery: '301404',
value: 0,
},
301405: {
text: t('headMystery301405Text'),
notes: t('headMystery301405Notes'),
mystery: '301405',
value: 0,
},
};
let headAccessory = {
201403: {
text: t('headAccessoryMystery201403Text'),
notes: t('headAccessoryMystery201403Notes'),
mystery: '201403',
value: 0,
},
201404: {
text: t('headAccessoryMystery201404Text'),
notes: t('headAccessoryMystery201404Notes'),
mystery: '201404',
value: 0,
},
201409: {
text: t('headAccessoryMystery201409Text'),
notes: t('headAccessoryMystery201409Notes'),
mystery: '201409',
value: 0,
},
201502: {
text: t('headAccessoryMystery201502Text'),
notes: t('headAccessoryMystery201502Notes'),
mystery: '201502',
value: 0,
},
201510: {
text: t('headAccessoryMystery201510Text'),
notes: t('headAccessoryMystery201510Notes'),
mystery: '201510',
value: 0,
},
301405: {
text: t('headAccessoryMystery301405Text'),
notes: t('headAccessoryMystery301405Notes'),
mystery: '301405',
value: 0,
},
};
let shield = {
301405: {
text: t('shieldMystery301405Text'),
notes: t('shieldMystery301405Notes'),
mystery: '301405',
value: 0,
},
};
let weapon = {
201411: {
text: t('weaponMystery201411Text'),
notes: t('weaponMystery201411Notes'),
mystery: '201411',
value: 0,
},
201502: {
text: t('weaponMystery201502Text'),
notes: t('weaponMystery201502Notes'),
mystery: '201502',
value: 0,
},
201505: {
text: t('weaponMystery201505Text'),
notes: t('weaponMystery201505Notes'),
mystery: '201505',
value: 0,
},
301404: {
text: t('weaponMystery301404Text'),
notes: t('weaponMystery301404Notes'),
mystery: '301404',
value: 0,
},
};
let mysterySet = {
armor,
back,
eyewear,
head,
headAccessory,
shield,
weapon,
};
export default mysterySet;

View File

@@ -0,0 +1,170 @@
import t from '../../translation';
let armor = {
1: {
text: t('armorRogue1Text'),
notes: t('armorRogue1Notes', { per: 6 }),
per: 6,
value: 30,
},
2: {
text: t('armorRogue2Text'),
notes: t('armorRogue2Notes', { per: 9 }),
per: 9,
value: 45,
},
3: {
text: t('armorRogue3Text'),
notes: t('armorRogue3Notes', { per: 12 }),
per: 12,
value: 65,
},
4: {
text: t('armorRogue4Text'),
notes: t('armorRogue4Notes', { per: 15 }),
per: 15,
value: 90,
},
5: {
text: t('armorRogue5Text'),
notes: t('armorRogue5Notes', { per: 18 }),
per: 18,
value: 120,
last: true,
},
};
let head = {
1: {
text: t('headRogue1Text'),
notes: t('headRogue1Notes', { per: 2 }),
per: 2,
value: 15,
},
2: {
text: t('headRogue2Text'),
notes: t('headRogue2Notes', { per: 4 }),
per: 4,
value: 25,
},
3: {
text: t('headRogue3Text'),
notes: t('headRogue3Notes', { per: 6 }),
per: 6,
value: 40,
},
4: {
text: t('headRogue4Text'),
notes: t('headRogue4Notes', { per: 9 }),
per: 9,
value: 60,
},
5: {
text: t('headRogue5Text'),
notes: t('headRogue5Notes', { per: 12 }),
per: 12,
value: 80,
last: true,
},
};
let weapon = {
0: {
text: t('weaponRogue0Text'),
notes: t('weaponRogue0Notes'),
str: 0,
value: 0,
},
1: {
text: t('weaponRogue1Text'),
notes: t('weaponRogue1Notes', { str: 2 }),
str: 2,
value: 20,
},
2: {
text: t('weaponRogue2Text'),
notes: t('weaponRogue2Notes', { str: 3 }),
str: 3,
value: 35,
},
3: {
text: t('weaponRogue3Text'),
notes: t('weaponRogue3Notes', { str: 4 }),
str: 4,
value: 50,
},
4: {
text: t('weaponRogue4Text'),
notes: t('weaponRogue4Notes', { str: 6 }),
str: 6,
value: 70,
},
5: {
text: t('weaponRogue5Text'),
notes: t('weaponRogue5Notes', { str: 8 }),
str: 8,
value: 90,
},
6: {
text: t('weaponRogue6Text'),
notes: t('weaponRogue6Notes', { str: 10 }),
str: 10,
value: 120,
last: true,
},
};
let shield = {
0: {
text: t('weaponRogue0Text'),
notes: t('weaponRogue0Notes'),
str: 0,
value: 0,
},
1: {
text: t('weaponRogue1Text'),
notes: t('weaponRogue1Notes', { str: 2 }),
str: 2,
value: 20,
},
2: {
text: t('weaponRogue2Text'),
notes: t('weaponRogue2Notes', { str: 3 }),
str: 3,
value: 35,
},
3: {
text: t('weaponRogue3Text'),
notes: t('weaponRogue3Notes', { str: 4 }),
str: 4,
value: 50,
},
4: {
text: t('weaponRogue4Text'),
notes: t('weaponRogue4Notes', { str: 6 }),
str: 6,
value: 70,
},
5: {
text: t('weaponRogue5Text'),
notes: t('weaponRogue5Notes', { str: 8 }),
str: 8,
value: 90,
},
6: {
text: t('weaponRogue6Text'),
notes: t('weaponRogue6Notes', { str: 10 }),
str: 10,
value: 120,
last: true,
},
};
let rogueSet = {
armor,
head,
shield,
weapon,
};
export default rogueSet;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
import t from '../../translation';
let armor = {
1: {
text: t('armorWarrior1Text'),
notes: t('armorWarrior1Notes', { con: 3 }),
con: 3,
value: 30,
},
2: {
text: t('armorWarrior2Text'),
notes: t('armorWarrior2Notes', { con: 5 }),
con: 5,
value: 45,
},
3: {
text: t('armorWarrior3Text'),
notes: t('armorWarrior3Notes', { con: 7 }),
con: 7,
value: 65,
},
4: {
text: t('armorWarrior4Text'),
notes: t('armorWarrior4Notes', { con: 9 }),
con: 9,
value: 90,
},
5: {
text: t('armorWarrior5Text'),
notes: t('armorWarrior5Notes', { con: 11 }),
con: 11,
value: 120,
last: true,
},
};
let head = {
1: {
text: t('headWarrior1Text'),
notes: t('headWarrior1Notes', { str: 2 }),
str: 2,
value: 15,
},
2: {
text: t('headWarrior2Text'),
notes: t('headWarrior2Notes', { str: 4 }),
str: 4,
value: 25,
},
3: {
text: t('headWarrior3Text'),
notes: t('headWarrior3Notes', { str: 6 }),
str: 6,
value: 40,
},
4: {
text: t('headWarrior4Text'),
notes: t('headWarrior4Notes', { str: 9 }),
str: 9,
value: 60,
},
5: {
text: t('headWarrior5Text'),
notes: t('headWarrior5Notes', { str: 12 }),
str: 12,
value: 80,
last: true,
},
};
let shield = {
1: {
text: t('shieldWarrior1Text'),
notes: t('shieldWarrior1Notes', { con: 2 }),
con: 2,
value: 20,
},
2: {
text: t('shieldWarrior2Text'),
notes: t('shieldWarrior2Notes', { con: 3 }),
con: 3,
value: 35,
},
3: {
text: t('shieldWarrior3Text'),
notes: t('shieldWarrior3Notes', { con: 5 }),
con: 5,
value: 50,
},
4: {
text: t('shieldWarrior4Text'),
notes: t('shieldWarrior4Notes', { con: 7 }),
con: 7,
value: 70,
},
5: {
text: t('shieldWarrior5Text'),
notes: t('shieldWarrior5Notes', { con: 9 }),
con: 9,
value: 90,
last: true,
},
};
let weapon = {
0: {
text: t('weaponWarrior0Text'),
notes: t('weaponWarrior0Notes'), value: 1 },
1: {
text: t('weaponWarrior1Text'),
notes: t('weaponWarrior1Notes', { str: 3 }),
str: 3,
value: 20,
},
2: {
text: t('weaponWarrior2Text'),
notes: t('weaponWarrior2Notes', { str: 6 }),
str: 6,
value: 30,
},
3: {
text: t('weaponWarrior3Text'),
notes: t('weaponWarrior3Notes', { str: 9 }),
str: 9,
value: 45,
},
4: {
text: t('weaponWarrior4Text'),
notes: t('weaponWarrior4Notes', { str: 12 }),
str: 12,
value: 65,
},
5: {
text: t('weaponWarrior5Text'),
notes: t('weaponWarrior5Notes', { str: 15 }),
str: 15,
value: 90,
},
6: {
text: t('weaponWarrior6Text'),
notes: t('weaponWarrior6Notes', { str: 18 }),
str: 18,
value: 120,
last: true,
},
};
let warriorSet = {
armor,
head,
shield,
weapon,
};
export default warriorSet;

View File

@@ -0,0 +1,141 @@
import t from '../../translation';
let armor = {
1: {
text: t('armorWizard1Text'),
notes: t('armorWizard1Notes', { int: 2 }),
int: 2,
value: 30,
},
2: {
text: t('armorWizard2Text'),
notes: t('armorWizard2Notes', { int: 4 }),
int: 4,
value: 45,
},
3: {
text: t('armorWizard3Text'),
notes: t('armorWizard3Notes', { int: 6 }),
int: 6,
value: 65,
},
4: {
text: t('armorWizard4Text'),
notes: t('armorWizard4Notes', { int: 9 }),
int: 9,
value: 90,
},
5: {
text: t('armorWizard5Text'),
notes: t('armorWizard5Notes', { int: 12 }),
int: 12,
value: 120,
last: true,
},
};
let head = {
1: {
text: t('headWizard1Text'),
notes: t('headWizard1Notes', { per: 2 }),
per: 2,
value: 15,
},
2: {
text: t('headWizard2Text'),
notes: t('headWizard2Notes', { per: 3 }),
per: 3,
value: 25,
},
3: {
text: t('headWizard3Text'),
notes: t('headWizard3Notes', { per: 5 }),
per: 5,
value: 40,
},
4: {
text: t('headWizard4Text'),
notes: t('headWizard4Notes', { per: 7 }),
per: 7,
value: 60,
},
5: {
text: t('headWizard5Text'),
notes: t('headWizard5Notes', { per: 10 }),
per: 10,
value: 80,
last: true,
},
};
let shield = {
// Wizard's weapons are two handed
// And thus do not have shields
// But the content structure still expects an object
};
let weapon = {
0: {
twoHanded: true,
text: t('weaponWizard0Text'),
notes: t('weaponWizard0Notes'), value: 0 },
1: {
twoHanded: true,
text: t('weaponWizard1Text'),
notes: t('weaponWizard1Notes', { int: 3, per: 1 }),
int: 3,
per: 1,
value: 30,
},
2: {
twoHanded: true,
text: t('weaponWizard2Text'),
notes: t('weaponWizard2Notes', { int: 6, per: 2 }),
int: 6,
per: 2,
value: 50,
},
3: {
twoHanded: true,
text: t('weaponWizard3Text'),
notes: t('weaponWizard3Notes', { int: 9, per: 3 }),
int: 9,
per: 3,
value: 80,
},
4: {
twoHanded: true,
text: t('weaponWizard4Text'),
notes: t('weaponWizard4Notes', { int: 12, per: 5 }),
int: 12,
per: 5,
value: 120,
},
5: {
twoHanded: true,
text: t('weaponWizard5Text'),
notes: t('weaponWizard5Notes', { int: 15, per: 7 }),
int: 15,
per: 7,
value: 160,
},
6: {
twoHanded: true,
text: t('weaponWizard6Text'),
notes: t('weaponWizard6Notes', { int: 18, per: 10 }),
int: 18,
per: 10,
value: 200,
last: true,
},
};
let wizardSet = {
armor,
head,
shield,
weapon,
};
export default wizardSet;

File diff suppressed because it is too large Load Diff

View File

@@ -1,119 +0,0 @@
import {each, defaults} from 'lodash';
import moment from 'moment';
//--------------------------------------------------
// Gear is structured by equipment type, but organized by set. Each set exports the equipment for each type that it has
//
// The class sets have numbered key values, as they are purchased sequentially
//
// <equipment_key> : {
// key: <gear_type>_<set_name>_<index>,
// type: <gear_type>,
// klass: <set_name>,
// index: <index>,
// text: t(<gear_type><set_name><formatted_equipment_key>Text),
// notes: t(<gear_type><set_name><formatted_equipment_key>Notes {
// <gear_attributes>
// }),
// con: <con_value>,
// int: <int_value>,
// per: <per_value>,
// str: <str_value>,
// value: <value>,
// last: <last_boolean>,
//
// event: <event>,
// canOwn: <canOwn_function>,
// mystery: <mystery_set_key>
// }
//
// <gear_type> - What type of equipment it is (armor, head, weapon, etc)
// <set_name> - What set this gear is a part of (special, mystery, warrior, etc)
// <index> - The order in this particular set
// <formatted_equipment_key> - CamelCased version of key
//
// <gear_attributes> - if gear has stat bonuses, they are automatically applied to notes
//
// <con_value> - Boost to con, defaults to 0
// <int_value> - Boost to int, defaults to 0
// <per_value> - Boost to per, defaults to 0
// <str_value> - Boost to str, defaults to 0
//
// <value> - Price in gold
// <last_boolean> - whether this is the last in a particular class set
//
// <event> - the event key, present if gear is part of an event
// <canOwn_function> - a function that determines whether or not gear can be purchased in the rewards column
// <mystery_set_key> - the mystery set key, present if item is a mystery item
//
//--------------------------------------------------
import classes from '../classes';
import weapon from './weapon';
import armor from './armor';
import head from './head';
import shield from './shield';
import back from './back';
import body from './body';
import headAccessory from './head-accessory';
import eyewear from './eyewear';
const GEAR_TYPES = [ 'weapon', 'armor', 'head', 'shield', 'body', 'back', 'headAccessory', 'eyewear']
let gear = {
weapon: weapon,
armor: armor,
head: head,
shield: shield,
back: back,
body: body,
headAccessory: headAccessory,
eyewear: eyewear,
};
let flat = {};
// The gear is exported as a tree (defined above), and a flat list (eg, {weapon_healer_1: .., shield_special_0: ...}) since
// they are needed in different forms at different points in the app
each(GEAR_TYPES, (type) => {
let classTypes = classes.concat(['base', 'special', 'mystery', 'armoire']);
each(classTypes, (klass) => {
each(gear[type][klass], (item, i) => {
let key = type + "_" + klass + "_" + i;
defaults(item, {
type: type,
key: key,
klass: klass,
index: i,
str: 0,
int: 0,
per: 0,
con: 0
});
if (item.event) {
let _canOwn = item.canOwn || (() => {
return true;
});
item.canOwn = (u) => {
return _canOwn(u) && ((u.items.gear.owned[key] != null) || (moment().isAfter(item.event.start) && moment().isBefore(item.event.end))) && (item.specialClass ? u.stats["class"] === item.specialClass : true);
};
}
if (item.mystery) {
item.canOwn = (u) => {
return u.items.gear.owned[key] != null;
};
}
flat[key] = item;
});
});
});
export default {
tree: gear,
flat: flat,
gearTypes: GEAR_TYPES
};

View File

@@ -1,400 +0,0 @@
import {
translator as t,
setGearSetDefaults
} from '../../helpers';
let armor = {
lunarArmor: {
value: 100,
str: 7,
int: 7,
set: 'soothing',
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_lunarArmor != null;
})
},
gladiatorArmor: {
value: 100,
str: 7,
per: 7,
set: 'gladiator',
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_gladiatorArmor != null;
})
},
rancherRobes: {
value: 100,
str: 5,
per: 5,
int: 5,
set: 'rancher',
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_rancherRobes != null;
})
},
goldenToga: {
text: t('armorArmoireGoldenTogaText'),
notes: t('armorArmoireGoldenTogaNotes', {
attrs: 8
}),
value: 100,
str: 8,
con: 8,
set: 'goldenToga',
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_goldenToga != null;
})
},
hornedIronArmor: {
value: 100,
con: 9,
per: 7,
set: 'hornedIron',
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_hornedIronArmor != null;
})
},
plagueDoctorOvercoat: {
value: 100,
int: 6,
str: 5,
con: 6,
set: 'plagueDoctor',
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_plagueDoctorOvercoat != null;
})
},
shepherdRobes: {
value: 100,
str: 9,
per: 9,
notes: t('armorArmoireShepherdRobesNotes', {
attrs: 9
}),
set: 'shepherd',
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_shepherdRobes != null;
})
},
royalRobes: {
value: 100,
con: 5,
int: 5,
per: 5,
notes: t('armorArmoireRoyalRobesNotes', {
attrs: 9
}),
set: 'royal',
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_royalRobes != null;
})
}
};
let eyewear = {
plagueDoctorMask: {
value: 100,
set: 'plagueDoctor',
canOwn: ((u) => {
return u.items.gear.owned.eyewear_armoire_plagueDoctorMask != null;
})
}
};
let head = {
lunarCrown: {
value: 100,
con: 7,
per: 7,
set: 'soothing',
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_lunarCrown != null;
})
},
redHairbow: {
value: 100,
str: 5,
int: 5,
con: 5,
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_redHairbow != null;
})
},
violetFloppyHat: {
value: 100,
per: 5,
int: 5,
con: 5,
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_violetFloppyHat != null;
})
},
gladiatorHelm: {
value: 100,
per: 7,
int: 7,
set: 'gladiator',
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_gladiatorHelm != null;
})
},
rancherHat: {
value: 100,
str: 5,
per: 5,
int: 5,
set: 'rancher',
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_rancherHat != null;
})
},
royalCrown: {
value: 100,
str: 10,
set: 'royal',
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_royalCrown != null;
})
},
blueHairbow: {
value: 100,
per: 5,
int: 5,
con: 5,
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_blueHairbow != null;
})
},
goldenLaurels: {
text: t('headArmoireGoldenLaurelsText'),
notes: t('headArmoireGoldenLaurelsNotes', {
attrs: 8
}),
value: 100,
per: 8,
con: 8,
set: 'goldenToga',
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_goldenLaurels != null;
})
},
hornedIronHelm: {
value: 100,
con: 9,
str: 7,
set: 'hornedIron',
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_hornedIronHelm != null;
})
},
yellowHairbow: {
notes: t('headArmoireYellowHairbowNotes', {
attrs: 5
}),
value: 100,
int: 5,
per: 5,
str: 5,
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_yellowHairbow != null;
})
},
redFloppyHat: {
notes: t('headArmoireRedFloppyHatNotes', {
attrs: 6
}),
value: 100,
con: 6,
int: 6,
per: 6,
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_redFloppyHat != null;
})
},
plagueDoctorHat: {
value: 100,
int: 5,
str: 6,
con: 5,
set: 'plagueDoctor',
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_plagueDoctorHat != null;
})
},
blackCat: {
notes: t('headArmoireBlackCatNotes', {
attrs: 9
}),
value: 100,
int: 9,
per: 9,
canOwn: (function(u) {
return u.items.gear.owned.head_armoire_blackCat != null;
})
},
orangeCat: {
notes: t('headArmoireOrangeCatNotes', {
attrs: 9
}),
value: 100,
con: 9,
str: 9,
canOwn: (function(u) {
return u.items.gear.owned.head_armoire_orangeCat != null;
})
},
blueFloppyHat: {
notes: t('headArmoireBlueFloppyHatNotes', {
attrs: 7
}),
value: 100,
con: 7,
int: 7,
per: 7,
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_blueFloppyHat != null;
})
},
shepherdHeaddress: {
value: 100,
int: 9,
set: 'shepherd',
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_shepherdHeaddress != null;
})
},
};
let shield = {
gladiatorShield: {
value: 100,
con: 5,
str: 5,
set: 'gladiator',
canOwn: ((u) => {
return u.items.gear.owned.shield_armoire_gladiatorShield != null;
})
},
midnightShield: {
value: 100,
con: 10,
str: 2,
canOwn: ((u) => {
return u.items.gear.owned.shield_armoire_midnightShield != null;
})
},
royalCane: {
notes: t('shieldArmoireRoyalCaneNotes', {
attrs: 5
}),
value: 100,
con: 5,
int: 5,
per: 5,
set: 'royal',
canOwn: ((u) => {
return u.items.gear.owned.shield_armoire_royalCane != null;
})
}
};
let weapon = {
basicCrossbow: {
value: 100,
str: 5,
per: 5,
con: 5,
canOwn: (function(u) {
return u.items.gear.owned.weapon_armoire_basicCrossbow != null;
})
},
lunarSceptre: {
value: 100,
con: 7,
int: 7,
set: 'soothing',
canOwn: (function(u) {
return u.items.gear.owned.weapon_armoire_lunarSceptre != null;
})
},
rancherLasso: {
notes: t('weaponArmoireRancherLassoNotes', {
str: 5,
per: 5,
int: 5
}),
value: 100,
str: 5,
per: 5,
int: 5,
set: 'rancher',
canOwn: (function(u) {
return u.items.gear.owned.weapon_armoire_rancherLasso != null;
})
},
mythmakerSword: {
notes: t('weaponArmoireMythmakerSwordNotes', {
attrs: 6
}),
value: 100,
str: 6,
per: 6,
set: 'goldenToga',
canOwn: (function(u) {
return u.items.gear.owned.weapon_armoire_mythmakerSword != null;
})
},
ironCrook: {
notes: t('weaponArmoireIronCrookNotes', {
attrs: 7
}),
value: 100,
str: 7,
per: 7,
set: 'hornedIron',
canOwn: (function(u) {
return u.items.gear.owned.weapon_armoire_ironCrook != null;
})
},
goldWingStaff: {
notes: t('weaponArmoireGoldWingStaffNotes', {
attrs: 4
}),
value: 100,
con: 4,
int: 4,
per: 4,
str: 4,
canOwn: (function(u) {
return u.items.gear.owned.weapon_armoire_goldWingStaff != null;
})
},
batWand: {
value: 100,
int: 10,
per: 2,
canOwn: (function(u) {
return u.items.gear.owned.weapon_armoire_batWand != null;
})
},
shepherdsCrook: {
value: 100,
con: 9,
set: 'shepherd',
canOwn: (function(u) {
return u.items.gear.owned.weapon_armoire_shepherdsCrook != null;
})
}
};
let armoireSet = {
armor: armor,
eyewear: eyewear,
head: head,
shield: shield,
weapon: weapon,
};
setGearSetDefaults(armoireSet, {setName: 'armoire'});
export default armoireSet;

View File

@@ -1,48 +0,0 @@
import {setGearSetDefaults} from '../../helpers';
let armor = {
0: { value: 0 },
};
let back = {
0: { value: 0 }
};
let body = {
0: { value: 0 }
};
let eyewear = {
0: { value: 0 }
};
let head = {
0: { value: 0 },
};
let headAccessory = {
0: { value: 0 },
};
let shield = {
0: { value: 0 },
};
let weapon = {
0: { value: 0 },
};
let baseSet = {
armor: armor,
back: back,
body: body,
eyewear: eyewear,
head: head,
headAccessory: headAccessory,
shield: shield,
weapon: weapon,
};
setGearSetDefaults(baseSet, {setName: 'base'});
export default baseSet;

View File

@@ -1,46 +0,0 @@
import {setGearSetDefaults} from '../../helpers';
let armor = {
1: { con: 6, value: 30 },
2: { con: 9, value: 45 },
3: { con: 12, value: 65 },
4: { con: 15, value: 90 },
5: { con: 18, value: 120, last: true },
};
let head = {
1: { int: 2, value: 15 },
2: { int: 3, value: 25 },
3: { int: 5, value: 40 },
4: { int: 7, value: 60 },
5: { int: 9, value: 80, last: true },
};
let shield = {
1: { con: 2, value: 20 },
2: { con: 4, value: 35 },
3: { con: 6, value: 50 },
4: { con: 9, value: 70 },
5: { con: 12, value: 90, last: true },
};
let weapon = {
0: { value: 0 },
1: { int: 2, value: 20 },
2: { int: 3, value: 30 },
3: { int: 5, value: 45 },
4: { int: 7, value: 65 },
5: { int: 9, value: 90 },
6: { int: 11, value: 120, last: true },
};
let healerSet = {
armor: armor,
head: head,
shield: shield,
weapon: weapon,
};
setGearSetDefaults(healerSet, {setName: 'healer'});
export default healerSet;

View File

@@ -1,87 +0,0 @@
import {setGearSetDefaults} from '../../helpers';
let armor = {
201402: { mystery: '201402', value: 0 },
201403: { mystery: '201403', value: 0 },
201405: { mystery: '201405', value: 0 },
201406: { mystery: '201406', value: 0 },
201407: { mystery: '201407', value: 0 },
201408: { mystery: '201408', value: 0 },
201409: { mystery: '201409', value: 0 },
201410: { mystery: '201410', value: 0 },
201412: { mystery: '201412', value: 0 },
201501: { mystery: '201501', value: 0 },
201503: { mystery: '201503', value: 0 },
201504: { mystery: '201504', value: 0 },
201506: { mystery: '201506', value: 0 },
201508: { mystery: '201508', value: 0 },
201509: { mystery: '201509', value: 0 },
301404: { mystery: '301404', value: 0 },
};
let back = {
201402: { mystery: '201402', value: 0 },
201404: { mystery: '201404', value: 0 },
201410: { mystery: '201410', value: 0 },
201504: { mystery: '201504', value: 0 },
201507: { mystery: '201507', value: 0 },
201510: { mystery: '201510', value: 0 },
};
let eyewear = {
201503: { mystery: '201503', value: 0 },
201506: { mystery: '201506', value: 0 },
201507: { mystery: '201507', value: 0 },
301404: { mystery: '301404', value: 0 },
301405: { mystery: '301405', value: 0 },
};
let head = {
201402: { mystery: '201402', value: 0 },
201405: { mystery: '201405', value: 0 },
201406: { mystery: '201406', value: 0 },
201407: { mystery: '201407', value: 0 },
201408: { mystery: '201408', value: 0 },
201411: { mystery: '201411', value: 0 },
201412: { mystery: '201412', value: 0 },
201501: { mystery: '201501', value: 0 },
201505: { mystery: '201505', value: 0 },
201508: { mystery: '201508', value: 0 },
201509: { mystery: '201509', value: 0 },
301404: { mystery: '301404', value: 0 },
301405: { mystery: '301405', value: 0 },
};
let headAccessory = {
201403: { mystery: '201403', value: 0 },
201404: { mystery: '201404', value: 0 },
201409: { mystery: '201409', value: 0 },
201502: { mystery: '201502', value: 0 },
201510: { mystery: '201510', value: 0 },
301405: { mystery: '301405', value: 0 },
};
let shield = {
301405: { mystery: '301405', value: 0 },
};
let weapon = {
201411: { mystery: '201411', value: 0 },
201502: { mystery: '201502', value: 0 },
201505: { mystery: '201505', value: 0 },
301404: { mystery: '301404', value: 0 },
};
let mysterySet = {
armor: armor,
back: back,
eyewear: eyewear,
head: head,
headAccessory: headAccessory,
shield: shield,
weapon: weapon,
};
setGearSetDefaults(mysterySet, {setName: 'mystery'});
export default mysterySet;

View File

@@ -1,37 +0,0 @@
import {setGearSetDefaults} from '../../helpers';
let armor = {
1: { per: 6, value: 30 },
2: { per: 9, value: 45 },
3: { per: 12, value: 65 },
4: { per: 15, value: 90 },
5: { per: 18, value: 120, last: true },
};
let head = {
1: { per: 2, value: 15 },
2: { per: 4, value: 25 },
3: { per: 6, value: 40 },
4: { per: 9, value: 60 },
5: { per: 12, value: 80, last: true },
};
let weapon = {
0: { str: 0, value: 0 },
1: { str: 2, value: 20 },
2: { str: 3, value: 35 },
3: { str: 4, value: 50 },
4: { str: 6, value: 70 },
5: { str: 8, value: 90 },
6: { str: 10, value: 120, last: true },
};
let rogueSet = {
armor: armor,
head: head,
weapon: weapon,
};
setGearSetDefaults(rogueSet, {setName: 'rogue'});
export default rogueSet;

File diff suppressed because it is too large Load Diff

View File

@@ -1,46 +0,0 @@
import {setGearSetDefaults} from '../../helpers';
let armor = {
1: { con: 3, value: 30 },
2: { con: 5, value: 45 },
3: { con: 7, value: 65 },
4: { con: 9, value: 90 },
5: { con: 11, value: 120, last: true },
};
let head = {
1: { str: 2, value: 15 },
2: { str: 4, value: 25 },
3: { str: 6, value: 40 },
4: { str: 9, value: 60 },
5: { str: 12, value: 80, last: true },
};
let shield = {
1: { con: 2, value: 20 },
2: { con: 3, value: 35 },
3: { con: 5, value: 50 },
4: { con: 7, value: 70 },
5: { con: 9, value: 90, last: true },
};
let weapon = {
0: { value: 1 },
1: { str: 3, value: 20 },
2: { str: 6, value: 30 },
3: { str: 9, value: 45 },
4: { str: 12, value: 65 },
5: { str: 15, value: 90 },
6: { str: 18, value: 120, last: true },
};
let warriorSet = {
armor: armor,
head: head,
shield: shield,
weapon: weapon,
};
setGearSetDefaults(warriorSet, {setName: 'warrior'});
export default warriorSet;

View File

@@ -1,44 +0,0 @@
import {setGearSetDefaults} from '../../helpers';
let armor = {
1: { int: 2, value: 30 },
2: { int: 4, value: 45 },
3: { int: 6, value: 65 },
4: { int: 9, value: 90 },
5: { int: 12, value: 120, last: true },
};
let head = {
1: { per: 2, value: 15 },
2: { per: 3, value: 25 },
3: { per: 5, value: 40 },
4: { per: 7, value: 60 },
5: { per: 10, value: 80, last: true },
};
let shield = {
// Wizard's weapons are two handed
// And thus do not have shields
// But the content structure still expects an object
};
let weapon = {
0: { twoHanded: true, value: 0 },
1: { twoHanded: true, int: 3, per: 1, value: 30 },
2: { twoHanded: true, int: 6, per: 2, value: 50 },
3: { twoHanded: true, int: 9, per: 3, value: 80 },
4: { twoHanded: true, int: 12, per: 5, value: 120 },
5: { twoHanded: true, int: 15, per: 7, value: 160 },
6: { twoHanded: true, int: 18, per: 10, value: 200, last: true },
};
let wizardSet = {
armor: armor,
head: head,
shield: shield,
weapon: weapon,
};
setGearSetDefaults(wizardSet, {setName: 'wizard'});
export default wizardSet;

View File

@@ -1,54 +1,44 @@
import { import {
expectValidTranslationString, expectValidTranslationString,
describeEachItem
} from '../helpers/content.helper'; } from '../helpers/content.helper';
import {each} from 'lodash'; import { each } from 'lodash';
import {tree as allGear} from '../../common/script/src/content/gear'; import { tree as allGear } from '../../common/script/content/gear';
describe('Gear', () => { describe('Gear', () => {
each(allGear, (piece, type) => { each(allGear, (piece, gearType) => {
describeEachItem(type, piece, (set, key) => { describe(gearType, () => {
checkGearAttributes(set); each(piece, (items, klass) => {
context(`${klass} ${gearType}s`, () => {
it('have a value of at least 0 for each stat', () => {
each(items, (gear, itemKey) => {
expect(gear.con).to.be.at.least(0);
expect(gear.int).to.be.at.least(0);
expect(gear.per).to.be.at.least(0);
expect(gear.str).to.be.at.least(0);
});
});
it('have a purchase value of at least 0', () => {
each(items, (gear, itemKey) => {
expect(gear.value).to.be.at.least(0);
});
});
it('has a canBuy function', () => {
each(items, (gear, itemKey) => {
expect(gear.canBuy).to.be.a('function');
});
});
it('have valid translation strings for text and notes', () => {
each(items, (gear, itemKey) => {
expectValidTranslationString(gear.text);
expectValidTranslationString(gear.notes);
});
});
});
});
}); });
}); });
}); });
function checkGearAttributes(set) {
each(set, (gear, key) => {
describe(`${key}`, () => {
it('has a value attribute', () => {
expect(gear.value).to.be.at.least(0);
});
it('has a valid con attribute', () => {
expect(gear.con).to.be.at.least(0);
});
it('has a valid int attribute', () => {
expect(gear.int).to.be.at.least(0);
});
it('has a valid per attribute', () => {
expect(gear.per).to.be.at.least(0);
});
it('has a valid str attribute', () => {
expect(gear.str).to.be.at.least(0);
});
it('has a canBuy function', () => {
expect(gear.canBuy).to.be.a('function');
});
it('has a valid text attribute', () => {
expectValidTranslationString(gear.text);
});
it('has a valid notes attribute', () => {
expectValidTranslationString(gear.notes);
});
});
});
}