Modularize mystery sets

This commit is contained in:
Blade Barringer
2015-11-15 10:08:40 -06:00
parent 600f3e4554
commit 411946e487
2 changed files with 35 additions and 162 deletions

View File

@@ -14,6 +14,7 @@ import {
GEAR_TYPES, GEAR_TYPES,
} from './constants'; } from './constants';
import mysterySets from './mystery-sets';
/* /*
--------------------------------------------------------------- ---------------------------------------------------------------
@@ -22,131 +23,7 @@ import {
--------------------------------------------------------------- ---------------------------------------------------------------
*/ */
api.mystery = { api.mystery = mysterySets;
201402: {
start: '2014-02-22',
end: '2014-02-28',
text: 'Winged Messenger Set'
},
201403: {
start: '2014-03-24',
end: '2014-04-02',
text: 'Forest Walker Set'
},
201404: {
start: '2014-04-24',
end: '2014-05-02',
text: 'Twilight Butterfly Set'
},
201405: {
start: '2014-05-21',
end: '2014-06-02',
text: 'Flame Wielder Set'
},
201406: {
start: '2014-06-23',
end: '2014-07-02',
text: 'Octomage Set'
},
201407: {
start: '2014-07-23',
end: '2014-08-02',
text: 'Undersea Explorer Set'
},
201408: {
start: '2014-08-23',
end: '2014-09-02',
text: 'Sun Sorcerer Set'
},
201409: {
start: '2014-09-24',
end: '2014-10-02',
text: 'Autumn Strider Set'
},
201410: {
start: '2014-10-24',
end: '2014-11-02',
text: 'Winged Goblin Set'
},
201411: {
start: '2014-11-24',
end: '2014-12-02',
text: 'Feast and Fun Set'
},
201412: {
start: '2014-12-25',
end: '2015-01-02',
text: 'Penguin Set'
},
201501: {
start: '2015-01-26',
end: '2015-02-02',
text: 'Starry Knight Set'
},
201502: {
start: '2015-02-24',
end: '2015-03-02',
text: 'Winged Enchanter Set'
},
201503: {
start: '2015-03-25',
end: '2015-04-02',
text: 'Aquamarine Set'
},
201504: {
start: '2015-04-24',
end: '2015-05-02',
text: 'Busy Bee Set'
},
201505: {
start: '2015-05-25',
end: '2015-06-02',
text: 'Green Knight Set'
},
201506: {
start: '2015-06-25',
end: '2015-07-02',
text: 'Neon Snorkeler Set'
},
201507: {
start: '2015-07-24',
end: '2015-08-02',
text: 'Rad Surfer Set'
},
201508: {
start: '2015-08-23',
end: '2015-09-02',
text: 'Cheetah Costume Set'
},
201509: {
start: '2015-09-24',
end: '2015-10-02',
text: 'Werewolf Set'
},
201510: {
start: '2015-10-26',
end: '2015-11-02',
text: 'Horned Goblin Set'
},
301404: {
start: '3014-03-24',
end: '3014-04-02',
text: 'Steampunk Standard Set'
},
301405: {
start: '3014-04-24',
end: '3014-05-02',
text: 'Steampunk Accessories Set'
},
wondercon: {
start: '2014-03-24',
end: '2014-04-01'
}
};
_.each(api.mystery, function(v, k) {
return v.key = k;
});
api.itemList = { api.itemList = {
'weapon': { 'weapon': {

View File

@@ -1,133 +1,129 @@
import {each, where} from 'lodash'; import { each } from 'lodash';
import {flat as flattenedGear} from './gear/index';
let mysterySets = { let mysterySets = {
201402: { 201402: {
start: '2014-02-22', start: '2014-02-22',
end: '2014-02-28', end: '2014-02-28',
text: 'Winged Messenger Set' text: 'Winged Messenger Set',
}, },
201403: { 201403: {
start: '2014-03-24', start: '2014-03-24',
end: '2014-04-02', end: '2014-04-02',
text: 'Forest Walker Set' text: 'Forest Walker Set',
}, },
201404: { 201404: {
start: '2014-04-24', start: '2014-04-24',
end: '2014-05-02', end: '2014-05-02',
text: 'Twilight Butterfly Set' text: 'Twilight Butterfly Set',
}, },
201405: { 201405: {
start: '2014-05-21', start: '2014-05-21',
end: '2014-06-02', end: '2014-06-02',
text: 'Flame Wielder Set' text: 'Flame Wielder Set',
}, },
201406: { 201406: {
start: '2014-06-23', start: '2014-06-23',
end: '2014-07-02', end: '2014-07-02',
text: 'Octomage Set' text: 'Octomage Set',
}, },
201407: { 201407: {
start: '2014-07-23', start: '2014-07-23',
end: '2014-08-02', end: '2014-08-02',
text: 'Undersea Explorer Set' text: 'Undersea Explorer Set',
}, },
201408: { 201408: {
start: '2014-08-23', start: '2014-08-23',
end: '2014-09-02', end: '2014-09-02',
text: 'Sun Sorcerer Set' text: 'Sun Sorcerer Set',
}, },
201409: { 201409: {
start: '2014-09-24', start: '2014-09-24',
end: '2014-10-02', end: '2014-10-02',
text: 'Autumn Strider Set' text: 'Autumn Strider Set',
}, },
201410: { 201410: {
start: '2014-10-24', start: '2014-10-24',
end: '2014-11-02', end: '2014-11-02',
text: 'Winged Goblin Set' text: 'Winged Goblin Set',
}, },
201411: { 201411: {
start: '2014-11-24', start: '2014-11-24',
end: '2014-12-02', end: '2014-12-02',
text: 'Feast and Fun Set' text: 'Feast and Fun Set',
}, },
201412: { 201412: {
start: '2014-12-25', start: '2014-12-25',
end: '2015-01-02', end: '2015-01-02',
text: 'Penguin Set' text: 'Penguin Set',
}, },
201501: { 201501: {
start: '2015-01-26', start: '2015-01-26',
end: '2015-02-02', end: '2015-02-02',
text: 'Starry Knight Set' text: 'Starry Knight Set',
}, },
201502: { 201502: {
start: '2015-02-24', start: '2015-02-24',
end: '2015-03-02', end: '2015-03-02',
text: 'Winged Enchanter Set' text: 'Winged Enchanter Set',
}, },
201503: { 201503: {
start: '2015-03-25', start: '2015-03-25',
end: '2015-04-02', end: '2015-04-02',
text: 'Aquamarine Set' text: 'Aquamarine Set',
}, },
201504: { 201504: {
start: '2015-04-24', start: '2015-04-24',
end: '2015-05-02', end: '2015-05-02',
text: 'Busy Bee Set' text: 'Busy Bee Set',
}, },
201505: { 201505: {
start: '2015-05-25', start: '2015-05-25',
end: '2015-06-02', end: '2015-06-02',
text: 'Green Knight Set' text: 'Green Knight Set',
}, },
201506: { 201506: {
start: '2015-06-25', start: '2015-06-25',
end: '2015-07-02', end: '2015-07-02',
text: 'Neon Snorkeler Set' text: 'Neon Snorkeler Set',
}, },
201507: { 201507: {
start: '2015-07-24', start: '2015-07-24',
end: '2015-08-02', end: '2015-08-02',
text: 'Rad Surfer Set' text: 'Rad Surfer Set',
}, },
201508: { 201508: {
start: '2015-08-23', start: '2015-08-23',
end: '2015-09-02', end: '2015-09-02',
text: 'Cheetah Costume Set' text: 'Cheetah Costume Set',
}, },
201509: { 201509: {
start: '2015-09-24', start: '2015-09-24',
end: '2015-10-02', end: '2015-10-02',
text:'Werewolf Set' text: 'Werewolf Set',
}, },
201510: { 201510: {
start: '2015-10-26', start: '2015-10-26',
end: '2015-11-02', end: '2015-11-02',
text:'Horned Goblin Set' text: 'Horned Goblin Set',
}, },
301404: { 301404: {
start: '3014-03-24', start: '3014-03-24',
end: '3014-04-02', end: '3014-04-02',
text: 'Steampunk Standard Set' text: 'Steampunk Standard Set',
}, },
301405: { 301405: {
start: '3014-04-24', start: '3014-04-24',
end: '3014-05-02', end: '3014-05-02',
text: 'Steampunk Accessories Set' text: 'Steampunk Accessories Set',
}, },
wondercon: { // @TODO: extract this out of mystery items wondercon: {
start: '2014-03-24', start: '2014-03-24',
end: '2014-04-01' end: '2014-04-01',
} },
}; };
each(mysterySets, (objectSet, name) => { each(mysterySets, (value, key) => {
objectSet.key = name; return value.key = key;
objectSet.items = where(flattenedGear, {
mystery: name
});
}); });
export default mysterySets; export default mysterySets;