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.
 
 
 

288 lines
6.2 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: 95
  82. },
  83. vitScale: 10,
  84. spritesheet: `${this.folderName}/images/inGameSprite.png`
  85. };
  86. classes.weapons.necromancer = 'Sickle';
  87. classes.portraits.necromancer = {
  88. spritesheet: `${this.folderName}/images/avatar.png`,
  89. x: 0,
  90. y: 0
  91. };
  92. },
  93. beforeGetSpellTemplate: function (spell) {
  94. if (spell.type == 'HarvestLife')
  95. spell.template = require(`${this.relativeFolderName}/spells/spellHarvestLife`);
  96. else if (spell.type == 'SummonSkeleton')
  97. spell.template = require(`${this.relativeFolderName}/spells/spellSummonSkeleton`);
  98. else if (spell.type == 'BloodBarrier')
  99. spell.template = require(`${this.relativeFolderName}/spells/spellBloodBarrier`);
  100. },
  101. beforeGetSkins: function (skins) {
  102. skins['necromancer 1'] = {
  103. name: 'Necromancer 1',
  104. sprite: [0, 0],
  105. class: 'necromancer',
  106. spritesheet: `${this.folderName}/images/inGameSprite.png`,
  107. default: true
  108. };
  109. },
  110. beforeGetItemTypes: function (types) {
  111. ['Sickle', 'Jade Sickle', 'Golden Sickle', 'Bone Sickle'].forEach(function (s, i) {
  112. types.oneHanded[s] = {
  113. sprite: [i, 0],
  114. spellName: 'harvest life',
  115. spritesheet: `${this.folderName}/images/items.png`
  116. };
  117. }, this);
  118. },
  119. beforeGetSpellsConfig: function (spells) {
  120. spells['harvest life'] = {
  121. statType: ['str', 'int'],
  122. statMult: 0.1035,
  123. element: 'physical',
  124. auto: true,
  125. cdMax: 6,
  126. manaCost: 0,
  127. range: 1,
  128. random: {
  129. damage: [2.2, 4.1],
  130. healPercent: [5, 15]
  131. }
  132. };
  133. spells['summon skeleton'] = {
  134. statType: ['str', 'int'],
  135. statMult: 0.1,
  136. element: 'physical',
  137. cdMax: 7,
  138. manaCost: 5,
  139. range: 9,
  140. random: {
  141. damagePercent: [80, 120],
  142. hpPercent: [65, 85]
  143. }
  144. };
  145. spells['blood barrier'] = {
  146. statType: ['str', 'int'],
  147. statMult: 0.1,
  148. element: 'physical',
  149. cdMax: 7,
  150. manaCost: 5,
  151. range: 9,
  152. random: {
  153. i_drainPercentage: [10, 50],
  154. shieldMultiplier: [2, 5],
  155. i_frenzyDuration: [10, 20]
  156. }
  157. };
  158. },
  159. beforeGetSpellsInfo: function (spells) {
  160. spells.push({
  161. name: 'Harvest Life',
  162. description: 'Absorbs the life-force of your enemies.',
  163. type: 'harvestLife',
  164. icon: [0, 0],
  165. animation: 'melee',
  166. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  167. particles: {
  168. color: {
  169. start: ['ff4252', 'b34b3a'],
  170. end: ['b34b3a', 'ff4252']
  171. },
  172. scale: {
  173. start: {
  174. min: 2,
  175. max: 14
  176. },
  177. end: {
  178. min: 0,
  179. max: 8
  180. }
  181. },
  182. lifetime: {
  183. min: 1,
  184. max: 3
  185. },
  186. alpha: {
  187. start: 0.7,
  188. end: 0
  189. },
  190. randomScale: true,
  191. randomColor: true,
  192. chance: 0.6
  193. }
  194. });
  195. spells.push({
  196. name: 'Summon Skeleton',
  197. description: 'Summons a skeletal warrior to assist you in combat.',
  198. type: 'summonSkeleton',
  199. icon: [1, 0],
  200. animation: 'magic',
  201. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  202. particles: {
  203. color: {
  204. start: ['ff4252', 'b34b3a'],
  205. end: ['b34b3a', 'ff4252']
  206. },
  207. scale: {
  208. start: {
  209. min: 2,
  210. max: 14
  211. },
  212. end: {
  213. min: 0,
  214. max: 8
  215. }
  216. },
  217. lifetime: {
  218. min: 1,
  219. max: 3
  220. },
  221. alpha: {
  222. start: 0.7,
  223. end: 0
  224. },
  225. randomScale: true,
  226. randomColor: true,
  227. chance: 0.6
  228. }
  229. });
  230. spells.push({
  231. name: 'Blood Barrier',
  232. description: 'Sacrifice some life force to grant an ally a protective barrier and increased attack speed.',
  233. type: 'bloodBarrier',
  234. icon: [2, 0],
  235. animation: 'magic',
  236. spellType: 'buff',
  237. spritesheet: `${this.folderName}/images/abilityIcons.png`,
  238. particles: {
  239. color: {
  240. start: ['ff4252', 'b34b3a'],
  241. end: ['b34b3a', 'ff4252']
  242. },
  243. scale: {
  244. start: {
  245. min: 2,
  246. max: 14
  247. },
  248. end: {
  249. min: 0,
  250. max: 8
  251. }
  252. },
  253. lifetime: {
  254. min: 1,
  255. max: 3
  256. },
  257. alpha: {
  258. start: 0.7,
  259. end: 0
  260. },
  261. randomScale: true,
  262. randomColor: true,
  263. chance: 0.6
  264. }
  265. });
  266. }
  267. };
  268. });