Common reorg (#8025)

* Re-organize common folder

* fix: Correct paths in tests

* fix: move new content to proper folder

* chore: Move audio folder to assets

* Move sprites to sprites assets directory

* Move css sprites to assets directory

* Split out readmes for common code and sprites

* Move images to assets directory

* Move destinatin of shared browserified file

* remove unused file

* move compiled js to client-old

* Fix karma tests

* fix: Correct paths for sprites
This commit is contained in:
Blade Barringer
2016-09-16 10:18:07 -05:00
committed by Matteo Pagliazzi
parent d971e673af
commit 81b7eeeb71
5956 changed files with 269 additions and 270 deletions

View File

@@ -0,0 +1,25 @@
import _ from 'lodash';
import content from '../content/index';
module.exports = function resetGear (user) {
let gear = user.items.gear;
_.each(['equipped', 'costume'], function resetUserGear (type) {
gear[type] = {};
gear[type].armor = 'armor_base_0';
gear[type].weapon = 'weapon_warrior_0';
gear[type].head = 'head_base_0';
gear[type].shield = 'shield_base_0';
});
// Gear.owned is a Mongo object so the _.each function iterates over hidden properties.
// The content.gear.flat[k] check should prevent this causing an error
_.each(gear.owned, function resetOwnedGear (v, k) {
if (gear.owned[k] && content.gear.flat[k] && content.gear.flat[k].value) {
gear.owned[k] = false;
}
});
gear.owned.weapon_warrior_0 = true; // eslint-disable-line camelcase
user.preferences.costume = false;
};