PageRenderTime 103ms CodeModel.GetById 2ms RepoModel.GetById 0ms app.codeStats 2ms

/dist/dka-game.js

https://gitlab.com/free-electrons-labs/dka-game
JavaScript | 15634 lines | 12615 code | 1017 blank | 2002 comment | 645 complexity | 58d04a1db1d903e6c1a5f9b5ffd68b33 MD5 | raw file
  1. /*
  2. * Copyright © Romain Fouquet, 2012-2015
  3. * Copyright © Clément Joly, 2012-2015
  4. #
  5. * romain.fouquet18@gmail.com
  6. * leowzukw@vmail.me
  7. #
  8. * This file is part of Diseases Killer Academy.
  9. #
  10. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as published by
  12. * the Free Software Foundation, either version 3 of the License, or
  13. * (at your option) any later version.
  14. #
  15. * Diseases Killer Academy is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. #
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  22. */
  23. (function() {
  24. 'use strict';
  25. window.dka = window.dka || {};
  26. dka.colors = {
  27. darkBlue: '#003d65',
  28. lightBlue: '#0da0ff',
  29. veryLightBlue: '#70c7ff',
  30. shinyBlue: '#19f1f1',
  31. lightGreen: '#00f000',
  32. gold: '#f0d400',
  33. darkGrey: '#2C3835',
  34. black: '#000'
  35. };
  36. }).call(this);
  37. /*
  38. * Copyright © Romain Fouquet, 2012-2015
  39. * Copyright © Clément Joly, 2012-2015
  40. #
  41. * romain.fouquet18@gmail.com
  42. * leowzukw@vmail.me
  43. #
  44. * This file is part of Diseases Killer Academy.
  45. #
  46. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  47. * it under the terms of the GNU Affero General Public License as published by
  48. * the Free Software Foundation, either version 3 of the License, or
  49. * (at your option) any later version.
  50. #
  51. * Diseases Killer Academy is distributed in the hope that it will be useful,
  52. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  53. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  54. * GNU Affero General Public License for more details.
  55. #
  56. * You should have received a copy of the GNU Affero General Public License
  57. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  58. */
  59. (function() {
  60. 'use strict';
  61. dka.GameSettings = (function() {
  62. function GameSettings() {
  63. this._towerPill();
  64. this._towerAntibiotic();
  65. this._towerCellB();
  66. this._towerCellMacrophage();
  67. this._towerHospital();
  68. this._labs();
  69. this._diseases();
  70. }
  71. GameSettings.prototype._towerPill = function() {
  72. this.towers = {};
  73. return this.towers.pill = {
  74. title: 'Pill Labs',
  75. description: 'Pills are generic remedies to all kind of diseases.',
  76. buildingTime: 30,
  77. upgrade0: {
  78. cost: 70,
  79. reloadTime: 20,
  80. range: 150,
  81. magazineSize: 20,
  82. haziness: 8,
  83. bulletDamage: [2, 5]
  84. },
  85. upgrade1: {
  86. cost: 90,
  87. reloadTime: 17,
  88. range: 180,
  89. magazineSize: 4,
  90. haziness: 6,
  91. bulletDamage: [3, 6]
  92. },
  93. upgrade2: {
  94. cost: 120,
  95. reloadTime: 15,
  96. range: 200,
  97. magazineSize: 8,
  98. haziness: 2,
  99. bulletDamage: [5, 8]
  100. },
  101. upgrade3: {
  102. cost: 180,
  103. reloadTime: 9,
  104. range: 230,
  105. magazineSize: 8,
  106. haziness: 10,
  107. bulletDamage: [10, 15]
  108. }
  109. };
  110. };
  111. GameSettings.prototype._towerAntibiotic = function() {
  112. return this.towers.antibiotic = {
  113. title: 'Antibiotic Labs',
  114. description: 'Antibiotics deal area damage to all alive germs. Be carefull! Viruses are not alive. They are totally immune to antibiotics!',
  115. buildingTime: 50,
  116. upgrade0: {
  117. cost: 90,
  118. reloadTime: 60,
  119. range: 170,
  120. magazineSize: 7,
  121. bulletRadiusDamage: 70,
  122. bulletDamage: [7, 15]
  123. },
  124. upgrade1: {
  125. cost: 110,
  126. reloadTime: 65,
  127. range: 220,
  128. magazineSize: 7,
  129. bulletRadiusDamage: 70,
  130. bulletDamage: [13, 18]
  131. },
  132. upgrade2: {
  133. cost: 150,
  134. reloadTime: 65,
  135. range: 250,
  136. magazineSize: 8,
  137. bulletRadiusDamage: 70,
  138. bulletDamage: [18, 25]
  139. },
  140. upgrade3: {
  141. cost: 200,
  142. reloadTime: 91,
  143. range: 270,
  144. magazineSize: 7,
  145. bulletRadiusDamage: 70,
  146. bulletDamage: [30, 45]
  147. }
  148. };
  149. };
  150. GameSettings.prototype._towerCellB = function() {
  151. return this.towers.cellB = {
  152. title: 'B Cell',
  153. description: ' B cells are part of immune defense system, they create plasma cells who can prevent diseases multiplicating, brake them, or even damage them!',
  154. buildingTime: 30,
  155. upgrade0: {
  156. cost: 90,
  157. range: 200,
  158. cellSpeed: 3,
  159. cellTtl: 4
  160. },
  161. upgrade1: {
  162. cost: 110,
  163. range: 200,
  164. cellSpeed: 2,
  165. cellTtl: 5
  166. },
  167. upgrade2: {
  168. cost: 150,
  169. range: 200,
  170. cellSpeed: 3,
  171. cellTtl: 6
  172. },
  173. upgrade3: {
  174. cost: 230,
  175. range: 200,
  176. cellSpeed: 5,
  177. cellTtl: 7
  178. }
  179. };
  180. };
  181. GameSettings.prototype._towerCellMacrophage = function() {
  182. return this.towers.cellMacrophage = {
  183. title: 'Macrophage Cell',
  184. description: 'Macrophage cells are part of immune defense system, they directly eat diseases! but target only the ones with antibodies.',
  185. buildingTime: 20,
  186. upgrade0: {
  187. cost: 70,
  188. range: 200,
  189. cellSpeed: 6,
  190. cellTtl: 4,
  191. cellDamage: 1,
  192. respawnReload: 40
  193. },
  194. upgrade1: {
  195. cost: 110,
  196. range: 160,
  197. cellSpeed: 6,
  198. cellTtl: 4,
  199. cellDamage: 1.5,
  200. respawnReload: 40
  201. },
  202. upgrade2: {
  203. cost: 150,
  204. range: 160,
  205. cellSpeed: 6,
  206. cellTtl: 4,
  207. cellDamage: 2,
  208. respawnReload: 40
  209. },
  210. upgrade3: {
  211. cost: 230,
  212. range: 160,
  213. cellSpeed: 5,
  214. cellTtl: 4,
  215. cellDamage: 3,
  216. respawnReload: 40
  217. }
  218. };
  219. };
  220. GameSettings.prototype._towerHospital = function() {
  221. return this.towers.hospital = {
  222. abilities: {
  223. subsidies: {
  224. title: 'Subsidies',
  225. description: 'The city helps you a little by giving you some coins each wave.',
  226. cost: [60, 140],
  227. action: [40, 80]
  228. },
  229. supply: {
  230. title: 'Better supply',
  231. description: 'A better supply will make your pill and antibiotic towers shoot faster.',
  232. cost: [40, 350],
  233. action: [10, 15]
  234. },
  235. education: {
  236. img: 'Up3',
  237. title: 'Education',
  238. description: 'Educating the population about hygiene enable the reduction of the multiplication rate of diseases.',
  239. cost: [40, 100],
  240. action: [100, 200]
  241. }
  242. }
  243. };
  244. };
  245. GameSettings.prototype._labs = function() {
  246. return this.labs = {
  247. fever: [
  248. {
  249. duration: 45,
  250. reloadTime: 300,
  251. title: 'Fever',
  252. description: 'Increase duration and reduce reload time.'
  253. }, {
  254. cost: 70,
  255. duration: 55,
  256. reloadTime: 350,
  257. title: 'Fever',
  258. description: 'Increase duration and reduce reload time.'
  259. }, {
  260. cost: 90,
  261. duration: 75,
  262. reloadTime: 450,
  263. title: 'Fever',
  264. description: 'Increase duration and reduce reload time.'
  265. }
  266. ],
  267. vaccine: [
  268. {
  269. damage: 0.5,
  270. duration: 100,
  271. reloadTime: 450,
  272. title: 'Vaccine',
  273. description: 'Increase damage and reduce reload time.'
  274. }, {
  275. cost: 70,
  276. duration: 150,
  277. damage: 1,
  278. reloadTime: 350,
  279. title: 'Vaccine',
  280. description: 'Increase damage and reduce reload time.'
  281. }, {
  282. cost: 100,
  283. duration: 200,
  284. damage: 1.5,
  285. reloadTime: 300,
  286. title: 'Vaccine',
  287. description: 'Increase damage and reduce reload time.'
  288. }
  289. ],
  290. hintNxtWave: [
  291. {
  292. cost: 40,
  293. title: 'Next wave',
  294. description: 'Add informations about the next wave.'
  295. }, {
  296. cost: 60,
  297. title: 'Next wave',
  298. description: 'Add informations about the next wave.'
  299. }
  300. ]
  301. };
  302. };
  303. GameSettings.prototype.getLabsSetting = function(setting, prop) {
  304. return this.labs[setting][dka.academy.game.labs.getUpgradeLevel(setting)][prop];
  305. };
  306. GameSettings.prototype._diseases = function() {
  307. this.diseasesList = ['Tuberculosis', 'Plague', 'HIV', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Unknown'];
  308. return this.diseases = {
  309. Tuberculosis: {
  310. type: 'Bacterium',
  311. speed: DEBUG_MODE ? 3 : 1.3,
  312. life: 20,
  313. lifeCost: 1,
  314. delayToMultiplicate: 300
  315. },
  316. HIV: {
  317. type: 'Virus',
  318. speed: 1.5,
  319. life: 40,
  320. lifeCost: 3
  321. },
  322. Plague: {
  323. type: 'Bacterium',
  324. speed: 2,
  325. life: 25,
  326. lifeCost: 1,
  327. delayToMultiplicate: 200
  328. }
  329. };
  330. };
  331. GameSettings.prototype.isBetter = function(before, after, criteria) {
  332. var diff, whatIsBetter;
  333. if (criteria === 'damage') {
  334. before = (before[1] - before[0]) / 2 + before[0];
  335. after = (after[1] - after[0]) / 2 + after[0];
  336. }
  337. diff = after - before;
  338. if (diff === 0) {
  339. return 'equal';
  340. }
  341. whatIsBetter = (function() {
  342. switch (criteria) {
  343. case 'range':
  344. return 'higher';
  345. case 'reloadTime':
  346. return 'lower';
  347. case 'damage':
  348. return 'higher';
  349. case 'cellDamage':
  350. return 'higher';
  351. case 'magazineSize':
  352. return 'higher';
  353. case 'haziness':
  354. return 'lower';
  355. case 'cellTtl':
  356. return 'higher';
  357. case 'cellSpeed':
  358. return 'higher';
  359. }
  360. })();
  361. if (whatIsBetter === 'higher' && diff > 0 || whatIsBetter === 'lower' && diff < 0) {
  362. return 'better';
  363. }
  364. return 'worse';
  365. };
  366. GameSettings.prototype.getReloadString = function(reloadTime, nbPlus) {
  367. var i, plusString;
  368. if (reloadTime < 0) {
  369. return '';
  370. }
  371. plusString = '';
  372. i = 0;
  373. while (i < nbPlus) {
  374. plusString += '+';
  375. i++;
  376. }
  377. switch (false) {
  378. case !(reloadTime <= 10):
  379. return 'Very fast' + plusString;
  380. case !(reloadTime <= 20):
  381. return 'Fast' + plusString;
  382. case !(reloadTime <= 50):
  383. return 'Average' + plusString;
  384. case !(reloadTime <= 70):
  385. return 'Slow' + plusString;
  386. default:
  387. return 'Very slow' + plusString;
  388. }
  389. };
  390. GameSettings.prototype.getMoveString = function(moveSpeed) {
  391. switch (false) {
  392. case !(moveSpeed < 0):
  393. return '';
  394. case !(moveSpeed <= 1):
  395. return 'Very slow';
  396. case !(moveSpeed <= 2):
  397. return 'Slow';
  398. case !(moveSpeed <= 4):
  399. return 'Average';
  400. case !(moveSpeed <= 6):
  401. return 'Fast';
  402. default:
  403. return 'Very fast';
  404. }
  405. };
  406. GameSettings.prototype.getDiseaseSpeedString = function(speed) {
  407. switch (false) {
  408. case !(speed < 0):
  409. return '';
  410. case !(speed <= 1):
  411. return 'Very slow';
  412. case !(speed <= 1.5):
  413. return 'Slow';
  414. case !(speed <= 2):
  415. return 'Average';
  416. case !(speed <= 2.5):
  417. return 'Fast';
  418. default:
  419. return 'Very fast';
  420. }
  421. };
  422. GameSettings.prototype.getRespawnString = function(respwanTime) {
  423. switch (false) {
  424. case !(respwanTime < 0):
  425. return '';
  426. case !(respwanTime <= 20):
  427. return 'Very fast';
  428. case !(respwanTime <= 30):
  429. return 'Fast';
  430. case !(respwanTime <= 40):
  431. return 'Average';
  432. case !(respwanTime <= 50):
  433. return 'Slow';
  434. default:
  435. return 'Very slow';
  436. }
  437. };
  438. GameSettings.prototype.getPrecisionString = function(haziness) {
  439. switch (false) {
  440. case !(haziness < 0):
  441. return '';
  442. case !(haziness <= 2):
  443. return 'Great';
  444. case !(haziness <= 5):
  445. return 'Good';
  446. case !(haziness <= 7):
  447. return 'Average';
  448. default:
  449. return 'Poor';
  450. }
  451. };
  452. return GameSettings;
  453. })();
  454. }).call(this);
  455. /*
  456. * Copyright © Romain Fouquet, 2012-2015
  457. * Copyright © Clément Joly, 2012-2015
  458. #
  459. * romain.fouquet18@gmail.com
  460. * leowzukw@vmail.me
  461. #
  462. * This file is part of Diseases Killer Academy.
  463. #
  464. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  465. * it under the terms of the GNU Affero General Public License as published by
  466. * the Free Software Foundation, either version 3 of the License, or
  467. * (at your option) any later version.
  468. #
  469. * Diseases Killer Academy is distributed in the hope that it will be useful,
  470. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  471. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  472. * GNU Affero General Public License for more details.
  473. #
  474. * You should have received a copy of the GNU Affero General Public License
  475. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  476. */
  477. (function() {
  478. 'use strict';
  479. this.geom = this.geom || {};
  480. geom.Ellipse = (function() {
  481. function Ellipse(x, y, rw, rh) {
  482. this.x = x || 0;
  483. this.y = y || 0;
  484. this.rw = rw || 0;
  485. this.rh = rh || 0;
  486. this;
  487. }
  488. Ellipse.prototype.contains = function(x, y) {
  489. return (Math.pow(x - this.x, 2) / Math.pow(this.rw, 2) + (Math.pow(y - this.y, 2) / Math.pow(this.rh, 2))) <= 1;
  490. };
  491. Ellipse.prototype.containsPoint = function(p) {
  492. return this.contains(p.x, p.y);
  493. };
  494. Ellipse.prototype.toString = function() {
  495. return '[Ellipse (x:' + this.x + ' y:' + this.y + ' rw:' + this.rw + ' rh:' + this.rh + ')]';
  496. };
  497. return Ellipse;
  498. })();
  499. }).call(this);
  500. /*
  501. * Copyright © Romain Fouquet, 2012-2015
  502. * Copyright © Clément Joly, 2012-2015
  503. #
  504. * romain.fouquet18@gmail.com
  505. * leowzukw@vmail.me
  506. #
  507. * This file is part of Diseases Killer Academy.
  508. #
  509. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  510. * it under the terms of the GNU Affero General Public License as published by
  511. * the Free Software Foundation, either version 3 of the License, or
  512. * (at your option) any later version.
  513. #
  514. * Diseases Killer Academy is distributed in the hope that it will be useful,
  515. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  516. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  517. * GNU Affero General Public License for more details.
  518. #
  519. * You should have received a copy of the GNU Affero General Public License
  520. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  521. */
  522. (function() {
  523. window.TXT_NBR = false;
  524. window.DEBUG_MODE = true;
  525. window.LEVEL_MODE = true;
  526. window.TIMELINE_MODE = false;
  527. window.LEO_DEV_MODE = false;
  528. window.moveConfig = function(target) {
  529. target.cursor = 'move';
  530. target.on('pressmove', function(e) {
  531. target.x = e.stageX;
  532. return target.y = e.stageY;
  533. });
  534. return target.on('pressup', function() {
  535. return console.log(target.x, target.y);
  536. });
  537. };
  538. }).call(this);
  539. /*
  540. * Copyright © Romain Fouquet, 2012-2015
  541. * Copyright © Clément Joly, 2012-2015
  542. #
  543. * romain.fouquet18@gmail.com
  544. * leowzukw@vmail.me
  545. #
  546. * This file is part of Diseases Killer Academy.
  547. #
  548. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  549. * it under the terms of the GNU Affero General Public License as published by
  550. * the Free Software Foundation, either version 3 of the License, or
  551. * (at your option) any later version.
  552. #
  553. * Diseases Killer Academy is distributed in the hope that it will be useful,
  554. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  555. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  556. * GNU Affero General Public License for more details.
  557. #
  558. * You should have received a copy of the GNU Affero General Public License
  559. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  560. */
  561. (function() {
  562. 'use strict';
  563. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  564. hasProp = {}.hasOwnProperty;
  565. dka.Button = (function(superClass) {
  566. extend(Button, superClass);
  567. function Button(x, y, img) {
  568. Button.__super__.constructor.call(this);
  569. this.set({
  570. regX: 20,
  571. regY: 20
  572. });
  573. this.set({
  574. x: x,
  575. y: y || this.regY + 5,
  576. cursor: 'pointer'
  577. });
  578. if (img) {
  579. this.img = this.addChild(img);
  580. }
  581. this.cache(0, 0, 2 * this.regX, 2 * this.regY);
  582. this.on('mouseover', function() {
  583. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
  584. this.updateCache();
  585. if (gameStage.cacheCanvas) {
  586. gameStage.updateCache();
  587. }
  588. if (createjs.Ticker.paused) {
  589. return gameStage.update();
  590. }
  591. });
  592. this.on('mouseout', function() {
  593. return this.removeAllFilters();
  594. });
  595. }
  596. Button.prototype.removeAllFilters = function() {
  597. this.filters = [];
  598. this.updateCache();
  599. if (gameStage.cacheCanvas) {
  600. gameStage.updateCache();
  601. }
  602. if (createjs.Ticker.paused) {
  603. return gameStage.update();
  604. }
  605. };
  606. return Button;
  607. })(createjs.Container);
  608. }).call(this);
  609. /*
  610. * Copyright © Romain Fouquet, 2012-2015
  611. * Copyright © Clément Joly, 2012-2015
  612. #
  613. * romain.fouquet18@gmail.com
  614. * leowzukw@vmail.me
  615. #
  616. * This file is part of Diseases Killer Academy.
  617. #
  618. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  619. * it under the terms of the GNU Affero General Public License as published by
  620. * the Free Software Foundation, either version 3 of the License, or
  621. * (at your option) any later version.
  622. #
  623. * Diseases Killer Academy is distributed in the hope that it will be useful,
  624. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  625. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  626. * GNU Affero General Public License for more details.
  627. #
  628. * You should have received a copy of the GNU Affero General Public License
  629. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  630. */
  631. (function() {
  632. 'use strict';
  633. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  634. hasProp = {}.hasOwnProperty;
  635. dka.MenuButton = (function(superClass) {
  636. extend(MenuButton, superClass);
  637. function MenuButton(x, y, img) {
  638. MenuButton.__super__.constructor.call(this);
  639. this.set({
  640. regX: 183 / 2,
  641. regY: 167 / 2
  642. });
  643. this.set({
  644. x: x,
  645. y: y,
  646. cursor: 'pointer'
  647. });
  648. if (img) {
  649. this.img = this.addChild(img);
  650. }
  651. this.cache(0, 0, 2 * this.regX, 2 * this.regY);
  652. this.on('mouseover', function() {
  653. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
  654. return this.updateCache();
  655. });
  656. this.on('mouseout', function() {
  657. return this.removeAllFilters();
  658. });
  659. }
  660. MenuButton.prototype.removeAllFilters = function() {
  661. this.filters = [];
  662. return this.updateCache();
  663. };
  664. return MenuButton;
  665. })(createjs.Container);
  666. }).call(this);
  667. /*
  668. * Copyright © Romain Fouquet, 2012-2015
  669. * Copyright © Clément Joly, 2012-2015
  670. #
  671. * romain.fouquet18@gmail.com
  672. * leowzukw@vmail.me
  673. #
  674. * This file is part of Diseases Killer Academy.
  675. #
  676. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  677. * it under the terms of the GNU Affero General Public License as published by
  678. * the Free Software Foundation, either version 3 of the License, or
  679. * (at your option) any later version.
  680. #
  681. * Diseases Killer Academy is distributed in the hope that it will be useful,
  682. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  683. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  684. * GNU Affero General Public License for more details.
  685. #
  686. * You should have received a copy of the GNU Affero General Public License
  687. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  688. */
  689. (function() {
  690. 'use strict';
  691. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  692. hasProp = {}.hasOwnProperty;
  693. dka.ButtonBitmap = (function(superClass) {
  694. extend(ButtonBitmap, superClass);
  695. function ButtonBitmap(bmp, brightness) {
  696. ButtonBitmap.__super__.constructor.call(this, bmp || null);
  697. this.set({
  698. cursor: 'pointer',
  699. available: true,
  700. brightness: (brightness ? brightness : 30)
  701. });
  702. this.on('mouseover', function() {
  703. if (!this.available) {
  704. return;
  705. }
  706. return this.lighten();
  707. });
  708. this.on('mouseout', function() {
  709. this.filters = [];
  710. if (!this.available) {
  711. this.darken();
  712. }
  713. this.updateCache();
  714. if (gameStage.cacheCanvas) {
  715. gameStage.updateCache();
  716. }
  717. if (createjs.Ticker.paused) {
  718. return gameStage.update();
  719. }
  720. });
  721. }
  722. ButtonBitmap.prototype.lighten = function() {
  723. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(this.brightness))];
  724. this.updateCache();
  725. if (gameStage.cacheCanvas) {
  726. gameStage.updateCache();
  727. }
  728. if (createjs.Ticker.paused) {
  729. return gameStage.update();
  730. }
  731. };
  732. ButtonBitmap.prototype.darken = function() {
  733. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustSaturation(-100))];
  734. this.updateCache();
  735. if (gameStage.cacheCanvas) {
  736. gameStage.updateCache();
  737. }
  738. if (createjs.Ticker.paused) {
  739. gameStage.update();
  740. }
  741. return this.available = false;
  742. };
  743. ButtonBitmap.prototype.removeAllFilters = function() {
  744. this.filters = [];
  745. this.updateCache();
  746. if (gameStage.cacheCanvas) {
  747. gameStage.updateCache();
  748. }
  749. if (createjs.Ticker.paused) {
  750. gameStage.update();
  751. }
  752. return this.available = true;
  753. };
  754. return ButtonBitmap;
  755. })(createjs.Bitmap);
  756. }).call(this);
  757. /*
  758. * Copyright © Romain Fouquet, 2012-2015
  759. * Copyright © Clément Joly, 2012-2015
  760. #
  761. * romain.fouquet18@gmail.com
  762. * leowzukw@vmail.me
  763. #
  764. * This file is part of Diseases Killer Academy.
  765. #
  766. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  767. * it under the terms of the GNU Affero General Public License as published by
  768. * the Free Software Foundation, either version 3 of the License, or
  769. * (at your option) any later version.
  770. #
  771. * Diseases Killer Academy is distributed in the hope that it will be useful,
  772. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  773. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  774. * GNU Affero General Public License for more details.
  775. #
  776. * You should have received a copy of the GNU Affero General Public License
  777. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  778. */
  779. (function() {
  780. 'use strict';
  781. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  782. hasProp = {}.hasOwnProperty;
  783. dka.ButtonLabs = (function(superClass) {
  784. extend(ButtonLabs, superClass);
  785. function ButtonLabs(bmp, point, upgrade, index, screen) {
  786. var settings;
  787. this.upgrade = upgrade;
  788. this.index = index;
  789. this.screen = screen;
  790. ButtonLabs.__super__.constructor.call(this);
  791. this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset(bmp)));
  792. this.set({
  793. x: point.x,
  794. y: point.y,
  795. regX: 50 / 2,
  796. regY: 62 / 2
  797. });
  798. settings = dka.academy.game.settings.labs[this.upgrade][index];
  799. this.cost = settings.cost;
  800. this.addChild(new createjs.Text(this.cost, '12px karnivoreRegular, Arial', dka.colors.gold).set({
  801. x: 50 / 2,
  802. y: 56,
  803. textAlign: 'center',
  804. textBaseline: 'alphabetic'
  805. }));
  806. this.cache(0, 0, 50, 62);
  807. this.hintData = {
  808. title: settings.title,
  809. description: settings.description
  810. };
  811. this.screen.on(this.screen.RESET_EVENT, (function(_this) {
  812. return function() {
  813. return _this.reset();
  814. };
  815. })(this));
  816. this.screen.on(this.screen.UPGRADE_BOUGHT_EVENT, (function(_this) {
  817. return function() {
  818. if (_this.bought) {
  819. return;
  820. }
  821. if (_this.isAvailable()) {
  822. if (_this.available) {
  823. return;
  824. }
  825. _this.removeAllFilters();
  826. return _this.makeBuyable();
  827. } else {
  828. _this.darken();
  829. return _this.cursor = 'default';
  830. }
  831. };
  832. })(this));
  833. this.reset();
  834. }
  835. ButtonLabs.prototype.reset = function() {
  836. this.removeAllFilters();
  837. this.removeAllEventListeners('click');
  838. this.removeAllEventListeners('mouseover');
  839. this.removeAllEventListeners('mouseout');
  840. this.on('mouseover', function() {
  841. return this.screen.addToolTip(this, this.hintData);
  842. });
  843. this.on('mouseout', function() {
  844. return this.screen.removeToolTip();
  845. });
  846. this.available = false;
  847. this.bought = false;
  848. if (this.isBought()) {
  849. this.setBought();
  850. return;
  851. }
  852. if (!this.isAvailable()) {
  853. this.darken();
  854. this.cursor = 'default';
  855. return;
  856. }
  857. return this.makeBuyable();
  858. };
  859. ButtonLabs.prototype.isAvailable = function() {
  860. if (dka.academy.game.getTotalGold() < this.cost) {
  861. return false;
  862. }
  863. if (dka.academy.game.labs.getUpgradeLevel(this.upgrade) + 1 >= this.index) {
  864. return true;
  865. }
  866. };
  867. ButtonLabs.prototype.isBought = function() {
  868. return dka.academy.game.labs.getUpgradeLevel(this.upgrade) + 1 > this.index;
  869. };
  870. ButtonLabs.prototype.makeBuyable = function() {
  871. this.cursor = 'pointer';
  872. this.on('mouseover', function() {
  873. if (!this.isBought()) {
  874. return this.lighten(30);
  875. }
  876. });
  877. this.on('mouseout', function() {
  878. if (!this.isBought()) {
  879. return this.removeAllFilters();
  880. }
  881. });
  882. this.on('click', function() {
  883. dka.academy.game.labs.buy(this.upgrade, this.cost);
  884. this.removeAllEventListeners('click');
  885. this.setBought();
  886. this.screen.dispatchEvent(new createjs.Event(this.screen.UPGRADE_BOUGHT_EVENT));
  887. this.screen.timeline.updateCoinScore();
  888. return this.screen.undoStack.push(this);
  889. });
  890. return this.available = true;
  891. };
  892. ButtonLabs.prototype.setBought = function() {
  893. this.lighten(60);
  894. this.cursor = 'default';
  895. return this.bought = true;
  896. };
  897. ButtonLabs.prototype.lighten = function(brightness) {
  898. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(brightness))];
  899. return this.updateCache();
  900. };
  901. ButtonLabs.prototype.darken = function() {
  902. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustSaturation(-100))];
  903. return this.updateCache();
  904. };
  905. ButtonLabs.prototype.removeAllFilters = function() {
  906. this.filters = [];
  907. return this.updateCache();
  908. };
  909. return ButtonLabs;
  910. })(createjs.Container);
  911. }).call(this);
  912. /*
  913. * Copyright © Romain Fouquet, 2012-2015
  914. * Copyright © Clément Joly, 2012-2015
  915. #
  916. * romain.fouquet18@gmail.com
  917. * leowzukw@vmail.me
  918. #
  919. * This file is part of Diseases Killer Academy.
  920. #
  921. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  922. * it under the terms of the GNU Affero General Public License as published by
  923. * the Free Software Foundation, either version 3 of the License, or
  924. * (at your option) any later version.
  925. #
  926. * Diseases Killer Academy is distributed in the hope that it will be useful,
  927. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  928. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  929. * GNU Affero General Public License for more details.
  930. #
  931. * You should have received a copy of the GNU Affero General Public License
  932. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  933. */
  934. (function() {
  935. 'use strict';
  936. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  937. hasProp = {}.hasOwnProperty;
  938. dka.ButtonSprite = (function(superClass) {
  939. extend(ButtonSprite, superClass);
  940. function ButtonSprite(sps, brightness) {
  941. var bounds;
  942. ButtonSprite.__super__.constructor.call(this, sps || null);
  943. this.set({
  944. cursor: 'pointer',
  945. available: true,
  946. brightness: (brightness ? brightness : 30)
  947. });
  948. if (sps) {
  949. bounds = sps.getFrameBounds(0);
  950. this.cache(bounds.x, bounds.y, bounds.width, bounds.height);
  951. }
  952. this.on('mouseover', function() {
  953. if (!this.available) {
  954. return;
  955. }
  956. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(this.brightness))];
  957. this.updateCache();
  958. return gameStage.update();
  959. });
  960. this.on('mouseout', function() {
  961. this.filters = [];
  962. if (!this.available) {
  963. this.darken();
  964. }
  965. this.updateCache();
  966. return gameStage.update();
  967. });
  968. }
  969. ButtonSprite.prototype.darken = function() {
  970. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustSaturation(-100))];
  971. this.updateCache();
  972. gameStage.update();
  973. return this.available = false;
  974. };
  975. ButtonSprite.prototype.removeAllFilters = function() {
  976. this.filters = [];
  977. this.updateCache();
  978. gameStage.update();
  979. return this.available = true;
  980. };
  981. return ButtonSprite;
  982. })(createjs.Sprite);
  983. }).call(this);
  984. /*
  985. * Copyright © Romain Fouquet, 2012-2015
  986. * Copyright © Clément Joly, 2012-2015
  987. #
  988. * romain.fouquet18@gmail.com
  989. * leowzukw@vmail.me
  990. #
  991. * This file is part of Diseases Killer Academy.
  992. #
  993. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  994. * it under the terms of the GNU Affero General Public License as published by
  995. * the Free Software Foundation, either version 3 of the License, or
  996. * (at your option) any later version.
  997. #
  998. * Diseases Killer Academy is distributed in the hope that it will be useful,
  999. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1000. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1001. * GNU Affero General Public License for more details.
  1002. #
  1003. * You should have received a copy of the GNU Affero General Public License
  1004. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1005. */
  1006. (function() {
  1007. 'use strict';
  1008. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1009. hasProp = {}.hasOwnProperty;
  1010. dka.BulletDecal = (function(superClass) {
  1011. extend(BulletDecal, superClass);
  1012. function BulletDecal(x, y, level) {
  1013. BulletDecal.__super__.constructor.call(this, dka.academy.assetManager.getAsset('spriteBulletEffect'));
  1014. this.level = level;
  1015. this.set({
  1016. x: x,
  1017. y: y
  1018. });
  1019. this.on('animationend', function(e) {
  1020. this.stop();
  1021. return createjs.Tween.get(this, {
  1022. useTicks: true
  1023. }).wait(20).to({
  1024. alpha: 0
  1025. }, 50, createjs.Ease.circIn).call(function() {
  1026. return this.parent.removeChild(this);
  1027. });
  1028. });
  1029. this.gotoAndPlay('boum');
  1030. this.level.decalsLayer.addChild(this);
  1031. }
  1032. return BulletDecal;
  1033. })(createjs.Sprite);
  1034. }).call(this);
  1035. /*
  1036. * Copyright © Romain Fouquet, 2012-2015
  1037. * Copyright © Clément Joly, 2012-2015
  1038. #
  1039. * romain.fouquet18@gmail.com
  1040. * leowzukw@vmail.me
  1041. #
  1042. * This file is part of Diseases Killer Academy.
  1043. #
  1044. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1045. * it under the terms of the GNU Affero General Public License as published by
  1046. * the Free Software Foundation, either version 3 of the License, or
  1047. * (at your option) any later version.
  1048. #
  1049. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1050. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1051. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1052. * GNU Affero General Public License for more details.
  1053. #
  1054. * You should have received a copy of the GNU Affero General Public License
  1055. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1056. */
  1057. (function() {
  1058. 'use strict';
  1059. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1060. hasProp = {}.hasOwnProperty;
  1061. dka.TutoBubble = (function(superClass) {
  1062. extend(TutoBubble, superClass);
  1063. function TutoBubble(text, position, level, closeEvent, invertDirection, alternateText) {
  1064. var ref;
  1065. TutoBubble.__super__.constructor.call(this);
  1066. this.text = text;
  1067. this.position = position;
  1068. this.level = level;
  1069. this.closeEvent = closeEvent;
  1070. this.invertDirection = invertDirection;
  1071. this.alternateText = alternateText;
  1072. this.SMALL_BUBBLE_WIDTH = 100;
  1073. this.LARGE_BUBBLE_WIDTH = 150;
  1074. this.set({
  1075. x: this.position.x,
  1076. y: this.position.y,
  1077. alpha: 0
  1078. });
  1079. this.addText();
  1080. this.addBubble();
  1081. createjs.Tween.get(this, {
  1082. useTicks: true
  1083. }).to({
  1084. alpha: 1
  1085. }, 15, createjs.Ease.backIn);
  1086. createjs.Tween.get(this, {
  1087. useTicks: true,
  1088. loop: true
  1089. }).to({
  1090. scaleX: 0.85
  1091. }, 15, createjs.Ease.backIn).to({
  1092. scaleX: 1
  1093. }, 15, createjs.Ease.backOut);
  1094. if ((ref = this.level) != null) {
  1095. ref.on(this.closeEvent, (function(_this) {
  1096. return function(e) {
  1097. e.remove();
  1098. return createjs.Tween.get(_this, {
  1099. useTicks: true
  1100. }).to({
  1101. alpha: 0,
  1102. scaleX: 0
  1103. }, 3).call(function() {
  1104. return this.parent.removeChild(this);
  1105. });
  1106. };
  1107. })(this));
  1108. }
  1109. if (alternateText) {
  1110. this.on('tick', this.tick);
  1111. this.switchDelay = 1 * 30;
  1112. this.switchCounter = 0;
  1113. }
  1114. }
  1115. TutoBubble.prototype.tick = function() {
  1116. this.switchCounter++;
  1117. if (this.switchCounter >= this.switchDelay) {
  1118. this.textToast.alpha = 0;
  1119. createjs.Tween.get(this.textToast, {
  1120. useTicks: true
  1121. }).to({
  1122. alpha: 1
  1123. }, 5);
  1124. this.switchCounter = 0;
  1125. if (this.textToast.text === this.text) {
  1126. return this.textToast.text = this.alternateText;
  1127. } else {
  1128. return this.textToast.text = this.text;
  1129. }
  1130. }
  1131. };
  1132. TutoBubble.prototype.addText = function() {
  1133. this.textToast = new createjs.Text(this.text, '17px Arial', dka.colors.lightBlue);
  1134. this.textToast.set({
  1135. y: 18,
  1136. textAlign: 'center',
  1137. textBaseline: 'alphabetic'
  1138. });
  1139. return this.addChild(this.textToast);
  1140. };
  1141. TutoBubble.prototype.addBubble = function() {
  1142. var bg, bubble, width;
  1143. bg = 'tutoBubbleSmall';
  1144. width = this.SMALL_BUBBLE_WIDTH;
  1145. if (this.textToast.getMeasuredWidth() > 90) {
  1146. bg = 'tutoBubbleLarge';
  1147. width = this.LARGE_BUBBLE_WIDTH;
  1148. }
  1149. bubble = new createjs.Bitmap(dka.academy.assetManager.getAsset(bg));
  1150. bubble.regX = width / 2;
  1151. if (this.invertDirection) {
  1152. bubble.scaleY = -1;
  1153. bubble.y = 25;
  1154. }
  1155. return this.addChildAt(bubble, 0);
  1156. };
  1157. return TutoBubble;
  1158. })(createjs.Container);
  1159. }).call(this);
  1160. /*
  1161. * Copyright © Romain Fouquet, 2012-2015
  1162. * Copyright © Clément Joly, 2012-2015
  1163. #
  1164. * romain.fouquet18@gmail.com
  1165. * leowzukw@vmail.me
  1166. #
  1167. * This file is part of Diseases Killer Academy.
  1168. *
  1169. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1170. * it under the terms of the GNU Affero General Public License as published by
  1171. * the Free Software Foundation, either version 3 of the License, or
  1172. * (at your option) any later version.
  1173. *
  1174. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1175. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1176. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1177. * GNU Affero General Public License for more details.
  1178. *
  1179. * You should have received a copy of the GNU Affero General Public License
  1180. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1181. */
  1182. (function() {
  1183. 'use strict';
  1184. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1185. hasProp = {}.hasOwnProperty;
  1186. dka.TabletSmoke = (function(superClass) {
  1187. extend(TabletSmoke, superClass);
  1188. function TabletSmoke(x, y) {
  1189. TabletSmoke.__super__.constructor.call(this, dka.academy.assetManager.getAsset('spriteTabletSmoke'));
  1190. this.x = x;
  1191. this.y = y;
  1192. this.gotoAndPlay(0);
  1193. this.on('animationend', this.animationend);
  1194. }
  1195. TabletSmoke.prototype.animationend = function() {
  1196. return this.parent.removeChild(this);
  1197. };
  1198. return TabletSmoke;
  1199. })(createjs.Sprite);
  1200. }).call(this);
  1201. /*
  1202. * Copyright © Romain Fouquet, 2012-2015
  1203. * Copyright © Clément Joly, 2012-2015
  1204. #
  1205. * romain.fouquet18@gmail.com
  1206. * leowzukw@vmail.me
  1207. #
  1208. * This file is part of Diseases Killer Academy.
  1209. #
  1210. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1211. * it under the terms of the GNU Affero General Public License as published by
  1212. * the Free Software Foundation, either version 3 of the License, or
  1213. * (at your option) any later version.
  1214. #
  1215. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1216. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1217. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1218. * GNU Affero General Public License for more details.
  1219. #
  1220. * You should have received a copy of the GNU Affero General Public License
  1221. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1222. */
  1223. (function() {
  1224. 'use strict';
  1225. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1226. hasProp = {}.hasOwnProperty;
  1227. dka.CapsuleSmoke = (function(superClass) {
  1228. extend(CapsuleSmoke, superClass);
  1229. function CapsuleSmoke(x, y) {
  1230. CapsuleSmoke.__super__.constructor.call(this, dka.academy.assetManager.getAsset('spCapsuleSmoke'));
  1231. this.x = x;
  1232. this.y = y;
  1233. this.gotoAndPlay(0);
  1234. this.on('animationend', this.animationend);
  1235. }
  1236. CapsuleSmoke.prototype.animationend = function() {
  1237. return this.parent.removeChild(this);
  1238. };
  1239. return CapsuleSmoke;
  1240. })(createjs.Sprite);
  1241. }).call(this);
  1242. /*
  1243. * Copyright © Romain Fouquet, 2012-2015
  1244. * Copyright © Clément Joly, 2012-2015
  1245. #
  1246. * romain.fouquet18@gmail.com
  1247. * leowzukw@vmail.me
  1248. #
  1249. * This file is part of Diseases Killer Academy.
  1250. #
  1251. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1252. * it under the terms of the GNU Affero General Public License as published by
  1253. * the Free Software Foundation, either version 3 of the License, or
  1254. * (at your option) any later version.
  1255. #
  1256. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1257. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1258. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1259. * GNU Affero General Public License for more details.
  1260. #
  1261. * You should have received a copy of the GNU Affero General Public License
  1262. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1263. */
  1264. (function() {
  1265. 'use strict';
  1266. var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
  1267. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1268. hasProp = {}.hasOwnProperty;
  1269. dka.WaveFlag = (function(superClass) {
  1270. extend(WaveFlag, superClass);
  1271. function WaveFlag(level, road) {
  1272. this.clickRemove = bind(this.clickRemove, this);
  1273. this.update = bind(this.update, this);
  1274. var hitCircle, newBmp, progressBar, settings;
  1275. WaveFlag.__super__.constructor.call(this);
  1276. this.level = level;
  1277. this.road = road;
  1278. settings = this.level.waves[this.level.getFresherWaveIndex() + 1].roads[road].callButton;
  1279. this.set({
  1280. x: settings.x,
  1281. y: settings.y,
  1282. regX: 20,
  1283. regY: 20,
  1284. scaleX: 0.7,
  1285. scaleY: 0.7,
  1286. cursor: 'pointer'
  1287. });
  1288. hitCircle = new createjs.Shape();
  1289. hitCircle.graphics.beginFill('#000000').dc(20, 20, 20).endFill();
  1290. this.hitArea = hitCircle;
  1291. progressBar = new createjs.Shape();
  1292. progressBar.set({
  1293. x: 10,
  1294. y: 8
  1295. });
  1296. if (this.level.getFresherWaveIndex() + 1 > 0) {
  1297. progressBar.on('tick', this.update);
  1298. }
  1299. newBmp = new createjs.Bitmap(dka.academy.assetManager.getAsset('callWave')).set({
  1300. x: 16,
  1301. y: 16,
  1302. regX: 16,
  1303. regY: 16
  1304. });
  1305. if (this.level.game.labs.getUpgradeLevel('hintNxtWave') >= 0) {
  1306. this.addHintBox();
  1307. }
  1308. this.addChild(progressBar, newBmp);
  1309. this.cache(0, 0, 2 * this.regX, 2 * this.regY);
  1310. createjs.Tween.get(this, {
  1311. useTicks: true,
  1312. loop: true
  1313. }).to({
  1314. scaleX: 1,
  1315. scaleY: 1
  1316. }, 15, createjs.Ease.backOut).to({
  1317. scaleX: 0.7,
  1318. scaleY: 0.7
  1319. }, 15, createjs.Ease.backIn);
  1320. this.on('click', this.clickRemove);
  1321. this.on('mouseover', function() {
  1322. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
  1323. return this.updateCache();
  1324. });
  1325. this.on('mouseout', function() {
  1326. this.filters = [];
  1327. return this.updateCache();
  1328. });
  1329. }
  1330. WaveFlag.prototype.addHintBox = function() {
  1331. var dis, disease, i, len, name, nbTypeDiseases, nxtWaveDiseases, prop, props, ref;
  1332. nxtWaveDiseases = {};
  1333. ref = this.level.waves[this.level.getFresherWaveIndex() + 1].roads[this.road].diseasesList;
  1334. for (i = 0, len = ref.length; i < len; i++) {
  1335. disease = ref[i];
  1336. dis = disease.dis;
  1337. if (nxtWaveDiseases[dis]) {
  1338. nxtWaveDiseases[dis]++;
  1339. } else {
  1340. nxtWaveDiseases[dis] = 1;
  1341. }
  1342. }
  1343. if (this.level.game.labs.getUpgradeLevel('hintNxtWave') >= 1) {
  1344. for (name in nxtWaveDiseases) {
  1345. nxtWaveDiseases[name] = 'x ' + nxtWaveDiseases[name];
  1346. }
  1347. } else {
  1348. for (name in nxtWaveDiseases) {
  1349. nxtWaveDiseases[name] = 'x ?';
  1350. }
  1351. }
  1352. props = [];
  1353. nbTypeDiseases = 0;
  1354. for (name in nxtWaveDiseases) {
  1355. prop = props[nbTypeDiseases] = {};
  1356. prop.caption = name;
  1357. prop.separator = ' ';
  1358. prop.value = nxtWaveDiseases[name];
  1359. prop.color = 'green';
  1360. nbTypeDiseases++;
  1361. }
  1362. this.on('mouseover', function() {
  1363. return this.level.addToolTip(this, {
  1364. title: 'Wave ' + (this.level.getFresherWaveIndex() + 2),
  1365. props: props
  1366. });
  1367. });
  1368. return this.on('mouseout', function() {
  1369. return this.level.removeToolTip();
  1370. });
  1371. };
  1372. WaveFlag.prototype.update = function() {
  1373. var ratio;
  1374. ratio = this.level.waitForNewWave / this.level.delayForNxtWave;
  1375. ratio = (ratio === 0 ? 1 : ratio);
  1376. this.getChildAt(0).graphics.clear();
  1377. this.getChildAt(0).graphics.beginFill(dka.colors.lightBlue).rect(0, 19, 19, -19 * ratio).endFill();
  1378. return this.updateCache();
  1379. };
  1380. WaveFlag.prototype.remove = function() {
  1381. this.removeAllEventListeners('click');
  1382. createjs.Tween.get(this, {
  1383. useTicks: true,
  1384. override: true
  1385. }).to({
  1386. scaleX: 0,
  1387. scaleY: 0
  1388. }, 15, createjs.Ease.backIn).call(function() {
  1389. return this.parent.removeChild(this);
  1390. });
  1391. if (this.level.getFresherWaveIndex() >= 0) {
  1392. return this.level.getHospital().getAbilityResult('subsidies');
  1393. }
  1394. };
  1395. WaveFlag.prototype.clickRemove = function() {
  1396. var goldEarned, timeEco;
  1397. this.level.towerMenu.fade();
  1398. this.level.ui.removeWaveFlags();
  1399. this.level.dispatchEvent(new createjs.Event(this.level.WAVE_FLAG_CLICKED_EVENT, true, false));
  1400. if (this.level.getFresherWaveIndex() === -1) {
  1401. dka.academy.removeStageTicker();
  1402. this.level.addLevelTicker();
  1403. this.level.ui.helpButtonsHolder.allow();
  1404. }
  1405. timeEco = this.level.delayForNxtWave - this.level.waitForNewWave;
  1406. goldEarned = (timeEco / 10) | 0;
  1407. if (goldEarned > 0) {
  1408. this.level.addGold(goldEarned);
  1409. this.level.ui.helpButtonsHolder.advanceLoading(timeEco, this.level);
  1410. createjs.Tween.get(null, {
  1411. useTicks: true
  1412. }).wait(30).call((function(_this) {
  1413. return function() {
  1414. var reward;
  1415. reward = new dka.BouncingText('+' + goldEarned, 'bold 12px karnivoreRegular, Arial', dka.colors.gold, new createjs.Point(_this.x, _this.y));
  1416. return _this.level.ui.addChild(reward);
  1417. };
  1418. })(this));
  1419. }
  1420. this.level.addWave();
  1421. return this.level.ui.hudBar.updateWaves();
  1422. };
  1423. return WaveFlag;
  1424. })(createjs.Container);
  1425. }).call(this);
  1426. /*
  1427. * Copyright © Romain Fouquet, 2012-2015
  1428. * Copyright © Clément Joly, 2012-2015
  1429. #
  1430. * romain.fouquet18@gmail.com
  1431. * leowzukw@vmail.me
  1432. #
  1433. * This file is part of Diseases Killer Academy.
  1434. #
  1435. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1436. * it under the terms of the GNU Affero General Public License as published by
  1437. * the Free Software Foundation, either version 3 of the License, or
  1438. * (at your option) any later version.
  1439. #
  1440. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1441. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1442. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1443. * GNU Affero General Public License for more details.
  1444. #
  1445. * You should have received a copy of the GNU Affero General Public License
  1446. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1447. */
  1448. (function() {
  1449. 'use strict';
  1450. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1451. hasProp = {}.hasOwnProperty;
  1452. dka.TypingText = (function(superClass) {
  1453. extend(TypingText, superClass);
  1454. function TypingText(text, font, color, level, waitAfter, cursorSymbol, speedText, speedCursor) {
  1455. this.textArray = text.split('');
  1456. TypingText.__super__.constructor.call(this, this.textArray[0] + cursorSymbol, font, color);
  1457. this.textToDisplay = text;
  1458. this.level = level;
  1459. this.waitAfter = waitAfter;
  1460. this.cursorSymbol = cursorSymbol || '';
  1461. this.speedText = speedText || 1;
  1462. this.speedCursor = speedCursor;
  1463. this.progressDisplay = 1;
  1464. this.delayCount = 0;
  1465. this.waitCount = 0;
  1466. this.updateWrapper = this.on('tick', this.update);
  1467. }
  1468. TypingText.prototype.update = function() {
  1469. if (this.level.ui.paused === true) {
  1470. return;
  1471. }
  1472. if (this.delayCount < this.speedText) {
  1473. this.delayCount++;
  1474. return;
  1475. }
  1476. if (this.progressDisplay < this.textArray.length) {
  1477. this.text = this.text.slice(0, this.progressDisplay) + this.textArray[this.progressDisplay] + this.text.slice(this.progressDisplay);
  1478. if (this.textArray[this.progressDisplay] === ' ') {
  1479. this.delayCount = -3 * this.speedText;
  1480. } else {
  1481. this.delayCount = 0;
  1482. }
  1483. return this.progressDisplay++;
  1484. } else {
  1485. if (this.waitCount > this.waitAfter) {
  1486. this.off('tick', this.updateWrapper);
  1487. createjs.Tween.get(this, {
  1488. useTicks: true
  1489. }).to({
  1490. y: canvasHeight - 30
  1491. }, 12, createjs.Ease.backIn).call(function() {
  1492. return this.parent.removeChild(this);
  1493. });
  1494. return;
  1495. }
  1496. if (this.waitCount / this.speedCursor === Math.round(this.waitCount / this.speedCursor)) {
  1497. if (this.text.search(this.cursorSymbol) === -1) {
  1498. this.text += this.cursorSymbol;
  1499. } else {
  1500. this.text = this.textToDisplay;
  1501. }
  1502. }
  1503. return this.waitCount++;
  1504. }
  1505. };
  1506. return TypingText;
  1507. })(createjs.Text);
  1508. }).call(this);
  1509. /*
  1510. * Copyright © Romain Fouquet, 2012-2015
  1511. * Copyright © Clément Joly, 2012-2015
  1512. #
  1513. * romain.fouquet18@gmail.com
  1514. * leowzukw@vmail.me
  1515. #
  1516. * This file is part of Diseases Killer Academy.
  1517. *
  1518. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1519. * it under the terms of the GNU Affero General Public License as published by
  1520. * the Free Software Foundation, either version 3 of the License, or
  1521. * (at your option) any later version.
  1522. *
  1523. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1524. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1525. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1526. * GNU Affero General Public License for more details.
  1527. *
  1528. * You should have received a copy of the GNU Affero General Public License
  1529. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1530. */
  1531. (function() {
  1532. 'use strict';
  1533. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1534. hasProp = {}.hasOwnProperty;
  1535. dka.BouncingText = (function(superClass) {
  1536. extend(BouncingText, superClass);
  1537. function BouncingText(text, font, color, position, jumpHeight) {
  1538. BouncingText.__super__.constructor.call(this, text, font, color);
  1539. this.set({
  1540. x: position.x,
  1541. y: position.y,
  1542. textAlign: 'center',
  1543. textBaseline: 'alphabetic'
  1544. });
  1545. createjs.Tween.get(this, {
  1546. useTicks: true
  1547. }).to({
  1548. y: position.y - (jumpHeight || 20)
  1549. }, 18, createjs.Ease.backOut).to({
  1550. alpha: 0
  1551. }, 5).call(function() {
  1552. return this.parent.removeChild(this);
  1553. });
  1554. }
  1555. return BouncingText;
  1556. })(createjs.Text);
  1557. }).call(this);
  1558. /*
  1559. * Copyright © Romain Fouquet, 2012-2015
  1560. * Copyright © Clément Joly, 2012-2015
  1561. #
  1562. * romain.fouquet18@gmail.com
  1563. * leowzukw@vmail.me
  1564. #
  1565. * This file is part of Diseases Killer Academy.
  1566. *
  1567. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1568. * it under the terms of the GNU Affero General Public License as published by
  1569. * the Free Software Foundation, either version 3 of the License, or
  1570. * (at your option) any later version.
  1571. *
  1572. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1573. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1574. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1575. * GNU Affero General Public License for more details.
  1576. *
  1577. * You should have received a copy of the GNU Affero General Public License
  1578. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1579. */
  1580. (function() {
  1581. 'use strict';
  1582. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1583. hasProp = {}.hasOwnProperty;
  1584. dka.ScrollNumber = (function(superClass) {
  1585. extend(ScrollNumber, superClass);
  1586. function ScrollNumber(number, font, color, speedScroll) {
  1587. ScrollNumber.__super__.constructor.call(this, '0', font, color);
  1588. this.updateWrapper = this.on('tick', this.update);
  1589. this.set({
  1590. textAlign: 'right',
  1591. textBaseline: 'alphabetic'
  1592. });
  1593. this.number = number;
  1594. this.progressNumber = 0;
  1595. this.speedScroll = speedScroll || 1;
  1596. }
  1597. ScrollNumber.prototype.update = function() {
  1598. if (this.progressNumber >= this.number) {
  1599. this.off('tick', this.updateWrapper);
  1600. }
  1601. if (this.speedScroll < 1) {
  1602. this.progressNumber += 1 / this.speedScroll;
  1603. if (this.progressNumber > this.number) {
  1604. this.progressNumber = this.number;
  1605. }
  1606. this.text = this.progressNumber;
  1607. return;
  1608. }
  1609. return this.text = this.progressNumber + this.speedScroll;
  1610. };
  1611. return ScrollNumber;
  1612. })(createjs.Text);
  1613. }).call(this);
  1614. /*
  1615. * Copyright © Romain Fouquet, 2012-2015
  1616. * Copyright © Clément Joly, 2012-2015
  1617. #
  1618. * romain.fouquet18@gmail.com
  1619. * leowzukw@vmail.me
  1620. #
  1621. * This file is part of Diseases Killer Academy.
  1622. #
  1623. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1624. * it under the terms of the GNU Affero General Public License as published by
  1625. * the Free Software Foundation, either version 3 of the License, or
  1626. * (at your option) any later version.
  1627. #
  1628. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1629. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1630. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1631. * GNU Affero General Public License for more details.
  1632. #
  1633. * You should have received a copy of the GNU Affero General Public License
  1634. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1635. */
  1636. (function() {
  1637. 'use strict';
  1638. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1639. hasProp = {}.hasOwnProperty;
  1640. dka.MessageBalloon = (function(superClass) {
  1641. extend(MessageBalloon, superClass);
  1642. function MessageBalloon(text, level) {
  1643. MessageBalloon.__super__.constructor.call(this);
  1644. this.text = text;
  1645. this.level = level;
  1646. this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('msgBalloon')));
  1647. this.textDisplay = new createjs.Text('', '16px karnivoreRegular, Arial', dka.colors.lightBlue).set({
  1648. x: 30,
  1649. y: 30,
  1650. textBaseline: 'alphabetic'
  1651. });
  1652. this.addChild(this.textDisplay);
  1653. this.cache(0, 0, 640, 56);
  1654. this.load(text);
  1655. }
  1656. MessageBalloon.prototype.load = function(text) {
  1657. this.textArray = text.split('`');
  1658. this.maxLines = this.textArray.length;
  1659. this.lineDisplayed = 0;
  1660. this.waitCount = this.speed = 60;
  1661. this.updateCache();
  1662. return this.updateWrapper = this.on('tick', this.update);
  1663. };
  1664. MessageBalloon.prototype.update = function() {
  1665. if (this.level.ui.paused) {
  1666. return;
  1667. }
  1668. this.waitCount++;
  1669. if (this.waitCount < this.speed) {
  1670. return;
  1671. }
  1672. this.waitCount = 0;
  1673. if (this.lineDisplayed === this.maxLines) {
  1674. this.fade();
  1675. return;
  1676. }
  1677. this.uncache();
  1678. return createjs.Tween.get(this.textDisplay, {
  1679. useTicks: true
  1680. }).to({
  1681. alpha: 0
  1682. }, 3).call(function() {
  1683. this.text = this.parent.textArray[this.parent.lineDisplayed];
  1684. return this.parent.lineDisplayed++;
  1685. }).to({
  1686. alpha: 1
  1687. }, 3).call(function() {
  1688. return this.parent.cache(0, 0, 640, 56);
  1689. });
  1690. };
  1691. MessageBalloon.prototype.fade = function() {
  1692. return createjs.Tween.get(this, {
  1693. useTicks: true
  1694. }).to({
  1695. x: canvasWidth
  1696. }, 22, createjs.Ease.backIn).call(function() {
  1697. return this.parent.removeChild(this);
  1698. });
  1699. };
  1700. return MessageBalloon;
  1701. })(createjs.Container);
  1702. }).call(this);
  1703. /*
  1704. * Copyright © Romain Fouquet, 2012-2015
  1705. * Copyright © Clément Joly, 2012-2015
  1706. #
  1707. * romain.fouquet18@gmail.com
  1708. * leowzukw@vmail.me
  1709. #
  1710. * This file is part of Diseases Killer Academy.
  1711. #
  1712. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1713. * it under the terms of the GNU Affero General Public License as published by
  1714. * the Free Software Foundation, either version 3 of the License, or
  1715. * (at your option) any later version.
  1716. #
  1717. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1718. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1719. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1720. * GNU Affero General Public License for more details.
  1721. #
  1722. * You should have received a copy of the GNU Affero General Public License
  1723. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1724. */
  1725. (function() {
  1726. 'use strict';
  1727. dka.Labs = (function() {
  1728. function Labs(game) {
  1729. var purchases;
  1730. this.game = game;
  1731. purchases = dka.academy.dataManager.retrieveLabsPurchases();
  1732. if (purchases) {
  1733. this._upgrades = purchases;
  1734. } else {
  1735. this._upgrades = {
  1736. hintNxtWave: -1,
  1737. fever: 0,
  1738. vaccine: 0
  1739. };
  1740. }
  1741. }
  1742. Labs.prototype.reset = function() {
  1743. this._upgrades = {
  1744. hintNxtWave: -1,
  1745. fever: 0,
  1746. vaccine: 0
  1747. };
  1748. dka.academy.dataManager.saveLabsPurchases();
  1749. return this.game.resetGold();
  1750. };
  1751. Labs.prototype.serialize = function() {
  1752. return JSON.stringify(this._upgrades);
  1753. };
  1754. Labs.prototype.getUpgradeLevel = function(upgrade) {
  1755. return this._upgrades[upgrade];
  1756. };
  1757. Labs.prototype.setUpgradeLevel = function(upgrade, value) {
  1758. return this._upgrades[upgrade] = value;
  1759. };
  1760. Labs.prototype.isBought = function(upgrade) {
  1761. return this.getUpgradeLevel(upgrade) > 0;
  1762. };
  1763. Labs.prototype.sell = function(upgrade, cost) {
  1764. this.setUpgradeLevel(upgrade, this.getUpgradeLevel(upgrade) - 1);
  1765. dka.academy.dataManager.saveLabsPurchases();
  1766. return this.game.removeGold(-cost);
  1767. };
  1768. Labs.prototype.buy = function(upgrade, cost) {
  1769. this.setUpgradeLevel(upgrade, this.getUpgradeLevel(upgrade) + 1);
  1770. dka.academy.dataManager.saveLabsPurchases();
  1771. return this.game.removeGold(cost);
  1772. };
  1773. Labs.prototype.getLowerUnlockedPrice = function() {
  1774. var min, price, upgrade;
  1775. min = 0;
  1776. for (upgrade in this._upgrades) {
  1777. if (!dka.academy.game.settings.labs[upgrade][this.getUpgradeLevel(upgrade)]) {
  1778. return;
  1779. }
  1780. price = dka.academy.game.settings.labs[upgrade][this.getUpgradeLevel(upgrade)].cost;
  1781. if (min === 0 || price < min) {
  1782. min = price;
  1783. }
  1784. }
  1785. return min;
  1786. };
  1787. return Labs;
  1788. })();
  1789. }).call(this);
  1790. /*
  1791. * Copyright © Romain Fouquet, 2012-2015
  1792. * Copyright © Clément Joly, 2012-2015
  1793. #
  1794. * romain.fouquet18@gmail.com
  1795. * leowzukw@vmail.me
  1796. #
  1797. * This file is part of Diseases Killer Academy.
  1798. #
  1799. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1800. * it under the terms of the GNU Affero General Public License as published by
  1801. * the Free Software Foundation, either version 3 of the License, or
  1802. * (at your option) any later version.
  1803. #
  1804. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1805. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1806. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1807. * GNU Affero General Public License for more details.
  1808. #
  1809. * You should have received a copy of the GNU Affero General Public License
  1810. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1811. */
  1812. (function() {
  1813. 'use strict';
  1814. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1815. hasProp = {}.hasOwnProperty;
  1816. dka.HelpButton = (function(superClass) {
  1817. extend(HelpButton, superClass);
  1818. function HelpButton(name, bmp, level, ui) {
  1819. var hexagon;
  1820. HelpButton.__super__.constructor.call(this, null, null, new createjs.Bitmap(bmp));
  1821. this.name = name;
  1822. this.level = level;
  1823. this.ui = ui;
  1824. this.set({
  1825. cursor: 'default',
  1826. ready: false
  1827. });
  1828. hexagon = this._reloadPie = new createjs.Shape();
  1829. hexagon.graphics.beginFill('#000000').drawPolyStar(this.regX, this.regY, 18, 6, 0, 30);
  1830. hexagon.alpha = 0.6;
  1831. this.addChild(hexagon);
  1832. this.on('click', function() {
  1833. this.level.towerMenu.fade();
  1834. return this.doAction();
  1835. });
  1836. this.on('mouseout', function() {
  1837. return this.level.removeToolTip();
  1838. });
  1839. this.updateCache();
  1840. }
  1841. HelpButton.prototype.allow = function() {
  1842. return this.loaded();
  1843. };
  1844. HelpButton.prototype.advanceLoading = function(arg) {
  1845. var base;
  1846. if (typeof arg === 'number') {
  1847. this._loading -= arg;
  1848. } else {
  1849. this._loading--;
  1850. }
  1851. if (this._loading <= 0) {
  1852. return this.loaded(arg);
  1853. } else {
  1854. if (typeof (base = this._reloadPie).setProgress === "function") {
  1855. base.setProgress(1 - (this._loading / this._full));
  1856. }
  1857. return this.updateCache();
  1858. }
  1859. };
  1860. HelpButton.prototype.loaded = function(e) {
  1861. (e != null ? e.remove : void 0) && e.remove();
  1862. this.ready = true;
  1863. this.cursor = 'pointer';
  1864. this.removeChild(this._reloadPie);
  1865. return this.updateCache();
  1866. };
  1867. HelpButton.prototype.unload = function() {
  1868. var hexagon;
  1869. this._loading = this._full;
  1870. this.ready = false;
  1871. this.cursor = 'default';
  1872. hexagon = new createjs.Shape();
  1873. hexagon.graphics.beginFill('#F00000').drawPolyStar(this.regX, this.regY, 18, 6, 0, 30);
  1874. this._reloadPie = (new dka.ProgressPie(20, 20, null, '#000')).set({
  1875. x: this.regX,
  1876. y: this.regY,
  1877. alpha: 0.6
  1878. });
  1879. this._reloadPie.mask = hexagon;
  1880. this.addChild(this._reloadPie);
  1881. return this.on('tick', this.advanceLoading);
  1882. };
  1883. return HelpButton;
  1884. })(dka.Button);
  1885. }).call(this);
  1886. /*
  1887. * Copyright © Romain Fouquet, 2012-2015
  1888. * Copyright © Clément Joly, 2012-2015
  1889. #
  1890. * romain.fouquet18@gmail.com
  1891. * leowzukw@vmail.me
  1892. #
  1893. * This file is part of Diseases Killer Academy.
  1894. #
  1895. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1896. * it under the terms of the GNU Affero General Public License as published by
  1897. * the Free Software Foundation, either version 3 of the License, or
  1898. * (at your option) any later version.
  1899. #
  1900. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1901. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1902. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1903. * GNU Affero General Public License for more details.
  1904. #
  1905. * You should have received a copy of the GNU Affero General Public License
  1906. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1907. */
  1908. (function() {
  1909. 'use strict';
  1910. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1911. hasProp = {}.hasOwnProperty;
  1912. dka.VaccineStain = (function(superClass) {
  1913. extend(VaccineStain, superClass);
  1914. function VaccineStain(x, y, level) {
  1915. VaccineStain.__super__.constructor.call(this);
  1916. this.x = x;
  1917. this.y = y;
  1918. this.level = level;
  1919. this.damage = level.settings.getLabsSetting('vaccine', 'damage');
  1920. this.spriteSheet = dka.academy.assetManager.getAsset('spriteVaccineStain');
  1921. this.gotoAndPlay('spread');
  1922. this.on('animationend', function() {
  1923. return this.gotoAndStop(3);
  1924. });
  1925. this.on('tick', function() {
  1926. var disease, diseasesLayer, i, localPoint, results;
  1927. diseasesLayer = this.level.diseasesLayer;
  1928. i = 0;
  1929. results = [];
  1930. while (i < diseasesLayer.numChildren) {
  1931. disease = diseasesLayer.getChildAt(i);
  1932. localPoint = gameStage.localToLocal(disease.x, disease.y, this);
  1933. if (this.hitTest(localPoint.x, localPoint.y)) {
  1934. disease.beDamaged(this.damage);
  1935. }
  1936. results.push(i++);
  1937. }
  1938. return results;
  1939. });
  1940. createjs.Tween.get(this, {
  1941. useTicks: true
  1942. }).wait(level.settings.getLabsSetting('vaccine', 'duration')).to({
  1943. alpha: 0
  1944. }, 15).call(function() {
  1945. return this.parent.removeChild(this);
  1946. });
  1947. }
  1948. return VaccineStain;
  1949. })(createjs.Sprite);
  1950. }).call(this);
  1951. /*
  1952. * Copyright © Romain Fouquet, 2012-2015
  1953. * Copyright © Clément Joly, 2012-2015
  1954. #
  1955. * romain.fouquet18@gmail.com
  1956. * leowzukw@vmail.me
  1957. #
  1958. * This file is part of Diseases Killer Academy.
  1959. #
  1960. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  1961. * it under the terms of the GNU Affero General Public License as published by
  1962. * the Free Software Foundation, either version 3 of the License, or
  1963. * (at your option) any later version.
  1964. #
  1965. * Diseases Killer Academy is distributed in the hope that it will be useful,
  1966. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1967. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1968. * GNU Affero General Public License for more details.
  1969. #
  1970. * You should have received a copy of the GNU Affero General Public License
  1971. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  1972. */
  1973. (function() {
  1974. 'use strict';
  1975. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1976. hasProp = {}.hasOwnProperty;
  1977. dka.HelpButtonVaccine = (function(superClass) {
  1978. extend(HelpButtonVaccine, superClass);
  1979. function HelpButtonVaccine(level, ui) {
  1980. HelpButtonVaccine.__super__.constructor.call(this, 'syringeButton', dka.academy.assetManager.getAsset('vaccineBP'), level, ui);
  1981. this.set({
  1982. x: this.ui.buttonsPositions[0],
  1983. _full: level.settings.getLabsSetting('vaccine', 'reloadTime')
  1984. });
  1985. this.on('mouseover', function() {
  1986. return this.level.addToolTip(this, {
  1987. title: 'Vaccine',
  1988. description: "Vaccine is a substance inoculated to cause a positive reaction from the patient. It works by \"training\" the immune system to recognize faster the disease next time, when the attack will be real.\n\nShortcut: y"
  1989. });
  1990. });
  1991. }
  1992. HelpButtonVaccine.prototype.doAction = function(keyboardTriggered) {
  1993. var clickSyringue, syringue, syringueGot;
  1994. if (!this.ready) {
  1995. return;
  1996. }
  1997. syringueGot = this.level.ui.getChildByName('syringue');
  1998. if (syringueGot) {
  1999. syringueGot.parent.removeChild(syringueGot);
  2000. gameStage.off('stagemousemove', this.syrMoveEvt);
  2001. gameStage.off('click', this.syrClickEvt);
  2002. return;
  2003. }
  2004. syringue = (new createjs.Sprite(dka.academy.assetManager.getAsset('spriteSyringue', 0))).set({
  2005. x: gameStage.mouseX,
  2006. y: gameStage.mouseY,
  2007. name: 'syringue',
  2008. cursor: 'pointer'
  2009. });
  2010. this.syrMoveEvt = gameStage.on('stagemousemove', function(e) {
  2011. syringue.x = e.stageX;
  2012. return syringue.y = e.stageY;
  2013. });
  2014. this.level.ui.addChild(syringue);
  2015. clickSyringue = function(e) {
  2016. this.unload();
  2017. syringueGot = this.level.ui.getChildByName('syringue');
  2018. syringueGot.gotoAndPlay('press');
  2019. syringueGot.on('animationend', function() {
  2020. return this.parent.removeChild(this);
  2021. });
  2022. this.level.backgroundLayer.addChild(new dka.VaccineStain(e.stageX, e.stageY, this.level));
  2023. e.remove();
  2024. return gameStage.off('stagemousemove', this.syrMoveEvt);
  2025. };
  2026. if (keyboardTriggered) {
  2027. return this.syrClickEvt = gameStage.on('click', clickSyringue, this);
  2028. } else {
  2029. return this.on('mouseout', (function() {
  2030. return this.syrClickEvt = gameStage.on('click', clickSyringue, this);
  2031. }), null, true);
  2032. }
  2033. };
  2034. return HelpButtonVaccine;
  2035. })(dka.HelpButton);
  2036. }).call(this);
  2037. /*
  2038. * Copyright © Romain Fouquet, 2012-2015
  2039. * Copyright © Clément Joly, 2012-2015
  2040. #
  2041. * romain.fouquet18@gmail.com
  2042. * leowzukw@vmail.me
  2043. #
  2044. * This file is part of Diseases Killer Academy.
  2045. #
  2046. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2047. * it under the terms of the GNU Affero General Public License as published by
  2048. * the Free Software Foundation, either version 3 of the License, or
  2049. * (at your option) any later version.
  2050. #
  2051. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2052. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2053. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2054. * GNU Affero General Public License for more details.
  2055. #
  2056. * You should have received a copy of the GNU Affero General Public License
  2057. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2058. */
  2059. (function() {
  2060. 'use strict';
  2061. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2062. hasProp = {}.hasOwnProperty;
  2063. dka.HelpButtonFever = (function(superClass) {
  2064. extend(HelpButtonFever, superClass);
  2065. function HelpButtonFever(level, ui) {
  2066. HelpButtonFever.__super__.constructor.call(this, 'thermometerButton', dka.academy.assetManager.getAsset('feverBP'), level, ui);
  2067. this.set({
  2068. x: this.ui.buttonsPositions[1],
  2069. _full: level.settings.getLabsSetting('fever', 'reloadTime')
  2070. });
  2071. this.on('mouseover', function() {
  2072. return this.level.addToolTip(this, {
  2073. title: 'Fever',
  2074. description: "Fever is a significant rise of body temperature. It helps you by stopping diseases.\n\nShortcut: t"
  2075. });
  2076. });
  2077. }
  2078. HelpButtonFever.prototype.doAction = function(keyboardTriggered) {
  2079. var feverHalo, halo;
  2080. if (!this.ready) {
  2081. return;
  2082. }
  2083. this.level.dispatchEvent(new createjs.Event(this.level.FEVER_CLICKED_EVENT, true, false));
  2084. this.unload();
  2085. this.level.moveDiseases = false;
  2086. feverHalo = this.level.ui.addChildAt(new createjs.Bitmap(dka.academy.assetManager.getAsset('feverHalo')), 0).set({
  2087. alpha: 0.7,
  2088. name: 'feverHalo'
  2089. });
  2090. halo = this.level.ui.getChildByName('feverHalo');
  2091. return createjs.Tween.get(halo, {
  2092. useTicks: true
  2093. }).wait(this.level.settings.getLabsSetting('fever', 'duration')).to({
  2094. alpha: 0
  2095. }, 30).call((function(_this) {
  2096. return function() {
  2097. _this.level.moveDiseases = true;
  2098. return halo.parent.removeChild(halo);
  2099. };
  2100. })(this));
  2101. };
  2102. return HelpButtonFever;
  2103. })(dka.HelpButton);
  2104. }).call(this);
  2105. /*
  2106. * Copyright © Romain Fouquet, 2012-2015
  2107. * Copyright © Clément Joly, 2012-2015
  2108. #
  2109. * romain.fouquet18@gmail.com
  2110. * leowzukw@vmail.me
  2111. #
  2112. * This file is part of Diseases Killer Academy.
  2113. #
  2114. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2115. * it under the terms of the GNU Affero General Public License as published by
  2116. * the Free Software Foundation, either version 3 of the License, or
  2117. * (at your option) any later version.
  2118. #
  2119. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2120. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2121. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2122. * GNU Affero General Public License for more details.
  2123. #
  2124. * You should have received a copy of the GNU Affero General Public License
  2125. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2126. */
  2127. (function() {
  2128. 'use strict';
  2129. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2130. hasProp = {}.hasOwnProperty;
  2131. dka.HelpButtonsHolder = (function(superClass) {
  2132. extend(HelpButtonsHolder, superClass);
  2133. function HelpButtonsHolder(level, ui) {
  2134. HelpButtonsHolder.__super__.constructor.call(this);
  2135. this.level = level;
  2136. this.ui = ui;
  2137. this.vaccineButton = new dka.HelpButtonVaccine(level, ui);
  2138. this.feverButton = new dka.HelpButtonFever(level, ui);
  2139. this.addChild(this.vaccineButton);
  2140. this.addChild(this.feverButton);
  2141. }
  2142. HelpButtonsHolder.prototype.allow = function() {
  2143. this.vaccineButton.allow();
  2144. return this.feverButton.allow();
  2145. };
  2146. HelpButtonsHolder.prototype.advanceLoading = function(time) {
  2147. this.vaccineButton.advanceLoading(time);
  2148. return this.feverButton.advanceLoading(time);
  2149. };
  2150. return HelpButtonsHolder;
  2151. })(createjs.Container);
  2152. }).call(this);
  2153. /*
  2154. * Copyright © Romain Fouquet, 2012-2015
  2155. * Copyright © Clément Joly, 2012-2015
  2156. #
  2157. * romain.fouquet18@gmail.com
  2158. * leowzukw@vmail.me
  2159. #
  2160. * This file is part of Diseases Killer Academy.
  2161. #
  2162. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2163. * it under the terms of the GNU Affero General Public License as published by
  2164. * the Free Software Foundation, either version 3 of the License, or
  2165. * (at your option) any later version.
  2166. #
  2167. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2168. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2169. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2170. * GNU Affero General Public License for more details.
  2171. #
  2172. * You should have received a copy of the GNU Affero General Public License
  2173. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2174. */
  2175. (function() {
  2176. 'use strict';
  2177. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2178. hasProp = {}.hasOwnProperty;
  2179. dka.GraduationHat = (function(superClass) {
  2180. extend(GraduationHat, superClass);
  2181. function GraduationHat(position, gradeRatio) {
  2182. var riseDuration, targetHeight;
  2183. GraduationHat.__super__.constructor.call(this, dka.academy.assetManager.getAsset('gradhat'));
  2184. targetHeight = canvasHeight / 5 + Math.random() * canvasHeight / 4;
  2185. riseDuration = 20;
  2186. this.set({
  2187. x: position + Math.random() * 10,
  2188. y: canvasHeight + 64,
  2189. regX: 80 / 2,
  2190. regY: 80 / 2
  2191. });
  2192. createjs.Tween.get(this, {
  2193. useTicks: true
  2194. }).to({
  2195. y: targetHeight
  2196. }, riseDuration, createjs.Ease.sineOut).to({
  2197. y: canvasHeight + 64
  2198. }, riseDuration, createjs.Ease.sineIn);
  2199. createjs.Tween.get(this, {
  2200. useTicks: true
  2201. }).to({
  2202. rotation: Math.random() * 180 + 180
  2203. }, riseDuration * 2, createjs.Ease.sineIn);
  2204. }
  2205. return GraduationHat;
  2206. })(createjs.Bitmap);
  2207. }).call(this);
  2208. /*
  2209. * Copyright © Romain Fouquet, 2012-2015
  2210. * Copyright © Clément Joly, 2012-2015
  2211. #
  2212. * romain.fouquet18@gmail.com
  2213. * leowzukw@vmail.me
  2214. #
  2215. * This file is part of Diseases Killer Academy.
  2216. #
  2217. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2218. * it under the terms of the GNU Affero General Public License as published by
  2219. * the Free Software Foundation, either version 3 of the License, or
  2220. * (at your option) any later version.
  2221. #
  2222. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2223. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2224. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2225. * GNU Affero General Public License for more details.
  2226. #
  2227. * You should have received a copy of the GNU Affero General Public License
  2228. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2229. */
  2230. (function() {
  2231. 'use strict';
  2232. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2233. hasProp = {}.hasOwnProperty;
  2234. dka.Screen = (function(superClass) {
  2235. extend(Screen, superClass);
  2236. function Screen(darkBackground, visible) {
  2237. if (visible == null) {
  2238. visible = false;
  2239. }
  2240. Screen.__super__.constructor.call(this);
  2241. this.visible = visible;
  2242. if (darkBackground) {
  2243. this.addDarkBackground();
  2244. }
  2245. }
  2246. Screen.prototype.addDarkBackground = function() {
  2247. var darkBackground;
  2248. darkBackground = new createjs.Shape();
  2249. darkBackground.graphics.beginFill('#000').drawRect(0, 0, canvasWidth, canvasHeight);
  2250. darkBackground.alpha = 0.5;
  2251. return this.addChild(darkBackground);
  2252. };
  2253. Screen.prototype.show = function() {
  2254. return this.visible = true;
  2255. };
  2256. Screen.prototype.hide = function() {
  2257. return this.visible = false;
  2258. };
  2259. return Screen;
  2260. })(createjs.Container);
  2261. }).call(this);
  2262. /*
  2263. * Copyright © Romain Fouquet, 2012-2015
  2264. * Copyright © Clément Joly, 2012-2015
  2265. #
  2266. * romain.fouquet18@gmail.com
  2267. * leowzukw@vmail.me
  2268. #
  2269. * This file is part of Diseases Killer Academy.
  2270. #
  2271. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2272. * it under the terms of the GNU Affero General Public License as published by
  2273. * the Free Software Foundation, either version 3 of the License, or
  2274. * (at your option) any later version.
  2275. #
  2276. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2277. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2278. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2279. * GNU Affero General Public License for more details.
  2280. #
  2281. * You should have received a copy of the GNU Affero General Public License
  2282. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2283. */
  2284. (function() {
  2285. 'use strict';
  2286. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2287. hasProp = {}.hasOwnProperty;
  2288. dka.ScreenStart = (function(superClass) {
  2289. extend(ScreenStart, superClass);
  2290. function ScreenStart() {
  2291. var bpStart, seal;
  2292. ScreenStart.__super__.constructor.call(this, false, true);
  2293. seal = new createjs.Bitmap(dka.academy.assetManager.getAsset('menuStartBg'));
  2294. seal.y = -400;
  2295. this.addChild(seal);
  2296. createjs.Tween.get(seal, {
  2297. useTicks: true
  2298. }).to({
  2299. y: 0
  2300. }, 50, createjs.Ease.elasticOut);
  2301. bpStart = new dka.MenuButton(canvasWidth / 2, canvasHeight + 167 / 2, new createjs.Bitmap(dka.academy.assetManager.getAsset('bpStart')));
  2302. this.addChild(bpStart);
  2303. createjs.Tween.get(bpStart, {
  2304. useTicks: true
  2305. }).wait(30).to({
  2306. y: 499
  2307. }, 50, createjs.Ease.elasticOut);
  2308. bpStart.on('click', (function(_this) {
  2309. return function() {
  2310. createjs.Tween.get(_this.getChildAt(0), {
  2311. useTicks: true
  2312. }).wait(5).to({
  2313. y: -canvasHeight
  2314. }, 15, createjs.Ease.sineOut);
  2315. return createjs.Tween.get(bpStart, {
  2316. useTicks: true,
  2317. override: true
  2318. }).to({
  2319. y: canvasHeight + 167 / 2
  2320. }, 15, createjs.Ease.sineOut).wait(5).call(function() {
  2321. return dka.academy.showFEL();
  2322. });
  2323. };
  2324. })(this));
  2325. }
  2326. return ScreenStart;
  2327. })(dka.Screen);
  2328. }).call(this);
  2329. /*
  2330. * Copyright © Romain Fouquet, 2012-2014
  2331. * Copyright © Clément Joly, 2012-2014
  2332. *
  2333. * romain.fouquet18@gmail.com
  2334. * leowzukw@vmail.me
  2335. *
  2336. * This file is part of Diseases Killer Academy.
  2337. *
  2338. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2339. * it under the terms of the GNU Affero General Public License as published by
  2340. * the Free Software Foundation, either version 3 of the License, or
  2341. * (at your option) any later version.
  2342. *
  2343. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2344. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2345. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2346. * GNU Affero General Public License for more details.
  2347. *
  2348. * You should have received a copy of the GNU Affero General Public License
  2349. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2350. */
  2351. (function() {
  2352. (function() {
  2353. 'use strict';
  2354. var Screens, s;
  2355. Screens = function() {
  2356. throw new Error('Screens cannot be instantiated.');
  2357. };
  2358. s = Screens;
  2359. s.firstStart = function() {
  2360. var StartButton, bpstart, rectWhite;
  2361. rectWhite = gameStage.addChild(new createjs.Shape());
  2362. rectWhite.graphics.beginFill('rgba(247,247,247,0.1)').rect(0, 0, canvasWidth, canvasHeight);
  2363. StartButton = gameStage.addChild((new createjs.Sprite(dka.academy.assetManager.getAsset('spriteStartButton'))).set({
  2364. x: canvasWidth / 2,
  2365. y: canvasHeight + 32,
  2366. scaleX: 0.25,
  2367. scaleY: 0.25,
  2368. alpha: 0.3
  2369. }));
  2370. bpstart = new createjs.ButtonHelper(StartButton);
  2371. StartButton.on('mouseover', function() {
  2372. gameStage.uncache();
  2373. });
  2374. StartButton.on('click', function() {
  2375. gameStage.uncache();
  2376. createjs.Tween.get(this, {
  2377. useTicks: true
  2378. }).wait(3).to({
  2379. y: -100,
  2380. scaleX: 0.5,
  2381. scaleY: 0.5,
  2382. alpha: 0.3
  2383. }, 15, createjs.Ease.bounceOut).call(function() {
  2384. gameStage.removeAllChildren();
  2385. dka.Screens.team();
  2386. });
  2387. });
  2388. createjs.Tween.get(StartButton, {
  2389. useTicks: true
  2390. }).wait(9).to({
  2391. scaleX: 0.5,
  2392. scaleY: 0.5,
  2393. y: canvasHeight / 2,
  2394. alpha: 1
  2395. }, 45, createjs.Ease.bounceOut).call(function() {
  2396. gameStage.cache(0, 0, canvasWidth, canvasHeight);
  2397. });
  2398. };
  2399. s.team = function() {
  2400. var logoMakers, txtTeamName;
  2401. txtTeamName = gameStage.addChild(new createjs.Text('Free Electrons\n\nLabs', 'bold 24px karnivoreRegular, Arial', '#FFFFFF')).set({
  2402. x: canvasWidth / 2 + 128,
  2403. y: canvasHeight / 2 - 32,
  2404. textAlign: 'center',
  2405. alpha: 0,
  2406. textBaseline: 'alphabetic'
  2407. });
  2408. logoMakers = gameStage.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('LogoTeam1'))).set({
  2409. x: canvasWidth / 2 - 188,
  2410. y: canvasHeight / 2,
  2411. regX: 80,
  2412. regY: 120,
  2413. scaleX: 0,
  2414. scaleY: 0,
  2415. alpha: 0
  2416. });
  2417. createjs.Tween.get(logoMakers, {
  2418. useTicks: true
  2419. }).wait(3).to({
  2420. scaleX: 1,
  2421. scaleY: 1,
  2422. alpha: 1
  2423. }, 12);
  2424. createjs.Tween.get(txtTeamName, {
  2425. useTicks: true
  2426. }).wait(30).to({
  2427. scaleX: 1.5,
  2428. scaleY: 1.5,
  2429. alpha: 1
  2430. }, 12).call(function() {
  2431. createjs.Tween.get(txtTeamName, {
  2432. useTicks: true
  2433. }).wait(15).to({
  2434. alpha: 0.3
  2435. }, 12).call(function() {
  2436. createjs.Tween.get(txtTeamName, {
  2437. useTicks: true
  2438. }).wait(3).to({
  2439. alpha: 1
  2440. }, 12).call(function() {
  2441. createjs.Tween.get(txtTeamName, {
  2442. useTicks: true
  2443. }).wait(21).to({
  2444. y: -100,
  2445. scaleX: 0.5,
  2446. scaleY: 0.5,
  2447. alpha: 0.3
  2448. }, 15, createjs.Ease.bounceOut).call(function() {
  2449. gameStage.removeAllChildren();
  2450. dka.Screens.levels();
  2451. });
  2452. });
  2453. });
  2454. });
  2455. };
  2456. s.levels = function() {
  2457. var creditsButton, credits_start, realStartButton, real_button_start, txtTitle;
  2458. gameStage.removeAllChildren();
  2459. gameStage.visible = true;
  2460. txtTitle = new createjs.Text('Diseases Killer Academy', 'bold 24px karnivoreRegular, Arial', '#FFF0F0');
  2461. txtTitle.textAlign = 'center';
  2462. txtTitle.x = canvasWidth / 2;
  2463. txtTitle.y = 0;
  2464. txtTitle.alpha = 0;
  2465. gameStage.addChild(txtTitle);
  2466. realStartButton = new createjs.Sprite(dka.academy.assetManager.getAsset('spriteStartButton'));
  2467. realStartButton.x = canvasWidth / 2;
  2468. realStartButton.y = -32;
  2469. realStartButton.scaleX = realStartButton.scaleY = 0.25;
  2470. realStartButton.alpha = 0.3;
  2471. gameStage.addChild(realStartButton);
  2472. real_button_start = new createjs.ButtonHelper(realStartButton);
  2473. creditsButton = new createjs.Sprite(dka.academy.assetManager.getAsset('spriteCreditsButton'));
  2474. creditsButton.x = canvasWidth / 2;
  2475. creditsButton.y = -32;
  2476. creditsButton.scaleX = realStartButton.scaleY = 0;
  2477. gameStage.addChild(creditsButton);
  2478. credits_start = new createjs.ButtonHelper(creditsButton);
  2479. createjs.Tween.get(txtTitle, {
  2480. useTicks: true
  2481. }).to({
  2482. x: canvasWidth / 2,
  2483. y: 96,
  2484. scaleX: 1.5,
  2485. scaleY: 1.5,
  2486. alpha: 1
  2487. }, 21, createjs.Ease.bounceOut).call(function() {
  2488. createjs.Tween.get(realStartButton, {
  2489. useTicks: true
  2490. }).to({
  2491. y: canvasHeight / 2,
  2492. scaleX: 1,
  2493. scaleY: 1,
  2494. alpha: 1
  2495. }, 21, createjs.Ease.bounceOut);
  2496. createjs.Tween.get(creditsButton, {
  2497. useTicks: true
  2498. }).to({
  2499. y: canvasHeight / 2 + 128,
  2500. scaleX: 1,
  2501. scaleY: 1,
  2502. alpha: 1
  2503. }, 21, createjs.Ease.bounceOut);
  2504. });
  2505. realStartButton.addEventListener('click', function() {
  2506. createjs.Tween.get(creditsButton, {
  2507. useTicks: true
  2508. }).wait(3).to({
  2509. y: -100,
  2510. scaleX: 0.5,
  2511. scaleY: 0.5,
  2512. alpha: 0.3
  2513. }, 15, createjs.Ease.bounceOut);
  2514. createjs.Tween.get(realStartButton, {
  2515. useTicks: true
  2516. }).wait(3).to({
  2517. y: -100,
  2518. scaleX: 0.5,
  2519. scaleY: 0.5,
  2520. alpha: 0.3
  2521. }, 15, createjs.Ease.bounceOut).call(function() {
  2522. gameStage.removeAllChildren();
  2523. gameStage.visible = false;
  2524. });
  2525. });
  2526. creditsButton.addEventListener('click', function() {
  2527. createjs.Tween.get(creditsButton, {
  2528. useTicks: true
  2529. }).wait(3).to({
  2530. x: -100
  2531. }, 15, createjs.Ease.bounceOut);
  2532. createjs.Tween.get(txtTitle, {
  2533. useTicks: true
  2534. }).wait(3).to({
  2535. y: -100
  2536. }, 15, createjs.Ease.bounceOut);
  2537. createjs.Tween.get(realStartButton, {
  2538. useTicks: true
  2539. }).wait(3).to({
  2540. x: canvasWidth + 100
  2541. }, 15, createjs.Ease.bounceOut).call(function() {
  2542. gameStage.removeAllChildren();
  2543. gameStage.visible = false;
  2544. dka.Screens.credits();
  2545. });
  2546. });
  2547. };
  2548. s.credits = function() {
  2549. var txtCredits;
  2550. txtCredits = gameStage.addChild(new createjs.Text('Development team\n\n\n\nProgrammers\n\nRomain Fouquet\n\nClément Joly\n\n\n\nGraphist\n\nClément Dumur\n\n\n\nTester (this job is really fun !)\n\nMatthieu Lombard\n\n\n\nPlease visit our site :\n\nlemeilleursitedumonde.quelquechose', 'bold 24px karnivoreRegular, Arial', '#FFFFFF')).set({
  2551. x: canvasWidth / 2,
  2552. y: canvasHeight,
  2553. textAlign: 'center'
  2554. });
  2555. createjs.Tween.get(txtCredits, {
  2556. useTicks: true
  2557. }).to({
  2558. y: -530
  2559. }, 700, createjs.Ease.linear).wait(15).call(function() {
  2560. gameStage.removeAllChildren();
  2561. dka.Screens.levels();
  2562. });
  2563. };
  2564. dka.Screens = Screens;
  2565. })();
  2566. }).call(this);
  2567. /*
  2568. * Copyright © Romain Fouquet, 2012-2015
  2569. * Copyright © Clément Joly, 2012-2015
  2570. #
  2571. * romain.fouquet18@gmail.com
  2572. * leowzukw@vmail.me
  2573. #
  2574. * This file is part of Diseases Killer Academy.
  2575. #
  2576. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2577. * it under the terms of the GNU Affero General Public License as published by
  2578. * the Free Software Foundation, either version 3 of the License, or
  2579. * (at your option) any later version.
  2580. #
  2581. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2582. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2583. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2584. * GNU Affero General Public License for more details.
  2585. #
  2586. * You should have received a copy of the GNU Affero General Public License
  2587. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2588. */
  2589. (function() {
  2590. 'use strict';
  2591. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2592. hasProp = {}.hasOwnProperty;
  2593. dka.ScreenFEL = (function(superClass) {
  2594. extend(ScreenFEL, superClass);
  2595. function ScreenFEL() {
  2596. var electron, i, j;
  2597. ScreenFEL.__super__.constructor.call(this, false, true);
  2598. this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('felSplash')));
  2599. this.electrons = [];
  2600. for (i = j = 0; j < 3; i = ++j) {
  2601. electron = new createjs.Bitmap(dka.academy.assetManager.getAsset('electron'));
  2602. electron.set({
  2603. x: 330,
  2604. y: 120,
  2605. regX: 36 / 2,
  2606. regY: 36 / 2
  2607. });
  2608. this.electrons.push(this.addChild(electron));
  2609. }
  2610. createjs.Tween.get(this.electrons[0], {
  2611. useTicks: true
  2612. }).to({
  2613. guide: {
  2614. path: [330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220]
  2615. }
  2616. }, 2.5 * 30).to({
  2617. guide: {
  2618. path: [540, 220, 460, 16, 100, -36]
  2619. }
  2620. }, 0.5 * 30);
  2621. createjs.Tween.get(this.electrons[1], {
  2622. useTicks: true
  2623. }).to({
  2624. guide: {
  2625. start: 1 / 3,
  2626. path: [330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220]
  2627. }
  2628. }, 2.5 * 30).to({
  2629. guide: {
  2630. path: [330, 220, 300, 300, 340, 550 + 36]
  2631. }
  2632. }, 0.5 * 30);
  2633. createjs.Tween.get(this.electrons[2], {
  2634. useTicks: true
  2635. }).to({
  2636. guide: {
  2637. start: 2 / 3,
  2638. path: [330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220, 330, 320, 435, 320, 540, 320, 540, 220, 540, 120, 435, 120, 330, 120, 330, 220]
  2639. }
  2640. }, 2.2 * 30).to({
  2641. guide: {
  2642. path: [330, 220, 380, 420, 800, 550 + 36]
  2643. }
  2644. }, 0.5 * 30).wait(20).call(function() {
  2645. return dka.academy.launchGame();
  2646. });
  2647. }
  2648. return ScreenFEL;
  2649. })(dka.Screen);
  2650. }).call(this);
  2651. /*
  2652. * Copyright © Romain Fouquet, 2012-2015
  2653. * Copyright © Clément Joly, 2012-2015
  2654. #
  2655. * romain.fouquet18@gmail.com
  2656. * leowzukw@vmail.me
  2657. #
  2658. * This file is part of Diseases Killer Academy.
  2659. #
  2660. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2661. * it under the terms of the GNU Affero General Public License as published by
  2662. * the Free Software Foundation, either version 3 of the License, or
  2663. * (at your option) any later version.
  2664. #
  2665. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2666. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2667. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2668. * GNU Affero General Public License for more details.
  2669. #
  2670. * You should have received a copy of the GNU Affero General Public License
  2671. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2672. */
  2673. (function() {
  2674. 'use strict';
  2675. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2676. hasProp = {}.hasOwnProperty;
  2677. dka.EncyclopediaItem = (function(superClass) {
  2678. extend(EncyclopediaItem, superClass);
  2679. function EncyclopediaItem(x, y, disease, sideView) {
  2680. this.disease = disease;
  2681. this.sideView = sideView;
  2682. if (disease === 'Unknown') {
  2683. EncyclopediaItem.__super__.constructor.call(this, dka.academy.assetManager.getAsset('sMysterious'));
  2684. } else {
  2685. EncyclopediaItem.__super__.constructor.call(this, dka.academy.assetManager.getAsset('s' + disease));
  2686. }
  2687. this.set({
  2688. x: x,
  2689. y: y,
  2690. cursor: 'pointer'
  2691. });
  2692. this.on('mouseover', this.hover);
  2693. this.on('mouseout', this.removeAllFilters);
  2694. this.cache(-16, -16, 32, 32);
  2695. }
  2696. EncyclopediaItem.prototype.hover = function() {
  2697. this.lighten();
  2698. return this.sideView.show(this.disease);
  2699. };
  2700. EncyclopediaItem.prototype.lighten = function() {
  2701. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
  2702. return this.updateCache();
  2703. };
  2704. EncyclopediaItem.prototype.removeAllFilters = function() {
  2705. this.filters = [];
  2706. return this.updateCache();
  2707. };
  2708. return EncyclopediaItem;
  2709. })(createjs.Sprite);
  2710. }).call(this);
  2711. /*
  2712. * Copyright © Romain Fouquet, 2012-2015
  2713. * Copyright © Clément Joly, 2012-2015
  2714. #
  2715. * romain.fouquet18@gmail.com
  2716. * leowzukw@vmail.me
  2717. #
  2718. * This file is part of Diseases Killer Academy.
  2719. #
  2720. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2721. * it under the terms of the GNU Affero General Public License as published by
  2722. * the Free Software Foundation, either version 3 of the License, or
  2723. * (at your option) any later version.
  2724. #
  2725. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2726. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2727. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2728. * GNU Affero General Public License for more details.
  2729. #
  2730. * You should have received a copy of the GNU Affero General Public License
  2731. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2732. */
  2733. (function() {
  2734. 'use strict';
  2735. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2736. hasProp = {}.hasOwnProperty;
  2737. dka.EncyclopediaSideView = (function(superClass) {
  2738. extend(EncyclopediaSideView, superClass);
  2739. function EncyclopediaSideView(x, y, level) {
  2740. var lifeCostIco, lifeIco, speedIco;
  2741. EncyclopediaSideView.__super__.constructor.call(this);
  2742. this.level = level;
  2743. this.set({
  2744. x: x,
  2745. y: y
  2746. });
  2747. this.diseaseImage = new createjs.Sprite(dka.academy.assetManager.getAsset('sMysterious'));
  2748. this.diseaseImage.set({
  2749. x: 64
  2750. });
  2751. this.addChild(this.diseaseImage);
  2752. this.diseaseLabel = new createjs.Text('Point a disease...', '18px karnivoreRegular, Arial', dka.colors.lightBlue);
  2753. this.diseaseLabel.set({
  2754. x: 64,
  2755. y: 80,
  2756. textAlign: 'center',
  2757. textBaseline: 'alphabetic'
  2758. });
  2759. this.addChild(this.diseaseLabel);
  2760. this.typeBar = new createjs.Bitmap(dka.academy.assetManager.getAsset('bacteriaBar'));
  2761. this.typeBar.set({
  2762. x: -33,
  2763. y: 100,
  2764. visible: false
  2765. });
  2766. this.addChild(this.typeBar);
  2767. console.log(this.typeBar);
  2768. lifeIco = new createjs.Bitmap(dka.academy.assetManager.getAsset('lifeIco'));
  2769. lifeIco.set({
  2770. x: 10,
  2771. y: 150
  2772. });
  2773. this.addChild(lifeIco);
  2774. lifeIco.on('mouseover', (function(_this) {
  2775. return function() {
  2776. return _this.level.addToolTip(lifeIco, {
  2777. title: 'Life',
  2778. description: 'Damage the disease can take before dying'
  2779. });
  2780. };
  2781. })(this));
  2782. lifeIco.on('mouseout', (function(_this) {
  2783. return function() {
  2784. return _this.level.removeToolTip();
  2785. };
  2786. })(this));
  2787. this.lifeText = new createjs.Text('???', '18px karnivoreRegular, Arial', dka.colors.lightBlue);
  2788. this.lifeText.set({
  2789. x: 50,
  2790. y: 168,
  2791. textAlign: 'left',
  2792. textBaseline: 'alphabetic'
  2793. });
  2794. this.addChild(this.lifeText);
  2795. speedIco = new createjs.Bitmap(dka.academy.assetManager.getAsset('speedIco'));
  2796. speedIco.set({
  2797. x: 10,
  2798. y: 200
  2799. });
  2800. this.addChild(speedIco);
  2801. speedIco.on('mouseover', (function(_this) {
  2802. return function() {
  2803. return _this.level.addToolTip(speedIco, {
  2804. title: 'Speed',
  2805. description: 'Speed at which the disease moves'
  2806. });
  2807. };
  2808. })(this));
  2809. speedIco.on('mouseout', (function(_this) {
  2810. return function() {
  2811. return _this.level.removeToolTip();
  2812. };
  2813. })(this));
  2814. this.speedText = new createjs.Text('???', '18px karnivoreRegular, Arial', dka.colors.lightBlue);
  2815. this.speedText.set({
  2816. x: 50,
  2817. y: 218,
  2818. textAlign: 'left',
  2819. textBaseline: 'alphabetic'
  2820. });
  2821. this.addChild(this.speedText);
  2822. lifeCostIco = new createjs.Bitmap(dka.academy.assetManager.getAsset('lifeCostIco'));
  2823. lifeCostIco.set({
  2824. x: 10,
  2825. y: 250
  2826. });
  2827. this.addChild(lifeCostIco);
  2828. lifeCostIco.on('mouseover', (function(_this) {
  2829. return function() {
  2830. return _this.level.addToolTip(lifeCostIco, {
  2831. title: 'Cost',
  2832. description: 'Number of lives you will lose if this disease pass through your defense'
  2833. });
  2834. };
  2835. })(this));
  2836. lifeCostIco.on('mouseout', (function(_this) {
  2837. return function() {
  2838. return _this.level.removeToolTip();
  2839. };
  2840. })(this));
  2841. this.lifeCostText = new createjs.Text('???', '18px karnivoreRegular, Arial', dka.colors.lightBlue);
  2842. this.lifeCostText.set({
  2843. x: 50,
  2844. y: 268,
  2845. textAlign: 'left',
  2846. textBaseline: 'alphabetic'
  2847. });
  2848. this.addChild(this.lifeCostText);
  2849. }
  2850. EncyclopediaSideView.prototype.show = function(diseaseName) {
  2851. var diseaseSettings, typeBar;
  2852. if (diseaseName === 'Unknown') {
  2853. this.diseaseImage.spriteSheet = dka.academy.assetManager.getAsset('sMysterious');
  2854. this.diseaseLabel.text = diseaseName;
  2855. this.typeBar.visible = false;
  2856. this.lifeText.text = '???';
  2857. this.speedText.text = '???';
  2858. this.lifeCostText.text = '???';
  2859. return;
  2860. }
  2861. this.diseaseImage.spriteSheet = dka.academy.assetManager.getAsset('s' + diseaseName);
  2862. this.diseaseLabel.text = diseaseName;
  2863. this.typeBar.visible = true;
  2864. diseaseSettings = this.level.settings.diseases[diseaseName];
  2865. typeBar = (function() {
  2866. switch (diseaseSettings.type) {
  2867. case 'Bacterium':
  2868. return 'bacteriumBar';
  2869. case 'Virus':
  2870. return 'virusBar';
  2871. }
  2872. })();
  2873. this.typeBar.image = dka.academy.assetManager.getAsset(typeBar);
  2874. this.lifeText.text = diseaseSettings.life;
  2875. this.speedText.text = this.level.settings.getDiseaseSpeedString(diseaseSettings.speed);
  2876. return this.lifeCostText.text = diseaseSettings.lifeCost;
  2877. };
  2878. return EncyclopediaSideView;
  2879. })(createjs.Container);
  2880. }).call(this);
  2881. /*
  2882. * Copyright © Romain Fouquet, 2012-2015
  2883. * Copyright © Clément Joly, 2012-2015
  2884. #
  2885. * romain.fouquet18@gmail.com
  2886. * leowzukw@vmail.me
  2887. #
  2888. * This file is part of Diseases Killer Academy.
  2889. #
  2890. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2891. * it under the terms of the GNU Affero General Public License as published by
  2892. * the Free Software Foundation, either version 3 of the License, or
  2893. * (at your option) any later version.
  2894. #
  2895. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2896. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2897. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2898. * GNU Affero General Public License for more details.
  2899. #
  2900. * You should have received a copy of the GNU Affero General Public License
  2901. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2902. */
  2903. (function() {
  2904. 'use strict';
  2905. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2906. hasProp = {}.hasOwnProperty;
  2907. dka.ScreenEncyclopedia = (function(superClass) {
  2908. extend(ScreenEncyclopedia, superClass);
  2909. function ScreenEncyclopedia(ui) {
  2910. ScreenEncyclopedia.__super__.constructor.call(this);
  2911. this.ui = ui;
  2912. this.visible = false;
  2913. }
  2914. ScreenEncyclopedia.prototype.build = function() {
  2915. var backPause, d, diseaseName, i, j, k, ref, results;
  2916. this.addDarkBackground();
  2917. backPause = new createjs.Bitmap(dka.academy.assetManager.getAsset('encyclopediaBk')).set({
  2918. x: canvasWidth / 2,
  2919. y: canvasHeight / 2 - 16,
  2920. regX: 600 / 2,
  2921. regY: 475 / 2
  2922. });
  2923. this.addChild(backPause);
  2924. this.getChildAt(0).on('click', (function(_this) {
  2925. return function() {
  2926. _this.hide();
  2927. return _this.ui.easyPause('resume', false);
  2928. };
  2929. })(this));
  2930. this.items = new createjs.Container();
  2931. this.addChild(this.items);
  2932. this.sideView = new dka.EncyclopediaSideView(530, 120, this.ui.level);
  2933. this.addChild(this.sideView);
  2934. d = 0;
  2935. results = [];
  2936. for (i = k = 120, ref = 120 + 60 * 5; k <= ref; i = k += 60) {
  2937. results.push((function() {
  2938. var l, ref1, results1;
  2939. results1 = [];
  2940. for (j = l = 200, ref1 = 200 + 50 * 5; l <= ref1; j = l += 50) {
  2941. diseaseName = this.ui.level.settings.diseasesList[d];
  2942. if (this.ui.level.game.knownDiseases.indexOf(diseaseName) === -1) {
  2943. diseaseName = 'Unknown';
  2944. }
  2945. this.items.addChild(new dka.EncyclopediaItem(j, i, diseaseName, this.sideView));
  2946. results1.push(d++);
  2947. }
  2948. return results1;
  2949. }).call(this));
  2950. }
  2951. return results;
  2952. };
  2953. ScreenEncyclopedia.prototype.hide = function() {
  2954. ScreenEncyclopedia.__super__.hide.call(this);
  2955. return dka.academy.removeStageTicker();
  2956. };
  2957. ScreenEncyclopedia.prototype.show = function() {
  2958. ScreenEncyclopedia.__super__.show.call(this);
  2959. this.removeAllChildren();
  2960. this.build();
  2961. return dka.academy.addStageTicker();
  2962. };
  2963. return ScreenEncyclopedia;
  2964. })(dka.Screen);
  2965. }).call(this);
  2966. /*
  2967. * Copyright © Romain Fouquet, 2012-2015
  2968. * Copyright © Clément Joly, 2012-2015
  2969. #
  2970. * romain.fouquet18@gmail.com
  2971. * leowzukw@vmail.me
  2972. #
  2973. * This file is part of Diseases Killer Academy.
  2974. #
  2975. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  2976. * it under the terms of the GNU Affero General Public License as published by
  2977. * the Free Software Foundation, either version 3 of the License, or
  2978. * (at your option) any later version.
  2979. #
  2980. * Diseases Killer Academy is distributed in the hope that it will be useful,
  2981. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2982. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2983. * GNU Affero General Public License for more details.
  2984. #
  2985. * You should have received a copy of the GNU Affero General Public License
  2986. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  2987. */
  2988. (function() {
  2989. 'use strict';
  2990. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  2991. hasProp = {}.hasOwnProperty;
  2992. dka.PauseButtonHolder = (function(superClass) {
  2993. extend(PauseButtonHolder, superClass);
  2994. function PauseButtonHolder(screenPause) {
  2995. var levelsButton, retryButton, settingsButton;
  2996. PauseButtonHolder.__super__.constructor.call(this);
  2997. this.screenPause = screenPause;
  2998. this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('pauseButtonHolder')));
  2999. this.set({
  3000. x: canvasWidth / 2,
  3001. y: 0,
  3002. regX: 304 / 2
  3003. });
  3004. retryButton = new dka.Button(304 / 2 - 70, null, new createjs.Bitmap(dka.academy.assetManager.getAsset('RetryPauseBP')));
  3005. retryButton.on('click', function() {
  3006. this.parent.screenPause.ui.easyPause('resume', false);
  3007. dka.academy.addStageTicker();
  3008. return dka.academy.game.launchLevel(dka.academy.game.currentLevel.level);
  3009. });
  3010. settingsButton = new dka.Button(304 / 2, null, new createjs.Bitmap(dka.academy.assetManager.getAsset('SettingsPauseBP')));
  3011. settingsButton.on('click', function() {
  3012. this.parent.screenPause.switchToSettings();
  3013. this.parent.removeChild(settingsButton);
  3014. return gameStage.update();
  3015. });
  3016. levelsButton = new dka.Button(304 / 2 + 70, null, new createjs.Bitmap(dka.academy.assetManager.getAsset('LevelsPauseBP')));
  3017. levelsButton.on('click', function() {
  3018. this.parent.screenPause.ui.easyPause('resume', false);
  3019. dka.academy.addStageTicker();
  3020. return dka.academy.showTimeline();
  3021. });
  3022. this.addChild(retryButton, settingsButton, levelsButton);
  3023. }
  3024. return PauseButtonHolder;
  3025. })(createjs.Container);
  3026. }).call(this);
  3027. /*
  3028. * Copyright © Romain Fouquet, 2012-2015
  3029. * Copyright © Clément Joly, 2012-2015
  3030. #
  3031. * romain.fouquet18@gmail.com
  3032. * leowzukw@vmail.me
  3033. #
  3034. * This file is part of Diseases Killer Academy.
  3035. #
  3036. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3037. * it under the terms of the GNU Affero General Public License as published by
  3038. * the Free Software Foundation, either version 3 of the License, or
  3039. * (at your option) any later version.
  3040. #
  3041. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3042. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3043. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3044. * GNU Affero General Public License for more details.
  3045. #
  3046. * You should have received a copy of the GNU Affero General Public License
  3047. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3048. */
  3049. (function() {
  3050. 'use strict';
  3051. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3052. hasProp = {}.hasOwnProperty;
  3053. dka.ScreenPause = (function(superClass) {
  3054. extend(ScreenPause, superClass);
  3055. function ScreenPause(ui) {
  3056. ScreenPause.__super__.constructor.call(this);
  3057. this.ui = ui;
  3058. this.mode = 'pause';
  3059. this.build();
  3060. }
  3061. ScreenPause.prototype.build = function() {
  3062. var backPause, txtUnpause;
  3063. this.addDarkBackground();
  3064. backPause = new createjs.Bitmap(dka.academy.assetManager.getAsset('pauseBck')).set({
  3065. x: canvasWidth / 2,
  3066. y: canvasHeight / 2 - 16,
  3067. regX: 574 / 2,
  3068. regY: 120 / 2
  3069. });
  3070. txtUnpause = new createjs.Text('Click or press again to resume...', '28px karnivoreRegular, karnivoreRegular, Arial', dka.colors.lightBlue).set({
  3071. x: canvasWidth / 2,
  3072. y: canvasHeight / 2 - 4,
  3073. textAlign: 'center',
  3074. textBaseline: 'alphabetic'
  3075. });
  3076. this.txtAutopause = new createjs.Text('You can disable autopause via the options menu', '20px karnivoreRegular, karnivoreRegular, Arial', dka.colors.lightBlue).set({
  3077. x: canvasWidth / 2,
  3078. y: canvasHeight / 2 + 64,
  3079. textAlign: 'center',
  3080. textBaseline: 'alphabetic'
  3081. });
  3082. this.buttonHolder = new dka.PauseButtonHolder(this);
  3083. this.addChild(backPause, txtUnpause, this.buttonHolder);
  3084. return this.getChildAt(0).on('click', (function(_this) {
  3085. return function() {
  3086. return _this.ui.easyPause('resume', false);
  3087. };
  3088. })(this));
  3089. };
  3090. ScreenPause.prototype.addAutopauseToast = function() {
  3091. return this.addChild(this.txtAutopause);
  3092. };
  3093. ScreenPause.prototype.removeAutopauseToast = function() {
  3094. return this.removeChild(this.txtAutopause);
  3095. };
  3096. ScreenPause.prototype.switchToSettings = function() {
  3097. this.mode = 'settings';
  3098. this.removeChildAt(1);
  3099. this.removeChildAt(1);
  3100. this.removeChild(this.txtAutopause);
  3101. this.addChild(new dka.SettingsMenu(this.ui));
  3102. gameStage.uncache();
  3103. return gameStage.update();
  3104. };
  3105. ScreenPause.prototype.show = function(trigger) {
  3106. ScreenPause.__super__.show.call(this);
  3107. if (trigger === 'auto') {
  3108. return this.addAutopauseToast();
  3109. } else {
  3110. return this.removeAutopauseToast();
  3111. }
  3112. };
  3113. ScreenPause.prototype.hide = function() {
  3114. ScreenPause.__super__.hide.call(this);
  3115. if (this.mode === 'settings') {
  3116. this.removeAllChildren();
  3117. this.build();
  3118. return this.mode = 'pause';
  3119. }
  3120. };
  3121. return ScreenPause;
  3122. })(dka.Screen);
  3123. }).call(this);
  3124. /*
  3125. * Copyright © Romain Fouquet, 2012-2015
  3126. * Copyright © Clément Joly, 2012-2015
  3127. #
  3128. * romain.fouquet18@gmail.com
  3129. * leowzukw@vmail.me
  3130. #
  3131. * This file is part of Diseases Killer Academy.
  3132. #
  3133. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3134. * it under the terms of the GNU Affero General Public License as published by
  3135. * the Free Software Foundation, either version 3 of the License, or
  3136. * (at your option) any later version.
  3137. #
  3138. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3139. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3140. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3141. * GNU Affero General Public License for more details.
  3142. #
  3143. * You should have received a copy of the GNU Affero General Public License
  3144. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3145. */
  3146. (function() {
  3147. 'use strict';
  3148. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3149. hasProp = {}.hasOwnProperty;
  3150. dka.ScreenCredits = (function(superClass) {
  3151. extend(ScreenCredits, superClass);
  3152. function ScreenCredits() {
  3153. var backBP;
  3154. ScreenCredits.__super__.constructor.call(this, false, true);
  3155. this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('credits')));
  3156. backBP = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('back'));
  3157. backBP.set({
  3158. x: 100,
  3159. y: 480
  3160. });
  3161. this.addChild(backBP);
  3162. backBP.on('click', function() {
  3163. return dka.academy.showTimeline();
  3164. });
  3165. }
  3166. return ScreenCredits;
  3167. })(dka.Screen);
  3168. }).call(this);
  3169. /*
  3170. * Copyright © Romain Fouquet, 2012-2015
  3171. * Copyright © Clément Joly, 2012-2015
  3172. #
  3173. * romain.fouquet18@gmail.com
  3174. * leowzukw@vmail.me
  3175. #
  3176. * This file is part of Diseases Killer Academy.
  3177. #
  3178. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3179. * it under the terms of the GNU Affero General Public License as published by
  3180. * the Free Software Foundation, either version 3 of the License, or
  3181. * (at your option) any later version.
  3182. #
  3183. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3184. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3185. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3186. * GNU Affero General Public License for more details.
  3187. #
  3188. * You should have received a copy of the GNU Affero General Public License
  3189. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3190. */
  3191. (function() {
  3192. 'use strict';
  3193. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3194. hasProp = {}.hasOwnProperty;
  3195. dka.ScreenLabs = (function(superClass) {
  3196. extend(ScreenLabs, superClass);
  3197. function ScreenLabs(timeline) {
  3198. var backBP, resetBP, undoBP;
  3199. ScreenLabs.__super__.constructor.call(this, false, true);
  3200. this.timeline = timeline;
  3201. this.UPGRADE_BOUGHT_EVENT = 'upgradeBought';
  3202. this.RESET_EVENT = 'reset';
  3203. this.undoStack = [];
  3204. backBP = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('back'));
  3205. backBP.set({
  3206. x: 100,
  3207. y: 480
  3208. });
  3209. this.addChild(backBP);
  3210. backBP.on('click', function() {
  3211. return dka.academy.showTimeline();
  3212. });
  3213. undoBP = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('undo'));
  3214. undoBP.set({
  3215. x: 650,
  3216. y: 480
  3217. });
  3218. this.addChild(undoBP);
  3219. undoBP.on('click', (function(_this) {
  3220. return function() {
  3221. if (_this.undoStack.length === 0) {
  3222. return;
  3223. }
  3224. return _this.undo();
  3225. };
  3226. })(this));
  3227. resetBP = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('reset'));
  3228. resetBP.set({
  3229. x: 730,
  3230. y: 480
  3231. });
  3232. this.addChild(resetBP);
  3233. resetBP.on('click', (function(_this) {
  3234. return function() {
  3235. return _this.reset();
  3236. };
  3237. })(this));
  3238. this.addUpgradeButtons();
  3239. this.hintBox = new dka.HintBox();
  3240. this.addChild(this.hintBox);
  3241. }
  3242. ScreenLabs.prototype.reset = function() {
  3243. dka.academy.game.labs.reset();
  3244. this.dispatchEvent(new Event(this.RESET_EVENT));
  3245. this.timeline.updateCoinScore();
  3246. return this.undoStack = [];
  3247. };
  3248. ScreenLabs.prototype.undo = function() {
  3249. var bp;
  3250. bp = this.undoStack.pop();
  3251. dka.academy.game.labs.sell(bp.upgrade, bp.cost);
  3252. this.timeline.updateCoinScore();
  3253. bp.reset();
  3254. return this.dispatchEvent(new createjs.Event(this.RESET_EVENT));
  3255. };
  3256. ScreenLabs.prototype.addToolTip = function(target, hintData) {
  3257. this.hintBox.load(target, hintData);
  3258. return this.hintBox.visible = true;
  3259. };
  3260. ScreenLabs.prototype.removeToolTip = function() {
  3261. return this.hintBox.hide();
  3262. };
  3263. ScreenLabs.prototype.addUpgradeButton = function(bmp, position, upgrade, hint) {
  3264. var button;
  3265. button = new dka.ButtonLabs(bmp, position, upgrade, hint, this);
  3266. return this.addChild(button);
  3267. };
  3268. ScreenLabs.prototype.addUpgradeButtons = function() {
  3269. this.addUpgradeButton('waveFlag1', new createjs.Point(330, 420), 'hintNxtWave', 0);
  3270. this.addUpgradeButton('waveFlag1', new createjs.Point(330, 340), 'hintNxtWave', 1);
  3271. this.addUpgradeButton('vaccine1', new createjs.Point(410, 420), 'vaccine', 1);
  3272. this.addUpgradeButton('vaccine1', new createjs.Point(410, 340), 'vaccine', 2);
  3273. this.addUpgradeButton('fever1', new createjs.Point(490, 420), 'fever', 1);
  3274. return this.addUpgradeButton('fever1', new createjs.Point(490, 340), 'fever', 2);
  3275. };
  3276. return ScreenLabs;
  3277. })(dka.Screen);
  3278. }).call(this);
  3279. /*
  3280. * Copyright © Romain Fouquet, 2012-2015
  3281. * Copyright © Clément Joly, 2012-2015
  3282. #
  3283. * romain.fouquet18@gmail.com
  3284. * leowzukw@vmail.me
  3285. #
  3286. * This file is part of Diseases Killer Academy.
  3287. #
  3288. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3289. * it under the terms of the GNU Affero General Public License as published by
  3290. * the Free Software Foundation, either version 3 of the License, or
  3291. * (at your option) any later version.
  3292. #
  3293. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3294. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3295. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3296. * GNU Affero General Public License for more details.
  3297. #
  3298. * You should have received a copy of the GNU Affero General Public License
  3299. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3300. */
  3301. (function() {
  3302. 'use strict';
  3303. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3304. hasProp = {}.hasOwnProperty;
  3305. dka.ScreenTuto = (function(superClass) {
  3306. extend(ScreenTuto, superClass);
  3307. function ScreenTuto() {
  3308. ScreenTuto.__super__.constructor.call(this, true, true);
  3309. this.build();
  3310. }
  3311. ScreenTuto.prototype.build = function() {
  3312. var nextButton, splashTuto;
  3313. splashTuto = new createjs.Bitmap(dka.academy.assetManager.getAsset('tutoSplash1')).set({
  3314. x: canvasWidth / 2,
  3315. y: canvasHeight / 2,
  3316. regX: 620 / 2,
  3317. regY: 390 / 2
  3318. });
  3319. nextButton = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('nextButton')).set({
  3320. x: canvasWidth / 2,
  3321. y: 427,
  3322. regX: 98 / 2,
  3323. regY: 43 / 2
  3324. });
  3325. nextButton.cache(0, 0, 200, 43);
  3326. nextButton.on('click', (function(_this) {
  3327. return function() {
  3328. _this.removeChild(splashTuto, nextButton);
  3329. return _this.next1();
  3330. };
  3331. })(this));
  3332. return this.addChild(splashTuto, nextButton);
  3333. };
  3334. ScreenTuto.prototype.next1 = function() {
  3335. var nextButton, splashTuto1;
  3336. splashTuto1 = new createjs.Bitmap(dka.academy.assetManager.getAsset('tutoSplash2')).set({
  3337. x: canvasWidth / 2,
  3338. y: canvasHeight / 2,
  3339. regX: 620 / 2,
  3340. regY: 390 / 2
  3341. });
  3342. nextButton = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('nextButton')).set({
  3343. x: canvasWidth / 2,
  3344. y: 427,
  3345. regX: 98 / 2,
  3346. regY: 43 / 2
  3347. });
  3348. nextButton.cache(0, 0, 200, 43);
  3349. nextButton.on('click', (function(_this) {
  3350. return function() {
  3351. _this.removeChild(splashTuto1, nextButton);
  3352. return _this.next2();
  3353. };
  3354. })(this));
  3355. return this.addChild(splashTuto1, nextButton);
  3356. };
  3357. ScreenTuto.prototype.next2 = function() {
  3358. var closeButton, splashTuto2;
  3359. splashTuto2 = new createjs.Bitmap(dka.academy.assetManager.getAsset('tutoBg')).set({
  3360. x: canvasWidth / 2,
  3361. y: canvasHeight / 2,
  3362. regX: 740 / 2,
  3363. regY: 430 / 2,
  3364. alpha: 0.2
  3365. });
  3366. closeButton = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('closeButton')).set({
  3367. x: canvasWidth / 2,
  3368. y: 440,
  3369. regX: 200 / 2,
  3370. regY: 43 / 2,
  3371. alpha: 0.2
  3372. });
  3373. closeButton.cache(0, 0, 200, 43);
  3374. closeButton.on('click', (function(_this) {
  3375. return function() {
  3376. return _this.close();
  3377. };
  3378. })(this));
  3379. createjs.Tween.get(closeButton, {
  3380. useTicks: true
  3381. }).to({
  3382. alpha: 1
  3383. }, 5);
  3384. createjs.Tween.get(splashTuto2, {
  3385. useTicks: true
  3386. }).to({
  3387. alpha: 1
  3388. }, 5);
  3389. return this.addChild(splashTuto2, closeButton);
  3390. };
  3391. ScreenTuto.prototype.close = function() {
  3392. return createjs.Tween.get(this, {
  3393. useTicks: true
  3394. }).to({
  3395. alpha: 0
  3396. }, 5).call((function(_this) {
  3397. return function() {
  3398. dka.academy.game.currentLevel.pausable = true;
  3399. _this.parent.removeChild(_this);
  3400. return dka.academy.game.currentLevel.ui.addDecorations();
  3401. };
  3402. })(this));
  3403. };
  3404. return ScreenTuto;
  3405. })(dka.Screen);
  3406. }).call(this);
  3407. /*
  3408. * Copyright © Romain Fouquet, 2012-2015
  3409. * Copyright © Clément Joly, 2012-2015
  3410. #
  3411. * romain.fouquet18@gmail.com
  3412. * leowzukw@vmail.me
  3413. #
  3414. * This file is part of Diseases Killer Academy.
  3415. #
  3416. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3417. * it under the terms of the GNU Affero General Public License as published by
  3418. * the Free Software Foundation, either version 3 of the License, or
  3419. * (at your option) any later version.
  3420. #
  3421. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3422. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3423. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3424. * GNU Affero General Public License for more details.
  3425. #
  3426. * You should have received a copy of the GNU Affero General Public License
  3427. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3428. */
  3429. (function() {
  3430. 'use strict';
  3431. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3432. hasProp = {}.hasOwnProperty;
  3433. dka.ScreenLevelEnd = (function(superClass) {
  3434. extend(ScreenLevelEnd, superClass);
  3435. function ScreenLevelEnd(level) {
  3436. var backRect, goldRemaining, goldRemainingTxt, gradeTxt, i, len, lifeRatio, listLevelsBP, position, positions, titleTxt, tryAgainBP;
  3437. ScreenLevelEnd.__super__.constructor.call(this, true, true);
  3438. this.level = level;
  3439. backRect = new createjs.Bitmap(dka.academy.assetManager.getAsset('BaseBP1')).set({
  3440. x: canvasWidth / 2,
  3441. y: canvasHeight / 2,
  3442. regX: 180,
  3443. regY: 180
  3444. });
  3445. listLevelsBP = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('LevelsBP')).set({
  3446. x: canvasWidth / 2 + 64,
  3447. y: canvasHeight / 2 + 96,
  3448. regX: 32,
  3449. regY: 32
  3450. });
  3451. listLevelsBP.cache(0, 0, 64, 64);
  3452. listLevelsBP.on('click', function() {
  3453. return dka.academy.showTimeline();
  3454. });
  3455. tryAgainBP = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('TryAgainBP')).set({
  3456. x: canvasWidth / 2 - 64,
  3457. y: canvasHeight / 2 + 96,
  3458. regX: 32,
  3459. regY: 32
  3460. });
  3461. tryAgainBP.cache(0, 0, 64, 64);
  3462. tryAgainBP.on('click', (function(_this) {
  3463. return function() {
  3464. return dka.academy.game.launchLevel(_this.level.level);
  3465. };
  3466. })(this));
  3467. if (level.playerLives <= 0) {
  3468. titleTxt = new createjs.Text('You lose !', '24px karnivoreRegular,Arial', dka.colors.lightBlue).set({
  3469. x: canvasWidth / 2,
  3470. y: canvasHeight / 2 - 120,
  3471. textAlign: 'center',
  3472. textBaseline: 'alphabetic'
  3473. });
  3474. this.addChild(transGreyRect, backRect, titleTxt, tryAgainBP, listLevelsBP);
  3475. } else {
  3476. lifeRatio = level.playerLives / level.levelLives;
  3477. titleTxt = new createjs.Text('You survive !', '24px karnivoreRegular,Arial', dka.colors.lightBlue).set({
  3478. x: canvasWidth / 2,
  3479. y: canvasHeight / 2 - 120,
  3480. textAlign: 'center',
  3481. textBaseline: 'alphabetic'
  3482. });
  3483. gradeTxt = new createjs.Text(this.grade(lifeRatio), '30px karnivoreRegular,Arial', dka.colors.lightBlue).set({
  3484. x: canvasWidth / 2,
  3485. y: canvasHeight / 2 - 60,
  3486. textAlign: 'center',
  3487. textBaseline: 'alphabetic'
  3488. });
  3489. goldRemainingTxt = new createjs.Text('Gold remaining: ', '14px karnivoreRegular,Arial', dka.colors.lightBlue).set({
  3490. x: canvasWidth / 2 - 130,
  3491. y: canvasHeight / 2 + 23,
  3492. textBaseline: 'alphabetic'
  3493. });
  3494. goldRemaining = new dka.ScrollNumber(level.playerGold, '18px karnivoreRegular,Arial', dka.colors.lightBlue, 0.05).set({
  3495. x: canvasWidth / 2 + 40,
  3496. y: canvasHeight / 2 + 23
  3497. });
  3498. this.addChild(backRect, titleTxt, gradeTxt, goldRemainingTxt, tryAgainBP, listLevelsBP, goldRemaining);
  3499. positions = [50, 120, 200, 670, 760, 830];
  3500. for (i = 0, len = positions.length; i < len; i++) {
  3501. position = positions[i];
  3502. this.addChild(new dka.GraduationHat(position, lifeRatio));
  3503. }
  3504. }
  3505. }
  3506. ScreenLevelEnd.prototype.grade = function(ratio) {
  3507. switch (false) {
  3508. case ratio !== 1:
  3509. return 'A+';
  3510. case !(ratio >= 0.9):
  3511. return 'A';
  3512. case !(ratio >= 0.8):
  3513. return 'B';
  3514. case !(ratio >= 0.7):
  3515. return 'C';
  3516. case !(ratio >= 0.6):
  3517. return 'D';
  3518. default:
  3519. return 'E';
  3520. }
  3521. };
  3522. return ScreenLevelEnd;
  3523. })(dka.Screen);
  3524. }).call(this);
  3525. /*
  3526. * Copyright © Romain Fouquet, 2012-2015
  3527. * Copyright © Clément Joly, 2012-2015
  3528. #
  3529. * romain.fouquet18@gmail.com
  3530. * leowzukw@vmail.me
  3531. #
  3532. * This file is part of Diseases Killer Academy.
  3533. #
  3534. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3535. * it under the terms of the GNU Affero General Public License as published by
  3536. * the Free Software Foundation, either version 3 of the License, or
  3537. * (at your option) any later version.
  3538. #
  3539. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3540. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3541. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3542. * GNU Affero General Public License for more details.
  3543. #
  3544. * You should have received a copy of the GNU Affero General Public License
  3545. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3546. */
  3547. (function() {
  3548. 'use strict';
  3549. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3550. hasProp = {}.hasOwnProperty;
  3551. dka.ButtonTimeline = (function(superClass) {
  3552. extend(ButtonTimeline, superClass);
  3553. function ButtonTimeline(bmp) {
  3554. ButtonTimeline.__super__.constructor.call(this, bmp);
  3555. this.set({
  3556. cursor: 'pointer',
  3557. brightness: 30
  3558. });
  3559. this.on('mouseover', function() {
  3560. return this.lighten();
  3561. });
  3562. this.on('mouseout', function() {
  3563. return this.removeAllFilters();
  3564. });
  3565. this.cache(0, 0, 60, 60);
  3566. }
  3567. ButtonTimeline.prototype.lighten = function() {
  3568. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(this.brightness))];
  3569. return this.updateCache();
  3570. };
  3571. ButtonTimeline.prototype.removeAllFilters = function() {
  3572. this.filters = [];
  3573. return this.updateCache();
  3574. };
  3575. return ButtonTimeline;
  3576. })(createjs.Bitmap);
  3577. }).call(this);
  3578. /*
  3579. * Copyright © Romain Fouquet, 2012-2015
  3580. * Copyright © Clément Joly, 2012-2015
  3581. #
  3582. * romain.fouquet18@gmail.com
  3583. * leowzukw@vmail.me
  3584. #
  3585. * This file is part of Diseases Killer Academy.
  3586. #
  3587. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3588. * it under the terms of the GNU Affero General Public License as published by
  3589. * the Free Software Foundation, either version 3 of the License, or
  3590. * (at your option) any later version.
  3591. #
  3592. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3593. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3594. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3595. * GNU Affero General Public License for more details.
  3596. #
  3597. * You should have received a copy of the GNU Affero General Public License
  3598. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3599. */
  3600. (function() {
  3601. 'use strict';
  3602. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3603. hasProp = {}.hasOwnProperty;
  3604. dka.ScreenTimeline = (function(superClass) {
  3605. extend(ScreenTimeline, superClass);
  3606. function ScreenTimeline() {
  3607. var arrow, bp, creditsBp, i, labsBp, level, ref;
  3608. ScreenTimeline.__super__.constructor.call(this, false, true);
  3609. this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('clock')));
  3610. this.timeline = new createjs.Container();
  3611. this.timeline.set({
  3612. x: -canvasWidth,
  3613. y: 140
  3614. });
  3615. this.addChild(this.timeline);
  3616. arrow = new createjs.Bitmap(dka.academy.assetManager.getAsset('timeline'));
  3617. this.timeline.addChild(arrow);
  3618. createjs.Tween.get(this.timeline, {
  3619. useTicks: true
  3620. }).to({
  3621. x: 90
  3622. }, 20, createjs.Ease.cubicOut);
  3623. this.buttons = [];
  3624. for (level = i = 0, ref = dka.academy.LEVEL_NUMBER; i < ref; level = i += 1) {
  3625. bp = new dka.TimelineLevel(level);
  3626. this.buttons.push(bp);
  3627. this.timeline.addChild(bp);
  3628. }
  3629. labsBp = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('labsBp'));
  3630. labsBp.set({
  3631. x: 730,
  3632. y: 480
  3633. });
  3634. this.addChild(labsBp);
  3635. labsBp.on('click', (function(_this) {
  3636. return function() {
  3637. return createjs.Tween.get(_this.timeline, {
  3638. useTicks: true
  3639. }).to({
  3640. x: canvasWidth
  3641. }, 20, createjs.Ease.cubicIn).call(function() {
  3642. labsBp.parent.removeChild(labsBp);
  3643. this.parent.removeChild(this.parent.bubble);
  3644. creditsBp.parent.removeChild(creditsBp);
  3645. return dka.academy.gotoLabs(this.parent);
  3646. });
  3647. };
  3648. })(this));
  3649. if (dka.academy.game.getTotalGold() >= dka.academy.game.labs.getLowerUnlockedPrice()) {
  3650. this.bubble = new dka.TutoBubble('Go to Labs!', new createjs.Point(760, 440));
  3651. this.addChild(this.bubble);
  3652. }
  3653. creditsBp = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('creditsBp'));
  3654. creditsBp.set({
  3655. x: 100,
  3656. y: 480
  3657. });
  3658. this.addChild(creditsBp);
  3659. creditsBp.on('click', (function(_this) {
  3660. return function() {
  3661. return createjs.Tween.get(_this.timeline, {
  3662. useTicks: true
  3663. }).to({
  3664. x: canvasWidth
  3665. }, 20, createjs.Ease.cubicIn).call(function() {
  3666. _this.removeCoinScore();
  3667. _this.removeChild(_this.bubble);
  3668. labsBp.parent.removeChild(labsBp);
  3669. creditsBp.parent.removeChild(creditsBp);
  3670. return dka.academy.showCredits();
  3671. });
  3672. };
  3673. })(this));
  3674. this.addMuteStuff();
  3675. this.addCoinScore();
  3676. }
  3677. ScreenTimeline.prototype.addCoinScore = function() {
  3678. this.coinLabel = new createjs.Bitmap(dka.academy.assetManager.getAsset('coinHud'));
  3679. this.coinLabel.set({
  3680. x: 349,
  3681. y: 55
  3682. });
  3683. this.addChild(this.coinLabel);
  3684. this.coinText = new createjs.Text(dka.academy.game.getTotalGold(), '20px karnivoreRegular, Arial', dka.colors.veryLightBlue);
  3685. this.coinText.set({
  3686. x: 380,
  3687. y: 70,
  3688. textAlign: 'left',
  3689. textBaseline: 'alphabetic'
  3690. });
  3691. return this.addChild(this.coinText);
  3692. };
  3693. ScreenTimeline.prototype.updateCoinScore = function() {
  3694. return this.coinText.text = dka.academy.game.getTotalGold();
  3695. };
  3696. ScreenTimeline.prototype.removeCoinScore = function() {
  3697. this.removeChild(this.coinLabel);
  3698. return this.removeChild(this.coinText);
  3699. };
  3700. ScreenTimeline.prototype.addMuteStuff = function() {
  3701. var speakersButton;
  3702. speakersButton = (new dka.ButtonSprite(dka.academy.assetManager.getAsset('sMuteSettingsBP'))).set({
  3703. x: 837,
  3704. y: 25
  3705. });
  3706. this.addChild(speakersButton);
  3707. if (localStorage && localStorage.getItem('muted')) {
  3708. if (localStorage.getItem('muted') === 'true') {
  3709. speakersButton.gotoAndStop(1);
  3710. } else {
  3711. speakersButton.gotoAndStop(0);
  3712. }
  3713. } else {
  3714. if (createjs.Sound.getMute()) {
  3715. speakersButton.gotoAndStop(1);
  3716. } else {
  3717. speakersButton.gotoAndStop(0);
  3718. }
  3719. }
  3720. speakersButton.updateCache();
  3721. return speakersButton.on('click', function(e) {
  3722. if (createjs.Sound.getMute()) {
  3723. this.gotoAndStop(0);
  3724. this.updateCache();
  3725. gameStage.update();
  3726. createjs.Sound.setMute(0);
  3727. return localStorage && localStorage.setItem('muted', false);
  3728. } else {
  3729. this.gotoAndStop(1);
  3730. this.updateCache();
  3731. gameStage.update();
  3732. createjs.Sound.setMute(1);
  3733. return localStorage && localStorage.setItem('muted', true);
  3734. }
  3735. });
  3736. };
  3737. return ScreenTimeline;
  3738. })(dka.Screen);
  3739. }).call(this);
  3740. /*
  3741. * Copyright © Romain Fouquet, 2012-2015
  3742. * Copyright © Clément Joly, 2012-2015
  3743. #
  3744. * romain.fouquet18@gmail.com
  3745. * leowzukw@vmail.me
  3746. #
  3747. * This file is part of Diseases Killer Academy.
  3748. #
  3749. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3750. * it under the terms of the GNU Affero General Public License as published by
  3751. * the Free Software Foundation, either version 3 of the License, or
  3752. * (at your option) any later version.
  3753. #
  3754. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3755. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3756. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3757. * GNU Affero General Public License for more details.
  3758. #
  3759. * You should have received a copy of the GNU Affero General Public License
  3760. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3761. */
  3762. (function() {
  3763. 'use strict';
  3764. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3765. hasProp = {}.hasOwnProperty;
  3766. dka.TimelineLevel = (function(superClass) {
  3767. extend(TimelineLevel, superClass);
  3768. function TimelineLevel(level) {
  3769. TimelineLevel.__super__.constructor.call(this, dka.academy.assetManager.getAsset("level" + level + "Bp"));
  3770. this.set({
  3771. x: 6 + level * 60,
  3772. y: 4,
  3773. cursor: 'pointer',
  3774. brightness: 30
  3775. });
  3776. this.on('click', (function(_this) {
  3777. return function() {
  3778. return createjs.Tween.get(_this.parent, {
  3779. useTicks: true
  3780. }).to({
  3781. x: canvasWidth
  3782. }, 20, createjs.Ease.cubicIn).call(function() {
  3783. return dka.academy.game.launchLevel(level);
  3784. });
  3785. };
  3786. })(this));
  3787. this.on('mouseover', function() {
  3788. return this.lighten();
  3789. });
  3790. this.on('mouseout', function() {
  3791. return this.removeAllFilters();
  3792. });
  3793. this.cache(0, 0, 143, 198);
  3794. }
  3795. TimelineLevel.prototype.lighten = function() {
  3796. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(this.brightness))];
  3797. return this.updateCache();
  3798. };
  3799. TimelineLevel.prototype.removeAllFilters = function() {
  3800. this.filters = [];
  3801. return this.updateCache();
  3802. };
  3803. return TimelineLevel;
  3804. })(createjs.Bitmap);
  3805. }).call(this);
  3806. /*
  3807. * Copyright © Romain Fouquet, 2012-2015
  3808. * Copyright © Clément Joly, 2012-2015
  3809. #
  3810. * romain.fouquet18@gmail.com
  3811. * leowzukw@vmail.me
  3812. #
  3813. * This file is part of Diseases Killer Academy.
  3814. #
  3815. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3816. * it under the terms of the GNU Affero General Public License as published by
  3817. * the Free Software Foundation, either version 3 of the License, or
  3818. * (at your option) any later version.
  3819. #
  3820. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3821. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3822. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3823. * GNU Affero General Public License for more details.
  3824. #
  3825. * You should have received a copy of the GNU Affero General Public License
  3826. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3827. */
  3828. (function() {
  3829. 'use strict';
  3830. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3831. hasProp = {}.hasOwnProperty;
  3832. dka.SettingsMenu = (function(superClass) {
  3833. extend(SettingsMenu, superClass);
  3834. function SettingsMenu(ui) {
  3835. var backRect, title;
  3836. SettingsMenu.__super__.constructor.call(this);
  3837. this.ui = ui;
  3838. backRect = new createjs.Bitmap(dka.academy.assetManager.getAsset('BaseBP1')).set({
  3839. x: canvasWidth / 2,
  3840. y: canvasHeight / 2,
  3841. regX: 180,
  3842. regY: 180
  3843. });
  3844. this.addChild(backRect);
  3845. title = new createjs.Text('Settings', '30px KarnivoreRegular', dka.colors.lightBlue).set({
  3846. x: canvasWidth / 2,
  3847. y: canvasHeight / 2 - 128,
  3848. textAlign: 'center',
  3849. baseline: 'alphbetic'
  3850. });
  3851. this.addChild(title);
  3852. this.addMuteStuff();
  3853. this.addAutopauseStuff();
  3854. }
  3855. SettingsMenu.prototype.addMuteStuff = function() {
  3856. var speakersButton, speakersLabel;
  3857. speakersLabel = new createjs.Text('Music: ', '15px KarnivoreRegular', dka.colors.lightBlue).set({
  3858. x: canvasWidth / 2 - 110,
  3859. y: canvasHeight / 2 - 40
  3860. });
  3861. this.addChild(speakersLabel);
  3862. speakersButton = (new dka.ButtonSprite(dka.academy.assetManager.getAsset('sMuteSettingsBP'))).set({
  3863. x: canvasWidth / 2 + 40,
  3864. y: canvasHeight / 2 - 29
  3865. });
  3866. this.addChild(speakersButton);
  3867. if (localStorage && localStorage.getItem('muted')) {
  3868. if (localStorage.getItem('muted') === 'true') {
  3869. speakersButton.gotoAndStop(1);
  3870. } else {
  3871. speakersButton.gotoAndStop(0);
  3872. }
  3873. } else {
  3874. if (createjs.Sound.getMute()) {
  3875. speakersButton.gotoAndStop(1);
  3876. } else {
  3877. speakersButton.gotoAndStop(0);
  3878. }
  3879. }
  3880. speakersButton.updateCache();
  3881. return speakersButton.on('click', function(e) {
  3882. if (createjs.Sound.getMute()) {
  3883. this.gotoAndStop(0);
  3884. this.updateCache();
  3885. gameStage.update();
  3886. createjs.Sound.setMute(0);
  3887. return localStorage && localStorage.setItem('muted', false);
  3888. } else {
  3889. this.gotoAndStop(1);
  3890. this.updateCache();
  3891. gameStage.update();
  3892. createjs.Sound.setMute(1);
  3893. return localStorage && localStorage.setItem('muted', true);
  3894. }
  3895. });
  3896. };
  3897. SettingsMenu.prototype.addAutopauseStuff = function() {
  3898. var autopauseButton, autopauseLabel;
  3899. autopauseLabel = new createjs.Text('Autopause: ', '15px KarnivoreRegular', dka.colors.lightBlue).set({
  3900. x: canvasWidth / 2 - 110,
  3901. y: canvasHeight / 2 + 40
  3902. });
  3903. this.addChild(autopauseLabel);
  3904. autopauseButton = (new dka.ButtonSprite(dka.academy.assetManager.getAsset('sAutopauseSettingsBP'))).set({
  3905. x: canvasWidth / 2 + 40,
  3906. y: canvasHeight / 2 + 51
  3907. });
  3908. this.addChild(autopauseButton);
  3909. if (localStorage && localStorage.getItem('autopause')) {
  3910. if (localStorage.getItem('autopause') === 'true') {
  3911. autopauseButton.gotoAndStop(0);
  3912. } else {
  3913. autopauseButton.gotoAndStop(1);
  3914. }
  3915. }
  3916. autopauseButton.updateCache();
  3917. return autopauseButton.on('click', (function(e, ui) {
  3918. if (ui.level.game.autopause) {
  3919. this.gotoAndStop(1);
  3920. this.updateCache();
  3921. gameStage.update();
  3922. ui.level.game.autopause = false;
  3923. return localStorage && localStorage.setItem('autopause', false);
  3924. } else {
  3925. this.gotoAndStop(0);
  3926. this.updateCache();
  3927. gameStage.update();
  3928. ui.level.game.autopause = true;
  3929. return localStorage && localStorage.setItem('autopause', true);
  3930. }
  3931. }), null, null, this.ui);
  3932. };
  3933. return SettingsMenu;
  3934. })(createjs.Container);
  3935. }).call(this);
  3936. /*
  3937. * Copyright © Romain Fouquet, 2012-2015
  3938. * Copyright © Clément Joly, 2012-2015
  3939. #
  3940. * romain.fouquet18@gmail.com
  3941. * leowzukw@vmail.me
  3942. #
  3943. * This file is part of Diseases Killer Academy.
  3944. #
  3945. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  3946. * it under the terms of the GNU Affero General Public License as published by
  3947. * the Free Software Foundation, either version 3 of the License, or
  3948. * (at your option) any later version.
  3949. #
  3950. * Diseases Killer Academy is distributed in the hope that it will be useful,
  3951. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3952. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3953. * GNU Affero General Public License for more details.
  3954. #
  3955. * You should have received a copy of the GNU Affero General Public License
  3956. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  3957. */
  3958. (function() {
  3959. 'use strict';
  3960. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3961. hasProp = {}.hasOwnProperty;
  3962. dka.HexaMenuButton = (function(superClass) {
  3963. extend(HexaMenuButton, superClass);
  3964. function HexaMenuButton(menu, level, position, bpData, img, hintData, unlockCondition, range) {
  3965. var bmp, ref, sp;
  3966. HexaMenuButton.__super__.constructor.call(this);
  3967. this.menu = menu;
  3968. this.level = level;
  3969. this.position = position;
  3970. this.bpData = bpData;
  3971. this.img = img;
  3972. this.unlockCondition = unlockCondition;
  3973. this.x = this.menu.pointHex[this.position].x;
  3974. this.y = this.menu.pointHex[this.position].y;
  3975. this.set({
  3976. cursor: 'pointer'
  3977. });
  3978. sp = new createjs.Sprite(dka.academy.assetManager.getAsset('spriteMenuButton'));
  3979. bmp = new createjs.Bitmap(dka.academy.assetManager.getAsset(img)).set({
  3980. regX: 16,
  3981. regY: 16
  3982. });
  3983. this.addChild(sp, bmp);
  3984. if (hintData) {
  3985. this.on('mouseover', function() {
  3986. return level.addToolTip(this, hintData);
  3987. });
  3988. this.on('mouseout', function() {
  3989. return level.removeToolTip();
  3990. });
  3991. }
  3992. if (range) {
  3993. this.on('mouseover', function() {
  3994. return this.level.showTowerRange(this.menu.x, this.menu.y, range);
  3995. });
  3996. this.on('mouseout', function() {
  3997. return this.level.towerRange.fade();
  3998. });
  3999. }
  4000. if (bpData && bpData.action) {
  4001. this.action = bpData.action;
  4002. }
  4003. if (bpData != null ? (ref = bpData.cost) != null ? ref.value : void 0 : void 0) {
  4004. this.addChild((new createjs.Text(bpData.cost.value, '10px karnivoreRegular, Arial', (bpData.cost.ressource === 'dna' ? dka.colors.lightGreen : dka.colors.gold))).set({
  4005. y: 29,
  4006. textAlign: 'center',
  4007. textBaseline: 'alphabetic'
  4008. }));
  4009. this.on('mouseover', function() {
  4010. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
  4011. return this.updateCache();
  4012. });
  4013. this.on('mouseout', function() {
  4014. this.filters = [];
  4015. return this.updateCache();
  4016. });
  4017. if (this.isAffordable(bpData.cost.value, bpData.cost.ressource)) {
  4018. sp.gotoAndStop(0);
  4019. this.affordable = true;
  4020. this.addAction();
  4021. } else {
  4022. this.darken();
  4023. sp.gotoAndStop(1);
  4024. this.set({
  4025. cursor: 'auto',
  4026. affordable: false
  4027. });
  4028. if (unlockCondition) {
  4029. this.level.on(bpData.cost.ressource + 'changed', (function(_this) {
  4030. return function(e) {
  4031. if (_this.isAffordable(bpData.cost.value, bpData.cost.ressource)) {
  4032. _this.getChildAt(0).gotoAndStop(0);
  4033. _this.removeAllFilters();
  4034. _this.set({
  4035. cursor: 'pointer',
  4036. affordable: true
  4037. });
  4038. e.remove();
  4039. _this.updateCache();
  4040. return _this.addAction();
  4041. }
  4042. };
  4043. })(this));
  4044. }
  4045. }
  4046. } else {
  4047. this.darken();
  4048. sp.gotoAndStop(2);
  4049. this.set({
  4050. cursor: 'auto',
  4051. affordable: false
  4052. });
  4053. }
  4054. this.cache(-22, -19, 44, 53);
  4055. }
  4056. HexaMenuButton.prototype.addAction = function() {
  4057. if (this.action) {
  4058. return this.on('click', function() {
  4059. this.menu.target.execAction(this.action);
  4060. return this.menu.fade();
  4061. });
  4062. }
  4063. };
  4064. HexaMenuButton.prototype.darken = function() {
  4065. this.getChildAt(1).filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustSaturation(-100))];
  4066. return this.getChildAt(1).cache(0, 0, 32, 32);
  4067. };
  4068. HexaMenuButton.prototype.removeAllFilters = function() {
  4069. this.getChildAt(1).filters = [];
  4070. return this.getChildAt(1).uncache();
  4071. };
  4072. HexaMenuButton.prototype.isAffordable = function(cost, ressource) {
  4073. return (ressource === 'dna' ? this.level.playerDna : this.level.playerGold) >= cost;
  4074. };
  4075. return HexaMenuButton;
  4076. })(createjs.Container);
  4077. }).call(this);
  4078. /*
  4079. * Copyright © Romain Fouquet, 2012-2015
  4080. * Copyright © Clément Joly, 2012-2015
  4081. #
  4082. * romain.fouquet18@gmail.com
  4083. * leowzukw@vmail.me
  4084. #
  4085. * This file is part of Diseases Killer Academy.
  4086. #
  4087. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4088. * it under the terms of the GNU Affero General Public License as published by
  4089. * the Free Software Foundation, either version 3 of the License, or
  4090. * (at your option) any later version.
  4091. #
  4092. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4093. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4094. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4095. * GNU Affero General Public License for more details.
  4096. #
  4097. * You should have received a copy of the GNU Affero General Public License
  4098. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4099. */
  4100. (function() {
  4101. 'use strict';
  4102. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4103. hasProp = {}.hasOwnProperty;
  4104. dka.HexaMenu = (function(superClass) {
  4105. extend(HexaMenu, superClass);
  4106. function HexaMenu(level) {
  4107. HexaMenu.__super__.constructor.call(this);
  4108. this.level = level;
  4109. this.pointHex = [
  4110. {
  4111. x: 63,
  4112. y: 4
  4113. }, {
  4114. x: 114,
  4115. y: 34
  4116. }, {
  4117. x: 14,
  4118. y: 34
  4119. }, {
  4120. x: 114,
  4121. y: 94
  4122. }, {
  4123. x: 14,
  4124. y: 94
  4125. }, {
  4126. x: 63,
  4127. y: 123
  4128. }
  4129. ];
  4130. this.set({
  4131. regX: 64,
  4132. regY: 64,
  4133. scaleX: 0.5,
  4134. scaleY: 0.5
  4135. });
  4136. this.hexaBase();
  4137. this.buttonsHolder = this.addChild(new createjs.Container());
  4138. this.visible = false;
  4139. }
  4140. HexaMenu.prototype.load = function(x, y, target) {
  4141. if (this.visible === true) {
  4142. if (target === this.target) {
  4143. this.fade();
  4144. return;
  4145. }
  4146. this.set({
  4147. scaleX: 0.5,
  4148. scaleY: 0.5
  4149. });
  4150. this.buttonsHolder.removeAllChildren();
  4151. }
  4152. this.x = x;
  4153. this.y = y;
  4154. this.target = target;
  4155. this.visible = true;
  4156. if (!this.target.name || !this.target.name === 'hospital') {
  4157. this.level.dispatchEvent(new createjs.Event(this.level.TOWER_MENU_OPEN_EVENT, true, false));
  4158. }
  4159. return createjs.Tween.get(this, {
  4160. useTicks: true
  4161. }).to({
  4162. scaleX: 1,
  4163. scaleY: 1
  4164. }, 5, createjs.Ease.circOut);
  4165. };
  4166. HexaMenu.prototype.hexaBase = function() {
  4167. return this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('hexMenu')));
  4168. };
  4169. HexaMenu.prototype.addButton = function(position, bpData, img, hintData, unlockCondition, range) {
  4170. return this.buttonsHolder.addChild(new dka.HexaMenuButton(this, this.level, position, bpData, img, hintData, unlockCondition, range));
  4171. };
  4172. HexaMenu.prototype.getPropColor = function(before, after, criteria) {
  4173. var isBetter;
  4174. isBetter = this.level.settings.isBetter(before, after, criteria);
  4175. switch (isBetter) {
  4176. case 'better':
  4177. return 'green';
  4178. case 'worse':
  4179. return 'red';
  4180. case 'equal':
  4181. return 'white';
  4182. default:
  4183. return 'white';
  4184. }
  4185. };
  4186. HexaMenu.prototype.fade = function() {
  4187. return createjs.Tween.get(this, {
  4188. useTicks: true
  4189. }).to({
  4190. scaleX: 0.5,
  4191. scaleY: 0.5
  4192. }, 2, createjs.Ease.circIn).call(function() {
  4193. if (this.target) {
  4194. this.target.unselect();
  4195. }
  4196. this.buttonsHolder.removeAllChildren();
  4197. return this.visible = false;
  4198. });
  4199. };
  4200. return HexaMenu;
  4201. })(createjs.Container);
  4202. }).call(this);
  4203. /*
  4204. * Copyright © Romain Fouquet, 2012-2015
  4205. * Copyright © Clément Joly, 2012-2015
  4206. #
  4207. * romain.fouquet18@gmail.com
  4208. * leowzukw@vmail.me
  4209. #
  4210. * This file is part of Diseases Killer Academy.
  4211. #
  4212. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4213. * it under the terms of the GNU Affero General Public License as published by
  4214. * the Free Software Foundation, either version 3 of the License, or
  4215. * (at your option) any later version.
  4216. #
  4217. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4218. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4219. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4220. * GNU Affero General Public License for more details.
  4221. #
  4222. * You should have received a copy of the GNU Affero General Public License
  4223. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4224. */
  4225. (function() {
  4226. 'use strict';
  4227. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4228. hasProp = {}.hasOwnProperty;
  4229. dka.ProgressBar = (function(superClass) {
  4230. extend(ProgressBar, superClass);
  4231. function ProgressBar(leftToRight, width, height, color1, color2, edgeColor) {
  4232. ProgressBar.__super__.constructor.call(this);
  4233. this.leftToRight = leftToRight;
  4234. this.width = width;
  4235. this.height = height;
  4236. this.color1 = color1;
  4237. this.color2 = color2;
  4238. this.edgeColor = edgeColor;
  4239. this.set({
  4240. regX: width / 2,
  4241. regY: height / 2
  4242. });
  4243. this.oldVal = 0;
  4244. this.drawBackgroundShape(leftToRight, width, height, color1, color2, edgeColor);
  4245. this.cache(0, 0, width, height);
  4246. }
  4247. ProgressBar.prototype.drawBackgroundShape = function() {
  4248. this.graphics.beginFill(this.edgeColor).rect(0, 0, this.width, this.height);
  4249. return this.graphics.beginFill(this.color1).rect(1, 1, this.width - 2, this.height - 2);
  4250. };
  4251. ProgressBar.prototype.setProgress = function(progress) {
  4252. if (this.leftToRight) {
  4253. if (progress < this.oldVal) {
  4254. this.graphics.clear();
  4255. this.drawBackgroundShape(this.leftToRight, this.width, this.height, this.color1, this.color2, this.edgeColor);
  4256. }
  4257. this.graphics.beginFill(this.color2).rect(1, 1, (this.width - 2) * progress, this.height - 2);
  4258. } else {
  4259. if (progress > this.oldVal) {
  4260. this.graphics.clear();
  4261. this.drawBackgroundShape(this.leftToRight, this.width, this.height, this.color1, this.color2, this.edgeColor);
  4262. }
  4263. this.graphics.beginFill(this.color2).rect(this.width - 1, 1, -((this.width - 2) - ((this.width - 2) * progress)), this.height - 2);
  4264. }
  4265. this.updateCache();
  4266. return this.oldVal = progress;
  4267. };
  4268. return ProgressBar;
  4269. })(createjs.Shape);
  4270. }).call(this);
  4271. /*
  4272. * Copyright © Romain Fouquet, 2012-2015
  4273. * Copyright © Clément Joly, 2012-2015
  4274. #
  4275. * romain.fouquet18@gmail.com
  4276. * leowzukw@vmail.me
  4277. #
  4278. * This file is part of Diseases Killer Academy.
  4279. *
  4280. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4281. * it under the terms of the GNU Affero General Public License as published by
  4282. * the Free Software Foundation, either version 3 of the License, or
  4283. * (at your option) any later version.
  4284. *
  4285. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4286. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4287. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4288. * GNU Affero General Public License for more details.
  4289. *
  4290. * You should have received a copy of the GNU Affero General Public License
  4291. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4292. */
  4293. (function() {
  4294. 'use strict';
  4295. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4296. hasProp = {}.hasOwnProperty;
  4297. dka.ProgressCircle = (function(superClass) {
  4298. extend(ProgressCircle, superClass);
  4299. function ProgressCircle(radius, thickness, color1, edgeColor) {
  4300. ProgressCircle.__super__.constructor.call(this);
  4301. edgeColor && this.graphics.beginStroke(edgeColor).setStrokeStyle(thickness).arc(0, 0, radius, 0, Math.PI * 2);
  4302. this.set({
  4303. regX: this.x,
  4304. regY: this.y,
  4305. radius: radius,
  4306. thickness: thickness,
  4307. color1: color1,
  4308. edgeColor: edgeColor
  4309. });
  4310. }
  4311. ProgressCircle.prototype.setProgress = function(progress) {
  4312. this.graphics.clear();
  4313. if (this.edgeColor) {
  4314. this.graphics.beginStroke(this.edgeColor).setStrokeStyle(this.thickness).arc(0, 0, this.radius, 0, Math.PI * 2);
  4315. }
  4316. if (this.color1) {
  4317. return this.graphics.beginStroke(this.color1).setStrokeStyle(this.thickness - 4).arc(0, 0, this.radius, -Math.PI / 2, ((Math.PI * 2) * progress) - Math.PI / 2, false);
  4318. }
  4319. };
  4320. return ProgressCircle;
  4321. })(createjs.Shape);
  4322. }).call(this);
  4323. /*
  4324. * Copyright © Romain Fouquet, 2012-2015
  4325. * Copyright © Clément Joly, 2012-2015
  4326. #
  4327. * romain.fouquet18@gmail.com
  4328. * leowzukw@vmail.me
  4329. #
  4330. * This file is part of Diseases Killer Academy.
  4331. *
  4332. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4333. * it under the terms of the GNU Affero General Public License as published by
  4334. * the Free Software Foundation, either version 3 of the License, or
  4335. * (at your option) any later version.
  4336. *
  4337. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4338. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4339. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4340. * GNU Affero General Public License for more details.
  4341. *
  4342. * You should have received a copy of the GNU Affero General Public License
  4343. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4344. */
  4345. (function() {
  4346. 'use strict';
  4347. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4348. hasProp = {}.hasOwnProperty;
  4349. dka.ProgressPie = (function(superClass) {
  4350. extend(ProgressPie, superClass);
  4351. function ProgressPie(radius, color) {
  4352. ProgressPie.__super__.constructor.call(this);
  4353. this.graphics.beginFill(color).arc(0, 0, radius, 0, Math.PI * 2);
  4354. this.set({
  4355. regX: this.x,
  4356. regY: this.y,
  4357. radius: radius,
  4358. color: color
  4359. });
  4360. }
  4361. ProgressPie.prototype.setProgress = function(progress) {
  4362. this.graphics.clear();
  4363. return this.graphics.beginFill(this.color).setStrokeStyle(this.thickness).arc(0, 0, this.radius, -Math.PI / 2, Math.PI * 2 * (progress - 0.25), true).lineTo(0, 0);
  4364. };
  4365. return ProgressPie;
  4366. })(createjs.Shape);
  4367. }).call(this);
  4368. /*
  4369. * Copyright © Romain Fouquet, 2012-2015
  4370. * Copyright © Clément Joly, 2012-2015
  4371. #
  4372. * romain.fouquet18@gmail.com
  4373. * leowzukw@vmail.me
  4374. #
  4375. * This file is part of Diseases Killer Academy.
  4376. #
  4377. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4378. * it under the terms of the GNU Affero General Public License as published by
  4379. * the Free Software Foundation, either version 3 of the License, or
  4380. * (at your option) any later version.
  4381. #
  4382. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4383. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4384. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4385. * GNU Affero General Public License for more details.
  4386. #
  4387. * You should have received a copy of the GNU Affero General Public License
  4388. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4389. */
  4390. (function() {
  4391. 'use strict';
  4392. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4393. hasProp = {}.hasOwnProperty;
  4394. dka.Tower = (function(superClass) {
  4395. extend(Tower, superClass);
  4396. function Tower(x, y, location, level, free) {
  4397. var settings;
  4398. Tower.__super__.constructor.call(this);
  4399. this.x = x;
  4400. this.y = y;
  4401. this.location = location;
  4402. this.level = level;
  4403. this.set({
  4404. cursor: 'pointer'
  4405. });
  4406. settings = this.level.settings.towers[this.type];
  4407. this.title = settings.title;
  4408. this.description = settings.description;
  4409. this.sprite = new createjs.Sprite();
  4410. this.addChild(this.sprite);
  4411. this.buildingBar = new dka.ProgressBar(true, 28, 7, dka.colors.veryLightBlue, dka.colors.lightBlue, dka.colors.darkGrey).set({
  4412. y: -10
  4413. });
  4414. this.addChild(this.buildingBar);
  4415. this.upgradeLevel = 0;
  4416. this.MAX_UPGRADE_LEVEL = 4;
  4417. this.totalCost = 0;
  4418. this.buildingCounter = 0;
  4419. this.buildingMode = true;
  4420. this.level.dispatchEvent(new createjs.Event(this.level.TOWER_BUILT_EVENT, true, false));
  4421. if (free) {
  4422. this.buildingMode = false;
  4423. }
  4424. this.upgrade(free);
  4425. this.sprite.on('click', (function(_this) {
  4426. return function() {
  4427. if (_this.buildingMode) {
  4428. return;
  4429. }
  4430. _this.select();
  4431. return _this.showMenu();
  4432. };
  4433. })(this));
  4434. this.on('mouseover', function() {
  4435. return this.lighten();
  4436. });
  4437. this.on('mouseout', function() {
  4438. if (this.selected) {
  4439. return;
  4440. }
  4441. return this.unselect();
  4442. });
  4443. this.on('tick', this.building);
  4444. }
  4445. Tower.prototype.lighten = function() {
  4446. this.sprite.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
  4447. return this.sprite.updateCache();
  4448. };
  4449. Tower.prototype.removeAllFilters = function() {
  4450. this.sprite.filters = [];
  4451. return this.sprite.updateCache();
  4452. };
  4453. Tower.prototype.select = function() {
  4454. this.selected = true;
  4455. return this.level.showTowerRange(this.x, this.y, this.range);
  4456. };
  4457. Tower.prototype.unselect = function() {
  4458. this.selected = false;
  4459. this.removeAllFilters();
  4460. return this.level.towerRange.fade();
  4461. };
  4462. Tower.prototype.inRange = function(x, y) {
  4463. return (new geom.Ellipse(this.x, this.y, this.range, this.range * this.level.coeffPerspective)).contains(x, y);
  4464. };
  4465. Tower.prototype.building = function() {
  4466. if (this.level.getFresherWaveIndex() >= 0) {
  4467. this.removeAllEventListeners('tick');
  4468. }
  4469. this.buildingCounter++;
  4470. this.buildingBar.setProgress(this.buildingCounter / this.buildingTime);
  4471. if (this.buildingCounter >= this.buildingTime) {
  4472. this.buildingMode = false;
  4473. this.removeChild(this.buildingBar);
  4474. this.removeAllEventListeners('tick');
  4475. return this.ready();
  4476. }
  4477. };
  4478. Tower.prototype.execAction = function(action) {
  4479. if (action === 'upgrade') {
  4480. return this.upgrade();
  4481. }
  4482. };
  4483. Tower.prototype.remove = function() {
  4484. this.parent.removeChild(this);
  4485. return this.level.addlocation(index);
  4486. };
  4487. return Tower;
  4488. })(createjs.Container);
  4489. }).call(this);
  4490. /*
  4491. * Copyright © Romain Fouquet, 2012-2015
  4492. * Copyright © Clément Joly, 2012-2015
  4493. #
  4494. * romain.fouquet18@gmail.com
  4495. * leowzukw@vmail.me
  4496. #
  4497. * This file is part of Diseases Killer Academy.
  4498. #
  4499. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4500. * it under the terms of the GNU Affero General Public License as published by
  4501. * the Free Software Foundation, either version 3 of the License, or
  4502. * (at your option) any later version.
  4503. #
  4504. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4505. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4506. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4507. * GNU Affero General Public License for more details.
  4508. #
  4509. * You should have received a copy of the GNU Affero General Public License
  4510. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4511. */
  4512. (function() {
  4513. 'use strict';
  4514. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4515. hasProp = {}.hasOwnProperty;
  4516. dka.TowerShoot = (function(superClass) {
  4517. extend(TowerShoot, superClass);
  4518. function TowerShoot(x, y, location, level, free) {
  4519. TowerShoot.__super__.constructor.call(this, x, y, location, level, free);
  4520. this.typeTower = 'shoot';
  4521. this.readyToFire = false;
  4522. this.waitToFire = 0;
  4523. this.tutoBubbleReload = false;
  4524. }
  4525. TowerShoot.prototype.ready = function() {
  4526. this.sprite.gotoAndStop(1);
  4527. this.sprite.updateCache();
  4528. this.addEntities();
  4529. return this.on('mouseover', this.reloadMagazine);
  4530. };
  4531. TowerShoot.prototype.tick = function() {
  4532. if (this.buildingMode) {
  4533. this.building();
  4534. return;
  4535. }
  4536. if (this.readyToFire !== true) {
  4537. this.waitToFire++;
  4538. }
  4539. if (this.readyToFire !== true && this.waitToFire >= this.reloadTime) {
  4540. this.waitToFire = 0;
  4541. this.readyToFire = true;
  4542. }
  4543. if (this.readyToFire === true) {
  4544. return this.getTarget();
  4545. }
  4546. };
  4547. TowerShoot.prototype.updateMagazineGauge = function() {
  4548. var color, green, h, maxGaugeHeight, padding, ratio, red, unit;
  4549. maxGaugeHeight = 28;
  4550. padding = 2;
  4551. ratio = this.magazineCounter / this.magazineSize;
  4552. h = ratio * maxGaugeHeight;
  4553. unit = maxGaugeHeight / this.magazineSize;
  4554. this.magazineGauge.graphics.clear();
  4555. this.magazineGauge.graphics.beginFill('#393939').drawRect(0, 0, 8, maxGaugeHeight + 2 * padding);
  4556. green = 255;
  4557. red = 2 * Math.ceil(255 - ratio * 255);
  4558. if (red >= 255) {
  4559. green = Math.ceil(ratio * 255);
  4560. }
  4561. color = 'rgb(' + red + ', ' + green + ', 0)';
  4562. this.magazineGauge.graphics.beginFill(color).drawRect(padding, maxGaugeHeight + padding, 8 - padding * padding, -h);
  4563. return this.magazineGauge.updateCache();
  4564. };
  4565. TowerShoot.prototype.reloadMagazine = function() {
  4566. this.magazineCounter = this.magazineSize;
  4567. this.updateMagazineGauge();
  4568. return this.level.dispatchEvent(new createjs.Event(this.level.MAGAZINE_RELOADED_EVENT, true, false));
  4569. };
  4570. TowerShoot.prototype.getTarget = function() {
  4571. var disease, i, target;
  4572. if (this.magazineCounter <= 0) {
  4573. if (this.tutoBubbleReload || !this.level.level === 0) {
  4574. return;
  4575. }
  4576. this.level.ui.tutoBubles.addChild(new dka.TutoBubble('Hover to reload', new createjs.Point(this.x, this.y - 40), this.level, this.level.MAGAZINE_RELOADED_EVENT));
  4577. this.tutoBubbleReload = true;
  4578. return;
  4579. }
  4580. target = null;
  4581. disease = null;
  4582. i = 0;
  4583. while (i < this.level.diseasesLayer.numChildren) {
  4584. disease = this.level.diseasesLayer.getChildAt(i);
  4585. if (disease.isTargetable() && this.inRange(disease.x, disease.y)) {
  4586. if (!target || disease.distanceToExit < target.distanceToExit) {
  4587. target = disease;
  4588. }
  4589. }
  4590. i++;
  4591. }
  4592. if (target) {
  4593. this.attack(target);
  4594. this.updateMagazineGauge();
  4595. return target;
  4596. }
  4597. return false;
  4598. };
  4599. TowerShoot.prototype.betterSupply = function(bonus) {
  4600. return this.reloadTime = this.level.settings.towers[this.type]['upgrade' + (this.upgradeLevel - 1)].reloadTime - bonus;
  4601. };
  4602. return TowerShoot;
  4603. })(dka.Tower);
  4604. }).call(this);
  4605. /*
  4606. * Copyright © Romain Fouquet, 2012-2015
  4607. * Copyright © Clément Joly, 2012-2015
  4608. #
  4609. * romain.fouquet18@gmail.com
  4610. * leowzukw@vmail.me
  4611. #
  4612. * This file is part of Diseases Killer Academy.
  4613. #
  4614. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4615. * it under the terms of the GNU Affero General Public License as published by
  4616. * the Free Software Foundation, either version 3 of the License, or
  4617. * (at your option) any later version.
  4618. #
  4619. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4620. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4621. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4622. * GNU Affero General Public License for more details.
  4623. #
  4624. * You should have received a copy of the GNU Affero General Public License
  4625. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4626. */
  4627. (function() {
  4628. 'use strict';
  4629. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4630. hasProp = {}.hasOwnProperty;
  4631. dka.TowerPill = (function(superClass) {
  4632. extend(TowerPill, superClass);
  4633. function TowerPill(x, y, location, level, free) {
  4634. this.type = 'pill';
  4635. TowerPill.__super__.constructor.call(this, x, y, location, level, free);
  4636. this.sprite.spriteSheet = dka.academy.assetManager.getAsset('TowerPill');
  4637. this.sprite.cache(-24, -9, 48, 48);
  4638. this.buildingTime = level.settings.towers.antibiotic.buildingTime;
  4639. }
  4640. TowerPill.prototype.addEntities = function() {
  4641. var mg;
  4642. this.entities = new createjs.Container();
  4643. this.addChildAt(this.entities, 0);
  4644. mg = this.magazineGauge = new createjs.Shape().set({
  4645. x: 0,
  4646. y: 8,
  4647. regX: 4,
  4648. regY: 0
  4649. });
  4650. this.entities.addChild(mg);
  4651. mg.cache(0, 0, 8, 32);
  4652. return this.updateMagazineGauge();
  4653. };
  4654. TowerPill.prototype.showMenu = function() {
  4655. var currentLevel, upLevel;
  4656. this.level.towerMenu.load(this.x, this.y, this);
  4657. currentLevel = this.level.settings.towers.pill['upgrade' + (this.upgradeLevel - 1)];
  4658. if (this.upgradeLevel === this.MAX_UPGRADE_LEVEL) {
  4659. this.level.towerMenu.addButton(0, null, 'upgradeGoldBP', {
  4660. title: this.title,
  4661. description: this.description,
  4662. props: [
  4663. {
  4664. caption: 'damage',
  4665. value: currentLevel.bulletDamage
  4666. }, {
  4667. caption: 'reload',
  4668. value: this.level.settings.getReloadString(currentLevel.reloadTime, this.level.hospital.getUpgradeLevel('supply'))
  4669. }, {
  4670. caption: 'magazine size',
  4671. value: currentLevel.magazineSize
  4672. }, {
  4673. caption: 'shot precision',
  4674. value: this.level.settings.getPrecisionString(currentLevel.haziness)
  4675. }
  4676. ]
  4677. }, true, currentLevel.range);
  4678. return;
  4679. }
  4680. upLevel = this.level.settings.towers.pill['upgrade' + this.upgradeLevel];
  4681. return this.level.towerMenu.addButton(0, {
  4682. action: 'upgrade',
  4683. cost: {
  4684. value: upLevel.cost,
  4685. ressource: 'gold'
  4686. }
  4687. }, 'upgradeGoldBP', {
  4688. title: this.title,
  4689. description: this.description,
  4690. props: [
  4691. {
  4692. caption: 'damage',
  4693. value: upLevel.bulletDamage,
  4694. color: this.level.towerMenu.getPropColor(currentLevel.bulletDamage, upLevel.bulletDamage, 'damage')
  4695. }, {
  4696. caption: 'reload',
  4697. value: this.level.settings.getReloadString(upLevel.reloadTime, this.level.hospital.getUpgradeLevel('supply')),
  4698. color: this.level.towerMenu.getPropColor(currentLevel.reloadTime, upLevel.reloadTime, 'reloadTime')
  4699. }, {
  4700. caption: 'magazine size',
  4701. value: upLevel.magazineSize,
  4702. color: this.level.towerMenu.getPropColor(currentLevel.magazineSize, upLevel.magazineSize, 'magazineSize')
  4703. }, {
  4704. caption: 'shot precision',
  4705. value: this.level.settings.getPrecisionString(upLevel.haziness),
  4706. color: this.level.towerMenu.getPropColor(currentLevel.haziness, upLevel.haziness, 'haziness')
  4707. }
  4708. ]
  4709. }, true, [this.range, upLevel.range]);
  4710. };
  4711. TowerPill.prototype.upgrade = function(free, targetUpgradeLevel) {
  4712. var settings, timeBonus;
  4713. targetUpgradeLevel = targetUpgradeLevel || this.upgradeLevel;
  4714. settings = this.level.settings.towers.pill['upgrade' + targetUpgradeLevel];
  4715. timeBonus = this.level.getHospital().getAbilityResult('supply', this);
  4716. this.reloadTime = settings.reloadTime - (timeBonus ? timeBonus : 0);
  4717. this.range = settings.range;
  4718. this.magazineCounter = this.magazineSize = settings.magazineSize;
  4719. this.haziness = settings.haziness;
  4720. this.bulletDamage = settings.bulletDamage;
  4721. if (targetUpgradeLevel > 0) {
  4722. this.updateMagazineGauge();
  4723. }
  4724. this.upgradeLevel = targetUpgradeLevel + 1;
  4725. if (free) {
  4726. return;
  4727. }
  4728. this.level.addGold(-settings.cost);
  4729. return this.totalCost += settings.cost;
  4730. };
  4731. TowerPill.prototype.attack = function(disease) {
  4732. this.readyToFire = false;
  4733. this.magazineCounter--;
  4734. return this.level.bulletsLayer.addChild(new dka.BulletTablet(this, disease));
  4735. };
  4736. return TowerPill;
  4737. })(dka.TowerShoot);
  4738. }).call(this);
  4739. /*
  4740. * Copyright © Romain Fouquet, 2012-2015
  4741. * Copyright © Clément Joly, 2012-2015
  4742. #
  4743. * romain.fouquet18@gmail.com
  4744. * leowzukw@vmail.me
  4745. #
  4746. * This file is part of Diseases Killer Academy.
  4747. #
  4748. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4749. * it under the terms of the GNU Affero General Public License as published by
  4750. * the Free Software Foundation, either version 3 of the License, or
  4751. * (at your option) any later version.
  4752. #
  4753. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4754. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4755. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4756. * GNU Affero General Public License for more details.
  4757. #
  4758. * You should have received a copy of the GNU Affero General Public License
  4759. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4760. */
  4761. (function() {
  4762. 'use strict';
  4763. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4764. hasProp = {}.hasOwnProperty;
  4765. dka.TowerAntibiotic = (function(superClass) {
  4766. extend(TowerAntibiotic, superClass);
  4767. function TowerAntibiotic(x, y, location, level, free) {
  4768. this.type = 'antibiotic';
  4769. TowerAntibiotic.__super__.constructor.call(this, x, y, location, level, free);
  4770. this.buildingTime = level.settings.towers.antibiotic.buildingTime;
  4771. this.sprite.spriteSheet = dka.academy.assetManager.getAsset('spriteTower');
  4772. this.sprite.cache(-24, -24, 48, 48);
  4773. }
  4774. TowerAntibiotic.prototype.addEntities = function() {
  4775. var mg;
  4776. this.entities = new createjs.Container();
  4777. this.addChildAt(this.entities, 0);
  4778. mg = this.magazineGauge = new createjs.Shape().set({
  4779. x: -28,
  4780. y: -12,
  4781. regX: 4,
  4782. regY: 0
  4783. });
  4784. this.entities.addChild(mg);
  4785. mg.cache(0, 0, 8, 32);
  4786. return this.updateMagazineGauge();
  4787. };
  4788. TowerAntibiotic.prototype.showMenu = function() {
  4789. var currentLevel, upLevel;
  4790. this.level.towerMenu.load(this.x, this.y, this);
  4791. currentLevel = this.level.settings.towers.antibiotic['upgrade' + (this.upgradeLevel - 1)];
  4792. if (this.upgradeLevel === this.MAX_UPGRADE_LEVEL) {
  4793. this.level.towerMenu.addButton(0, null, 'upgradeGoldBP', {
  4794. title: this.title,
  4795. description: this.description,
  4796. props: [
  4797. {
  4798. caption: 'damage',
  4799. value: currentLevel.bulletDamage
  4800. }, {
  4801. caption: 'reload',
  4802. value: this.level.settings.getReloadString(currentLevel.reloadTime, this.level.hospital.getUpgradeLevel('supply'))
  4803. }, {
  4804. caption: 'magazine size',
  4805. value: currentLevel.magazineSize
  4806. }
  4807. ]
  4808. }, true, currentLevel.range);
  4809. return;
  4810. }
  4811. upLevel = this.level.settings.towers.antibiotic['upgrade' + this.upgradeLevel];
  4812. return this.level.towerMenu.addButton(0, {
  4813. action: 'upgrade',
  4814. cost: {
  4815. value: upLevel.cost,
  4816. ressource: 'gold'
  4817. }
  4818. }, 'upgradeGoldBP', {
  4819. title: this.title,
  4820. description: this.description,
  4821. props: [
  4822. {
  4823. caption: 'damage',
  4824. value: upLevel.bulletDamage,
  4825. color: this.level.towerMenu.getPropColor(currentLevel.bulletDamage, upLevel.bulletDamage, 'damage')
  4826. }, {
  4827. caption: 'reload',
  4828. value: this.level.settings.getReloadString(upLevel.reloadTime, this.level.hospital.getUpgradeLevel('supply')),
  4829. color: this.level.towerMenu.getPropColor(currentLevel.reloadTime, upLevel.reloadTime, 'reloadTime')
  4830. }, {
  4831. caption: 'magazine size',
  4832. value: upLevel.magazineSize,
  4833. color: this.level.towerMenu.getPropColor(currentLevel.magazineSize, upLevel.magazineSize, 'magazineSize')
  4834. }
  4835. ]
  4836. }, true, [this.range, upLevel.range]);
  4837. };
  4838. TowerAntibiotic.prototype.upgrade = function(free, targetUpgradeLevel) {
  4839. var bonus, settings;
  4840. targetUpgradeLevel = targetUpgradeLevel || this.upgradeLevel;
  4841. settings = this.level.settings.towers.antibiotic['upgrade' + targetUpgradeLevel];
  4842. bonus = this.level.getHospital().getAbilityResult('supply', this);
  4843. this.reloadTime = settings.reloadTime - (bonus ? bonus : 0);
  4844. this.range = settings.range;
  4845. this.magazineCounter = this.magazineSize = settings.magazineSize;
  4846. this.bulletRadiusDamage = settings.bulletRadiusDamage;
  4847. this.bulletDamage = settings.bulletDamage;
  4848. if (targetUpgradeLevel > 0) {
  4849. this.updateMagazineGauge();
  4850. }
  4851. this.upgradeLevel = targetUpgradeLevel + 1;
  4852. if (free) {
  4853. return;
  4854. }
  4855. this.level.addGold(-settings.cost);
  4856. return this.totalCost += settings.cost;
  4857. };
  4858. TowerAntibiotic.prototype.attack = function(disease) {
  4859. this.readyToFire = false;
  4860. this.magazineCounter--;
  4861. return this.level.bulletsLayer.addChild(new dka.BulletCapsule(this, disease));
  4862. };
  4863. return TowerAntibiotic;
  4864. })(dka.TowerShoot);
  4865. }).call(this);
  4866. /*
  4867. * Copyright © Romain Fouquet, 2012-2015
  4868. * Copyright © Clément Joly, 2012-2015
  4869. #
  4870. * romain.fouquet18@gmail.com
  4871. * leowzukw@vmail.me
  4872. #
  4873. * This file is part of Diseases Killer Academy.
  4874. #
  4875. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  4876. * it under the terms of the GNU Affero General Public License as published by
  4877. * the Free Software Foundation, either version 3 of the License, or
  4878. * (at your option) any later version.
  4879. #
  4880. * Diseases Killer Academy is distributed in the hope that it will be useful,
  4881. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4882. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4883. * GNU Affero General Public License for more details.
  4884. #
  4885. * You should have received a copy of the GNU Affero General Public License
  4886. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  4887. */
  4888. (function() {
  4889. 'use strict';
  4890. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  4891. hasProp = {}.hasOwnProperty;
  4892. dka.TowerHospital = (function(superClass) {
  4893. extend(TowerHospital, superClass);
  4894. function TowerHospital(position, level) {
  4895. TowerHospital.__super__.constructor.call(this);
  4896. this.x = position.x;
  4897. this.y = position.y;
  4898. this.level = level;
  4899. this.name = 'hospital';
  4900. this.set({
  4901. cursor: 'pointer'
  4902. });
  4903. this.image = dka.academy.assetManager.getAsset(level.hospitalImage);
  4904. this.set({
  4905. regX: level.hospitalSize.regX,
  4906. regY: level.hospitalSize.regY
  4907. });
  4908. this.maxUpgradeLevel = 2;
  4909. this.abilities = {
  4910. subsidies: {
  4911. upgradeLevel: 0
  4912. },
  4913. supply: {
  4914. upgradeLevel: 0
  4915. },
  4916. education: {
  4917. upgradeLevel: 0
  4918. }
  4919. };
  4920. this.cache(0, 0, level.hospitalSize.width, level.hospitalSize.height);
  4921. this.on('click', function() {
  4922. this.select();
  4923. this.level.dispatchEvent(new createjs.Event(this.level.HOSPITAL_CLICKED_EVENT, true, false));
  4924. return this.showMenu();
  4925. });
  4926. this.on('mouseover', this.lighten);
  4927. this.on('mouseout', function() {
  4928. if (this.selected) {
  4929. return;
  4930. }
  4931. return this.unselect();
  4932. });
  4933. }
  4934. TowerHospital.prototype.lighten = function() {
  4935. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(10))];
  4936. return this.updateCache();
  4937. };
  4938. TowerHospital.prototype.removeAllFilters = function() {
  4939. this.filters = [];
  4940. return this.updateCache();
  4941. };
  4942. TowerHospital.prototype.select = function() {
  4943. return this.selected = true;
  4944. };
  4945. TowerHospital.prototype.unselect = function() {
  4946. this.selected = false;
  4947. return this.removeAllFilters();
  4948. };
  4949. TowerHospital.prototype.showMenu = function() {
  4950. var abilities;
  4951. this.level.towerMenu.load(this.x, this.y, this);
  4952. abilities = this.level.settings.towers.hospital.abilities;
  4953. this.level.towerMenu.addButton(0, {
  4954. action: 'subsidies',
  4955. cost: {
  4956. value: abilities.subsidies.cost[this.abilities.subsidies.upgradeLevel],
  4957. ressource: 'gold'
  4958. }
  4959. }, 'subsidies', {
  4960. title: abilities.subsidies.title,
  4961. description: abilities.subsidies.description
  4962. }, true);
  4963. this.level.towerMenu.addButton(1, {
  4964. action: 'supply',
  4965. cost: {
  4966. value: abilities.supply.cost[this.abilities.supply.upgradeLevel],
  4967. ressource: 'gold'
  4968. }
  4969. }, 'crateBP', {
  4970. title: abilities.supply.title,
  4971. description: abilities.supply.description
  4972. }, true);
  4973. return this.level.towerMenu.addButton(2, {
  4974. action: 'education',
  4975. cost: {
  4976. value: abilities.education.cost[this.abilities.education.upgradeLevel],
  4977. ressource: 'gold'
  4978. }
  4979. }, 'educ', {
  4980. title: abilities.education.title,
  4981. description: abilities.education.description
  4982. }, true);
  4983. };
  4984. TowerHospital.prototype.execAction = function(action) {
  4985. return this.upgradeAbility(action);
  4986. };
  4987. TowerHospital.prototype.upgradeAbility = function(ability) {
  4988. if (this.abilities[ability].upgradeLevel === this.maxUpgradeLevel) {
  4989. return;
  4990. }
  4991. this.level.addGold(-this.level.settings.towers.hospital.abilities[ability].cost[this.abilities[ability].upgradeLevel]);
  4992. this.abilities[ability].upgradeLevel++;
  4993. if (ability === 'supply' || ability === 'education') {
  4994. return this.applyAbility(ability);
  4995. }
  4996. };
  4997. TowerHospital.prototype.applyAbility = function(ability) {
  4998. var disease, diseasesLayer, i, onlyTowersLayer, results, results1, tower;
  4999. switch (ability) {
  5000. case 'supply':
  5001. onlyTowersLayer = this.level.onlyTowersLayer;
  5002. results = [];
  5003. for (i in onlyTowersLayer.children) {
  5004. tower = onlyTowersLayer.children[i];
  5005. if (tower.typeTower === 'shoot') {
  5006. results.push(tower.betterSupply(this.getAbilityResult('supply', tower)));
  5007. } else {
  5008. results.push(void 0);
  5009. }
  5010. }
  5011. return results;
  5012. break;
  5013. case 'education':
  5014. diseasesLayer = this.level.diseasesLayer;
  5015. results1 = [];
  5016. for (disease in diseasesLayer.children) {
  5017. disease = diseasesLayer.children[disease];
  5018. results1.push(disease.educate(this.getAbilityResult('education', disease)));
  5019. }
  5020. return results1;
  5021. }
  5022. };
  5023. TowerHospital.prototype.getAbilityResult = function(ability, target) {
  5024. var abilityData, hospitalAbility, subsidy;
  5025. hospitalAbility = this.abilities[ability];
  5026. if (hospitalAbility.upgradeLevel === 0) {
  5027. return 0;
  5028. }
  5029. abilityData = this.level.settings.towers.hospital.abilities[ability];
  5030. switch (ability) {
  5031. case 'subsidies':
  5032. subsidy = abilityData.action[hospitalAbility.upgradeLevel - 1];
  5033. this.level.addGold(subsidy);
  5034. createjs.Tween.get({
  5035. useTicks: true
  5036. }).wait(30).call((function(_this) {
  5037. return function() {
  5038. var reward;
  5039. reward = new dka.BouncingText('+' + subsidy, 'bold 16px karnivoreRegular, Arial', dka.colors.gold, new createjs.Point(_this.x, _this.y));
  5040. return _this.level.ui.addChild(reward);
  5041. };
  5042. })(this));
  5043. return subsidy;
  5044. case 'supply':
  5045. return abilityData.action[hospitalAbility.upgradeLevel - 1];
  5046. case 'education':
  5047. return abilityData.action[hospitalAbility.upgradeLevel - 1];
  5048. }
  5049. };
  5050. TowerHospital.prototype.getUpgradeLevel = function(ability) {
  5051. if (this.abilities[ability]) {
  5052. return this.abilities[ability].upgradeLevel;
  5053. } else {
  5054. return null;
  5055. }
  5056. };
  5057. return TowerHospital;
  5058. })(createjs.Bitmap);
  5059. }).call(this);
  5060. /*
  5061. * Copyright © Romain Fouquet, 2012-2015
  5062. * Copyright © Clément Joly, 2012-2015
  5063. #
  5064. * romain.fouquet18@gmail.com
  5065. * leowzukw@vmail.me
  5066. #
  5067. * This file is part of Diseases Killer Academy.
  5068. #
  5069. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5070. * it under the terms of the GNU Affero General Public License as published by
  5071. * the Free Software Foundation, either version 3 of the License, or
  5072. * (at your option) any later version.
  5073. #
  5074. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5075. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5076. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5077. * GNU Affero General Public License for more details.
  5078. #
  5079. * You should have received a copy of the GNU Affero General Public License
  5080. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5081. */
  5082. (function() {
  5083. 'use strict';
  5084. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5085. hasProp = {}.hasOwnProperty;
  5086. dka.SpinningAntibody = (function(superClass) {
  5087. extend(SpinningAntibody, superClass);
  5088. function SpinningAntibody(mother, level, type) {
  5089. SpinningAntibody.__super__.constructor.call(this);
  5090. this.mother = mother;
  5091. this.level = level;
  5092. this.image = dka.academy.assetManager.getAsset('antibody' + type);
  5093. this.set({
  5094. regX: 8 / 2,
  5095. regY: 14 / 2
  5096. });
  5097. this.spinning = false;
  5098. this.posCounter = 0;
  5099. this.speed = 0.1;
  5100. this.orbitPos = new createjs.Point(3, 16);
  5101. this.widthOrbit = 65;
  5102. this.heigthOrbit = 24 * this.level.coeffPerspective;
  5103. this.minRotation = -20;
  5104. this.maxRotation = 20;
  5105. this.rotationSpeed = 3;
  5106. this.rotationDir = 1;
  5107. }
  5108. SpinningAntibody.prototype.spin = function() {
  5109. this.spinning = true;
  5110. return this.on('tick', this.tick);
  5111. };
  5112. SpinningAntibody.prototype.tick = function() {
  5113. if (this.level.ui.paused === true) {
  5114. return;
  5115. }
  5116. this.x = this.widthOrbit / 2 * Math.cos(this.posCounter) + this.orbitPos.x;
  5117. this.y = this.heigthOrbit / 2 * Math.sin(this.posCounter) - this.orbitPos.y;
  5118. if (this.y < -this.orbitPos.y) {
  5119. this.parent.setChildIndex(this, 0);
  5120. } else {
  5121. this.parent.addChild(this);
  5122. }
  5123. this.posCounter += this.speed;
  5124. this.rotation += this.rotationSpeed * this.rotationDir;
  5125. switch (false) {
  5126. case !(this.rotation >= this.maxRotation):
  5127. return this.rotationDir = -1;
  5128. case !(this.rotation <= this.minRotation):
  5129. return this.rotationDir = 1;
  5130. }
  5131. };
  5132. return SpinningAntibody;
  5133. })(createjs.Bitmap);
  5134. }).call(this);
  5135. /*
  5136. * Copyright © Romain Fouquet, 2012-2015
  5137. * Copyright © Clément Joly, 2012-2015
  5138. #
  5139. * romain.fouquet18@gmail.com
  5140. * leowzukw@vmail.me
  5141. #
  5142. * This file is part of Diseases Killer Academy.
  5143. #
  5144. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5145. * it under the terms of the GNU Affero General Public License as published by
  5146. * the Free Software Foundation, either version 3 of the License, or
  5147. * (at your option) any later version.
  5148. #
  5149. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5150. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5151. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5152. * GNU Affero General Public License for more details.
  5153. #
  5154. * You should have received a copy of the GNU Affero General Public License
  5155. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5156. */
  5157. (function() {
  5158. 'use strict';
  5159. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5160. hasProp = {}.hasOwnProperty;
  5161. dka.Antibody = (function(superClass) {
  5162. extend(Antibody, superClass);
  5163. function Antibody(x, y, rotation, level) {
  5164. Antibody.__super__.constructor.call(this);
  5165. this.initX = this.x = x;
  5166. this.initY = this.y = y;
  5167. this.initRotation = this.rotation = rotation;
  5168. this.level = level;
  5169. this.spreadRadius = 7;
  5170. this.spreadSpeed = 2;
  5171. this.range = 35;
  5172. this.speed = 0;
  5173. this.rotationRange = 10 + Math.random() * 7;
  5174. this.rotationSpeed = 4;
  5175. this.rotationDir = 1;
  5176. this.ttl = 30 * 10;
  5177. this.ttlCounter = 0;
  5178. this.removed = false;
  5179. this.diseaseFollowed = null;
  5180. this.state = 'spreading';
  5181. }
  5182. Antibody.prototype.tick = function() {
  5183. switch (this.state) {
  5184. case 'spreading':
  5185. return this.spread();
  5186. case 'idle':
  5187. return this.idle();
  5188. case 'following':
  5189. return this.followDisease();
  5190. case 'sticking':
  5191. return typeof this.stickingToDisease === "function" ? this.stickingToDisease() : void 0;
  5192. }
  5193. };
  5194. Antibody.prototype.spread = function() {
  5195. this.x += this.spreadSpeed * Math.cos((this.rotation - 90) * Math.PI / 180);
  5196. this.y += this.spreadSpeed * Math.sin((this.rotation - 90) * Math.PI / 180);
  5197. if (this.level.euclidDistance(this.initX, this.initY, this.x, this.y) >= this.spreadRadius) {
  5198. return this.state = 'idle';
  5199. }
  5200. };
  5201. Antibody.prototype.idle = function() {
  5202. this.rotation += this.rotationSpeed * this.rotationDir;
  5203. this.ttlCounter++;
  5204. if (this.ttlCounter >= this.ttl) {
  5205. if (!this.removed) {
  5206. this.remove();
  5207. }
  5208. }
  5209. switch (false) {
  5210. case !(Math.abs(this.initRotation - this.rotation) >= this.rotationRange):
  5211. this.rotationDir *= -1;
  5212. }
  5213. return this.anyDiseasesInRange();
  5214. };
  5215. Antibody.prototype.anyDiseasesInRange = function(road, path) {
  5216. var disease, i, l, range;
  5217. range = new geom.Ellipse(this.x, this.y, this.range, this.range * this.level.coeffPerspective);
  5218. i = 0;
  5219. l = this.level.diseasesLayer.numChildren;
  5220. while (i < l) {
  5221. disease = this.level.diseasesLayer.getChildAt(i);
  5222. if (disease.antibodiesCounter < disease.maxAntibodies && range.contains(disease.x, disease.y)) {
  5223. this.diseaseFollowed = disease;
  5224. this.diseaseFollowed.antibodiesCounter++;
  5225. this.state = 'following';
  5226. }
  5227. i++;
  5228. }
  5229. return false;
  5230. };
  5231. Antibody.prototype.followDisease = function() {
  5232. var angle, dstToDisease;
  5233. if (!this.diseaseFollowed) {
  5234. this.parent.removeChild(this);
  5235. }
  5236. this.speed = this.diseaseFollowed.speed * 1.5;
  5237. dstToDisease = this.level.euclidDistance(this.x, this.y, this.diseaseFollowed.x, this.diseaseFollowed.y);
  5238. angle = Math.atan2(this.diseaseFollowed.y - this.y, this.diseaseFollowed.x - this.x);
  5239. this.rotation = angle / Math.PI * 180 + 90;
  5240. if (dstToDisease < this.diseaseFollowed.radius + this.speed) {
  5241. this.speed = dstToDisease - (this.diseaseFollowed.radius + this.regY);
  5242. this.stickToDisease();
  5243. }
  5244. this.x += this.speed * Math.cos(angle);
  5245. return this.y += this.speed * Math.sin(angle);
  5246. };
  5247. Antibody.prototype.stickToDisease = function() {
  5248. var localPosition;
  5249. this.parent.removeChild(this);
  5250. this.diseaseFollowed.addAntibody(this);
  5251. localPosition = this.diseaseFollowed.globalToLocal(this.x, this.y);
  5252. this.x = localPosition.x;
  5253. this.y = localPosition.y;
  5254. return this.state = 'sticking';
  5255. };
  5256. Antibody.prototype.remove = function() {
  5257. createjs.Tween.get(this, {
  5258. useTicks: true
  5259. }).to({
  5260. alpha: 0
  5261. }, 30).call(function() {
  5262. return this.parent.removeChild(this);
  5263. });
  5264. return this.removed = true;
  5265. };
  5266. return Antibody;
  5267. })(createjs.Bitmap);
  5268. }).call(this);
  5269. /*
  5270. * Copyright © Romain Fouquet, 2012-2015
  5271. * Copyright © Clément Joly, 2012-2015
  5272. #
  5273. * romain.fouquet18@gmail.com
  5274. * leowzukw@vmail.me
  5275. #
  5276. * This file is part of Diseases Killer Academy.
  5277. *
  5278. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5279. * it under the terms of the GNU Affero General Public License as published by
  5280. * the Free Software Foundation, either version 3 of the License, or
  5281. * (at your option) any later version.
  5282. *
  5283. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5284. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5285. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5286. * GNU Affero General Public License for more details.
  5287. *
  5288. * You should have received a copy of the GNU Affero General Public License
  5289. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5290. */
  5291. (function() {
  5292. 'use strict';
  5293. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5294. hasProp = {}.hasOwnProperty;
  5295. dka.AntibodyIgG = (function(superClass) {
  5296. extend(AntibodyIgG, superClass);
  5297. function AntibodyIgG(x, y, rotation, level) {
  5298. AntibodyIgG.__super__.constructor.call(this, x, y, rotation, level);
  5299. this.image = dka.academy.assetManager.getAsset('antibodyIgG');
  5300. this.set({
  5301. regX: 8 / 2,
  5302. regY: 14 / 2
  5303. });
  5304. }
  5305. AntibodyIgG.prototype.stickToDisease = function() {
  5306. AntibodyIgG.__super__.stickToDisease.call(this);
  5307. return this.diseaseFollowed.preventMultiplication();
  5308. };
  5309. return AntibodyIgG;
  5310. })(dka.Antibody);
  5311. }).call(this);
  5312. /*
  5313. * Copyright © Romain Fouquet, 2012-2015
  5314. * Copyright © Clément Joly, 2012-2015
  5315. #
  5316. * romain.fouquet18@gmail.com
  5317. * leowzukw@vmail.me
  5318. #
  5319. * This file is part of Diseases Killer Academy.
  5320. *
  5321. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5322. * it under the terms of the GNU Affero General Public License as published by
  5323. * the Free Software Foundation, either version 3 of the License, or
  5324. * (at your option) any later version.
  5325. *
  5326. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5327. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5328. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5329. * GNU Affero General Public License for more details.
  5330. *
  5331. * You should have received a copy of the GNU Affero General Public License
  5332. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5333. */
  5334. (function() {
  5335. 'use strict';
  5336. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5337. hasProp = {}.hasOwnProperty;
  5338. dka.AntibodyIgA = (function(superClass) {
  5339. extend(AntibodyIgA, superClass);
  5340. function AntibodyIgA(x, y, rotation, level) {
  5341. AntibodyIgA.__super__.constructor.call(this, x, y, rotation, level);
  5342. this.image = dka.academy.assetManager.getAsset('antibodyIgA');
  5343. this.set({
  5344. regX: 8 / 2,
  5345. regY: 24 / 2
  5346. });
  5347. }
  5348. AntibodyIgA.prototype.stickToDisease = function() {
  5349. AntibodyIgA.__super__.stickToDisease.call(this);
  5350. this.diseaseFollowed.brake(0.8);
  5351. return this.diseaseFollowed.preventMultiplication();
  5352. };
  5353. return AntibodyIgA;
  5354. })(dka.Antibody);
  5355. }).call(this);
  5356. /*
  5357. * Copyright © Romain Fouquet, 2012-2015
  5358. * Copyright © Clément Joly, 2012-2015
  5359. #
  5360. * romain.fouquet18@gmail.com
  5361. * leowzukw@vmail.me
  5362. #
  5363. * This file is part of Diseases Killer Academy.
  5364. *
  5365. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5366. * it under the terms of the GNU Affero General Public License as published by
  5367. * the Free Software Foundation, either version 3 of the License, or
  5368. * (at your option) any later version.
  5369. *
  5370. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5371. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5372. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5373. * GNU Affero General Public License for more details.
  5374. *
  5375. * You should have received a copy of the GNU Affero General Public License
  5376. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5377. */
  5378. (function() {
  5379. 'use strict';
  5380. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5381. hasProp = {}.hasOwnProperty;
  5382. dka.AntibodyIgM = (function(superClass) {
  5383. extend(AntibodyIgM, superClass);
  5384. function AntibodyIgM(x, y, rotation, level) {
  5385. AntibodyIgM.__super__.constructor.call(this, x, y, rotation, level);
  5386. this.image = dka.academy.assetManager.getAsset('antibodyIgM');
  5387. this.set({
  5388. regX: 20 / 2,
  5389. regY: 20 / 2
  5390. });
  5391. this.reloadTime = 10;
  5392. this.reloadCounter = 0;
  5393. }
  5394. AntibodyIgM.prototype.stickingToDisease = function() {
  5395. this.reloadCounter++;
  5396. if (this.reloadCounter >= this.reloadTime) {
  5397. this.reloadCounter = 0;
  5398. return this.diseaseFollowed.beDamaged(3);
  5399. }
  5400. };
  5401. return AntibodyIgM;
  5402. })(dka.Antibody);
  5403. }).call(this);
  5404. /*
  5405. * Copyright © Romain Fouquet, 2012-2015
  5406. * Copyright © Clément Joly, 2012-2015
  5407. #
  5408. * romain.fouquet18@gmail.com
  5409. * leowzukw@vmail.me
  5410. #
  5411. * This file is part of Diseases Killer Academy.
  5412. #
  5413. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5414. * it under the terms of the GNU Affero General Public License as published by
  5415. * the Free Software Foundation, either version 3 of the License, or
  5416. * (at your option) any later version.
  5417. #
  5418. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5419. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5420. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5421. * GNU Affero General Public License for more details.
  5422. #
  5423. * You should have received a copy of the GNU Affero General Public License
  5424. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5425. */
  5426. (function() {
  5427. 'use strict';
  5428. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5429. hasProp = {}.hasOwnProperty;
  5430. dka.TowerCell = (function(superClass) {
  5431. extend(TowerCell, superClass);
  5432. function TowerCell(x, y, location, level, free) {
  5433. var cellPath, settings;
  5434. TowerCell.__super__.constructor.call(this, x, y, location, level, free);
  5435. this.typeTower = 'cell';
  5436. this.cellPatrol = null;
  5437. this.spawnPoint = new createjs.Point(this.x, this.y);
  5438. settings = this.level.settings.towers[this.type].upgrade0;
  5439. cellPath = this.level.towers[this.location].cell;
  5440. this.spawnRoad = this.level.waypoints[cellPath.road];
  5441. this.spawnPath = this.spawnRoad[cellPath.path];
  5442. this.cellSpeed = settings.cellSpeed;
  5443. }
  5444. TowerCell.prototype.ready = function() {
  5445. this.sprite.gotoAndStop(1);
  5446. return this.sprite.updateCache();
  5447. };
  5448. TowerCell.prototype.closestPathPoint = function(path) {
  5449. var closestPoint, dst, i, index, j, len, min, waypoint;
  5450. if (path == null) {
  5451. path = this.spawnPath;
  5452. }
  5453. min = -1;
  5454. closestPoint = new createjs.Point();
  5455. for (i = j = 0, len = path.length; j < len; i = ++j) {
  5456. waypoint = path[i];
  5457. dst = this.level.euclidDistance(waypoint.x, waypoint.y, this.x, this.y);
  5458. if (dst < min || min === -1) {
  5459. min = dst;
  5460. index = i;
  5461. closestPoint = waypoint;
  5462. }
  5463. }
  5464. return [closestPoint, index];
  5465. };
  5466. TowerCell.prototype.tick = function() {
  5467. var target;
  5468. if (this.cellPatrol) {
  5469. return;
  5470. }
  5471. target = this.getTarget();
  5472. if (target) {
  5473. return this.spawn(this.spawnPath, target);
  5474. }
  5475. };
  5476. return TowerCell;
  5477. })(dka.Tower);
  5478. }).call(this);
  5479. /*
  5480. * Copyright © Romain Fouquet, 2012-2015
  5481. * Copyright © Clément Joly, 2012-2015
  5482. #
  5483. * romain.fouquet18@gmail.com
  5484. * leowzukw@vmail.me
  5485. #
  5486. * This file is part of Diseases Killer Academy.
  5487. #
  5488. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5489. * it under the terms of the GNU Affero General Public License as published by
  5490. * the Free Software Foundation, either version 3 of the License, or
  5491. * (at your option) any later version.
  5492. #
  5493. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5494. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5495. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5496. * GNU Affero General Public License for more details.
  5497. #
  5498. * You should have received a copy of the GNU Affero General Public License
  5499. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5500. */
  5501. (function() {
  5502. 'use strict';
  5503. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5504. hasProp = {}.hasOwnProperty;
  5505. dka.TowerCellB = (function(superClass) {
  5506. extend(TowerCellB, superClass);
  5507. function TowerCellB(x, y, location, level, free) {
  5508. this.type = 'cellB';
  5509. TowerCellB.__super__.constructor.call(this, x, y, location, level, free);
  5510. this.buildingTime = level.settings.towers.cellB.buildingTime;
  5511. this.sprite.spriteSheet = dka.academy.assetManager.getAsset('spriteTowerCellB');
  5512. this.sprite.cache(-24, -24, 48, 48);
  5513. this.doneTypes = [];
  5514. this.spinningAntibodies = [];
  5515. }
  5516. TowerCellB.prototype.tick = function() {
  5517. if (this.buildingMode) {
  5518. this.building();
  5519. return;
  5520. }
  5521. return TowerCellB.__super__.tick.call(this);
  5522. };
  5523. TowerCellB.prototype.getTarget = function(road, path) {
  5524. var i, l;
  5525. i = 0;
  5526. l = this.level.diseasesLayer.numChildren;
  5527. while (i < l) {
  5528. if (this.inRange(this.level.diseasesLayer.getChildAt(i).x, this.level.diseasesLayer.getChildAt(i).y)) {
  5529. return this.level.diseasesLayer.getChildAt(i);
  5530. }
  5531. i++;
  5532. }
  5533. return false;
  5534. };
  5535. TowerCellB.prototype.showMenu = function() {
  5536. var currentLevel, upLevel;
  5537. this.level.towerMenu.load(this.x, this.y, this);
  5538. currentLevel = this.level.settings.towers.cellB['upgrade' + (this.upgradeLevel - 1)];
  5539. if (this.upgradeLevel === this.MAX_UPGRADE_LEVEL) {
  5540. this.level.towerMenu.addButton(0, null, 'upgradeDnaBP', {
  5541. title: this.title,
  5542. description: this.description,
  5543. props: [
  5544. {
  5545. caption: 'move speed',
  5546. value: this.level.settings.getMoveString(currentLevel.cellSpeed)
  5547. }, {
  5548. caption: 'lifespan',
  5549. value: currentLevel.cellTtl
  5550. }
  5551. ]
  5552. }, true, currentLevel.range);
  5553. return;
  5554. }
  5555. upLevel = this.level.settings.towers.cellB['upgrade' + this.upgradeLevel];
  5556. return this.level.towerMenu.addButton(0, {
  5557. action: 'upgrade',
  5558. cost: {
  5559. value: upLevel.cost,
  5560. ressource: 'dna'
  5561. }
  5562. }, 'upgradeDnaBP', {
  5563. title: this.title,
  5564. description: this.description,
  5565. props: [
  5566. {
  5567. caption: 'move speed',
  5568. value: this.level.settings.getMoveString(upLevel.cellSpeed),
  5569. color: this.level.towerMenu.getPropColor(currentLevel.cellSpeed, upLevel.cellSpeed, 'cellSpeed')
  5570. }, {
  5571. caption: 'lifespan',
  5572. value: upLevel.cellTtl,
  5573. color: this.level.towerMenu.getPropColor(currentLevel.cellTtl, upLevel.cellTtl, 'cellTtl')
  5574. }
  5575. ]
  5576. }, true, [currentLevel.range, upLevel.range]);
  5577. };
  5578. TowerCellB.prototype.upgrade = function(free, targetUpgradeLevel) {
  5579. var settings;
  5580. targetUpgradeLevel = targetUpgradeLevel || this.upgradeLevel;
  5581. settings = this.level.settings.towers.cellB['upgrade' + targetUpgradeLevel];
  5582. this.range = settings.range;
  5583. this.cellSpeed = settings.cellSpeed;
  5584. this.cellTtl = settings.cellTtl;
  5585. this.upgradeLevel = targetUpgradeLevel + 1;
  5586. if (free) {
  5587. return;
  5588. }
  5589. this.level.addDna(-settings.cost);
  5590. return this.totalCost += settings.cost;
  5591. };
  5592. TowerCellB.prototype.getRandomCellType = function() {
  5593. var rand;
  5594. rand = Math.random();
  5595. switch (false) {
  5596. case !(rand < 15 / 100):
  5597. return 'IgM';
  5598. case !(rand < (15 + 25) / 100):
  5599. return 'IgA';
  5600. case !(rand < 1):
  5601. return 'IgG';
  5602. }
  5603. };
  5604. TowerCellB.prototype.addType = function(type) {
  5605. if (this.doneTypes.indexOf(type) === -1) {
  5606. this.doneTypes.push(type);
  5607. return true;
  5608. }
  5609. return false;
  5610. };
  5611. TowerCellB.prototype.spawn = function(path) {
  5612. var memory, type;
  5613. type = this.getRandomCellType();
  5614. memory = this.addType(type);
  5615. if (memory) {
  5616. this.addSpinningAntibody(type);
  5617. }
  5618. this.cellPatrol = new dka.CellPlasma(this, this.level, path, type, !memory);
  5619. return this.level.cellsPatrolLayer.addChild(this.cellPatrol);
  5620. };
  5621. TowerCellB.prototype.addSpinningAntibody = function(type) {
  5622. var antibody;
  5623. antibody = new dka.SpinningAntibody(this, this.level, type);
  5624. antibody.spin();
  5625. this.spinningAntibodies.push(antibody);
  5626. return this.addChild(antibody);
  5627. };
  5628. return TowerCellB;
  5629. })(dka.TowerCell);
  5630. }).call(this);
  5631. /*
  5632. * Copyright © Romain Fouquet, 2012-2015
  5633. * Copyright © Clément Joly, 2012-2015
  5634. #
  5635. * romain.fouquet18@gmail.com
  5636. * leowzukw@vmail.me
  5637. #
  5638. * This file is part of Diseases Killer Academy.
  5639. #
  5640. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5641. * it under the terms of the GNU Affero General Public License as published by
  5642. * the Free Software Foundation, either version 3 of the License, or
  5643. * (at your option) any later version.
  5644. #
  5645. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5646. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5647. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5648. * GNU Affero General Public License for more details.
  5649. #
  5650. * You should have received a copy of the GNU Affero General Public License
  5651. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5652. */
  5653. (function() {
  5654. 'use strict';
  5655. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5656. hasProp = {}.hasOwnProperty;
  5657. dka.TowerCellMacrophage = (function(superClass) {
  5658. extend(TowerCellMacrophage, superClass);
  5659. function TowerCellMacrophage(x, y, location, level, free) {
  5660. this.type = 'cellMacrophage';
  5661. TowerCellMacrophage.__super__.constructor.call(this, x, y, location, level, free);
  5662. this.buildingTime = level.settings.towers.cellMacrophage.buildingTime;
  5663. this.sprite.spriteSheet = dka.academy.assetManager.getAsset('spriteTowerCellMacrophage');
  5664. this.sprite.cache(-24, -24, 48, 48);
  5665. this.MIN_ANTIBODIES = 1;
  5666. this.respawnCounter = 0;
  5667. this.haveToRespawn = false;
  5668. this.readyToRespawn = true;
  5669. }
  5670. TowerCellMacrophage.prototype.tick = function() {
  5671. if (this.buildingMode) {
  5672. this.building();
  5673. return;
  5674. }
  5675. TowerCellMacrophage.__super__.tick.call(this);
  5676. if (!this.haveToRespawn) {
  5677. return;
  5678. }
  5679. this.respawnCounter++;
  5680. if (this.respawnCounter >= this.respawnReload) {
  5681. this.haveToRespawn = false;
  5682. this.respawnCounter = 0;
  5683. return this.readyToRespawn = true;
  5684. }
  5685. };
  5686. TowerCellMacrophage.prototype.showMenu = function() {
  5687. var currentLevel, upLevel;
  5688. this.level.towerMenu.load(this.x, this.y, this);
  5689. currentLevel = this.level.settings.towers.cellMacrophage['upgrade' + (this.upgradeLevel - 1)];
  5690. if (this.upgradeLevel === this.MAX_UPGRADE_LEVEL) {
  5691. this.level.towerMenu.addButton(0, null, 'upgradeDnaBP', {
  5692. title: this.title,
  5693. description: this.description,
  5694. props: [
  5695. {
  5696. caption: 'move',
  5697. value: this.level.settings.getMoveString(currentLevel.cellSpeed)
  5698. }, {
  5699. caption: 'lifespan',
  5700. value: currentLevel.cellTtl
  5701. }, {
  5702. caption: 'damage',
  5703. value: currentLevel.cellDamage
  5704. }, {
  5705. caption: 'respawn',
  5706. value: this.level.settings.getRespawnString(currentLevel.respawnReload)
  5707. }
  5708. ]
  5709. }, true, currentLevel.range);
  5710. return;
  5711. }
  5712. upLevel = this.level.settings.towers.cellMacrophage['upgrade' + this.upgradeLevel];
  5713. return this.level.towerMenu.addButton(0, {
  5714. action: 'upgrade',
  5715. cost: {
  5716. value: upLevel.cost,
  5717. ressource: 'dna'
  5718. }
  5719. }, 'upgradeDnaBP', {
  5720. title: this.title,
  5721. description: this.description,
  5722. props: [
  5723. {
  5724. caption: 'move',
  5725. value: this.level.settings.getMoveString(upLevel.cellSpeed),
  5726. color: this.level.towerMenu.getPropColor(currentLevel.cellSpeed, upLevel.cellSpeed, 'cellSpeed')
  5727. }, {
  5728. caption: 'lifespan',
  5729. value: upLevel.cellTtl,
  5730. color: this.level.towerMenu.getPropColor(currentLevel.cellTtl, upLevel.cellTtl, 'cellTtl')
  5731. }, {
  5732. caption: 'damage',
  5733. value: upLevel.cellDamage,
  5734. color: this.level.towerMenu.getPropColor(currentLevel.cellDamage, upLevel.cellDamage, 'cellDamage')
  5735. }, {
  5736. caption: 'respawn',
  5737. value: this.level.settings.getRespawnString(upLevel.respawnReload),
  5738. color: this.level.towerMenu.getPropColor(currentLevel.respawnReload, upLevel.respawnReload, 'reloadTime')
  5739. }
  5740. ]
  5741. }, true, [currentLevel.range, upLevel.range]);
  5742. };
  5743. TowerCellMacrophage.prototype.upgrade = function(free, targetUpgradeLevel) {
  5744. var settings;
  5745. targetUpgradeLevel = targetUpgradeLevel || this.upgradeLevel;
  5746. settings = this.level.settings.towers.cellMacrophage['upgrade' + targetUpgradeLevel];
  5747. this.range = settings.range;
  5748. this.cellSpeed = settings.cellSpeed;
  5749. this.cellTtl = settings.cellTtl;
  5750. this.cellDamage = settings.cellDamage;
  5751. this.respawnReload = settings.respawnReload;
  5752. this.upgradeLevel = targetUpgradeLevel + 1;
  5753. if (free) {
  5754. return;
  5755. }
  5756. this.level.addDna(-settings.cost);
  5757. return this.totalCost += settings.cost;
  5758. };
  5759. TowerCellMacrophage.prototype.getTarget = function() {
  5760. var disease, i, target;
  5761. target = null;
  5762. disease = null;
  5763. i = 0;
  5764. while (i < this.level.diseasesLayer.numChildren) {
  5765. disease = this.level.diseasesLayer.getChildAt(i);
  5766. if (disease.isTargetable() && disease.antibodiesCounter >= this.MIN_ANTIBODIES && this.inRange(disease.x, disease.y)) {
  5767. if (!target || disease.distanceToExit < target.distanceToExit) {
  5768. if (disease.road === this.spawnRoad) {
  5769. target = disease;
  5770. }
  5771. }
  5772. }
  5773. i++;
  5774. }
  5775. if (target) {
  5776. return target;
  5777. }
  5778. return false;
  5779. };
  5780. TowerCellMacrophage.prototype.spawn = function(path, disease) {
  5781. if (!this.readyToRespawn) {
  5782. return;
  5783. }
  5784. this.readyToRespawn = false;
  5785. this.cellPatrol = new dka.CellMacrophage(this, this.level, path);
  5786. return this.level.cellsPatrolLayer.addChild(this.cellPatrol);
  5787. };
  5788. return TowerCellMacrophage;
  5789. })(dka.TowerCell);
  5790. }).call(this);
  5791. /*
  5792. * Copyright © Romain Fouquet, 2012-2015
  5793. * Copyright © Clément Joly, 2012-2015
  5794. #
  5795. * romain.fouquet18@gmail.com
  5796. * leowzukw@vmail.me
  5797. #
  5798. * This file is part of Diseases Killer Academy.
  5799. #
  5800. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5801. * it under the terms of the GNU Affero General Public License as published by
  5802. * the Free Software Foundation, either version 3 of the License, or
  5803. * (at your option) any later version.
  5804. #
  5805. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5806. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5807. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5808. * GNU Affero General Public License for more details.
  5809. #
  5810. * You should have received a copy of the GNU Affero General Public License
  5811. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5812. */
  5813. (function() {
  5814. 'use strict';
  5815. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5816. hasProp = {}.hasOwnProperty;
  5817. dka.CellPlasma = (function(superClass) {
  5818. extend(CellPlasma, superClass);
  5819. function CellPlasma(mother, level, path, type, memory) {
  5820. var deltaX, deltaY, index, p, ref;
  5821. CellPlasma.__super__.constructor.call(this);
  5822. this.mother = mother;
  5823. this.level = level;
  5824. this.path = path;
  5825. this.type = type;
  5826. this.memory = memory;
  5827. this.sprite = new createjs.Bitmap(dka.academy.assetManager.getAsset('CellB1'));
  5828. this.sprite.set({
  5829. regX: 8,
  5830. regY: 8
  5831. });
  5832. this.addChild(this.sprite);
  5833. this.x = mother.spawnPoint.x;
  5834. this.y = mother.spawnPoint.y;
  5835. this.speed = mother.cellSpeed;
  5836. this.direction = 1;
  5837. ref = mother.closestPathPoint(), p = ref[0], index = ref[1];
  5838. this.spawnIndex = this.pointToReach = index;
  5839. this.ttl = mother.cellTtl;
  5840. this.ttlCounter = 0;
  5841. this.t0 = 0;
  5842. this.t1 = 20;
  5843. this.spawnSpeed = 30;
  5844. this.spawnReloadCounter = 0;
  5845. this.spawnRate = memory ? 2 : 1;
  5846. deltaX = this.path[this.pointToReach].x - this.x;
  5847. deltaY = this.path[this.pointToReach].y - this.y;
  5848. this.speedX = deltaX / this.t1;
  5849. this.speedY = (deltaY - this.t1 * this.t1 / 2) / this.t1;
  5850. this.state = 'jumping';
  5851. }
  5852. CellPlasma.prototype.tick = function() {
  5853. if (this.state === 'jumping') {
  5854. this.jump();
  5855. return;
  5856. }
  5857. this.checkMotherRange();
  5858. this.move();
  5859. if (this.spawnReloadCounter < this.spawnSpeed) {
  5860. return this.spawnReloadCounter++;
  5861. } else {
  5862. this.spawnReloadCounter = 0;
  5863. return this.spawnAntibodies();
  5864. }
  5865. };
  5866. CellPlasma.prototype.checkMotherRange = function() {
  5867. if (!this.mother.inRange(this.x, this.y)) {
  5868. return this.uTurn();
  5869. }
  5870. };
  5871. CellPlasma.prototype.jump = function() {
  5872. this.x = this.mother.x + this.t0 * this.speedX;
  5873. this.y = this.mother.y + this.t0 * this.speedY + this.t0 * this.t0 / 2;
  5874. this.t0++;
  5875. if (this.t0 >= this.t1) {
  5876. return this.state = 'spawning';
  5877. }
  5878. };
  5879. CellPlasma.prototype.move = function() {
  5880. var angle, deltaX, deltaY, nxtX, nxtY, pointToReach;
  5881. pointToReach = this.path[this.pointToReach];
  5882. deltaX = pointToReach.x - this.x;
  5883. deltaY = pointToReach.y - this.y;
  5884. this.dstToWaypoint = this.level.euclidDistance(this.x, this.y, pointToReach.x, pointToReach.y);
  5885. if (this.dstToWaypoint < this.speed) {
  5886. this.reachingWP();
  5887. }
  5888. angle = Math.atan2(deltaY, deltaX);
  5889. nxtX = this.x + this.speed * Math.cos(angle);
  5890. nxtY = this.y + this.speed * Math.sin(angle);
  5891. this.sprite.rotation = angle / Math.PI * 180 + 90;
  5892. this.x = nxtX;
  5893. this.y = nxtY;
  5894. if (!this.level.isVisibleByPlayer(this.x, this.y)) {
  5895. return this.uTurn();
  5896. }
  5897. };
  5898. CellPlasma.prototype.reachingWP = function() {
  5899. this.pointToReach += this.direction;
  5900. if (this.pointToReach === this.spawnIndex) {
  5901. this.ttlCounter++;
  5902. if (this.ttlCounter >= this.ttl) {
  5903. return this.die();
  5904. }
  5905. }
  5906. };
  5907. CellPlasma.prototype.uTurn = function() {
  5908. this.direction *= -1;
  5909. return this.reachingWP();
  5910. };
  5911. CellPlasma.prototype.die = function() {
  5912. return this.remove();
  5913. };
  5914. CellPlasma.prototype.spawnAntibodies = function() {
  5915. var antibody, i, j, piece, ref, results, rotation;
  5916. piece = 360 / this.spawnRate;
  5917. results = [];
  5918. for (i = j = 0, ref = this.spawnRate; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
  5919. rotation = Math.random() * 30 * (piece - 30) * (i + piece);
  5920. switch (this.type) {
  5921. case 'IgG':
  5922. antibody = new dka.AntibodyIgG(this.x, this.y, rotation, this.level);
  5923. break;
  5924. case 'IgA':
  5925. antibody = new dka.AntibodyIgA(this.x, this.y, rotation, this.level);
  5926. break;
  5927. case 'IgM':
  5928. antibody = new dka.AntibodyIgM(this.x, this.y, rotation, this.level);
  5929. }
  5930. results.push(this.level.antibodiesLayer.addChild(antibody));
  5931. }
  5932. return results;
  5933. };
  5934. CellPlasma.prototype.remove = function() {
  5935. this.mother.cellPatrol = null;
  5936. return this.parent.removeChild(this);
  5937. };
  5938. return CellPlasma;
  5939. })(createjs.Container);
  5940. }).call(this);
  5941. /*
  5942. * Copyright © Romain Fouquet, 2012-2015
  5943. * Copyright © Clément Joly, 2012-2015
  5944. #
  5945. * romain.fouquet18@gmail.com
  5946. * leowzukw@vmail.me
  5947. #
  5948. * This file is part of Diseases Killer Academy.
  5949. #
  5950. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  5951. * it under the terms of the GNU Affero General Public License as published by
  5952. * the Free Software Foundation, either version 3 of the License, or
  5953. * (at your option) any later version.
  5954. #
  5955. * Diseases Killer Academy is distributed in the hope that it will be useful,
  5956. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5957. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5958. * GNU Affero General Public License for more details.
  5959. #
  5960. * You should have received a copy of the GNU Affero General Public License
  5961. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  5962. */
  5963. (function() {
  5964. 'use strict';
  5965. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  5966. hasProp = {}.hasOwnProperty;
  5967. dka.CellMacrophage = (function(superClass) {
  5968. extend(CellMacrophage, superClass);
  5969. function CellMacrophage(mother, level) {
  5970. CellMacrophage.__super__.constructor.call(this);
  5971. this.mother = mother;
  5972. this.level = level;
  5973. this.hitRadius = 16;
  5974. this.sprite = new createjs.Bitmap(dka.academy.assetManager.getAsset('CellMacrophage'));
  5975. this.sprite.set({
  5976. regX: 16,
  5977. regY: 16
  5978. });
  5979. this.addChild(this.sprite);
  5980. this.x = mother.spawnPoint.x;
  5981. this.y = mother.spawnPoint.y;
  5982. this.speed = mother.cellSpeed;
  5983. this.direction = -1;
  5984. this.damage = mother.cellDamage;
  5985. this.ttl = mother.cellTtl;
  5986. this.ttlCounter = 0;
  5987. this.targetDisease = null;
  5988. this.state = 'following';
  5989. }
  5990. CellMacrophage.prototype.tick = function() {
  5991. switch (this.state) {
  5992. case 'following':
  5993. return this.move();
  5994. case 'eating':
  5995. return this.eat();
  5996. }
  5997. };
  5998. CellMacrophage.prototype.move = function() {
  5999. var angle, target;
  6000. target = this.mother.getTarget();
  6001. if (!target) {
  6002. this.remove();
  6003. return;
  6004. }
  6005. angle = Math.atan2(target.y - this.y, target.x - this.x);
  6006. this.x += this.speed * Math.cos(angle);
  6007. this.y += this.speed * Math.sin(angle);
  6008. if (this.level.euclidDistance(target.x, target.y, this.x, this.y) < 5) {
  6009. target.preventMultiplication();
  6010. target.stopped = true;
  6011. this.disease = target;
  6012. return this.state = 'eating';
  6013. }
  6014. };
  6015. CellMacrophage.prototype.eat = function() {
  6016. if (this.disease.beDamaged(this.damage)) {
  6017. this.ttlCounter++;
  6018. if (this.ttlCounter >= this.ttl) {
  6019. this.remove();
  6020. return;
  6021. }
  6022. return this.state = 'following';
  6023. }
  6024. };
  6025. CellMacrophage.prototype.remove = function() {
  6026. this.mother.cellPatrol = null;
  6027. this.parent.removeChild(this);
  6028. return this.mother.haveToRespawn = true;
  6029. };
  6030. return CellMacrophage;
  6031. })(createjs.Container);
  6032. }).call(this);
  6033. /*
  6034. * Copyright © Romain Fouquet, 2012-2015
  6035. * Copyright © Clément Joly, 2012-2015
  6036. #
  6037. * romain.fouquet18@gmail.com
  6038. * leowzukw@vmail.me
  6039. #
  6040. * This file is part of Diseases Killer Academy.
  6041. #
  6042. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6043. * it under the terms of the GNU Affero General Public License as published by
  6044. * the Free Software Foundation, either version 3 of the License, or
  6045. * (at your option) any later version.
  6046. #
  6047. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6048. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6049. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6050. * GNU Affero General Public License for more details.
  6051. #
  6052. * You should have received a copy of the GNU Affero General Public License
  6053. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6054. */
  6055. (function() {
  6056. 'use strict';
  6057. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  6058. hasProp = {}.hasOwnProperty;
  6059. dka.TowerLocation = (function(superClass) {
  6060. extend(TowerLocation, superClass);
  6061. function TowerLocation(x, y, level, index) {
  6062. TowerLocation.__super__.constructor.call(this, dka.academy.assetManager.getAsset('towerLocation'));
  6063. this.x = x;
  6064. this.y = y;
  6065. this.level = level;
  6066. this.index = index;
  6067. this.set({
  6068. regX: 24,
  6069. regY: 24,
  6070. cursor: 'pointer'
  6071. });
  6072. this.selected = false;
  6073. this.cache(0, 0, 48, 48);
  6074. this.on('click', this.showMenu);
  6075. this.on('mouseover', this.lighten);
  6076. this.on('mouseout', function() {
  6077. if (this.selected) {
  6078. return;
  6079. }
  6080. return this.unselect();
  6081. });
  6082. }
  6083. TowerLocation.prototype.lighten = function() {
  6084. this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
  6085. return this.updateCache();
  6086. };
  6087. TowerLocation.prototype.removeAllFilters = function() {
  6088. this.filters = [];
  6089. return this.updateCache();
  6090. };
  6091. TowerLocation.prototype.select = function() {
  6092. return this.selected = true;
  6093. };
  6094. TowerLocation.prototype.unselect = function() {
  6095. this.selected = false;
  6096. return this.removeAllFilters();
  6097. };
  6098. TowerLocation.prototype.showMenu = function() {
  6099. this.select();
  6100. this.level.towerMenu.load(this.x, this.y, this);
  6101. this.level.towerMenu.addButton(1, {
  6102. action: 'cellMacrophage',
  6103. cost: {
  6104. value: this.level.settings.towers.cellMacrophage.upgrade0.cost,
  6105. ressource: 'dna'
  6106. }
  6107. }, 'MacroCell', {
  6108. title: this.level.settings.towers.cellMacrophage.title,
  6109. description: this.level.settings.towers.cellMacrophage.description,
  6110. props: [
  6111. {
  6112. caption: 'move',
  6113. value: this.level.settings.getMoveString(this.level.settings.towers.cellMacrophage.upgrade0.cellSpeed)
  6114. }, {
  6115. caption: 'lifespan',
  6116. value: this.level.settings.towers.cellMacrophage.upgrade0.cellTtl
  6117. }, {
  6118. caption: 'damage',
  6119. value: this.level.settings.towers.cellMacrophage.upgrade0.cellDamage
  6120. }, {
  6121. caption: 'respawn',
  6122. value: this.level.settings.getRespawnString(this.level.settings.towers.cellMacrophage.upgrade0.respawnReload)
  6123. }
  6124. ]
  6125. }, true, this.level.settings.towers.cellMacrophage.upgrade0.range);
  6126. this.level.towerMenu.addButton(2, {
  6127. action: 'cellB',
  6128. cost: {
  6129. value: this.level.settings.towers.cellB.upgrade0.cost,
  6130. ressource: 'dna'
  6131. }
  6132. }, 'BCell', {
  6133. title: this.level.settings.towers.cellB.title,
  6134. description: this.level.settings.towers.cellB.description,
  6135. props: [
  6136. {
  6137. caption: 'move',
  6138. value: this.level.settings.getMoveString(this.level.settings.towers.cellB.upgrade0.cellSpeed)
  6139. }, {
  6140. caption: 'lifespan',
  6141. value: this.level.settings.towers.cellB.upgrade0.cellTtl
  6142. }
  6143. ]
  6144. }, true, this.level.settings.towers.cellB.upgrade0.range);
  6145. this.level.towerMenu.addButton(3, {
  6146. action: 'pill',
  6147. cost: {
  6148. value: this.level.settings.towers.pill.upgrade0.cost,
  6149. ressource: 'gold'
  6150. }
  6151. }, 'tabletBP', {
  6152. title: this.level.settings.towers.pill.title,
  6153. description: this.level.settings.towers.pill.description,
  6154. props: [
  6155. {
  6156. caption: 'damage',
  6157. value: this.level.settings.towers.pill.upgrade0.bulletDamage
  6158. }, {
  6159. caption: 'reload',
  6160. value: this.level.settings.getReloadString(this.level.settings.towers.pill.upgrade0.reloadTime, this.level.hospital.getUpgradeLevel('supply'))
  6161. }, {
  6162. caption: 'magazine size',
  6163. value: this.level.settings.towers.pill.upgrade0.magazineSize
  6164. }, {
  6165. caption: 'shot precision',
  6166. value: this.level.settings.getPrecisionString(this.level.settings.towers.pill.upgrade0.haziness)
  6167. }
  6168. ]
  6169. }, true, this.level.settings.towers.pill.upgrade0.range);
  6170. return this.level.towerMenu.addButton(4, {
  6171. action: 'antibiotic',
  6172. cost: {
  6173. value: this.level.settings.towers.antibiotic.upgrade0.cost,
  6174. ressource: 'gold'
  6175. }
  6176. }, 'capsuleBP', {
  6177. title: this.level.settings.towers.antibiotic.title,
  6178. description: this.level.settings.towers.antibiotic.description,
  6179. props: [
  6180. {
  6181. caption: 'damage',
  6182. value: this.level.settings.towers.antibiotic.upgrade0.bulletDamage
  6183. }, {
  6184. caption: 'reload',
  6185. value: this.level.settings.getReloadString(this.level.settings.towers.antibiotic.upgrade0.reloadTime, this.level.hospital.getUpgradeLevel('supply'))
  6186. }, {
  6187. caption: 'magazine size',
  6188. value: this.level.settings.towers.antibiotic.upgrade0.magazineSize
  6189. }
  6190. ]
  6191. }, true, this.level.settings.towers.antibiotic.upgrade0.range);
  6192. };
  6193. TowerLocation.prototype.execAction = function(action) {
  6194. return this.level.buildTower(this.index, action);
  6195. };
  6196. return TowerLocation;
  6197. })(createjs.Bitmap);
  6198. }).call(this);
  6199. /*
  6200. * Copyright © Romain Fouquet, 2012-2015
  6201. * Copyright © Clément Joly, 2012-2015
  6202. #
  6203. * romain.fouquet18@gmail.com
  6204. * leowzukw@vmail.me
  6205. #
  6206. * This file is part of Diseases Killer Academy.
  6207. #
  6208. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6209. * it under the terms of the GNU Affero General Public License as published by
  6210. * the Free Software Foundation, either version 3 of the License, or
  6211. * (at your option) any later version.
  6212. #
  6213. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6214. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6215. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6216. * GNU Affero General Public License for more details.
  6217. #
  6218. * You should have received a copy of the GNU Affero General Public License
  6219. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6220. */
  6221. (function() {
  6222. 'use strict';
  6223. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  6224. hasProp = {}.hasOwnProperty;
  6225. dka.TowerRange = (function(superClass) {
  6226. extend(TowerRange, superClass);
  6227. function TowerRange() {
  6228. TowerRange.__super__.constructor.call(this);
  6229. this.alpha = 0.7;
  6230. this.visible = false;
  6231. }
  6232. TowerRange.prototype.load = function(x, y, regX, regY, width, height, newWidth, newHeight) {
  6233. this.x = x;
  6234. this.y = y;
  6235. this.regX = regX;
  6236. this.regY = regY;
  6237. this.visible = true;
  6238. if (newWidth && newHeight) {
  6239. return this.newRange(width, height, newWidth, newHeight);
  6240. } else {
  6241. return this.range(width, height);
  6242. }
  6243. };
  6244. TowerRange.prototype.range = function(width, height) {
  6245. return this.graphics.clear().setStrokeStyle(2).beginStroke(dka.colors.lightBlue).drawEllipse(0, 0, width, height);
  6246. };
  6247. TowerRange.prototype.newRange = function(width, height, newWidth, newHeight) {
  6248. return this.graphics.clear().setStrokeStyle(2).beginStroke(dka.colors.lightBlue).drawEllipse(0, 0, width, height).beginStroke(dka.colors.lightGreen).drawEllipse(-(newWidth - width) / 2, -(newHeight - height) / 2, newWidth, newHeight);
  6249. };
  6250. TowerRange.prototype.fade = function() {
  6251. return this.visible = false;
  6252. };
  6253. return TowerRange;
  6254. })(createjs.Shape);
  6255. }).call(this);
  6256. /*
  6257. * Copyright © Romain Fouquet, 2012-2015
  6258. * Copyright © Clément Joly, 2012-2015
  6259. #
  6260. * romain.fouquet18@gmail.com
  6261. * leowzukw@vmail.me
  6262. #
  6263. * This file is part of Diseases Killer Academy.
  6264. #
  6265. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6266. * it under the terms of the GNU Affero General Public License as published by
  6267. * the Free Software Foundation, either version 3 of the License, or
  6268. * (at your option) any later version.
  6269. #
  6270. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6271. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6272. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6273. * GNU Affero General Public License for more details.
  6274. #
  6275. * You should have received a copy of the GNU Affero General Public License
  6276. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6277. */
  6278. (function() {
  6279. 'use strict';
  6280. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  6281. hasProp = {}.hasOwnProperty;
  6282. dka.Bullet = (function(superClass) {
  6283. extend(Bullet, superClass);
  6284. function Bullet(towerLauncher, disease) {
  6285. Bullet.__super__.constructor.call(this);
  6286. this.towerLauncher = towerLauncher;
  6287. this.disease = disease;
  6288. this.x = towerLauncher.x;
  6289. this.y = towerLauncher.y;
  6290. this.level = towerLauncher.level;
  6291. this.damage = towerLauncher.bulletDamage;
  6292. }
  6293. Bullet.prototype.tick = function() {
  6294. return this.move();
  6295. };
  6296. Bullet.prototype.collideTest = function() {
  6297. if (this.disease && this.disease.alive && this.level.euclidDistance(this.x, this.y, this.disease.x, this.disease.y) < this.hitRadius) {
  6298. return true;
  6299. }
  6300. return false;
  6301. };
  6302. return Bullet;
  6303. })(createjs.Sprite);
  6304. }).call(this);
  6305. /*
  6306. * Copyright © Romain Fouquet, 2012-2015
  6307. * Copyright © Clément Joly, 2012-2015
  6308. #
  6309. * romain.fouquet18@gmail.com
  6310. * leowzukw@vmail.me
  6311. #
  6312. * This file is part of Diseases Killer Academy.
  6313. #
  6314. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6315. * it under the terms of the GNU Affero General Public License as published by
  6316. * the Free Software Foundation, either version 3 of the License, or
  6317. * (at your option) any later version.
  6318. #
  6319. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6320. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6321. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6322. * GNU Affero General Public License for more details.
  6323. #
  6324. * You should have received a copy of the GNU Affero General Public License
  6325. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6326. */
  6327. (function() {
  6328. 'use strict';
  6329. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  6330. hasProp = {}.hasOwnProperty;
  6331. dka.BulletCapsule = (function(superClass) {
  6332. extend(BulletCapsule, superClass);
  6333. function BulletCapsule(towerLauncher, disease) {
  6334. var deltaX, deltaY, nxtWP;
  6335. BulletCapsule.__super__.constructor.call(this, towerLauncher, disease);
  6336. this.radiusDamage = towerLauncher.bulletRadiusDamage;
  6337. this.spriteSheet = dka.academy.assetManager.getAsset('spCapsule');
  6338. this.decalSprite = 'spriteBulletEffect';
  6339. this.hitRadius = 12;
  6340. this.rotationSpeed = (Math.round(Math.random()) * 2 - 1) * 15;
  6341. this.t0 = 0;
  6342. this.t1 = 25;
  6343. if (this.level.moveDiseases) {
  6344. nxtWP = disease.pointToReach + Math.ceil(this.level.distanceBetweenWP * disease.speed);
  6345. if (nxtWP < disease.path.length) {
  6346. this.target = disease.path[nxtWP];
  6347. } else {
  6348. this.target = disease.path[disease.pointToReach];
  6349. }
  6350. } else {
  6351. this.target = new createjs.Point(disease.x, disease.y);
  6352. }
  6353. deltaX = this.target.x - this.x;
  6354. deltaY = this.target.y - this.y;
  6355. this.speedX = deltaX / this.t1;
  6356. this.speedY = (deltaY - this.t1 * this.t1 / 2) / this.t1;
  6357. }
  6358. BulletCapsule.prototype.tick = function() {
  6359. if (this.t0 !== this.t1 + 1) {
  6360. BulletCapsule.__super__.tick.call(this);
  6361. this.rotation += this.rotationSpeed;
  6362. if (this.t0 === this.t1) {
  6363. this.gotoAndPlay(0);
  6364. return this.on('animationend', this.animationend);
  6365. }
  6366. } else {
  6367. return this.impact();
  6368. }
  6369. };
  6370. BulletCapsule.prototype.move = function() {
  6371. this.x = this.towerLauncher.x + this.t0 * this.speedX;
  6372. this.y = this.towerLauncher.y + this.t0 * this.speedY + this.t0 * this.t0 / 2;
  6373. return this.t0++;
  6374. };
  6375. BulletCapsule.prototype.animationend = function() {
  6376. return this.parent.removeChild(this);
  6377. };
  6378. BulletCapsule.prototype.impact = function() {
  6379. var damageToDeal, decal, disease, distanceToDisease, i, range, results;
  6380. this.level.bulletEffectsLayer.addChild(new dka.CapsuleSmoke(this.x, this.y));
  6381. if (!this.collideTest()) {
  6382. decal = new dka.BulletDecal(this.x, this.y, this.level);
  6383. }
  6384. i = 0;
  6385. results = [];
  6386. while (i < this.level.diseasesLayer.numChildren) {
  6387. disease = this.level.diseasesLayer.getChildAt(i);
  6388. range = new geom.Ellipse(this.x, this.y, this.radiusDamage, this.radiusDamage * this.level.coeffPerspective);
  6389. if (disease.type !== 'Bacterium') {
  6390. i++;
  6391. continue;
  6392. }
  6393. if (!range.contains(disease.x, disease.y)) {
  6394. i++;
  6395. continue;
  6396. }
  6397. distanceToDisease = this.level.euclidDistance(this.x, this.y, disease.x, disease.y);
  6398. damageToDeal = 0;
  6399. if (distanceToDisease < this.radiusDamage / 10) {
  6400. damageToDeal = Math.ceil(Math.random() * (this.damage[1] - this.damage[0]) + this.damage[0]);
  6401. } else {
  6402. damageToDeal = Math.ceil(((Math.ceil(Math.random() * (this.damage[1] - this.damage[0]) + this.damage[0])) / distanceToDisease) * 3);
  6403. }
  6404. disease.beDamaged(damageToDeal);
  6405. results.push(i++);
  6406. }
  6407. return results;
  6408. };
  6409. return BulletCapsule;
  6410. })(dka.Bullet);
  6411. }).call(this);
  6412. /*
  6413. * Copyright © Romain Fouquet, 2012-2015
  6414. * Copyright © Clément Joly, 2012-2015
  6415. #
  6416. * romain.fouquet18@gmail.com
  6417. * leowzukw@vmail.me
  6418. #
  6419. * This file is part of Diseases Killer Academy.
  6420. #
  6421. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6422. * it under the terms of the GNU Affero General Public License as published by
  6423. * the Free Software Foundation, either version 3 of the License, or
  6424. * (at your option) any later version.
  6425. #
  6426. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6427. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6428. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6429. * GNU Affero General Public License for more details.
  6430. #
  6431. * You should have received a copy of the GNU Affero General Public License
  6432. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6433. */
  6434. (function() {
  6435. 'use strict';
  6436. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  6437. hasProp = {}.hasOwnProperty;
  6438. dka.BulletTablet = (function(superClass) {
  6439. extend(BulletTablet, superClass);
  6440. function BulletTablet(towerLauncher, disease) {
  6441. BulletTablet.__super__.constructor.call(this, towerLauncher, disease);
  6442. this.haziness = new createjs.Point(this.getHaziness(), this.getHaziness());
  6443. this.target = new createjs.Point(disease.x + this.haziness.x, disease.y + this.haziness.y);
  6444. this.destiny = this.target.clone();
  6445. this.spriteSheet = dka.academy.assetManager.getAsset('spriteTablet');
  6446. this.decalSprite = 'spriteBulletEffect';
  6447. this.acceleration = 17;
  6448. this.hitRadius = 4;
  6449. this.t0 = 0;
  6450. this.t1 = 25;
  6451. this.move();
  6452. }
  6453. BulletTablet.prototype.getHaziness = function() {
  6454. return this.towerLauncher.haziness / -2 + Math.random() * this.towerLauncher.haziness;
  6455. };
  6456. BulletTablet.prototype.tick = function() {
  6457. return BulletTablet.__super__.tick.call(this);
  6458. };
  6459. BulletTablet.prototype.move = function() {
  6460. var angle;
  6461. this.target.x = this.disease ? this.disease.x + this.haziness.x : this.destiny.x;
  6462. this.target.y = this.disease ? this.disease.y + this.haziness.y : this.destiny.y;
  6463. if (this.level.euclidDistance(this.x, this.y, this.target.x, this.target.y) < this.acceleration + 7) {
  6464. this.x = this.target.x;
  6465. this.y = this.target.y;
  6466. return this.impact();
  6467. } else {
  6468. angle = Math.atan2(this.target.y - this.y, this.target.x - this.x);
  6469. this.x += this.acceleration * Math.cos(angle);
  6470. this.y += this.acceleration * Math.sin(angle);
  6471. this.acceleration *= 0.95;
  6472. this.rotation = angle / Math.PI * 180 + 90;
  6473. return this.level.bulletEffectsLayer.addChild(new dka.TabletSmoke(this.x, this.y));
  6474. }
  6475. };
  6476. BulletTablet.prototype.getDamage = function() {
  6477. return Math.ceil(Math.random() * (this.damage[1] - this.damage[0]) + this.damage[0]);
  6478. };
  6479. BulletTablet.prototype.impact = function() {
  6480. var decal;
  6481. this.parent.removeChild(this);
  6482. if (this.collideTest()) {
  6483. this.disease.beDamaged(this.getDamage());
  6484. this.disease.hit();
  6485. return;
  6486. }
  6487. return decal = new dka.BulletDecal(this.x, this.y, this.level);
  6488. };
  6489. return BulletTablet;
  6490. })(dka.Bullet);
  6491. }).call(this);
  6492. /*
  6493. * Copyright © Romain Fouquet, 2012-2015
  6494. * Copyright © Clément Joly, 2012-2015
  6495. #
  6496. * romain.fouquet18@gmail.com
  6497. * leowzukw@vmail.me
  6498. #
  6499. * This file is part of Diseases Killer Academy.
  6500. #
  6501. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6502. * it under the terms of the GNU Affero General Public License as published by
  6503. * the Free Software Foundation, either version 3 of the License, or
  6504. * (at your option) any later version.
  6505. #
  6506. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6507. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6508. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6509. * GNU Affero General Public License for more details.
  6510. #
  6511. * You should have received a copy of the GNU Affero General Public License
  6512. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6513. */
  6514. (function() {
  6515. 'use strict';
  6516. dka.RoadSpawn = (function() {
  6517. function RoadSpawn(wave, road, roadIndex) {
  6518. this.wave = wave;
  6519. this.road = road;
  6520. this.roadIndex = roadIndex;
  6521. this.level = wave.level;
  6522. this.maxDiseasesToPut = this.road.diseasesList.length;
  6523. this.delayForNxtDisease = this.road.diseasesList[0].delay;
  6524. this.finished = false;
  6525. this.diseasesPut = 0;
  6526. this.waitForNewDisease = 0;
  6527. }
  6528. RoadSpawn.prototype.tick = function() {
  6529. if (this.level.moveDiseases) {
  6530. if (this.waitForNewDisease >= this.delayForNxtDisease) {
  6531. this.addDisease();
  6532. }
  6533. if (!this.finished) {
  6534. return this.waitForNewDisease++;
  6535. } else {
  6536. return this.level.lookToLaunchWave();
  6537. }
  6538. }
  6539. };
  6540. RoadSpawn.prototype.addDisease = function() {
  6541. var disease, diseaseName, path;
  6542. path = this.level.waypoints[this.roadIndex][Math.floor(Math.random() * this.level.waypoints[this.roadIndex].length)];
  6543. diseaseName = this.road.diseasesList[this.diseasesPut].dis;
  6544. if (this.level.game.knownDiseases.indexOf(diseaseName) === -1) {
  6545. this.level.game.knownDiseases.push(diseaseName);
  6546. }
  6547. disease = new dka['Disease' + diseaseName](this.level, this.level.waypoints[this.roadIndex], path);
  6548. this.level.diseasesLayer.addChild(disease);
  6549. this.delayForNxtDisease = this.road.diseasesList[this.diseasesPut].delay;
  6550. this.diseasesPut++;
  6551. this.wave.diseasesSpawned++;
  6552. this.waitForNewDisease = 0;
  6553. if (this.diseasesPut === this.maxDiseasesToPut) {
  6554. return this.finished = true;
  6555. }
  6556. };
  6557. return RoadSpawn;
  6558. })();
  6559. }).call(this);
  6560. /*
  6561. * Copyright © Romain Fouquet, 2012-2015
  6562. * Copyright © Clément Joly, 2012-2015
  6563. #
  6564. * romain.fouquet18@gmail.com
  6565. * leowzukw@vmail.me
  6566. #
  6567. * This file is part of Diseases Killer Academy.
  6568. #
  6569. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6570. * it under the terms of the GNU Affero General Public License as published by
  6571. * the Free Software Foundation, either version 3 of the License, or
  6572. * (at your option) any later version.
  6573. #
  6574. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6575. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6576. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6577. * GNU Affero General Public License for more details.
  6578. #
  6579. * You should have received a copy of the GNU Affero General Public License
  6580. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6581. */
  6582. (function() {
  6583. 'use strict';
  6584. dka.Wave = (function() {
  6585. function Wave(level) {
  6586. var i, j, len, ref, road;
  6587. this.level = level;
  6588. this.diseasesSpawned = 0;
  6589. this.diseasesKilled = 0;
  6590. this.diseasesArrived = 0;
  6591. this.roads = this.level.waves[level.getFresherWaveIndex() + 1].roads;
  6592. this.roadSpawns = [];
  6593. ref = this.roads;
  6594. for (i = j = 0, len = ref.length; j < len; i = ++j) {
  6595. road = ref[i];
  6596. this.roadSpawns.push(new dka.RoadSpawn(this, road, i));
  6597. }
  6598. }
  6599. Wave.prototype.tickWave = function() {
  6600. var j, len, ref, results, roadSpawn;
  6601. ref = this.roadSpawns;
  6602. results = [];
  6603. for (j = 0, len = ref.length; j < len; j++) {
  6604. roadSpawn = ref[j];
  6605. results.push(roadSpawn.tick());
  6606. }
  6607. return results;
  6608. };
  6609. Wave.prototype.verifFinished = function() {
  6610. var j, len, ref, roadSpawn;
  6611. ref = this.roadSpawns;
  6612. for (j = 0, len = ref.length; j < len; j++) {
  6613. roadSpawn = ref[j];
  6614. if (roadSpawn.finished === false) {
  6615. return;
  6616. }
  6617. }
  6618. if (this.diseasesKilled + this.diseasesArrived === this.diseasesSpawned) {
  6619. return this.level.removeWave(this.level.currentWaves.indexOf(this));
  6620. }
  6621. };
  6622. return Wave;
  6623. })();
  6624. }).call(this);
  6625. /*
  6626. * Copyright © Romain Fouquet, 2012-2015
  6627. * Copyright © Clément Joly, 2012-2015
  6628. #
  6629. * romain.fouquet18@gmail.com
  6630. * leowzukw@vmail.me
  6631. #
  6632. * This file is part of Diseases Killer Academy.
  6633. #
  6634. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6635. * it under the terms of the GNU Affero General Public License as published by
  6636. * the Free Software Foundation, either version 3 of the License, or
  6637. * (at your option) any later version.
  6638. #
  6639. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6640. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6641. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6642. * GNU Affero General Public License for more details.
  6643. #
  6644. * You should have received a copy of the GNU Affero General Public License
  6645. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6646. */
  6647. (function() {
  6648. 'use strict';
  6649. var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
  6650. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  6651. hasProp = {}.hasOwnProperty;
  6652. dka.Level = (function(superClass) {
  6653. extend(Level, superClass);
  6654. function Level(game) {
  6655. this.tickLevel = bind(this.tickLevel, this);
  6656. Level.__super__.constructor.call(this);
  6657. this.game = game;
  6658. this.settings = game.settings;
  6659. this.coeffPerspective = 0.7;
  6660. this.distanceBetweenWP = 5;
  6661. this.currentWaves = [];
  6662. this.locations = [];
  6663. this.waitForNewWave = 0;
  6664. this.delayForNxtWave = 0;
  6665. this.finished = false;
  6666. this.paused = false;
  6667. this.pausable = true;
  6668. this.moveDiseases = true;
  6669. this.nbrWaves = this.waves.length;
  6670. this.on('added', this.init);
  6671. }
  6672. Level.prototype.setEvents = function() {
  6673. this.GOLD_CHANGED_EVENT = 'goldchanged';
  6674. this.DNA_CHANGED_EVENT = 'dnachanged';
  6675. this.TOWER_MENU_OPEN_EVENT = 'towermenuopen';
  6676. this.TOWER_BUILT_EVENT = 'towerbuilt';
  6677. this.MAGAZINE_RELOADED_EVENT = 'magazinereloaded';
  6678. this.WAVE_FLAG_CLICKED_EVENT = 'waveflagclicked';
  6679. this.HOSPITAL_CLICKED_EVENT = 'hospitalclicked';
  6680. return this.FEVER_CLICKED_EVENT = 'feverclicked';
  6681. };
  6682. Level.prototype.init = function() {
  6683. var i, k, ref;
  6684. this.addLayers();
  6685. this.addBackground();
  6686. this.buildHospital();
  6687. for (i = k = 0, ref = this.towers.length; k < ref; i = k += 1) {
  6688. this.addlocation(i);
  6689. if (this.towersToBePlaced[i].type !== '') {
  6690. this.buildTower(i, this.towersToBePlaced[i].type, true, this.towersToBePlaced[i].upgradeLevel);
  6691. }
  6692. }
  6693. return typeof this.buildSpecial === "function" ? this.buildSpecial() : void 0;
  6694. };
  6695. Level.prototype.addLayers = function() {
  6696. this.backgroundLayer = new createjs.Container();
  6697. this.backgroundLayer.on('click', function() {
  6698. return this.parent.towerMenu.fade();
  6699. });
  6700. this.decalsLayer = new createjs.Container();
  6701. this.bulletEffectsLayer = new createjs.Container();
  6702. this.bulletEffectsLayer.on('click', function() {
  6703. return this.parent.towerMenu.fade();
  6704. });
  6705. this.antibodiesLayer = new createjs.Container();
  6706. this.diseasesLayer = new createjs.Container();
  6707. this.diseasesLayer.on('click', function() {
  6708. return this.parent.towerMenu.fade();
  6709. });
  6710. this.towersLayer = new createjs.Container();
  6711. this.onlyTowersLayer = new createjs.Container();
  6712. this.cellsPatrolLayer = new createjs.Container();
  6713. this.bulletsLayer = new createjs.Container();
  6714. this.towerRange = new dka.TowerRange();
  6715. this.towerMenu = new dka.HexaMenu(this);
  6716. this.ui = new dka.Ui(this);
  6717. this.screenPause = new dka.ScreenPause(this.ui);
  6718. this.screenEncyclopedia = new dka.ScreenEncyclopedia(this.ui);
  6719. this.hintBox = new dka.HintBox();
  6720. this.towersLayer.addChild(this.onlyTowersLayer, this.cellsPatrolLayer, this.bulletsLayer, this.towerRange, this.towerMenu);
  6721. return this.addChild(this.backgroundLayer, this.antibodiesLayer, this.decalsLayer, this.diseasesLayer, this.bulletEffectsLayer, this.towersLayer, this.ui, this.screenPause, this.screenEncyclopedia, this.hintBox);
  6722. };
  6723. Level.prototype.addBackground = function() {
  6724. return this.backgroundLayer.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset(this.map)));
  6725. };
  6726. Level.prototype.showPaths = function() {
  6727. var i, j, k, l, len, len1, path, paths, ref, road;
  6728. paths = new createjs.Container();
  6729. this.backgroundLayer.addChild(paths);
  6730. ref = this.waypoints;
  6731. for (i = k = 0, len = ref.length; k < len; i = ++k) {
  6732. road = ref[i];
  6733. for (j = l = 0, len1 = road.length; l < len1; j = ++l) {
  6734. path = road[j];
  6735. this.showPath(path, i, j, paths);
  6736. }
  6737. }
  6738. return paths.cache(0, 0, canvasWidth, canvasHeight);
  6739. };
  6740. Level.prototype.showPath = function(path, i, j, paths) {
  6741. var k, pathShape, ref, results, wp;
  6742. if (i == null) {
  6743. i = 0;
  6744. }
  6745. if (j == null) {
  6746. j = 0;
  6747. }
  6748. pathShape = new createjs.Shape().set({
  6749. alpha: 0.5
  6750. });
  6751. paths.addChild(pathShape);
  6752. results = [];
  6753. for (wp = k = 0, ref = path.length - 1; k < ref; wp = k += 1) {
  6754. results.push(pathShape.graphics.setStrokeStyle(3).beginStroke(createjs.Graphics.getRGB(50 * i, 50 * j + 50, 0)).moveTo(path[wp].x, path[wp].y).lineTo(path[wp + 1].x, path[wp + 1].y).endStroke());
  6755. }
  6756. return results;
  6757. };
  6758. Level.prototype.euclidDistance = function(AX, AY, BX, BY) {
  6759. return Math.sqrt(Math.pow(AX - BX, 2) + Math.pow(AY - BY, 2));
  6760. };
  6761. Level.prototype.tickLevel = function() {
  6762. var base, i;
  6763. if (this.getFresherWave()) {
  6764. this.getFresherWave().tickWave();
  6765. } else {
  6766. this.lookToLaunchWave();
  6767. }
  6768. i = 0;
  6769. while (i < this.diseasesLayer.numChildren) {
  6770. this.diseasesLayer.getChildAt(i).tick();
  6771. i++;
  6772. }
  6773. i = 0;
  6774. while (i < this.cellsPatrolLayer.numChildren) {
  6775. this.cellsPatrolLayer.getChildAt(i).tick();
  6776. i++;
  6777. }
  6778. i = 0;
  6779. while (i < this.antibodiesLayer.numChildren) {
  6780. this.antibodiesLayer.getChildAt(i).tick();
  6781. i++;
  6782. }
  6783. i = 0;
  6784. while (i < this.onlyTowersLayer.numChildren) {
  6785. if (typeof (base = this.onlyTowersLayer.getChildAt(i)).tick === "function") {
  6786. base.tick();
  6787. }
  6788. i++;
  6789. }
  6790. i = 0;
  6791. while (i < this.bulletsLayer.numChildren) {
  6792. this.bulletsLayer.getChildAt(i).tick();
  6793. i++;
  6794. }
  6795. return gameStage.update();
  6796. };
  6797. Level.prototype.lookToLaunchWave = function() {
  6798. var ready;
  6799. if (!this.isLastWaveLaunched()) {
  6800. ready = this.currentWaves.every(function(element) {
  6801. if (element) {
  6802. return element.roadSpawns.every(function(element) {
  6803. return element.finished;
  6804. });
  6805. } else {
  6806. return true;
  6807. }
  6808. });
  6809. if (ready) {
  6810. this.waitForNewWave++;
  6811. if (!this.ui.waveFlags.length) {
  6812. this.ui.showWaveFlags();
  6813. }
  6814. }
  6815. if (this.waitForNewWave >= this.delayForNxtWave) {
  6816. this.ui.removeWaveFlags();
  6817. this.addWave();
  6818. return this.ui.hudBar.updateWaves();
  6819. }
  6820. }
  6821. };
  6822. Level.prototype.addWave = function() {
  6823. if (this.isLastWaveLaunched()) {
  6824. return;
  6825. }
  6826. this.currentWaves.push(new dka.Wave(this));
  6827. this.waitForNewWave = 0;
  6828. if (!this.isLastWaveLaunched()) {
  6829. this.delayForNxtWave = this.waves[this.getFresherWaveIndex() + 1].delay;
  6830. }
  6831. if (this.level === 0) {
  6832. if ((this.getFresherWaveIndex() + 1) === 2) {
  6833. return this.ui.tutoBubles.addChild(new dka.TutoBubble('Click here!', new createjs.Point(this.ui.buttonsPositions[1], 60), this, this.FEVER_CLICKED_EVENT, true));
  6834. } else {
  6835. if ((this.getFresherWaveIndex() + 1) === 3) {
  6836. return this.ui.tutoBubles.addChild(new dka.TutoBubble('Click here!', new createjs.Point(this.hospitalPosition.x, this.hospitalPosition.y + 45), this, this.HOSPITAL_CLICKED_EVENT, true));
  6837. }
  6838. }
  6839. }
  6840. };
  6841. Level.prototype.removeWave = function(waveToRemove) {
  6842. if (typeof waveToRemove === 'number') {
  6843. this.currentWaves[waveToRemove] = null;
  6844. } else {
  6845. this.currentWaves[this.currentWaves.indexOf(waveToRemove)] = null;
  6846. }
  6847. return this.verifFinished();
  6848. };
  6849. Level.prototype.isLastWaveLaunched = function() {
  6850. return !this.waves[this.getFresherWaveIndex() + 1];
  6851. };
  6852. Level.prototype.getFresherWaveIndex = function() {
  6853. return this.currentWaves.length - 1;
  6854. };
  6855. Level.prototype.isVisibleByPlayer = function(x, y) {
  6856. if ((0 <= x && x <= canvasWidth) && (0 <= y && y <= canvasHeight)) {
  6857. return true;
  6858. }
  6859. return false;
  6860. };
  6861. Level.prototype.getFresherWave = function() {
  6862. return this.currentWaves[this.currentWaves.length - 1];
  6863. };
  6864. Level.prototype.verifFinished = function() {
  6865. var navWaves, nbrWavesFinished, verif;
  6866. verif = false;
  6867. nbrWavesFinished = 0;
  6868. if (this.currentWaves.length === this.nbrWaves) {
  6869. navWaves = 0;
  6870. while (navWaves <= (this.currentWaves.length - 1)) {
  6871. if (this.currentWaves[navWaves] === null) {
  6872. nbrWavesFinished++;
  6873. }
  6874. navWaves++;
  6875. }
  6876. if (nbrWavesFinished === this.currentWaves.length) {
  6877. verif = true;
  6878. }
  6879. }
  6880. if (verif) {
  6881. this.finished = true;
  6882. return createjs.Tween.get(gameStage, {
  6883. useTicks: true
  6884. }).wait(60).call((function(_this) {
  6885. return function() {
  6886. return _this.finish();
  6887. };
  6888. })(this));
  6889. }
  6890. };
  6891. Level.prototype.addLevelTicker = function() {
  6892. return this.tickWrapper = createjs.Ticker.on('tick', this.tickLevel);
  6893. };
  6894. Level.prototype.removeLevelTicker = function() {
  6895. return createjs.Ticker.off('tick', this.tickWrapper);
  6896. };
  6897. Level.prototype.finish = function() {
  6898. this.removeLevelTicker();
  6899. dka.academy.dataManager.saveLevelProgress();
  6900. dka.academy.addStageTicker();
  6901. dka.academy.game.addGold(this.playerGold, this.level);
  6902. return this.ui.endScreen();
  6903. };
  6904. Level.prototype.showTowerRange = function(x, y, range) {
  6905. if (range instanceof Array) {
  6906. return this.towerRange.load(x, y, range[0], range[0] * this.coeffPerspective, 2 * range[0], 2 * range[0] * this.coeffPerspective, 2 * range[1], 2 * range[1] * this.coeffPerspective);
  6907. } else {
  6908. return this.towerRange.load(x, y, range, range * this.coeffPerspective, 2 * range, 2 * range * this.coeffPerspective);
  6909. }
  6910. };
  6911. Level.prototype.addlocation = function(index) {
  6912. var location;
  6913. location = new dka.TowerLocation(this.towers[index].x, this.towers[index].y, this, index);
  6914. this.onlyTowersLayer.addChildAt(location, index);
  6915. if (TXT_NBR) {
  6916. return this.ui.addChild(new createjs.Text(index, '20px Arial', '#FFFFFF').set({
  6917. x: this.towers[index].x,
  6918. y: this.towers[index].y - 10,
  6919. textAlign: 'center'
  6920. }));
  6921. }
  6922. };
  6923. Level.prototype.buildTower = function(location, typeTower, free, upgradeLevel) {
  6924. var tower;
  6925. switch (typeTower) {
  6926. case 'pill':
  6927. tower = new dka.TowerPill(this.towers[location].x, this.towers[location].y, location, this, free);
  6928. break;
  6929. case 'antibiotic':
  6930. tower = new dka.TowerAntibiotic(this.towers[location].x, this.towers[location].y, location, this, free);
  6931. break;
  6932. case 'cellB':
  6933. tower = new dka.TowerCellB(this.towers[location].x, this.towers[location].y, location, this, free);
  6934. break;
  6935. case 'cellMacrophage':
  6936. tower = new dka.TowerCellMacrophage(this.towers[location].x, this.towers[location].y, location, this, free);
  6937. }
  6938. if (upgradeLevel > 0) {
  6939. tower.upgrade(true, upgradeLevel);
  6940. }
  6941. this.onlyTowersLayer.removeChildAt(location);
  6942. return this.onlyTowersLayer.addChildAt(tower, location);
  6943. };
  6944. Level.prototype.buildHospital = function() {
  6945. this.hospital = new dka.TowerHospital(new createjs.Point(this.hospitalPosition.x, this.hospitalPosition.y), this);
  6946. return this.onlyTowersLayer.addChild(this.hospital);
  6947. };
  6948. Level.prototype.getHospital = function() {
  6949. return this.hospital;
  6950. };
  6951. Level.prototype.addGold = function(gold) {
  6952. this.playerGold += gold;
  6953. this.dispatchEvent(new createjs.Event('goldchanged', true, false));
  6954. return this.ui.hudBar.updateGold();
  6955. };
  6956. Level.prototype.addDna = function(dna) {
  6957. this.playerDna += dna;
  6958. this.dispatchEvent(new createjs.Event('dnachanged', true, false));
  6959. return this.ui.hudBar.updateDna();
  6960. };
  6961. Level.prototype.loseLives = function(lives) {
  6962. this.playerLives -= lives;
  6963. return this.ui.hudBar.updateLives();
  6964. };
  6965. Level.prototype.addToolTip = function(target, hintData) {
  6966. this.hintBox.load(target, hintData);
  6967. return this.hintBox.visible = true;
  6968. };
  6969. Level.prototype.removeToolTip = function() {
  6970. return this.hintBox.hide();
  6971. };
  6972. return Level;
  6973. })(createjs.Container);
  6974. }).call(this);
  6975. /*
  6976. * Copyright © Romain Fouquet, 2012-2015
  6977. * Copyright © Clément Joly, 2012-2015
  6978. #
  6979. * romain.fouquet18@gmail.com
  6980. * leowzukw@vmail.me
  6981. #
  6982. * This file is part of Diseases Killer Academy.
  6983. #
  6984. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  6985. * it under the terms of the GNU Affero General Public License as published by
  6986. * the Free Software Foundation, either version 3 of the License, or
  6987. * (at your option) any later version.
  6988. #
  6989. * Diseases Killer Academy is distributed in the hope that it will be useful,
  6990. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6991. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6992. * GNU Affero General Public License for more details.
  6993. #
  6994. * You should have received a copy of the GNU Affero General Public License
  6995. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  6996. */
  6997. (function() {
  6998. 'use strict';
  6999. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  7000. hasProp = {}.hasOwnProperty;
  7001. dka.Level0 = (function(superClass) {
  7002. extend(Level0, superClass);
  7003. function Level0(game) {
  7004. this.level = 0;
  7005. this.name = 'Tuto';
  7006. this.map = 'map0';
  7007. this.hospitalPosition = {
  7008. x: 682,
  7009. y: 122
  7010. };
  7011. this.hospitalImage = 'hospital0';
  7012. this.hospitalSize = {
  7013. regX: 144 / 2,
  7014. regY: 59 / 2,
  7015. width: 144,
  7016. height: 59
  7017. };
  7018. this.goalMarkerPosition = {
  7019. x: 820,
  7020. y: 280
  7021. };
  7022. this.setEvents();
  7023. this.on(this.TOWER_BUILT_EVENT, function() {
  7024. if (this.getFresherWaveIndex() === -1 && !this.ui.callTutoBubble) {
  7025. this.ui.callTutoBubble = true;
  7026. return this.ui.tutoBubles.addChild(new dka.TutoBubble('Call wave!', new createjs.Point(199, 70), this, this.WAVE_FLAG_CLICKED_EVENT, true));
  7027. }
  7028. });
  7029. this.placeDate = 'Africa - Prehistory';
  7030. this.hintLabsMsg = "Hello! I will be your teacher during\nall the time of this game...`Try to be brillant !";
  7031. this.towers = [
  7032. {
  7033. x: 274,
  7034. y: 126,
  7035. cell: {
  7036. road: 0,
  7037. path: 0
  7038. }
  7039. }, {
  7040. x: 287,
  7041. y: 280,
  7042. cell: {
  7043. road: 0,
  7044. path: 0
  7045. }
  7046. }, {
  7047. x: 214,
  7048. y: 367,
  7049. cell: {
  7050. road: 0,
  7051. path: 0
  7052. }
  7053. }, {
  7054. x: 447,
  7055. y: 380,
  7056. cell: {
  7057. road: 0,
  7058. path: 0
  7059. }
  7060. }, {
  7061. x: 526,
  7062. y: 250,
  7063. cell: {
  7064. road: 0,
  7065. path: 0
  7066. }
  7067. }, {
  7068. x: 766,
  7069. y: 233,
  7070. cell: {
  7071. road: 0,
  7072. path: 0
  7073. }
  7074. }, {
  7075. x: 690,
  7076. y: 358,
  7077. cell: {
  7078. road: 0,
  7079. path: 0
  7080. }
  7081. }
  7082. ];
  7083. this.waypoints = [
  7084. [
  7085. [
  7086. {
  7087. x: 224,
  7088. y: -24
  7089. }, {
  7090. x: 222.92,
  7091. y: -19.12
  7092. }, {
  7093. x: 221.83,
  7094. y: -14.24
  7095. }, {
  7096. x: 220.75,
  7097. y: -9.36
  7098. }, {
  7099. x: 219.66,
  7100. y: -4.48
  7101. }, {
  7102. x: 218.58,
  7103. y: 0.4
  7104. }, {
  7105. x: 217.49,
  7106. y: 5.29
  7107. }, {
  7108. x: 216.41,
  7109. y: 10.17
  7110. }, {
  7111. x: 214.49,
  7112. y: 14.78
  7113. }, {
  7114. x: 212.57,
  7115. y: 19.4
  7116. }, {
  7117. x: 210.65,
  7118. y: 24.02
  7119. }, {
  7120. x: 208.74,
  7121. y: 28.64
  7122. }, {
  7123. x: 207.04,
  7124. y: 33.34
  7125. }, {
  7126. x: 205.34,
  7127. y: 38.04
  7128. }, {
  7129. x: 204.16,
  7130. y: 42.9
  7131. }, {
  7132. x: 202.98,
  7133. y: 47.76
  7134. }, {
  7135. x: 201.8,
  7136. y: 52.62
  7137. }, {
  7138. x: 200.61,
  7139. y: 57.48
  7140. }, {
  7141. x: 199.43,
  7142. y: 62.33
  7143. }, {
  7144. x: 199.57,
  7145. y: 67.33
  7146. }, {
  7147. x: 199.71,
  7148. y: 72.33
  7149. }, {
  7150. x: 199.84,
  7151. y: 77.33
  7152. }, {
  7153. x: 199.98,
  7154. y: 82.33
  7155. }, {
  7156. x: 200.93,
  7157. y: 87.24
  7158. }, {
  7159. x: 201.87,
  7160. y: 92.15
  7161. }, {
  7162. x: 202.82,
  7163. y: 97.06
  7164. }, {
  7165. x: 202.87,
  7166. y: 102.06
  7167. }, {
  7168. x: 202.93,
  7169. y: 107.06
  7170. }, {
  7171. x: 202.98,
  7172. y: 112.06
  7173. }, {
  7174. x: 203.28,
  7175. y: 117.05
  7176. }, {
  7177. x: 203.58,
  7178. y: 122.04
  7179. }, {
  7180. x: 203.88,
  7181. y: 127.03
  7182. }, {
  7183. x: 203.91,
  7184. y: 132.03
  7185. }, {
  7186. x: 203.94,
  7187. y: 137.03
  7188. }, {
  7189. x: 203.97,
  7190. y: 142.03
  7191. }, {
  7192. x: 204,
  7193. y: 147.03
  7194. }, {
  7195. x: 206.24,
  7196. y: 151.5
  7197. }, {
  7198. x: 208.48,
  7199. y: 155.97
  7200. }, {
  7201. x: 210.72,
  7202. y: 160.44
  7203. }, {
  7204. x: 212.96,
  7205. y: 164.91
  7206. }, {
  7207. x: 213.52,
  7208. y: 169.88
  7209. }, {
  7210. x: 214.08,
  7211. y: 174.85
  7212. }, {
  7213. x: 214.64,
  7214. y: 179.82
  7215. }, {
  7216. x: 215.2,
  7217. y: 184.78
  7218. }, {
  7219. x: 216.71,
  7220. y: 189.55
  7221. }, {
  7222. x: 218.21,
  7223. y: 194.32
  7224. }, {
  7225. x: 219.71,
  7226. y: 199.09
  7227. }, {
  7228. x: 219.79,
  7229. y: 204.09
  7230. }, {
  7231. x: 219.86,
  7232. y: 209.09
  7233. }, {
  7234. x: 219.93,
  7235. y: 214.09
  7236. }, {
  7237. x: 220,
  7238. y: 219.09
  7239. }, {
  7240. x: 220,
  7241. y: 224.09
  7242. }, {
  7243. x: 220,
  7244. y: 229.09
  7245. }, {
  7246. x: 220,
  7247. y: 234.09
  7248. }, {
  7249. x: 217.12,
  7250. y: 238.17
  7251. }, {
  7252. x: 214.23,
  7253. y: 242.26
  7254. }, {
  7255. x: 212.66,
  7256. y: 247
  7257. }, {
  7258. x: 211.08,
  7259. y: 251.75
  7260. }, {
  7261. x: 209.5,
  7262. y: 256.49
  7263. }, {
  7264. x: 206.17,
  7265. y: 260.22
  7266. }, {
  7267. x: 202.84,
  7268. y: 263.95
  7269. }, {
  7270. x: 199.5,
  7271. y: 267.67
  7272. }, {
  7273. x: 197.44,
  7274. y: 272.23
  7275. }, {
  7276. x: 195.37,
  7277. y: 276.78
  7278. }, {
  7279. x: 193.3,
  7280. y: 281.33
  7281. }, {
  7282. x: 190.93,
  7283. y: 285.73
  7284. }, {
  7285. x: 188.55,
  7286. y: 290.13
  7287. }, {
  7288. x: 186.17,
  7289. y: 294.53
  7290. }, {
  7291. x: 184.32,
  7292. y: 299.17
  7293. }, {
  7294. x: 182.47,
  7295. y: 303.82
  7296. }, {
  7297. x: 178.26,
  7298. y: 306.51
  7299. }, {
  7300. x: 174.05,
  7301. y: 309.21
  7302. }, {
  7303. x: 169.84,
  7304. y: 311.9
  7305. }, {
  7306. x: 165.63,
  7307. y: 314.6
  7308. }, {
  7309. x: 161.8,
  7310. y: 317.82
  7311. }, {
  7312. x: 157.98,
  7313. y: 321.05
  7314. }, {
  7315. x: 154.16,
  7316. y: 324.27
  7317. }, {
  7318. x: 150.34,
  7319. y: 327.5
  7320. }, {
  7321. x: 146.52,
  7322. y: 330.72
  7323. }, {
  7324. x: 144.59,
  7325. y: 335.33
  7326. }, {
  7327. x: 142.66,
  7328. y: 339.94
  7329. }, {
  7330. x: 140.72,
  7331. y: 344.56
  7332. }, {
  7333. x: 138.79,
  7334. y: 349.17
  7335. }, {
  7336. x: 136.86,
  7337. y: 353.78
  7338. }, {
  7339. x: 134.93,
  7340. y: 358.39
  7341. }, {
  7342. x: 133,
  7343. y: 363
  7344. }, {
  7345. x: 131.71,
  7346. y: 367.83
  7347. }, {
  7348. x: 130.42,
  7349. y: 372.67
  7350. }, {
  7351. x: 129.13,
  7352. y: 377.5
  7353. }, {
  7354. x: 127.85,
  7355. y: 382.33
  7356. }, {
  7357. x: 126.56,
  7358. y: 387.16
  7359. }, {
  7360. x: 125.27,
  7361. y: 391.99
  7362. }, {
  7363. x: 125.64,
  7364. y: 396.98
  7365. }, {
  7366. x: 126.02,
  7367. y: 401.96
  7368. }, {
  7369. x: 126.39,
  7370. y: 406.95
  7371. }, {
  7372. x: 126.77,
  7373. y: 411.93
  7374. }, {
  7375. x: 127.14,
  7376. y: 416.92
  7377. }, {
  7378. x: 129.54,
  7379. y: 421.31
  7380. }, {
  7381. x: 131.93,
  7382. y: 425.7
  7383. }, {
  7384. x: 134.32,
  7385. y: 430.09
  7386. }, {
  7387. x: 136.72,
  7388. y: 434.48
  7389. }, {
  7390. x: 141.6,
  7391. y: 435.54
  7392. }, {
  7393. x: 146.49,
  7394. y: 436.59
  7395. }, {
  7396. x: 151.38,
  7397. y: 437.65
  7398. }, {
  7399. x: 156.37,
  7400. y: 437.44
  7401. }, {
  7402. x: 161.37,
  7403. y: 437.23
  7404. }, {
  7405. x: 166.37,
  7406. y: 437.03
  7407. }, {
  7408. x: 171.34,
  7409. y: 436.54
  7410. }, {
  7411. x: 176.32,
  7412. y: 436.05
  7413. }, {
  7414. x: 181.29,
  7415. y: 435.56
  7416. }, {
  7417. x: 186.27,
  7418. y: 435.07
  7419. }, {
  7420. x: 191.21,
  7421. y: 434.3
  7422. }, {
  7423. x: 196.15,
  7424. y: 433.53
  7425. }, {
  7426. x: 201.09,
  7427. y: 432.76
  7428. }, {
  7429. x: 206.03,
  7430. y: 432
  7431. }, {
  7432. x: 211.02,
  7433. y: 432.38
  7434. }, {
  7435. x: 216,
  7436. y: 432.76
  7437. }, {
  7438. x: 220.99,
  7439. y: 433.15
  7440. }, {
  7441. x: 225.97,
  7442. y: 433.53
  7443. }, {
  7444. x: 230.96,
  7445. y: 433.92
  7446. }, {
  7447. x: 234.85,
  7448. y: 430.78
  7449. }, {
  7450. x: 238.75,
  7451. y: 427.65
  7452. }, {
  7453. x: 242.64,
  7454. y: 424.51
  7455. }, {
  7456. x: 246.53,
  7457. y: 421.38
  7458. }, {
  7459. x: 251.22,
  7460. y: 419.63
  7461. }, {
  7462. x: 255.9,
  7463. y: 417.88
  7464. }, {
  7465. x: 260.59,
  7466. y: 416.14
  7467. }, {
  7468. x: 265.27,
  7469. y: 414.39
  7470. }, {
  7471. x: 269.96,
  7472. y: 412.64
  7473. }, {
  7474. x: 273.2,
  7475. y: 408.83
  7476. }, {
  7477. x: 276.43,
  7478. y: 405.02
  7479. }, {
  7480. x: 279.67,
  7481. y: 401.21
  7482. }, {
  7483. x: 283.22,
  7484. y: 397.69
  7485. }, {
  7486. x: 286.78,
  7487. y: 394.18
  7488. }, {
  7489. x: 290.33,
  7490. y: 390.66
  7491. }, {
  7492. x: 294.25,
  7493. y: 387.55
  7494. }, {
  7495. x: 298.17,
  7496. y: 384.45
  7497. }, {
  7498. x: 301.63,
  7499. y: 380.84
  7500. }, {
  7501. x: 305.09,
  7502. y: 377.23
  7503. }, {
  7504. x: 308.54,
  7505. y: 373.61
  7506. }, {
  7507. x: 312,
  7508. y: 370
  7509. }, {
  7510. x: 315.41,
  7511. y: 366.35
  7512. }, {
  7513. x: 318.82,
  7514. y: 362.69
  7515. }, {
  7516. x: 322.23,
  7517. y: 359.03
  7518. }, {
  7519. x: 325.65,
  7520. y: 355.38
  7521. }, {
  7522. x: 329.76,
  7523. y: 352.54
  7524. }, {
  7525. x: 333.87,
  7526. y: 349.69
  7527. }, {
  7528. x: 337.98,
  7529. y: 346.85
  7530. }, {
  7531. x: 342.1,
  7532. y: 344.01
  7533. }, {
  7534. x: 346.21,
  7535. y: 341.16
  7536. }, {
  7537. x: 350.7,
  7538. y: 338.96
  7539. }, {
  7540. x: 355.19,
  7541. y: 336.76
  7542. }, {
  7543. x: 359.68,
  7544. y: 334.56
  7545. }, {
  7546. x: 364.17,
  7547. y: 332.37
  7548. }, {
  7549. x: 368.66,
  7550. y: 330.17
  7551. }, {
  7552. x: 373.02,
  7553. y: 327.72
  7554. }, {
  7555. x: 377.38,
  7556. y: 325.27
  7557. }, {
  7558. x: 381.74,
  7559. y: 322.83
  7560. }, {
  7561. x: 386.1,
  7562. y: 320.38
  7563. }, {
  7564. x: 390.99,
  7565. y: 319.34
  7566. }, {
  7567. x: 395.89,
  7568. y: 318.3
  7569. }, {
  7570. x: 400.78,
  7571. y: 317.26
  7572. }, {
  7573. x: 405.77,
  7574. y: 316.99
  7575. }, {
  7576. x: 410.76,
  7577. y: 316.72
  7578. }, {
  7579. x: 415.75,
  7580. y: 316.45
  7581. }, {
  7582. x: 420.75,
  7583. y: 316.18
  7584. }, {
  7585. x: 425.74,
  7586. y: 315.91
  7587. }, {
  7588. x: 430.73,
  7589. y: 315.67
  7590. }, {
  7591. x: 435.73,
  7592. y: 315.44
  7593. }, {
  7594. x: 440.72,
  7595. y: 315.2
  7596. }, {
  7597. x: 445.72,
  7598. y: 314.97
  7599. }, {
  7600. x: 450.72,
  7601. y: 314.97
  7602. }, {
  7603. x: 455.72,
  7604. y: 314.98
  7605. }, {
  7606. x: 460.72,
  7607. y: 314.99
  7608. }, {
  7609. x: 465.72,
  7610. y: 315
  7611. }, {
  7612. x: 470.64,
  7613. y: 314.1
  7614. }, {
  7615. x: 475.55,
  7616. y: 313.2
  7617. }, {
  7618. x: 480.47,
  7619. y: 312.29
  7620. }, {
  7621. x: 485.39,
  7622. y: 311.39
  7623. }, {
  7624. x: 490.31,
  7625. y: 310.49
  7626. }, {
  7627. x: 495.23,
  7628. y: 309.59
  7629. }, {
  7630. x: 500.08,
  7631. y: 308.41
  7632. }, {
  7633. x: 504.94,
  7634. y: 307.23
  7635. }, {
  7636. x: 509.8,
  7637. y: 306.05
  7638. }, {
  7639. x: 514.73,
  7640. y: 305.22
  7641. }, {
  7642. x: 519.66,
  7643. y: 304.4
  7644. }, {
  7645. x: 524.6,
  7646. y: 303.57
  7647. }, {
  7648. x: 529.53,
  7649. y: 302.75
  7650. }, {
  7651. x: 534.46,
  7652. y: 301.93
  7653. }, {
  7654. x: 539.39,
  7655. y: 301.1
  7656. }, {
  7657. x: 544.34,
  7658. y: 300.37
  7659. }, {
  7660. x: 549.28,
  7661. y: 299.63
  7662. }, {
  7663. x: 554.23,
  7664. y: 298.9
  7665. }, {
  7666. x: 559.17,
  7667. y: 298.16
  7668. }, {
  7669. x: 564.12,
  7670. y: 297.43
  7671. }, {
  7672. x: 569.07,
  7673. y: 296.69
  7674. }, {
  7675. x: 574.04,
  7676. y: 296.22
  7677. }, {
  7678. x: 579.02,
  7679. y: 295.75
  7680. }, {
  7681. x: 584,
  7682. y: 295.28
  7683. }, {
  7684. x: 588.98,
  7685. y: 294.81
  7686. }, {
  7687. x: 593.8,
  7688. y: 293.48
  7689. }, {
  7690. x: 598.62,
  7691. y: 292.15
  7692. }, {
  7693. x: 603.43,
  7694. y: 290.82
  7695. }, {
  7696. x: 608.25,
  7697. y: 289.48
  7698. }, {
  7699. x: 613.04,
  7700. y: 288.03
  7701. }, {
  7702. x: 617.82,
  7703. y: 286.57
  7704. }, {
  7705. x: 622.61,
  7706. y: 285.12
  7707. }, {
  7708. x: 627.59,
  7709. y: 284.69
  7710. }, {
  7711. x: 632.57,
  7712. y: 284.27
  7713. }, {
  7714. x: 637.55,
  7715. y: 283.84
  7716. }, {
  7717. x: 642.53,
  7718. y: 283.41
  7719. }, {
  7720. x: 647.51,
  7721. y: 282.98
  7722. }, {
  7723. x: 652.5,
  7724. y: 282.56
  7725. }, {
  7726. x: 657.48,
  7727. y: 282.13
  7728. }, {
  7729. x: 662.47,
  7730. y: 282.29
  7731. }, {
  7732. x: 667.47,
  7733. y: 282.46
  7734. }, {
  7735. x: 672.47,
  7736. y: 282.62
  7737. }, {
  7738. x: 677.47,
  7739. y: 282.79
  7740. }, {
  7741. x: 682.46,
  7742. y: 282.95
  7743. }, {
  7744. x: 687.45,
  7745. y: 283.28
  7746. }, {
  7747. x: 692.44,
  7748. y: 283.62
  7749. }, {
  7750. x: 697.43,
  7751. y: 283.95
  7752. }, {
  7753. x: 702.42,
  7754. y: 284.29
  7755. }, {
  7756. x: 707.41,
  7757. y: 284.62
  7758. }, {
  7759. x: 712.4,
  7760. y: 284.96
  7761. }, {
  7762. x: 717.38,
  7763. y: 285.36
  7764. }, {
  7765. x: 722.36,
  7766. y: 285.75
  7767. }, {
  7768. x: 727.35,
  7769. y: 286.15
  7770. }, {
  7771. x: 732.33,
  7772. y: 286.55
  7773. }, {
  7774. x: 737.32,
  7775. y: 286.95
  7776. }, {
  7777. x: 742.2,
  7778. y: 288
  7779. }, {
  7780. x: 747.09,
  7781. y: 289.06
  7782. }, {
  7783. x: 751.98,
  7784. y: 290.11
  7785. }, {
  7786. x: 756.87,
  7787. y: 291.17
  7788. }, {
  7789. x: 761.75,
  7790. y: 292.22
  7791. }, {
  7792. x: 766.64,
  7793. y: 293.28
  7794. }, {
  7795. x: 771.53,
  7796. y: 294.33
  7797. }, {
  7798. x: 776.43,
  7799. y: 295.3
  7800. }, {
  7801. x: 781.34,
  7802. y: 296.28
  7803. }, {
  7804. x: 786.24,
  7805. y: 297.25
  7806. }, {
  7807. x: 791.15,
  7808. y: 298.23
  7809. }, {
  7810. x: 795.7,
  7811. y: 300.29
  7812. }, {
  7813. x: 800.26,
  7814. y: 302.34
  7815. }, {
  7816. x: 804.82,
  7817. y: 304.4
  7818. }, {
  7819. x: 809.37,
  7820. y: 306.46
  7821. }, {
  7822. x: 813.93,
  7823. y: 308.52
  7824. }, {
  7825. x: 818.92,
  7826. y: 308.9
  7827. }, {
  7828. x: 823.9,
  7829. y: 309.29
  7830. }, {
  7831. x: 828.89,
  7832. y: 309.67
  7833. }, {
  7834. x: 833.87,
  7835. y: 310.06
  7836. }, {
  7837. x: 838.86,
  7838. y: 310.45
  7839. }, {
  7840. x: 843.84,
  7841. y: 310.83
  7842. }, {
  7843. x: 848.84,
  7844. y: 311.02
  7845. }, {
  7846. x: 853.83,
  7847. y: 311.21
  7848. }, {
  7849. x: 858.83,
  7850. y: 311.39
  7851. }, {
  7852. x: 863.83,
  7853. y: 311.58
  7854. }, {
  7855. x: 868.82,
  7856. y: 311.77
  7857. }, {
  7858. x: 873.82,
  7859. y: 311.96
  7860. }, {
  7861. x: 878.78,
  7862. y: 312.56
  7863. }, {
  7864. x: 883.75,
  7865. y: 313.16
  7866. }, {
  7867. x: 888.71,
  7868. y: 313.76
  7869. }, {
  7870. x: 893.68,
  7871. y: 314.36
  7872. }, {
  7873. x: 898.64,
  7874. y: 314.96
  7875. }
  7876. ], [
  7877. {
  7878. x: 205,
  7879. y: -22
  7880. }, {
  7881. x: 203.49,
  7882. y: -17.23
  7883. }, {
  7884. x: 201.98,
  7885. y: -12.47
  7886. }, {
  7887. x: 200.47,
  7888. y: -7.7
  7889. }, {
  7890. x: 198.96,
  7891. y: -2.94
  7892. }, {
  7893. x: 197.44,
  7894. y: 1.83
  7895. }, {
  7896. x: 195.93,
  7897. y: 6.6
  7898. }, {
  7899. x: 194.42,
  7900. y: 11.36
  7901. }, {
  7902. x: 192.91,
  7903. y: 16.13
  7904. }, {
  7905. x: 191.4,
  7906. y: 20.9
  7907. }, {
  7908. x: 190.01,
  7909. y: 25.7
  7910. }, {
  7911. x: 188.63,
  7912. y: 30.5
  7913. }, {
  7914. x: 187.24,
  7915. y: 35.31
  7916. }, {
  7917. x: 185.85,
  7918. y: 40.11
  7919. }, {
  7920. x: 184.47,
  7921. y: 44.92
  7922. }, {
  7923. x: 183.08,
  7924. y: 49.72
  7925. }, {
  7926. x: 182.06,
  7927. y: 54.61
  7928. }, {
  7929. x: 181.03,
  7930. y: 59.51
  7931. }, {
  7932. x: 180.01,
  7933. y: 64.4
  7934. }, {
  7935. x: 178.98,
  7936. y: 69.3
  7937. }, {
  7938. x: 177.96,
  7939. y: 74.19
  7940. }, {
  7941. x: 178.35,
  7942. y: 79.17
  7943. }, {
  7944. x: 178.75,
  7945. y: 84.16
  7946. }, {
  7947. x: 179.14,
  7948. y: 89.14
  7949. }, {
  7950. x: 179.54,
  7951. y: 94.13
  7952. }, {
  7953. x: 179.93,
  7954. y: 99.11
  7955. }, {
  7956. x: 179.94,
  7957. y: 104.11
  7958. }, {
  7959. x: 179.95,
  7960. y: 109.11
  7961. }, {
  7962. x: 179.97,
  7963. y: 114.11
  7964. }, {
  7965. x: 179.98,
  7966. y: 119.11
  7967. }, {
  7968. x: 179.99,
  7969. y: 124.11
  7970. }, {
  7971. x: 180.01,
  7972. y: 129.11
  7973. }, {
  7974. x: 181.22,
  7975. y: 133.96
  7976. }, {
  7977. x: 182.44,
  7978. y: 138.81
  7979. }, {
  7980. x: 183.65,
  7981. y: 143.66
  7982. }, {
  7983. x: 184.87,
  7984. y: 148.51
  7985. }, {
  7986. x: 186.09,
  7987. y: 153.36
  7988. }, {
  7989. x: 187.3,
  7990. y: 158.21
  7991. }, {
  7992. x: 187.73,
  7993. y: 163.19
  7994. }, {
  7995. x: 188.15,
  7996. y: 168.17
  7997. }, {
  7998. x: 188.57,
  7999. y: 173.16
  8000. }, {
  8001. x: 188.99,
  8002. y: 178.14
  8003. }, {
  8004. x: 189.42,
  8005. y: 183.12
  8006. }, {
  8007. x: 189.84,
  8008. y: 188.1
  8009. }, {
  8010. x: 189.53,
  8011. y: 193.09
  8012. }, {
  8013. x: 189.23,
  8014. y: 198.08
  8015. }, {
  8016. x: 188.92,
  8017. y: 203.07
  8018. }, {
  8019. x: 188.61,
  8020. y: 208.07
  8021. }, {
  8022. x: 188.3,
  8023. y: 213.06
  8024. }, {
  8025. x: 188,
  8026. y: 218.05
  8027. }, {
  8028. x: 186.14,
  8029. y: 222.69
  8030. }, {
  8031. x: 184.28,
  8032. y: 227.33
  8033. }, {
  8034. x: 182.42,
  8035. y: 231.97
  8036. }, {
  8037. x: 180.56,
  8038. y: 236.61
  8039. }, {
  8040. x: 178.7,
  8041. y: 241.25
  8042. }, {
  8043. x: 176.84,
  8044. y: 245.9
  8045. }, {
  8046. x: 174.35,
  8047. y: 250.23
  8048. }, {
  8049. x: 171.86,
  8050. y: 254.57
  8051. }, {
  8052. x: 169.37,
  8053. y: 258.9
  8054. }, {
  8055. x: 166.88,
  8056. y: 263.24
  8057. }, {
  8058. x: 164.39,
  8059. y: 267.57
  8060. }, {
  8061. x: 161.9,
  8062. y: 271.91
  8063. }, {
  8064. x: 160.01,
  8065. y: 276.54
  8066. }, {
  8067. x: 158.12,
  8068. y: 281.17
  8069. }, {
  8070. x: 156.22,
  8071. y: 285.79
  8072. }, {
  8073. x: 154.33,
  8074. y: 290.42
  8075. }, {
  8076. x: 152.44,
  8077. y: 295.05
  8078. }, {
  8079. x: 150.54,
  8080. y: 299.68
  8081. }, {
  8082. x: 146.79,
  8083. y: 302.98
  8084. }, {
  8085. x: 143.04,
  8086. y: 306.28
  8087. }, {
  8088. x: 139.28,
  8089. y: 309.59
  8090. }, {
  8091. x: 135.53,
  8092. y: 312.89
  8093. }, {
  8094. x: 131.78,
  8095. y: 316.2
  8096. }, {
  8097. x: 129.2,
  8098. y: 320.48
  8099. }, {
  8100. x: 126.61,
  8101. y: 324.76
  8102. }, {
  8103. x: 124.03,
  8104. y: 329.04
  8105. }, {
  8106. x: 121.45,
  8107. y: 333.32
  8108. }, {
  8109. x: 118.87,
  8110. y: 337.61
  8111. }, {
  8112. x: 116.29,
  8113. y: 341.89
  8114. }, {
  8115. x: 113.71,
  8116. y: 346.17
  8117. }, {
  8118. x: 111.12,
  8119. y: 350.45
  8120. }, {
  8121. x: 109.29,
  8122. y: 355.1
  8123. }, {
  8124. x: 107.45,
  8125. y: 359.75
  8126. }, {
  8127. x: 105.61,
  8128. y: 364.4
  8129. }, {
  8130. x: 103.77,
  8131. y: 369.05
  8132. }, {
  8133. x: 103.53,
  8134. y: 374.05
  8135. }, {
  8136. x: 103.29,
  8137. y: 379.04
  8138. }, {
  8139. x: 103.05,
  8140. y: 384.03
  8141. }, {
  8142. x: 102.81,
  8143. y: 389.03
  8144. }, {
  8145. x: 102.57,
  8146. y: 394.02
  8147. }, {
  8148. x: 102.33,
  8149. y: 399.02
  8150. }, {
  8151. x: 102.1,
  8152. y: 404.01
  8153. }, {
  8154. x: 102.46,
  8155. y: 409
  8156. }, {
  8157. x: 102.82,
  8158. y: 413.98
  8159. }, {
  8160. x: 103.18,
  8161. y: 418.97
  8162. }, {
  8163. x: 103.54,
  8164. y: 423.96
  8165. }, {
  8166. x: 103.91,
  8167. y: 428.94
  8168. }, {
  8169. x: 104.27,
  8170. y: 433.93
  8171. }, {
  8172. x: 104.63,
  8173. y: 438.92
  8174. }, {
  8175. x: 104.99,
  8176. y: 443.91
  8177. }, {
  8178. x: 109.63,
  8179. y: 445.78
  8180. }, {
  8181. x: 114.27,
  8182. y: 447.65
  8183. }, {
  8184. x: 118.9,
  8185. y: 449.52
  8186. }, {
  8187. x: 123.54,
  8188. y: 451.39
  8189. }, {
  8190. x: 128.18,
  8191. y: 453.26
  8192. }, {
  8193. x: 133.03,
  8194. y: 454.48
  8195. }, {
  8196. x: 137.88,
  8197. y: 455.7
  8198. }, {
  8199. x: 142.72,
  8200. y: 456.91
  8201. }, {
  8202. x: 147.57,
  8203. y: 458.13
  8204. }, {
  8205. x: 152.42,
  8206. y: 459.35
  8207. }, {
  8208. x: 157.27,
  8209. y: 460.56
  8210. }, {
  8211. x: 162.12,
  8212. y: 461.78
  8213. }, {
  8214. x: 167.11,
  8215. y: 461.44
  8216. }, {
  8217. x: 172.1,
  8218. y: 461.1
  8219. }, {
  8220. x: 177.09,
  8221. y: 460.76
  8222. }, {
  8223. x: 182.08,
  8224. y: 460.42
  8225. }, {
  8226. x: 187.07,
  8227. y: 460.08
  8228. }, {
  8229. x: 192.05,
  8230. y: 459.74
  8231. }, {
  8232. x: 197.04,
  8233. y: 459.41
  8234. }, {
  8235. x: 202.03,
  8236. y: 459.07
  8237. }, {
  8238. x: 206.95,
  8239. y: 458.16
  8240. }, {
  8241. x: 211.87,
  8242. y: 457.26
  8243. }, {
  8244. x: 216.78,
  8245. y: 456.35
  8246. }, {
  8247. x: 221.7,
  8248. y: 455.45
  8249. }, {
  8250. x: 226.62,
  8251. y: 454.54
  8252. }, {
  8253. x: 231.54,
  8254. y: 453.64
  8255. }, {
  8256. x: 236.45,
  8257. y: 452.73
  8258. }, {
  8259. x: 241,
  8260. y: 450.65
  8261. }, {
  8262. x: 245.54,
  8263. y: 448.56
  8264. }, {
  8265. x: 250.09,
  8266. y: 446.48
  8267. }, {
  8268. x: 254.63,
  8269. y: 444.39
  8270. }, {
  8271. x: 259.18,
  8272. y: 442.31
  8273. }, {
  8274. x: 263.72,
  8275. y: 440.22
  8276. }, {
  8277. x: 268.27,
  8278. y: 438.14
  8279. }, {
  8280. x: 272.81,
  8281. y: 436.05
  8282. }, {
  8283. x: 277.35,
  8284. y: 433.97
  8285. }, {
  8286. x: 281.9,
  8287. y: 431.88
  8288. }, {
  8289. x: 286.44,
  8290. y: 429.8
  8291. }, {
  8292. x: 290.46,
  8293. y: 426.82
  8294. }, {
  8295. x: 294.47,
  8296. y: 423.84
  8297. }, {
  8298. x: 298.49,
  8299. y: 420.85
  8300. }, {
  8301. x: 302.5,
  8302. y: 417.87
  8303. }, {
  8304. x: 306.52,
  8305. y: 414.89
  8306. }, {
  8307. x: 310.53,
  8308. y: 411.91
  8309. }, {
  8310. x: 314.54,
  8311. y: 408.93
  8312. }, {
  8313. x: 318.56,
  8314. y: 405.95
  8315. }, {
  8316. x: 322.57,
  8317. y: 402.97
  8318. }, {
  8319. x: 326.59,
  8320. y: 399.99
  8321. }, {
  8322. x: 330.6,
  8323. y: 397.01
  8324. }, {
  8325. x: 334.62,
  8326. y: 394.03
  8327. }, {
  8328. x: 338.62,
  8329. y: 391.03
  8330. }, {
  8331. x: 342.62,
  8332. y: 388.03
  8333. }, {
  8334. x: 346.62,
  8335. y: 385.03
  8336. }, {
  8337. x: 350.62,
  8338. y: 382.03
  8339. }, {
  8340. x: 354.62,
  8341. y: 379.03
  8342. }, {
  8343. x: 358.62,
  8344. y: 376.03
  8345. }, {
  8346. x: 362.62,
  8347. y: 373.03
  8348. }, {
  8349. x: 366.62,
  8350. y: 370.03
  8351. }, {
  8352. x: 370.62,
  8353. y: 367.03
  8354. }, {
  8355. x: 374.96,
  8356. y: 364.56
  8357. }, {
  8358. x: 379.31,
  8359. y: 362.08
  8360. }, {
  8361. x: 383.65,
  8362. y: 359.61
  8363. }, {
  8364. x: 388,
  8365. y: 357.13
  8366. }, {
  8367. x: 392.34,
  8368. y: 354.66
  8369. }, {
  8370. x: 396.68,
  8371. y: 352.18
  8372. }, {
  8373. x: 401.52,
  8374. y: 350.89
  8375. }, {
  8376. x: 406.35,
  8377. y: 349.6
  8378. }, {
  8379. x: 411.18,
  8380. y: 348.31
  8381. }, {
  8382. x: 416.01,
  8383. y: 347.02
  8384. }, {
  8385. x: 420.84,
  8386. y: 345.72
  8387. }, {
  8388. x: 425.67,
  8389. y: 344.43
  8390. }, {
  8391. x: 430.5,
  8392. y: 343.14
  8393. }, {
  8394. x: 435.33,
  8395. y: 341.85
  8396. }, {
  8397. x: 440.16,
  8398. y: 340.56
  8399. }, {
  8400. x: 444.99,
  8401. y: 339.27
  8402. }, {
  8403. x: 449.99,
  8404. y: 339.12
  8405. }, {
  8406. x: 454.98,
  8407. y: 338.97
  8408. }, {
  8409. x: 459.98,
  8410. y: 338.82
  8411. }, {
  8412. x: 464.98,
  8413. y: 338.67
  8414. }, {
  8415. x: 469.98,
  8416. y: 338.51
  8417. }, {
  8418. x: 474.98,
  8419. y: 338.36
  8420. }, {
  8421. x: 479.97,
  8422. y: 338.21
  8423. }, {
  8424. x: 484.97,
  8425. y: 338.06
  8426. }, {
  8427. x: 489.97,
  8428. y: 337.89
  8429. }, {
  8430. x: 494.97,
  8431. y: 337.72
  8432. }, {
  8433. x: 499.96,
  8434. y: 337.55
  8435. }, {
  8436. x: 504.96,
  8437. y: 337.38
  8438. }, {
  8439. x: 509.96,
  8440. y: 337.21
  8441. }, {
  8442. x: 514.95,
  8443. y: 337.04
  8444. }, {
  8445. x: 519.83,
  8446. y: 335.93
  8447. }, {
  8448. x: 524.71,
  8449. y: 334.83
  8450. }, {
  8451. x: 529.58,
  8452. y: 333.72
  8453. }, {
  8454. x: 534.46,
  8455. y: 332.62
  8456. }, {
  8457. x: 539.34,
  8458. y: 331.51
  8459. }, {
  8460. x: 544.21,
  8461. y: 330.41
  8462. }, {
  8463. x: 548.99,
  8464. y: 328.93
  8465. }, {
  8466. x: 553.77,
  8467. y: 327.46
  8468. }, {
  8469. x: 558.55,
  8470. y: 325.99
  8471. }, {
  8472. x: 563.33,
  8473. y: 324.52
  8474. }, {
  8475. x: 568.1,
  8476. y: 323.05
  8477. }, {
  8478. x: 572.88,
  8479. y: 321.58
  8480. }, {
  8481. x: 577.66,
  8482. y: 320.1
  8483. }, {
  8484. x: 582.59,
  8485. y: 319.24
  8486. }, {
  8487. x: 587.51,
  8488. y: 318.38
  8489. }, {
  8490. x: 592.44,
  8491. y: 317.52
  8492. }, {
  8493. x: 597.36,
  8494. y: 316.66
  8495. }, {
  8496. x: 602.29,
  8497. y: 315.8
  8498. }, {
  8499. x: 607.21,
  8500. y: 314.94
  8501. }, {
  8502. x: 612.14,
  8503. y: 314.07
  8504. }, {
  8505. x: 617.06,
  8506. y: 313.21
  8507. }, {
  8508. x: 621.99,
  8509. y: 312.35
  8510. }, {
  8511. x: 626.91,
  8512. y: 311.49
  8513. }, {
  8514. x: 631.84,
  8515. y: 310.63
  8516. }, {
  8517. x: 636.76,
  8518. y: 309.77
  8519. }, {
  8520. x: 641.69,
  8521. y: 308.9
  8522. }, {
  8523. x: 646.61,
  8524. y: 308.04
  8525. }, {
  8526. x: 651.54,
  8527. y: 307.18
  8528. }, {
  8529. x: 656.46,
  8530. y: 306.32
  8531. }, {
  8532. x: 661.39,
  8533. y: 305.46
  8534. }, {
  8535. x: 666.31,
  8536. y: 304.59
  8537. }, {
  8538. x: 671.31,
  8539. y: 304.53
  8540. }, {
  8541. x: 676.31,
  8542. y: 304.46
  8543. }, {
  8544. x: 681.31,
  8545. y: 304.39
  8546. }, {
  8547. x: 686.31,
  8548. y: 304.32
  8549. }, {
  8550. x: 691.31,
  8551. y: 304.25
  8552. }, {
  8553. x: 696.31,
  8554. y: 304.19
  8555. }, {
  8556. x: 701.31,
  8557. y: 304.12
  8558. }, {
  8559. x: 706.31,
  8560. y: 304.05
  8561. }, {
  8562. x: 711.31,
  8563. y: 303.98
  8564. }, {
  8565. x: 716.3,
  8566. y: 304.29
  8567. }, {
  8568. x: 721.29,
  8569. y: 304.6
  8570. }, {
  8571. x: 726.28,
  8572. y: 304.91
  8573. }, {
  8574. x: 731.27,
  8575. y: 305.21
  8576. }, {
  8577. x: 736.26,
  8578. y: 305.52
  8579. }, {
  8580. x: 741.25,
  8581. y: 305.83
  8582. }, {
  8583. x: 746.24,
  8584. y: 306.14
  8585. }, {
  8586. x: 750.95,
  8587. y: 307.84
  8588. }, {
  8589. x: 755.65,
  8590. y: 309.54
  8591. }, {
  8592. x: 760.35,
  8593. y: 311.24
  8594. }, {
  8595. x: 765.05,
  8596. y: 312.94
  8597. }, {
  8598. x: 769.76,
  8599. y: 314.63
  8600. }, {
  8601. x: 774.53,
  8602. y: 316.11
  8603. }, {
  8604. x: 779.31,
  8605. y: 317.59
  8606. }, {
  8607. x: 784.09,
  8608. y: 319.07
  8609. }, {
  8610. x: 788.86,
  8611. y: 320.55
  8612. }, {
  8613. x: 793.64,
  8614. y: 322.03
  8615. }, {
  8616. x: 798.41,
  8617. y: 323.51
  8618. }, {
  8619. x: 803.11,
  8620. y: 325.24
  8621. }, {
  8622. x: 807.8,
  8623. y: 326.97
  8624. }, {
  8625. x: 812.49,
  8626. y: 328.7
  8627. }, {
  8628. x: 817.18,
  8629. y: 330.43
  8630. }, {
  8631. x: 821.87,
  8632. y: 332.16
  8633. }, {
  8634. x: 826.56,
  8635. y: 333.89
  8636. }, {
  8637. x: 831.25,
  8638. y: 335.62
  8639. }, {
  8640. x: 835.94,
  8641. y: 337.35
  8642. }, {
  8643. x: 840.79,
  8644. y: 338.59
  8645. }, {
  8646. x: 845.63,
  8647. y: 339.83
  8648. }, {
  8649. x: 850.48,
  8650. y: 341.07
  8651. }, {
  8652. x: 855.32,
  8653. y: 342.31
  8654. }, {
  8655. x: 860.16,
  8656. y: 343.55
  8657. }, {
  8658. x: 865.01,
  8659. y: 344.79
  8660. }, {
  8661. x: 869.85,
  8662. y: 346.03
  8663. }, {
  8664. x: 874.69,
  8665. y: 347.27
  8666. }, {
  8667. x: 879.54,
  8668. y: 348.51
  8669. }, {
  8670. x: 884.38,
  8671. y: 349.75
  8672. }, {
  8673. x: 889.23,
  8674. y: 350.99
  8675. }, {
  8676. x: 894.07,
  8677. y: 352.23
  8678. }, {
  8679. x: 898.91,
  8680. y: 353.47
  8681. }
  8682. ]
  8683. ]
  8684. ];
  8685. this.playerLives = this.levelLives = 100;
  8686. this.playerGold = 200;
  8687. this.playerDna = 0;
  8688. this.towersToBePlaced = [
  8689. {
  8690. type: '',
  8691. upgradeLevel: 0
  8692. }, {
  8693. type: '',
  8694. upgradeLevel: 0
  8695. }, {
  8696. type: '',
  8697. upgradeLevel: 0
  8698. }, {
  8699. type: '',
  8700. upgradeLevel: 0
  8701. }, {
  8702. type: '',
  8703. upgradeLevel: 0
  8704. }, {
  8705. type: '',
  8706. upgradeLevel: 0
  8707. }, {
  8708. type: '',
  8709. upgradeLevel: 0
  8710. }
  8711. ];
  8712. this.waves = [
  8713. {
  8714. delay: 0,
  8715. roads: [
  8716. {
  8717. callButton: {
  8718. x: 199,
  8719. y: 40
  8720. },
  8721. diseasesList: [
  8722. {
  8723. dis: 'Tuberculosis',
  8724. delay: 10
  8725. }
  8726. ]
  8727. }
  8728. ]
  8729. }, {
  8730. delay: 300,
  8731. roads: [
  8732. {
  8733. callButton: {
  8734. x: 199,
  8735. y: 40
  8736. },
  8737. diseasesList: [
  8738. {
  8739. dis: 'Tuberculosis',
  8740. delay: 50
  8741. }, {
  8742. dis: 'Tuberculosis',
  8743. delay: 50
  8744. }, {
  8745. dis: 'Tuberculosis',
  8746. delay: 50
  8747. }, {
  8748. dis: 'Tuberculosis',
  8749. delay: 50
  8750. }
  8751. ]
  8752. }
  8753. ]
  8754. }, {
  8755. delay: 300,
  8756. roads: [
  8757. {
  8758. callButton: {
  8759. x: 199,
  8760. y: 40
  8761. },
  8762. diseasesList: [
  8763. {
  8764. dis: 'Tuberculosis',
  8765. delay: 50
  8766. }, {
  8767. dis: 'Tuberculosis',
  8768. delay: 50
  8769. }, {
  8770. dis: 'Tuberculosis',
  8771. delay: 50
  8772. }, {
  8773. dis: 'Tuberculosis',
  8774. delay: 50
  8775. }, {
  8776. dis: 'Tuberculosis',
  8777. delay: 200
  8778. }, {
  8779. dis: 'Tuberculosis',
  8780. delay: 50
  8781. }, {
  8782. dis: 'Tuberculosis',
  8783. delay: 50
  8784. }, {
  8785. dis: 'Tuberculosis',
  8786. delay: 50
  8787. }
  8788. ]
  8789. }
  8790. ]
  8791. }, {
  8792. delay: 300,
  8793. roads: [
  8794. {
  8795. callButton: {
  8796. x: 199,
  8797. y: 40
  8798. },
  8799. diseasesList: [
  8800. {
  8801. dis: 'Tuberculosis',
  8802. delay: 50
  8803. }, {
  8804. dis: 'Tuberculosis',
  8805. delay: 50
  8806. }, {
  8807. dis: 'Tuberculosis',
  8808. delay: 50
  8809. }, {
  8810. dis: 'Tuberculosis',
  8811. delay: 50
  8812. }, {
  8813. dis: 'Tuberculosis',
  8814. delay: 50
  8815. }, {
  8816. dis: 'Tuberculosis',
  8817. delay: 300
  8818. }, {
  8819. dis: 'Tuberculosis',
  8820. delay: 50
  8821. }, {
  8822. dis: 'Tuberculosis',
  8823. delay: 50
  8824. }, {
  8825. dis: 'Tuberculosis',
  8826. delay: 50
  8827. }, {
  8828. dis: 'Tuberculosis',
  8829. delay: 50
  8830. }
  8831. ]
  8832. }
  8833. ]
  8834. }, {
  8835. delay: 300,
  8836. roads: [
  8837. {
  8838. callButton: {
  8839. x: 199,
  8840. y: 40
  8841. },
  8842. diseasesList: [
  8843. {
  8844. dis: 'Tuberculosis',
  8845. delay: 50
  8846. }, {
  8847. dis: 'Tuberculosis',
  8848. delay: 50
  8849. }, {
  8850. dis: 'Tuberculosis',
  8851. delay: 50
  8852. }, {
  8853. dis: 'Tuberculosis',
  8854. delay: 50
  8855. }, {
  8856. dis: 'Tuberculosis',
  8857. delay: 50
  8858. }, {
  8859. dis: 'Tuberculosis',
  8860. delay: 300
  8861. }, {
  8862. dis: 'Tuberculosis',
  8863. delay: 50
  8864. }, {
  8865. dis: 'Tuberculosis',
  8866. delay: 50
  8867. }, {
  8868. dis: 'Tuberculosis',
  8869. delay: 50
  8870. }, {
  8871. dis: 'Tuberculosis',
  8872. delay: 50
  8873. }, {
  8874. dis: 'Tuberculosis',
  8875. delay: 300
  8876. }, {
  8877. dis: 'Tuberculosis',
  8878. delay: 50
  8879. }, {
  8880. dis: 'Tuberculosis',
  8881. delay: 50
  8882. }, {
  8883. dis: 'Tuberculosis',
  8884. delay: 50
  8885. }, {
  8886. dis: 'Tuberculosis',
  8887. delay: 50
  8888. }
  8889. ]
  8890. }
  8891. ]
  8892. }
  8893. ];
  8894. Level0.__super__.constructor.call(this, game);
  8895. this.pausable = false;
  8896. }
  8897. Level0.prototype.buildSpecial = function() {
  8898. this.addTutoBubbles();
  8899. return this.addTutoScreen();
  8900. };
  8901. Level0.prototype.addTutoBubbles = function() {
  8902. return this.ui.tutoBubles.addChild(new dka.TutoBubble('Build here!', new createjs.Point(this.towers[2].x, this.towers[2].y - 50), this, this.TOWER_MENU_OPEN_EVENT));
  8903. };
  8904. Level0.prototype.addTutoScreen = function() {
  8905. return this.ui.addChild(new dka.ScreenTuto());
  8906. };
  8907. return Level0;
  8908. })(dka.Level);
  8909. }).call(this);
  8910. /*
  8911. * Copyright © Romain Fouquet, 2012-2015
  8912. * Copyright © Clément Joly, 2012-2015
  8913. #
  8914. * romain.fouquet18@gmail.com
  8915. * leowzukw@vmail.me
  8916. #
  8917. * This file is part of Diseases Killer Academy.
  8918. #
  8919. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  8920. * it under the terms of the GNU Affero General Public License as published by
  8921. * the Free Software Foundation, either version 3 of the License, or
  8922. * (at your option) any later version.
  8923. #
  8924. * Diseases Killer Academy is distributed in the hope that it will be useful,
  8925. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8926. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8927. * GNU Affero General Public License for more details.
  8928. #
  8929. * You should have received a copy of the GNU Affero General Public License
  8930. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  8931. */
  8932. (function() {
  8933. 'use strict';
  8934. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  8935. hasProp = {}.hasOwnProperty;
  8936. dka.Level1 = (function(superClass) {
  8937. extend(Level1, superClass);
  8938. function Level1(game) {
  8939. this.level = 0;
  8940. this.name = 'Tuto';
  8941. this.map = 'map0';
  8942. this.hospital = {
  8943. x: 682,
  8944. y: 122
  8945. };
  8946. this.hospitalImage = 'hospital0';
  8947. this.hospitalSize = {
  8948. regX: 144 / 2,
  8949. regY: 59 / 2,
  8950. width: 144,
  8951. height: 59
  8952. };
  8953. this.placeDate = 'Antiquity - Greece';
  8954. this.hintLabsMsg = 'Hello, guy ! ;) I will be your teacher during\nall the time of this game...`Try to be brillant !';
  8955. this.towers = [
  8956. {
  8957. x: 108,
  8958. y: 164,
  8959. cell: {
  8960. road: 1,
  8961. path: 0
  8962. }
  8963. }, {
  8964. x: 296,
  8965. y: 211,
  8966. cell: {
  8967. road: 0,
  8968. path: 2
  8969. }
  8970. }, {
  8971. x: 440,
  8972. y: 53,
  8973. cell: {
  8974. road: 0,
  8975. path: 1
  8976. }
  8977. }, {
  8978. x: 466,
  8979. y: 211,
  8980. cell: {
  8981. road: 0,
  8982. path: 1
  8983. }
  8984. }, {
  8985. x: 450,
  8986. y: 320,
  8987. cell: {
  8988. road: 0,
  8989. path: 1
  8990. }
  8991. }, {
  8992. x: 809,
  8993. y: 321,
  8994. cell: {
  8995. road: 0,
  8996. path: 2
  8997. }
  8998. }, {
  8999. x: 791,
  9000. y: 160,
  9001. cell: {
  9002. road: 0,
  9003. path: 1
  9004. }
  9005. }
  9006. ];
  9007. this.waypoints = [
  9008. [
  9009. [
  9010. {
  9011. x: -27,
  9012. y: 270
  9013. }, {
  9014. x: -22,
  9015. y: 270.06
  9016. }, {
  9017. x: -17,
  9018. y: 270.13
  9019. }, {
  9020. x: -12,
  9021. y: 270.19
  9022. }, {
  9023. x: -7,
  9024. y: 270.26
  9025. }, {
  9026. x: -2,
  9027. y: 270.32
  9028. }, {
  9029. x: 3,
  9030. y: 270.39
  9031. }, {
  9032. x: 8,
  9033. y: 270.45
  9034. }, {
  9035. x: 13,
  9036. y: 270.52
  9037. }, {
  9038. x: 18,
  9039. y: 270.58
  9040. }, {
  9041. x: 23,
  9042. y: 270.65
  9043. }, {
  9044. x: 28,
  9045. y: 270.71
  9046. }, {
  9047. x: 32.99,
  9048. y: 270.78
  9049. }, {
  9050. x: 37.99,
  9051. y: 270.84
  9052. }, {
  9053. x: 42.99,
  9054. y: 270.91
  9055. }, {
  9056. x: 47.99,
  9057. y: 270.97
  9058. }, {
  9059. x: 52.99,
  9060. y: 271.03
  9061. }, {
  9062. x: 57.99,
  9063. y: 271.1
  9064. }, {
  9065. x: 62.99,
  9066. y: 271.16
  9067. }, {
  9068. x: 67.99,
  9069. y: 271.23
  9070. }, {
  9071. x: 72.99,
  9072. y: 271.29
  9073. }, {
  9074. x: 77.99,
  9075. y: 271.36
  9076. }, {
  9077. x: 82.99,
  9078. y: 271.42
  9079. }, {
  9080. x: 87.99,
  9081. y: 271.49
  9082. }, {
  9083. x: 92.99,
  9084. y: 271.55
  9085. }, {
  9086. x: 97.99,
  9087. y: 271.62
  9088. }, {
  9089. x: 102.99,
  9090. y: 271.68
  9091. }, {
  9092. x: 107.99,
  9093. y: 271.75
  9094. }, {
  9095. x: 112.99,
  9096. y: 271.81
  9097. }, {
  9098. x: 117.99,
  9099. y: 271.87
  9100. }, {
  9101. x: 122.99,
  9102. y: 271.94
  9103. }, {
  9104. x: 127.99,
  9105. y: 272
  9106. }, {
  9107. x: 132.99,
  9108. y: 272.07
  9109. }, {
  9110. x: 137.99,
  9111. y: 272.13
  9112. }, {
  9113. x: 142.99,
  9114. y: 272.2
  9115. }, {
  9116. x: 147.99,
  9117. y: 272.26
  9118. }, {
  9119. x: 152.98,
  9120. y: 272.33
  9121. }, {
  9122. x: 157.98,
  9123. y: 272.39
  9124. }, {
  9125. x: 162.98,
  9126. y: 272.46
  9127. }, {
  9128. x: 167.98,
  9129. y: 272.52
  9130. }, {
  9131. x: 172.98,
  9132. y: 272.59
  9133. }, {
  9134. x: 177.98,
  9135. y: 272.65
  9136. }, {
  9137. x: 182.98,
  9138. y: 272.72
  9139. }, {
  9140. x: 187.98,
  9141. y: 272.78
  9142. }, {
  9143. x: 192.98,
  9144. y: 272.84
  9145. }, {
  9146. x: 197.98,
  9147. y: 272.91
  9148. }, {
  9149. x: 202.98,
  9150. y: 272.97
  9151. }, {
  9152. x: 205.06,
  9153. y: 268.43
  9154. }, {
  9155. x: 207.14,
  9156. y: 263.88
  9157. }, {
  9158. x: 209.21,
  9159. y: 259.33
  9160. }, {
  9161. x: 211.29,
  9162. y: 254.78
  9163. }, {
  9164. x: 213.37,
  9165. y: 250.24
  9166. }, {
  9167. x: 215.45,
  9168. y: 245.69
  9169. }, {
  9170. x: 217.53,
  9171. y: 241.14
  9172. }, {
  9173. x: 219.61,
  9174. y: 236.59
  9175. }, {
  9176. x: 221.68,
  9177. y: 232.04
  9178. }, {
  9179. x: 223.76,
  9180. y: 227.5
  9181. }, {
  9182. x: 225.84,
  9183. y: 222.95
  9184. }, {
  9185. x: 227.92,
  9186. y: 218.4
  9187. }, {
  9188. x: 230,
  9189. y: 213.85
  9190. }, {
  9191. x: 232.07,
  9192. y: 209.31
  9193. }, {
  9194. x: 234.15,
  9195. y: 204.76
  9196. }, {
  9197. x: 236.23,
  9198. y: 200.21
  9199. }, {
  9200. x: 238.31,
  9201. y: 195.66
  9202. }, {
  9203. x: 240.39,
  9204. y: 191.11
  9205. }, {
  9206. x: 242.46,
  9207. y: 186.57
  9208. }, {
  9209. x: 244.54,
  9210. y: 182.02
  9211. }, {
  9212. x: 246.62,
  9213. y: 177.47
  9214. }, {
  9215. x: 248.7,
  9216. y: 172.92
  9217. }, {
  9218. x: 250.78,
  9219. y: 168.38
  9220. }, {
  9221. x: 252.85,
  9222. y: 163.83
  9223. }, {
  9224. x: 254.93,
  9225. y: 159.28
  9226. }, {
  9227. x: 257.01,
  9228. y: 154.73
  9229. }, {
  9230. x: 259.09,
  9231. y: 150.19
  9232. }, {
  9233. x: 261.17,
  9234. y: 145.64
  9235. }, {
  9236. x: 266.17,
  9237. y: 145.61
  9238. }, {
  9239. x: 271.17,
  9240. y: 145.59
  9241. }, {
  9242. x: 276.17,
  9243. y: 145.56
  9244. }, {
  9245. x: 281.17,
  9246. y: 145.54
  9247. }, {
  9248. x: 286.17,
  9249. y: 145.51
  9250. }, {
  9251. x: 291.17,
  9252. y: 145.48
  9253. }, {
  9254. x: 296.17,
  9255. y: 145.46
  9256. }, {
  9257. x: 301.17,
  9258. y: 145.43
  9259. }, {
  9260. x: 306.17,
  9261. y: 145.41
  9262. }, {
  9263. x: 311.16,
  9264. y: 145.38
  9265. }, {
  9266. x: 316.16,
  9267. y: 145.36
  9268. }, {
  9269. x: 321.16,
  9270. y: 145.33
  9271. }, {
  9272. x: 326.16,
  9273. y: 145.31
  9274. }, {
  9275. x: 331.16,
  9276. y: 145.28
  9277. }, {
  9278. x: 336.16,
  9279. y: 145.26
  9280. }, {
  9281. x: 341.16,
  9282. y: 145.23
  9283. }, {
  9284. x: 346.16,
  9285. y: 145.21
  9286. }, {
  9287. x: 351.16,
  9288. y: 145.18
  9289. }, {
  9290. x: 356.16,
  9291. y: 145.15
  9292. }, {
  9293. x: 361.16,
  9294. y: 145.13
  9295. }, {
  9296. x: 366.16,
  9297. y: 145.1
  9298. }, {
  9299. x: 371.16,
  9300. y: 145.08
  9301. }, {
  9302. x: 376.16,
  9303. y: 145.05
  9304. }, {
  9305. x: 381.16,
  9306. y: 145.03
  9307. }, {
  9308. x: 386.16,
  9309. y: 145
  9310. }, {
  9311. x: 391.16,
  9312. y: 144.98
  9313. }, {
  9314. x: 396.16,
  9315. y: 144.95
  9316. }, {
  9317. x: 401.16,
  9318. y: 144.93
  9319. }, {
  9320. x: 406.16,
  9321. y: 144.9
  9322. }, {
  9323. x: 411.16,
  9324. y: 144.87
  9325. }, {
  9326. x: 416.16,
  9327. y: 144.85
  9328. }, {
  9329. x: 421.16,
  9330. y: 144.82
  9331. }, {
  9332. x: 426.16,
  9333. y: 144.8
  9334. }, {
  9335. x: 431.16,
  9336. y: 144.77
  9337. }, {
  9338. x: 436.16,
  9339. y: 144.75
  9340. }, {
  9341. x: 441.16,
  9342. y: 144.72
  9343. }, {
  9344. x: 446.16,
  9345. y: 144.7
  9346. }, {
  9347. x: 451.16,
  9348. y: 144.67
  9349. }, {
  9350. x: 456.16,
  9351. y: 144.65
  9352. }, {
  9353. x: 461.16,
  9354. y: 144.62
  9355. }, {
  9356. x: 466.16,
  9357. y: 144.59
  9358. }, {
  9359. x: 471.16,
  9360. y: 144.57
  9361. }, {
  9362. x: 476.16,
  9363. y: 144.54
  9364. }, {
  9365. x: 481.16,
  9366. y: 144.52
  9367. }, {
  9368. x: 486.16,
  9369. y: 144.49
  9370. }, {
  9371. x: 491.16,
  9372. y: 144.47
  9373. }, {
  9374. x: 496.16,
  9375. y: 144.44
  9376. }, {
  9377. x: 501.16,
  9378. y: 144.42
  9379. }, {
  9380. x: 506.16,
  9381. y: 144.39
  9382. }, {
  9383. x: 511.16,
  9384. y: 144.37
  9385. }, {
  9386. x: 516.16,
  9387. y: 144.34
  9388. }, {
  9389. x: 521.16,
  9390. y: 144.31
  9391. }, {
  9392. x: 526.16,
  9393. y: 144.29
  9394. }, {
  9395. x: 531.16,
  9396. y: 144.26
  9397. }, {
  9398. x: 536.16,
  9399. y: 144.24
  9400. }, {
  9401. x: 541.16,
  9402. y: 144.21
  9403. }, {
  9404. x: 546.16,
  9405. y: 144.19
  9406. }, {
  9407. x: 551.16,
  9408. y: 144.16
  9409. }, {
  9410. x: 556.16,
  9411. y: 144.14
  9412. }, {
  9413. x: 561.16,
  9414. y: 144.11
  9415. }, {
  9416. x: 566.16,
  9417. y: 144.09
  9418. }, {
  9419. x: 571.16,
  9420. y: 144.06
  9421. }, {
  9422. x: 576.16,
  9423. y: 144.03
  9424. }, {
  9425. x: 581.16,
  9426. y: 144.01
  9427. }, {
  9428. x: 579.26,
  9429. y: 148.63
  9430. }, {
  9431. x: 577.36,
  9432. y: 153.26
  9433. }, {
  9434. x: 575.46,
  9435. y: 157.88
  9436. }, {
  9437. x: 573.55,
  9438. y: 162.51
  9439. }, {
  9440. x: 571.65,
  9441. y: 167.13
  9442. }, {
  9443. x: 569.75,
  9444. y: 171.75
  9445. }, {
  9446. x: 567.85,
  9447. y: 176.38
  9448. }, {
  9449. x: 565.95,
  9450. y: 181
  9451. }, {
  9452. x: 564.04,
  9453. y: 185.63
  9454. }, {
  9455. x: 562.14,
  9456. y: 190.25
  9457. }, {
  9458. x: 560.24,
  9459. y: 194.87
  9460. }, {
  9461. x: 558.34,
  9462. y: 199.5
  9463. }, {
  9464. x: 556.44,
  9465. y: 204.12
  9466. }, {
  9467. x: 554.53,
  9468. y: 208.75
  9469. }, {
  9470. x: 552.63,
  9471. y: 213.37
  9472. }, {
  9473. x: 550.73,
  9474. y: 218
  9475. }, {
  9476. x: 548.83,
  9477. y: 222.62
  9478. }, {
  9479. x: 546.93,
  9480. y: 227.24
  9481. }, {
  9482. x: 545.02,
  9483. y: 231.87
  9484. }, {
  9485. x: 543.12,
  9486. y: 236.49
  9487. }, {
  9488. x: 541.22,
  9489. y: 241.12
  9490. }, {
  9491. x: 539.32,
  9492. y: 245.74
  9493. }, {
  9494. x: 537.42,
  9495. y: 250.36
  9496. }, {
  9497. x: 535.52,
  9498. y: 254.99
  9499. }, {
  9500. x: 533.61,
  9501. y: 259.61
  9502. }, {
  9503. x: 531.71,
  9504. y: 264.24
  9505. }, {
  9506. x: 529.81,
  9507. y: 268.86
  9508. }, {
  9509. x: 527.91,
  9510. y: 273.49
  9511. }, {
  9512. x: 526.01,
  9513. y: 278.11
  9514. }, {
  9515. x: 524.1,
  9516. y: 282.73
  9517. }, {
  9518. x: 522.2,
  9519. y: 287.36
  9520. }, {
  9521. x: 520.3,
  9522. y: 291.98
  9523. }, {
  9524. x: 518.4,
  9525. y: 296.61
  9526. }, {
  9527. x: 516.5,
  9528. y: 301.23
  9529. }, {
  9530. x: 514.59,
  9531. y: 305.85
  9532. }, {
  9533. x: 512.69,
  9534. y: 310.48
  9535. }, {
  9536. x: 510.79,
  9537. y: 315.1
  9538. }, {
  9539. x: 508.89,
  9540. y: 319.73
  9541. }, {
  9542. x: 506.99,
  9543. y: 324.35
  9544. }, {
  9545. x: 505.08,
  9546. y: 328.97
  9547. }, {
  9548. x: 503.18,
  9549. y: 333.6
  9550. }, {
  9551. x: 501.28,
  9552. y: 338.22
  9553. }, {
  9554. x: 499.38,
  9555. y: 342.85
  9556. }, {
  9557. x: 497.48,
  9558. y: 347.47
  9559. }, {
  9560. x: 495.57,
  9561. y: 352.1
  9562. }, {
  9563. x: 493.67,
  9564. y: 356.72
  9565. }, {
  9566. x: 491.77,
  9567. y: 361.34
  9568. }, {
  9569. x: 489.87,
  9570. y: 365.97
  9571. }, {
  9572. x: 487.97,
  9573. y: 370.59
  9574. }, {
  9575. x: 486.06,
  9576. y: 375.22
  9577. }, {
  9578. x: 484.16,
  9579. y: 379.84
  9580. }, {
  9581. x: 482.26,
  9582. y: 384.46
  9583. }, {
  9584. x: 480.36,
  9585. y: 389.09
  9586. }, {
  9587. x: 478.46,
  9588. y: 393.71
  9589. }, {
  9590. x: 476.56,
  9591. y: 398.34
  9592. }, {
  9593. x: 474.65,
  9594. y: 402.96
  9595. }, {
  9596. x: 472.75,
  9597. y: 407.59
  9598. }, {
  9599. x: 470.85,
  9600. y: 412.21
  9601. }, {
  9602. x: 468.95,
  9603. y: 416.83
  9604. }, {
  9605. x: 467.05,
  9606. y: 421.46
  9607. }, {
  9608. x: 465.14,
  9609. y: 426.08
  9610. }, {
  9611. x: 470.14,
  9612. y: 426.1
  9613. }, {
  9614. x: 475.14,
  9615. y: 426.12
  9616. }, {
  9617. x: 480.14,
  9618. y: 426.15
  9619. }, {
  9620. x: 485.14,
  9621. y: 426.17
  9622. }, {
  9623. x: 490.14,
  9624. y: 426.19
  9625. }, {
  9626. x: 495.14,
  9627. y: 426.21
  9628. }, {
  9629. x: 500.14,
  9630. y: 426.23
  9631. }, {
  9632. x: 505.14,
  9633. y: 426.25
  9634. }, {
  9635. x: 510.14,
  9636. y: 426.27
  9637. }, {
  9638. x: 515.14,
  9639. y: 426.29
  9640. }, {
  9641. x: 520.14,
  9642. y: 426.31
  9643. }, {
  9644. x: 525.14,
  9645. y: 426.33
  9646. }, {
  9647. x: 530.14,
  9648. y: 426.36
  9649. }, {
  9650. x: 535.14,
  9651. y: 426.38
  9652. }, {
  9653. x: 540.14,
  9654. y: 426.4
  9655. }, {
  9656. x: 545.14,
  9657. y: 426.42
  9658. }, {
  9659. x: 550.14,
  9660. y: 426.44
  9661. }, {
  9662. x: 555.14,
  9663. y: 426.46
  9664. }, {
  9665. x: 560.14,
  9666. y: 426.48
  9667. }, {
  9668. x: 565.14,
  9669. y: 426.5
  9670. }, {
  9671. x: 570.14,
  9672. y: 426.52
  9673. }, {
  9674. x: 575.14,
  9675. y: 426.55
  9676. }, {
  9677. x: 580.14,
  9678. y: 426.57
  9679. }, {
  9680. x: 585.14,
  9681. y: 426.59
  9682. }, {
  9683. x: 590.14,
  9684. y: 426.61
  9685. }, {
  9686. x: 595.14,
  9687. y: 426.63
  9688. }, {
  9689. x: 600.14,
  9690. y: 426.65
  9691. }, {
  9692. x: 605.14,
  9693. y: 426.67
  9694. }, {
  9695. x: 610.14,
  9696. y: 426.69
  9697. }, {
  9698. x: 615.14,
  9699. y: 426.71
  9700. }, {
  9701. x: 620.14,
  9702. y: 426.74
  9703. }, {
  9704. x: 625.14,
  9705. y: 426.76
  9706. }, {
  9707. x: 630.14,
  9708. y: 426.78
  9709. }, {
  9710. x: 635.14,
  9711. y: 426.8
  9712. }, {
  9713. x: 640.14,
  9714. y: 426.82
  9715. }, {
  9716. x: 645.14,
  9717. y: 426.84
  9718. }, {
  9719. x: 650.14,
  9720. y: 426.86
  9721. }, {
  9722. x: 655.14,
  9723. y: 426.88
  9724. }, {
  9725. x: 660.14,
  9726. y: 426.9
  9727. }, {
  9728. x: 665.14,
  9729. y: 426.92
  9730. }, {
  9731. x: 670.14,
  9732. y: 426.95
  9733. }, {
  9734. x: 675.14,
  9735. y: 426.97
  9736. }, {
  9737. x: 680.14,
  9738. y: 426.99
  9739. }, {
  9740. x: 685.14,
  9741. y: 427.01
  9742. }, {
  9743. x: 686.78,
  9744. y: 422.29
  9745. }, {
  9746. x: 688.42,
  9747. y: 417.56
  9748. }, {
  9749. x: 690.06,
  9750. y: 412.84
  9751. }, {
  9752. x: 691.71,
  9753. y: 408.12
  9754. }, {
  9755. x: 693.35,
  9756. y: 403.39
  9757. }, {
  9758. x: 694.99,
  9759. y: 398.67
  9760. }, {
  9761. x: 696.63,
  9762. y: 393.95
  9763. }, {
  9764. x: 698.27,
  9765. y: 389.22
  9766. }, {
  9767. x: 699.91,
  9768. y: 384.5
  9769. }, {
  9770. x: 701.55,
  9771. y: 379.78
  9772. }, {
  9773. x: 703.19,
  9774. y: 375.06
  9775. }, {
  9776. x: 704.83,
  9777. y: 370.33
  9778. }, {
  9779. x: 706.48,
  9780. y: 365.61
  9781. }, {
  9782. x: 708.12,
  9783. y: 360.89
  9784. }, {
  9785. x: 709.76,
  9786. y: 356.16
  9787. }, {
  9788. x: 711.4,
  9789. y: 351.44
  9790. }, {
  9791. x: 713.04,
  9792. y: 346.72
  9793. }, {
  9794. x: 714.68,
  9795. y: 341.99
  9796. }, {
  9797. x: 716.32,
  9798. y: 337.27
  9799. }, {
  9800. x: 717.96,
  9801. y: 332.55
  9802. }, {
  9803. x: 719.6,
  9804. y: 327.83
  9805. }, {
  9806. x: 721.24,
  9807. y: 323.1
  9808. }, {
  9809. x: 722.89,
  9810. y: 318.38
  9811. }, {
  9812. x: 724.53,
  9813. y: 313.66
  9814. }, {
  9815. x: 726.17,
  9816. y: 308.93
  9817. }, {
  9818. x: 727.81,
  9819. y: 304.21
  9820. }, {
  9821. x: 729.45,
  9822. y: 299.49
  9823. }, {
  9824. x: 731.09,
  9825. y: 294.76
  9826. }, {
  9827. x: 732.73,
  9828. y: 290.04
  9829. }, {
  9830. x: 734.37,
  9831. y: 285.32
  9832. }, {
  9833. x: 736.01,
  9834. y: 280.6
  9835. }, {
  9836. x: 737.65,
  9837. y: 275.87
  9838. }, {
  9839. x: 739.3,
  9840. y: 271.15
  9841. }, {
  9842. x: 744.3,
  9843. y: 271.17
  9844. }, {
  9845. x: 749.3,
  9846. y: 271.2
  9847. }, {
  9848. x: 754.3,
  9849. y: 271.23
  9850. }, {
  9851. x: 759.3,
  9852. y: 271.25
  9853. }, {
  9854. x: 764.3,
  9855. y: 271.28
  9856. }, {
  9857. x: 769.3,
  9858. y: 271.3
  9859. }, {
  9860. x: 774.3,
  9861. y: 271.33
  9862. }, {
  9863. x: 779.3,
  9864. y: 271.36
  9865. }, {
  9866. x: 784.3,
  9867. y: 271.38
  9868. }, {
  9869. x: 789.3,
  9870. y: 271.41
  9871. }, {
  9872. x: 794.29,
  9873. y: 271.43
  9874. }, {
  9875. x: 799.29,
  9876. y: 271.46
  9877. }, {
  9878. x: 804.29,
  9879. y: 271.48
  9880. }, {
  9881. x: 809.29,
  9882. y: 271.51
  9883. }, {
  9884. x: 814.29,
  9885. y: 271.54
  9886. }, {
  9887. x: 819.29,
  9888. y: 271.56
  9889. }, {
  9890. x: 824.29,
  9891. y: 271.59
  9892. }, {
  9893. x: 829.29,
  9894. y: 271.61
  9895. }, {
  9896. x: 834.29,
  9897. y: 271.64
  9898. }, {
  9899. x: 839.29,
  9900. y: 271.67
  9901. }, {
  9902. x: 844.29,
  9903. y: 271.69
  9904. }, {
  9905. x: 849.29,
  9906. y: 271.72
  9907. }, {
  9908. x: 854.29,
  9909. y: 271.74
  9910. }, {
  9911. x: 859.29,
  9912. y: 271.77
  9913. }, {
  9914. x: 864.29,
  9915. y: 271.79
  9916. }, {
  9917. x: 869.29,
  9918. y: 271.82
  9919. }, {
  9920. x: 874.29,
  9921. y: 271.85
  9922. }, {
  9923. x: 879.29,
  9924. y: 271.87
  9925. }, {
  9926. x: 884.29,
  9927. y: 271.9
  9928. }, {
  9929. x: 889.29,
  9930. y: 271.92
  9931. }, {
  9932. x: 894.29,
  9933. y: 271.95
  9934. }, {
  9935. x: 899.29,
  9936. y: 271.98
  9937. }, {
  9938. x: 904.29,
  9939. y: 272
  9940. }
  9941. ], [
  9942. {
  9943. x: -26,
  9944. y: 241
  9945. }, {
  9946. x: -21,
  9947. y: 241
  9948. }, {
  9949. x: -16,
  9950. y: 241
  9951. }, {
  9952. x: -11,
  9953. y: 241
  9954. }, {
  9955. x: -6,
  9956. y: 241
  9957. }, {
  9958. x: -1,
  9959. y: 241
  9960. }, {
  9961. x: 4,
  9962. y: 241
  9963. }, {
  9964. x: 9,
  9965. y: 241
  9966. }, {
  9967. x: 14,
  9968. y: 241
  9969. }, {
  9970. x: 19,
  9971. y: 241
  9972. }, {
  9973. x: 24,
  9974. y: 241
  9975. }, {
  9976. x: 29,
  9977. y: 241
  9978. }, {
  9979. x: 34,
  9980. y: 241
  9981. }, {
  9982. x: 39,
  9983. y: 241
  9984. }, {
  9985. x: 44,
  9986. y: 241
  9987. }, {
  9988. x: 49,
  9989. y: 241
  9990. }, {
  9991. x: 54,
  9992. y: 241
  9993. }, {
  9994. x: 59,
  9995. y: 241
  9996. }, {
  9997. x: 64,
  9998. y: 241
  9999. }, {
  10000. x: 69,
  10001. y: 241
  10002. }, {
  10003. x: 74,
  10004. y: 241
  10005. }, {
  10006. x: 79,
  10007. y: 241
  10008. }, {
  10009. x: 84,
  10010. y: 241
  10011. }, {
  10012. x: 89,
  10013. y: 241
  10014. }, {
  10015. x: 94,
  10016. y: 241
  10017. }, {
  10018. x: 99,
  10019. y: 241
  10020. }, {
  10021. x: 104,
  10022. y: 241
  10023. }, {
  10024. x: 109,
  10025. y: 241
  10026. }, {
  10027. x: 114,
  10028. y: 241
  10029. }, {
  10030. x: 119,
  10031. y: 241
  10032. }, {
  10033. x: 124,
  10034. y: 241
  10035. }, {
  10036. x: 129,
  10037. y: 241
  10038. }, {
  10039. x: 133.94,
  10040. y: 240.24
  10041. }, {
  10042. x: 138.88,
  10043. y: 239.48
  10044. }, {
  10045. x: 143.83,
  10046. y: 238.72
  10047. }, {
  10048. x: 148.77,
  10049. y: 237.96
  10050. }, {
  10051. x: 153.71,
  10052. y: 237.2
  10053. }, {
  10054. x: 158.4,
  10055. y: 235.46
  10056. }, {
  10057. x: 163.08,
  10058. y: 233.71
  10059. }, {
  10060. x: 167.63,
  10061. y: 231.64
  10062. }, {
  10063. x: 172.18,
  10064. y: 229.56
  10065. }, {
  10066. x: 176.73,
  10067. y: 227.49
  10068. }, {
  10069. x: 181.28,
  10070. y: 225.42
  10071. }, {
  10072. x: 184.26,
  10073. y: 221.4
  10074. }, {
  10075. x: 187.25,
  10076. y: 217.39
  10077. }, {
  10078. x: 190.23,
  10079. y: 213.38
  10080. }, {
  10081. x: 193.21,
  10082. y: 209.37
  10083. }, {
  10084. x: 194.56,
  10085. y: 204.55
  10086. }, {
  10087. x: 195.9,
  10088. y: 199.73
  10089. }, {
  10090. x: 197.24,
  10091. y: 194.92
  10092. }, {
  10093. x: 198.58,
  10094. y: 190.1
  10095. }, {
  10096. x: 199.92,
  10097. y: 185.28
  10098. }, {
  10099. x: 201.9,
  10100. y: 180.69
  10101. }, {
  10102. x: 203.88,
  10103. y: 176.1
  10104. }, {
  10105. x: 205.86,
  10106. y: 171.51
  10107. }, {
  10108. x: 207.84,
  10109. y: 166.92
  10110. }, {
  10111. x: 209.82,
  10112. y: 162.33
  10113. }, {
  10114. x: 211.8,
  10115. y: 157.74
  10116. }, {
  10117. x: 213.78,
  10118. y: 153.14
  10119. }, {
  10120. x: 215.76,
  10121. y: 148.55
  10122. }, {
  10123. x: 218.92,
  10124. y: 144.68
  10125. }, {
  10126. x: 222.08,
  10127. y: 140.8
  10128. }, {
  10129. x: 225.24,
  10130. y: 136.93
  10131. }, {
  10132. x: 229.96,
  10133. y: 135.26
  10134. }, {
  10135. x: 234.67,
  10136. y: 133.59
  10137. }, {
  10138. x: 239.38,
  10139. y: 131.93
  10140. }, {
  10141. x: 244.1,
  10142. y: 130.26
  10143. }, {
  10144. x: 248.76,
  10145. y: 128.47
  10146. }, {
  10147. x: 253.43,
  10148. y: 126.67
  10149. }, {
  10150. x: 258.1,
  10151. y: 124.88
  10152. }, {
  10153. x: 262.77,
  10154. y: 123.09
  10155. }, {
  10156. x: 267.76,
  10157. y: 122.8
  10158. }, {
  10159. x: 272.75,
  10160. y: 122.51
  10161. }, {
  10162. x: 277.74,
  10163. y: 122.22
  10164. }, {
  10165. x: 282.73,
  10166. y: 121.93
  10167. }, {
  10168. x: 287.73,
  10169. y: 121.64
  10170. }, {
  10171. x: 292.72,
  10172. y: 121.35
  10173. }, {
  10174. x: 297.71,
  10175. y: 121.06
  10176. }, {
  10177. x: 302.7,
  10178. y: 120.77
  10179. }, {
  10180. x: 307.69,
  10181. y: 120.48
  10182. }, {
  10183. x: 312.68,
  10184. y: 120.19
  10185. }, {
  10186. x: 317.67,
  10187. y: 119.9
  10188. }, {
  10189. x: 322.67,
  10190. y: 119.61
  10191. }, {
  10192. x: 327.66,
  10193. y: 119.32
  10194. }, {
  10195. x: 332.65,
  10196. y: 119.03
  10197. }, {
  10198. x: 337.64,
  10199. y: 118.74
  10200. }, {
  10201. x: 342.63,
  10202. y: 118.45
  10203. }, {
  10204. x: 347.62,
  10205. y: 118.16
  10206. }, {
  10207. x: 352.62,
  10208. y: 117.87
  10209. }, {
  10210. x: 357.61,
  10211. y: 117.58
  10212. }, {
  10213. x: 362.6,
  10214. y: 117.29
  10215. }, {
  10216. x: 367.59,
  10217. y: 117
  10218. }, {
  10219. x: 372.58,
  10220. y: 116.71
  10221. }, {
  10222. x: 377.57,
  10223. y: 116.42
  10224. }, {
  10225. x: 382.57,
  10226. y: 116.13
  10227. }, {
  10228. x: 387.56,
  10229. y: 115.84
  10230. }, {
  10231. x: 392.55,
  10232. y: 115.55
  10233. }, {
  10234. x: 397.54,
  10235. y: 115.26
  10236. }, {
  10237. x: 402.53,
  10238. y: 114.97
  10239. }, {
  10240. x: 407.52,
  10241. y: 114.68
  10242. }, {
  10243. x: 412.51,
  10244. y: 114.39
  10245. }, {
  10246. x: 417.51,
  10247. y: 114.1
  10248. }, {
  10249. x: 422.5,
  10250. y: 113.81
  10251. }, {
  10252. x: 427.49,
  10253. y: 113.52
  10254. }, {
  10255. x: 432.48,
  10256. y: 113.23
  10257. }, {
  10258. x: 437.47,
  10259. y: 112.94
  10260. }, {
  10261. x: 442.46,
  10262. y: 112.65
  10263. }, {
  10264. x: 447.46,
  10265. y: 112.36
  10266. }, {
  10267. x: 452.45,
  10268. y: 112.07
  10269. }, {
  10270. x: 457.44,
  10271. y: 111.78
  10272. }, {
  10273. x: 462.43,
  10274. y: 111.49
  10275. }, {
  10276. x: 467.42,
  10277. y: 111.2
  10278. }, {
  10279. x: 472.41,
  10280. y: 110.91
  10281. }, {
  10282. x: 477.41,
  10283. y: 110.62
  10284. }, {
  10285. x: 482.4,
  10286. y: 110.33
  10287. }, {
  10288. x: 487.39,
  10289. y: 110.04
  10290. }, {
  10291. x: 492.38,
  10292. y: 109.75
  10293. }, {
  10294. x: 497.37,
  10295. y: 109.46
  10296. }, {
  10297. x: 502.36,
  10298. y: 109.17
  10299. }, {
  10300. x: 507.36,
  10301. y: 108.88
  10302. }, {
  10303. x: 512.35,
  10304. y: 108.59
  10305. }, {
  10306. x: 517.34,
  10307. y: 108.3
  10308. }, {
  10309. x: 522.33,
  10310. y: 108.01
  10311. }, {
  10312. x: 527.32,
  10313. y: 107.72
  10314. }, {
  10315. x: 532.31,
  10316. y: 107.43
  10317. }, {
  10318. x: 537.3,
  10319. y: 107.14
  10320. }, {
  10321. x: 542.3,
  10322. y: 106.85
  10323. }, {
  10324. x: 547.29,
  10325. y: 106.56
  10326. }, {
  10327. x: 552.28,
  10328. y: 106.27
  10329. }, {
  10330. x: 557.27,
  10331. y: 105.98
  10332. }, {
  10333. x: 562,
  10334. y: 107.6
  10335. }, {
  10336. x: 566.74,
  10337. y: 109.21
  10338. }, {
  10339. x: 571.47,
  10340. y: 110.82
  10341. }, {
  10342. x: 576.45,
  10343. y: 111.31
  10344. }, {
  10345. x: 581.42,
  10346. y: 111.79
  10347. }, {
  10348. x: 586.4,
  10349. y: 112.28
  10350. }, {
  10351. x: 591.38,
  10352. y: 112.77
  10353. }, {
  10354. x: 596.35,
  10355. y: 113.25
  10356. }, {
  10357. x: 601.33,
  10358. y: 113.74
  10359. }, {
  10360. x: 606.3,
  10361. y: 114.23
  10362. }, {
  10363. x: 608.96,
  10364. y: 118.46
  10365. }, {
  10366. x: 611.62,
  10367. y: 122.69
  10368. }, {
  10369. x: 614.28,
  10370. y: 126.93
  10371. }, {
  10372. x: 616.94,
  10373. y: 131.16
  10374. }, {
  10375. x: 619.6,
  10376. y: 135.4
  10377. }, {
  10378. x: 622.26,
  10379. y: 139.63
  10380. }, {
  10381. x: 624.92,
  10382. y: 143.87
  10383. }, {
  10384. x: 622.74,
  10385. y: 148.37
  10386. }, {
  10387. x: 620.56,
  10388. y: 152.87
  10389. }, {
  10390. x: 618.38,
  10391. y: 157.37
  10392. }, {
  10393. x: 616.2,
  10394. y: 161.87
  10395. }, {
  10396. x: 614.02,
  10397. y: 166.37
  10398. }, {
  10399. x: 611.84,
  10400. y: 170.87
  10401. }, {
  10402. x: 609.66,
  10403. y: 175.37
  10404. }, {
  10405. x: 607.48,
  10406. y: 179.87
  10407. }, {
  10408. x: 605.31,
  10409. y: 184.37
  10410. }, {
  10411. x: 603.18,
  10412. y: 188.89
  10413. }, {
  10414. x: 601.05,
  10415. y: 193.42
  10416. }, {
  10417. x: 598.92,
  10418. y: 197.94
  10419. }, {
  10420. x: 596.79,
  10421. y: 202.47
  10422. }, {
  10423. x: 594.67,
  10424. y: 206.99
  10425. }, {
  10426. x: 592.54,
  10427. y: 211.52
  10428. }, {
  10429. x: 590.41,
  10430. y: 216.04
  10431. }, {
  10432. x: 588.28,
  10433. y: 220.57
  10434. }, {
  10435. x: 586.16,
  10436. y: 225.09
  10437. }, {
  10438. x: 584.03,
  10439. y: 229.62
  10440. }, {
  10441. x: 581.9,
  10442. y: 234.14
  10443. }, {
  10444. x: 579.77,
  10445. y: 238.66
  10446. }, {
  10447. x: 577.64,
  10448. y: 243.19
  10449. }, {
  10450. x: 575.52,
  10451. y: 247.71
  10452. }, {
  10453. x: 573.39,
  10454. y: 252.24
  10455. }, {
  10456. x: 571.26,
  10457. y: 256.76
  10458. }, {
  10459. x: 569.13,
  10460. y: 261.29
  10461. }, {
  10462. x: 567.01,
  10463. y: 265.81
  10464. }, {
  10465. x: 564.88,
  10466. y: 270.34
  10467. }, {
  10468. x: 562.75,
  10469. y: 274.86
  10470. }, {
  10471. x: 560.62,
  10472. y: 279.39
  10473. }, {
  10474. x: 558.5,
  10475. y: 283.91
  10476. }, {
  10477. x: 556.37,
  10478. y: 288.44
  10479. }, {
  10480. x: 554.24,
  10481. y: 292.96
  10482. }, {
  10483. x: 552.11,
  10484. y: 297.49
  10485. }, {
  10486. x: 549.98,
  10487. y: 302.01
  10488. }, {
  10489. x: 547.86,
  10490. y: 306.53
  10491. }, {
  10492. x: 545.73,
  10493. y: 311.06
  10494. }, {
  10495. x: 543.6,
  10496. y: 315.58
  10497. }, {
  10498. x: 541.47,
  10499. y: 320.11
  10500. }, {
  10501. x: 539.35,
  10502. y: 324.63
  10503. }, {
  10504. x: 537.22,
  10505. y: 329.16
  10506. }, {
  10507. x: 535.09,
  10508. y: 333.68
  10509. }, {
  10510. x: 532.96,
  10511. y: 338.21
  10512. }, {
  10513. x: 529.41,
  10514. y: 341.72
  10515. }, {
  10516. x: 525.85,
  10517. y: 345.24
  10518. }, {
  10519. x: 522.3,
  10520. y: 348.75
  10521. }, {
  10522. x: 518.74,
  10523. y: 352.27
  10524. }, {
  10525. x: 518.81,
  10526. y: 357.27
  10527. }, {
  10528. x: 518.89,
  10529. y: 362.27
  10530. }, {
  10531. x: 518.96,
  10532. y: 367.27
  10533. }, {
  10534. x: 519.03,
  10535. y: 372.27
  10536. }, {
  10537. x: 521.06,
  10538. y: 376.84
  10539. }, {
  10540. x: 523.08,
  10541. y: 381.41
  10542. }, {
  10543. x: 525.11,
  10544. y: 385.98
  10545. }, {
  10546. x: 529.22,
  10547. y: 388.83
  10548. }, {
  10549. x: 533.32,
  10550. y: 391.68
  10551. }, {
  10552. x: 537.43,
  10553. y: 394.53
  10554. }, {
  10555. x: 541.54,
  10556. y: 397.38
  10557. }, {
  10558. x: 546.54,
  10559. y: 397.49
  10560. }, {
  10561. x: 551.54,
  10562. y: 397.61
  10563. }, {
  10564. x: 556.54,
  10565. y: 397.73
  10566. }, {
  10567. x: 561.54,
  10568. y: 397.85
  10569. }, {
  10570. x: 566.54,
  10571. y: 397.97
  10572. }, {
  10573. x: 571.54,
  10574. y: 398.07
  10575. }, {
  10576. x: 576.53,
  10577. y: 398.17
  10578. }, {
  10579. x: 581.53,
  10580. y: 398.27
  10581. }, {
  10582. x: 586.53,
  10583. y: 398.38
  10584. }, {
  10585. x: 591.53,
  10586. y: 398.48
  10587. }, {
  10588. x: 596.53,
  10589. y: 398.58
  10590. }, {
  10591. x: 601.53,
  10592. y: 398.68
  10593. }, {
  10594. x: 606.53,
  10595. y: 398.79
  10596. }, {
  10597. x: 611.53,
  10598. y: 398.89
  10599. }, {
  10600. x: 616.53,
  10601. y: 398.99
  10602. }, {
  10603. x: 621.45,
  10604. y: 398.13
  10605. }, {
  10606. x: 626.38,
  10607. y: 397.28
  10608. }, {
  10609. x: 631.3,
  10610. y: 396.42
  10611. }, {
  10612. x: 636.23,
  10613. y: 395.57
  10614. }, {
  10615. x: 641.16,
  10616. y: 394.71
  10617. }, {
  10618. x: 646.08,
  10619. y: 393.85
  10620. }, {
  10621. x: 651.01,
  10622. y: 393
  10623. }, {
  10624. x: 654.06,
  10625. y: 389.03
  10626. }, {
  10627. x: 657.1,
  10628. y: 385.07
  10629. }, {
  10630. x: 660.15,
  10631. y: 381.11
  10632. }, {
  10633. x: 663.2,
  10634. y: 377.14
  10635. }, {
  10636. x: 666.25,
  10637. y: 373.18
  10638. }, {
  10639. x: 669.3,
  10640. y: 369.22
  10641. }, {
  10642. x: 672.34,
  10643. y: 365.25
  10644. }, {
  10645. x: 673.38,
  10646. y: 360.36
  10647. }, {
  10648. x: 674.41,
  10649. y: 355.47
  10650. }, {
  10651. x: 675.44,
  10652. y: 350.58
  10653. }, {
  10654. x: 676.48,
  10655. y: 345.68
  10656. }, {
  10657. x: 677.51,
  10658. y: 340.79
  10659. }, {
  10660. x: 678.54,
  10661. y: 335.9
  10662. }, {
  10663. x: 679.58,
  10664. y: 331.01
  10665. }, {
  10666. x: 680.13,
  10667. y: 326.04
  10668. }, {
  10669. x: 680.68,
  10670. y: 321.07
  10671. }, {
  10672. x: 681.22,
  10673. y: 316.1
  10674. }, {
  10675. x: 681.77,
  10676. y: 311.13
  10677. }, {
  10678. x: 682.32,
  10679. y: 306.16
  10680. }, {
  10681. x: 682.87,
  10682. y: 301.19
  10683. }, {
  10684. x: 683.42,
  10685. y: 296.22
  10686. }, {
  10687. x: 683.97,
  10688. y: 291.25
  10689. }, {
  10690. x: 685.22,
  10691. y: 286.41
  10692. }, {
  10693. x: 686.46,
  10694. y: 281.56
  10695. }, {
  10696. x: 687.7,
  10697. y: 276.72
  10698. }, {
  10699. x: 688.95,
  10700. y: 271.88
  10701. }, {
  10702. x: 690.19,
  10703. y: 267.04
  10704. }, {
  10705. x: 691.44,
  10706. y: 262.19
  10707. }, {
  10708. x: 694.42,
  10709. y: 258.18
  10710. }, {
  10711. x: 697.41,
  10712. y: 254.18
  10713. }, {
  10714. x: 700.4,
  10715. y: 250.17
  10716. }, {
  10717. x: 703.39,
  10718. y: 246.16
  10719. }, {
  10720. x: 706.38,
  10721. y: 242.15
  10722. }, {
  10723. x: 711.2,
  10724. y: 240.84
  10725. }, {
  10726. x: 716.03,
  10727. y: 239.52
  10728. }, {
  10729. x: 720.85,
  10730. y: 238.21
  10731. }, {
  10732. x: 725.68,
  10733. y: 236.9
  10734. }, {
  10735. x: 730.5,
  10736. y: 235.58
  10737. }, {
  10738. x: 735.32,
  10739. y: 234.27
  10740. }, {
  10741. x: 740.15,
  10742. y: 232.95
  10743. }, {
  10744. x: 744.97,
  10745. y: 231.64
  10746. }, {
  10747. x: 749.8,
  10748. y: 230.33
  10749. }, {
  10750. x: 754.79,
  10751. y: 230.01
  10752. }, {
  10753. x: 759.78,
  10754. y: 229.69
  10755. }, {
  10756. x: 764.77,
  10757. y: 229.37
  10758. }, {
  10759. x: 769.76,
  10760. y: 229.06
  10761. }, {
  10762. x: 774.75,
  10763. y: 228.74
  10764. }, {
  10765. x: 779.74,
  10766. y: 228.42
  10767. }, {
  10768. x: 784.73,
  10769. y: 228.1
  10770. }, {
  10771. x: 789.72,
  10772. y: 227.78
  10773. }, {
  10774. x: 794.71,
  10775. y: 227.46
  10776. }, {
  10777. x: 799.7,
  10778. y: 227.15
  10779. }, {
  10780. x: 804.7,
  10781. y: 227.23
  10782. }, {
  10783. x: 809.7,
  10784. y: 227.31
  10785. }, {
  10786. x: 814.69,
  10787. y: 227.39
  10788. }, {
  10789. x: 819.69,
  10790. y: 227.47
  10791. }, {
  10792. x: 824.69,
  10793. y: 227.55
  10794. }, {
  10795. x: 829.69,
  10796. y: 227.64
  10797. }, {
  10798. x: 834.69,
  10799. y: 227.72
  10800. }, {
  10801. x: 839.69,
  10802. y: 227.8
  10803. }, {
  10804. x: 844.69,
  10805. y: 227.88
  10806. }, {
  10807. x: 849.69,
  10808. y: 227.96
  10809. }, {
  10810. x: 854.67,
  10811. y: 228.42
  10812. }, {
  10813. x: 859.65,
  10814. y: 228.87
  10815. }, {
  10816. x: 864.63,
  10817. y: 229.33
  10818. }, {
  10819. x: 869.61,
  10820. y: 229.78
  10821. }, {
  10822. x: 874.61,
  10823. y: 229.8
  10824. }, {
  10825. x: 879.61,
  10826. y: 229.82
  10827. }, {
  10828. x: 884.61,
  10829. y: 229.84
  10830. }, {
  10831. x: 889.61,
  10832. y: 229.86
  10833. }, {
  10834. x: 894.61,
  10835. y: 229.89
  10836. }, {
  10837. x: 899.61,
  10838. y: 229.91
  10839. }, {
  10840. x: 904.61,
  10841. y: 229.93
  10842. }, {
  10843. x: 909.61,
  10844. y: 229.95
  10845. }, {
  10846. x: 914.61,
  10847. y: 229.97
  10848. }, {
  10849. x: 919.61,
  10850. y: 229.99
  10851. }
  10852. ], [
  10853. {
  10854. x: -18,
  10855. y: 232
  10856. }, {
  10857. x: -13,
  10858. y: 232
  10859. }, {
  10860. x: -8,
  10861. y: 232
  10862. }, {
  10863. x: -3,
  10864. y: 232
  10865. }, {
  10866. x: 2,
  10867. y: 232
  10868. }, {
  10869. x: 7,
  10870. y: 232
  10871. }, {
  10872. x: 12,
  10873. y: 232
  10874. }, {
  10875. x: 17,
  10876. y: 232
  10877. }, {
  10878. x: 22,
  10879. y: 232
  10880. }, {
  10881. x: 27,
  10882. y: 232
  10883. }, {
  10884. x: 32,
  10885. y: 232
  10886. }, {
  10887. x: 37,
  10888. y: 232
  10889. }, {
  10890. x: 42,
  10891. y: 232
  10892. }, {
  10893. x: 47,
  10894. y: 232
  10895. }, {
  10896. x: 52,
  10897. y: 232
  10898. }, {
  10899. x: 57,
  10900. y: 232
  10901. }, {
  10902. x: 62,
  10903. y: 232
  10904. }, {
  10905. x: 67,
  10906. y: 232
  10907. }, {
  10908. x: 72,
  10909. y: 232
  10910. }, {
  10911. x: 77,
  10912. y: 232
  10913. }, {
  10914. x: 82,
  10915. y: 232
  10916. }, {
  10917. x: 87,
  10918. y: 232
  10919. }, {
  10920. x: 92,
  10921. y: 232
  10922. }, {
  10923. x: 97,
  10924. y: 232
  10925. }, {
  10926. x: 102,
  10927. y: 232
  10928. }, {
  10929. x: 107,
  10930. y: 232
  10931. }, {
  10932. x: 112,
  10933. y: 232
  10934. }, {
  10935. x: 117,
  10936. y: 232
  10937. }, {
  10938. x: 122,
  10939. y: 232
  10940. }, {
  10941. x: 127,
  10942. y: 232
  10943. }, {
  10944. x: 132,
  10945. y: 232
  10946. }, {
  10947. x: 137,
  10948. y: 232
  10949. }, {
  10950. x: 142,
  10951. y: 232
  10952. }, {
  10953. x: 147,
  10954. y: 232
  10955. }, {
  10956. x: 152,
  10957. y: 232
  10958. }, {
  10959. x: 157,
  10960. y: 232
  10961. }, {
  10962. x: 162,
  10963. y: 232
  10964. }, {
  10965. x: 167,
  10966. y: 232
  10967. }, {
  10968. x: 172,
  10969. y: 232
  10970. }, {
  10971. x: 177,
  10972. y: 232
  10973. }, {
  10974. x: 182,
  10975. y: 232
  10976. }, {
  10977. x: 186.94,
  10978. y: 232.77
  10979. }, {
  10980. x: 191.88,
  10981. y: 233.54
  10982. }, {
  10983. x: 196.82,
  10984. y: 234.32
  10985. }, {
  10986. x: 201.76,
  10987. y: 235.09
  10988. }, {
  10989. x: 206.7,
  10990. y: 235.86
  10991. }, {
  10992. x: 211.64,
  10993. y: 236.63
  10994. }, {
  10995. x: 216.39,
  10996. y: 238.2
  10997. }, {
  10998. x: 221.14,
  10999. y: 239.76
  11000. }, {
  11001. x: 225.89,
  11002. y: 241.33
  11003. }, {
  11004. x: 230.64,
  11005. y: 242.89
  11006. }, {
  11007. x: 235.38,
  11008. y: 244.46
  11009. }, {
  11010. x: 239.62,
  11011. y: 247.11
  11012. }, {
  11013. x: 243.86,
  11014. y: 249.76
  11015. }, {
  11016. x: 248.1,
  11017. y: 252.41
  11018. }, {
  11019. x: 252.34,
  11020. y: 255.06
  11021. }, {
  11022. x: 256.58,
  11023. y: 257.71
  11024. }, {
  11025. x: 260.82,
  11026. y: 260.36
  11027. }, {
  11028. x: 265.06,
  11029. y: 263.01
  11030. }, {
  11031. x: 269.3,
  11032. y: 265.66
  11033. }, {
  11034. x: 273.54,
  11035. y: 268.31
  11036. }, {
  11037. x: 277.78,
  11038. y: 270.96
  11039. }, {
  11040. x: 282.02,
  11041. y: 273.61
  11042. }, {
  11043. x: 286.26,
  11044. y: 276.26
  11045. }, {
  11046. x: 290.5,
  11047. y: 278.91
  11048. }, {
  11049. x: 294.74,
  11050. y: 281.56
  11051. }, {
  11052. x: 298.98,
  11053. y: 284.21
  11054. }, {
  11055. x: 303.22,
  11056. y: 286.86
  11057. }, {
  11058. x: 307.46,
  11059. y: 289.51
  11060. }, {
  11061. x: 311.7,
  11062. y: 292.16
  11063. }, {
  11064. x: 315.94,
  11065. y: 294.81
  11066. }, {
  11067. x: 320.18,
  11068. y: 297.47
  11069. }, {
  11070. x: 324.42,
  11071. y: 300.12
  11072. }, {
  11073. x: 328.66,
  11074. y: 302.77
  11075. }, {
  11076. x: 332.9,
  11077. y: 305.42
  11078. }, {
  11079. x: 337.14,
  11080. y: 308.07
  11081. }, {
  11082. x: 341.38,
  11083. y: 310.72
  11084. }, {
  11085. x: 345.62,
  11086. y: 313.37
  11087. }, {
  11088. x: 349.86,
  11089. y: 316.02
  11090. }, {
  11091. x: 354.1,
  11092. y: 318.67
  11093. }, {
  11094. x: 358.34,
  11095. y: 321.32
  11096. }, {
  11097. x: 362.58,
  11098. y: 323.97
  11099. }, {
  11100. x: 366.81,
  11101. y: 326.62
  11102. }, {
  11103. x: 371.05,
  11104. y: 329.27
  11105. }, {
  11106. x: 375.29,
  11107. y: 331.92
  11108. }, {
  11109. x: 379.53,
  11110. y: 334.57
  11111. }, {
  11112. x: 383.77,
  11113. y: 337.22
  11114. }, {
  11115. x: 388.01,
  11116. y: 339.87
  11117. }, {
  11118. x: 392.25,
  11119. y: 342.52
  11120. }, {
  11121. x: 396.49,
  11122. y: 345.17
  11123. }, {
  11124. x: 400.73,
  11125. y: 347.82
  11126. }, {
  11127. x: 404.97,
  11128. y: 350.47
  11129. }, {
  11130. x: 409.21,
  11131. y: 353.13
  11132. }, {
  11133. x: 413.45,
  11134. y: 355.78
  11135. }, {
  11136. x: 417.69,
  11137. y: 358.43
  11138. }, {
  11139. x: 421.93,
  11140. y: 361.08
  11141. }, {
  11142. x: 426.17,
  11143. y: 363.73
  11144. }, {
  11145. x: 430.41,
  11146. y: 366.38
  11147. }, {
  11148. x: 434.65,
  11149. y: 369.03
  11150. }, {
  11151. x: 438.89,
  11152. y: 371.68
  11153. }, {
  11154. x: 443.13,
  11155. y: 374.33
  11156. }, {
  11157. x: 447.37,
  11158. y: 376.98
  11159. }, {
  11160. x: 451.61,
  11161. y: 379.63
  11162. }, {
  11163. x: 455.85,
  11164. y: 382.28
  11165. }, {
  11166. x: 460.2,
  11167. y: 384.75
  11168. }, {
  11169. x: 464.55,
  11170. y: 387.21
  11171. }, {
  11172. x: 468.9,
  11173. y: 389.68
  11174. }, {
  11175. x: 473.25,
  11176. y: 392.14
  11177. }, {
  11178. x: 478.22,
  11179. y: 392.68
  11180. }, {
  11181. x: 483.19,
  11182. y: 393.22
  11183. }, {
  11184. x: 488.16,
  11185. y: 393.76
  11186. }, {
  11187. x: 493.13,
  11188. y: 394.3
  11189. }, {
  11190. x: 498.1,
  11191. y: 394.84
  11192. }, {
  11193. x: 503.07,
  11194. y: 395.38
  11195. }, {
  11196. x: 508.04,
  11197. y: 395.92
  11198. }, {
  11199. x: 513.02,
  11200. y: 396.46
  11201. }, {
  11202. x: 517.99,
  11203. y: 397
  11204. }, {
  11205. x: 522.99,
  11206. y: 397.04
  11207. }, {
  11208. x: 527.99,
  11209. y: 397.09
  11210. }, {
  11211. x: 532.99,
  11212. y: 397.13
  11213. }, {
  11214. x: 537.99,
  11215. y: 397.17
  11216. }, {
  11217. x: 542.98,
  11218. y: 397.22
  11219. }, {
  11220. x: 547.98,
  11221. y: 397.26
  11222. }, {
  11223. x: 552.98,
  11224. y: 397.3
  11225. }, {
  11226. x: 557.98,
  11227. y: 397.35
  11228. }, {
  11229. x: 562.98,
  11230. y: 397.39
  11231. }, {
  11232. x: 567.98,
  11233. y: 397.43
  11234. }, {
  11235. x: 572.98,
  11236. y: 397.48
  11237. }, {
  11238. x: 577.98,
  11239. y: 397.52
  11240. }, {
  11241. x: 582.98,
  11242. y: 397.56
  11243. }, {
  11244. x: 587.98,
  11245. y: 397.61
  11246. }, {
  11247. x: 592.98,
  11248. y: 397.65
  11249. }, {
  11250. x: 597.98,
  11251. y: 397.7
  11252. }, {
  11253. x: 602.98,
  11254. y: 397.74
  11255. }, {
  11256. x: 607.98,
  11257. y: 397.78
  11258. }, {
  11259. x: 612.98,
  11260. y: 397.83
  11261. }, {
  11262. x: 617.98,
  11263. y: 397.87
  11264. }, {
  11265. x: 622.98,
  11266. y: 397.91
  11267. }, {
  11268. x: 627.98,
  11269. y: 397.96
  11270. }, {
  11271. x: 632.98,
  11272. y: 398
  11273. }, {
  11274. x: 634.95,
  11275. y: 393.4
  11276. }, {
  11277. x: 636.92,
  11278. y: 388.81
  11279. }, {
  11280. x: 638.89,
  11281. y: 384.21
  11282. }, {
  11283. x: 640.86,
  11284. y: 379.62
  11285. }, {
  11286. x: 642.84,
  11287. y: 375.02
  11288. }, {
  11289. x: 644.81,
  11290. y: 370.43
  11291. }, {
  11292. x: 646.78,
  11293. y: 365.83
  11294. }, {
  11295. x: 648.75,
  11296. y: 361.24
  11297. }, {
  11298. x: 650.72,
  11299. y: 356.64
  11300. }, {
  11301. x: 652.69,
  11302. y: 352.05
  11303. }, {
  11304. x: 654.66,
  11305. y: 347.45
  11306. }, {
  11307. x: 656.63,
  11308. y: 342.86
  11309. }, {
  11310. x: 658.6,
  11311. y: 338.26
  11312. }, {
  11313. x: 660.57,
  11314. y: 333.67
  11315. }, {
  11316. x: 663.38,
  11317. y: 329.53
  11318. }, {
  11319. x: 666.19,
  11320. y: 325.39
  11321. }, {
  11322. x: 669,
  11323. y: 321.26
  11324. }, {
  11325. x: 671.8,
  11326. y: 317.12
  11327. }, {
  11328. x: 674.61,
  11329. y: 312.98
  11330. }, {
  11331. x: 677.42,
  11332. y: 308.84
  11333. }, {
  11334. x: 680.23,
  11335. y: 304.71
  11336. }, {
  11337. x: 683.04,
  11338. y: 300.57
  11339. }, {
  11340. x: 685.84,
  11341. y: 296.43
  11342. }, {
  11343. x: 688.65,
  11344. y: 292.3
  11345. }, {
  11346. x: 691.46,
  11347. y: 288.16
  11348. }, {
  11349. x: 694.27,
  11350. y: 284.02
  11351. }, {
  11352. x: 697.08,
  11353. y: 279.89
  11354. }, {
  11355. x: 701.51,
  11356. y: 277.57
  11357. }, {
  11358. x: 705.94,
  11359. y: 275.26
  11360. }, {
  11361. x: 710.37,
  11362. y: 272.94
  11363. }, {
  11364. x: 714.81,
  11365. y: 270.63
  11366. }, {
  11367. x: 719.24,
  11368. y: 268.32
  11369. }, {
  11370. x: 723.67,
  11371. y: 266
  11372. }, {
  11373. x: 728.1,
  11374. y: 263.69
  11375. }, {
  11376. x: 732.54,
  11377. y: 261.37
  11378. }, {
  11379. x: 736.97,
  11380. y: 259.06
  11381. }, {
  11382. x: 741.94,
  11383. y: 258.56
  11384. }, {
  11385. x: 746.92,
  11386. y: 258.05
  11387. }, {
  11388. x: 751.89,
  11389. y: 257.55
  11390. }, {
  11391. x: 756.87,
  11392. y: 257.05
  11393. }, {
  11394. x: 761.84,
  11395. y: 256.54
  11396. }, {
  11397. x: 766.82,
  11398. y: 256.04
  11399. }, {
  11400. x: 771.79,
  11401. y: 255.54
  11402. }, {
  11403. x: 776.77,
  11404. y: 255.04
  11405. }, {
  11406. x: 781.74,
  11407. y: 254.53
  11408. }, {
  11409. x: 786.71,
  11410. y: 254.03
  11411. }, {
  11412. x: 791.7,
  11413. y: 253.69
  11414. }, {
  11415. x: 796.69,
  11416. y: 253.36
  11417. }, {
  11418. x: 801.68,
  11419. y: 253.03
  11420. }, {
  11421. x: 806.67,
  11422. y: 252.69
  11423. }, {
  11424. x: 811.66,
  11425. y: 252.36
  11426. }, {
  11427. x: 816.65,
  11428. y: 252.02
  11429. }, {
  11430. x: 821.64,
  11431. y: 252.19
  11432. }, {
  11433. x: 826.64,
  11434. y: 252.36
  11435. }, {
  11436. x: 831.64,
  11437. y: 252.53
  11438. }, {
  11439. x: 836.64,
  11440. y: 252.7
  11441. }, {
  11442. x: 841.63,
  11443. y: 252.87
  11444. }, {
  11445. x: 846.63,
  11446. y: 253.03
  11447. }, {
  11448. x: 851.63,
  11449. y: 253.2
  11450. }, {
  11451. x: 856.62,
  11452. y: 253.37
  11453. }, {
  11454. x: 861.62,
  11455. y: 253.54
  11456. }, {
  11457. x: 866.62,
  11458. y: 253.71
  11459. }, {
  11460. x: 871.62,
  11461. y: 253.88
  11462. }, {
  11463. x: 876.61,
  11464. y: 254.04
  11465. }, {
  11466. x: 881.61,
  11467. y: 254.21
  11468. }, {
  11469. x: 886.61,
  11470. y: 254.38
  11471. }, {
  11472. x: 891.61,
  11473. y: 254.55
  11474. }, {
  11475. x: 896.6,
  11476. y: 254.72
  11477. }, {
  11478. x: 901.6,
  11479. y: 254.89
  11480. }, {
  11481. x: 906.6,
  11482. y: 255.05
  11483. }
  11484. ]
  11485. ], [
  11486. [
  11487. {
  11488. x: -30,
  11489. y: 423
  11490. }, {
  11491. x: -26.06,
  11492. y: 419.93
  11493. }, {
  11494. x: -22.11,
  11495. y: 416.85
  11496. }, {
  11497. x: -18.17,
  11498. y: 413.78
  11499. }, {
  11500. x: -14.23,
  11501. y: 410.7
  11502. }, {
  11503. x: -10.29,
  11504. y: 407.63
  11505. }, {
  11506. x: -6.34,
  11507. y: 404.55
  11508. }, {
  11509. x: -2.4,
  11510. y: 401.48
  11511. }, {
  11512. x: 1.54,
  11513. y: 398.4
  11514. }, {
  11515. x: 5.49,
  11516. y: 395.33
  11517. }, {
  11518. x: 9.43,
  11519. y: 392.25
  11520. }, {
  11521. x: 13.37,
  11522. y: 389.18
  11523. }, {
  11524. x: 17.31,
  11525. y: 386.1
  11526. }, {
  11527. x: 21.26,
  11528. y: 383.03
  11529. }, {
  11530. x: 25.2,
  11531. y: 379.95
  11532. }, {
  11533. x: 29.14,
  11534. y: 376.88
  11535. }, {
  11536. x: 33.09,
  11537. y: 373.8
  11538. }, {
  11539. x: 37.03,
  11540. y: 370.73
  11541. }, {
  11542. x: 40.97,
  11543. y: 367.66
  11544. }, {
  11545. x: 44.91,
  11546. y: 364.58
  11547. }, {
  11548. x: 48.86,
  11549. y: 361.51
  11550. }, {
  11551. x: 52.8,
  11552. y: 358.43
  11553. }, {
  11554. x: 56.74,
  11555. y: 355.36
  11556. }, {
  11557. x: 60.69,
  11558. y: 352.28
  11559. }, {
  11560. x: 64.63,
  11561. y: 349.21
  11562. }, {
  11563. x: 68.57,
  11564. y: 346.13
  11565. }, {
  11566. x: 72.51,
  11567. y: 343.06
  11568. }, {
  11569. x: 76.46,
  11570. y: 339.98
  11571. }, {
  11572. x: 80.4,
  11573. y: 336.91
  11574. }, {
  11575. x: 84.34,
  11576. y: 333.83
  11577. }, {
  11578. x: 88.29,
  11579. y: 330.76
  11580. }, {
  11581. x: 92.23,
  11582. y: 327.68
  11583. }, {
  11584. x: 96.17,
  11585. y: 324.61
  11586. }, {
  11587. x: 100.11,
  11588. y: 321.53
  11589. }, {
  11590. x: 104.06,
  11591. y: 318.46
  11592. }, {
  11593. x: 108,
  11594. y: 315.39
  11595. }, {
  11596. x: 111.94,
  11597. y: 312.31
  11598. }, {
  11599. x: 115.89,
  11600. y: 309.24
  11601. }, {
  11602. x: 119.83,
  11603. y: 306.16
  11604. }, {
  11605. x: 123.77,
  11606. y: 303.09
  11607. }, {
  11608. x: 127.71,
  11609. y: 300.01
  11610. }, {
  11611. x: 131.66,
  11612. y: 296.94
  11613. }, {
  11614. x: 135.6,
  11615. y: 293.86
  11616. }, {
  11617. x: 139.54,
  11618. y: 290.79
  11619. }, {
  11620. x: 143.49,
  11621. y: 287.71
  11622. }, {
  11623. x: 147.43,
  11624. y: 284.64
  11625. }, {
  11626. x: 151.37,
  11627. y: 281.56
  11628. }, {
  11629. x: 155.31,
  11630. y: 278.49
  11631. }, {
  11632. x: 159.26,
  11633. y: 275.41
  11634. }, {
  11635. x: 163.2,
  11636. y: 272.34
  11637. }, {
  11638. x: 167.14,
  11639. y: 269.26
  11640. }, {
  11641. x: 171.09,
  11642. y: 266.19
  11643. }, {
  11644. x: 175.03,
  11645. y: 263.12
  11646. }, {
  11647. x: 178.97,
  11648. y: 260.04
  11649. }, {
  11650. x: 182.91,
  11651. y: 256.97
  11652. }, {
  11653. x: 186.86,
  11654. y: 253.89
  11655. }, {
  11656. x: 189,
  11657. y: 249.37
  11658. }, {
  11659. x: 191.13,
  11660. y: 244.85
  11661. }, {
  11662. x: 193.27,
  11663. y: 240.33
  11664. }, {
  11665. x: 195.41,
  11666. y: 235.81
  11667. }, {
  11668. x: 197.55,
  11669. y: 231.29
  11670. }, {
  11671. x: 199.69,
  11672. y: 226.77
  11673. }, {
  11674. x: 201.83,
  11675. y: 222.25
  11676. }, {
  11677. x: 203.96,
  11678. y: 217.73
  11679. }, {
  11680. x: 206.1,
  11681. y: 213.21
  11682. }, {
  11683. x: 208.24,
  11684. y: 208.69
  11685. }, {
  11686. x: 210.38,
  11687. y: 204.17
  11688. }, {
  11689. x: 212.52,
  11690. y: 199.65
  11691. }, {
  11692. x: 214.66,
  11693. y: 195.14
  11694. }, {
  11695. x: 216.79,
  11696. y: 190.62
  11697. }, {
  11698. x: 218.93,
  11699. y: 186.1
  11700. }, {
  11701. x: 221.07,
  11702. y: 181.58
  11703. }, {
  11704. x: 223.21,
  11705. y: 177.06
  11706. }, {
  11707. x: 225.35,
  11708. y: 172.54
  11709. }, {
  11710. x: 227.49,
  11711. y: 168.02
  11712. }, {
  11713. x: 229.62,
  11714. y: 163.5
  11715. }, {
  11716. x: 231.76,
  11717. y: 158.98
  11718. }, {
  11719. x: 233.9,
  11720. y: 154.46
  11721. }, {
  11722. x: 236.04,
  11723. y: 149.94
  11724. }, {
  11725. x: 238.18,
  11726. y: 145.42
  11727. }, {
  11728. x: 240.32,
  11729. y: 140.9
  11730. }, {
  11731. x: 242.45,
  11732. y: 136.38
  11733. }, {
  11734. x: 244.59,
  11735. y: 131.86
  11736. }, {
  11737. x: 249.59,
  11738. y: 131.78
  11739. }, {
  11740. x: 254.59,
  11741. y: 131.7
  11742. }, {
  11743. x: 259.59,
  11744. y: 131.62
  11745. }, {
  11746. x: 264.59,
  11747. y: 131.54
  11748. }, {
  11749. x: 269.59,
  11750. y: 131.46
  11751. }, {
  11752. x: 274.59,
  11753. y: 131.38
  11754. }, {
  11755. x: 279.59,
  11756. y: 131.3
  11757. }, {
  11758. x: 284.59,
  11759. y: 131.22
  11760. }, {
  11761. x: 289.59,
  11762. y: 131.14
  11763. }, {
  11764. x: 294.59,
  11765. y: 131.06
  11766. }, {
  11767. x: 299.59,
  11768. y: 130.98
  11769. }, {
  11770. x: 304.59,
  11771. y: 130.9
  11772. }, {
  11773. x: 309.58,
  11774. y: 130.82
  11775. }, {
  11776. x: 314.58,
  11777. y: 130.74
  11778. }, {
  11779. x: 319.58,
  11780. y: 130.66
  11781. }, {
  11782. x: 324.58,
  11783. y: 130.58
  11784. }, {
  11785. x: 329.58,
  11786. y: 130.5
  11787. }, {
  11788. x: 334.58,
  11789. y: 130.42
  11790. }, {
  11791. x: 339.58,
  11792. y: 130.34
  11793. }, {
  11794. x: 344.58,
  11795. y: 130.26
  11796. }, {
  11797. x: 349.58,
  11798. y: 130.18
  11799. }, {
  11800. x: 354.58,
  11801. y: 130.1
  11802. }, {
  11803. x: 359.58,
  11804. y: 130.02
  11805. }, {
  11806. x: 364.58,
  11807. y: 129.94
  11808. }, {
  11809. x: 369.58,
  11810. y: 129.86
  11811. }, {
  11812. x: 374.58,
  11813. y: 129.78
  11814. }, {
  11815. x: 379.58,
  11816. y: 129.7
  11817. }, {
  11818. x: 384.58,
  11819. y: 129.62
  11820. }, {
  11821. x: 389.57,
  11822. y: 129.54
  11823. }, {
  11824. x: 394.57,
  11825. y: 129.46
  11826. }, {
  11827. x: 399.57,
  11828. y: 129.38
  11829. }, {
  11830. x: 404.57,
  11831. y: 129.3
  11832. }, {
  11833. x: 409.57,
  11834. y: 129.22
  11835. }, {
  11836. x: 414.57,
  11837. y: 129.14
  11838. }, {
  11839. x: 419.57,
  11840. y: 129.06
  11841. }, {
  11842. x: 424.57,
  11843. y: 128.98
  11844. }, {
  11845. x: 429.57,
  11846. y: 128.9
  11847. }, {
  11848. x: 434.57,
  11849. y: 128.82
  11850. }, {
  11851. x: 439.57,
  11852. y: 128.74
  11853. }, {
  11854. x: 444.57,
  11855. y: 128.66
  11856. }, {
  11857. x: 449.57,
  11858. y: 128.58
  11859. }, {
  11860. x: 454.57,
  11861. y: 128.5
  11862. }, {
  11863. x: 459.57,
  11864. y: 128.42
  11865. }, {
  11866. x: 464.57,
  11867. y: 128.34
  11868. }, {
  11869. x: 469.56,
  11870. y: 128.26
  11871. }, {
  11872. x: 474.56,
  11873. y: 128.18
  11874. }, {
  11875. x: 479.56,
  11876. y: 128.1
  11877. }, {
  11878. x: 484.56,
  11879. y: 128.02
  11880. }, {
  11881. x: 489.56,
  11882. y: 127.94
  11883. }, {
  11884. x: 494.56,
  11885. y: 127.86
  11886. }, {
  11887. x: 499.56,
  11888. y: 127.78
  11889. }, {
  11890. x: 504.56,
  11891. y: 127.7
  11892. }, {
  11893. x: 509.56,
  11894. y: 127.62
  11895. }, {
  11896. x: 514.56,
  11897. y: 127.54
  11898. }, {
  11899. x: 519.56,
  11900. y: 127.46
  11901. }, {
  11902. x: 524.56,
  11903. y: 127.38
  11904. }, {
  11905. x: 529.56,
  11906. y: 127.3
  11907. }, {
  11908. x: 534.56,
  11909. y: 127.22
  11910. }, {
  11911. x: 539.56,
  11912. y: 127.14
  11913. }, {
  11914. x: 544.55,
  11915. y: 127.06
  11916. }, {
  11917. x: 549.55,
  11918. y: 126.98
  11919. }, {
  11920. x: 554.55,
  11921. y: 126.9
  11922. }, {
  11923. x: 559.55,
  11924. y: 126.82
  11925. }, {
  11926. x: 564.55,
  11927. y: 126.74
  11928. }, {
  11929. x: 569.55,
  11930. y: 126.66
  11931. }, {
  11932. x: 574.55,
  11933. y: 126.58
  11934. }, {
  11935. x: 579.55,
  11936. y: 126.5
  11937. }, {
  11938. x: 584.55,
  11939. y: 126.42
  11940. }, {
  11941. x: 589.55,
  11942. y: 126.34
  11943. }, {
  11944. x: 594.55,
  11945. y: 126.26
  11946. }, {
  11947. x: 599.55,
  11948. y: 126.18
  11949. }, {
  11950. x: 604.55,
  11951. y: 126.1
  11952. }, {
  11953. x: 609.55,
  11954. y: 126.02
  11955. }, {
  11956. x: 607.61,
  11957. y: 130.63
  11958. }, {
  11959. x: 605.67,
  11960. y: 135.24
  11961. }, {
  11962. x: 603.73,
  11963. y: 139.85
  11964. }, {
  11965. x: 601.79,
  11966. y: 144.46
  11967. }, {
  11968. x: 599.85,
  11969. y: 149.07
  11970. }, {
  11971. x: 597.91,
  11972. y: 153.67
  11973. }, {
  11974. x: 595.97,
  11975. y: 158.28
  11976. }, {
  11977. x: 594.03,
  11978. y: 162.89
  11979. }, {
  11980. x: 592.09,
  11981. y: 167.5
  11982. }, {
  11983. x: 590.15,
  11984. y: 172.11
  11985. }, {
  11986. x: 588.22,
  11987. y: 176.72
  11988. }, {
  11989. x: 586.28,
  11990. y: 181.33
  11991. }, {
  11992. x: 584.34,
  11993. y: 185.94
  11994. }, {
  11995. x: 582.4,
  11996. y: 190.54
  11997. }, {
  11998. x: 580.46,
  11999. y: 195.15
  12000. }, {
  12001. x: 578.52,
  12002. y: 199.76
  12003. }, {
  12004. x: 576.58,
  12005. y: 204.37
  12006. }, {
  12007. x: 574.64,
  12008. y: 208.98
  12009. }, {
  12010. x: 572.7,
  12011. y: 213.59
  12012. }, {
  12013. x: 570.76,
  12014. y: 218.2
  12015. }, {
  12016. x: 568.82,
  12017. y: 222.8
  12018. }, {
  12019. x: 566.88,
  12020. y: 227.41
  12021. }, {
  12022. x: 564.94,
  12023. y: 232.02
  12024. }, {
  12025. x: 563.01,
  12026. y: 236.63
  12027. }, {
  12028. x: 561.07,
  12029. y: 241.24
  12030. }, {
  12031. x: 559.13,
  12032. y: 245.85
  12033. }, {
  12034. x: 557.19,
  12035. y: 250.46
  12036. }, {
  12037. x: 555.25,
  12038. y: 255.06
  12039. }, {
  12040. x: 553.31,
  12041. y: 259.67
  12042. }, {
  12043. x: 551.37,
  12044. y: 264.28
  12045. }, {
  12046. x: 549.43,
  12047. y: 268.89
  12048. }, {
  12049. x: 547.49,
  12050. y: 273.5
  12051. }, {
  12052. x: 545.55,
  12053. y: 278.11
  12054. }, {
  12055. x: 543.61,
  12056. y: 282.72
  12057. }, {
  12058. x: 541.67,
  12059. y: 287.33
  12060. }, {
  12061. x: 539.73,
  12062. y: 291.93
  12063. }, {
  12064. x: 537.8,
  12065. y: 296.54
  12066. }, {
  12067. x: 535.86,
  12068. y: 301.15
  12069. }, {
  12070. x: 533.92,
  12071. y: 305.76
  12072. }, {
  12073. x: 531.98,
  12074. y: 310.37
  12075. }, {
  12076. x: 530.04,
  12077. y: 314.98
  12078. }, {
  12079. x: 528.1,
  12080. y: 319.59
  12081. }, {
  12082. x: 526.16,
  12083. y: 324.19
  12084. }, {
  12085. x: 524.22,
  12086. y: 328.8
  12087. }, {
  12088. x: 522.28,
  12089. y: 333.41
  12090. }, {
  12091. x: 520.34,
  12092. y: 338.02
  12093. }, {
  12094. x: 518.4,
  12095. y: 342.63
  12096. }, {
  12097. x: 516.46,
  12098. y: 347.24
  12099. }, {
  12100. x: 514.52,
  12101. y: 351.85
  12102. }, {
  12103. x: 512.59,
  12104. y: 356.45
  12105. }, {
  12106. x: 510.65,
  12107. y: 361.06
  12108. }, {
  12109. x: 508.71,
  12110. y: 365.67
  12111. }, {
  12112. x: 506.77,
  12113. y: 370.28
  12114. }, {
  12115. x: 504.83,
  12116. y: 374.89
  12117. }, {
  12118. x: 502.89,
  12119. y: 379.5
  12120. }, {
  12121. x: 500.95,
  12122. y: 384.11
  12123. }, {
  12124. x: 499.01,
  12125. y: 388.71
  12126. }, {
  12127. x: 497.07,
  12128. y: 393.32
  12129. }, {
  12130. x: 495.13,
  12131. y: 397.93
  12132. }, {
  12133. x: 493.19,
  12134. y: 402.54
  12135. }, {
  12136. x: 498.19,
  12137. y: 402.46
  12138. }, {
  12139. x: 503.19,
  12140. y: 402.38
  12141. }, {
  12142. x: 508.19,
  12143. y: 402.3
  12144. }, {
  12145. x: 513.19,
  12146. y: 402.22
  12147. }, {
  12148. x: 518.19,
  12149. y: 402.14
  12150. }, {
  12151. x: 523.19,
  12152. y: 402.06
  12153. }, {
  12154. x: 528.19,
  12155. y: 401.98
  12156. }, {
  12157. x: 533.19,
  12158. y: 401.9
  12159. }, {
  12160. x: 538.19,
  12161. y: 401.83
  12162. }, {
  12163. x: 543.19,
  12164. y: 401.75
  12165. }, {
  12166. x: 548.19,
  12167. y: 401.67
  12168. }, {
  12169. x: 553.19,
  12170. y: 401.59
  12171. }, {
  12172. x: 558.19,
  12173. y: 401.51
  12174. }, {
  12175. x: 563.18,
  12176. y: 401.43
  12177. }, {
  12178. x: 568.18,
  12179. y: 401.35
  12180. }, {
  12181. x: 573.18,
  12182. y: 401.27
  12183. }, {
  12184. x: 578.18,
  12185. y: 401.19
  12186. }, {
  12187. x: 583.18,
  12188. y: 401.11
  12189. }, {
  12190. x: 588.18,
  12191. y: 401.03
  12192. }, {
  12193. x: 593.18,
  12194. y: 400.95
  12195. }, {
  12196. x: 598.18,
  12197. y: 400.87
  12198. }, {
  12199. x: 603.18,
  12200. y: 400.79
  12201. }, {
  12202. x: 608.18,
  12203. y: 400.71
  12204. }, {
  12205. x: 613.18,
  12206. y: 400.63
  12207. }, {
  12208. x: 618.18,
  12209. y: 400.55
  12210. }, {
  12211. x: 623.18,
  12212. y: 400.47
  12213. }, {
  12214. x: 628.18,
  12215. y: 400.39
  12216. }, {
  12217. x: 633.18,
  12218. y: 400.32
  12219. }, {
  12220. x: 638.17,
  12221. y: 400.24
  12222. }, {
  12223. x: 643.17,
  12224. y: 400.16
  12225. }, {
  12226. x: 648.17,
  12227. y: 400.08
  12228. }, {
  12229. x: 653.17,
  12230. y: 400
  12231. }, {
  12232. x: 655.38,
  12233. y: 395.51
  12234. }, {
  12235. x: 657.59,
  12236. y: 391.02
  12237. }, {
  12238. x: 659.79,
  12239. y: 386.54
  12240. }, {
  12241. x: 662,
  12242. y: 382.05
  12243. }, {
  12244. x: 664.21,
  12245. y: 377.57
  12246. }, {
  12247. x: 666.42,
  12248. y: 373.08
  12249. }, {
  12250. x: 668.62,
  12251. y: 368.59
  12252. }, {
  12253. x: 670.83,
  12254. y: 364.11
  12255. }, {
  12256. x: 673.04,
  12257. y: 359.62
  12258. }, {
  12259. x: 675.25,
  12260. y: 355.13
  12261. }, {
  12262. x: 677.45,
  12263. y: 350.65
  12264. }, {
  12265. x: 679.66,
  12266. y: 346.16
  12267. }, {
  12268. x: 681.87,
  12269. y: 341.67
  12270. }, {
  12271. x: 684.07,
  12272. y: 337.19
  12273. }, {
  12274. x: 686.28,
  12275. y: 332.7
  12276. }, {
  12277. x: 688.49,
  12278. y: 328.21
  12279. }, {
  12280. x: 690.7,
  12281. y: 323.73
  12282. }, {
  12283. x: 692.9,
  12284. y: 319.24
  12285. }, {
  12286. x: 695.11,
  12287. y: 314.75
  12288. }, {
  12289. x: 697.32,
  12290. y: 310.27
  12291. }, {
  12292. x: 699.52,
  12293. y: 305.78
  12294. }, {
  12295. x: 701.73,
  12296. y: 301.3
  12297. }, {
  12298. x: 703.94,
  12299. y: 296.81
  12300. }, {
  12301. x: 706.15,
  12302. y: 292.32
  12303. }, {
  12304. x: 708.35,
  12305. y: 287.84
  12306. }, {
  12307. x: 710.56,
  12308. y: 283.35
  12309. }, {
  12310. x: 712.77,
  12311. y: 278.86
  12312. }, {
  12313. x: 714.98,
  12314. y: 274.38
  12315. }, {
  12316. x: 717.18,
  12317. y: 269.89
  12318. }, {
  12319. x: 719.39,
  12320. y: 265.4
  12321. }, {
  12322. x: 721.6,
  12323. y: 260.92
  12324. }, {
  12325. x: 723.8,
  12326. y: 256.43
  12327. }, {
  12328. x: 726.01,
  12329. y: 251.94
  12330. }, {
  12331. x: 731.01,
  12332. y: 251.8
  12333. }, {
  12334. x: 736.01,
  12335. y: 251.65
  12336. }, {
  12337. x: 741,
  12338. y: 251.5
  12339. }, {
  12340. x: 746,
  12341. y: 251.35
  12342. }, {
  12343. x: 751,
  12344. y: 251.2
  12345. }, {
  12346. x: 756,
  12347. y: 251.05
  12348. }, {
  12349. x: 761,
  12350. y: 250.91
  12351. }, {
  12352. x: 765.99,
  12353. y: 250.76
  12354. }, {
  12355. x: 770.99,
  12356. y: 250.61
  12357. }, {
  12358. x: 775.99,
  12359. y: 250.46
  12360. }, {
  12361. x: 780.99,
  12362. y: 250.31
  12363. }, {
  12364. x: 785.98,
  12365. y: 250.16
  12366. }, {
  12367. x: 790.98,
  12368. y: 250.02
  12369. }, {
  12370. x: 795.98,
  12371. y: 249.87
  12372. }, {
  12373. x: 800.98,
  12374. y: 249.72
  12375. }, {
  12376. x: 805.98,
  12377. y: 249.57
  12378. }, {
  12379. x: 810.97,
  12380. y: 249.42
  12381. }, {
  12382. x: 815.97,
  12383. y: 249.27
  12384. }, {
  12385. x: 820.97,
  12386. y: 249.13
  12387. }, {
  12388. x: 825.97,
  12389. y: 248.98
  12390. }, {
  12391. x: 830.97,
  12392. y: 248.83
  12393. }, {
  12394. x: 835.96,
  12395. y: 248.68
  12396. }, {
  12397. x: 840.96,
  12398. y: 248.53
  12399. }, {
  12400. x: 845.96,
  12401. y: 248.38
  12402. }, {
  12403. x: 850.96,
  12404. y: 248.24
  12405. }, {
  12406. x: 855.95,
  12407. y: 248.09
  12408. }, {
  12409. x: 860.95,
  12410. y: 247.94
  12411. }, {
  12412. x: 865.95,
  12413. y: 247.79
  12414. }, {
  12415. x: 870.95,
  12416. y: 247.64
  12417. }, {
  12418. x: 875.95,
  12419. y: 247.49
  12420. }, {
  12421. x: 880.94,
  12422. y: 247.57
  12423. }, {
  12424. x: 885.94,
  12425. y: 247.65
  12426. }, {
  12427. x: 890.94,
  12428. y: 247.73
  12429. }, {
  12430. x: 895.94,
  12431. y: 247.81
  12432. }, {
  12433. x: 900.94,
  12434. y: 247.89
  12435. }, {
  12436. x: 905.94,
  12437. y: 247.97
  12438. }, {
  12439. x: 910.93,
  12440. y: 246.46
  12441. }, {
  12442. x: 915.93,
  12443. y: 246.31
  12444. }, {
  12445. x: 920.93,
  12446. y: 246.16
  12447. }, {
  12448. x: 925.92,
  12449. y: 246.01
  12450. }, {
  12451. x: 930.92,
  12452. y: 245.86
  12453. }, {
  12454. x: 935.92,
  12455. y: 245.71
  12456. }, {
  12457. x: 940.92,
  12458. y: 245.57
  12459. }, {
  12460. x: 945.91,
  12461. y: 245.42
  12462. }, {
  12463. x: 950.91,
  12464. y: 245.27
  12465. }, {
  12466. x: 955.91,
  12467. y: 245.12
  12468. }, {
  12469. x: 960.91,
  12470. y: 244.97
  12471. }
  12472. ]
  12473. ]
  12474. ];
  12475. this.playerLives = this.levelLives = 100;
  12476. this.playerGold = 200;
  12477. this.playerDna = 470;
  12478. this.towersToBePlaced = [
  12479. {
  12480. type: '',
  12481. upgradeLevel: 0
  12482. }, {
  12483. type: '',
  12484. upgradeLevel: 0
  12485. }, {
  12486. type: '',
  12487. upgradeLevel: 0
  12488. }, {
  12489. type: '',
  12490. upgradeLevel: 0
  12491. }, {
  12492. type: '',
  12493. upgradeLevel: 0
  12494. }, {
  12495. type: '',
  12496. upgradeLevel: 0
  12497. }, {
  12498. type: '',
  12499. upgradeLevel: 0
  12500. }
  12501. ];
  12502. this.waves = [
  12503. {
  12504. delay: 0,
  12505. roads: [
  12506. {
  12507. callButton: {
  12508. x: 32,
  12509. y: 256,
  12510. rotation: 0
  12511. },
  12512. diseasesList: [
  12513. {
  12514. dis: 'Plague',
  12515. delay: 10
  12516. }
  12517. ]
  12518. }
  12519. ]
  12520. }, {
  12521. delay: 1500,
  12522. roads: [
  12523. {
  12524. callButton: {
  12525. x: 32,
  12526. y: 256,
  12527. rotation: 0
  12528. },
  12529. diseasesList: [
  12530. {
  12531. dis: 'HIV',
  12532. delay: 20
  12533. }, {
  12534. dis: 'Plague',
  12535. delay: 20
  12536. }, {
  12537. dis: 'HIV',
  12538. delay: 20
  12539. }, {
  12540. dis: 'Plague',
  12541. delay: 20
  12542. }, {
  12543. dis: 'HIV',
  12544. delay: 20
  12545. }, {
  12546. dis: 'Plague',
  12547. delay: 20
  12548. }, {
  12549. dis: 'HIV',
  12550. delay: 20
  12551. }, {
  12552. dis: 'Plague',
  12553. delay: 20
  12554. }, {
  12555. dis: 'HIV',
  12556. delay: 20
  12557. }, {
  12558. dis: 'Plague',
  12559. delay: 20
  12560. }
  12561. ]
  12562. }, {
  12563. callButton: {
  12564. x: 32,
  12565. y: 392,
  12566. rotation: -30
  12567. },
  12568. diseasesList: [
  12569. {
  12570. dis: 'Plague',
  12571. delay: 20
  12572. }
  12573. ]
  12574. }
  12575. ]
  12576. }, {
  12577. delay: 200,
  12578. roads: [
  12579. {
  12580. callButton: {
  12581. x: 32,
  12582. y: 256,
  12583. rotation: 0
  12584. },
  12585. diseasesList: [
  12586. {
  12587. dis: 'Plague',
  12588. delay: 20
  12589. }, {
  12590. dis: 'Plague',
  12591. delay: 20
  12592. }
  12593. ]
  12594. }, {
  12595. callButton: {
  12596. x: 32,
  12597. y: 392,
  12598. rotation: -30
  12599. },
  12600. diseasesList: [
  12601. {
  12602. dis: 'Plague',
  12603. delay: 20
  12604. }, {
  12605. dis: 'Plague',
  12606. delay: 20
  12607. }
  12608. ]
  12609. }
  12610. ]
  12611. }
  12612. ];
  12613. Level1.__super__.constructor.call(this, game);
  12614. }
  12615. return Level1;
  12616. })(dka.Level);
  12617. }).call(this);
  12618. /*
  12619. * Copyright © Romain Fouquet, 2012-2015
  12620. * Copyright © Clément Joly, 2012-2015
  12621. #
  12622. * romain.fouquet18@gmail.com
  12623. * leowzukw@vmail.me
  12624. #
  12625. * This file is part of Diseases Killer Academy.
  12626. #
  12627. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  12628. * it under the terms of the GNU Affero General Public License as published by
  12629. * the Free Software Foundation, either version 3 of the License, or
  12630. * (at your option) any later version.
  12631. #
  12632. * Diseases Killer Academy is distributed in the hope that it will be useful,
  12633. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12634. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12635. * GNU Affero General Public License for more details.
  12636. #
  12637. * You should have received a copy of the GNU Affero General Public License
  12638. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  12639. */
  12640. (function() {
  12641. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  12642. hasProp = {}.hasOwnProperty;
  12643. dka.HUDBar = (function(superClass) {
  12644. extend(HUDBar, superClass);
  12645. function HUDBar(level) {
  12646. var imgDna, imgGold, imgLife, imgWave;
  12647. HUDBar.__super__.constructor.call(this);
  12648. this.level = level;
  12649. this.set({
  12650. y: canvasHeight - 60
  12651. });
  12652. imgLife = (new createjs.Bitmap(dka.academy.assetManager.getAsset('lifeHud'))).set({
  12653. x: 19,
  12654. y: 32
  12655. });
  12656. imgGold = (new createjs.Bitmap(dka.academy.assetManager.getAsset('coinHud'))).set({
  12657. x: 110,
  12658. y: 32
  12659. });
  12660. imgDna = (new createjs.Bitmap(dka.academy.assetManager.getAsset('dnaHud'))).set({
  12661. x: 182,
  12662. y: 32
  12663. });
  12664. imgWave = (new createjs.Bitmap(dka.academy.assetManager.getAsset('waveHud'))).set({
  12665. x: 365,
  12666. y: 32
  12667. });
  12668. this.txtLives = (new createjs.Text(this.level.playerLives + ' k', '20px karnivoreRegular, Arial', dka.colors.lightBlue)).set({
  12669. x: 45,
  12670. y: 49,
  12671. textAlign: 'left',
  12672. textBaseline: 'alphabetic'
  12673. });
  12674. this.txtGold = (new createjs.Text(this.level.playerGold, '20px karnivoreRegular, Arial', dka.colors.lightBlue)).set({
  12675. x: 130,
  12676. y: 49,
  12677. textAlign: 'left',
  12678. textBaseline: 'alphabetic'
  12679. });
  12680. this.txtDna = (new createjs.Text(this.level.playerDna, '20px karnivoreRegular, Arial', dka.colors.lightBlue)).set({
  12681. x: 208,
  12682. y: 49,
  12683. textAlign: 'left',
  12684. textBaseline: 'alphabetic'
  12685. });
  12686. this.txtWaves = (new createjs.Text((this.level.getFresherWaveIndex() + 1) + '/' + this.level.nbrWaves, '20px karnivoreRegular, Arial', dka.colors.lightBlue)).set({
  12687. x: 395,
  12688. y: 49,
  12689. textAlign: 'left',
  12690. textBaseline: 'alphabetic'
  12691. });
  12692. this.addChild(imgLife, imgGold, imgDna, imgWave, this.txtLives, this.txtGold, this.txtDna, this.txtWaves);
  12693. this.cache(0, 0, canvasWidth, 60);
  12694. }
  12695. HUDBar.prototype.updateLives = function() {
  12696. this.txtLives.text = this.level.playerLives + ' k';
  12697. return this.updateCache();
  12698. };
  12699. HUDBar.prototype.updateGold = function() {
  12700. this.txtGold.text = this.level.playerGold;
  12701. return this.updateCache();
  12702. };
  12703. HUDBar.prototype.updateDna = function() {
  12704. this.txtDna.text = this.level.playerDna;
  12705. return this.updateCache();
  12706. };
  12707. HUDBar.prototype.updateWaves = function() {
  12708. this.txtWaves.text = (this.level.getFresherWaveIndex() + 1) + '/' + this.level.nbrWaves;
  12709. return this.updateCache();
  12710. };
  12711. HUDBar.prototype.addMessageBalloon = function() {
  12712. this.msgBalloon = (new dka.MessageBalloon(this.level.hintLabsMsg, this.level)).set({
  12713. x: canvasWidth - 440,
  12714. y: canvasHeight - 68
  12715. });
  12716. this.parent.addChild(this.msgBalloon);
  12717. return this.updateCache();
  12718. };
  12719. return HUDBar;
  12720. })(createjs.Container);
  12721. }).call(this);
  12722. /*
  12723. * Copyright © Romain Fouquet, 2012-2015
  12724. * Copyright © Clément Joly, 2012-2015
  12725. #
  12726. * romain.fouquet18@gmail.com
  12727. * leowzukw@vmail.me
  12728. #
  12729. * This file is part of Diseases Killer Academy.
  12730. #
  12731. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  12732. * it under the terms of the GNU Affero General Public License as published by
  12733. * the Free Software Foundation, either version 3 of the License, or
  12734. * (at your option) any later version.
  12735. #
  12736. * Diseases Killer Academy is distributed in the hope that it will be useful,
  12737. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12738. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12739. * GNU Affero General Public License for more details.
  12740. #
  12741. * You should have received a copy of the GNU Affero General Public License
  12742. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  12743. */
  12744. (function() {
  12745. 'use strict';
  12746. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  12747. hasProp = {}.hasOwnProperty;
  12748. dka.Ui = (function(superClass) {
  12749. extend(Ui, superClass);
  12750. function Ui(level) {
  12751. var encyclopediaButton, j, pauseButton, ref, road;
  12752. Ui.__super__.constructor.call(this);
  12753. this.level = level;
  12754. this.buttonsPositions = [25, 70];
  12755. this.paused = false;
  12756. this.addKeyEvents();
  12757. dka.academy.addBlurEvent((function(_this) {
  12758. return function() {
  12759. if (_this.level.game.autopause) {
  12760. return _this.easyPause('auto', true);
  12761. }
  12762. };
  12763. })(this));
  12764. this.alpha = 0;
  12765. createjs.Tween.get(this, {
  12766. useTicks: true
  12767. }).to({
  12768. alpha: 1
  12769. }, 20, createjs.Ease.cubicOut);
  12770. this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('border')));
  12771. this.helpButtonsHolder = new dka.HelpButtonsHolder(this.level, this);
  12772. this.addChild(this.helpButtonsHolder);
  12773. this.hudBar = this.addChild(new dka.HUDBar(this.level));
  12774. pauseButton = this.addChild(new dka.Button(canvasWidth - this.buttonsPositions[0], null, new createjs.Bitmap(dka.academy.assetManager.getAsset('PauseBP'))));
  12775. pauseButton.on('click', (function(_this) {
  12776. return function() {
  12777. return _this.easyPause('button');
  12778. };
  12779. })(this));
  12780. encyclopediaButton = this.addChild(new dka.Button(canvasWidth - this.buttonsPositions[1], null, new createjs.Bitmap(dka.academy.assetManager.getAsset('EncyclopediaBP'))));
  12781. encyclopediaButton.on('click', (function(_this) {
  12782. return function() {
  12783. _this.easyPause('encyclopedia');
  12784. return _this.level.screenEncyclopedia.show();
  12785. };
  12786. })(this));
  12787. this.waveFlags = [];
  12788. for (road = j = 0, ref = this.level.waves[0].roads.length; 0 <= ref ? j < ref : j > ref; road = 0 <= ref ? ++j : --j) {
  12789. this.waveFlags.push(new dka.WaveFlag(this.level, road));
  12790. this.addChild(this.waveFlags[this.waveFlags.length - 1]);
  12791. }
  12792. this.tutoBubles = this.addChild(new createjs.Container());
  12793. this.callTutoBubble = false;
  12794. if (this.level.pausable) {
  12795. this.addDecorations();
  12796. }
  12797. }
  12798. Ui.prototype.addDecorations = function() {
  12799. var goalMarker, info;
  12800. info = new dka.TypingText(this.level.placeDate, 'bold 24px karnivoreRegular, Arial', dka.colors.lightBlue, this.level, 20, '_', 2, 8).set({
  12801. x: 32,
  12802. y: canvasHeight - 60,
  12803. textBaseline: 'alphabetic'
  12804. });
  12805. this.addChild(info);
  12806. goalMarker = new createjs.Bitmap(dka.academy.assetManager.getAsset('goalMarker'));
  12807. goalMarker.set({
  12808. x: this.level.goalMarkerPosition.x,
  12809. y: this.level.goalMarkerPosition.y - 50,
  12810. alpha: 0
  12811. });
  12812. this.addChild(goalMarker);
  12813. return createjs.Tween.get(goalMarker, {
  12814. useTicks: true
  12815. }).to({
  12816. alpha: 1,
  12817. y: this.level.goalMarkerPosition.y
  12818. }, 20, createjs.Ease.cubicIn).wait(3 * 30).to({
  12819. alpha: 0,
  12820. y: this.level.goalMarkerPosition.y - 50
  12821. }, 20, createjs.Ease.cubicOut).call(function() {
  12822. return this.parent.removeChild(this);
  12823. });
  12824. };
  12825. Ui.prototype.showWaveFlags = function() {
  12826. var j, ref, results, road;
  12827. results = [];
  12828. for (road = j = 0, ref = this.level.waves[this.level.getFresherWaveIndex() + 1].roads.length; 0 <= ref ? j < ref : j > ref; road = 0 <= ref ? ++j : --j) {
  12829. this.waveFlags.push(new dka.WaveFlag(this.level, road));
  12830. results.push(this.addChild(this.waveFlags[this.waveFlags.length - 1]));
  12831. }
  12832. return results;
  12833. };
  12834. Ui.prototype.removeWaveFlags = function() {
  12835. var flag, j, len, ref;
  12836. ref = this.waveFlags;
  12837. for (j = 0, len = ref.length; j < len; j++) {
  12838. flag = ref[j];
  12839. flag.remove();
  12840. }
  12841. return this.waveFlags = [];
  12842. };
  12843. Ui.prototype.endScreen = function() {
  12844. this.removeKeyEvents();
  12845. return this.addChild(new dka.ScreenLevelEnd(this.level));
  12846. };
  12847. Ui.prototype.easyPause = function(trigger, value) {
  12848. if (value === this.paused || this.level.finished || !this.level.pausable) {
  12849. return;
  12850. }
  12851. value = value || !this.paused;
  12852. this.level.removeToolTip();
  12853. if (value) {
  12854. this.paused = true;
  12855. if (this.level.getFresherWaveIndex() >= 0) {
  12856. this.level.removeLevelTicker();
  12857. } else {
  12858. dka.academy.removeStageTicker();
  12859. }
  12860. dka.academy.soundManager.pauseAll();
  12861. if (trigger !== 'encyclopedia') {
  12862. this.level.screenPause.show(trigger);
  12863. gameStage.update();
  12864. gameStage.cache(0, 0, canvasWidth, canvasHeight);
  12865. return createjs.Ticker.paused = true;
  12866. }
  12867. } else {
  12868. this.paused = false;
  12869. dka.academy.soundManager.resume();
  12870. this.level.screenPause.hide();
  12871. gameStage.uncache();
  12872. createjs.Ticker.paused = false;
  12873. if (this.level.getFresherWaveIndex() >= 0) {
  12874. return this.level.addLevelTicker();
  12875. } else {
  12876. return dka.academy.addStageTicker();
  12877. }
  12878. }
  12879. };
  12880. Ui.prototype.addKeyEvents = function() {
  12881. Mousetrap.bind('p', (function(_this) {
  12882. return function() {
  12883. return _this.easyPause('key');
  12884. };
  12885. })(this));
  12886. Mousetrap.bind('t', (function(_this) {
  12887. return function() {
  12888. if (!_this.paused) {
  12889. return _this.helpButtonsHolder.feverButton.doAction(true);
  12890. }
  12891. };
  12892. })(this));
  12893. Mousetrap.bind('y', (function(_this) {
  12894. return function() {
  12895. if (!_this.paused) {
  12896. return _this.helpButtonsHolder.vaccineButton.doAction(true);
  12897. }
  12898. };
  12899. })(this));
  12900. return Mousetrap.bind('up up down down left right left right b a enter', (function(_this) {
  12901. return function() {
  12902. var i, j, ref, results;
  12903. results = [];
  12904. for (i = j = 0, ref = _this.level.diseasesLayer.numChildren; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
  12905. results.push(_this.level.diseasesLayer.getChildAt(0).die());
  12906. }
  12907. return results;
  12908. };
  12909. })(this));
  12910. };
  12911. Ui.prototype.removeKeyEvents = function() {
  12912. return Mousetrap.reset();
  12913. };
  12914. return Ui;
  12915. })(createjs.Container);
  12916. }).call(this);
  12917. /*
  12918. * Copyright © Romain Fouquet, 2012-2015
  12919. * Copyright © Clément Joly, 2012-2015
  12920. #
  12921. * romain.fouquet18@gmail.com
  12922. * leowzukw@vmail.me
  12923. #
  12924. * This file is part of Diseases Killer Academy.
  12925. *
  12926. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  12927. * it under the terms of the GNU Affero General Public License as published by
  12928. * the Free Software Foundation, either version 3 of the License, or
  12929. * (at your option) any later version.
  12930. *
  12931. * Diseases Killer Academy is distributed in the hope that it will be useful,
  12932. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12933. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12934. * GNU Affero General Public License for more details.
  12935. *
  12936. * You should have received a copy of the GNU Affero General Public License
  12937. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  12938. */
  12939. (function() {
  12940. 'use strict';
  12941. dka.SoundManager = (function() {
  12942. function SoundManager() {}
  12943. SoundManager.prototype.stopAll = function() {};
  12944. SoundManager.prototype.pauseAll = function() {
  12945. if (this.soundtrack) {
  12946. return this.soundtrack.pause();
  12947. }
  12948. };
  12949. SoundManager.prototype.resume = function() {
  12950. if (this.soundtrack) {
  12951. return this.soundtrack.resume();
  12952. }
  12953. };
  12954. SoundManager.prototype.playBackgroundsound = function() {
  12955. return this.soundtrack = createjs.Sound.play('soundMagieder', createjs.Sound.INTERRUPT_ANY, 0, 0, -1);
  12956. };
  12957. SoundManager.prototype.play = function(sound) {};
  12958. return SoundManager;
  12959. })();
  12960. }).call(this);
  12961. /*
  12962. * Copyright © Romain Fouquet, 2012-2015
  12963. * Copyright © Clément Joly, 2012-2015
  12964. #
  12965. * romain.fouquet18@gmail.com
  12966. * leowzukw@vmail.me
  12967. #
  12968. * This file is part of Diseases Killer Academy.
  12969. #
  12970. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  12971. * it under the terms of the GNU Affero General Public License as published by
  12972. * the Free Software Foundation, either version 3 of the License, or
  12973. * (at your option) any later version.
  12974. #
  12975. * Diseases Killer Academy is distributed in the hope that it will be useful,
  12976. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12977. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12978. * GNU Affero General Public License for more details.
  12979. #
  12980. * You should have received a copy of the GNU Affero General Public License
  12981. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  12982. */
  12983. (function() {
  12984. dka.DataManager = (function() {
  12985. function DataManager() {}
  12986. DataManager.prototype.saveLevelProgress = function() {
  12987. return typeof localStorage !== "undefined" && localStorage !== null ? localStorage.setItem('levelprogress', dka.academy.game.serialize()) : void 0;
  12988. };
  12989. DataManager.prototype.retrieveLevelProgress = function() {
  12990. return JSON.parse(typeof localStorage !== "undefined" && localStorage !== null ? localStorage.getItem('levelprogress') : void 0);
  12991. };
  12992. DataManager.prototype.saveLabsPurchases = function() {
  12993. return typeof localStorage !== "undefined" && localStorage !== null ? localStorage.setItem('labs', dka.academy.game.labs.serialize()) : void 0;
  12994. };
  12995. DataManager.prototype.retrieveLabsPurchases = function() {
  12996. return JSON.parse(typeof localStorage !== "undefined" && localStorage !== null ? localStorage.getItem('labs') : void 0);
  12997. };
  12998. return DataManager;
  12999. })();
  13000. }).call(this);
  13001. /*
  13002. * Copyright © Romain Fouquet, 2012-2015
  13003. * Copyright © Clément Joly, 2012-2015
  13004. #
  13005. * romain.fouquet18@gmail.com
  13006. * leowzukw@vmail.me
  13007. #
  13008. * This file is part of Diseases Killer Academy.
  13009. #
  13010. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13011. * it under the terms of the GNU Affero General Public License as published by
  13012. * the Free Software Foundation, either version 3 of the License, or
  13013. * (at your option) any later version.
  13014. #
  13015. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13016. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13017. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13018. * GNU Affero General Public License for more details.
  13019. #
  13020. * You should have received a copy of the GNU Affero General Public License
  13021. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13022. */
  13023. (function() {
  13024. 'use strict';
  13025. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13026. hasProp = {}.hasOwnProperty,
  13027. slice = [].slice;
  13028. String.prototype.uppercaseFirstLetter = function() {
  13029. return this.slice(0, 1).toUpperCase() + this.substring(1);
  13030. };
  13031. dka.HintBox = (function(superClass) {
  13032. extend(HintBox, superClass);
  13033. function HintBox() {
  13034. HintBox.__super__.constructor.call(this);
  13035. this.hintOffset = 16;
  13036. this.maxTextWidth = 150;
  13037. this.rectPadding = 7;
  13038. this.bottomMargins = {
  13039. title: 10,
  13040. separator: 5,
  13041. description: 10,
  13042. props: 1
  13043. };
  13044. this.textFonts = {
  13045. title: '16px Arial',
  13046. description: '13px Arial',
  13047. props: '13px Arial'
  13048. };
  13049. this.textColors = {
  13050. title: '#FFE000',
  13051. description: '#F0F0F0',
  13052. prop: '#F0F0F0',
  13053. green: '#10F000',
  13054. red: '#FF0000'
  13055. };
  13056. this.threadPositions = [];
  13057. this.rectWidth = 0;
  13058. this.rectHeight = 0;
  13059. }
  13060. HintBox.prototype.load = function(target, hintData) {
  13061. var backRect, nextY, separator, separatorPos, title;
  13062. this.target = target;
  13063. this.removeAllChildren();
  13064. this.set({
  13065. alpha: 0.8
  13066. });
  13067. this.on('tick', function(e) {
  13068. if (!this.target || !gameStage.contains(this.target)) {
  13069. return createjs.Tween.get(this, {
  13070. useTicks: true
  13071. }).to({
  13072. alpha: 0
  13073. }, 6).call(function() {
  13074. return this.hide();
  13075. });
  13076. }
  13077. });
  13078. separatorPos = new createjs.Point();
  13079. nextY = this.rectPadding + 15;
  13080. title = (new createjs.Text(hintData.title, this.textFonts.title, this.textColors.title)).set({
  13081. x: this.rectPadding,
  13082. y: nextY,
  13083. lineWidth: this.maxTextWidth,
  13084. textBaseline: 'alphabetic'
  13085. });
  13086. this.addChild(title);
  13087. nextY += this.bottomMargins.title;
  13088. separatorPos.x = this.rectPadding;
  13089. separatorPos.y = nextY;
  13090. nextY += this.bottomMargins.separator + title.getMeasuredHeight();
  13091. if (hintData.description) {
  13092. nextY = this.addDescription(hintData.description, nextY);
  13093. }
  13094. if (hintData.props) {
  13095. if (hintData.description) {
  13096. nextY += this.bottomMargins.description;
  13097. }
  13098. nextY = this.addProps(hintData.props, nextY);
  13099. }
  13100. this.rectWidth = this.getRectWidth();
  13101. this.rectHeight = nextY;
  13102. backRect = new createjs.Shape();
  13103. backRect.graphics.beginFill('#1e1e1e').drawRoundRect(0, 0, this.rectWidth, this.rectHeight, 5);
  13104. this.addChildAt(backRect, 0);
  13105. separator = new createjs.Shape().set({
  13106. x: separatorPos.x,
  13107. y: separatorPos.y
  13108. });
  13109. separator.graphics.beginStroke('#000').moveTo(0, 0).lineTo(this.rectWidth - 2 * this.rectPadding, 0);
  13110. this.addChildAt(separator, 1);
  13111. this.position();
  13112. return this.cache(0, 0, this.rectWidth, this.rectHeight);
  13113. };
  13114. HintBox.prototype.addDescription = function(txt, nextY) {
  13115. var description;
  13116. description = (new createjs.Text(txt, this.textFonts.description, this.textColors.description)).set({
  13117. x: this.rectPadding,
  13118. y: nextY,
  13119. lineWidth: this.maxTextWidth,
  13120. textBaseline: 'alphabetic'
  13121. });
  13122. this.addChild(description);
  13123. return nextY + description.getMeasuredHeight();
  13124. };
  13125. HintBox.prototype.addProps = function(props, nextY) {
  13126. var i, j, len, prop, propName, propValue, textLine;
  13127. for (i = j = 0, len = props.length; j < len; i = ++j) {
  13128. prop = props[i];
  13129. propName = new createjs.Text(prop.caption.uppercaseFirstLetter() + (prop.separator || ': '), this.textFonts.props, this.textColors.prop).set({
  13130. lineWidth: this.maxTextWidth,
  13131. textBaseline: 'alphabetic'
  13132. });
  13133. if (prop.value instanceof Array) {
  13134. if (prop.value.length === 2) {
  13135. propValue = new createjs.Text(prop.value[0] + '-' + prop.value[1], this.textFonts.props, this.getColor(prop.color)).set({
  13136. lineWidth: this.maxTextWidth,
  13137. textBaseline: 'alphabetic'
  13138. });
  13139. }
  13140. } else {
  13141. propValue = new createjs.Text(prop.value, this.textFonts.props, this.getColor(prop.color)).set({
  13142. lineWidth: this.maxTextWidth,
  13143. textBaseline: 'alphabetic'
  13144. });
  13145. }
  13146. textLine = this.concateTexts(propName, propValue).set({
  13147. x: this.rectPadding,
  13148. y: nextY
  13149. });
  13150. this.addChild(textLine);
  13151. nextY = textLine.y + propName.getMeasuredHeight();
  13152. if (i < props.length - 1) {
  13153. nextY += this.bottomMargins.props;
  13154. }
  13155. }
  13156. return nextY;
  13157. };
  13158. HintBox.prototype.getRectWidth = function() {
  13159. var i, j, rectWidth, ref, width;
  13160. rectWidth = 0;
  13161. width = 0;
  13162. for (i = j = ref = this.numChildren - 1; j >= 0; i = j += -1) {
  13163. if (this.getChildAt(i).text) {
  13164. width = this.getChildAt(i).getBounds().width;
  13165. if (width < this.maxTextWidth) {
  13166. if (width > rectWidth) {
  13167. rectWidth = width + 2 * this.rectPadding;
  13168. }
  13169. } else {
  13170. return this.maxTextWidth + 2 * this.rectPadding;
  13171. }
  13172. } else {
  13173. if (this.getChildAt(i).width < this.maxTextWidth && this.getChildAt(i).width > rectWidth) {
  13174. rectWidth = this.getChildAt(i).width + 2 * this.rectPadding;
  13175. }
  13176. }
  13177. }
  13178. return rectWidth;
  13179. };
  13180. HintBox.prototype.getColor = function(color) {
  13181. switch (color) {
  13182. case 'green':
  13183. return this.textColors.green;
  13184. case 'red':
  13185. return this.textColors.red;
  13186. default:
  13187. return this.textColors.prop;
  13188. }
  13189. };
  13190. HintBox.prototype.position = function() {
  13191. var hintPoint, objPoint;
  13192. objPoint = new createjs.Point(this.target.x, this.target.y);
  13193. objPoint = this.target.localToGlobal(this.target.regX, this.target.regY);
  13194. hintPoint = new createjs.Point();
  13195. if (objPoint.x + this.rectWidth + this.hintOffset > canvasWidth) {
  13196. hintPoint.x = objPoint.x - (this.rectWidth + this.hintOffset);
  13197. } else {
  13198. hintPoint.x = objPoint.x + this.hintOffset;
  13199. }
  13200. if (objPoint.y + this.rectHeight + this.hintOffset > canvasHeight) {
  13201. hintPoint.y = objPoint.y - (this.rectHeight + this.hintOffset);
  13202. } else {
  13203. hintPoint.y = objPoint.y + this.hintOffset;
  13204. }
  13205. return this.set({
  13206. x: hintPoint.x,
  13207. y: hintPoint.y
  13208. });
  13209. };
  13210. HintBox.prototype.hide = function() {
  13211. this.visible = false;
  13212. return this.removeAllEventListeners();
  13213. };
  13214. HintBox.prototype.concateTexts = function() {
  13215. var j, len, nextX, text, textContainer, texts;
  13216. texts = 1 <= arguments.length ? slice.call(arguments, 0) : [];
  13217. nextX = 0;
  13218. textContainer = new createjs.Container();
  13219. for (j = 0, len = texts.length; j < len; j++) {
  13220. text = texts[j];
  13221. text.x = nextX;
  13222. nextX += text.getMeasuredWidth();
  13223. textContainer.addChild(text);
  13224. }
  13225. textContainer.width = nextX;
  13226. return textContainer;
  13227. };
  13228. return HintBox;
  13229. })(createjs.Container);
  13230. }).call(this);
  13231. /*
  13232. * Copyright © Romain Fouquet, 2012-2015
  13233. * Copyright © Clément Joly, 2012-2015
  13234. #
  13235. * romain.fouquet18@gmail.com
  13236. * leowzukw@vmail.me
  13237. #
  13238. * This file is part of Diseases Killer Academy.
  13239. *
  13240. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13241. * it under the terms of the GNU Affero General Public License as published by
  13242. * the Free Software Foundation, either version 3 of the License, or
  13243. * (at your option) any later version.
  13244. *
  13245. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13246. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13247. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13248. * GNU Affero General Public License for more details.
  13249. *
  13250. * You should have received a copy of the GNU Affero General Public License
  13251. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13252. */
  13253. (function() {
  13254. 'use strict';
  13255. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13256. hasProp = {}.hasOwnProperty;
  13257. dka.DiseaseSplash = (function(superClass) {
  13258. extend(DiseaseSplash, superClass);
  13259. function DiseaseSplash(x, y) {
  13260. if (x == null) {
  13261. x = 0;
  13262. }
  13263. if (y == null) {
  13264. y = 0;
  13265. }
  13266. DiseaseSplash.__super__.constructor.call(this, dka.academy.assetManager.getAsset('spriteDiseaseSplash'));
  13267. this.x = x;
  13268. this.y = y;
  13269. this.gotoAndPlay(0);
  13270. this.on('animationend', this.animationend);
  13271. }
  13272. DiseaseSplash.prototype.animationend = function() {
  13273. return this.parent.removeChild(this);
  13274. };
  13275. return DiseaseSplash;
  13276. })(createjs.Sprite);
  13277. }).call(this);
  13278. /*
  13279. * Copyright © Romain Fouquet, 2012-2015
  13280. * Copyright © Clément Joly, 2012-2015
  13281. #
  13282. * romain.fouquet18@gmail.com
  13283. * leowzukw@vmail.me
  13284. #
  13285. * This file is part of Diseases Killer Academy.
  13286. #
  13287. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13288. * it under the terms of the GNU Affero General Public License as published by
  13289. * the Free Software Foundation, either version 3 of the License, or
  13290. * (at your option) any later version.
  13291. #
  13292. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13293. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13294. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13295. * GNU Affero General Public License for more details.
  13296. #
  13297. * You should have received a copy of the GNU Affero General Public License
  13298. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13299. */
  13300. (function() {
  13301. 'use strict';
  13302. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13303. hasProp = {}.hasOwnProperty;
  13304. dka.Disease = (function(superClass) {
  13305. extend(Disease, superClass);
  13306. function Disease(level, road, path) {
  13307. var settings;
  13308. Disease.__super__.constructor.call(this);
  13309. this.level = level;
  13310. this.road = road;
  13311. this.path = path;
  13312. this.sprite = new createjs.Sprite();
  13313. this.addChild(this.sprite);
  13314. this.antibodies = new createjs.Container();
  13315. this.addChild(this.antibodies);
  13316. this.pointToReach = 0;
  13317. this.isActive = false;
  13318. this.stopped = false;
  13319. this.braked = false;
  13320. this.put(new createjs.Point(path[this.pointToReach].x, path[this.pointToReach].y));
  13321. settings = level.settings.diseases[this.diseaseName];
  13322. this.beforeBrake = this.initialSpeed = this.speed = settings.speed;
  13323. this.initialLife = this.life = settings.life;
  13324. this.damage = settings.damage;
  13325. this.attackReload = settings.attackReload;
  13326. this.lifeCost = settings.lifeCost;
  13327. this.lifeBar = new dka.ProgressBar(false, 28, 6, '#00E400', '#FF0000', dka.colors.darkGrey).set({
  13328. y: -18
  13329. });
  13330. this.lifeBar.setProgress(1);
  13331. this.lifeBar.visible = false;
  13332. this.addChild(this.lifeBar);
  13333. this.wave = this.level.getFresherWave();
  13334. this.alive = true;
  13335. this.readyToAttack = true;
  13336. this.waitToAttack = 0;
  13337. this.antibodiesCounter = 0;
  13338. this.distanceToExit = path.length * level.distanceBetweenWP;
  13339. if (TXT_NBR) {
  13340. this.addTxtNbr();
  13341. }
  13342. }
  13343. Disease.prototype.put = function(position) {
  13344. this.x = position.x;
  13345. return this.y = position.y;
  13346. };
  13347. Disease.prototype.tick = function() {
  13348. var i, l;
  13349. if (this.readyToAttack !== true) {
  13350. this.waitToAttack++;
  13351. if (this.waitToAttack >= this.attackReload) {
  13352. this.waitToAttack = 0;
  13353. this.readyToAttack = true;
  13354. }
  13355. }
  13356. if (this.level.moveDiseases && !this.stopped) {
  13357. this.move();
  13358. }
  13359. i = 0;
  13360. l = this.antibodies.numChildren;
  13361. while (i < l) {
  13362. this.antibodies.getChildAt(i).tick();
  13363. i++;
  13364. }
  13365. if (TXT_NBR) {
  13366. return this.updateTxtNbr();
  13367. }
  13368. };
  13369. Disease.prototype.move = function() {
  13370. var angle, deltaX, deltaY, nxtX, nxtY, pointToReach;
  13371. pointToReach = this.path[this.pointToReach];
  13372. deltaX = pointToReach.x - this.x;
  13373. deltaY = pointToReach.y - this.y;
  13374. this.dstToWaypoint = this.level.euclidDistance(this.x, this.y, pointToReach.x, pointToReach.y);
  13375. if (this.dstToWaypoint < this.speed) {
  13376. this.reachingWP();
  13377. }
  13378. angle = Math.atan2(deltaY, deltaX);
  13379. nxtX = this.x + this.speed * Math.cos(angle);
  13380. nxtY = this.y + this.speed * Math.sin(angle);
  13381. this.x = nxtX;
  13382. this.y = nxtY;
  13383. if (this.level.isVisibleByPlayer(this.x, this.y)) {
  13384. this.isActive = true;
  13385. } else {
  13386. this.isActive = false;
  13387. }
  13388. if (TXT_NBR) {
  13389. this.txtNbr.x = this.x;
  13390. return this.txtNbr.y = this.y + 7;
  13391. }
  13392. };
  13393. Disease.prototype.reachingWP = function() {
  13394. if (this.pointToReach < this.path.length - 1) {
  13395. this.pointToReach++;
  13396. return this.distanceToExit -= this.level.distanceBetweenWP;
  13397. } else {
  13398. this.wave.diseasesArrived++;
  13399. this.level.loseLives(this.lifeCost);
  13400. this.remove();
  13401. if (this.level.playerLives <= 0) {
  13402. return this.level.finish();
  13403. }
  13404. }
  13405. };
  13406. Disease.prototype.isTargetable = function() {
  13407. if (this.isActive && this.alive) {
  13408. return true;
  13409. } else {
  13410. return false;
  13411. }
  13412. };
  13413. Disease.prototype.die = function() {
  13414. var dnaEarned, reward;
  13415. if (!this.alive) {
  13416. return;
  13417. }
  13418. dnaEarned = this.initialLife;
  13419. this.level.addDna(dnaEarned);
  13420. reward = new dka.BouncingText('+' + dnaEarned, 'bold 12px karnivoreRegular, Arial', '#1FC121', new createjs.Point(this.x, this.y));
  13421. this.level.ui.addChild(reward);
  13422. this.wave.diseasesKilled++;
  13423. return this.remove();
  13424. };
  13425. Disease.prototype.remove = function() {
  13426. if (!this.alive) {
  13427. return;
  13428. }
  13429. if (!this.level.finished) {
  13430. this.wave.verifFinished();
  13431. }
  13432. this.alive = false;
  13433. if (this.lifeBar) {
  13434. this.lifeBar.parent.removeChild(this.lifeBar);
  13435. }
  13436. this.parent.removeChild(this);
  13437. return gameStage.removeChild(this.txtNbr);
  13438. };
  13439. Disease.prototype.beDamaged = function(damage) {
  13440. this.life -= damage;
  13441. if (this.life <= 0) {
  13442. this.life = 0;
  13443. this.die();
  13444. return true;
  13445. } else {
  13446. if (this.alive) {
  13447. this.updateLifeBar();
  13448. }
  13449. return false;
  13450. }
  13451. };
  13452. Disease.prototype.hit = function() {
  13453. return this.addChild(new dka.DiseaseSplash());
  13454. };
  13455. Disease.prototype.updateLifeBar = function() {
  13456. this.lifeBar.setProgress(this.life / this.initialLife);
  13457. return this.lifeBar.visible = true;
  13458. };
  13459. Disease.prototype.getDamage = function() {
  13460. return Math.ceil(Math.random() * (this.damage[1] - this.damage[0]) + this.damage[0]);
  13461. };
  13462. Disease.prototype.brake = function(brake) {
  13463. this.braked = true;
  13464. return this.speed *= brake;
  13465. };
  13466. Disease.prototype.preventMultiplication = function() {
  13467. return false;
  13468. };
  13469. Disease.prototype.addAntibody = function(antibody) {
  13470. return this.antibodies.addChild(antibody);
  13471. };
  13472. Disease.prototype.educate = function() {
  13473. return false;
  13474. };
  13475. Disease.prototype.updateTxtNbr = function() {
  13476. return this.txtNbr.text = Math.round(this.speed * 100) / 100;
  13477. };
  13478. Disease.prototype.addTxtNbr = function() {
  13479. this.txtNbr = new createjs.Text(this.speed, '20px Arial', '#FFFFFF').set({
  13480. x: this.x,
  13481. y: this.y + 7,
  13482. textAlign: 'center',
  13483. textBaseline: 'alphabetic'
  13484. });
  13485. return gameStage.addChild(this.txtNbr);
  13486. };
  13487. return Disease;
  13488. })(createjs.Container);
  13489. }).call(this);
  13490. /*
  13491. * Copyright © Romain Fouquet, 2012-2015
  13492. * Copyright © Clément Joly, 2012-2015
  13493. #
  13494. * romain.fouquet18@gmail.com
  13495. * leowzukw@vmail.me
  13496. #
  13497. * This file is part of Diseases Killer Academy.
  13498. #
  13499. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13500. * it under the terms of the GNU Affero General Public License as published by
  13501. * the Free Software Foundation, either version 3 of the License, or
  13502. * (at your option) any later version.
  13503. #
  13504. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13505. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13506. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13507. * GNU Affero General Public License for more details.
  13508. #
  13509. * You should have received a copy of the GNU Affero General Public License
  13510. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13511. */
  13512. (function() {
  13513. 'use strict';
  13514. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13515. hasProp = {}.hasOwnProperty;
  13516. dka.DiseaseBacterium = (function(superClass) {
  13517. extend(DiseaseBacterium, superClass);
  13518. function DiseaseBacterium(level, road, path, isDaughter, mother) {
  13519. var malus;
  13520. DiseaseBacterium.__super__.constructor.call(this, level, road, path);
  13521. this.type = 'Bacterium';
  13522. malus = level.getHospital().getAbilityResult('education', this);
  13523. this.delayToMultiplicate = level.settings.diseases[this.diseaseName].delayToMultiplicate + (malus ? malus : 0) + (Math.random() * 50) | 0;
  13524. this.waitToMultipicate = 0;
  13525. this.canMultiplicate = true;
  13526. this.on('mouseover', function() {
  13527. return console.log(this.delayToMultiplicate);
  13528. });
  13529. if (isDaughter) {
  13530. this.daughter = true;
  13531. this.growingState = true;
  13532. this.delayToMultiplicate *= 2;
  13533. this.rotation = mother.rotation;
  13534. this.speed = mother.speed;
  13535. this.pointToReach = mother.pointToReach;
  13536. this.distanceTraveled = mother.distanceTraveled;
  13537. this.distanceToExit = mother.distanceToExit;
  13538. this.wave = mother.wave;
  13539. this.put(new createjs.Point(mother.x, mother.y));
  13540. }
  13541. }
  13542. DiseaseBacterium.prototype.tick = function() {
  13543. if (this.canMultiplicate && this.level.moveDiseases) {
  13544. this.waitToMultipicate++;
  13545. if (this.waitToMultipicate >= this.delayToMultiplicate) {
  13546. this.waitToMultipicate = 0;
  13547. this.addSmallDisease();
  13548. }
  13549. }
  13550. if (this.daughter && this.growingState) {
  13551. if (this.braked) {
  13552. this.growingState = false;
  13553. }
  13554. if (this.speed === this.initialSpeed) {
  13555. this.speed *= 0.5;
  13556. } else {
  13557. this.speed += 0.01;
  13558. if (this.speed >= this.initialSpeed) {
  13559. this.speed = this.initialSpeed;
  13560. this.growingState = false;
  13561. }
  13562. }
  13563. }
  13564. return DiseaseBacterium.__super__.tick.call(this);
  13565. };
  13566. DiseaseBacterium.prototype.addSmallDisease = function() {
  13567. var disease;
  13568. disease = new dka['Disease' + this.diseaseName](this.level, this.road, this.path, true, this);
  13569. this.parent.addChildAt(disease, this.parent.getChildIndex(this));
  13570. return this.wave.diseasesSpawned++;
  13571. };
  13572. DiseaseBacterium.prototype.preventMultiplication = function() {
  13573. return this.canMultiplicate = false;
  13574. };
  13575. DiseaseBacterium.prototype.educate = function(malus) {
  13576. return this.delayToMultiplicate = this.delayToMultiplicate + malus;
  13577. };
  13578. return DiseaseBacterium;
  13579. })(dka.Disease);
  13580. }).call(this);
  13581. /*
  13582. * Copyright © Romain Fouquet, 2012-2015
  13583. * Copyright © Clément Joly, 2012-2015
  13584. #
  13585. * romain.fouquet18@gmail.com
  13586. * leowzukw@vmail.me
  13587. #
  13588. * This file is part of Diseases Killer Academy.
  13589. #
  13590. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13591. * it under the terms of the GNU Affero General Public License as published by
  13592. * the Free Software Foundation, either version 3 of the License, or
  13593. * (at your option) any later version.
  13594. #
  13595. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13596. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13597. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13598. * GNU Affero General Public License for more details.
  13599. #
  13600. * You should have received a copy of the GNU Affero General Public License
  13601. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13602. */
  13603. (function() {
  13604. 'use strict';
  13605. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13606. hasProp = {}.hasOwnProperty;
  13607. dka.DiseaseVirus = (function(superClass) {
  13608. extend(DiseaseVirus, superClass);
  13609. function DiseaseVirus(level, road, path) {
  13610. DiseaseVirus.__super__.constructor.call(this, level, road, path);
  13611. this.type = 'Virus';
  13612. }
  13613. DiseaseVirus.prototype.tick = function() {
  13614. return DiseaseVirus.__super__.tick.call(this);
  13615. };
  13616. return DiseaseVirus;
  13617. })(dka.Disease);
  13618. }).call(this);
  13619. /*
  13620. * Copyright © Romain Fouquet, 2012-2015
  13621. * Copyright © Clément Joly, 2012-2015
  13622. #
  13623. * romain.fouquet18@gmail.com
  13624. * leowzukw@vmail.me
  13625. #
  13626. * This file is part of Diseases Killer Academy.
  13627. #
  13628. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13629. * it under the terms of the GNU Affero General Public License as published by
  13630. * the Free Software Foundation, either version 3 of the License, or
  13631. * (at your option) any later version.
  13632. #
  13633. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13634. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13635. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13636. * GNU Affero General Public License for more details.
  13637. #
  13638. * You should have received a copy of the GNU Affero General Public License
  13639. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13640. */
  13641. (function() {
  13642. 'use strict';
  13643. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13644. hasProp = {}.hasOwnProperty;
  13645. dka.DiseaseHIV = (function(superClass) {
  13646. extend(DiseaseHIV, superClass);
  13647. function DiseaseHIV(level, road, path) {
  13648. this.diseaseName = 'HIV';
  13649. DiseaseHIV.__super__.constructor.call(this, level, road, path);
  13650. this.sprite.spriteSheet = dka.academy.assetManager.getAsset('sHIV');
  13651. this.maxAntibodies = 4;
  13652. this.radius = 9;
  13653. }
  13654. return DiseaseHIV;
  13655. })(dka.DiseaseVirus);
  13656. }).call(this);
  13657. /*
  13658. * Copyright © Romain Fouquet, 2012-2015
  13659. * Copyright © Clément Joly, 2012-2015
  13660. #
  13661. * romain.fouquet18@gmail.com
  13662. * leowzukw@vmail.me
  13663. #
  13664. * This file is part of Diseases Killer Academy.
  13665. #
  13666. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13667. * it under the terms of the GNU Affero General Public License as published by
  13668. * the Free Software Foundation, either version 3 of the License, or
  13669. * (at your option) any later version.
  13670. #
  13671. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13672. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13673. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13674. * GNU Affero General Public License for more details.
  13675. #
  13676. * You should have received a copy of the GNU Affero General Public License
  13677. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13678. */
  13679. (function() {
  13680. 'use strict';
  13681. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13682. hasProp = {}.hasOwnProperty;
  13683. dka.DiseasePlague = (function(superClass) {
  13684. extend(DiseasePlague, superClass);
  13685. function DiseasePlague(level, road, path, isDaughter, mother) {
  13686. this.diseaseName = 'Plague';
  13687. DiseasePlague.__super__.constructor.call(this, level, road, path, isDaughter, mother);
  13688. this.sprite.spriteSheet = dka.academy.assetManager.getAsset('sPlague');
  13689. this.maxAntibodies = 3;
  13690. this.radius = 9;
  13691. }
  13692. return DiseasePlague;
  13693. })(dka.DiseaseBacterium);
  13694. }).call(this);
  13695. /*
  13696. * Copyright © Romain Fouquet, 2012-2015
  13697. * Copyright © Clément Joly, 2012-2015
  13698. #
  13699. * romain.fouquet18@gmail.com
  13700. * leowzukw@vmail.me
  13701. #
  13702. * This file is part of Diseases Killer Academy.
  13703. #
  13704. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13705. * it under the terms of the GNU Affero General Public License as published by
  13706. * the Free Software Foundation, either version 3 of the License, or
  13707. * (at your option) any later version.
  13708. #
  13709. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13710. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13711. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13712. * GNU Affero General Public License for more details.
  13713. #
  13714. * You should have received a copy of the GNU Affero General Public License
  13715. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13716. */
  13717. (function() {
  13718. 'use strict';
  13719. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13720. hasProp = {}.hasOwnProperty;
  13721. dka.DiseaseTuberculosis = (function(superClass) {
  13722. extend(DiseaseTuberculosis, superClass);
  13723. function DiseaseTuberculosis(level, road, path, isDaughter, mother) {
  13724. this.diseaseName = 'Tuberculosis';
  13725. DiseaseTuberculosis.__super__.constructor.call(this, level, road, path, isDaughter, mother);
  13726. this.sprite.spriteSheet = dka.academy.assetManager.getAsset('sTuberculosis');
  13727. this.maxAntibodies = 3;
  13728. this.radius = 9;
  13729. }
  13730. return DiseaseTuberculosis;
  13731. })(dka.DiseaseBacterium);
  13732. }).call(this);
  13733. /*
  13734. * Copyright © Romain Fouquet, 2012-2015
  13735. * Copyright © Clément Joly, 2012-2015
  13736. #
  13737. * romain.fouquet18@gmail.com
  13738. * leowzukw@vmail.me
  13739. #
  13740. * This file is part of Diseases Killer Academy.
  13741. #
  13742. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13743. * it under the terms of the GNU Affero General Public License as published by
  13744. * the Free Software Foundation, either version 3 of the License, or
  13745. * (at your option) any later version.
  13746. #
  13747. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13748. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13749. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13750. * GNU Affero General Public License for more details.
  13751. #
  13752. * You should have received a copy of the GNU Affero General Public License
  13753. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13754. */
  13755. (function() {
  13756. 'use strict';
  13757. dka.Game = (function() {
  13758. function Game() {
  13759. this.autopause = true;
  13760. this.settings = new dka.GameSettings();
  13761. this.labs = new dka.Labs(this);
  13762. this.knownDiseases = [];
  13763. this.playerGold = [];
  13764. this.usedGold = 0;
  13765. createjs.Sound.stop();
  13766. if (localStorage) {
  13767. if (localStorage.getItem('muted') === 'true') {
  13768. createjs.Sound.setMute(1);
  13769. }
  13770. if (localStorage.getItem('autopause') === 'false') {
  13771. this.autopause = false;
  13772. }
  13773. }
  13774. this.restore();
  13775. }
  13776. Game.prototype.restore = function() {
  13777. var serialized;
  13778. serialized = dka.academy.dataManager.retrieveLevelProgress();
  13779. if (!serialized) {
  13780. return;
  13781. }
  13782. this.knownDiseases = serialized.knownDiseases;
  13783. this.playerGold = serialized.playerGold;
  13784. return this.usedGold = serialized.usedGold;
  13785. };
  13786. Game.prototype.serialize = function() {
  13787. var serialized;
  13788. serialized = {};
  13789. serialized.knownDiseases = this.knownDiseases;
  13790. serialized.playerGold = this.playerGold;
  13791. serialized.usedGold = this.usedGold;
  13792. return JSON.stringify(serialized);
  13793. };
  13794. Game.prototype.launchLevel = function(level) {
  13795. var ref;
  13796. gameStage.removeAllChildren();
  13797. if ((ref = this.currentLevel) != null) {
  13798. ref.removeLevelTicker();
  13799. }
  13800. dka.academy.removeBlurEvent();
  13801. this.currentLevel = new dka['Level' + level](this);
  13802. return gameStage.addChild(this.currentLevel);
  13803. };
  13804. Game.prototype.addGold = function(gold, level) {
  13805. var gain;
  13806. if (this.playerGold.length === level) {
  13807. this.playerGold.push(0);
  13808. }
  13809. gain = gold - this.playerGold[level];
  13810. if (gain > 0) {
  13811. this.playerGold[level] += gain;
  13812. }
  13813. return dka.academy.dataManager.saveLevelProgress();
  13814. };
  13815. Game.prototype.removeGold = function(gold) {
  13816. this.usedGold += gold;
  13817. return dka.academy.dataManager.saveLevelProgress();
  13818. };
  13819. Game.prototype.resetGold = function() {
  13820. this.usedGold = 0;
  13821. return dka.academy.dataManager.saveLevelProgress();
  13822. };
  13823. Game.prototype.getTotalGold = function() {
  13824. var gold, i, len, ref, total;
  13825. if (this.playerGold.length === 0) {
  13826. return 0;
  13827. }
  13828. total = 0;
  13829. ref = this.playerGold;
  13830. for (i = 0, len = ref.length; i < len; i++) {
  13831. gold = ref[i];
  13832. total += gold;
  13833. }
  13834. return total - this.usedGold;
  13835. };
  13836. return Game;
  13837. })();
  13838. }).call(this);
  13839. /*
  13840. * Copyright © Romain Fouquet, 2012-2015
  13841. * Copyright © Clément Joly, 2012-2015
  13842. #
  13843. * romain.fouquet18@gmail.com
  13844. * leowzukw@vmail.me
  13845. #
  13846. * This file is part of Diseases Killer Academy.
  13847. *
  13848. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13849. * it under the terms of the GNU Affero General Public License as published by
  13850. * the Free Software Foundation, either version 3 of the License, or
  13851. * (at your option) any later version.
  13852. *
  13853. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13854. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13855. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13856. * GNU Affero General Public License for more details.
  13857. *
  13858. * You should have received a copy of the GNU Affero General Public License
  13859. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13860. */
  13861. (function() {
  13862. 'use strict';
  13863. dka.AssetManager = (function() {
  13864. function AssetManager() {
  13865. this._assets = {};
  13866. }
  13867. AssetManager.prototype.addAsset = function(assetName, asset) {
  13868. if (assetName && asset) {
  13869. return this._assets[assetName] = asset;
  13870. }
  13871. };
  13872. AssetManager.prototype.getAsset = function(assetName) {
  13873. if (assetName) {
  13874. return this._assets[assetName];
  13875. }
  13876. };
  13877. return AssetManager;
  13878. })();
  13879. }).call(this);
  13880. /*
  13881. * Copyright © Romain Fouquet, 2012-2015
  13882. * Copyright © Clément Joly, 2012-2015
  13883. #
  13884. * romain.fouquet18@gmail.com
  13885. * leowzukw@vmail.me
  13886. #
  13887. * This file is part of Diseases Killer Academy.
  13888. #
  13889. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  13890. * it under the terms of the GNU Affero General Public License as published by
  13891. * the Free Software Foundation, either version 3 of the License, or
  13892. * (at your option) any later version.
  13893. #
  13894. * Diseases Killer Academy is distributed in the hope that it will be useful,
  13895. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13896. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13897. * GNU Affero General Public License for more details.
  13898. #
  13899. * You should have received a copy of the GNU Affero General Public License
  13900. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  13901. */
  13902. (function() {
  13903. 'use strict';
  13904. dka.SpriteSheets = (function() {
  13905. function SpriteSheets() {
  13906. this._spriteSheets = {};
  13907. }
  13908. SpriteSheets.prototype.spriteSheets = function() {
  13909. this._spriteSheets.spriteSyringue = {
  13910. images: [dka.academy.assetManager.getAsset('syringueSP')],
  13911. frames: {
  13912. width: 32,
  13913. height: 32,
  13914. regY: 32
  13915. },
  13916. animations: {
  13917. press: [0, 8]
  13918. }
  13919. };
  13920. this._spriteSheets.sMysterious = {
  13921. images: [dka.academy.assetManager.getAsset('mysterious')],
  13922. frames: {
  13923. width: 32,
  13924. height: 32,
  13925. regX: 16,
  13926. regY: 16
  13927. }
  13928. };
  13929. this._spriteSheets.sHIV = {
  13930. images: [dka.academy.assetManager.getAsset('HIV')],
  13931. frames: {
  13932. width: 32,
  13933. height: 32,
  13934. regX: 16,
  13935. regY: 16
  13936. },
  13937. animations: {
  13938. move: [0, 0]
  13939. }
  13940. };
  13941. this._spriteSheets.sPlague = {
  13942. images: [dka.academy.assetManager.getAsset('Plague')],
  13943. frames: {
  13944. width: 32,
  13945. height: 32,
  13946. regX: 16,
  13947. regY: 16
  13948. },
  13949. animations: {
  13950. move: [0, 0]
  13951. }
  13952. };
  13953. this._spriteSheets.sTuberculosis = {
  13954. images: [dka.academy.assetManager.getAsset('Tuberculosis')],
  13955. frames: {
  13956. width: 30,
  13957. height: 30,
  13958. regX: 15,
  13959. regY: 15
  13960. },
  13961. animations: {
  13962. move: [0, 0]
  13963. }
  13964. };
  13965. this._spriteSheets.spriteDiseaseSplash = {
  13966. images: [dka.academy.assetManager.getAsset('DiseaseSplash')],
  13967. frames: {
  13968. width: 24,
  13969. height: 24,
  13970. regX: 12,
  13971. regY: 12
  13972. }
  13973. };
  13974. this._spriteSheets.spriteTower = {
  13975. images: [dka.academy.assetManager.getAsset('Tour2')],
  13976. frames: {
  13977. width: 48,
  13978. height: 48,
  13979. regX: 24,
  13980. regY: 24
  13981. },
  13982. animations: {
  13983. fire: [0, 0]
  13984. }
  13985. };
  13986. this._spriteSheets.TowerPill = {
  13987. images: [dka.academy.assetManager.getAsset('towerPill')],
  13988. frames: {
  13989. width: 48,
  13990. height: 48,
  13991. regX: 24,
  13992. regY: 9
  13993. },
  13994. animations: {
  13995. fire: [0, 0]
  13996. }
  13997. };
  13998. this._spriteSheets.spriteTowerCellB = {
  13999. images: [dka.academy.assetManager.getAsset('TowerCellB0')],
  14000. frames: {
  14001. width: 48,
  14002. height: 48,
  14003. regX: 24,
  14004. regY: 24
  14005. },
  14006. animations: {
  14007. fire: [0, 0]
  14008. }
  14009. };
  14010. this._spriteSheets.spriteTowerCellMacrophage = {
  14011. images: [dka.academy.assetManager.getAsset('TowerCellMacrophage')],
  14012. frames: {
  14013. width: 48,
  14014. height: 48,
  14015. regX: 24,
  14016. regY: 24
  14017. },
  14018. animations: {
  14019. fire: [0, 0]
  14020. }
  14021. };
  14022. this._spriteSheets.spriteCellB = {
  14023. images: [dka.academy.assetManager.getAsset('CellB1')],
  14024. frames: {
  14025. width: 16,
  14026. height: 16,
  14027. regX: 8,
  14028. regY: 8
  14029. },
  14030. animations: {
  14031. move: [0, 0, 'move'],
  14032. attack: [0, 0, 'move']
  14033. }
  14034. };
  14035. this._spriteSheets.spriteTCellPatrol = {
  14036. images: [dka.academy.assetManager.getAsset('TCellPatrol1')],
  14037. frames: {
  14038. width: 16,
  14039. height: 16,
  14040. regX: 8,
  14041. regY: 8
  14042. },
  14043. animations: {
  14044. move: [0, 0, 'move'],
  14045. attack: [0, 0, 'move']
  14046. }
  14047. };
  14048. this._spriteSheets.spriteTablet = {
  14049. images: [dka.academy.assetManager.getAsset('Tablet')],
  14050. frames: {
  14051. width: 12,
  14052. height: 12,
  14053. regX: 6,
  14054. regY: 6
  14055. },
  14056. animations: {
  14057. touch: [0, 0, 'touch']
  14058. }
  14059. };
  14060. this._spriteSheets.spCapsule = {
  14061. images: [dka.academy.assetManager.getAsset('Capsule')],
  14062. frames: {
  14063. width: 20,
  14064. height: 14,
  14065. regX: 10,
  14066. regY: 7
  14067. }
  14068. };
  14069. this._spriteSheets.spCapsuleSmoke = {
  14070. images: [dka.academy.assetManager.getAsset('CapsuleSmoke')],
  14071. frames: {
  14072. width: 50,
  14073. height: 50,
  14074. regX: 25,
  14075. regY: 25
  14076. }
  14077. };
  14078. this._spriteSheets.spriteTabletSmoke = {
  14079. images: [dka.academy.assetManager.getAsset('TabletSmoke')],
  14080. frames: {
  14081. width: 12,
  14082. height: 12,
  14083. regX: 6,
  14084. regY: 6
  14085. }
  14086. };
  14087. this._spriteSheets.spriteBulletEffect = {
  14088. images: [dka.academy.assetManager.getAsset('SyringueEff1')],
  14089. frames: {
  14090. width: 8,
  14091. height: 8,
  14092. regX: 4,
  14093. regY: 4
  14094. },
  14095. animations: {
  14096. boum: [0, 2]
  14097. }
  14098. };
  14099. this._spriteSheets.sMuteSettingsBP = {
  14100. images: [dka.academy.assetManager.getAsset('MuteSettingsBP')],
  14101. frames: {
  14102. width: 40,
  14103. height: 40,
  14104. regX: 20,
  14105. regY: 20
  14106. }
  14107. };
  14108. this._spriteSheets.sAutopauseSettingsBP = {
  14109. images: [dka.academy.assetManager.getAsset('AutopauseSettingsBP')],
  14110. frames: {
  14111. width: 40,
  14112. height: 40,
  14113. regX: 20,
  14114. regY: 20
  14115. },
  14116. animations: {
  14117. out: [0, 0, 'out'],
  14118. over: [1, 1, 'over'],
  14119. down: [2, 2, 'down']
  14120. }
  14121. };
  14122. this._spriteSheets.spriteVaccineStain = {
  14123. images: [dka.academy.assetManager.getAsset('VaccineStain')],
  14124. frames: {
  14125. width: 64,
  14126. height: 64,
  14127. regX: 32,
  14128. regY: 32
  14129. },
  14130. animations: {
  14131. spread: [0, 3]
  14132. }
  14133. };
  14134. return this._spriteSheets.spriteMenuButton = {
  14135. images: [dka.academy.assetManager.getAsset('bpMenu')],
  14136. frames: {
  14137. width: 44,
  14138. height: 53,
  14139. regX: 22,
  14140. regY: 19
  14141. }
  14142. };
  14143. };
  14144. SpriteSheets.prototype.build = function() {
  14145. var results, spriteName;
  14146. this.spriteSheets();
  14147. results = [];
  14148. for (spriteName in this._spriteSheets) {
  14149. results.push(dka.academy.assetManager.addAsset(spriteName, new createjs.SpriteSheet(this._spriteSheets[spriteName])));
  14150. }
  14151. return results;
  14152. };
  14153. return SpriteSheets;
  14154. })();
  14155. }).call(this);
  14156. /*
  14157. * Copyright © Romain Fouquet, 2012-2015
  14158. * Copyright © Clément Joly, 2012-2015
  14159. #
  14160. * romain.fouquet18@gmail.com
  14161. * leowzukw@vmail.me
  14162. #
  14163. * This file is part of Diseases Killer Academy.
  14164. #
  14165. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  14166. * it under the terms of the GNU Affero General Public License as published by
  14167. * the Free Software Foundation, either version 3 of the License, or
  14168. * (at your option) any later version.
  14169. #
  14170. * Diseases Killer Academy is distributed in the hope that it will be useful,
  14171. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14172. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14173. * GNU Affero General Public License for more details.
  14174. #
  14175. * You should have received a copy of the GNU Affero General Public License
  14176. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  14177. */
  14178. (function() {
  14179. 'use strict';
  14180. var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  14181. hasProp = {}.hasOwnProperty;
  14182. dka.LoadingClock = (function(superClass) {
  14183. extend(LoadingClock, superClass);
  14184. function LoadingClock() {
  14185. LoadingClock.__super__.constructor.call(this);
  14186. this.set({
  14187. x: canvasWidth / 2,
  14188. y: canvasHeight / 2
  14189. });
  14190. this.hourHand = new createjs.Shape();
  14191. this.hourHand.graphics.setStrokeStyle(5, 1).beginStroke(dka.colors.darkBlue).drawCircle(0, 0, 10).moveTo(0, -10).lineTo(0, -100);
  14192. this.minuteHand = new createjs.Shape();
  14193. this.minuteHand.graphics.setStrokeStyle(5, 1).beginStroke(dka.colors.lightBlue).drawCircle(0, 0, 20).moveTo(0, -20).lineTo(0, -150);
  14194. this.timeText = (new createjs.Text('0 %', '30px karnivoreRegular,Arial', dka.colors.darkBlue)).set({
  14195. y: 200,
  14196. textAlign: 'center',
  14197. textBaseline: 'alphabetic'
  14198. });
  14199. this.addChild(this.hourHand, this.minuteHand, this.timeText);
  14200. }
  14201. LoadingClock.prototype.update = function(progress) {
  14202. this.hourHand.rotation = -360 * progress;
  14203. this.minuteHand.rotation = -360 * 12 * progress;
  14204. return this.timeText.text = ((progress * 100) | 0) + ' %';
  14205. };
  14206. return LoadingClock;
  14207. })(createjs.Container);
  14208. }).call(this);
  14209. /*
  14210. * Copyright © Romain Fouquet, 2012-2015
  14211. * Copyright © Clément Joly, 2012-2015
  14212. #
  14213. * romain.fouquet18@gmail.com
  14214. * leowzukw@vmail.me
  14215. #
  14216. * This file is part of Diseases Killer Academy.
  14217. #
  14218. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  14219. * it under the terms of the GNU Affero General Public License as published by
  14220. * the Free Software Foundation, either version 3 of the License, or
  14221. * (at your option) any later version.
  14222. #
  14223. * Diseases Killer Academy is distributed in the hope that it will be useful,
  14224. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14225. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14226. * GNU Affero General Public License for more details.
  14227. #
  14228. * You should have received a copy of the GNU Affero General Public License
  14229. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  14230. */
  14231. (function() {
  14232. 'use strict';
  14233. dka.Loader = (function() {
  14234. function Loader() {
  14235. this.fileManifest = [
  14236. {
  14237. src: 'enemies/DiseaseSplash.png'
  14238. }, {
  14239. src: 'enemies/Plague.png'
  14240. }, {
  14241. src: 'FEL/felSplash.png'
  14242. }, {
  14243. src: 'FEL/electron.png'
  14244. }, {
  14245. src: 'enemies/HIV.png'
  14246. }, {
  14247. src: 'enemies/Tuberculosis.png'
  14248. }, {
  14249. src: 'labs/waveFlag1.png'
  14250. }, {
  14251. src: 'labs/vaccine1.png'
  14252. }, {
  14253. src: 'labs/fever1.png'
  14254. }, {
  14255. src: 'labs/back.png'
  14256. }, {
  14257. src: 'labs/reset.png'
  14258. }, {
  14259. src: 'labs/undo.png'
  14260. }, {
  14261. src: 'timeline/timeline.png'
  14262. }, {
  14263. src: 'timeline/clock.png'
  14264. }, {
  14265. src: 'timeline/level0Bp.png'
  14266. }, {
  14267. src: 'timeline/labsBp.png'
  14268. }, {
  14269. src: 'timeline/creditsBp.png'
  14270. }, {
  14271. src: 'interface/capsuleBP.png'
  14272. }, {
  14273. src: 'interface/tabletBP.png'
  14274. }, {
  14275. src: 'interface/credits.png'
  14276. }, {
  14277. src: 'interface/BaseBP1.png'
  14278. }, {
  14279. src: 'interface/tutoBack.png'
  14280. }, {
  14281. src: 'interface/tutoSplash1.png'
  14282. }, {
  14283. src: 'interface/tutoSplash2.png'
  14284. }, {
  14285. src: 'interface/nextButton.png'
  14286. }, {
  14287. src: 'interface/closeButton.png'
  14288. }, {
  14289. src: 'interface/bpStart.png'
  14290. }, {
  14291. src: 'interface/BCell.png'
  14292. }, {
  14293. src: 'interface/pauseBck.png'
  14294. }, {
  14295. src: 'interface/MacroCell.png'
  14296. }, {
  14297. src: 'interface/bpMenu.png'
  14298. }, {
  14299. src: 'interface/menuStartBg.png'
  14300. }, {
  14301. src: 'interface/pauseButtonHolder.png'
  14302. }, {
  14303. src: 'interface/callWave.png'
  14304. }, {
  14305. src: 'interface/coinHud.png'
  14306. }, {
  14307. src: 'interface/dnaHud.png'
  14308. }, {
  14309. src: 'interface/waveHud.png'
  14310. }, {
  14311. src: 'interface/educ.png'
  14312. }, {
  14313. src: 'interface/subsidies.png'
  14314. }, {
  14315. src: 'interface/tutoBubbleSmall.png'
  14316. }, {
  14317. src: 'interface/tutoBubbleLarge.png'
  14318. }, {
  14319. src: 'interface/feverHalo.png'
  14320. }, {
  14321. src: 'interface/gradhat.png'
  14322. }, {
  14323. src: 'interface/lifeIco.png'
  14324. }, {
  14325. src: 'interface/speedIco.png'
  14326. }, {
  14327. src: 'interface/lifeCostIco.png'
  14328. }, {
  14329. src: 'interface/virusBar.png'
  14330. }, {
  14331. src: 'interface/bacteriumBar.png'
  14332. }, {
  14333. src: 'interface/hexMenu.png'
  14334. }, {
  14335. src: 'interface/hudBar.png'
  14336. }, {
  14337. src: 'interface/msgBalloon.png'
  14338. }, {
  14339. src: 'interface/LevelsBP.png'
  14340. }, {
  14341. src: 'interface/lifeHud.png'
  14342. }, {
  14343. src: 'interface/SettingsPauseBP.png'
  14344. }, {
  14345. src: 'interface/LevelsPauseBP.png'
  14346. }, {
  14347. src: 'interface/RetryPauseBP.png'
  14348. }, {
  14349. src: 'interface/MuteSettingsBP.png'
  14350. }, {
  14351. src: 'interface/AutopauseSettingsBP.png'
  14352. }, {
  14353. src: 'interface/vaccineBP.png'
  14354. }, {
  14355. src: 'interface/mysterious.png'
  14356. }, {
  14357. src: 'interface/leftCorner.png'
  14358. }, {
  14359. src: 'interface/border.png'
  14360. }, {
  14361. src: 'interface/PauseBP.png'
  14362. }, {
  14363. src: 'interface/EncyclopediaBP.png'
  14364. }, {
  14365. src: 'interface/encyclopediaBk.png'
  14366. }, {
  14367. src: 'interface/syringueSP.png'
  14368. }, {
  14369. src: 'interface/feverBP.png'
  14370. }, {
  14371. src: 'interface/TryAgainBP.png'
  14372. }, {
  14373. src: 'interface/VaccineStain.png'
  14374. }, {
  14375. src: 'interface/tutoBg.png'
  14376. }, {
  14377. src: 'interface/goalMarker.png'
  14378. }, {
  14379. src: 'levels/FondTest3.png'
  14380. }, {
  14381. src: 'levels/map0.png'
  14382. }, {
  14383. src: 'levels/hospital0.png'
  14384. }, {
  14385. src: 'towers/antibodyIgA.png'
  14386. }, {
  14387. src: 'towers/antibodyIgG.png'
  14388. }, {
  14389. src: 'towers/antibodyIgM.png'
  14390. }, {
  14391. src: 'towers/Capsule.png'
  14392. }, {
  14393. src: 'towers/CapsuleSmoke.png'
  14394. }, {
  14395. src: 'towers/CellB1.png'
  14396. }, {
  14397. src: 'towers/CellMacrophage.png'
  14398. }, {
  14399. src: 'interface/crateBP.png'
  14400. }, {
  14401. src: 'towers/towerLocation.png'
  14402. }, {
  14403. src: 'towers/ReloadBP.png'
  14404. }, {
  14405. src: 'towers/Syringue1.png'
  14406. }, {
  14407. src: 'towers/SyringueEff1.png'
  14408. }, {
  14409. src: 'towers/Tablet.png'
  14410. }, {
  14411. src: 'towers/TabletSmoke.png'
  14412. }, {
  14413. src: 'towers/towerPill.png'
  14414. }, {
  14415. src: 'towers/TCellPatrol1.png'
  14416. }, {
  14417. src: 'towers/Tour2.png'
  14418. }, {
  14419. src: 'towers/TowerCellB0.png'
  14420. }, {
  14421. src: 'towers/TowerCellMacrophage.png'
  14422. }, {
  14423. src: 'interface/upgradeDnaBP.png'
  14424. }, {
  14425. src: 'interface/upgradeGoldBP.png'
  14426. }
  14427. ];
  14428. this.load();
  14429. }
  14430. Loader.prototype.load = function() {
  14431. var queue;
  14432. this.clock = gameStage.addChild(new dka.LoadingClock());
  14433. dka.academy.addStageTicker();
  14434. queue = this.queue = new createjs.LoadQueue(true, 'dist/assets/');
  14435. queue.installPlugin(createjs.Sound);
  14436. createjs.Sound.alternateExtensions = ['mp3'];
  14437. queue.on('progress', this.handleProgress, this);
  14438. queue.on('complete', this.handleComplete, this);
  14439. queue.on('error', this.handleError, this);
  14440. return queue.loadManifest(this.fileManifest);
  14441. };
  14442. Loader.prototype.handleProgress = function(e) {
  14443. return this.clock.update(e.progress);
  14444. };
  14445. Loader.prototype.handleComplete = function(e) {
  14446. gameStage.removeAllChildren();
  14447. gameStage.enableMouseOver(20);
  14448. gameStage.mouseMoveOutside = true;
  14449. this.initResources();
  14450. return dka.academy.launchMagic();
  14451. };
  14452. Loader.prototype.handleError = function(e) {
  14453. return console.log('Error Loader: ' + e.item.src);
  14454. };
  14455. Loader.prototype.initResources = function() {
  14456. var asset, assetName;
  14457. for (asset in this.fileManifest) {
  14458. assetName = this.fileManifest[asset].src.match(/[^\/]*$/)[0].split('.')[0];
  14459. dka.academy.assetManager.addAsset(assetName, this.queue.getResult(this.fileManifest[asset].src));
  14460. }
  14461. return (new dka.SpriteSheets).build();
  14462. };
  14463. return Loader;
  14464. })();
  14465. }).call(this);
  14466. /*
  14467. * Copyright © Romain Fouquet, 2012-2015
  14468. * Copyright © Clément Joly, 2012-2015
  14469. #
  14470. * romain.fouquet18@gmail.com
  14471. * leowzukw@vmail.me
  14472. #
  14473. * This file is part of Diseases Killer Academy.
  14474. #
  14475. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  14476. * it under the terms of the GNU Affero General Public License as published by
  14477. * the Free Software Foundation, either version 3 of the License, or
  14478. * (at your option) any later version.
  14479. #
  14480. * Diseases Killer Academy is distributed in the hope that it will be useful,
  14481. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14482. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14483. * GNU Affero General Public License for more details.
  14484. #
  14485. * You should have received a copy of the GNU Affero General Public License
  14486. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  14487. */
  14488. (function() {
  14489. 'use strict';
  14490. dka.Academy = (function() {
  14491. function Academy() {
  14492. dka.academy = this;
  14493. this.LEVEL_NUMBER = 1;
  14494. this.loader = new dka.Loader();
  14495. this.dataManager = new dka.DataManager();
  14496. this.assetManager = new dka.AssetManager();
  14497. this.soundManager = new dka.SoundManager();
  14498. }
  14499. Academy.prototype.addStageTicker = function() {
  14500. return createjs.Ticker.addEventListener('tick', gameStage);
  14501. };
  14502. Academy.prototype.removeStageTicker = function() {
  14503. return createjs.Ticker.removeEventListener('tick', gameStage);
  14504. };
  14505. Academy.prototype.addBlurEvent = function(func) {
  14506. this.blurFunc = func;
  14507. return window.addEventListener('blur', func);
  14508. };
  14509. Academy.prototype.removeBlurEvent = function() {
  14510. return window.removeEventListener('blur', this.blurFunc);
  14511. };
  14512. Academy.prototype.showFEL = function() {
  14513. gameStage.removeAllChildren();
  14514. return gameStage.addChild(new dka.ScreenFEL());
  14515. };
  14516. Academy.prototype.launchMagic = function() {
  14517. gameStage.removeAllChildren();
  14518. if (LEVEL_MODE) {
  14519. this.launchGame();
  14520. return this.game.launchLevel(0);
  14521. } else {
  14522. if (TIMELINE_MODE) {
  14523. return this.launchGame();
  14524. } else {
  14525. return gameStage.addChild(new dka.ScreenStart());
  14526. }
  14527. }
  14528. };
  14529. Academy.prototype.launchGame = function() {
  14530. gameStage.removeAllChildren();
  14531. this.game = new dka.Game();
  14532. return dka.academy.showTimeline();
  14533. };
  14534. Academy.prototype.showTimeline = function() {
  14535. var ref;
  14536. gameStage.removeAllChildren();
  14537. if ((ref = this.game.currentLevel) != null) {
  14538. ref.removeLevelTicker();
  14539. }
  14540. this.game.currentLevel = null;
  14541. this.removeBlurEvent();
  14542. return gameStage.addChild(new dka.ScreenTimeline());
  14543. };
  14544. Academy.prototype.showCredits = function() {
  14545. return gameStage.addChild(new dka.ScreenCredits());
  14546. };
  14547. Academy.prototype.gotoLabs = function(timeline) {
  14548. return gameStage.addChild(new dka.ScreenLabs(timeline));
  14549. };
  14550. Academy.prototype.fullScreen = function() {
  14551. var canvas;
  14552. canvas = document.getElementById('gameCanvas');
  14553. if (canvas.requestFullScreen) {
  14554. return canvas.requestFullScreen();
  14555. } else if (canvas.webkitRequestFullScreen) {
  14556. return canvas.webkitRequestFullScreen(canvas.ALLOW_KEYBOARD_INPUT);
  14557. } else if (canvas.mozRequestFullScreen) {
  14558. return canvas.mozRequestFullScreen();
  14559. } else {
  14560. return alert('Sorry, your browser does not support fullscreen mode.');
  14561. }
  14562. };
  14563. return Academy;
  14564. })();
  14565. }).call(this);
  14566. /*
  14567. * Copyright © Romain Fouquet, 2012-2015
  14568. * Copyright © Clément Joly, 2012-2015
  14569. #
  14570. * romain.fouquet18@gmail.com
  14571. * leowzukw@vmail.me
  14572. #
  14573. * This file is part of Diseases Killer Academy.
  14574. #
  14575. * Diseases Killer Academy is free software: you can redistribute it and/or modify
  14576. * it under the terms of the GNU Affero General Public License as published by
  14577. * the Free Software Foundation, either version 3 of the License, or
  14578. * (at your option) any later version.
  14579. #
  14580. * Diseases Killer Academy is distributed in the hope that it will be useful,
  14581. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14582. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14583. * GNU Affero General Public License for more details.
  14584. #
  14585. * You should have received a copy of the GNU Affero General Public License
  14586. * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
  14587. */
  14588. (function() {
  14589. 'use strict';
  14590. window.onload = function() {
  14591. var academy, canvas;
  14592. canvas = document.getElementById('gameCanvas');
  14593. canvas.addEventListener('contextmenu', (function(e) {
  14594. e.preventDefault();
  14595. return location.reload();
  14596. }), false);
  14597. if (!(LEO_DEV_MODE || DEBUG_MODE)) {
  14598. window.onbeforeunload = function() {
  14599. return 'If you close, you will lose your progress in the current level.';
  14600. };
  14601. }
  14602. window.gameStage = new createjs.Stage(canvas);
  14603. createjs.MotionGuidePlugin.install();
  14604. window.canvasHeight = canvas.height;
  14605. window.canvasWidth = canvas.width;
  14606. createjs.Ticker.setFPS(30);
  14607. createjs.Touch.enable(gameStage, true);
  14608. academy = new dka.Academy();
  14609. if (DEBUG_MODE) {
  14610. return gameStage.on('click', function(e) {
  14611. if (e.nativeEvent.which === 2) {
  14612. return console.log(e.stageX, e.stageY);
  14613. }
  14614. });
  14615. }
  14616. };
  14617. }).call(this);