Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

292 lignes
6.3 KiB

  1. define([
  2. ], function (
  3. ) {
  4. return {
  5. name: 'Necromancer Class',
  6. extraScripts: [
  7. 'spells/spellHarvestLife',
  8. 'spells/spellSummonSkeleton',
  9. 'spells/spellBloodBarrier'
  10. ],
  11. init: function () {
  12. this.events.on('onBeforeGetClasses', this.beforeGetClasses.bind(this));
  13. this.events.on('onBeforeGetSkins', this.beforeGetSkins.bind(this));
  14. this.events.on('onBeforeGetItemTypes', this.beforeGetItemTypes.bind(this));
  15. this.events.on('onBeforeGetSpellsInfo', this.beforeGetSpellsInfo.bind(this));
  16. this.events.on('onBeforeGetSpellsConfig', this.beforeGetSpellsConfig.bind(this));
  17. this.events.on('onBeforeGetSpellTemplate', this.beforeGetSpellTemplate.bind(this));
  18. this.events.on('onBeforeGetResourceList', this.beforeGetResourceList.bind(this));
  19. this.events.on('onBeforeGetAnimations', this.beforeGetAnimations.bind(this));
  20. },
  21. beforeGetAnimations: function (animations) {
  22. var spritesheet = `${this.folderName}/images/inGameSprite.png`;
  23. animations.mobs[spritesheet] = {
  24. '0': {
  25. magic: {
  26. spritesheet: spritesheet,
  27. row: 0,
  28. col: 1,
  29. frames: 4,
  30. frameDelay: 4
  31. },
  32. melee: {
  33. spritesheet: spritesheet,
  34. row: 1,
  35. col: 1,
  36. frames: 3,
  37. frameDelay: 4
  38. }
  39. }
  40. };
  41. //Skeleton animations
  42. var mobsheet = `${this.folderName}/images/mobs.png`;
  43. if (!animations.mobs[mobsheet])
  44. animations.mobs[mobsheet] = {};
  45. animations.mobs[mobsheet]['0'] = {
  46. melee: {
  47. spritesheet: mobsheet,
  48. row: 1,
  49. col: 0,
  50. frames: 2,
  51. frameDelay: 5
  52. },
  53. spawn: {
  54. spritesheet: mobsheet,
  55. row: 2,
  56. col: 0,
  57. frames: 3,
  58. frameDelay: 4,
  59. hideSprite: true,
  60. type: 'attackAnimation'
  61. },
  62. death: {
  63. spritesheet: mobsheet,
  64. row: 3,
  65. col: 0,
  66. frames: 4,
  67. frameDelay: 4,
  68. type: 'attackAnimation'
  69. }
  70. };
  71. },
  72. beforeGetResourceList: function (list) {
  73. list.push(`${this.folderName}/images/inGameSprite.png`);
  74. list.push(`${this.folderName}/images/abilityIcons.png`);
  75. list.push(`${this.folderName}/images/mobs.png`);
  76. },
  77. beforeGetClasses: function (classes) {
  78. classes.spells.necromancer = ['summon skeleton', 'blood barrier'];
  79. classes.stats.necromancer = {
  80. values: {
  81. hpMax: 65
  82. },
  83. vitScale: 10,
  84. gainStats: {
  85. int: 1,
  86. str: 1
  87. },
  88. spritesheet: `${this.folderName}/images/inGameSprite.png`
  89. };
  90. classes.weapons.necromancer = 'Sickle';
  91. classes.portraits.necromancer = {
  92. spritesheet: `${this.folderName}/images/avatar.png`,
  93. x: 0,
  94. y: 0
  95. };
  96. },
  97. beforeGetSpellTemplate: function (spell) {
  98. if (spell.type == 'HarvestLife')
  99. spell.template = require(`${this.relativeFolderName}/spells/spellHarvestLife`);
  100. else if (spell.type == 'SummonSkeleton')
  101. spell.template = require(`${this.relativeFolderName}/spells/spellSummonSkeleton`);
  102. else if (spell.type == 'BloodBarrier')
  103. spell.template = require(`${this.relativeFolderName}/spells/spellBloodBarrier`);
  104. },
  105. beforeGetSkins: function (skins) {
  106. skins['necromancer 1'] = {
  107. name: 'Necromancer 1',
  108. sprite: [0, 0],
  109. class: 'necromancer',
  110. spritesheet: `${this.folderName}/images/inGameSprite.png`,
  111. default: true
  112. };
  113. },
  114. beforeGetItemTypes: function (types) {
  115. ['Sickle', 'Jade Sickle', 'Golden Sickle', 'Bone Sickle'].forEach(function (s, i) {
  116. types.oneHanded[s] = {
  117. sprite: [i, 0],
  118. spellName: 'harvest life',
  119. spritesheet: `${this.folderName}/images/items.png`
  120. };
  121. }, this);
  122. },
  123. beforeGetSpellsConfig: function (spells) {
  124. spells['harvest life'] = {
  125. statType: ['str', 'int'],
  126. statMult: 0.76,
  127. element: 'physical',
  128. auto: true,
  129. cdMax: 6,
  130. manaCost: 0,
  131. range: 1,
  132. random: {
  133. damage: [1.5, 5.7],
  134. healPercent: [5, 15]
  135. }
  136. };
  137. spells['summon skeleton'] = {
  138. statType: ['str', 'int'],
  139. statMult: 0.27,
  140. element: 'physical',
  141. cdMax: 7,
  142. manaCost: 5,
  143. range: 9,
  144. random: {
  145. damagePercent: [100, 380],
  146. hpPercent: [40, 60]
  147. }
  148. };
  149. spells['blood barrier'] = {
  150. statType: ['str', 'int'],
  151. statMult: 0.1,
  152. element: 'physical',
  153. cdMax: 20,
  154. manaCost: 5,
  155. range: 9,
  156. random: {
  157. i_drainPercentage: [10, 50],
  158. shieldMultiplier: [2, 5],
  159. i_frenzyDuration: [5, 15]
  160. }
  161. };
  162. },
  163. beforeGetSpellsInfo: function (spells) {
  164. spells.push({
  165. name: 'Harvest Life',
  166. description: 'Absorbs the life-force of your enemies.',
  167. type: 'harvestLife',
  168. icon: [0, 0],
  169. animation: 'melee',
  170. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  171. particles: {
  172. color: {
  173. start: ['ff4252', 'b34b3a'],
  174. end: ['b34b3a', 'ff4252']
  175. },
  176. scale: {
  177. start: {
  178. min: 2,
  179. max: 14
  180. },
  181. end: {
  182. min: 0,
  183. max: 8
  184. }
  185. },
  186. lifetime: {
  187. min: 1,
  188. max: 3
  189. },
  190. alpha: {
  191. start: 0.7,
  192. end: 0
  193. },
  194. randomScale: true,
  195. randomColor: true,
  196. chance: 0.6
  197. }
  198. });
  199. spells.push({
  200. name: 'Summon Skeleton',
  201. description: 'Summons a skeletal warrior to assist you in combat.',
  202. type: 'summonSkeleton',
  203. icon: [1, 0],
  204. animation: 'magic',
  205. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  206. particles: {
  207. color: {
  208. start: ['ff4252', 'b34b3a'],
  209. end: ['b34b3a', 'ff4252']
  210. },
  211. scale: {
  212. start: {
  213. min: 2,
  214. max: 14
  215. },
  216. end: {
  217. min: 0,
  218. max: 8
  219. }
  220. },
  221. lifetime: {
  222. min: 1,
  223. max: 3
  224. },
  225. alpha: {
  226. start: 0.7,
  227. end: 0
  228. },
  229. randomScale: true,
  230. randomColor: true,
  231. chance: 0.6
  232. }
  233. });
  234. spells.push({
  235. name: 'Blood Barrier',
  236. description: 'Sacrifice some life force to grant an ally a protective barrier and increased attack speed.',
  237. type: 'bloodBarrier',
  238. icon: [2, 0],
  239. animation: 'magic',
  240. spellType: 'buff',
  241. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  242. particles: {
  243. color: {
  244. start: ['ff4252', 'b34b3a'],
  245. end: ['b34b3a', 'ff4252']
  246. },
  247. scale: {
  248. start: {
  249. min: 2,
  250. max: 14
  251. },
  252. end: {
  253. min: 0,
  254. max: 8
  255. }
  256. },
  257. lifetime: {
  258. min: 1,
  259. max: 3
  260. },
  261. alpha: {
  262. start: 0.7,
  263. end: 0
  264. },
  265. randomScale: true,
  266. randomColor: true,
  267. chance: 0.6
  268. }
  269. });
  270. }
  271. };
  272. });