Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

38 строки
804 B

  1. //Helpers
  2. const { getFactionBlueprint } = require('../../config/factions/helpers');
  3. //Internals
  4. const tierNames = ['Hated', 'Hostile', 'Unfriendly', 'Neutral', 'Friendly', 'Honored', 'Revered', 'Exalted'];
  5. //Method
  6. const simplifyItem = (cpnInventory, item) => {
  7. const result = extend({}, item);
  8. if (result.effects) {
  9. result.effects = result.effects.map(e => ({
  10. factionId: e.factionId ?? null,
  11. text: e.text ?? null,
  12. properties: e.properties ?? null,
  13. type: e.type ?? null,
  14. rolls: e.rolls ?? null
  15. }));
  16. }
  17. if (result.factions) {
  18. result.factions = result.factions.map(f => {
  19. const res = {
  20. id: f.id,
  21. tier: f.tier,
  22. tierName: tierNames[f.tier],
  23. name: getFactionBlueprint(f.id).name
  24. };
  25. return res;
  26. });
  27. }
  28. return result;
  29. };
  30. module.exports = simplifyItem;