Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

types.js 864 B

7 år sedan
7 år sedan
7 år sedan
123456789101112131415161718192021222324252627282930313233343536
  1. define([
  2. '../config/types',
  3. '../config/armorMaterials'
  4. ], function(
  5. configTypes,
  6. armorMaterials
  7. ) {
  8. return {
  9. generate: function(item, blueprint) {
  10. var type = blueprint.type || _.randomKey(configTypes[item.slot]);
  11. var typeBlueprint = configTypes[item.slot][type];
  12. if (!typeBlueprint)
  13. return;
  14. item.type = type;
  15. item.sprite = typeBlueprint.sprite;
  16. if (typeBlueprint.spritesheet)
  17. item.spritesheet = typeBlueprint.spritesheet;
  18. if (typeBlueprint.spellName)
  19. blueprint.spellName = typeBlueprint.spellName;
  20. if (typeBlueprint.range)
  21. item.range = typeBlueprint.range;
  22. if ((typeBlueprint.material) && (blueprint.statMult.armor))
  23. blueprint.statMult.armor *= armorMaterials[typeBlueprint.material].statMult.armor;
  24. if (item.slot == 'tool') {
  25. blueprint.noStats = true;
  26. blueprint.noName = true;
  27. }
  28. }
  29. }
  30. });