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

51 строка
1.3 KiB

  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.types[item.slot]);
  11. var typeBlueprint = configTypes.types[item.slot][type] || {};
  12. if (!typeBlueprint)
  13. return;
  14. item.type = type;
  15. item.sprite = extend(true, [], blueprint.sprite || typeBlueprint.sprite);
  16. if (typeBlueprint.spritesheet)
  17. item.spritesheet = typeBlueprint.spritesheet;
  18. if (typeBlueprint.spellName) {
  19. blueprint.spellName = typeBlueprint.spellName;
  20. blueprint.spellConfig = typeBlueprint.spellConfig;
  21. }
  22. if (typeBlueprint.range)
  23. item.range = typeBlueprint.range;
  24. if (typeBlueprint.material) {
  25. var material = armorMaterials[typeBlueprint.material];
  26. blueprint.attrRequire = material.attrRequire;
  27. if (blueprint.statMult.armor)
  28. blueprint.statMult.armor *= material.statMult.armor
  29. }
  30. if (typeBlueprint.attrRequire)
  31. blueprint.attrRequire = typeBlueprint.attrRequire;
  32. if (typeBlueprint.armorMult)
  33. blueprint.statMult.armor = typeBlueprint.armorMult;
  34. if (typeBlueprint.blockAttackMult)
  35. blueprint.statMult.blockAttackChance = typeBlueprint.blockAttackMult;
  36. if (typeBlueprint.blockSpellMult)
  37. blueprint.statMult.blockSpellChance = typeBlueprint.blockSpellMult;
  38. }
  39. }
  40. });