types.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 gish-ap-calc.
  6. *
  7. * gish-ap-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. * gish-ap-calc is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
  15. * for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with gish-ap-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. export class Monster {
  24. constructor(level, avoid, wdef, mdef) {
  25. this.level = level;
  26. this.avoid = avoid;
  27. this.wdef = wdef;
  28. this.mdef = mdef;
  29. }
  30. }
  31. export class Spell {
  32. constructor(basicAtk, mastery, period, lines) {
  33. this.basicAtk = basicAtk;
  34. this.mastery = mastery;
  35. this.period = period;
  36. this.lines = lines;
  37. }
  38. }
  39. export class Stats {
  40. constructor(str, dex, int, luk) {
  41. this.str = str;
  42. this.dex = dex;
  43. this.int = int;
  44. this.luk = luk;
  45. }
  46. clone() {
  47. return new Stats(this.str, this.dex, this.int, this.luk);
  48. }
  49. /** Operates **in-place** and then returns `this`. */
  50. add(other) {
  51. this.str += other.str;
  52. this.dex += other.dex;
  53. this.int += other.int;
  54. this.luk += other.luk;
  55. return this;
  56. }
  57. /** Operates **in-place** and then returns `this`. */
  58. sub(other) {
  59. this.str -= other.str;
  60. this.dex -= other.dex;
  61. this.int -= other.int;
  62. this.luk -= other.luk;
  63. return this;
  64. }
  65. }
  66. export class Weapon {
  67. constructor(psm, period) {
  68. this.psm = psm;
  69. this.period = period;
  70. }
  71. }
  72. export var WeaponType;
  73. (function (WeaponType) {
  74. WeaponType[WeaponType["OneHandedSword"] = 30] = "OneHandedSword";
  75. WeaponType[WeaponType["OneHandedAxe"] = 31] = "OneHandedAxe";
  76. WeaponType[WeaponType["OneHandedMace"] = 32] = "OneHandedMace";
  77. WeaponType[WeaponType["Dagger"] = 33] = "Dagger";
  78. WeaponType[WeaponType["Wand"] = 37] = "Wand";
  79. WeaponType[WeaponType["Staff"] = 38] = "Staff";
  80. WeaponType[WeaponType["TwoHandedSword"] = 40] = "TwoHandedSword";
  81. WeaponType[WeaponType["TwoHandedAxe"] = 41] = "TwoHandedAxe";
  82. WeaponType[WeaponType["TwoHandedMace"] = 42] = "TwoHandedMace";
  83. WeaponType[WeaponType["Spear"] = 43] = "Spear";
  84. WeaponType[WeaponType["Polearm"] = 44] = "Polearm";
  85. })(WeaponType || (WeaponType = {}));
  86. export var SpellType;
  87. (function (SpellType) {
  88. SpellType[SpellType["Other"] = 0] = "Other";
  89. SpellType[SpellType["Explosion"] = 2111002] = "Explosion";
  90. SpellType[SpellType["PoisonMist"] = 2111003] = "PoisonMist";
  91. SpellType[SpellType["ElementCompositionFP"] = 2111006] = "ElementCompositionFP";
  92. SpellType[SpellType["Elquines"] = 2121005] = "Elquines";
  93. SpellType[SpellType["MeteorShower"] = 2121007] = "MeteorShower";
  94. SpellType[SpellType["IceStrike"] = 2211002] = "IceStrike";
  95. SpellType[SpellType["ThunderSpear"] = 2211003] = "ThunderSpear";
  96. SpellType[SpellType["ElementCompositionIL"] = 2211006] = "ElementCompositionIL";
  97. SpellType[SpellType["Ifrit"] = 2221005] = "Ifrit";
  98. SpellType[SpellType["ChainLightning"] = 2221006] = "ChainLightning";
  99. SpellType[SpellType["Blizzard"] = 2221007] = "Blizzard";
  100. SpellType[SpellType["Heal"] = 2301002] = "Heal";
  101. SpellType[SpellType["HolyArrow"] = 2301005] = "HolyArrow";
  102. SpellType[SpellType["ShiningRay"] = 2311004] = "ShiningRay";
  103. SpellType[SpellType["SummonDragon"] = 2311006] = "SummonDragon";
  104. SpellType[SpellType["Bahamut"] = 2321003] = "Bahamut";
  105. SpellType[SpellType["AngelRay"] = 2321007] = "AngelRay";
  106. SpellType[SpellType["Genesis"] = 2321008] = "Genesis";
  107. })(SpellType || (SpellType = {}));