You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
826 B

  1. module.exports = {
  2. slots: {
  3. head: {
  4. extraStats: {
  5. stat: 'armor',
  6. mult: 0.3
  7. }
  8. },
  9. neck: {},
  10. chest: {
  11. extraStats: {
  12. stat: 'armor',
  13. mult: 1
  14. }
  15. },
  16. hands: {
  17. extraStats: {
  18. stat: 'armor',
  19. mult: 0.1
  20. }
  21. },
  22. finger: {},
  23. waist: {},
  24. legs: {
  25. extraStats: {
  26. stat: 'armor',
  27. mult: 0.5
  28. }
  29. },
  30. feet: {
  31. extraStats: {
  32. stat: 'armor',
  33. mult: 0.1
  34. }
  35. },
  36. trinket: {},
  37. twoHanded: {}
  38. },
  39. generate: function (item, blueprint) {
  40. if (blueprint.slot)
  41. item.slot = blueprint.slot;
  42. else
  43. item.slot = _.randomKey(this.slots);
  44. let extraStats = this.slots[item.slot].extraStats;
  45. if (extraStats) {
  46. extraStats = extend({}, extraStats);
  47. if (!(extraStats instanceof Array))
  48. extraStats = [extraStats];
  49. blueprint.extraStats = extraStats;
  50. }
  51. }
  52. };