data.ts 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959
  1. /*
  2. * @licstart The following is the entire license notice for the JavaScript
  3. * code in this page.
  4. *
  5. * This file is part of oddjobs-dmg-calc.
  6. *
  7. * oddjobs-dmg-calc is free software: you can redistribute it and/or modify it
  8. * under the terms of the GNU Affero General Public License as published by the
  9. * Free Software Foundation, either version 3 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * oddjobs-dmg-calc is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  14. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
  15. * License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with oddjobs-dmg-calc. If not, see <https://www.gnu.org/licenses/>.
  19. *
  20. * @licend The above is the entire license notice for the JavaScript code in
  21. * this page.
  22. */
  23. import {
  24. Attack,
  25. ChargeType,
  26. Class,
  27. Speed,
  28. Spell,
  29. Stats,
  30. WeaponType,
  31. } from "./types.js";
  32. export function primaryStat(
  33. stats: Stats,
  34. wepType: WeaponType,
  35. goodAnim: boolean,
  36. clazz: Class,
  37. ): number {
  38. switch (wepType) {
  39. case WeaponType.None: {
  40. switch (clazz) {
  41. case Class.Pirate:
  42. return stats.str * 3;
  43. case Class.Pirate2nd:
  44. return stats.str * 4.2;
  45. default:
  46. return 0;
  47. }
  48. }
  49. case WeaponType.OneHandedSword:
  50. return stats.str * 4;
  51. case WeaponType.OneHandedAxe:
  52. return stats.str * (goodAnim ? 4.4 : 3.2);
  53. case WeaponType.OneHandedMace:
  54. return stats.str * (goodAnim ? 4.4 : 3.2);
  55. case WeaponType.Dagger:
  56. return clazz === Class.Rogue ? stats.luk * 3.6 : stats.str * 4;
  57. case WeaponType.Wand:
  58. return stats.str * (goodAnim ? 4.4 : 3.2);
  59. case WeaponType.Staff:
  60. return stats.str * (goodAnim ? 4.4 : 3.2);
  61. case WeaponType.TwoHandedSword:
  62. return stats.str * 4.6;
  63. case WeaponType.TwoHandedAxe:
  64. return stats.str * (goodAnim ? 4.8 : 3.4);
  65. case WeaponType.TwoHandedMace:
  66. return stats.str * (goodAnim ? 4.8 : 3.4);
  67. case WeaponType.Spear:
  68. return stats.str * (goodAnim ? 5 : 3);
  69. case WeaponType.Polearm:
  70. return stats.str * (goodAnim ? 5 : 3);
  71. case WeaponType.Bow:
  72. return stats.dex * 3.4;
  73. case WeaponType.Crossbow:
  74. return stats.dex * 3.6;
  75. case WeaponType.Claw:
  76. return stats.luk * 3.6;
  77. case WeaponType.Knuckler:
  78. return stats.str * 4.8;
  79. case WeaponType.Gun:
  80. return stats.dex * 3.6;
  81. }
  82. }
  83. export function secondaryStat(
  84. stats: Stats,
  85. wepType: WeaponType,
  86. clazz: Class,
  87. ): number {
  88. switch (wepType) {
  89. case WeaponType.None:
  90. return stats.dex;
  91. case WeaponType.OneHandedSword:
  92. return stats.dex;
  93. case WeaponType.OneHandedAxe:
  94. return stats.dex;
  95. case WeaponType.OneHandedMace:
  96. return stats.dex;
  97. case WeaponType.Dagger:
  98. return clazz === Class.Rogue ? stats.str + stats.dex : stats.dex;
  99. case WeaponType.Wand:
  100. return stats.dex;
  101. case WeaponType.Staff:
  102. return stats.dex;
  103. case WeaponType.TwoHandedSword:
  104. return stats.dex;
  105. case WeaponType.TwoHandedAxe:
  106. return stats.dex;
  107. case WeaponType.TwoHandedMace:
  108. return stats.dex;
  109. case WeaponType.Spear:
  110. return stats.dex;
  111. case WeaponType.Polearm:
  112. return stats.dex;
  113. case WeaponType.Bow:
  114. return stats.str;
  115. case WeaponType.Crossbow:
  116. return stats.str;
  117. case WeaponType.Claw:
  118. return stats.str + stats.dex;
  119. case WeaponType.Knuckler:
  120. return stats.dex;
  121. case WeaponType.Gun:
  122. return stats.str;
  123. }
  124. }
  125. /**
  126. * The return value of this function is a natural number of milliseconds, or
  127. * else `undefined`.
  128. *
  129. * The values here were extracted from:
  130. * <http://www.southperry.net/showthread.php?t=3217>
  131. */
  132. export function magicAttackPeriod(
  133. spellBooster: number,
  134. spell: Spell,
  135. speed: Speed,
  136. ): number | undefined {
  137. switch (spell) {
  138. case Spell.Other:
  139. case Spell.HolyArrow:
  140. case Spell.AngelRay: {
  141. switch (spellBooster) {
  142. case -2:
  143. return 720;
  144. case -1:
  145. return 750;
  146. case 0:
  147. return 810;
  148. default:
  149. return;
  150. }
  151. }
  152. case Spell.Heal:
  153. return 600;
  154. case Spell.ChainLightning: {
  155. switch (spellBooster) {
  156. case -2:
  157. return 690;
  158. case -1:
  159. return 750;
  160. case 0:
  161. return 780;
  162. default:
  163. return;
  164. }
  165. }
  166. case Spell.ShiningRay:
  167. case Spell.IceStrike: {
  168. switch (spellBooster) {
  169. case -2:
  170. return 930;
  171. case -1:
  172. return 990;
  173. case 0:
  174. return 1050;
  175. default:
  176. return;
  177. }
  178. }
  179. case Spell.PoisonMist: {
  180. switch (spellBooster) {
  181. case -2:
  182. return 1320;
  183. case -1:
  184. return 1410;
  185. case 0:
  186. return 1500;
  187. default:
  188. return;
  189. }
  190. }
  191. case Spell.ElementCompositionFP:
  192. case Spell.ElementCompositionIL: {
  193. switch (spellBooster) {
  194. case -2:
  195. return 810;
  196. case -1:
  197. return 870;
  198. case 0:
  199. return 900;
  200. default:
  201. return;
  202. }
  203. }
  204. case Spell.Explosion: {
  205. switch (spellBooster) {
  206. case -2: {
  207. switch (speed) {
  208. case Speed.Fast4:
  209. return 1500;
  210. case Speed.Fast5:
  211. return 1560;
  212. case Speed.Normal:
  213. return 1620;
  214. case Speed.Slow7:
  215. return 1680;
  216. case Speed.Slow8:
  217. return 1710;
  218. default:
  219. return;
  220. }
  221. }
  222. case -1: {
  223. switch (speed) {
  224. case Speed.Fast4:
  225. return 1620;
  226. case Speed.Fast5:
  227. return 1680;
  228. case Speed.Normal:
  229. return 1740;
  230. case Speed.Slow7:
  231. return 1770;
  232. case Speed.Slow8:
  233. return 1830;
  234. default:
  235. return;
  236. }
  237. }
  238. case 0: {
  239. switch (speed) {
  240. case Speed.Fast4:
  241. return 1710;
  242. case Speed.Fast5:
  243. return 1770;
  244. case Speed.Normal:
  245. return 1800;
  246. case Speed.Slow7:
  247. return 1860;
  248. case Speed.Slow8:
  249. return 1920;
  250. default:
  251. return;
  252. }
  253. }
  254. default:
  255. return;
  256. }
  257. }
  258. case Spell.Elquines:
  259. case Spell.Ifrit:
  260. case Spell.SummonDragon:
  261. case Spell.Bahamut:
  262. return 3030;
  263. case Spell.Genesis:
  264. return 2700;
  265. case Spell.MeteorShower:
  266. case Spell.Blizzard: {
  267. switch (spellBooster) {
  268. case -2:
  269. return 3060;
  270. case -1:
  271. return 3270;
  272. case 0:
  273. return 3480;
  274. default:
  275. return;
  276. }
  277. }
  278. case Spell.ThunderSpear: {
  279. switch (spellBooster) {
  280. case -2:
  281. return 1140;
  282. case -1:
  283. return 1230;
  284. case 0:
  285. return 1320;
  286. default:
  287. return;
  288. }
  289. }
  290. }
  291. }
  292. /**
  293. * The return value of this function is a natural number of milliseconds, or
  294. * else `undefined`.
  295. *
  296. * Not all combinations of weapon type & speed have an associated value. For
  297. * example, crossbows cannot have a "Slower" speed.
  298. *
  299. * The values here were extracted from:
  300. * <http://www.southperry.net/showthread.php?t=3217>
  301. */
  302. export function attackPeriod(
  303. wepType: WeaponType,
  304. speed: Speed,
  305. attack: Attack,
  306. ): number | undefined {
  307. /*======== Attacking skills with special attack periods ========*/
  308. switch (attack) {
  309. case Attack.Panic:
  310. case Attack.Coma:
  311. case Attack.HeavensHammerXiuz:
  312. case Attack.HeavensHammerXiuzCorrected:
  313. case Attack.Grenade:
  314. return;
  315. case Attack.Rush:
  316. return 1770;
  317. case Attack.Brandish:
  318. case Attack.Blast: {
  319. switch (speed) {
  320. case Speed.Faster2:
  321. return 630;
  322. case Speed.Faster3:
  323. return 690;
  324. case Speed.Fast4:
  325. return 750;
  326. case Speed.Fast5:
  327. return 810;
  328. case Speed.Normal:
  329. return 840;
  330. case Speed.Slow7:
  331. return 900;
  332. case Speed.Slow8:
  333. return 960;
  334. default:
  335. return;
  336. }
  337. }
  338. case Attack.CrusherHigh: {
  339. switch (speed) {
  340. case Speed.Faster2:
  341. return 810;
  342. case Speed.Faster3:
  343. return 870;
  344. case Speed.Fast4:
  345. return 930;
  346. case Speed.Fast5:
  347. return 990;
  348. case Speed.Normal:
  349. return 1050;
  350. case Speed.Slow7:
  351. return 1140;
  352. case Speed.Slow8:
  353. return 1200;
  354. case Speed.Slower:
  355. return 1260;
  356. }
  357. }
  358. case Attack.CrusherLow: {
  359. switch (speed) {
  360. case Speed.Faster2:
  361. return 690;
  362. case Speed.Faster3:
  363. return 750;
  364. case Speed.Fast4:
  365. return 810;
  366. case Speed.Fast5:
  367. return 870;
  368. case Speed.Normal:
  369. return 900;
  370. case Speed.Slow7:
  371. return 960;
  372. case Speed.Slow8:
  373. return 1020;
  374. case Speed.Slower:
  375. return 1080;
  376. }
  377. }
  378. case Attack.Fury: {
  379. switch (speed) {
  380. case Speed.Faster2:
  381. return 600;
  382. case Speed.Faster3:
  383. return 660;
  384. case Speed.Fast4:
  385. return 720;
  386. case Speed.Fast5:
  387. return 750;
  388. case Speed.Normal:
  389. return 810;
  390. case Speed.Slow7:
  391. return 870;
  392. case Speed.Slow8:
  393. return 900;
  394. case Speed.Slower:
  395. return 960;
  396. }
  397. }
  398. case Attack.DragonRoar: {
  399. switch (speed) {
  400. case Speed.Faster2:
  401. return 1140;
  402. case Speed.Faster3:
  403. return 1230;
  404. case Speed.Fast4:
  405. return 1320;
  406. case Speed.Fast5:
  407. return 1410;
  408. case Speed.Normal:
  409. return 1500;
  410. case Speed.Slow7:
  411. return 1620;
  412. case Speed.Slow8:
  413. return 1710;
  414. case Speed.Slower:
  415. return 1800;
  416. }
  417. }
  418. case Attack.Hurricane:
  419. case Attack.RapidFire:
  420. return 120;
  421. case Attack.Phoenix:
  422. case Attack.Frostprey:
  423. return 3030;
  424. case Attack.DoubleStab: {
  425. // Double Stab's attack periods are laid out to be the same as a
  426. // basic-attack with a weapon speed category that has been lowered
  427. // by two.
  428. switch (speed) {
  429. case Speed.Faster2:
  430. return 600;
  431. case Speed.Faster3:
  432. return 600;
  433. case Speed.Fast4:
  434. return 600;
  435. case Speed.Fast5:
  436. return 660;
  437. case Speed.Normal:
  438. return 720;
  439. case Speed.Slow7:
  440. return 750;
  441. case Speed.Slow8:
  442. return 810;
  443. default:
  444. return;
  445. }
  446. }
  447. case Attack.Avenger: {
  448. switch (speed) {
  449. case Speed.Faster2:
  450. return 630;
  451. case Speed.Faster3:
  452. return 690;
  453. case Speed.Fast4:
  454. return 750;
  455. case Speed.Fast5:
  456. return 810;
  457. case Speed.Normal:
  458. return 840;
  459. default:
  460. return;
  461. }
  462. }
  463. case Attack.Assaulter: {
  464. switch (speed) {
  465. case Speed.Faster2:
  466. return 900;
  467. case Speed.Faster3:
  468. return 990;
  469. case Speed.Fast4:
  470. return 1050;
  471. case Speed.Fast5:
  472. return 1140;
  473. default:
  474. return;
  475. }
  476. }
  477. case Attack.NinjaAmbush:
  478. case Attack.VenomousStar:
  479. case Attack.VenomousStab:
  480. return 1000;
  481. case Attack.NinjaStorm:
  482. return 1440;
  483. case Attack.SavageBlow: {
  484. switch (speed) {
  485. case Speed.Faster2:
  486. return 720;
  487. case Speed.Faster3:
  488. return 780;
  489. case Speed.Fast4:
  490. return 840;
  491. case Speed.Fast5:
  492. return 900;
  493. default:
  494. return;
  495. }
  496. }
  497. case Attack.BoomerangStep:
  498. return 1950;
  499. case Attack.FlashFist:
  500. case Attack.EnergyDrain: {
  501. switch (speed) {
  502. case Speed.Faster2:
  503. return 450;
  504. case Speed.Faster3:
  505. return 510;
  506. case Speed.Fast4:
  507. return 540;
  508. case Speed.Fast5:
  509. return 570;
  510. case Speed.Normal:
  511. return 600;
  512. default:
  513. return;
  514. }
  515. }
  516. case Attack.SomersaultKick: {
  517. // See issue #8
  518. switch (speed) {
  519. case Speed.Faster2:
  520. return 660;
  521. case Speed.Faster3:
  522. return 720;
  523. case Speed.Fast4:
  524. return 780;
  525. case Speed.Fast5:
  526. return 840;
  527. case Speed.Normal:
  528. return 870;
  529. default:
  530. return;
  531. }
  532. }
  533. case Attack.DoubleShot: {
  534. switch (speed) {
  535. case Speed.Faster2:
  536. return 390;
  537. case Speed.Faster3:
  538. return 420;
  539. case Speed.Fast4:
  540. return 450;
  541. case Speed.Fast5:
  542. case Speed.Normal:
  543. return 480;
  544. default:
  545. return;
  546. }
  547. }
  548. case Attack.BackspinBlow:
  549. return 1980;
  550. case Attack.DoubleUppercut:
  551. return 2160;
  552. case Attack.EnergyBlast:
  553. return 1140;
  554. case Attack.Shockwave: {
  555. switch (speed) {
  556. case Speed.Faster2:
  557. return 1500;
  558. case Speed.Faster3:
  559. return 1620;
  560. case Speed.Fast4:
  561. return 1740;
  562. case Speed.Fast5:
  563. return 1860;
  564. case Speed.Normal:
  565. return 1980;
  566. default:
  567. return;
  568. }
  569. }
  570. case Attack.DragonStrike:
  571. return 2250;
  572. case Attack.EnergyOrb: {
  573. switch (speed) {
  574. case Speed.Faster2:
  575. return 930;
  576. case Speed.Faster3:
  577. return 990;
  578. case Speed.Fast4:
  579. return 1050;
  580. case Speed.Fast5:
  581. return 1140;
  582. case Speed.Normal:
  583. return 1200;
  584. default:
  585. return;
  586. }
  587. }
  588. case Attack.Demolition: {
  589. switch (speed) {
  590. case Speed.Faster2:
  591. return 2340;
  592. case Speed.Faster3:
  593. return 2550;
  594. case Speed.Fast4:
  595. return 2730;
  596. case Speed.Fast5:
  597. return 2940;
  598. case Speed.Normal:
  599. return 3120;
  600. default:
  601. return;
  602. }
  603. }
  604. case Attack.Snatch:
  605. return 1320;
  606. case Attack.Barrage:
  607. return 3240;
  608. case Attack.InvisibleShot: {
  609. switch (speed) {
  610. case Speed.Faster2:
  611. return 630;
  612. case Speed.Faster3:
  613. return 660;
  614. case Speed.Fast4:
  615. return 720;
  616. case Speed.Fast5:
  617. return 750;
  618. case Speed.Normal:
  619. return 810;
  620. default:
  621. return;
  622. }
  623. }
  624. case Attack.BlankShot:
  625. case Attack.BurstFire: {
  626. switch (speed) {
  627. case Speed.Faster2:
  628. return 660;
  629. case Speed.Faster3:
  630. return 690;
  631. case Speed.Fast4:
  632. return 750;
  633. case Speed.Fast5:
  634. return 810;
  635. case Speed.Normal:
  636. return 840;
  637. default:
  638. return;
  639. }
  640. }
  641. case Attack.RecoilShot:
  642. return 2310;
  643. case Attack.Octopus:
  644. case Attack.Gaviota:
  645. return 1530;
  646. case Attack.WrathOfTheOctopi:
  647. return 1530 / 2; // See issue #9
  648. case Attack.Flamethrower:
  649. case Attack.IceSplitter:
  650. return 1050;
  651. case Attack.AerialStrike:
  652. return 5000;
  653. case Attack.HomingBeacon:
  654. case Attack.BattleshipTorpedo: {
  655. switch (speed) {
  656. case Speed.Faster2:
  657. return 720;
  658. case Speed.Faster3:
  659. return 780;
  660. case Speed.Fast4:
  661. return 840;
  662. case Speed.Fast5:
  663. return 900;
  664. case Speed.Normal:
  665. return 960;
  666. default:
  667. return;
  668. }
  669. }
  670. case Attack.BattleshipCannon: {
  671. switch (speed) {
  672. case Speed.Faster2:
  673. return 600;
  674. case Speed.Faster3:
  675. return 630;
  676. case Speed.Fast4:
  677. return 690;
  678. case Speed.Fast5:
  679. return 750;
  680. case Speed.Normal:
  681. return 780;
  682. default:
  683. return;
  684. }
  685. }
  686. default:
  687. break;
  688. }
  689. /*======== Basic attack periods ========*/
  690. switch (wepType) {
  691. case WeaponType.None:
  692. case WeaponType.OneHandedSword:
  693. case WeaponType.OneHandedAxe:
  694. case WeaponType.OneHandedMace:
  695. case WeaponType.Dagger:
  696. case WeaponType.Wand:
  697. case WeaponType.Staff:
  698. case WeaponType.TwoHandedSword:
  699. case WeaponType.TwoHandedAxe:
  700. case WeaponType.TwoHandedMace:
  701. case WeaponType.Bow:
  702. case WeaponType.Claw:
  703. case WeaponType.Knuckler: {
  704. switch (speed) {
  705. case Speed.Faster2:
  706. return 600;
  707. case Speed.Faster3:
  708. return 660;
  709. case Speed.Fast4:
  710. return 720;
  711. case Speed.Fast5:
  712. return 750;
  713. case Speed.Normal:
  714. return 810;
  715. case Speed.Slow7:
  716. return 870;
  717. case Speed.Slow8:
  718. return 900;
  719. default:
  720. return;
  721. }
  722. }
  723. case WeaponType.Spear:
  724. case WeaponType.Polearm: {
  725. switch (speed) {
  726. case Speed.Faster2:
  727. return 570;
  728. case Speed.Faster3:
  729. return 630;
  730. case Speed.Fast4:
  731. return 660;
  732. case Speed.Fast5:
  733. return 720;
  734. case Speed.Normal:
  735. return 750;
  736. case Speed.Slow7:
  737. return 810;
  738. case Speed.Slow8:
  739. return 870;
  740. case Speed.Slower:
  741. return 900;
  742. }
  743. }
  744. case WeaponType.Crossbow: {
  745. switch (speed) {
  746. case Speed.Faster2:
  747. return 630;
  748. case Speed.Faster3:
  749. return 690;
  750. case Speed.Fast4:
  751. return 720;
  752. case Speed.Fast5:
  753. return 780;
  754. case Speed.Normal:
  755. return 870;
  756. default:
  757. return;
  758. }
  759. }
  760. case WeaponType.Gun: {
  761. switch (speed) {
  762. case Speed.Faster2:
  763. return 630;
  764. case Speed.Faster3:
  765. return 690;
  766. case Speed.Fast4:
  767. return 750;
  768. case Speed.Fast5:
  769. return 780;
  770. case Speed.Normal:
  771. return 810;
  772. default:
  773. return;
  774. }
  775. }
  776. }
  777. }
  778. export function attackIsElemental(attack: Attack): boolean {
  779. switch (attack) {
  780. case Attack.Inferno:
  781. case Attack.Blizzard:
  782. case Attack.Phoenix:
  783. case Attack.Frostprey:
  784. case Attack.VenomousStar:
  785. case Attack.VenomousStab:
  786. case Attack.Flamethrower:
  787. case Attack.IceSplitter:
  788. return true;
  789. default:
  790. return false;
  791. }
  792. }
  793. export function isHolySpell(spell: Spell): boolean {
  794. switch (spell) {
  795. case Spell.Heal:
  796. case Spell.HolyArrow:
  797. case Spell.ShiningRay:
  798. case Spell.SummonDragon:
  799. case Spell.Bahamut:
  800. case Spell.AngelRay:
  801. case Spell.Genesis:
  802. return true;
  803. default:
  804. return false;
  805. }
  806. }
  807. export function isSummon(attack: Attack): boolean {
  808. switch (attack) {
  809. case Attack.Phoenix:
  810. case Attack.Frostprey:
  811. case Attack.Octopus:
  812. case Attack.Gaviota:
  813. case Attack.WrathOfTheOctopi:
  814. return true;
  815. default:
  816. return false;
  817. }
  818. }
  819. export function weaponTypeName(wepType: WeaponType): string {
  820. switch (wepType) {
  821. case WeaponType.None:
  822. return "no weapon";
  823. case WeaponType.OneHandedSword:
  824. return "one-handed sword";
  825. case WeaponType.OneHandedAxe:
  826. return "one-handed axe";
  827. case WeaponType.OneHandedMace:
  828. return "one-handed blunt weapon";
  829. case WeaponType.Dagger:
  830. return "dagger";
  831. case WeaponType.Wand:
  832. return "wand";
  833. case WeaponType.Staff:
  834. return "staff";
  835. case WeaponType.TwoHandedSword:
  836. return "two-handed sword";
  837. case WeaponType.TwoHandedAxe:
  838. return "two-handed axe";
  839. case WeaponType.TwoHandedMace:
  840. return "two-handed blunt weapon";
  841. case WeaponType.Spear:
  842. return "spear";
  843. case WeaponType.Polearm:
  844. return "polearm";
  845. case WeaponType.Bow:
  846. return "bow";
  847. case WeaponType.Crossbow:
  848. return "crossbow";
  849. case WeaponType.Claw:
  850. return "claw";
  851. case WeaponType.Knuckler:
  852. return "knuckler";
  853. case WeaponType.Gun:
  854. return "gun";
  855. }
  856. }
  857. export function className(clazz: Class): string {
  858. switch (clazz) {
  859. case Class.Beginner:
  860. return "beginner";
  861. case Class.Warrior:
  862. return "warrior";
  863. case Class.Magician:
  864. return "magician";
  865. case Class.Archer:
  866. return "archer";
  867. case Class.Rogue:
  868. return "rogue";
  869. case Class.Pirate:
  870. return "pirate";
  871. case Class.Pirate2nd:
  872. return "\u{2265}2\u{207f}\u{1d48} job pirate";
  873. }
  874. }
  875. export function attackName(attack: Attack): string {
  876. switch (attack) {
  877. case Attack.Other:
  878. return "basic attack";
  879. case Attack.BowWhack:
  880. return "bow whack";
  881. case Attack.ClawPunch:
  882. return "claw punch";
  883. case Attack.Panic:
  884. return "Panic";
  885. case Attack.Coma:
  886. return "Coma";
  887. case Attack.Rush:
  888. return "Rush";
  889. case Attack.Brandish:
  890. return "Brandish";
  891. case Attack.Blast:
  892. return "Blast";
  893. case Attack.HeavensHammerXiuz:
  894. return "Heaven\u{2019}s Hammer (original Xiuz)";
  895. case Attack.HeavensHammerXiuzCorrected:
  896. return "Heaven\u{2019}s Hammer (corrected Xiuz)";
  897. case Attack.CrusherHigh:
  898. return "Crusher (lvl 16\u{301c}30)";
  899. case Attack.CrusherLow:
  900. return "Crusher (lvl 1\u{301c}15)";
  901. case Attack.Fury:
  902. return "Fury";
  903. case Attack.DragonRoar:
  904. return "Dragon Roar";
  905. case Attack.PowerKnockBack:
  906. return "Power Knock-Back";
  907. case Attack.ArrowBombImpact:
  908. return "Arrow Bomb (impact)";
  909. case Attack.ArrowBombSplash:
  910. return "Arrow Bomb (splash)";
  911. case Attack.IronArrow:
  912. return "Iron Arrow";
  913. case Attack.Inferno:
  914. return "Inferno";
  915. case Attack.Blizzard:
  916. return "Blizzard";
  917. case Attack.Hurricane:
  918. return "Hurricane";
  919. case Attack.Phoenix:
  920. return "Phoenix";
  921. case Attack.Frostprey:
  922. return "Frostprey";
  923. case Attack.PiercingArrow:
  924. return "Piercing Arrow";
  925. case Attack.DoubleStab:
  926. return "Double Stab";
  927. case Attack.LuckySeven:
  928. return "Lucky Seven";
  929. case Attack.Avenger:
  930. return "Avenger";
  931. case Attack.TripleThrow:
  932. return "Triple Throw";
  933. case Attack.Assaulter:
  934. return "Assaulter";
  935. case Attack.NinjaAmbush:
  936. return "Ninja Ambush";
  937. case Attack.VenomousStar:
  938. return "Venomous Star";
  939. case Attack.VenomousStab:
  940. return "Venomous Stab";
  941. case Attack.NinjaStorm:
  942. return "Ninja Storm";
  943. case Attack.SavageBlow:
  944. return "Savage Blow";
  945. case Attack.BoomerangStep:
  946. return "Boomerang Step";
  947. case Attack.FlashFist:
  948. return "Flash Fist";
  949. case Attack.SomersaultKick:
  950. return "Somersault Kick";
  951. case Attack.DoubleShot:
  952. return "Double Shot";
  953. case Attack.BackspinBlow:
  954. return "Backspin Blow";
  955. case Attack.DoubleUppercut:
  956. return "Double Uppercut";
  957. case Attack.EnergyDrain:
  958. return "Energy Drain";
  959. case Attack.EnergyBlast:
  960. return "Energy Blast";
  961. case Attack.Shockwave:
  962. return "Shockwave";
  963. case Attack.DragonStrike:
  964. return "Dragon Strike";
  965. case Attack.EnergyOrb:
  966. return "Energy Orb";
  967. case Attack.Demolition:
  968. return "Demolition";
  969. case Attack.Snatch:
  970. return "Snatch";
  971. case Attack.Barrage:
  972. return "Barrage";
  973. case Attack.InvisibleShot:
  974. return "Invisible Shot";
  975. case Attack.Grenade:
  976. return "Grenade";
  977. case Attack.BlankShot:
  978. return "Blank Shot";
  979. case Attack.RecoilShot:
  980. return "Recoil Shot";
  981. case Attack.BurstFire:
  982. return "Burst Fire";
  983. case Attack.Octopus:
  984. return "Octopus";
  985. case Attack.Gaviota:
  986. return "Gaviota";
  987. case Attack.Flamethrower:
  988. return "Flamethrower";
  989. case Attack.IceSplitter:
  990. return "Ice Splitter";
  991. case Attack.HomingBeacon:
  992. return "Homing Beacon";
  993. case Attack.WrathOfTheOctopi:
  994. return "Wrath of the Octopi";
  995. case Attack.AerialStrike:
  996. return "Aerial Strike";
  997. case Attack.RapidFire:
  998. return "Rapid Fire";
  999. case Attack.BattleshipCannon:
  1000. return "Battleship Cannon";
  1001. case Attack.BattleshipTorpedo:
  1002. return "Battleship Torpedo";
  1003. }
  1004. }
  1005. export function spellName(spell: Spell): string {
  1006. switch (spell) {
  1007. case Spell.Other:
  1008. return "a spell";
  1009. case Spell.Explosion:
  1010. return "Explosion";
  1011. case Spell.PoisonMist:
  1012. return "Poison Mist";
  1013. case Spell.ElementCompositionFP:
  1014. return "Element Composition [F/P]";
  1015. case Spell.Elquines:
  1016. return "Elquines";
  1017. case Spell.MeteorShower:
  1018. return "Meteor Shower";
  1019. case Spell.IceStrike:
  1020. return "Ice Strike";
  1021. case Spell.ThunderSpear:
  1022. return "Thunder Spear";
  1023. case Spell.ElementCompositionIL:
  1024. return "Element Composition [I/L]";
  1025. case Spell.Ifrit:
  1026. return "Ifrit";
  1027. case Spell.ChainLightning:
  1028. return "Chain Lightning";
  1029. case Spell.Blizzard:
  1030. return "Blizzard";
  1031. case Spell.Heal:
  1032. return "Heal";
  1033. case Spell.HolyArrow:
  1034. return "Holy Arrow";
  1035. case Spell.ShiningRay:
  1036. return "Shining Ray";
  1037. case Spell.SummonDragon:
  1038. return "Summon Dragon";
  1039. case Spell.Bahamut:
  1040. return "Bahamut";
  1041. case Spell.AngelRay:
  1042. return "Angel Ray";
  1043. case Spell.Genesis:
  1044. return "Genesis";
  1045. }
  1046. }
  1047. export function chargeTypeFromValue(val: string): ChargeType | undefined {
  1048. switch (val) {
  1049. case "no-ele-charge":
  1050. return ChargeType.None;
  1051. case "holy-ele-charge":
  1052. return ChargeType.Holy;
  1053. case "other-ele-charge":
  1054. return ChargeType.Other;
  1055. default:
  1056. return;
  1057. }
  1058. }
  1059. export function chargeTypeToValue(chargeType: ChargeType): string {
  1060. switch (chargeType) {
  1061. case ChargeType.None:
  1062. return "no-ele-charge";
  1063. case ChargeType.Holy:
  1064. return "holy-ele-charge";
  1065. case ChargeType.Other:
  1066. return "other-ele-charge";
  1067. }
  1068. }
  1069. export const BAD_WEPS = new Map([
  1070. [
  1071. Class.Beginner,
  1072. new Set([
  1073. WeaponType.None,
  1074. WeaponType.TwoHandedAxe,
  1075. WeaponType.Staff,
  1076. WeaponType.Bow,
  1077. WeaponType.Crossbow,
  1078. WeaponType.Knuckler,
  1079. WeaponType.Gun,
  1080. ]),
  1081. ],
  1082. [
  1083. Class.Warrior,
  1084. new Set([
  1085. WeaponType.None,
  1086. WeaponType.Staff,
  1087. WeaponType.Bow,
  1088. WeaponType.Crossbow,
  1089. WeaponType.Knuckler,
  1090. WeaponType.Gun,
  1091. ]),
  1092. ],
  1093. [
  1094. Class.Magician,
  1095. new Set([
  1096. WeaponType.None,
  1097. WeaponType.TwoHandedAxe,
  1098. WeaponType.Bow,
  1099. WeaponType.Crossbow,
  1100. WeaponType.Knuckler,
  1101. WeaponType.Gun,
  1102. ]),
  1103. ],
  1104. [
  1105. Class.Archer,
  1106. new Set([
  1107. WeaponType.None,
  1108. WeaponType.Staff,
  1109. WeaponType.Knuckler,
  1110. WeaponType.Gun,
  1111. ]),
  1112. ],
  1113. [
  1114. Class.Rogue,
  1115. new Set([
  1116. WeaponType.None,
  1117. WeaponType.Staff,
  1118. WeaponType.Bow,
  1119. WeaponType.Crossbow,
  1120. WeaponType.Knuckler,
  1121. WeaponType.Gun,
  1122. ]),
  1123. ],
  1124. [
  1125. Class.Pirate,
  1126. new Set([
  1127. WeaponType.TwoHandedAxe,
  1128. WeaponType.Staff,
  1129. WeaponType.Bow,
  1130. WeaponType.Crossbow,
  1131. ]),
  1132. ],
  1133. [
  1134. Class.Pirate2nd,
  1135. new Set([
  1136. WeaponType.TwoHandedAxe,
  1137. WeaponType.Staff,
  1138. WeaponType.Bow,
  1139. WeaponType.Crossbow,
  1140. ]),
  1141. ],
  1142. ]);
  1143. export const ATTACK_REQS: Map<
  1144. Attack,
  1145. [Set<Class>, number, Set<WeaponType>]
  1146. > = new Map([
  1147. [
  1148. Attack.Other,
  1149. [
  1150. new Set([
  1151. Class.Beginner,
  1152. Class.Warrior,
  1153. Class.Magician,
  1154. Class.Archer,
  1155. Class.Rogue,
  1156. Class.Pirate,
  1157. Class.Pirate2nd,
  1158. ]),
  1159. 0,
  1160. new Set([
  1161. WeaponType.None,
  1162. WeaponType.OneHandedSword,
  1163. WeaponType.OneHandedAxe,
  1164. WeaponType.OneHandedMace,
  1165. WeaponType.Dagger,
  1166. WeaponType.Wand,
  1167. WeaponType.Staff,
  1168. WeaponType.TwoHandedSword,
  1169. WeaponType.TwoHandedAxe,
  1170. WeaponType.TwoHandedMace,
  1171. WeaponType.Spear,
  1172. WeaponType.Polearm,
  1173. WeaponType.Bow,
  1174. WeaponType.Crossbow,
  1175. WeaponType.Claw,
  1176. WeaponType.Knuckler,
  1177. WeaponType.Gun,
  1178. ]),
  1179. ],
  1180. ],
  1181. [
  1182. Attack.BowWhack,
  1183. [
  1184. new Set([
  1185. Class.Beginner,
  1186. Class.Warrior,
  1187. Class.Magician,
  1188. Class.Archer,
  1189. Class.Rogue,
  1190. Class.Pirate,
  1191. Class.Pirate2nd,
  1192. ]),
  1193. 0,
  1194. new Set([WeaponType.Bow, WeaponType.Crossbow]),
  1195. ],
  1196. ],
  1197. [
  1198. Attack.ClawPunch,
  1199. [
  1200. new Set([
  1201. Class.Beginner,
  1202. Class.Warrior,
  1203. Class.Magician,
  1204. Class.Archer,
  1205. Class.Rogue,
  1206. Class.Pirate,
  1207. Class.Pirate2nd,
  1208. ]),
  1209. 0,
  1210. new Set([WeaponType.Claw]),
  1211. ],
  1212. ],
  1213. [
  1214. Attack.Panic,
  1215. [
  1216. new Set([Class.Warrior]),
  1217. 71,
  1218. new Set([
  1219. WeaponType.OneHandedSword,
  1220. WeaponType.OneHandedAxe,
  1221. WeaponType.TwoHandedSword,
  1222. WeaponType.TwoHandedAxe,
  1223. ]),
  1224. ],
  1225. ],
  1226. [
  1227. Attack.Coma,
  1228. [
  1229. new Set([Class.Warrior]),
  1230. 71,
  1231. new Set([
  1232. WeaponType.OneHandedSword,
  1233. WeaponType.OneHandedAxe,
  1234. WeaponType.TwoHandedSword,
  1235. WeaponType.TwoHandedAxe,
  1236. ]),
  1237. ],
  1238. ],
  1239. [
  1240. Attack.Rush,
  1241. [
  1242. new Set([Class.Warrior]),
  1243. 120,
  1244. new Set([
  1245. WeaponType.None,
  1246. WeaponType.OneHandedSword,
  1247. WeaponType.OneHandedAxe,
  1248. WeaponType.OneHandedMace,
  1249. WeaponType.Dagger,
  1250. WeaponType.Wand,
  1251. WeaponType.Staff,
  1252. WeaponType.TwoHandedSword,
  1253. WeaponType.TwoHandedAxe,
  1254. WeaponType.TwoHandedMace,
  1255. WeaponType.Spear,
  1256. WeaponType.Polearm,
  1257. WeaponType.Bow,
  1258. WeaponType.Crossbow,
  1259. WeaponType.Claw,
  1260. WeaponType.Knuckler,
  1261. WeaponType.Gun,
  1262. ]),
  1263. ],
  1264. ],
  1265. [
  1266. Attack.Brandish,
  1267. [
  1268. new Set([Class.Warrior]),
  1269. 120,
  1270. new Set([
  1271. WeaponType.OneHandedSword,
  1272. WeaponType.OneHandedAxe,
  1273. WeaponType.TwoHandedSword,
  1274. WeaponType.TwoHandedAxe,
  1275. ]),
  1276. ],
  1277. ],
  1278. [
  1279. Attack.Blast,
  1280. [
  1281. new Set([Class.Warrior]),
  1282. 120,
  1283. new Set([
  1284. WeaponType.OneHandedSword,
  1285. WeaponType.OneHandedMace,
  1286. WeaponType.TwoHandedSword,
  1287. WeaponType.TwoHandedMace,
  1288. ]),
  1289. ],
  1290. ],
  1291. [
  1292. Attack.HeavensHammerXiuz,
  1293. [
  1294. new Set([Class.Warrior]),
  1295. 120,
  1296. new Set([
  1297. WeaponType.None,
  1298. WeaponType.OneHandedSword,
  1299. WeaponType.OneHandedAxe,
  1300. WeaponType.OneHandedMace,
  1301. WeaponType.Dagger,
  1302. WeaponType.Wand,
  1303. WeaponType.Staff,
  1304. WeaponType.TwoHandedSword,
  1305. WeaponType.TwoHandedAxe,
  1306. WeaponType.TwoHandedMace,
  1307. WeaponType.Spear,
  1308. WeaponType.Polearm,
  1309. WeaponType.Bow,
  1310. WeaponType.Crossbow,
  1311. WeaponType.Claw,
  1312. WeaponType.Knuckler,
  1313. WeaponType.Gun,
  1314. ]),
  1315. ],
  1316. ],
  1317. [
  1318. Attack.HeavensHammerXiuzCorrected,
  1319. [
  1320. new Set([Class.Warrior]),
  1321. 120,
  1322. new Set([
  1323. WeaponType.None,
  1324. WeaponType.OneHandedSword,
  1325. WeaponType.OneHandedAxe,
  1326. WeaponType.OneHandedMace,
  1327. WeaponType.Dagger,
  1328. WeaponType.Wand,
  1329. WeaponType.Staff,
  1330. WeaponType.TwoHandedSword,
  1331. WeaponType.TwoHandedAxe,
  1332. WeaponType.TwoHandedMace,
  1333. WeaponType.Spear,
  1334. WeaponType.Polearm,
  1335. WeaponType.Bow,
  1336. WeaponType.Crossbow,
  1337. WeaponType.Claw,
  1338. WeaponType.Knuckler,
  1339. WeaponType.Gun,
  1340. ]),
  1341. ],
  1342. ],
  1343. [
  1344. Attack.CrusherHigh,
  1345. [
  1346. new Set([Class.Warrior]),
  1347. 75,
  1348. new Set([WeaponType.Spear, WeaponType.Polearm]),
  1349. ],
  1350. ],
  1351. [
  1352. Attack.CrusherLow,
  1353. [
  1354. new Set([Class.Warrior]),
  1355. 70,
  1356. new Set([WeaponType.Spear, WeaponType.Polearm]),
  1357. ],
  1358. ],
  1359. [
  1360. Attack.Fury,
  1361. [
  1362. new Set([Class.Warrior]),
  1363. 70,
  1364. new Set([WeaponType.Spear, WeaponType.Polearm]),
  1365. ],
  1366. ],
  1367. [
  1368. Attack.DragonRoar,
  1369. [
  1370. new Set([Class.Warrior]),
  1371. 71,
  1372. new Set([WeaponType.Spear, WeaponType.Polearm]),
  1373. ],
  1374. ],
  1375. [
  1376. Attack.PowerKnockBack,
  1377. [
  1378. new Set([Class.Archer]),
  1379. 30,
  1380. new Set([WeaponType.Bow, WeaponType.Crossbow]),
  1381. ],
  1382. ],
  1383. [
  1384. Attack.ArrowBombImpact,
  1385. [new Set([Class.Archer]), 30, new Set([WeaponType.Bow])],
  1386. ],
  1387. [
  1388. Attack.ArrowBombSplash,
  1389. [new Set([Class.Archer]), 30, new Set([WeaponType.Bow])],
  1390. ],
  1391. [
  1392. Attack.IronArrow,
  1393. [new Set([Class.Archer]), 30, new Set([WeaponType.Crossbow])],
  1394. ],
  1395. [Attack.Inferno, [new Set([Class.Archer]), 70, new Set([WeaponType.Bow])]],
  1396. [
  1397. Attack.Blizzard,
  1398. [new Set([Class.Archer]), 70, new Set([WeaponType.Crossbow])],
  1399. ],
  1400. [
  1401. Attack.Hurricane,
  1402. [new Set([Class.Archer]), 120, new Set([WeaponType.Bow])],
  1403. ],
  1404. [
  1405. Attack.Phoenix,
  1406. [
  1407. new Set([Class.Archer]),
  1408. 120,
  1409. new Set([
  1410. WeaponType.None,
  1411. WeaponType.OneHandedSword,
  1412. WeaponType.OneHandedAxe,
  1413. WeaponType.OneHandedMace,
  1414. WeaponType.Dagger,
  1415. WeaponType.Wand,
  1416. WeaponType.Staff,
  1417. WeaponType.TwoHandedSword,
  1418. WeaponType.TwoHandedAxe,
  1419. WeaponType.TwoHandedMace,
  1420. WeaponType.Spear,
  1421. WeaponType.Polearm,
  1422. WeaponType.Bow,
  1423. WeaponType.Crossbow,
  1424. WeaponType.Claw,
  1425. WeaponType.Knuckler,
  1426. WeaponType.Gun,
  1427. ]),
  1428. ],
  1429. ],
  1430. [
  1431. Attack.Frostprey,
  1432. [
  1433. new Set([Class.Archer]),
  1434. 120,
  1435. new Set([
  1436. WeaponType.None,
  1437. WeaponType.OneHandedSword,
  1438. WeaponType.OneHandedAxe,
  1439. WeaponType.OneHandedMace,
  1440. WeaponType.Dagger,
  1441. WeaponType.Wand,
  1442. WeaponType.Staff,
  1443. WeaponType.TwoHandedSword,
  1444. WeaponType.TwoHandedAxe,
  1445. WeaponType.TwoHandedMace,
  1446. WeaponType.Spear,
  1447. WeaponType.Polearm,
  1448. WeaponType.Bow,
  1449. WeaponType.Crossbow,
  1450. WeaponType.Claw,
  1451. WeaponType.Knuckler,
  1452. WeaponType.Gun,
  1453. ]),
  1454. ],
  1455. ],
  1456. [
  1457. Attack.PiercingArrow,
  1458. [new Set([Class.Archer]), 120, new Set([WeaponType.Crossbow])],
  1459. ],
  1460. [
  1461. Attack.LuckySeven,
  1462. [new Set([Class.Rogue]), 10, new Set([WeaponType.Claw])],
  1463. ],
  1464. [Attack.Avenger, [new Set([Class.Rogue]), 70, new Set([WeaponType.Claw])]],
  1465. [
  1466. Attack.TripleThrow,
  1467. [new Set([Class.Rogue]), 120, new Set([WeaponType.Claw])],
  1468. ],
  1469. [
  1470. Attack.Assaulter,
  1471. [new Set([Class.Rogue]), 70, new Set([WeaponType.Dagger])],
  1472. ],
  1473. [
  1474. Attack.NinjaAmbush,
  1475. [
  1476. new Set([Class.Rogue]),
  1477. 122,
  1478. new Set([
  1479. WeaponType.None,
  1480. WeaponType.OneHandedSword,
  1481. WeaponType.OneHandedAxe,
  1482. WeaponType.OneHandedMace,
  1483. WeaponType.Dagger,
  1484. WeaponType.Wand,
  1485. WeaponType.Staff,
  1486. WeaponType.TwoHandedSword,
  1487. WeaponType.TwoHandedAxe,
  1488. WeaponType.TwoHandedMace,
  1489. WeaponType.Spear,
  1490. WeaponType.Polearm,
  1491. WeaponType.Bow,
  1492. WeaponType.Crossbow,
  1493. WeaponType.Claw,
  1494. WeaponType.Knuckler,
  1495. WeaponType.Gun,
  1496. ]),
  1497. ],
  1498. ],
  1499. [
  1500. Attack.VenomousStar,
  1501. [new Set([Class.Rogue]), 120, new Set([WeaponType.Claw])],
  1502. ],
  1503. [
  1504. Attack.VenomousStab,
  1505. [new Set([Class.Rogue]), 120, new Set([WeaponType.Dagger])],
  1506. ],
  1507. [
  1508. Attack.NinjaStorm,
  1509. [
  1510. new Set([Class.Rogue]),
  1511. 120,
  1512. new Set([
  1513. WeaponType.None,
  1514. WeaponType.OneHandedSword,
  1515. WeaponType.OneHandedAxe,
  1516. WeaponType.OneHandedMace,
  1517. WeaponType.Dagger,
  1518. WeaponType.Wand,
  1519. WeaponType.Staff,
  1520. WeaponType.TwoHandedSword,
  1521. WeaponType.TwoHandedAxe,
  1522. WeaponType.TwoHandedMace,
  1523. WeaponType.Spear,
  1524. WeaponType.Polearm,
  1525. WeaponType.Bow,
  1526. WeaponType.Crossbow,
  1527. WeaponType.Claw,
  1528. WeaponType.Knuckler,
  1529. WeaponType.Gun,
  1530. ]),
  1531. ],
  1532. ],
  1533. [
  1534. Attack.SavageBlow,
  1535. [new Set([Class.Rogue]), 30, new Set([WeaponType.Dagger])],
  1536. ],
  1537. [
  1538. Attack.BoomerangStep,
  1539. [new Set([Class.Rogue]), 120, new Set([WeaponType.Dagger])],
  1540. ],
  1541. [
  1542. Attack.FlashFist,
  1543. [
  1544. new Set([Class.Pirate, Class.Pirate2nd]),
  1545. 10,
  1546. new Set([WeaponType.None, WeaponType.Knuckler]),
  1547. ],
  1548. ],
  1549. [
  1550. Attack.SomersaultKick,
  1551. [
  1552. new Set([Class.Pirate, Class.Pirate2nd]),
  1553. 10,
  1554. new Set([
  1555. WeaponType.None,
  1556. WeaponType.OneHandedSword,
  1557. WeaponType.OneHandedAxe,
  1558. WeaponType.OneHandedMace,
  1559. WeaponType.Dagger,
  1560. WeaponType.Wand,
  1561. WeaponType.Staff,
  1562. WeaponType.TwoHandedSword,
  1563. WeaponType.TwoHandedAxe,
  1564. WeaponType.TwoHandedMace,
  1565. WeaponType.Spear,
  1566. WeaponType.Polearm,
  1567. WeaponType.Bow,
  1568. WeaponType.Crossbow,
  1569. WeaponType.Claw,
  1570. WeaponType.Knuckler,
  1571. WeaponType.Gun,
  1572. ]),
  1573. ],
  1574. ],
  1575. [
  1576. Attack.DoubleShot,
  1577. [
  1578. new Set([Class.Pirate, Class.Pirate2nd]),
  1579. 10,
  1580. new Set([WeaponType.Gun]),
  1581. ],
  1582. ],
  1583. [
  1584. Attack.BackspinBlow,
  1585. [
  1586. new Set([Class.Pirate2nd]),
  1587. 30,
  1588. new Set([WeaponType.None, WeaponType.Knuckler]),
  1589. ],
  1590. ],
  1591. [
  1592. Attack.DoubleUppercut,
  1593. [
  1594. new Set([Class.Pirate2nd]),
  1595. 30,
  1596. new Set([WeaponType.None, WeaponType.Knuckler]),
  1597. ],
  1598. ],
  1599. [
  1600. Attack.EnergyDrain,
  1601. [
  1602. new Set([Class.Pirate2nd]),
  1603. 71,
  1604. new Set([WeaponType.None, WeaponType.Knuckler]),
  1605. ],
  1606. ],
  1607. [
  1608. Attack.EnergyBlast,
  1609. [
  1610. new Set([Class.Pirate2nd]),
  1611. 71,
  1612. new Set([WeaponType.None, WeaponType.Knuckler]),
  1613. ],
  1614. ],
  1615. [
  1616. Attack.Shockwave,
  1617. [
  1618. new Set([Class.Pirate2nd]),
  1619. 71,
  1620. new Set([WeaponType.None, WeaponType.Knuckler]),
  1621. ],
  1622. ],
  1623. [
  1624. Attack.DragonStrike,
  1625. [
  1626. new Set([Class.Pirate2nd]),
  1627. 120,
  1628. new Set([WeaponType.None, WeaponType.Knuckler]),
  1629. ],
  1630. ],
  1631. [
  1632. Attack.EnergyOrb,
  1633. [
  1634. new Set([Class.Pirate2nd]),
  1635. 120,
  1636. new Set([WeaponType.None, WeaponType.Knuckler]),
  1637. ],
  1638. ],
  1639. [
  1640. Attack.Demolition,
  1641. [
  1642. new Set([Class.Pirate2nd]),
  1643. 121,
  1644. new Set([WeaponType.None, WeaponType.Knuckler]),
  1645. ],
  1646. ],
  1647. [
  1648. Attack.Snatch,
  1649. [
  1650. new Set([Class.Pirate2nd]),
  1651. 121,
  1652. new Set([WeaponType.None, WeaponType.Knuckler]),
  1653. ],
  1654. ],
  1655. [
  1656. Attack.Barrage,
  1657. [
  1658. new Set([Class.Pirate2nd]),
  1659. 120,
  1660. new Set([WeaponType.None, WeaponType.Knuckler]),
  1661. ],
  1662. ],
  1663. [
  1664. Attack.InvisibleShot,
  1665. [new Set([Class.Pirate2nd]), 30, new Set([WeaponType.Gun])],
  1666. ],
  1667. [
  1668. Attack.Grenade,
  1669. [new Set([Class.Pirate2nd]), 30, new Set([WeaponType.Gun])],
  1670. ],
  1671. [
  1672. Attack.BlankShot,
  1673. [new Set([Class.Pirate2nd]), 30, new Set([WeaponType.Gun])],
  1674. ],
  1675. [
  1676. Attack.RecoilShot,
  1677. [new Set([Class.Pirate2nd]), 30, new Set([WeaponType.Gun])],
  1678. ],
  1679. [
  1680. Attack.BurstFire,
  1681. [new Set([Class.Pirate2nd]), 70, new Set([WeaponType.Gun])],
  1682. ],
  1683. [
  1684. Attack.Octopus,
  1685. [
  1686. new Set([Class.Pirate2nd]),
  1687. 70,
  1688. new Set([
  1689. WeaponType.None,
  1690. WeaponType.OneHandedSword,
  1691. WeaponType.OneHandedAxe,
  1692. WeaponType.OneHandedMace,
  1693. WeaponType.Dagger,
  1694. WeaponType.Wand,
  1695. WeaponType.Staff,
  1696. WeaponType.TwoHandedSword,
  1697. WeaponType.TwoHandedAxe,
  1698. WeaponType.TwoHandedMace,
  1699. WeaponType.Spear,
  1700. WeaponType.Polearm,
  1701. WeaponType.Bow,
  1702. WeaponType.Crossbow,
  1703. WeaponType.Claw,
  1704. WeaponType.Knuckler,
  1705. WeaponType.Gun,
  1706. ]),
  1707. ],
  1708. ],
  1709. [
  1710. Attack.Gaviota,
  1711. [
  1712. new Set([Class.Pirate2nd]),
  1713. 70,
  1714. new Set([
  1715. WeaponType.None,
  1716. WeaponType.OneHandedSword,
  1717. WeaponType.OneHandedAxe,
  1718. WeaponType.OneHandedMace,
  1719. WeaponType.Dagger,
  1720. WeaponType.Wand,
  1721. WeaponType.Staff,
  1722. WeaponType.TwoHandedSword,
  1723. WeaponType.TwoHandedAxe,
  1724. WeaponType.TwoHandedMace,
  1725. WeaponType.Spear,
  1726. WeaponType.Polearm,
  1727. WeaponType.Bow,
  1728. WeaponType.Crossbow,
  1729. WeaponType.Claw,
  1730. WeaponType.Knuckler,
  1731. WeaponType.Gun,
  1732. ]),
  1733. ],
  1734. ],
  1735. [
  1736. Attack.Flamethrower,
  1737. [new Set([Class.Pirate2nd]), 70, new Set([WeaponType.Gun])],
  1738. ],
  1739. [
  1740. Attack.IceSplitter,
  1741. [new Set([Class.Pirate2nd]), 70, new Set([WeaponType.Gun])],
  1742. ],
  1743. [
  1744. Attack.HomingBeacon,
  1745. [new Set([Class.Pirate2nd]), 70, new Set([WeaponType.Gun])],
  1746. ],
  1747. [
  1748. Attack.WrathOfTheOctopi,
  1749. [
  1750. new Set([Class.Pirate2nd]),
  1751. 120,
  1752. new Set([
  1753. WeaponType.None,
  1754. WeaponType.OneHandedSword,
  1755. WeaponType.OneHandedAxe,
  1756. WeaponType.OneHandedMace,
  1757. WeaponType.Dagger,
  1758. WeaponType.Wand,
  1759. WeaponType.Staff,
  1760. WeaponType.TwoHandedSword,
  1761. WeaponType.TwoHandedAxe,
  1762. WeaponType.TwoHandedMace,
  1763. WeaponType.Spear,
  1764. WeaponType.Polearm,
  1765. WeaponType.Bow,
  1766. WeaponType.Crossbow,
  1767. WeaponType.Claw,
  1768. WeaponType.Knuckler,
  1769. WeaponType.Gun,
  1770. ]),
  1771. ],
  1772. ],
  1773. [
  1774. Attack.AerialStrike,
  1775. [
  1776. new Set([Class.Pirate2nd]),
  1777. 120,
  1778. new Set([
  1779. WeaponType.None,
  1780. WeaponType.OneHandedSword,
  1781. WeaponType.OneHandedAxe,
  1782. WeaponType.OneHandedMace,
  1783. WeaponType.Dagger,
  1784. WeaponType.Wand,
  1785. WeaponType.Staff,
  1786. WeaponType.TwoHandedSword,
  1787. WeaponType.TwoHandedAxe,
  1788. WeaponType.TwoHandedMace,
  1789. WeaponType.Spear,
  1790. WeaponType.Polearm,
  1791. WeaponType.Bow,
  1792. WeaponType.Crossbow,
  1793. WeaponType.Claw,
  1794. WeaponType.Knuckler,
  1795. WeaponType.Gun,
  1796. ]),
  1797. ],
  1798. ],
  1799. [
  1800. Attack.RapidFire,
  1801. [new Set([Class.Pirate2nd]), 120, new Set([WeaponType.Gun])],
  1802. ],
  1803. [
  1804. Attack.BattleshipCannon,
  1805. [new Set([Class.Pirate2nd]), 121, new Set([WeaponType.Gun])],
  1806. ],
  1807. [
  1808. Attack.BattleshipTorpedo,
  1809. [new Set([Class.Pirate2nd]), 121, new Set([WeaponType.Gun])],
  1810. ],
  1811. ]);
  1812. export const SPELL_LVL_REQS: Map<Spell, number> = new Map([
  1813. [Spell.Other, 0],
  1814. [Spell.Explosion, 70],
  1815. [Spell.PoisonMist, 70],
  1816. [Spell.ElementCompositionFP, 70],
  1817. [Spell.Elquines, 120],
  1818. [Spell.MeteorShower, 120],
  1819. [Spell.IceStrike, 70],
  1820. [Spell.ThunderSpear, 70],
  1821. [Spell.ElementCompositionIL, 70],
  1822. [Spell.Ifrit, 120],
  1823. [Spell.ChainLightning, 120],
  1824. [Spell.Blizzard, 120],
  1825. [Spell.Heal, 30],
  1826. [Spell.HolyArrow, 30],
  1827. [Spell.ShiningRay, 70],
  1828. [Spell.SummonDragon, 70],
  1829. [Spell.Bahamut, 120],
  1830. [Spell.AngelRay, 120],
  1831. [Spell.Genesis, 120],
  1832. ]);
  1833. export const JOB_LVL_REQS: Map<Class, number> = new Map([
  1834. [Class.Beginner, 0],
  1835. [Class.Warrior, 10],
  1836. [Class.Magician, 8],
  1837. [Class.Archer, 10],
  1838. [Class.Rogue, 10],
  1839. [Class.Pirate, 10],
  1840. [Class.Pirate2nd, 30],
  1841. ]);
  1842. /**
  1843. * The first two numbers of the 3-tuple represent the minimum and maximum
  1844. * number of lines, respectively. The last number represents the maximum
  1845. * number of targets.
  1846. */
  1847. export const ATTACK_LINES: Map<Attack, [number, number, number]> = new Map([
  1848. [Attack.Other, [1, 32767, 15]],
  1849. [Attack.BowWhack, [1, 1, 1]],
  1850. [Attack.ClawPunch, [1, 1, 1]],
  1851. [Attack.Panic, [1, 1, 1]],
  1852. [Attack.Coma, [1, 1, 6]],
  1853. [Attack.Rush, [1, 1, 10]],
  1854. [Attack.Brandish, [2, 2, 3]],
  1855. [Attack.Blast, [1, 1, 1]],
  1856. [Attack.HeavensHammerXiuz, [1, 1, 15]],
  1857. [Attack.HeavensHammerXiuzCorrected, [1, 1, 15]],
  1858. [Attack.CrusherHigh, [3, 3, 3]],
  1859. [Attack.CrusherLow, [2, 2, 3]],
  1860. [Attack.Fury, [1, 1, 6]],
  1861. [Attack.DragonRoar, [1, 1, 6]],
  1862. [Attack.PowerKnockBack, [1, 1, 6]],
  1863. [Attack.ArrowBombImpact, [1, 1, 1]],
  1864. [Attack.ArrowBombSplash, [1, 1, 5]],
  1865. [Attack.IronArrow, [1, 1, 6]],
  1866. [Attack.Inferno, [1, 1, 6]],
  1867. [Attack.Blizzard, [1, 1, 6]],
  1868. [Attack.Hurricane, [1, 1, 1]],
  1869. [Attack.Phoenix, [1, 1, 4]],
  1870. [Attack.Frostprey, [1, 1, 4]],
  1871. [Attack.PiercingArrow, [1, 1, 6]],
  1872. [Attack.LuckySeven, [2, 2, 1]],
  1873. [Attack.Avenger, [1, 1, 6]],
  1874. [Attack.TripleThrow, [3, 3, 1]],
  1875. [Attack.Assaulter, [1, 1, 1]],
  1876. [Attack.NinjaAmbush, [1, 1, 6]],
  1877. [Attack.VenomousStar, [1, 1, 1]],
  1878. [Attack.VenomousStab, [1, 1, 1]],
  1879. [Attack.NinjaStorm, [1, 1, 6]],
  1880. [Attack.SavageBlow, [4, 6, 1]],
  1881. [Attack.BoomerangStep, [2, 2, 4]],
  1882. [Attack.FlashFist, [1, 1, 1]],
  1883. [Attack.SomersaultKick, [1, 1, 6]],
  1884. [Attack.DoubleShot, [2, 2, 1]],
  1885. [Attack.BackspinBlow, [1, 1, 3]],
  1886. [Attack.DoubleUppercut, [2, 2, 1]],
  1887. [Attack.EnergyDrain, [1, 1, 1]],
  1888. [Attack.EnergyBlast, [1, 1, 4]],
  1889. [Attack.Shockwave, [1, 1, 6]],
  1890. [Attack.DragonStrike, [1, 1, 6]],
  1891. [Attack.EnergyOrb, [1, 1, 6]],
  1892. [Attack.Demolition, [8, 8, 1]],
  1893. [Attack.Snatch, [1, 1, 6]],
  1894. [Attack.Barrage, [6, 6, 1]],
  1895. [Attack.InvisibleShot, [1, 1, 3]],
  1896. [Attack.BlankShot, [1, 1, 3]],
  1897. [Attack.RecoilShot, [1, 1, 1]],
  1898. [Attack.BurstFire, [3, 3, 1]],
  1899. [Attack.Octopus, [1, 1, 1]],
  1900. [Attack.Gaviota, [1, 1, 6]],
  1901. [Attack.Flamethrower, [1, 1, 6]],
  1902. [Attack.IceSplitter, [1, 1, 6]],
  1903. [Attack.HomingBeacon, [1, 1, 1]],
  1904. [Attack.WrathOfTheOctopi, [1, 1, 1]],
  1905. [Attack.AerialStrike, [1, 1, 15]],
  1906. [Attack.RapidFire, [1, 1, 1]],
  1907. [Attack.BattleshipCannon, [3, 4, 1]],
  1908. [Attack.BattleshipTorpedo, [1, 1, 6]],
  1909. ]);
  1910. /**
  1911. * The first two numbers of the 3-tuple represent the minimum and maximum
  1912. * number of lines, respectively. The last number represents the maximum
  1913. * number of targets.
  1914. */
  1915. export const SPELL_LINES: Map<Spell, [number, number, number]> = new Map([
  1916. [Spell.Other, [1, 32767, 15]],
  1917. [Spell.Explosion, [1, 1, 6]],
  1918. [Spell.PoisonMist, [1, 1, 6]],
  1919. [Spell.ElementCompositionFP, [1, 1, 1]],
  1920. [Spell.Elquines, [1, 1, 3]],
  1921. [Spell.MeteorShower, [1, 1, 15]],
  1922. [Spell.IceStrike, [1, 1, 6]],
  1923. [Spell.ThunderSpear, [1, 1, 1]],
  1924. [Spell.ElementCompositionIL, [1, 1, 1]],
  1925. [Spell.Ifrit, [1, 1, 3]],
  1926. [Spell.ChainLightning, [1, 1, 6]],
  1927. [Spell.Blizzard, [1, 1, 15]],
  1928. [Spell.Heal, [1, 1, 5]],
  1929. [Spell.HolyArrow, [1, 1, 1]],
  1930. [Spell.ShiningRay, [1, 1, 6]],
  1931. [Spell.SummonDragon, [1, 1, 1]],
  1932. [Spell.Bahamut, [1, 1, 3]],
  1933. [Spell.AngelRay, [1, 1, 1]],
  1934. [Spell.Genesis, [1, 1, 15]],
  1935. ]);