/dist/dka-game.js
JavaScript | 15634 lines | 12615 code | 1017 blank | 2002 comment | 645 complexity | 58d04a1db1d903e6c1a5f9b5ffd68b33 MD5 | raw file
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- window.dka = window.dka || {};
- dka.colors = {
- darkBlue: '#003d65',
- lightBlue: '#0da0ff',
- veryLightBlue: '#70c7ff',
- shinyBlue: '#19f1f1',
- lightGreen: '#00f000',
- gold: '#f0d400',
- darkGrey: '#2C3835',
- black: '#000'
- };
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.GameSettings = (function() {
- function GameSettings() {
- this._towerPill();
- this._towerAntibiotic();
- this._towerCellB();
- this._towerCellMacrophage();
- this._towerHospital();
- this._labs();
- this._diseases();
- }
- GameSettings.prototype._towerPill = function() {
- this.towers = {};
- return this.towers.pill = {
- title: 'Pill Labs',
- description: 'Pills are generic remedies to all kind of diseases.',
- buildingTime: 30,
- upgrade0: {
- cost: 70,
- reloadTime: 20,
- range: 150,
- magazineSize: 20,
- haziness: 8,
- bulletDamage: [2, 5]
- },
- upgrade1: {
- cost: 90,
- reloadTime: 17,
- range: 180,
- magazineSize: 4,
- haziness: 6,
- bulletDamage: [3, 6]
- },
- upgrade2: {
- cost: 120,
- reloadTime: 15,
- range: 200,
- magazineSize: 8,
- haziness: 2,
- bulletDamage: [5, 8]
- },
- upgrade3: {
- cost: 180,
- reloadTime: 9,
- range: 230,
- magazineSize: 8,
- haziness: 10,
- bulletDamage: [10, 15]
- }
- };
- };
- GameSettings.prototype._towerAntibiotic = function() {
- return this.towers.antibiotic = {
- title: 'Antibiotic Labs',
- description: 'Antibiotics deal area damage to all alive germs. Be carefull! Viruses are not alive. They are totally immune to antibiotics!',
- buildingTime: 50,
- upgrade0: {
- cost: 90,
- reloadTime: 60,
- range: 170,
- magazineSize: 7,
- bulletRadiusDamage: 70,
- bulletDamage: [7, 15]
- },
- upgrade1: {
- cost: 110,
- reloadTime: 65,
- range: 220,
- magazineSize: 7,
- bulletRadiusDamage: 70,
- bulletDamage: [13, 18]
- },
- upgrade2: {
- cost: 150,
- reloadTime: 65,
- range: 250,
- magazineSize: 8,
- bulletRadiusDamage: 70,
- bulletDamage: [18, 25]
- },
- upgrade3: {
- cost: 200,
- reloadTime: 91,
- range: 270,
- magazineSize: 7,
- bulletRadiusDamage: 70,
- bulletDamage: [30, 45]
- }
- };
- };
- GameSettings.prototype._towerCellB = function() {
- return this.towers.cellB = {
- title: 'B Cell',
- description: ' B cells are part of immune defense system, they create plasma cells who can prevent diseases multiplicating, brake them, or even damage them!',
- buildingTime: 30,
- upgrade0: {
- cost: 90,
- range: 200,
- cellSpeed: 3,
- cellTtl: 4
- },
- upgrade1: {
- cost: 110,
- range: 200,
- cellSpeed: 2,
- cellTtl: 5
- },
- upgrade2: {
- cost: 150,
- range: 200,
- cellSpeed: 3,
- cellTtl: 6
- },
- upgrade3: {
- cost: 230,
- range: 200,
- cellSpeed: 5,
- cellTtl: 7
- }
- };
- };
- GameSettings.prototype._towerCellMacrophage = function() {
- return this.towers.cellMacrophage = {
- title: 'Macrophage Cell',
- description: 'Macrophage cells are part of immune defense system, they directly eat diseases! but target only the ones with antibodies.',
- buildingTime: 20,
- upgrade0: {
- cost: 70,
- range: 200,
- cellSpeed: 6,
- cellTtl: 4,
- cellDamage: 1,
- respawnReload: 40
- },
- upgrade1: {
- cost: 110,
- range: 160,
- cellSpeed: 6,
- cellTtl: 4,
- cellDamage: 1.5,
- respawnReload: 40
- },
- upgrade2: {
- cost: 150,
- range: 160,
- cellSpeed: 6,
- cellTtl: 4,
- cellDamage: 2,
- respawnReload: 40
- },
- upgrade3: {
- cost: 230,
- range: 160,
- cellSpeed: 5,
- cellTtl: 4,
- cellDamage: 3,
- respawnReload: 40
- }
- };
- };
- GameSettings.prototype._towerHospital = function() {
- return this.towers.hospital = {
- abilities: {
- subsidies: {
- title: 'Subsidies',
- description: 'The city helps you a little by giving you some coins each wave.',
- cost: [60, 140],
- action: [40, 80]
- },
- supply: {
- title: 'Better supply',
- description: 'A better supply will make your pill and antibiotic towers shoot faster.',
- cost: [40, 350],
- action: [10, 15]
- },
- education: {
- img: 'Up3',
- title: 'Education',
- description: 'Educating the population about hygiene enable the reduction of the multiplication rate of diseases.',
- cost: [40, 100],
- action: [100, 200]
- }
- }
- };
- };
- GameSettings.prototype._labs = function() {
- return this.labs = {
- fever: [
- {
- duration: 45,
- reloadTime: 300,
- title: 'Fever',
- description: 'Increase duration and reduce reload time.'
- }, {
- cost: 70,
- duration: 55,
- reloadTime: 350,
- title: 'Fever',
- description: 'Increase duration and reduce reload time.'
- }, {
- cost: 90,
- duration: 75,
- reloadTime: 450,
- title: 'Fever',
- description: 'Increase duration and reduce reload time.'
- }
- ],
- vaccine: [
- {
- damage: 0.5,
- duration: 100,
- reloadTime: 450,
- title: 'Vaccine',
- description: 'Increase damage and reduce reload time.'
- }, {
- cost: 70,
- duration: 150,
- damage: 1,
- reloadTime: 350,
- title: 'Vaccine',
- description: 'Increase damage and reduce reload time.'
- }, {
- cost: 100,
- duration: 200,
- damage: 1.5,
- reloadTime: 300,
- title: 'Vaccine',
- description: 'Increase damage and reduce reload time.'
- }
- ],
- hintNxtWave: [
- {
- cost: 40,
- title: 'Next wave',
- description: 'Add informations about the next wave.'
- }, {
- cost: 60,
- title: 'Next wave',
- description: 'Add informations about the next wave.'
- }
- ]
- };
- };
- GameSettings.prototype.getLabsSetting = function(setting, prop) {
- return this.labs[setting][dka.academy.game.labs.getUpgradeLevel(setting)][prop];
- };
- GameSettings.prototype._diseases = function() {
- 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'];
- return this.diseases = {
- Tuberculosis: {
- type: 'Bacterium',
- speed: DEBUG_MODE ? 3 : 1.3,
- life: 20,
- lifeCost: 1,
- delayToMultiplicate: 300
- },
- HIV: {
- type: 'Virus',
- speed: 1.5,
- life: 40,
- lifeCost: 3
- },
- Plague: {
- type: 'Bacterium',
- speed: 2,
- life: 25,
- lifeCost: 1,
- delayToMultiplicate: 200
- }
- };
- };
- GameSettings.prototype.isBetter = function(before, after, criteria) {
- var diff, whatIsBetter;
- if (criteria === 'damage') {
- before = (before[1] - before[0]) / 2 + before[0];
- after = (after[1] - after[0]) / 2 + after[0];
- }
- diff = after - before;
- if (diff === 0) {
- return 'equal';
- }
- whatIsBetter = (function() {
- switch (criteria) {
- case 'range':
- return 'higher';
- case 'reloadTime':
- return 'lower';
- case 'damage':
- return 'higher';
- case 'cellDamage':
- return 'higher';
- case 'magazineSize':
- return 'higher';
- case 'haziness':
- return 'lower';
- case 'cellTtl':
- return 'higher';
- case 'cellSpeed':
- return 'higher';
- }
- })();
- if (whatIsBetter === 'higher' && diff > 0 || whatIsBetter === 'lower' && diff < 0) {
- return 'better';
- }
- return 'worse';
- };
- GameSettings.prototype.getReloadString = function(reloadTime, nbPlus) {
- var i, plusString;
- if (reloadTime < 0) {
- return '';
- }
- plusString = '';
- i = 0;
- while (i < nbPlus) {
- plusString += '+';
- i++;
- }
- switch (false) {
- case !(reloadTime <= 10):
- return 'Very fast' + plusString;
- case !(reloadTime <= 20):
- return 'Fast' + plusString;
- case !(reloadTime <= 50):
- return 'Average' + plusString;
- case !(reloadTime <= 70):
- return 'Slow' + plusString;
- default:
- return 'Very slow' + plusString;
- }
- };
- GameSettings.prototype.getMoveString = function(moveSpeed) {
- switch (false) {
- case !(moveSpeed < 0):
- return '';
- case !(moveSpeed <= 1):
- return 'Very slow';
- case !(moveSpeed <= 2):
- return 'Slow';
- case !(moveSpeed <= 4):
- return 'Average';
- case !(moveSpeed <= 6):
- return 'Fast';
- default:
- return 'Very fast';
- }
- };
- GameSettings.prototype.getDiseaseSpeedString = function(speed) {
- switch (false) {
- case !(speed < 0):
- return '';
- case !(speed <= 1):
- return 'Very slow';
- case !(speed <= 1.5):
- return 'Slow';
- case !(speed <= 2):
- return 'Average';
- case !(speed <= 2.5):
- return 'Fast';
- default:
- return 'Very fast';
- }
- };
- GameSettings.prototype.getRespawnString = function(respwanTime) {
- switch (false) {
- case !(respwanTime < 0):
- return '';
- case !(respwanTime <= 20):
- return 'Very fast';
- case !(respwanTime <= 30):
- return 'Fast';
- case !(respwanTime <= 40):
- return 'Average';
- case !(respwanTime <= 50):
- return 'Slow';
- default:
- return 'Very slow';
- }
- };
- GameSettings.prototype.getPrecisionString = function(haziness) {
- switch (false) {
- case !(haziness < 0):
- return '';
- case !(haziness <= 2):
- return 'Great';
- case !(haziness <= 5):
- return 'Good';
- case !(haziness <= 7):
- return 'Average';
- default:
- return 'Poor';
- }
- };
- return GameSettings;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- this.geom = this.geom || {};
- geom.Ellipse = (function() {
- function Ellipse(x, y, rw, rh) {
- this.x = x || 0;
- this.y = y || 0;
- this.rw = rw || 0;
- this.rh = rh || 0;
- this;
- }
- Ellipse.prototype.contains = function(x, y) {
- return (Math.pow(x - this.x, 2) / Math.pow(this.rw, 2) + (Math.pow(y - this.y, 2) / Math.pow(this.rh, 2))) <= 1;
- };
- Ellipse.prototype.containsPoint = function(p) {
- return this.contains(p.x, p.y);
- };
- Ellipse.prototype.toString = function() {
- return '[Ellipse (x:' + this.x + ' y:' + this.y + ' rw:' + this.rw + ' rh:' + this.rh + ')]';
- };
- return Ellipse;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- window.TXT_NBR = false;
- window.DEBUG_MODE = true;
- window.LEVEL_MODE = true;
- window.TIMELINE_MODE = false;
- window.LEO_DEV_MODE = false;
- window.moveConfig = function(target) {
- target.cursor = 'move';
- target.on('pressmove', function(e) {
- target.x = e.stageX;
- return target.y = e.stageY;
- });
- return target.on('pressup', function() {
- return console.log(target.x, target.y);
- });
- };
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Button = (function(superClass) {
- extend(Button, superClass);
- function Button(x, y, img) {
- Button.__super__.constructor.call(this);
- this.set({
- regX: 20,
- regY: 20
- });
- this.set({
- x: x,
- y: y || this.regY + 5,
- cursor: 'pointer'
- });
- if (img) {
- this.img = this.addChild(img);
- }
- this.cache(0, 0, 2 * this.regX, 2 * this.regY);
- this.on('mouseover', function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
- this.updateCache();
- if (gameStage.cacheCanvas) {
- gameStage.updateCache();
- }
- if (createjs.Ticker.paused) {
- return gameStage.update();
- }
- });
- this.on('mouseout', function() {
- return this.removeAllFilters();
- });
- }
- Button.prototype.removeAllFilters = function() {
- this.filters = [];
- this.updateCache();
- if (gameStage.cacheCanvas) {
- gameStage.updateCache();
- }
- if (createjs.Ticker.paused) {
- return gameStage.update();
- }
- };
- return Button;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.MenuButton = (function(superClass) {
- extend(MenuButton, superClass);
- function MenuButton(x, y, img) {
- MenuButton.__super__.constructor.call(this);
- this.set({
- regX: 183 / 2,
- regY: 167 / 2
- });
- this.set({
- x: x,
- y: y,
- cursor: 'pointer'
- });
- if (img) {
- this.img = this.addChild(img);
- }
- this.cache(0, 0, 2 * this.regX, 2 * this.regY);
- this.on('mouseover', function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
- return this.updateCache();
- });
- this.on('mouseout', function() {
- return this.removeAllFilters();
- });
- }
- MenuButton.prototype.removeAllFilters = function() {
- this.filters = [];
- return this.updateCache();
- };
- return MenuButton;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ButtonBitmap = (function(superClass) {
- extend(ButtonBitmap, superClass);
- function ButtonBitmap(bmp, brightness) {
- ButtonBitmap.__super__.constructor.call(this, bmp || null);
- this.set({
- cursor: 'pointer',
- available: true,
- brightness: (brightness ? brightness : 30)
- });
- this.on('mouseover', function() {
- if (!this.available) {
- return;
- }
- return this.lighten();
- });
- this.on('mouseout', function() {
- this.filters = [];
- if (!this.available) {
- this.darken();
- }
- this.updateCache();
- if (gameStage.cacheCanvas) {
- gameStage.updateCache();
- }
- if (createjs.Ticker.paused) {
- return gameStage.update();
- }
- });
- }
- ButtonBitmap.prototype.lighten = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(this.brightness))];
- this.updateCache();
- if (gameStage.cacheCanvas) {
- gameStage.updateCache();
- }
- if (createjs.Ticker.paused) {
- return gameStage.update();
- }
- };
- ButtonBitmap.prototype.darken = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustSaturation(-100))];
- this.updateCache();
- if (gameStage.cacheCanvas) {
- gameStage.updateCache();
- }
- if (createjs.Ticker.paused) {
- gameStage.update();
- }
- return this.available = false;
- };
- ButtonBitmap.prototype.removeAllFilters = function() {
- this.filters = [];
- this.updateCache();
- if (gameStage.cacheCanvas) {
- gameStage.updateCache();
- }
- if (createjs.Ticker.paused) {
- gameStage.update();
- }
- return this.available = true;
- };
- return ButtonBitmap;
- })(createjs.Bitmap);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ButtonLabs = (function(superClass) {
- extend(ButtonLabs, superClass);
- function ButtonLabs(bmp, point, upgrade, index, screen) {
- var settings;
- this.upgrade = upgrade;
- this.index = index;
- this.screen = screen;
- ButtonLabs.__super__.constructor.call(this);
- this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset(bmp)));
- this.set({
- x: point.x,
- y: point.y,
- regX: 50 / 2,
- regY: 62 / 2
- });
- settings = dka.academy.game.settings.labs[this.upgrade][index];
- this.cost = settings.cost;
- this.addChild(new createjs.Text(this.cost, '12px karnivoreRegular, Arial', dka.colors.gold).set({
- x: 50 / 2,
- y: 56,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- }));
- this.cache(0, 0, 50, 62);
- this.hintData = {
- title: settings.title,
- description: settings.description
- };
- this.screen.on(this.screen.RESET_EVENT, (function(_this) {
- return function() {
- return _this.reset();
- };
- })(this));
- this.screen.on(this.screen.UPGRADE_BOUGHT_EVENT, (function(_this) {
- return function() {
- if (_this.bought) {
- return;
- }
- if (_this.isAvailable()) {
- if (_this.available) {
- return;
- }
- _this.removeAllFilters();
- return _this.makeBuyable();
- } else {
- _this.darken();
- return _this.cursor = 'default';
- }
- };
- })(this));
- this.reset();
- }
- ButtonLabs.prototype.reset = function() {
- this.removeAllFilters();
- this.removeAllEventListeners('click');
- this.removeAllEventListeners('mouseover');
- this.removeAllEventListeners('mouseout');
- this.on('mouseover', function() {
- return this.screen.addToolTip(this, this.hintData);
- });
- this.on('mouseout', function() {
- return this.screen.removeToolTip();
- });
- this.available = false;
- this.bought = false;
- if (this.isBought()) {
- this.setBought();
- return;
- }
- if (!this.isAvailable()) {
- this.darken();
- this.cursor = 'default';
- return;
- }
- return this.makeBuyable();
- };
- ButtonLabs.prototype.isAvailable = function() {
- if (dka.academy.game.getTotalGold() < this.cost) {
- return false;
- }
- if (dka.academy.game.labs.getUpgradeLevel(this.upgrade) + 1 >= this.index) {
- return true;
- }
- };
- ButtonLabs.prototype.isBought = function() {
- return dka.academy.game.labs.getUpgradeLevel(this.upgrade) + 1 > this.index;
- };
- ButtonLabs.prototype.makeBuyable = function() {
- this.cursor = 'pointer';
- this.on('mouseover', function() {
- if (!this.isBought()) {
- return this.lighten(30);
- }
- });
- this.on('mouseout', function() {
- if (!this.isBought()) {
- return this.removeAllFilters();
- }
- });
- this.on('click', function() {
- dka.academy.game.labs.buy(this.upgrade, this.cost);
- this.removeAllEventListeners('click');
- this.setBought();
- this.screen.dispatchEvent(new createjs.Event(this.screen.UPGRADE_BOUGHT_EVENT));
- this.screen.timeline.updateCoinScore();
- return this.screen.undoStack.push(this);
- });
- return this.available = true;
- };
- ButtonLabs.prototype.setBought = function() {
- this.lighten(60);
- this.cursor = 'default';
- return this.bought = true;
- };
- ButtonLabs.prototype.lighten = function(brightness) {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(brightness))];
- return this.updateCache();
- };
- ButtonLabs.prototype.darken = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustSaturation(-100))];
- return this.updateCache();
- };
- ButtonLabs.prototype.removeAllFilters = function() {
- this.filters = [];
- return this.updateCache();
- };
- return ButtonLabs;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ButtonSprite = (function(superClass) {
- extend(ButtonSprite, superClass);
- function ButtonSprite(sps, brightness) {
- var bounds;
- ButtonSprite.__super__.constructor.call(this, sps || null);
- this.set({
- cursor: 'pointer',
- available: true,
- brightness: (brightness ? brightness : 30)
- });
- if (sps) {
- bounds = sps.getFrameBounds(0);
- this.cache(bounds.x, bounds.y, bounds.width, bounds.height);
- }
- this.on('mouseover', function() {
- if (!this.available) {
- return;
- }
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(this.brightness))];
- this.updateCache();
- return gameStage.update();
- });
- this.on('mouseout', function() {
- this.filters = [];
- if (!this.available) {
- this.darken();
- }
- this.updateCache();
- return gameStage.update();
- });
- }
- ButtonSprite.prototype.darken = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustSaturation(-100))];
- this.updateCache();
- gameStage.update();
- return this.available = false;
- };
- ButtonSprite.prototype.removeAllFilters = function() {
- this.filters = [];
- this.updateCache();
- gameStage.update();
- return this.available = true;
- };
- return ButtonSprite;
- })(createjs.Sprite);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.BulletDecal = (function(superClass) {
- extend(BulletDecal, superClass);
- function BulletDecal(x, y, level) {
- BulletDecal.__super__.constructor.call(this, dka.academy.assetManager.getAsset('spriteBulletEffect'));
- this.level = level;
- this.set({
- x: x,
- y: y
- });
- this.on('animationend', function(e) {
- this.stop();
- return createjs.Tween.get(this, {
- useTicks: true
- }).wait(20).to({
- alpha: 0
- }, 50, createjs.Ease.circIn).call(function() {
- return this.parent.removeChild(this);
- });
- });
- this.gotoAndPlay('boum');
- this.level.decalsLayer.addChild(this);
- }
- return BulletDecal;
- })(createjs.Sprite);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TutoBubble = (function(superClass) {
- extend(TutoBubble, superClass);
- function TutoBubble(text, position, level, closeEvent, invertDirection, alternateText) {
- var ref;
- TutoBubble.__super__.constructor.call(this);
- this.text = text;
- this.position = position;
- this.level = level;
- this.closeEvent = closeEvent;
- this.invertDirection = invertDirection;
- this.alternateText = alternateText;
- this.SMALL_BUBBLE_WIDTH = 100;
- this.LARGE_BUBBLE_WIDTH = 150;
- this.set({
- x: this.position.x,
- y: this.position.y,
- alpha: 0
- });
- this.addText();
- this.addBubble();
- createjs.Tween.get(this, {
- useTicks: true
- }).to({
- alpha: 1
- }, 15, createjs.Ease.backIn);
- createjs.Tween.get(this, {
- useTicks: true,
- loop: true
- }).to({
- scaleX: 0.85
- }, 15, createjs.Ease.backIn).to({
- scaleX: 1
- }, 15, createjs.Ease.backOut);
- if ((ref = this.level) != null) {
- ref.on(this.closeEvent, (function(_this) {
- return function(e) {
- e.remove();
- return createjs.Tween.get(_this, {
- useTicks: true
- }).to({
- alpha: 0,
- scaleX: 0
- }, 3).call(function() {
- return this.parent.removeChild(this);
- });
- };
- })(this));
- }
- if (alternateText) {
- this.on('tick', this.tick);
- this.switchDelay = 1 * 30;
- this.switchCounter = 0;
- }
- }
- TutoBubble.prototype.tick = function() {
- this.switchCounter++;
- if (this.switchCounter >= this.switchDelay) {
- this.textToast.alpha = 0;
- createjs.Tween.get(this.textToast, {
- useTicks: true
- }).to({
- alpha: 1
- }, 5);
- this.switchCounter = 0;
- if (this.textToast.text === this.text) {
- return this.textToast.text = this.alternateText;
- } else {
- return this.textToast.text = this.text;
- }
- }
- };
- TutoBubble.prototype.addText = function() {
- this.textToast = new createjs.Text(this.text, '17px Arial', dka.colors.lightBlue);
- this.textToast.set({
- y: 18,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- return this.addChild(this.textToast);
- };
- TutoBubble.prototype.addBubble = function() {
- var bg, bubble, width;
- bg = 'tutoBubbleSmall';
- width = this.SMALL_BUBBLE_WIDTH;
- if (this.textToast.getMeasuredWidth() > 90) {
- bg = 'tutoBubbleLarge';
- width = this.LARGE_BUBBLE_WIDTH;
- }
- bubble = new createjs.Bitmap(dka.academy.assetManager.getAsset(bg));
- bubble.regX = width / 2;
- if (this.invertDirection) {
- bubble.scaleY = -1;
- bubble.y = 25;
- }
- return this.addChildAt(bubble, 0);
- };
- return TutoBubble;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TabletSmoke = (function(superClass) {
- extend(TabletSmoke, superClass);
- function TabletSmoke(x, y) {
- TabletSmoke.__super__.constructor.call(this, dka.academy.assetManager.getAsset('spriteTabletSmoke'));
- this.x = x;
- this.y = y;
- this.gotoAndPlay(0);
- this.on('animationend', this.animationend);
- }
- TabletSmoke.prototype.animationend = function() {
- return this.parent.removeChild(this);
- };
- return TabletSmoke;
- })(createjs.Sprite);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.CapsuleSmoke = (function(superClass) {
- extend(CapsuleSmoke, superClass);
- function CapsuleSmoke(x, y) {
- CapsuleSmoke.__super__.constructor.call(this, dka.academy.assetManager.getAsset('spCapsuleSmoke'));
- this.x = x;
- this.y = y;
- this.gotoAndPlay(0);
- this.on('animationend', this.animationend);
- }
- CapsuleSmoke.prototype.animationend = function() {
- return this.parent.removeChild(this);
- };
- return CapsuleSmoke;
- })(createjs.Sprite);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.WaveFlag = (function(superClass) {
- extend(WaveFlag, superClass);
- function WaveFlag(level, road) {
- this.clickRemove = bind(this.clickRemove, this);
- this.update = bind(this.update, this);
- var hitCircle, newBmp, progressBar, settings;
- WaveFlag.__super__.constructor.call(this);
- this.level = level;
- this.road = road;
- settings = this.level.waves[this.level.getFresherWaveIndex() + 1].roads[road].callButton;
- this.set({
- x: settings.x,
- y: settings.y,
- regX: 20,
- regY: 20,
- scaleX: 0.7,
- scaleY: 0.7,
- cursor: 'pointer'
- });
- hitCircle = new createjs.Shape();
- hitCircle.graphics.beginFill('#000000').dc(20, 20, 20).endFill();
- this.hitArea = hitCircle;
- progressBar = new createjs.Shape();
- progressBar.set({
- x: 10,
- y: 8
- });
- if (this.level.getFresherWaveIndex() + 1 > 0) {
- progressBar.on('tick', this.update);
- }
- newBmp = new createjs.Bitmap(dka.academy.assetManager.getAsset('callWave')).set({
- x: 16,
- y: 16,
- regX: 16,
- regY: 16
- });
- if (this.level.game.labs.getUpgradeLevel('hintNxtWave') >= 0) {
- this.addHintBox();
- }
- this.addChild(progressBar, newBmp);
- this.cache(0, 0, 2 * this.regX, 2 * this.regY);
- createjs.Tween.get(this, {
- useTicks: true,
- loop: true
- }).to({
- scaleX: 1,
- scaleY: 1
- }, 15, createjs.Ease.backOut).to({
- scaleX: 0.7,
- scaleY: 0.7
- }, 15, createjs.Ease.backIn);
- this.on('click', this.clickRemove);
- this.on('mouseover', function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
- return this.updateCache();
- });
- this.on('mouseout', function() {
- this.filters = [];
- return this.updateCache();
- });
- }
- WaveFlag.prototype.addHintBox = function() {
- var dis, disease, i, len, name, nbTypeDiseases, nxtWaveDiseases, prop, props, ref;
- nxtWaveDiseases = {};
- ref = this.level.waves[this.level.getFresherWaveIndex() + 1].roads[this.road].diseasesList;
- for (i = 0, len = ref.length; i < len; i++) {
- disease = ref[i];
- dis = disease.dis;
- if (nxtWaveDiseases[dis]) {
- nxtWaveDiseases[dis]++;
- } else {
- nxtWaveDiseases[dis] = 1;
- }
- }
- if (this.level.game.labs.getUpgradeLevel('hintNxtWave') >= 1) {
- for (name in nxtWaveDiseases) {
- nxtWaveDiseases[name] = 'x ' + nxtWaveDiseases[name];
- }
- } else {
- for (name in nxtWaveDiseases) {
- nxtWaveDiseases[name] = 'x ?';
- }
- }
- props = [];
- nbTypeDiseases = 0;
- for (name in nxtWaveDiseases) {
- prop = props[nbTypeDiseases] = {};
- prop.caption = name;
- prop.separator = ' ';
- prop.value = nxtWaveDiseases[name];
- prop.color = 'green';
- nbTypeDiseases++;
- }
- this.on('mouseover', function() {
- return this.level.addToolTip(this, {
- title: 'Wave ' + (this.level.getFresherWaveIndex() + 2),
- props: props
- });
- });
- return this.on('mouseout', function() {
- return this.level.removeToolTip();
- });
- };
- WaveFlag.prototype.update = function() {
- var ratio;
- ratio = this.level.waitForNewWave / this.level.delayForNxtWave;
- ratio = (ratio === 0 ? 1 : ratio);
- this.getChildAt(0).graphics.clear();
- this.getChildAt(0).graphics.beginFill(dka.colors.lightBlue).rect(0, 19, 19, -19 * ratio).endFill();
- return this.updateCache();
- };
- WaveFlag.prototype.remove = function() {
- this.removeAllEventListeners('click');
- createjs.Tween.get(this, {
- useTicks: true,
- override: true
- }).to({
- scaleX: 0,
- scaleY: 0
- }, 15, createjs.Ease.backIn).call(function() {
- return this.parent.removeChild(this);
- });
- if (this.level.getFresherWaveIndex() >= 0) {
- return this.level.getHospital().getAbilityResult('subsidies');
- }
- };
- WaveFlag.prototype.clickRemove = function() {
- var goldEarned, timeEco;
- this.level.towerMenu.fade();
- this.level.ui.removeWaveFlags();
- this.level.dispatchEvent(new createjs.Event(this.level.WAVE_FLAG_CLICKED_EVENT, true, false));
- if (this.level.getFresherWaveIndex() === -1) {
- dka.academy.removeStageTicker();
- this.level.addLevelTicker();
- this.level.ui.helpButtonsHolder.allow();
- }
- timeEco = this.level.delayForNxtWave - this.level.waitForNewWave;
- goldEarned = (timeEco / 10) | 0;
- if (goldEarned > 0) {
- this.level.addGold(goldEarned);
- this.level.ui.helpButtonsHolder.advanceLoading(timeEco, this.level);
- createjs.Tween.get(null, {
- useTicks: true
- }).wait(30).call((function(_this) {
- return function() {
- var reward;
- reward = new dka.BouncingText('+' + goldEarned, 'bold 12px karnivoreRegular, Arial', dka.colors.gold, new createjs.Point(_this.x, _this.y));
- return _this.level.ui.addChild(reward);
- };
- })(this));
- }
- this.level.addWave();
- return this.level.ui.hudBar.updateWaves();
- };
- return WaveFlag;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TypingText = (function(superClass) {
- extend(TypingText, superClass);
- function TypingText(text, font, color, level, waitAfter, cursorSymbol, speedText, speedCursor) {
- this.textArray = text.split('');
- TypingText.__super__.constructor.call(this, this.textArray[0] + cursorSymbol, font, color);
- this.textToDisplay = text;
- this.level = level;
- this.waitAfter = waitAfter;
- this.cursorSymbol = cursorSymbol || '';
- this.speedText = speedText || 1;
- this.speedCursor = speedCursor;
- this.progressDisplay = 1;
- this.delayCount = 0;
- this.waitCount = 0;
- this.updateWrapper = this.on('tick', this.update);
- }
- TypingText.prototype.update = function() {
- if (this.level.ui.paused === true) {
- return;
- }
- if (this.delayCount < this.speedText) {
- this.delayCount++;
- return;
- }
- if (this.progressDisplay < this.textArray.length) {
- this.text = this.text.slice(0, this.progressDisplay) + this.textArray[this.progressDisplay] + this.text.slice(this.progressDisplay);
- if (this.textArray[this.progressDisplay] === ' ') {
- this.delayCount = -3 * this.speedText;
- } else {
- this.delayCount = 0;
- }
- return this.progressDisplay++;
- } else {
- if (this.waitCount > this.waitAfter) {
- this.off('tick', this.updateWrapper);
- createjs.Tween.get(this, {
- useTicks: true
- }).to({
- y: canvasHeight - 30
- }, 12, createjs.Ease.backIn).call(function() {
- return this.parent.removeChild(this);
- });
- return;
- }
- if (this.waitCount / this.speedCursor === Math.round(this.waitCount / this.speedCursor)) {
- if (this.text.search(this.cursorSymbol) === -1) {
- this.text += this.cursorSymbol;
- } else {
- this.text = this.textToDisplay;
- }
- }
- return this.waitCount++;
- }
- };
- return TypingText;
- })(createjs.Text);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.BouncingText = (function(superClass) {
- extend(BouncingText, superClass);
- function BouncingText(text, font, color, position, jumpHeight) {
- BouncingText.__super__.constructor.call(this, text, font, color);
- this.set({
- x: position.x,
- y: position.y,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- createjs.Tween.get(this, {
- useTicks: true
- }).to({
- y: position.y - (jumpHeight || 20)
- }, 18, createjs.Ease.backOut).to({
- alpha: 0
- }, 5).call(function() {
- return this.parent.removeChild(this);
- });
- }
- return BouncingText;
- })(createjs.Text);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScrollNumber = (function(superClass) {
- extend(ScrollNumber, superClass);
- function ScrollNumber(number, font, color, speedScroll) {
- ScrollNumber.__super__.constructor.call(this, '0', font, color);
- this.updateWrapper = this.on('tick', this.update);
- this.set({
- textAlign: 'right',
- textBaseline: 'alphabetic'
- });
- this.number = number;
- this.progressNumber = 0;
- this.speedScroll = speedScroll || 1;
- }
- ScrollNumber.prototype.update = function() {
- if (this.progressNumber >= this.number) {
- this.off('tick', this.updateWrapper);
- }
- if (this.speedScroll < 1) {
- this.progressNumber += 1 / this.speedScroll;
- if (this.progressNumber > this.number) {
- this.progressNumber = this.number;
- }
- this.text = this.progressNumber;
- return;
- }
- return this.text = this.progressNumber + this.speedScroll;
- };
- return ScrollNumber;
- })(createjs.Text);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.MessageBalloon = (function(superClass) {
- extend(MessageBalloon, superClass);
- function MessageBalloon(text, level) {
- MessageBalloon.__super__.constructor.call(this);
- this.text = text;
- this.level = level;
- this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('msgBalloon')));
- this.textDisplay = new createjs.Text('', '16px karnivoreRegular, Arial', dka.colors.lightBlue).set({
- x: 30,
- y: 30,
- textBaseline: 'alphabetic'
- });
- this.addChild(this.textDisplay);
- this.cache(0, 0, 640, 56);
- this.load(text);
- }
- MessageBalloon.prototype.load = function(text) {
- this.textArray = text.split('`');
- this.maxLines = this.textArray.length;
- this.lineDisplayed = 0;
- this.waitCount = this.speed = 60;
- this.updateCache();
- return this.updateWrapper = this.on('tick', this.update);
- };
- MessageBalloon.prototype.update = function() {
- if (this.level.ui.paused) {
- return;
- }
- this.waitCount++;
- if (this.waitCount < this.speed) {
- return;
- }
- this.waitCount = 0;
- if (this.lineDisplayed === this.maxLines) {
- this.fade();
- return;
- }
- this.uncache();
- return createjs.Tween.get(this.textDisplay, {
- useTicks: true
- }).to({
- alpha: 0
- }, 3).call(function() {
- this.text = this.parent.textArray[this.parent.lineDisplayed];
- return this.parent.lineDisplayed++;
- }).to({
- alpha: 1
- }, 3).call(function() {
- return this.parent.cache(0, 0, 640, 56);
- });
- };
- MessageBalloon.prototype.fade = function() {
- return createjs.Tween.get(this, {
- useTicks: true
- }).to({
- x: canvasWidth
- }, 22, createjs.Ease.backIn).call(function() {
- return this.parent.removeChild(this);
- });
- };
- return MessageBalloon;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.Labs = (function() {
- function Labs(game) {
- var purchases;
- this.game = game;
- purchases = dka.academy.dataManager.retrieveLabsPurchases();
- if (purchases) {
- this._upgrades = purchases;
- } else {
- this._upgrades = {
- hintNxtWave: -1,
- fever: 0,
- vaccine: 0
- };
- }
- }
- Labs.prototype.reset = function() {
- this._upgrades = {
- hintNxtWave: -1,
- fever: 0,
- vaccine: 0
- };
- dka.academy.dataManager.saveLabsPurchases();
- return this.game.resetGold();
- };
- Labs.prototype.serialize = function() {
- return JSON.stringify(this._upgrades);
- };
- Labs.prototype.getUpgradeLevel = function(upgrade) {
- return this._upgrades[upgrade];
- };
- Labs.prototype.setUpgradeLevel = function(upgrade, value) {
- return this._upgrades[upgrade] = value;
- };
- Labs.prototype.isBought = function(upgrade) {
- return this.getUpgradeLevel(upgrade) > 0;
- };
- Labs.prototype.sell = function(upgrade, cost) {
- this.setUpgradeLevel(upgrade, this.getUpgradeLevel(upgrade) - 1);
- dka.academy.dataManager.saveLabsPurchases();
- return this.game.removeGold(-cost);
- };
- Labs.prototype.buy = function(upgrade, cost) {
- this.setUpgradeLevel(upgrade, this.getUpgradeLevel(upgrade) + 1);
- dka.academy.dataManager.saveLabsPurchases();
- return this.game.removeGold(cost);
- };
- Labs.prototype.getLowerUnlockedPrice = function() {
- var min, price, upgrade;
- min = 0;
- for (upgrade in this._upgrades) {
- if (!dka.academy.game.settings.labs[upgrade][this.getUpgradeLevel(upgrade)]) {
- return;
- }
- price = dka.academy.game.settings.labs[upgrade][this.getUpgradeLevel(upgrade)].cost;
- if (min === 0 || price < min) {
- min = price;
- }
- }
- return min;
- };
- return Labs;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.HelpButton = (function(superClass) {
- extend(HelpButton, superClass);
- function HelpButton(name, bmp, level, ui) {
- var hexagon;
- HelpButton.__super__.constructor.call(this, null, null, new createjs.Bitmap(bmp));
- this.name = name;
- this.level = level;
- this.ui = ui;
- this.set({
- cursor: 'default',
- ready: false
- });
- hexagon = this._reloadPie = new createjs.Shape();
- hexagon.graphics.beginFill('#000000').drawPolyStar(this.regX, this.regY, 18, 6, 0, 30);
- hexagon.alpha = 0.6;
- this.addChild(hexagon);
- this.on('click', function() {
- this.level.towerMenu.fade();
- return this.doAction();
- });
- this.on('mouseout', function() {
- return this.level.removeToolTip();
- });
- this.updateCache();
- }
- HelpButton.prototype.allow = function() {
- return this.loaded();
- };
- HelpButton.prototype.advanceLoading = function(arg) {
- var base;
- if (typeof arg === 'number') {
- this._loading -= arg;
- } else {
- this._loading--;
- }
- if (this._loading <= 0) {
- return this.loaded(arg);
- } else {
- if (typeof (base = this._reloadPie).setProgress === "function") {
- base.setProgress(1 - (this._loading / this._full));
- }
- return this.updateCache();
- }
- };
- HelpButton.prototype.loaded = function(e) {
- (e != null ? e.remove : void 0) && e.remove();
- this.ready = true;
- this.cursor = 'pointer';
- this.removeChild(this._reloadPie);
- return this.updateCache();
- };
- HelpButton.prototype.unload = function() {
- var hexagon;
- this._loading = this._full;
- this.ready = false;
- this.cursor = 'default';
- hexagon = new createjs.Shape();
- hexagon.graphics.beginFill('#F00000').drawPolyStar(this.regX, this.regY, 18, 6, 0, 30);
- this._reloadPie = (new dka.ProgressPie(20, 20, null, '#000')).set({
- x: this.regX,
- y: this.regY,
- alpha: 0.6
- });
- this._reloadPie.mask = hexagon;
- this.addChild(this._reloadPie);
- return this.on('tick', this.advanceLoading);
- };
- return HelpButton;
- })(dka.Button);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.VaccineStain = (function(superClass) {
- extend(VaccineStain, superClass);
- function VaccineStain(x, y, level) {
- VaccineStain.__super__.constructor.call(this);
- this.x = x;
- this.y = y;
- this.level = level;
- this.damage = level.settings.getLabsSetting('vaccine', 'damage');
- this.spriteSheet = dka.academy.assetManager.getAsset('spriteVaccineStain');
- this.gotoAndPlay('spread');
- this.on('animationend', function() {
- return this.gotoAndStop(3);
- });
- this.on('tick', function() {
- var disease, diseasesLayer, i, localPoint, results;
- diseasesLayer = this.level.diseasesLayer;
- i = 0;
- results = [];
- while (i < diseasesLayer.numChildren) {
- disease = diseasesLayer.getChildAt(i);
- localPoint = gameStage.localToLocal(disease.x, disease.y, this);
- if (this.hitTest(localPoint.x, localPoint.y)) {
- disease.beDamaged(this.damage);
- }
- results.push(i++);
- }
- return results;
- });
- createjs.Tween.get(this, {
- useTicks: true
- }).wait(level.settings.getLabsSetting('vaccine', 'duration')).to({
- alpha: 0
- }, 15).call(function() {
- return this.parent.removeChild(this);
- });
- }
- return VaccineStain;
- })(createjs.Sprite);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.HelpButtonVaccine = (function(superClass) {
- extend(HelpButtonVaccine, superClass);
- function HelpButtonVaccine(level, ui) {
- HelpButtonVaccine.__super__.constructor.call(this, 'syringeButton', dka.academy.assetManager.getAsset('vaccineBP'), level, ui);
- this.set({
- x: this.ui.buttonsPositions[0],
- _full: level.settings.getLabsSetting('vaccine', 'reloadTime')
- });
- this.on('mouseover', function() {
- return this.level.addToolTip(this, {
- title: 'Vaccine',
- 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"
- });
- });
- }
- HelpButtonVaccine.prototype.doAction = function(keyboardTriggered) {
- var clickSyringue, syringue, syringueGot;
- if (!this.ready) {
- return;
- }
- syringueGot = this.level.ui.getChildByName('syringue');
- if (syringueGot) {
- syringueGot.parent.removeChild(syringueGot);
- gameStage.off('stagemousemove', this.syrMoveEvt);
- gameStage.off('click', this.syrClickEvt);
- return;
- }
- syringue = (new createjs.Sprite(dka.academy.assetManager.getAsset('spriteSyringue', 0))).set({
- x: gameStage.mouseX,
- y: gameStage.mouseY,
- name: 'syringue',
- cursor: 'pointer'
- });
- this.syrMoveEvt = gameStage.on('stagemousemove', function(e) {
- syringue.x = e.stageX;
- return syringue.y = e.stageY;
- });
- this.level.ui.addChild(syringue);
- clickSyringue = function(e) {
- this.unload();
- syringueGot = this.level.ui.getChildByName('syringue');
- syringueGot.gotoAndPlay('press');
- syringueGot.on('animationend', function() {
- return this.parent.removeChild(this);
- });
- this.level.backgroundLayer.addChild(new dka.VaccineStain(e.stageX, e.stageY, this.level));
- e.remove();
- return gameStage.off('stagemousemove', this.syrMoveEvt);
- };
- if (keyboardTriggered) {
- return this.syrClickEvt = gameStage.on('click', clickSyringue, this);
- } else {
- return this.on('mouseout', (function() {
- return this.syrClickEvt = gameStage.on('click', clickSyringue, this);
- }), null, true);
- }
- };
- return HelpButtonVaccine;
- })(dka.HelpButton);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.HelpButtonFever = (function(superClass) {
- extend(HelpButtonFever, superClass);
- function HelpButtonFever(level, ui) {
- HelpButtonFever.__super__.constructor.call(this, 'thermometerButton', dka.academy.assetManager.getAsset('feverBP'), level, ui);
- this.set({
- x: this.ui.buttonsPositions[1],
- _full: level.settings.getLabsSetting('fever', 'reloadTime')
- });
- this.on('mouseover', function() {
- return this.level.addToolTip(this, {
- title: 'Fever',
- description: "Fever is a significant rise of body temperature. It helps you by stopping diseases.\n\nShortcut: t"
- });
- });
- }
- HelpButtonFever.prototype.doAction = function(keyboardTriggered) {
- var feverHalo, halo;
- if (!this.ready) {
- return;
- }
- this.level.dispatchEvent(new createjs.Event(this.level.FEVER_CLICKED_EVENT, true, false));
- this.unload();
- this.level.moveDiseases = false;
- feverHalo = this.level.ui.addChildAt(new createjs.Bitmap(dka.academy.assetManager.getAsset('feverHalo')), 0).set({
- alpha: 0.7,
- name: 'feverHalo'
- });
- halo = this.level.ui.getChildByName('feverHalo');
- return createjs.Tween.get(halo, {
- useTicks: true
- }).wait(this.level.settings.getLabsSetting('fever', 'duration')).to({
- alpha: 0
- }, 30).call((function(_this) {
- return function() {
- _this.level.moveDiseases = true;
- return halo.parent.removeChild(halo);
- };
- })(this));
- };
- return HelpButtonFever;
- })(dka.HelpButton);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.HelpButtonsHolder = (function(superClass) {
- extend(HelpButtonsHolder, superClass);
- function HelpButtonsHolder(level, ui) {
- HelpButtonsHolder.__super__.constructor.call(this);
- this.level = level;
- this.ui = ui;
- this.vaccineButton = new dka.HelpButtonVaccine(level, ui);
- this.feverButton = new dka.HelpButtonFever(level, ui);
- this.addChild(this.vaccineButton);
- this.addChild(this.feverButton);
- }
- HelpButtonsHolder.prototype.allow = function() {
- this.vaccineButton.allow();
- return this.feverButton.allow();
- };
- HelpButtonsHolder.prototype.advanceLoading = function(time) {
- this.vaccineButton.advanceLoading(time);
- return this.feverButton.advanceLoading(time);
- };
- return HelpButtonsHolder;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.GraduationHat = (function(superClass) {
- extend(GraduationHat, superClass);
- function GraduationHat(position, gradeRatio) {
- var riseDuration, targetHeight;
- GraduationHat.__super__.constructor.call(this, dka.academy.assetManager.getAsset('gradhat'));
- targetHeight = canvasHeight / 5 + Math.random() * canvasHeight / 4;
- riseDuration = 20;
- this.set({
- x: position + Math.random() * 10,
- y: canvasHeight + 64,
- regX: 80 / 2,
- regY: 80 / 2
- });
- createjs.Tween.get(this, {
- useTicks: true
- }).to({
- y: targetHeight
- }, riseDuration, createjs.Ease.sineOut).to({
- y: canvasHeight + 64
- }, riseDuration, createjs.Ease.sineIn);
- createjs.Tween.get(this, {
- useTicks: true
- }).to({
- rotation: Math.random() * 180 + 180
- }, riseDuration * 2, createjs.Ease.sineIn);
- }
- return GraduationHat;
- })(createjs.Bitmap);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Screen = (function(superClass) {
- extend(Screen, superClass);
- function Screen(darkBackground, visible) {
- if (visible == null) {
- visible = false;
- }
- Screen.__super__.constructor.call(this);
- this.visible = visible;
- if (darkBackground) {
- this.addDarkBackground();
- }
- }
- Screen.prototype.addDarkBackground = function() {
- var darkBackground;
- darkBackground = new createjs.Shape();
- darkBackground.graphics.beginFill('#000').drawRect(0, 0, canvasWidth, canvasHeight);
- darkBackground.alpha = 0.5;
- return this.addChild(darkBackground);
- };
- Screen.prototype.show = function() {
- return this.visible = true;
- };
- Screen.prototype.hide = function() {
- return this.visible = false;
- };
- return Screen;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenStart = (function(superClass) {
- extend(ScreenStart, superClass);
- function ScreenStart() {
- var bpStart, seal;
- ScreenStart.__super__.constructor.call(this, false, true);
- seal = new createjs.Bitmap(dka.academy.assetManager.getAsset('menuStartBg'));
- seal.y = -400;
- this.addChild(seal);
- createjs.Tween.get(seal, {
- useTicks: true
- }).to({
- y: 0
- }, 50, createjs.Ease.elasticOut);
- bpStart = new dka.MenuButton(canvasWidth / 2, canvasHeight + 167 / 2, new createjs.Bitmap(dka.academy.assetManager.getAsset('bpStart')));
- this.addChild(bpStart);
- createjs.Tween.get(bpStart, {
- useTicks: true
- }).wait(30).to({
- y: 499
- }, 50, createjs.Ease.elasticOut);
- bpStart.on('click', (function(_this) {
- return function() {
- createjs.Tween.get(_this.getChildAt(0), {
- useTicks: true
- }).wait(5).to({
- y: -canvasHeight
- }, 15, createjs.Ease.sineOut);
- return createjs.Tween.get(bpStart, {
- useTicks: true,
- override: true
- }).to({
- y: canvasHeight + 167 / 2
- }, 15, createjs.Ease.sineOut).wait(5).call(function() {
- return dka.academy.showFEL();
- });
- };
- })(this));
- }
- return ScreenStart;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2014
- * Copyright © Clément Joly, 2012-2014
- *
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- *
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- (function() {
- 'use strict';
- var Screens, s;
- Screens = function() {
- throw new Error('Screens cannot be instantiated.');
- };
- s = Screens;
- s.firstStart = function() {
- var StartButton, bpstart, rectWhite;
- rectWhite = gameStage.addChild(new createjs.Shape());
- rectWhite.graphics.beginFill('rgba(247,247,247,0.1)').rect(0, 0, canvasWidth, canvasHeight);
- StartButton = gameStage.addChild((new createjs.Sprite(dka.academy.assetManager.getAsset('spriteStartButton'))).set({
- x: canvasWidth / 2,
- y: canvasHeight + 32,
- scaleX: 0.25,
- scaleY: 0.25,
- alpha: 0.3
- }));
- bpstart = new createjs.ButtonHelper(StartButton);
- StartButton.on('mouseover', function() {
- gameStage.uncache();
- });
- StartButton.on('click', function() {
- gameStage.uncache();
- createjs.Tween.get(this, {
- useTicks: true
- }).wait(3).to({
- y: -100,
- scaleX: 0.5,
- scaleY: 0.5,
- alpha: 0.3
- }, 15, createjs.Ease.bounceOut).call(function() {
- gameStage.removeAllChildren();
- dka.Screens.team();
- });
- });
- createjs.Tween.get(StartButton, {
- useTicks: true
- }).wait(9).to({
- scaleX: 0.5,
- scaleY: 0.5,
- y: canvasHeight / 2,
- alpha: 1
- }, 45, createjs.Ease.bounceOut).call(function() {
- gameStage.cache(0, 0, canvasWidth, canvasHeight);
- });
- };
- s.team = function() {
- var logoMakers, txtTeamName;
- txtTeamName = gameStage.addChild(new createjs.Text('Free Electrons\n\nLabs', 'bold 24px karnivoreRegular, Arial', '#FFFFFF')).set({
- x: canvasWidth / 2 + 128,
- y: canvasHeight / 2 - 32,
- textAlign: 'center',
- alpha: 0,
- textBaseline: 'alphabetic'
- });
- logoMakers = gameStage.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('LogoTeam1'))).set({
- x: canvasWidth / 2 - 188,
- y: canvasHeight / 2,
- regX: 80,
- regY: 120,
- scaleX: 0,
- scaleY: 0,
- alpha: 0
- });
- createjs.Tween.get(logoMakers, {
- useTicks: true
- }).wait(3).to({
- scaleX: 1,
- scaleY: 1,
- alpha: 1
- }, 12);
- createjs.Tween.get(txtTeamName, {
- useTicks: true
- }).wait(30).to({
- scaleX: 1.5,
- scaleY: 1.5,
- alpha: 1
- }, 12).call(function() {
- createjs.Tween.get(txtTeamName, {
- useTicks: true
- }).wait(15).to({
- alpha: 0.3
- }, 12).call(function() {
- createjs.Tween.get(txtTeamName, {
- useTicks: true
- }).wait(3).to({
- alpha: 1
- }, 12).call(function() {
- createjs.Tween.get(txtTeamName, {
- useTicks: true
- }).wait(21).to({
- y: -100,
- scaleX: 0.5,
- scaleY: 0.5,
- alpha: 0.3
- }, 15, createjs.Ease.bounceOut).call(function() {
- gameStage.removeAllChildren();
- dka.Screens.levels();
- });
- });
- });
- });
- };
- s.levels = function() {
- var creditsButton, credits_start, realStartButton, real_button_start, txtTitle;
- gameStage.removeAllChildren();
- gameStage.visible = true;
- txtTitle = new createjs.Text('Diseases Killer Academy', 'bold 24px karnivoreRegular, Arial', '#FFF0F0');
- txtTitle.textAlign = 'center';
- txtTitle.x = canvasWidth / 2;
- txtTitle.y = 0;
- txtTitle.alpha = 0;
- gameStage.addChild(txtTitle);
- realStartButton = new createjs.Sprite(dka.academy.assetManager.getAsset('spriteStartButton'));
- realStartButton.x = canvasWidth / 2;
- realStartButton.y = -32;
- realStartButton.scaleX = realStartButton.scaleY = 0.25;
- realStartButton.alpha = 0.3;
- gameStage.addChild(realStartButton);
- real_button_start = new createjs.ButtonHelper(realStartButton);
- creditsButton = new createjs.Sprite(dka.academy.assetManager.getAsset('spriteCreditsButton'));
- creditsButton.x = canvasWidth / 2;
- creditsButton.y = -32;
- creditsButton.scaleX = realStartButton.scaleY = 0;
- gameStage.addChild(creditsButton);
- credits_start = new createjs.ButtonHelper(creditsButton);
- createjs.Tween.get(txtTitle, {
- useTicks: true
- }).to({
- x: canvasWidth / 2,
- y: 96,
- scaleX: 1.5,
- scaleY: 1.5,
- alpha: 1
- }, 21, createjs.Ease.bounceOut).call(function() {
- createjs.Tween.get(realStartButton, {
- useTicks: true
- }).to({
- y: canvasHeight / 2,
- scaleX: 1,
- scaleY: 1,
- alpha: 1
- }, 21, createjs.Ease.bounceOut);
- createjs.Tween.get(creditsButton, {
- useTicks: true
- }).to({
- y: canvasHeight / 2 + 128,
- scaleX: 1,
- scaleY: 1,
- alpha: 1
- }, 21, createjs.Ease.bounceOut);
- });
- realStartButton.addEventListener('click', function() {
- createjs.Tween.get(creditsButton, {
- useTicks: true
- }).wait(3).to({
- y: -100,
- scaleX: 0.5,
- scaleY: 0.5,
- alpha: 0.3
- }, 15, createjs.Ease.bounceOut);
- createjs.Tween.get(realStartButton, {
- useTicks: true
- }).wait(3).to({
- y: -100,
- scaleX: 0.5,
- scaleY: 0.5,
- alpha: 0.3
- }, 15, createjs.Ease.bounceOut).call(function() {
- gameStage.removeAllChildren();
- gameStage.visible = false;
- });
- });
- creditsButton.addEventListener('click', function() {
- createjs.Tween.get(creditsButton, {
- useTicks: true
- }).wait(3).to({
- x: -100
- }, 15, createjs.Ease.bounceOut);
- createjs.Tween.get(txtTitle, {
- useTicks: true
- }).wait(3).to({
- y: -100
- }, 15, createjs.Ease.bounceOut);
- createjs.Tween.get(realStartButton, {
- useTicks: true
- }).wait(3).to({
- x: canvasWidth + 100
- }, 15, createjs.Ease.bounceOut).call(function() {
- gameStage.removeAllChildren();
- gameStage.visible = false;
- dka.Screens.credits();
- });
- });
- };
- s.credits = function() {
- var txtCredits;
- 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({
- x: canvasWidth / 2,
- y: canvasHeight,
- textAlign: 'center'
- });
- createjs.Tween.get(txtCredits, {
- useTicks: true
- }).to({
- y: -530
- }, 700, createjs.Ease.linear).wait(15).call(function() {
- gameStage.removeAllChildren();
- dka.Screens.levels();
- });
- };
- dka.Screens = Screens;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenFEL = (function(superClass) {
- extend(ScreenFEL, superClass);
- function ScreenFEL() {
- var electron, i, j;
- ScreenFEL.__super__.constructor.call(this, false, true);
- this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('felSplash')));
- this.electrons = [];
- for (i = j = 0; j < 3; i = ++j) {
- electron = new createjs.Bitmap(dka.academy.assetManager.getAsset('electron'));
- electron.set({
- x: 330,
- y: 120,
- regX: 36 / 2,
- regY: 36 / 2
- });
- this.electrons.push(this.addChild(electron));
- }
- createjs.Tween.get(this.electrons[0], {
- useTicks: true
- }).to({
- guide: {
- 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]
- }
- }, 2.5 * 30).to({
- guide: {
- path: [540, 220, 460, 16, 100, -36]
- }
- }, 0.5 * 30);
- createjs.Tween.get(this.electrons[1], {
- useTicks: true
- }).to({
- guide: {
- start: 1 / 3,
- 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]
- }
- }, 2.5 * 30).to({
- guide: {
- path: [330, 220, 300, 300, 340, 550 + 36]
- }
- }, 0.5 * 30);
- createjs.Tween.get(this.electrons[2], {
- useTicks: true
- }).to({
- guide: {
- start: 2 / 3,
- 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]
- }
- }, 2.2 * 30).to({
- guide: {
- path: [330, 220, 380, 420, 800, 550 + 36]
- }
- }, 0.5 * 30).wait(20).call(function() {
- return dka.academy.launchGame();
- });
- }
- return ScreenFEL;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.EncyclopediaItem = (function(superClass) {
- extend(EncyclopediaItem, superClass);
- function EncyclopediaItem(x, y, disease, sideView) {
- this.disease = disease;
- this.sideView = sideView;
- if (disease === 'Unknown') {
- EncyclopediaItem.__super__.constructor.call(this, dka.academy.assetManager.getAsset('sMysterious'));
- } else {
- EncyclopediaItem.__super__.constructor.call(this, dka.academy.assetManager.getAsset('s' + disease));
- }
- this.set({
- x: x,
- y: y,
- cursor: 'pointer'
- });
- this.on('mouseover', this.hover);
- this.on('mouseout', this.removeAllFilters);
- this.cache(-16, -16, 32, 32);
- }
- EncyclopediaItem.prototype.hover = function() {
- this.lighten();
- return this.sideView.show(this.disease);
- };
- EncyclopediaItem.prototype.lighten = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
- return this.updateCache();
- };
- EncyclopediaItem.prototype.removeAllFilters = function() {
- this.filters = [];
- return this.updateCache();
- };
- return EncyclopediaItem;
- })(createjs.Sprite);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.EncyclopediaSideView = (function(superClass) {
- extend(EncyclopediaSideView, superClass);
- function EncyclopediaSideView(x, y, level) {
- var lifeCostIco, lifeIco, speedIco;
- EncyclopediaSideView.__super__.constructor.call(this);
- this.level = level;
- this.set({
- x: x,
- y: y
- });
- this.diseaseImage = new createjs.Sprite(dka.academy.assetManager.getAsset('sMysterious'));
- this.diseaseImage.set({
- x: 64
- });
- this.addChild(this.diseaseImage);
- this.diseaseLabel = new createjs.Text('Point a disease...', '18px karnivoreRegular, Arial', dka.colors.lightBlue);
- this.diseaseLabel.set({
- x: 64,
- y: 80,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- this.addChild(this.diseaseLabel);
- this.typeBar = new createjs.Bitmap(dka.academy.assetManager.getAsset('bacteriaBar'));
- this.typeBar.set({
- x: -33,
- y: 100,
- visible: false
- });
- this.addChild(this.typeBar);
- console.log(this.typeBar);
- lifeIco = new createjs.Bitmap(dka.academy.assetManager.getAsset('lifeIco'));
- lifeIco.set({
- x: 10,
- y: 150
- });
- this.addChild(lifeIco);
- lifeIco.on('mouseover', (function(_this) {
- return function() {
- return _this.level.addToolTip(lifeIco, {
- title: 'Life',
- description: 'Damage the disease can take before dying'
- });
- };
- })(this));
- lifeIco.on('mouseout', (function(_this) {
- return function() {
- return _this.level.removeToolTip();
- };
- })(this));
- this.lifeText = new createjs.Text('???', '18px karnivoreRegular, Arial', dka.colors.lightBlue);
- this.lifeText.set({
- x: 50,
- y: 168,
- textAlign: 'left',
- textBaseline: 'alphabetic'
- });
- this.addChild(this.lifeText);
- speedIco = new createjs.Bitmap(dka.academy.assetManager.getAsset('speedIco'));
- speedIco.set({
- x: 10,
- y: 200
- });
- this.addChild(speedIco);
- speedIco.on('mouseover', (function(_this) {
- return function() {
- return _this.level.addToolTip(speedIco, {
- title: 'Speed',
- description: 'Speed at which the disease moves'
- });
- };
- })(this));
- speedIco.on('mouseout', (function(_this) {
- return function() {
- return _this.level.removeToolTip();
- };
- })(this));
- this.speedText = new createjs.Text('???', '18px karnivoreRegular, Arial', dka.colors.lightBlue);
- this.speedText.set({
- x: 50,
- y: 218,
- textAlign: 'left',
- textBaseline: 'alphabetic'
- });
- this.addChild(this.speedText);
- lifeCostIco = new createjs.Bitmap(dka.academy.assetManager.getAsset('lifeCostIco'));
- lifeCostIco.set({
- x: 10,
- y: 250
- });
- this.addChild(lifeCostIco);
- lifeCostIco.on('mouseover', (function(_this) {
- return function() {
- return _this.level.addToolTip(lifeCostIco, {
- title: 'Cost',
- description: 'Number of lives you will lose if this disease pass through your defense'
- });
- };
- })(this));
- lifeCostIco.on('mouseout', (function(_this) {
- return function() {
- return _this.level.removeToolTip();
- };
- })(this));
- this.lifeCostText = new createjs.Text('???', '18px karnivoreRegular, Arial', dka.colors.lightBlue);
- this.lifeCostText.set({
- x: 50,
- y: 268,
- textAlign: 'left',
- textBaseline: 'alphabetic'
- });
- this.addChild(this.lifeCostText);
- }
- EncyclopediaSideView.prototype.show = function(diseaseName) {
- var diseaseSettings, typeBar;
- if (diseaseName === 'Unknown') {
- this.diseaseImage.spriteSheet = dka.academy.assetManager.getAsset('sMysterious');
- this.diseaseLabel.text = diseaseName;
- this.typeBar.visible = false;
- this.lifeText.text = '???';
- this.speedText.text = '???';
- this.lifeCostText.text = '???';
- return;
- }
- this.diseaseImage.spriteSheet = dka.academy.assetManager.getAsset('s' + diseaseName);
- this.diseaseLabel.text = diseaseName;
- this.typeBar.visible = true;
- diseaseSettings = this.level.settings.diseases[diseaseName];
- typeBar = (function() {
- switch (diseaseSettings.type) {
- case 'Bacterium':
- return 'bacteriumBar';
- case 'Virus':
- return 'virusBar';
- }
- })();
- this.typeBar.image = dka.academy.assetManager.getAsset(typeBar);
- this.lifeText.text = diseaseSettings.life;
- this.speedText.text = this.level.settings.getDiseaseSpeedString(diseaseSettings.speed);
- return this.lifeCostText.text = diseaseSettings.lifeCost;
- };
- return EncyclopediaSideView;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenEncyclopedia = (function(superClass) {
- extend(ScreenEncyclopedia, superClass);
- function ScreenEncyclopedia(ui) {
- ScreenEncyclopedia.__super__.constructor.call(this);
- this.ui = ui;
- this.visible = false;
- }
- ScreenEncyclopedia.prototype.build = function() {
- var backPause, d, diseaseName, i, j, k, ref, results;
- this.addDarkBackground();
- backPause = new createjs.Bitmap(dka.academy.assetManager.getAsset('encyclopediaBk')).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2 - 16,
- regX: 600 / 2,
- regY: 475 / 2
- });
- this.addChild(backPause);
- this.getChildAt(0).on('click', (function(_this) {
- return function() {
- _this.hide();
- return _this.ui.easyPause('resume', false);
- };
- })(this));
- this.items = new createjs.Container();
- this.addChild(this.items);
- this.sideView = new dka.EncyclopediaSideView(530, 120, this.ui.level);
- this.addChild(this.sideView);
- d = 0;
- results = [];
- for (i = k = 120, ref = 120 + 60 * 5; k <= ref; i = k += 60) {
- results.push((function() {
- var l, ref1, results1;
- results1 = [];
- for (j = l = 200, ref1 = 200 + 50 * 5; l <= ref1; j = l += 50) {
- diseaseName = this.ui.level.settings.diseasesList[d];
- if (this.ui.level.game.knownDiseases.indexOf(diseaseName) === -1) {
- diseaseName = 'Unknown';
- }
- this.items.addChild(new dka.EncyclopediaItem(j, i, diseaseName, this.sideView));
- results1.push(d++);
- }
- return results1;
- }).call(this));
- }
- return results;
- };
- ScreenEncyclopedia.prototype.hide = function() {
- ScreenEncyclopedia.__super__.hide.call(this);
- return dka.academy.removeStageTicker();
- };
- ScreenEncyclopedia.prototype.show = function() {
- ScreenEncyclopedia.__super__.show.call(this);
- this.removeAllChildren();
- this.build();
- return dka.academy.addStageTicker();
- };
- return ScreenEncyclopedia;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.PauseButtonHolder = (function(superClass) {
- extend(PauseButtonHolder, superClass);
- function PauseButtonHolder(screenPause) {
- var levelsButton, retryButton, settingsButton;
- PauseButtonHolder.__super__.constructor.call(this);
- this.screenPause = screenPause;
- this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('pauseButtonHolder')));
- this.set({
- x: canvasWidth / 2,
- y: 0,
- regX: 304 / 2
- });
- retryButton = new dka.Button(304 / 2 - 70, null, new createjs.Bitmap(dka.academy.assetManager.getAsset('RetryPauseBP')));
- retryButton.on('click', function() {
- this.parent.screenPause.ui.easyPause('resume', false);
- dka.academy.addStageTicker();
- return dka.academy.game.launchLevel(dka.academy.game.currentLevel.level);
- });
- settingsButton = new dka.Button(304 / 2, null, new createjs.Bitmap(dka.academy.assetManager.getAsset('SettingsPauseBP')));
- settingsButton.on('click', function() {
- this.parent.screenPause.switchToSettings();
- this.parent.removeChild(settingsButton);
- return gameStage.update();
- });
- levelsButton = new dka.Button(304 / 2 + 70, null, new createjs.Bitmap(dka.academy.assetManager.getAsset('LevelsPauseBP')));
- levelsButton.on('click', function() {
- this.parent.screenPause.ui.easyPause('resume', false);
- dka.academy.addStageTicker();
- return dka.academy.showTimeline();
- });
- this.addChild(retryButton, settingsButton, levelsButton);
- }
- return PauseButtonHolder;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenPause = (function(superClass) {
- extend(ScreenPause, superClass);
- function ScreenPause(ui) {
- ScreenPause.__super__.constructor.call(this);
- this.ui = ui;
- this.mode = 'pause';
- this.build();
- }
- ScreenPause.prototype.build = function() {
- var backPause, txtUnpause;
- this.addDarkBackground();
- backPause = new createjs.Bitmap(dka.academy.assetManager.getAsset('pauseBck')).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2 - 16,
- regX: 574 / 2,
- regY: 120 / 2
- });
- txtUnpause = new createjs.Text('Click or press again to resume...', '28px karnivoreRegular, karnivoreRegular, Arial', dka.colors.lightBlue).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2 - 4,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- this.txtAutopause = new createjs.Text('You can disable autopause via the options menu', '20px karnivoreRegular, karnivoreRegular, Arial', dka.colors.lightBlue).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2 + 64,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- this.buttonHolder = new dka.PauseButtonHolder(this);
- this.addChild(backPause, txtUnpause, this.buttonHolder);
- return this.getChildAt(0).on('click', (function(_this) {
- return function() {
- return _this.ui.easyPause('resume', false);
- };
- })(this));
- };
- ScreenPause.prototype.addAutopauseToast = function() {
- return this.addChild(this.txtAutopause);
- };
- ScreenPause.prototype.removeAutopauseToast = function() {
- return this.removeChild(this.txtAutopause);
- };
- ScreenPause.prototype.switchToSettings = function() {
- this.mode = 'settings';
- this.removeChildAt(1);
- this.removeChildAt(1);
- this.removeChild(this.txtAutopause);
- this.addChild(new dka.SettingsMenu(this.ui));
- gameStage.uncache();
- return gameStage.update();
- };
- ScreenPause.prototype.show = function(trigger) {
- ScreenPause.__super__.show.call(this);
- if (trigger === 'auto') {
- return this.addAutopauseToast();
- } else {
- return this.removeAutopauseToast();
- }
- };
- ScreenPause.prototype.hide = function() {
- ScreenPause.__super__.hide.call(this);
- if (this.mode === 'settings') {
- this.removeAllChildren();
- this.build();
- return this.mode = 'pause';
- }
- };
- return ScreenPause;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenCredits = (function(superClass) {
- extend(ScreenCredits, superClass);
- function ScreenCredits() {
- var backBP;
- ScreenCredits.__super__.constructor.call(this, false, true);
- this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('credits')));
- backBP = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('back'));
- backBP.set({
- x: 100,
- y: 480
- });
- this.addChild(backBP);
- backBP.on('click', function() {
- return dka.academy.showTimeline();
- });
- }
- return ScreenCredits;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenLabs = (function(superClass) {
- extend(ScreenLabs, superClass);
- function ScreenLabs(timeline) {
- var backBP, resetBP, undoBP;
- ScreenLabs.__super__.constructor.call(this, false, true);
- this.timeline = timeline;
- this.UPGRADE_BOUGHT_EVENT = 'upgradeBought';
- this.RESET_EVENT = 'reset';
- this.undoStack = [];
- backBP = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('back'));
- backBP.set({
- x: 100,
- y: 480
- });
- this.addChild(backBP);
- backBP.on('click', function() {
- return dka.academy.showTimeline();
- });
- undoBP = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('undo'));
- undoBP.set({
- x: 650,
- y: 480
- });
- this.addChild(undoBP);
- undoBP.on('click', (function(_this) {
- return function() {
- if (_this.undoStack.length === 0) {
- return;
- }
- return _this.undo();
- };
- })(this));
- resetBP = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('reset'));
- resetBP.set({
- x: 730,
- y: 480
- });
- this.addChild(resetBP);
- resetBP.on('click', (function(_this) {
- return function() {
- return _this.reset();
- };
- })(this));
- this.addUpgradeButtons();
- this.hintBox = new dka.HintBox();
- this.addChild(this.hintBox);
- }
- ScreenLabs.prototype.reset = function() {
- dka.academy.game.labs.reset();
- this.dispatchEvent(new Event(this.RESET_EVENT));
- this.timeline.updateCoinScore();
- return this.undoStack = [];
- };
- ScreenLabs.prototype.undo = function() {
- var bp;
- bp = this.undoStack.pop();
- dka.academy.game.labs.sell(bp.upgrade, bp.cost);
- this.timeline.updateCoinScore();
- bp.reset();
- return this.dispatchEvent(new createjs.Event(this.RESET_EVENT));
- };
- ScreenLabs.prototype.addToolTip = function(target, hintData) {
- this.hintBox.load(target, hintData);
- return this.hintBox.visible = true;
- };
- ScreenLabs.prototype.removeToolTip = function() {
- return this.hintBox.hide();
- };
- ScreenLabs.prototype.addUpgradeButton = function(bmp, position, upgrade, hint) {
- var button;
- button = new dka.ButtonLabs(bmp, position, upgrade, hint, this);
- return this.addChild(button);
- };
- ScreenLabs.prototype.addUpgradeButtons = function() {
- this.addUpgradeButton('waveFlag1', new createjs.Point(330, 420), 'hintNxtWave', 0);
- this.addUpgradeButton('waveFlag1', new createjs.Point(330, 340), 'hintNxtWave', 1);
- this.addUpgradeButton('vaccine1', new createjs.Point(410, 420), 'vaccine', 1);
- this.addUpgradeButton('vaccine1', new createjs.Point(410, 340), 'vaccine', 2);
- this.addUpgradeButton('fever1', new createjs.Point(490, 420), 'fever', 1);
- return this.addUpgradeButton('fever1', new createjs.Point(490, 340), 'fever', 2);
- };
- return ScreenLabs;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenTuto = (function(superClass) {
- extend(ScreenTuto, superClass);
- function ScreenTuto() {
- ScreenTuto.__super__.constructor.call(this, true, true);
- this.build();
- }
- ScreenTuto.prototype.build = function() {
- var nextButton, splashTuto;
- splashTuto = new createjs.Bitmap(dka.academy.assetManager.getAsset('tutoSplash1')).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2,
- regX: 620 / 2,
- regY: 390 / 2
- });
- nextButton = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('nextButton')).set({
- x: canvasWidth / 2,
- y: 427,
- regX: 98 / 2,
- regY: 43 / 2
- });
- nextButton.cache(0, 0, 200, 43);
- nextButton.on('click', (function(_this) {
- return function() {
- _this.removeChild(splashTuto, nextButton);
- return _this.next1();
- };
- })(this));
- return this.addChild(splashTuto, nextButton);
- };
- ScreenTuto.prototype.next1 = function() {
- var nextButton, splashTuto1;
- splashTuto1 = new createjs.Bitmap(dka.academy.assetManager.getAsset('tutoSplash2')).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2,
- regX: 620 / 2,
- regY: 390 / 2
- });
- nextButton = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('nextButton')).set({
- x: canvasWidth / 2,
- y: 427,
- regX: 98 / 2,
- regY: 43 / 2
- });
- nextButton.cache(0, 0, 200, 43);
- nextButton.on('click', (function(_this) {
- return function() {
- _this.removeChild(splashTuto1, nextButton);
- return _this.next2();
- };
- })(this));
- return this.addChild(splashTuto1, nextButton);
- };
- ScreenTuto.prototype.next2 = function() {
- var closeButton, splashTuto2;
- splashTuto2 = new createjs.Bitmap(dka.academy.assetManager.getAsset('tutoBg')).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2,
- regX: 740 / 2,
- regY: 430 / 2,
- alpha: 0.2
- });
- closeButton = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('closeButton')).set({
- x: canvasWidth / 2,
- y: 440,
- regX: 200 / 2,
- regY: 43 / 2,
- alpha: 0.2
- });
- closeButton.cache(0, 0, 200, 43);
- closeButton.on('click', (function(_this) {
- return function() {
- return _this.close();
- };
- })(this));
- createjs.Tween.get(closeButton, {
- useTicks: true
- }).to({
- alpha: 1
- }, 5);
- createjs.Tween.get(splashTuto2, {
- useTicks: true
- }).to({
- alpha: 1
- }, 5);
- return this.addChild(splashTuto2, closeButton);
- };
- ScreenTuto.prototype.close = function() {
- return createjs.Tween.get(this, {
- useTicks: true
- }).to({
- alpha: 0
- }, 5).call((function(_this) {
- return function() {
- dka.academy.game.currentLevel.pausable = true;
- _this.parent.removeChild(_this);
- return dka.academy.game.currentLevel.ui.addDecorations();
- };
- })(this));
- };
- return ScreenTuto;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenLevelEnd = (function(superClass) {
- extend(ScreenLevelEnd, superClass);
- function ScreenLevelEnd(level) {
- var backRect, goldRemaining, goldRemainingTxt, gradeTxt, i, len, lifeRatio, listLevelsBP, position, positions, titleTxt, tryAgainBP;
- ScreenLevelEnd.__super__.constructor.call(this, true, true);
- this.level = level;
- backRect = new createjs.Bitmap(dka.academy.assetManager.getAsset('BaseBP1')).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2,
- regX: 180,
- regY: 180
- });
- listLevelsBP = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('LevelsBP')).set({
- x: canvasWidth / 2 + 64,
- y: canvasHeight / 2 + 96,
- regX: 32,
- regY: 32
- });
- listLevelsBP.cache(0, 0, 64, 64);
- listLevelsBP.on('click', function() {
- return dka.academy.showTimeline();
- });
- tryAgainBP = new dka.ButtonBitmap(dka.academy.assetManager.getAsset('TryAgainBP')).set({
- x: canvasWidth / 2 - 64,
- y: canvasHeight / 2 + 96,
- regX: 32,
- regY: 32
- });
- tryAgainBP.cache(0, 0, 64, 64);
- tryAgainBP.on('click', (function(_this) {
- return function() {
- return dka.academy.game.launchLevel(_this.level.level);
- };
- })(this));
- if (level.playerLives <= 0) {
- titleTxt = new createjs.Text('You lose !', '24px karnivoreRegular,Arial', dka.colors.lightBlue).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2 - 120,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- this.addChild(transGreyRect, backRect, titleTxt, tryAgainBP, listLevelsBP);
- } else {
- lifeRatio = level.playerLives / level.levelLives;
- titleTxt = new createjs.Text('You survive !', '24px karnivoreRegular,Arial', dka.colors.lightBlue).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2 - 120,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- gradeTxt = new createjs.Text(this.grade(lifeRatio), '30px karnivoreRegular,Arial', dka.colors.lightBlue).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2 - 60,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- goldRemainingTxt = new createjs.Text('Gold remaining: ', '14px karnivoreRegular,Arial', dka.colors.lightBlue).set({
- x: canvasWidth / 2 - 130,
- y: canvasHeight / 2 + 23,
- textBaseline: 'alphabetic'
- });
- goldRemaining = new dka.ScrollNumber(level.playerGold, '18px karnivoreRegular,Arial', dka.colors.lightBlue, 0.05).set({
- x: canvasWidth / 2 + 40,
- y: canvasHeight / 2 + 23
- });
- this.addChild(backRect, titleTxt, gradeTxt, goldRemainingTxt, tryAgainBP, listLevelsBP, goldRemaining);
- positions = [50, 120, 200, 670, 760, 830];
- for (i = 0, len = positions.length; i < len; i++) {
- position = positions[i];
- this.addChild(new dka.GraduationHat(position, lifeRatio));
- }
- }
- }
- ScreenLevelEnd.prototype.grade = function(ratio) {
- switch (false) {
- case ratio !== 1:
- return 'A+';
- case !(ratio >= 0.9):
- return 'A';
- case !(ratio >= 0.8):
- return 'B';
- case !(ratio >= 0.7):
- return 'C';
- case !(ratio >= 0.6):
- return 'D';
- default:
- return 'E';
- }
- };
- return ScreenLevelEnd;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ButtonTimeline = (function(superClass) {
- extend(ButtonTimeline, superClass);
- function ButtonTimeline(bmp) {
- ButtonTimeline.__super__.constructor.call(this, bmp);
- this.set({
- cursor: 'pointer',
- brightness: 30
- });
- this.on('mouseover', function() {
- return this.lighten();
- });
- this.on('mouseout', function() {
- return this.removeAllFilters();
- });
- this.cache(0, 0, 60, 60);
- }
- ButtonTimeline.prototype.lighten = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(this.brightness))];
- return this.updateCache();
- };
- ButtonTimeline.prototype.removeAllFilters = function() {
- this.filters = [];
- return this.updateCache();
- };
- return ButtonTimeline;
- })(createjs.Bitmap);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ScreenTimeline = (function(superClass) {
- extend(ScreenTimeline, superClass);
- function ScreenTimeline() {
- var arrow, bp, creditsBp, i, labsBp, level, ref;
- ScreenTimeline.__super__.constructor.call(this, false, true);
- this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('clock')));
- this.timeline = new createjs.Container();
- this.timeline.set({
- x: -canvasWidth,
- y: 140
- });
- this.addChild(this.timeline);
- arrow = new createjs.Bitmap(dka.academy.assetManager.getAsset('timeline'));
- this.timeline.addChild(arrow);
- createjs.Tween.get(this.timeline, {
- useTicks: true
- }).to({
- x: 90
- }, 20, createjs.Ease.cubicOut);
- this.buttons = [];
- for (level = i = 0, ref = dka.academy.LEVEL_NUMBER; i < ref; level = i += 1) {
- bp = new dka.TimelineLevel(level);
- this.buttons.push(bp);
- this.timeline.addChild(bp);
- }
- labsBp = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('labsBp'));
- labsBp.set({
- x: 730,
- y: 480
- });
- this.addChild(labsBp);
- labsBp.on('click', (function(_this) {
- return function() {
- return createjs.Tween.get(_this.timeline, {
- useTicks: true
- }).to({
- x: canvasWidth
- }, 20, createjs.Ease.cubicIn).call(function() {
- labsBp.parent.removeChild(labsBp);
- this.parent.removeChild(this.parent.bubble);
- creditsBp.parent.removeChild(creditsBp);
- return dka.academy.gotoLabs(this.parent);
- });
- };
- })(this));
- if (dka.academy.game.getTotalGold() >= dka.academy.game.labs.getLowerUnlockedPrice()) {
- this.bubble = new dka.TutoBubble('Go to Labs!', new createjs.Point(760, 440));
- this.addChild(this.bubble);
- }
- creditsBp = new dka.ButtonTimeline(dka.academy.assetManager.getAsset('creditsBp'));
- creditsBp.set({
- x: 100,
- y: 480
- });
- this.addChild(creditsBp);
- creditsBp.on('click', (function(_this) {
- return function() {
- return createjs.Tween.get(_this.timeline, {
- useTicks: true
- }).to({
- x: canvasWidth
- }, 20, createjs.Ease.cubicIn).call(function() {
- _this.removeCoinScore();
- _this.removeChild(_this.bubble);
- labsBp.parent.removeChild(labsBp);
- creditsBp.parent.removeChild(creditsBp);
- return dka.academy.showCredits();
- });
- };
- })(this));
- this.addMuteStuff();
- this.addCoinScore();
- }
- ScreenTimeline.prototype.addCoinScore = function() {
- this.coinLabel = new createjs.Bitmap(dka.academy.assetManager.getAsset('coinHud'));
- this.coinLabel.set({
- x: 349,
- y: 55
- });
- this.addChild(this.coinLabel);
- this.coinText = new createjs.Text(dka.academy.game.getTotalGold(), '20px karnivoreRegular, Arial', dka.colors.veryLightBlue);
- this.coinText.set({
- x: 380,
- y: 70,
- textAlign: 'left',
- textBaseline: 'alphabetic'
- });
- return this.addChild(this.coinText);
- };
- ScreenTimeline.prototype.updateCoinScore = function() {
- return this.coinText.text = dka.academy.game.getTotalGold();
- };
- ScreenTimeline.prototype.removeCoinScore = function() {
- this.removeChild(this.coinLabel);
- return this.removeChild(this.coinText);
- };
- ScreenTimeline.prototype.addMuteStuff = function() {
- var speakersButton;
- speakersButton = (new dka.ButtonSprite(dka.academy.assetManager.getAsset('sMuteSettingsBP'))).set({
- x: 837,
- y: 25
- });
- this.addChild(speakersButton);
- if (localStorage && localStorage.getItem('muted')) {
- if (localStorage.getItem('muted') === 'true') {
- speakersButton.gotoAndStop(1);
- } else {
- speakersButton.gotoAndStop(0);
- }
- } else {
- if (createjs.Sound.getMute()) {
- speakersButton.gotoAndStop(1);
- } else {
- speakersButton.gotoAndStop(0);
- }
- }
- speakersButton.updateCache();
- return speakersButton.on('click', function(e) {
- if (createjs.Sound.getMute()) {
- this.gotoAndStop(0);
- this.updateCache();
- gameStage.update();
- createjs.Sound.setMute(0);
- return localStorage && localStorage.setItem('muted', false);
- } else {
- this.gotoAndStop(1);
- this.updateCache();
- gameStage.update();
- createjs.Sound.setMute(1);
- return localStorage && localStorage.setItem('muted', true);
- }
- });
- };
- return ScreenTimeline;
- })(dka.Screen);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TimelineLevel = (function(superClass) {
- extend(TimelineLevel, superClass);
- function TimelineLevel(level) {
- TimelineLevel.__super__.constructor.call(this, dka.academy.assetManager.getAsset("level" + level + "Bp"));
- this.set({
- x: 6 + level * 60,
- y: 4,
- cursor: 'pointer',
- brightness: 30
- });
- this.on('click', (function(_this) {
- return function() {
- return createjs.Tween.get(_this.parent, {
- useTicks: true
- }).to({
- x: canvasWidth
- }, 20, createjs.Ease.cubicIn).call(function() {
- return dka.academy.game.launchLevel(level);
- });
- };
- })(this));
- this.on('mouseover', function() {
- return this.lighten();
- });
- this.on('mouseout', function() {
- return this.removeAllFilters();
- });
- this.cache(0, 0, 143, 198);
- }
- TimelineLevel.prototype.lighten = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(this.brightness))];
- return this.updateCache();
- };
- TimelineLevel.prototype.removeAllFilters = function() {
- this.filters = [];
- return this.updateCache();
- };
- return TimelineLevel;
- })(createjs.Bitmap);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.SettingsMenu = (function(superClass) {
- extend(SettingsMenu, superClass);
- function SettingsMenu(ui) {
- var backRect, title;
- SettingsMenu.__super__.constructor.call(this);
- this.ui = ui;
- backRect = new createjs.Bitmap(dka.academy.assetManager.getAsset('BaseBP1')).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2,
- regX: 180,
- regY: 180
- });
- this.addChild(backRect);
- title = new createjs.Text('Settings', '30px KarnivoreRegular', dka.colors.lightBlue).set({
- x: canvasWidth / 2,
- y: canvasHeight / 2 - 128,
- textAlign: 'center',
- baseline: 'alphbetic'
- });
- this.addChild(title);
- this.addMuteStuff();
- this.addAutopauseStuff();
- }
- SettingsMenu.prototype.addMuteStuff = function() {
- var speakersButton, speakersLabel;
- speakersLabel = new createjs.Text('Music: ', '15px KarnivoreRegular', dka.colors.lightBlue).set({
- x: canvasWidth / 2 - 110,
- y: canvasHeight / 2 - 40
- });
- this.addChild(speakersLabel);
- speakersButton = (new dka.ButtonSprite(dka.academy.assetManager.getAsset('sMuteSettingsBP'))).set({
- x: canvasWidth / 2 + 40,
- y: canvasHeight / 2 - 29
- });
- this.addChild(speakersButton);
- if (localStorage && localStorage.getItem('muted')) {
- if (localStorage.getItem('muted') === 'true') {
- speakersButton.gotoAndStop(1);
- } else {
- speakersButton.gotoAndStop(0);
- }
- } else {
- if (createjs.Sound.getMute()) {
- speakersButton.gotoAndStop(1);
- } else {
- speakersButton.gotoAndStop(0);
- }
- }
- speakersButton.updateCache();
- return speakersButton.on('click', function(e) {
- if (createjs.Sound.getMute()) {
- this.gotoAndStop(0);
- this.updateCache();
- gameStage.update();
- createjs.Sound.setMute(0);
- return localStorage && localStorage.setItem('muted', false);
- } else {
- this.gotoAndStop(1);
- this.updateCache();
- gameStage.update();
- createjs.Sound.setMute(1);
- return localStorage && localStorage.setItem('muted', true);
- }
- });
- };
- SettingsMenu.prototype.addAutopauseStuff = function() {
- var autopauseButton, autopauseLabel;
- autopauseLabel = new createjs.Text('Autopause: ', '15px KarnivoreRegular', dka.colors.lightBlue).set({
- x: canvasWidth / 2 - 110,
- y: canvasHeight / 2 + 40
- });
- this.addChild(autopauseLabel);
- autopauseButton = (new dka.ButtonSprite(dka.academy.assetManager.getAsset('sAutopauseSettingsBP'))).set({
- x: canvasWidth / 2 + 40,
- y: canvasHeight / 2 + 51
- });
- this.addChild(autopauseButton);
- if (localStorage && localStorage.getItem('autopause')) {
- if (localStorage.getItem('autopause') === 'true') {
- autopauseButton.gotoAndStop(0);
- } else {
- autopauseButton.gotoAndStop(1);
- }
- }
- autopauseButton.updateCache();
- return autopauseButton.on('click', (function(e, ui) {
- if (ui.level.game.autopause) {
- this.gotoAndStop(1);
- this.updateCache();
- gameStage.update();
- ui.level.game.autopause = false;
- return localStorage && localStorage.setItem('autopause', false);
- } else {
- this.gotoAndStop(0);
- this.updateCache();
- gameStage.update();
- ui.level.game.autopause = true;
- return localStorage && localStorage.setItem('autopause', true);
- }
- }), null, null, this.ui);
- };
- return SettingsMenu;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.HexaMenuButton = (function(superClass) {
- extend(HexaMenuButton, superClass);
- function HexaMenuButton(menu, level, position, bpData, img, hintData, unlockCondition, range) {
- var bmp, ref, sp;
- HexaMenuButton.__super__.constructor.call(this);
- this.menu = menu;
- this.level = level;
- this.position = position;
- this.bpData = bpData;
- this.img = img;
- this.unlockCondition = unlockCondition;
- this.x = this.menu.pointHex[this.position].x;
- this.y = this.menu.pointHex[this.position].y;
- this.set({
- cursor: 'pointer'
- });
- sp = new createjs.Sprite(dka.academy.assetManager.getAsset('spriteMenuButton'));
- bmp = new createjs.Bitmap(dka.academy.assetManager.getAsset(img)).set({
- regX: 16,
- regY: 16
- });
- this.addChild(sp, bmp);
- if (hintData) {
- this.on('mouseover', function() {
- return level.addToolTip(this, hintData);
- });
- this.on('mouseout', function() {
- return level.removeToolTip();
- });
- }
- if (range) {
- this.on('mouseover', function() {
- return this.level.showTowerRange(this.menu.x, this.menu.y, range);
- });
- this.on('mouseout', function() {
- return this.level.towerRange.fade();
- });
- }
- if (bpData && bpData.action) {
- this.action = bpData.action;
- }
- if (bpData != null ? (ref = bpData.cost) != null ? ref.value : void 0 : void 0) {
- this.addChild((new createjs.Text(bpData.cost.value, '10px karnivoreRegular, Arial', (bpData.cost.ressource === 'dna' ? dka.colors.lightGreen : dka.colors.gold))).set({
- y: 29,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- }));
- this.on('mouseover', function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
- return this.updateCache();
- });
- this.on('mouseout', function() {
- this.filters = [];
- return this.updateCache();
- });
- if (this.isAffordable(bpData.cost.value, bpData.cost.ressource)) {
- sp.gotoAndStop(0);
- this.affordable = true;
- this.addAction();
- } else {
- this.darken();
- sp.gotoAndStop(1);
- this.set({
- cursor: 'auto',
- affordable: false
- });
- if (unlockCondition) {
- this.level.on(bpData.cost.ressource + 'changed', (function(_this) {
- return function(e) {
- if (_this.isAffordable(bpData.cost.value, bpData.cost.ressource)) {
- _this.getChildAt(0).gotoAndStop(0);
- _this.removeAllFilters();
- _this.set({
- cursor: 'pointer',
- affordable: true
- });
- e.remove();
- _this.updateCache();
- return _this.addAction();
- }
- };
- })(this));
- }
- }
- } else {
- this.darken();
- sp.gotoAndStop(2);
- this.set({
- cursor: 'auto',
- affordable: false
- });
- }
- this.cache(-22, -19, 44, 53);
- }
- HexaMenuButton.prototype.addAction = function() {
- if (this.action) {
- return this.on('click', function() {
- this.menu.target.execAction(this.action);
- return this.menu.fade();
- });
- }
- };
- HexaMenuButton.prototype.darken = function() {
- this.getChildAt(1).filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustSaturation(-100))];
- return this.getChildAt(1).cache(0, 0, 32, 32);
- };
- HexaMenuButton.prototype.removeAllFilters = function() {
- this.getChildAt(1).filters = [];
- return this.getChildAt(1).uncache();
- };
- HexaMenuButton.prototype.isAffordable = function(cost, ressource) {
- return (ressource === 'dna' ? this.level.playerDna : this.level.playerGold) >= cost;
- };
- return HexaMenuButton;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.HexaMenu = (function(superClass) {
- extend(HexaMenu, superClass);
- function HexaMenu(level) {
- HexaMenu.__super__.constructor.call(this);
- this.level = level;
- this.pointHex = [
- {
- x: 63,
- y: 4
- }, {
- x: 114,
- y: 34
- }, {
- x: 14,
- y: 34
- }, {
- x: 114,
- y: 94
- }, {
- x: 14,
- y: 94
- }, {
- x: 63,
- y: 123
- }
- ];
- this.set({
- regX: 64,
- regY: 64,
- scaleX: 0.5,
- scaleY: 0.5
- });
- this.hexaBase();
- this.buttonsHolder = this.addChild(new createjs.Container());
- this.visible = false;
- }
- HexaMenu.prototype.load = function(x, y, target) {
- if (this.visible === true) {
- if (target === this.target) {
- this.fade();
- return;
- }
- this.set({
- scaleX: 0.5,
- scaleY: 0.5
- });
- this.buttonsHolder.removeAllChildren();
- }
- this.x = x;
- this.y = y;
- this.target = target;
- this.visible = true;
- if (!this.target.name || !this.target.name === 'hospital') {
- this.level.dispatchEvent(new createjs.Event(this.level.TOWER_MENU_OPEN_EVENT, true, false));
- }
- return createjs.Tween.get(this, {
- useTicks: true
- }).to({
- scaleX: 1,
- scaleY: 1
- }, 5, createjs.Ease.circOut);
- };
- HexaMenu.prototype.hexaBase = function() {
- return this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('hexMenu')));
- };
- HexaMenu.prototype.addButton = function(position, bpData, img, hintData, unlockCondition, range) {
- return this.buttonsHolder.addChild(new dka.HexaMenuButton(this, this.level, position, bpData, img, hintData, unlockCondition, range));
- };
- HexaMenu.prototype.getPropColor = function(before, after, criteria) {
- var isBetter;
- isBetter = this.level.settings.isBetter(before, after, criteria);
- switch (isBetter) {
- case 'better':
- return 'green';
- case 'worse':
- return 'red';
- case 'equal':
- return 'white';
- default:
- return 'white';
- }
- };
- HexaMenu.prototype.fade = function() {
- return createjs.Tween.get(this, {
- useTicks: true
- }).to({
- scaleX: 0.5,
- scaleY: 0.5
- }, 2, createjs.Ease.circIn).call(function() {
- if (this.target) {
- this.target.unselect();
- }
- this.buttonsHolder.removeAllChildren();
- return this.visible = false;
- });
- };
- return HexaMenu;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ProgressBar = (function(superClass) {
- extend(ProgressBar, superClass);
- function ProgressBar(leftToRight, width, height, color1, color2, edgeColor) {
- ProgressBar.__super__.constructor.call(this);
- this.leftToRight = leftToRight;
- this.width = width;
- this.height = height;
- this.color1 = color1;
- this.color2 = color2;
- this.edgeColor = edgeColor;
- this.set({
- regX: width / 2,
- regY: height / 2
- });
- this.oldVal = 0;
- this.drawBackgroundShape(leftToRight, width, height, color1, color2, edgeColor);
- this.cache(0, 0, width, height);
- }
- ProgressBar.prototype.drawBackgroundShape = function() {
- this.graphics.beginFill(this.edgeColor).rect(0, 0, this.width, this.height);
- return this.graphics.beginFill(this.color1).rect(1, 1, this.width - 2, this.height - 2);
- };
- ProgressBar.prototype.setProgress = function(progress) {
- if (this.leftToRight) {
- if (progress < this.oldVal) {
- this.graphics.clear();
- this.drawBackgroundShape(this.leftToRight, this.width, this.height, this.color1, this.color2, this.edgeColor);
- }
- this.graphics.beginFill(this.color2).rect(1, 1, (this.width - 2) * progress, this.height - 2);
- } else {
- if (progress > this.oldVal) {
- this.graphics.clear();
- this.drawBackgroundShape(this.leftToRight, this.width, this.height, this.color1, this.color2, this.edgeColor);
- }
- this.graphics.beginFill(this.color2).rect(this.width - 1, 1, -((this.width - 2) - ((this.width - 2) * progress)), this.height - 2);
- }
- this.updateCache();
- return this.oldVal = progress;
- };
- return ProgressBar;
- })(createjs.Shape);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ProgressCircle = (function(superClass) {
- extend(ProgressCircle, superClass);
- function ProgressCircle(radius, thickness, color1, edgeColor) {
- ProgressCircle.__super__.constructor.call(this);
- edgeColor && this.graphics.beginStroke(edgeColor).setStrokeStyle(thickness).arc(0, 0, radius, 0, Math.PI * 2);
- this.set({
- regX: this.x,
- regY: this.y,
- radius: radius,
- thickness: thickness,
- color1: color1,
- edgeColor: edgeColor
- });
- }
- ProgressCircle.prototype.setProgress = function(progress) {
- this.graphics.clear();
- if (this.edgeColor) {
- this.graphics.beginStroke(this.edgeColor).setStrokeStyle(this.thickness).arc(0, 0, this.radius, 0, Math.PI * 2);
- }
- if (this.color1) {
- 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);
- }
- };
- return ProgressCircle;
- })(createjs.Shape);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.ProgressPie = (function(superClass) {
- extend(ProgressPie, superClass);
- function ProgressPie(radius, color) {
- ProgressPie.__super__.constructor.call(this);
- this.graphics.beginFill(color).arc(0, 0, radius, 0, Math.PI * 2);
- this.set({
- regX: this.x,
- regY: this.y,
- radius: radius,
- color: color
- });
- }
- ProgressPie.prototype.setProgress = function(progress) {
- this.graphics.clear();
- 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);
- };
- return ProgressPie;
- })(createjs.Shape);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Tower = (function(superClass) {
- extend(Tower, superClass);
- function Tower(x, y, location, level, free) {
- var settings;
- Tower.__super__.constructor.call(this);
- this.x = x;
- this.y = y;
- this.location = location;
- this.level = level;
- this.set({
- cursor: 'pointer'
- });
- settings = this.level.settings.towers[this.type];
- this.title = settings.title;
- this.description = settings.description;
- this.sprite = new createjs.Sprite();
- this.addChild(this.sprite);
- this.buildingBar = new dka.ProgressBar(true, 28, 7, dka.colors.veryLightBlue, dka.colors.lightBlue, dka.colors.darkGrey).set({
- y: -10
- });
- this.addChild(this.buildingBar);
- this.upgradeLevel = 0;
- this.MAX_UPGRADE_LEVEL = 4;
- this.totalCost = 0;
- this.buildingCounter = 0;
- this.buildingMode = true;
- this.level.dispatchEvent(new createjs.Event(this.level.TOWER_BUILT_EVENT, true, false));
- if (free) {
- this.buildingMode = false;
- }
- this.upgrade(free);
- this.sprite.on('click', (function(_this) {
- return function() {
- if (_this.buildingMode) {
- return;
- }
- _this.select();
- return _this.showMenu();
- };
- })(this));
- this.on('mouseover', function() {
- return this.lighten();
- });
- this.on('mouseout', function() {
- if (this.selected) {
- return;
- }
- return this.unselect();
- });
- this.on('tick', this.building);
- }
- Tower.prototype.lighten = function() {
- this.sprite.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
- return this.sprite.updateCache();
- };
- Tower.prototype.removeAllFilters = function() {
- this.sprite.filters = [];
- return this.sprite.updateCache();
- };
- Tower.prototype.select = function() {
- this.selected = true;
- return this.level.showTowerRange(this.x, this.y, this.range);
- };
- Tower.prototype.unselect = function() {
- this.selected = false;
- this.removeAllFilters();
- return this.level.towerRange.fade();
- };
- Tower.prototype.inRange = function(x, y) {
- return (new geom.Ellipse(this.x, this.y, this.range, this.range * this.level.coeffPerspective)).contains(x, y);
- };
- Tower.prototype.building = function() {
- if (this.level.getFresherWaveIndex() >= 0) {
- this.removeAllEventListeners('tick');
- }
- this.buildingCounter++;
- this.buildingBar.setProgress(this.buildingCounter / this.buildingTime);
- if (this.buildingCounter >= this.buildingTime) {
- this.buildingMode = false;
- this.removeChild(this.buildingBar);
- this.removeAllEventListeners('tick');
- return this.ready();
- }
- };
- Tower.prototype.execAction = function(action) {
- if (action === 'upgrade') {
- return this.upgrade();
- }
- };
- Tower.prototype.remove = function() {
- this.parent.removeChild(this);
- return this.level.addlocation(index);
- };
- return Tower;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerShoot = (function(superClass) {
- extend(TowerShoot, superClass);
- function TowerShoot(x, y, location, level, free) {
- TowerShoot.__super__.constructor.call(this, x, y, location, level, free);
- this.typeTower = 'shoot';
- this.readyToFire = false;
- this.waitToFire = 0;
- this.tutoBubbleReload = false;
- }
- TowerShoot.prototype.ready = function() {
- this.sprite.gotoAndStop(1);
- this.sprite.updateCache();
- this.addEntities();
- return this.on('mouseover', this.reloadMagazine);
- };
- TowerShoot.prototype.tick = function() {
- if (this.buildingMode) {
- this.building();
- return;
- }
- if (this.readyToFire !== true) {
- this.waitToFire++;
- }
- if (this.readyToFire !== true && this.waitToFire >= this.reloadTime) {
- this.waitToFire = 0;
- this.readyToFire = true;
- }
- if (this.readyToFire === true) {
- return this.getTarget();
- }
- };
- TowerShoot.prototype.updateMagazineGauge = function() {
- var color, green, h, maxGaugeHeight, padding, ratio, red, unit;
- maxGaugeHeight = 28;
- padding = 2;
- ratio = this.magazineCounter / this.magazineSize;
- h = ratio * maxGaugeHeight;
- unit = maxGaugeHeight / this.magazineSize;
- this.magazineGauge.graphics.clear();
- this.magazineGauge.graphics.beginFill('#393939').drawRect(0, 0, 8, maxGaugeHeight + 2 * padding);
- green = 255;
- red = 2 * Math.ceil(255 - ratio * 255);
- if (red >= 255) {
- green = Math.ceil(ratio * 255);
- }
- color = 'rgb(' + red + ', ' + green + ', 0)';
- this.magazineGauge.graphics.beginFill(color).drawRect(padding, maxGaugeHeight + padding, 8 - padding * padding, -h);
- return this.magazineGauge.updateCache();
- };
- TowerShoot.prototype.reloadMagazine = function() {
- this.magazineCounter = this.magazineSize;
- this.updateMagazineGauge();
- return this.level.dispatchEvent(new createjs.Event(this.level.MAGAZINE_RELOADED_EVENT, true, false));
- };
- TowerShoot.prototype.getTarget = function() {
- var disease, i, target;
- if (this.magazineCounter <= 0) {
- if (this.tutoBubbleReload || !this.level.level === 0) {
- return;
- }
- 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));
- this.tutoBubbleReload = true;
- return;
- }
- target = null;
- disease = null;
- i = 0;
- while (i < this.level.diseasesLayer.numChildren) {
- disease = this.level.diseasesLayer.getChildAt(i);
- if (disease.isTargetable() && this.inRange(disease.x, disease.y)) {
- if (!target || disease.distanceToExit < target.distanceToExit) {
- target = disease;
- }
- }
- i++;
- }
- if (target) {
- this.attack(target);
- this.updateMagazineGauge();
- return target;
- }
- return false;
- };
- TowerShoot.prototype.betterSupply = function(bonus) {
- return this.reloadTime = this.level.settings.towers[this.type]['upgrade' + (this.upgradeLevel - 1)].reloadTime - bonus;
- };
- return TowerShoot;
- })(dka.Tower);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerPill = (function(superClass) {
- extend(TowerPill, superClass);
- function TowerPill(x, y, location, level, free) {
- this.type = 'pill';
- TowerPill.__super__.constructor.call(this, x, y, location, level, free);
- this.sprite.spriteSheet = dka.academy.assetManager.getAsset('TowerPill');
- this.sprite.cache(-24, -9, 48, 48);
- this.buildingTime = level.settings.towers.antibiotic.buildingTime;
- }
- TowerPill.prototype.addEntities = function() {
- var mg;
- this.entities = new createjs.Container();
- this.addChildAt(this.entities, 0);
- mg = this.magazineGauge = new createjs.Shape().set({
- x: 0,
- y: 8,
- regX: 4,
- regY: 0
- });
- this.entities.addChild(mg);
- mg.cache(0, 0, 8, 32);
- return this.updateMagazineGauge();
- };
- TowerPill.prototype.showMenu = function() {
- var currentLevel, upLevel;
- this.level.towerMenu.load(this.x, this.y, this);
- currentLevel = this.level.settings.towers.pill['upgrade' + (this.upgradeLevel - 1)];
- if (this.upgradeLevel === this.MAX_UPGRADE_LEVEL) {
- this.level.towerMenu.addButton(0, null, 'upgradeGoldBP', {
- title: this.title,
- description: this.description,
- props: [
- {
- caption: 'damage',
- value: currentLevel.bulletDamage
- }, {
- caption: 'reload',
- value: this.level.settings.getReloadString(currentLevel.reloadTime, this.level.hospital.getUpgradeLevel('supply'))
- }, {
- caption: 'magazine size',
- value: currentLevel.magazineSize
- }, {
- caption: 'shot precision',
- value: this.level.settings.getPrecisionString(currentLevel.haziness)
- }
- ]
- }, true, currentLevel.range);
- return;
- }
- upLevel = this.level.settings.towers.pill['upgrade' + this.upgradeLevel];
- return this.level.towerMenu.addButton(0, {
- action: 'upgrade',
- cost: {
- value: upLevel.cost,
- ressource: 'gold'
- }
- }, 'upgradeGoldBP', {
- title: this.title,
- description: this.description,
- props: [
- {
- caption: 'damage',
- value: upLevel.bulletDamage,
- color: this.level.towerMenu.getPropColor(currentLevel.bulletDamage, upLevel.bulletDamage, 'damage')
- }, {
- caption: 'reload',
- value: this.level.settings.getReloadString(upLevel.reloadTime, this.level.hospital.getUpgradeLevel('supply')),
- color: this.level.towerMenu.getPropColor(currentLevel.reloadTime, upLevel.reloadTime, 'reloadTime')
- }, {
- caption: 'magazine size',
- value: upLevel.magazineSize,
- color: this.level.towerMenu.getPropColor(currentLevel.magazineSize, upLevel.magazineSize, 'magazineSize')
- }, {
- caption: 'shot precision',
- value: this.level.settings.getPrecisionString(upLevel.haziness),
- color: this.level.towerMenu.getPropColor(currentLevel.haziness, upLevel.haziness, 'haziness')
- }
- ]
- }, true, [this.range, upLevel.range]);
- };
- TowerPill.prototype.upgrade = function(free, targetUpgradeLevel) {
- var settings, timeBonus;
- targetUpgradeLevel = targetUpgradeLevel || this.upgradeLevel;
- settings = this.level.settings.towers.pill['upgrade' + targetUpgradeLevel];
- timeBonus = this.level.getHospital().getAbilityResult('supply', this);
- this.reloadTime = settings.reloadTime - (timeBonus ? timeBonus : 0);
- this.range = settings.range;
- this.magazineCounter = this.magazineSize = settings.magazineSize;
- this.haziness = settings.haziness;
- this.bulletDamage = settings.bulletDamage;
- if (targetUpgradeLevel > 0) {
- this.updateMagazineGauge();
- }
- this.upgradeLevel = targetUpgradeLevel + 1;
- if (free) {
- return;
- }
- this.level.addGold(-settings.cost);
- return this.totalCost += settings.cost;
- };
- TowerPill.prototype.attack = function(disease) {
- this.readyToFire = false;
- this.magazineCounter--;
- return this.level.bulletsLayer.addChild(new dka.BulletTablet(this, disease));
- };
- return TowerPill;
- })(dka.TowerShoot);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerAntibiotic = (function(superClass) {
- extend(TowerAntibiotic, superClass);
- function TowerAntibiotic(x, y, location, level, free) {
- this.type = 'antibiotic';
- TowerAntibiotic.__super__.constructor.call(this, x, y, location, level, free);
- this.buildingTime = level.settings.towers.antibiotic.buildingTime;
- this.sprite.spriteSheet = dka.academy.assetManager.getAsset('spriteTower');
- this.sprite.cache(-24, -24, 48, 48);
- }
- TowerAntibiotic.prototype.addEntities = function() {
- var mg;
- this.entities = new createjs.Container();
- this.addChildAt(this.entities, 0);
- mg = this.magazineGauge = new createjs.Shape().set({
- x: -28,
- y: -12,
- regX: 4,
- regY: 0
- });
- this.entities.addChild(mg);
- mg.cache(0, 0, 8, 32);
- return this.updateMagazineGauge();
- };
- TowerAntibiotic.prototype.showMenu = function() {
- var currentLevel, upLevel;
- this.level.towerMenu.load(this.x, this.y, this);
- currentLevel = this.level.settings.towers.antibiotic['upgrade' + (this.upgradeLevel - 1)];
- if (this.upgradeLevel === this.MAX_UPGRADE_LEVEL) {
- this.level.towerMenu.addButton(0, null, 'upgradeGoldBP', {
- title: this.title,
- description: this.description,
- props: [
- {
- caption: 'damage',
- value: currentLevel.bulletDamage
- }, {
- caption: 'reload',
- value: this.level.settings.getReloadString(currentLevel.reloadTime, this.level.hospital.getUpgradeLevel('supply'))
- }, {
- caption: 'magazine size',
- value: currentLevel.magazineSize
- }
- ]
- }, true, currentLevel.range);
- return;
- }
- upLevel = this.level.settings.towers.antibiotic['upgrade' + this.upgradeLevel];
- return this.level.towerMenu.addButton(0, {
- action: 'upgrade',
- cost: {
- value: upLevel.cost,
- ressource: 'gold'
- }
- }, 'upgradeGoldBP', {
- title: this.title,
- description: this.description,
- props: [
- {
- caption: 'damage',
- value: upLevel.bulletDamage,
- color: this.level.towerMenu.getPropColor(currentLevel.bulletDamage, upLevel.bulletDamage, 'damage')
- }, {
- caption: 'reload',
- value: this.level.settings.getReloadString(upLevel.reloadTime, this.level.hospital.getUpgradeLevel('supply')),
- color: this.level.towerMenu.getPropColor(currentLevel.reloadTime, upLevel.reloadTime, 'reloadTime')
- }, {
- caption: 'magazine size',
- value: upLevel.magazineSize,
- color: this.level.towerMenu.getPropColor(currentLevel.magazineSize, upLevel.magazineSize, 'magazineSize')
- }
- ]
- }, true, [this.range, upLevel.range]);
- };
- TowerAntibiotic.prototype.upgrade = function(free, targetUpgradeLevel) {
- var bonus, settings;
- targetUpgradeLevel = targetUpgradeLevel || this.upgradeLevel;
- settings = this.level.settings.towers.antibiotic['upgrade' + targetUpgradeLevel];
- bonus = this.level.getHospital().getAbilityResult('supply', this);
- this.reloadTime = settings.reloadTime - (bonus ? bonus : 0);
- this.range = settings.range;
- this.magazineCounter = this.magazineSize = settings.magazineSize;
- this.bulletRadiusDamage = settings.bulletRadiusDamage;
- this.bulletDamage = settings.bulletDamage;
- if (targetUpgradeLevel > 0) {
- this.updateMagazineGauge();
- }
- this.upgradeLevel = targetUpgradeLevel + 1;
- if (free) {
- return;
- }
- this.level.addGold(-settings.cost);
- return this.totalCost += settings.cost;
- };
- TowerAntibiotic.prototype.attack = function(disease) {
- this.readyToFire = false;
- this.magazineCounter--;
- return this.level.bulletsLayer.addChild(new dka.BulletCapsule(this, disease));
- };
- return TowerAntibiotic;
- })(dka.TowerShoot);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerHospital = (function(superClass) {
- extend(TowerHospital, superClass);
- function TowerHospital(position, level) {
- TowerHospital.__super__.constructor.call(this);
- this.x = position.x;
- this.y = position.y;
- this.level = level;
- this.name = 'hospital';
- this.set({
- cursor: 'pointer'
- });
- this.image = dka.academy.assetManager.getAsset(level.hospitalImage);
- this.set({
- regX: level.hospitalSize.regX,
- regY: level.hospitalSize.regY
- });
- this.maxUpgradeLevel = 2;
- this.abilities = {
- subsidies: {
- upgradeLevel: 0
- },
- supply: {
- upgradeLevel: 0
- },
- education: {
- upgradeLevel: 0
- }
- };
- this.cache(0, 0, level.hospitalSize.width, level.hospitalSize.height);
- this.on('click', function() {
- this.select();
- this.level.dispatchEvent(new createjs.Event(this.level.HOSPITAL_CLICKED_EVENT, true, false));
- return this.showMenu();
- });
- this.on('mouseover', this.lighten);
- this.on('mouseout', function() {
- if (this.selected) {
- return;
- }
- return this.unselect();
- });
- }
- TowerHospital.prototype.lighten = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(10))];
- return this.updateCache();
- };
- TowerHospital.prototype.removeAllFilters = function() {
- this.filters = [];
- return this.updateCache();
- };
- TowerHospital.prototype.select = function() {
- return this.selected = true;
- };
- TowerHospital.prototype.unselect = function() {
- this.selected = false;
- return this.removeAllFilters();
- };
- TowerHospital.prototype.showMenu = function() {
- var abilities;
- this.level.towerMenu.load(this.x, this.y, this);
- abilities = this.level.settings.towers.hospital.abilities;
- this.level.towerMenu.addButton(0, {
- action: 'subsidies',
- cost: {
- value: abilities.subsidies.cost[this.abilities.subsidies.upgradeLevel],
- ressource: 'gold'
- }
- }, 'subsidies', {
- title: abilities.subsidies.title,
- description: abilities.subsidies.description
- }, true);
- this.level.towerMenu.addButton(1, {
- action: 'supply',
- cost: {
- value: abilities.supply.cost[this.abilities.supply.upgradeLevel],
- ressource: 'gold'
- }
- }, 'crateBP', {
- title: abilities.supply.title,
- description: abilities.supply.description
- }, true);
- return this.level.towerMenu.addButton(2, {
- action: 'education',
- cost: {
- value: abilities.education.cost[this.abilities.education.upgradeLevel],
- ressource: 'gold'
- }
- }, 'educ', {
- title: abilities.education.title,
- description: abilities.education.description
- }, true);
- };
- TowerHospital.prototype.execAction = function(action) {
- return this.upgradeAbility(action);
- };
- TowerHospital.prototype.upgradeAbility = function(ability) {
- if (this.abilities[ability].upgradeLevel === this.maxUpgradeLevel) {
- return;
- }
- this.level.addGold(-this.level.settings.towers.hospital.abilities[ability].cost[this.abilities[ability].upgradeLevel]);
- this.abilities[ability].upgradeLevel++;
- if (ability === 'supply' || ability === 'education') {
- return this.applyAbility(ability);
- }
- };
- TowerHospital.prototype.applyAbility = function(ability) {
- var disease, diseasesLayer, i, onlyTowersLayer, results, results1, tower;
- switch (ability) {
- case 'supply':
- onlyTowersLayer = this.level.onlyTowersLayer;
- results = [];
- for (i in onlyTowersLayer.children) {
- tower = onlyTowersLayer.children[i];
- if (tower.typeTower === 'shoot') {
- results.push(tower.betterSupply(this.getAbilityResult('supply', tower)));
- } else {
- results.push(void 0);
- }
- }
- return results;
- break;
- case 'education':
- diseasesLayer = this.level.diseasesLayer;
- results1 = [];
- for (disease in diseasesLayer.children) {
- disease = diseasesLayer.children[disease];
- results1.push(disease.educate(this.getAbilityResult('education', disease)));
- }
- return results1;
- }
- };
- TowerHospital.prototype.getAbilityResult = function(ability, target) {
- var abilityData, hospitalAbility, subsidy;
- hospitalAbility = this.abilities[ability];
- if (hospitalAbility.upgradeLevel === 0) {
- return 0;
- }
- abilityData = this.level.settings.towers.hospital.abilities[ability];
- switch (ability) {
- case 'subsidies':
- subsidy = abilityData.action[hospitalAbility.upgradeLevel - 1];
- this.level.addGold(subsidy);
- createjs.Tween.get({
- useTicks: true
- }).wait(30).call((function(_this) {
- return function() {
- var reward;
- reward = new dka.BouncingText('+' + subsidy, 'bold 16px karnivoreRegular, Arial', dka.colors.gold, new createjs.Point(_this.x, _this.y));
- return _this.level.ui.addChild(reward);
- };
- })(this));
- return subsidy;
- case 'supply':
- return abilityData.action[hospitalAbility.upgradeLevel - 1];
- case 'education':
- return abilityData.action[hospitalAbility.upgradeLevel - 1];
- }
- };
- TowerHospital.prototype.getUpgradeLevel = function(ability) {
- if (this.abilities[ability]) {
- return this.abilities[ability].upgradeLevel;
- } else {
- return null;
- }
- };
- return TowerHospital;
- })(createjs.Bitmap);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.SpinningAntibody = (function(superClass) {
- extend(SpinningAntibody, superClass);
- function SpinningAntibody(mother, level, type) {
- SpinningAntibody.__super__.constructor.call(this);
- this.mother = mother;
- this.level = level;
- this.image = dka.academy.assetManager.getAsset('antibody' + type);
- this.set({
- regX: 8 / 2,
- regY: 14 / 2
- });
- this.spinning = false;
- this.posCounter = 0;
- this.speed = 0.1;
- this.orbitPos = new createjs.Point(3, 16);
- this.widthOrbit = 65;
- this.heigthOrbit = 24 * this.level.coeffPerspective;
- this.minRotation = -20;
- this.maxRotation = 20;
- this.rotationSpeed = 3;
- this.rotationDir = 1;
- }
- SpinningAntibody.prototype.spin = function() {
- this.spinning = true;
- return this.on('tick', this.tick);
- };
- SpinningAntibody.prototype.tick = function() {
- if (this.level.ui.paused === true) {
- return;
- }
- this.x = this.widthOrbit / 2 * Math.cos(this.posCounter) + this.orbitPos.x;
- this.y = this.heigthOrbit / 2 * Math.sin(this.posCounter) - this.orbitPos.y;
- if (this.y < -this.orbitPos.y) {
- this.parent.setChildIndex(this, 0);
- } else {
- this.parent.addChild(this);
- }
- this.posCounter += this.speed;
- this.rotation += this.rotationSpeed * this.rotationDir;
- switch (false) {
- case !(this.rotation >= this.maxRotation):
- return this.rotationDir = -1;
- case !(this.rotation <= this.minRotation):
- return this.rotationDir = 1;
- }
- };
- return SpinningAntibody;
- })(createjs.Bitmap);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Antibody = (function(superClass) {
- extend(Antibody, superClass);
- function Antibody(x, y, rotation, level) {
- Antibody.__super__.constructor.call(this);
- this.initX = this.x = x;
- this.initY = this.y = y;
- this.initRotation = this.rotation = rotation;
- this.level = level;
- this.spreadRadius = 7;
- this.spreadSpeed = 2;
- this.range = 35;
- this.speed = 0;
- this.rotationRange = 10 + Math.random() * 7;
- this.rotationSpeed = 4;
- this.rotationDir = 1;
- this.ttl = 30 * 10;
- this.ttlCounter = 0;
- this.removed = false;
- this.diseaseFollowed = null;
- this.state = 'spreading';
- }
- Antibody.prototype.tick = function() {
- switch (this.state) {
- case 'spreading':
- return this.spread();
- case 'idle':
- return this.idle();
- case 'following':
- return this.followDisease();
- case 'sticking':
- return typeof this.stickingToDisease === "function" ? this.stickingToDisease() : void 0;
- }
- };
- Antibody.prototype.spread = function() {
- this.x += this.spreadSpeed * Math.cos((this.rotation - 90) * Math.PI / 180);
- this.y += this.spreadSpeed * Math.sin((this.rotation - 90) * Math.PI / 180);
- if (this.level.euclidDistance(this.initX, this.initY, this.x, this.y) >= this.spreadRadius) {
- return this.state = 'idle';
- }
- };
- Antibody.prototype.idle = function() {
- this.rotation += this.rotationSpeed * this.rotationDir;
- this.ttlCounter++;
- if (this.ttlCounter >= this.ttl) {
- if (!this.removed) {
- this.remove();
- }
- }
- switch (false) {
- case !(Math.abs(this.initRotation - this.rotation) >= this.rotationRange):
- this.rotationDir *= -1;
- }
- return this.anyDiseasesInRange();
- };
- Antibody.prototype.anyDiseasesInRange = function(road, path) {
- var disease, i, l, range;
- range = new geom.Ellipse(this.x, this.y, this.range, this.range * this.level.coeffPerspective);
- i = 0;
- l = this.level.diseasesLayer.numChildren;
- while (i < l) {
- disease = this.level.diseasesLayer.getChildAt(i);
- if (disease.antibodiesCounter < disease.maxAntibodies && range.contains(disease.x, disease.y)) {
- this.diseaseFollowed = disease;
- this.diseaseFollowed.antibodiesCounter++;
- this.state = 'following';
- }
- i++;
- }
- return false;
- };
- Antibody.prototype.followDisease = function() {
- var angle, dstToDisease;
- if (!this.diseaseFollowed) {
- this.parent.removeChild(this);
- }
- this.speed = this.diseaseFollowed.speed * 1.5;
- dstToDisease = this.level.euclidDistance(this.x, this.y, this.diseaseFollowed.x, this.diseaseFollowed.y);
- angle = Math.atan2(this.diseaseFollowed.y - this.y, this.diseaseFollowed.x - this.x);
- this.rotation = angle / Math.PI * 180 + 90;
- if (dstToDisease < this.diseaseFollowed.radius + this.speed) {
- this.speed = dstToDisease - (this.diseaseFollowed.radius + this.regY);
- this.stickToDisease();
- }
- this.x += this.speed * Math.cos(angle);
- return this.y += this.speed * Math.sin(angle);
- };
- Antibody.prototype.stickToDisease = function() {
- var localPosition;
- this.parent.removeChild(this);
- this.diseaseFollowed.addAntibody(this);
- localPosition = this.diseaseFollowed.globalToLocal(this.x, this.y);
- this.x = localPosition.x;
- this.y = localPosition.y;
- return this.state = 'sticking';
- };
- Antibody.prototype.remove = function() {
- createjs.Tween.get(this, {
- useTicks: true
- }).to({
- alpha: 0
- }, 30).call(function() {
- return this.parent.removeChild(this);
- });
- return this.removed = true;
- };
- return Antibody;
- })(createjs.Bitmap);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.AntibodyIgG = (function(superClass) {
- extend(AntibodyIgG, superClass);
- function AntibodyIgG(x, y, rotation, level) {
- AntibodyIgG.__super__.constructor.call(this, x, y, rotation, level);
- this.image = dka.academy.assetManager.getAsset('antibodyIgG');
- this.set({
- regX: 8 / 2,
- regY: 14 / 2
- });
- }
- AntibodyIgG.prototype.stickToDisease = function() {
- AntibodyIgG.__super__.stickToDisease.call(this);
- return this.diseaseFollowed.preventMultiplication();
- };
- return AntibodyIgG;
- })(dka.Antibody);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.AntibodyIgA = (function(superClass) {
- extend(AntibodyIgA, superClass);
- function AntibodyIgA(x, y, rotation, level) {
- AntibodyIgA.__super__.constructor.call(this, x, y, rotation, level);
- this.image = dka.academy.assetManager.getAsset('antibodyIgA');
- this.set({
- regX: 8 / 2,
- regY: 24 / 2
- });
- }
- AntibodyIgA.prototype.stickToDisease = function() {
- AntibodyIgA.__super__.stickToDisease.call(this);
- this.diseaseFollowed.brake(0.8);
- return this.diseaseFollowed.preventMultiplication();
- };
- return AntibodyIgA;
- })(dka.Antibody);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.AntibodyIgM = (function(superClass) {
- extend(AntibodyIgM, superClass);
- function AntibodyIgM(x, y, rotation, level) {
- AntibodyIgM.__super__.constructor.call(this, x, y, rotation, level);
- this.image = dka.academy.assetManager.getAsset('antibodyIgM');
- this.set({
- regX: 20 / 2,
- regY: 20 / 2
- });
- this.reloadTime = 10;
- this.reloadCounter = 0;
- }
- AntibodyIgM.prototype.stickingToDisease = function() {
- this.reloadCounter++;
- if (this.reloadCounter >= this.reloadTime) {
- this.reloadCounter = 0;
- return this.diseaseFollowed.beDamaged(3);
- }
- };
- return AntibodyIgM;
- })(dka.Antibody);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerCell = (function(superClass) {
- extend(TowerCell, superClass);
- function TowerCell(x, y, location, level, free) {
- var cellPath, settings;
- TowerCell.__super__.constructor.call(this, x, y, location, level, free);
- this.typeTower = 'cell';
- this.cellPatrol = null;
- this.spawnPoint = new createjs.Point(this.x, this.y);
- settings = this.level.settings.towers[this.type].upgrade0;
- cellPath = this.level.towers[this.location].cell;
- this.spawnRoad = this.level.waypoints[cellPath.road];
- this.spawnPath = this.spawnRoad[cellPath.path];
- this.cellSpeed = settings.cellSpeed;
- }
- TowerCell.prototype.ready = function() {
- this.sprite.gotoAndStop(1);
- return this.sprite.updateCache();
- };
- TowerCell.prototype.closestPathPoint = function(path) {
- var closestPoint, dst, i, index, j, len, min, waypoint;
- if (path == null) {
- path = this.spawnPath;
- }
- min = -1;
- closestPoint = new createjs.Point();
- for (i = j = 0, len = path.length; j < len; i = ++j) {
- waypoint = path[i];
- dst = this.level.euclidDistance(waypoint.x, waypoint.y, this.x, this.y);
- if (dst < min || min === -1) {
- min = dst;
- index = i;
- closestPoint = waypoint;
- }
- }
- return [closestPoint, index];
- };
- TowerCell.prototype.tick = function() {
- var target;
- if (this.cellPatrol) {
- return;
- }
- target = this.getTarget();
- if (target) {
- return this.spawn(this.spawnPath, target);
- }
- };
- return TowerCell;
- })(dka.Tower);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerCellB = (function(superClass) {
- extend(TowerCellB, superClass);
- function TowerCellB(x, y, location, level, free) {
- this.type = 'cellB';
- TowerCellB.__super__.constructor.call(this, x, y, location, level, free);
- this.buildingTime = level.settings.towers.cellB.buildingTime;
- this.sprite.spriteSheet = dka.academy.assetManager.getAsset('spriteTowerCellB');
- this.sprite.cache(-24, -24, 48, 48);
- this.doneTypes = [];
- this.spinningAntibodies = [];
- }
- TowerCellB.prototype.tick = function() {
- if (this.buildingMode) {
- this.building();
- return;
- }
- return TowerCellB.__super__.tick.call(this);
- };
- TowerCellB.prototype.getTarget = function(road, path) {
- var i, l;
- i = 0;
- l = this.level.diseasesLayer.numChildren;
- while (i < l) {
- if (this.inRange(this.level.diseasesLayer.getChildAt(i).x, this.level.diseasesLayer.getChildAt(i).y)) {
- return this.level.diseasesLayer.getChildAt(i);
- }
- i++;
- }
- return false;
- };
- TowerCellB.prototype.showMenu = function() {
- var currentLevel, upLevel;
- this.level.towerMenu.load(this.x, this.y, this);
- currentLevel = this.level.settings.towers.cellB['upgrade' + (this.upgradeLevel - 1)];
- if (this.upgradeLevel === this.MAX_UPGRADE_LEVEL) {
- this.level.towerMenu.addButton(0, null, 'upgradeDnaBP', {
- title: this.title,
- description: this.description,
- props: [
- {
- caption: 'move speed',
- value: this.level.settings.getMoveString(currentLevel.cellSpeed)
- }, {
- caption: 'lifespan',
- value: currentLevel.cellTtl
- }
- ]
- }, true, currentLevel.range);
- return;
- }
- upLevel = this.level.settings.towers.cellB['upgrade' + this.upgradeLevel];
- return this.level.towerMenu.addButton(0, {
- action: 'upgrade',
- cost: {
- value: upLevel.cost,
- ressource: 'dna'
- }
- }, 'upgradeDnaBP', {
- title: this.title,
- description: this.description,
- props: [
- {
- caption: 'move speed',
- value: this.level.settings.getMoveString(upLevel.cellSpeed),
- color: this.level.towerMenu.getPropColor(currentLevel.cellSpeed, upLevel.cellSpeed, 'cellSpeed')
- }, {
- caption: 'lifespan',
- value: upLevel.cellTtl,
- color: this.level.towerMenu.getPropColor(currentLevel.cellTtl, upLevel.cellTtl, 'cellTtl')
- }
- ]
- }, true, [currentLevel.range, upLevel.range]);
- };
- TowerCellB.prototype.upgrade = function(free, targetUpgradeLevel) {
- var settings;
- targetUpgradeLevel = targetUpgradeLevel || this.upgradeLevel;
- settings = this.level.settings.towers.cellB['upgrade' + targetUpgradeLevel];
- this.range = settings.range;
- this.cellSpeed = settings.cellSpeed;
- this.cellTtl = settings.cellTtl;
- this.upgradeLevel = targetUpgradeLevel + 1;
- if (free) {
- return;
- }
- this.level.addDna(-settings.cost);
- return this.totalCost += settings.cost;
- };
- TowerCellB.prototype.getRandomCellType = function() {
- var rand;
- rand = Math.random();
- switch (false) {
- case !(rand < 15 / 100):
- return 'IgM';
- case !(rand < (15 + 25) / 100):
- return 'IgA';
- case !(rand < 1):
- return 'IgG';
- }
- };
- TowerCellB.prototype.addType = function(type) {
- if (this.doneTypes.indexOf(type) === -1) {
- this.doneTypes.push(type);
- return true;
- }
- return false;
- };
- TowerCellB.prototype.spawn = function(path) {
- var memory, type;
- type = this.getRandomCellType();
- memory = this.addType(type);
- if (memory) {
- this.addSpinningAntibody(type);
- }
- this.cellPatrol = new dka.CellPlasma(this, this.level, path, type, !memory);
- return this.level.cellsPatrolLayer.addChild(this.cellPatrol);
- };
- TowerCellB.prototype.addSpinningAntibody = function(type) {
- var antibody;
- antibody = new dka.SpinningAntibody(this, this.level, type);
- antibody.spin();
- this.spinningAntibodies.push(antibody);
- return this.addChild(antibody);
- };
- return TowerCellB;
- })(dka.TowerCell);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerCellMacrophage = (function(superClass) {
- extend(TowerCellMacrophage, superClass);
- function TowerCellMacrophage(x, y, location, level, free) {
- this.type = 'cellMacrophage';
- TowerCellMacrophage.__super__.constructor.call(this, x, y, location, level, free);
- this.buildingTime = level.settings.towers.cellMacrophage.buildingTime;
- this.sprite.spriteSheet = dka.academy.assetManager.getAsset('spriteTowerCellMacrophage');
- this.sprite.cache(-24, -24, 48, 48);
- this.MIN_ANTIBODIES = 1;
- this.respawnCounter = 0;
- this.haveToRespawn = false;
- this.readyToRespawn = true;
- }
- TowerCellMacrophage.prototype.tick = function() {
- if (this.buildingMode) {
- this.building();
- return;
- }
- TowerCellMacrophage.__super__.tick.call(this);
- if (!this.haveToRespawn) {
- return;
- }
- this.respawnCounter++;
- if (this.respawnCounter >= this.respawnReload) {
- this.haveToRespawn = false;
- this.respawnCounter = 0;
- return this.readyToRespawn = true;
- }
- };
- TowerCellMacrophage.prototype.showMenu = function() {
- var currentLevel, upLevel;
- this.level.towerMenu.load(this.x, this.y, this);
- currentLevel = this.level.settings.towers.cellMacrophage['upgrade' + (this.upgradeLevel - 1)];
- if (this.upgradeLevel === this.MAX_UPGRADE_LEVEL) {
- this.level.towerMenu.addButton(0, null, 'upgradeDnaBP', {
- title: this.title,
- description: this.description,
- props: [
- {
- caption: 'move',
- value: this.level.settings.getMoveString(currentLevel.cellSpeed)
- }, {
- caption: 'lifespan',
- value: currentLevel.cellTtl
- }, {
- caption: 'damage',
- value: currentLevel.cellDamage
- }, {
- caption: 'respawn',
- value: this.level.settings.getRespawnString(currentLevel.respawnReload)
- }
- ]
- }, true, currentLevel.range);
- return;
- }
- upLevel = this.level.settings.towers.cellMacrophage['upgrade' + this.upgradeLevel];
- return this.level.towerMenu.addButton(0, {
- action: 'upgrade',
- cost: {
- value: upLevel.cost,
- ressource: 'dna'
- }
- }, 'upgradeDnaBP', {
- title: this.title,
- description: this.description,
- props: [
- {
- caption: 'move',
- value: this.level.settings.getMoveString(upLevel.cellSpeed),
- color: this.level.towerMenu.getPropColor(currentLevel.cellSpeed, upLevel.cellSpeed, 'cellSpeed')
- }, {
- caption: 'lifespan',
- value: upLevel.cellTtl,
- color: this.level.towerMenu.getPropColor(currentLevel.cellTtl, upLevel.cellTtl, 'cellTtl')
- }, {
- caption: 'damage',
- value: upLevel.cellDamage,
- color: this.level.towerMenu.getPropColor(currentLevel.cellDamage, upLevel.cellDamage, 'cellDamage')
- }, {
- caption: 'respawn',
- value: this.level.settings.getRespawnString(upLevel.respawnReload),
- color: this.level.towerMenu.getPropColor(currentLevel.respawnReload, upLevel.respawnReload, 'reloadTime')
- }
- ]
- }, true, [currentLevel.range, upLevel.range]);
- };
- TowerCellMacrophage.prototype.upgrade = function(free, targetUpgradeLevel) {
- var settings;
- targetUpgradeLevel = targetUpgradeLevel || this.upgradeLevel;
- settings = this.level.settings.towers.cellMacrophage['upgrade' + targetUpgradeLevel];
- this.range = settings.range;
- this.cellSpeed = settings.cellSpeed;
- this.cellTtl = settings.cellTtl;
- this.cellDamage = settings.cellDamage;
- this.respawnReload = settings.respawnReload;
- this.upgradeLevel = targetUpgradeLevel + 1;
- if (free) {
- return;
- }
- this.level.addDna(-settings.cost);
- return this.totalCost += settings.cost;
- };
- TowerCellMacrophage.prototype.getTarget = function() {
- var disease, i, target;
- target = null;
- disease = null;
- i = 0;
- while (i < this.level.diseasesLayer.numChildren) {
- disease = this.level.diseasesLayer.getChildAt(i);
- if (disease.isTargetable() && disease.antibodiesCounter >= this.MIN_ANTIBODIES && this.inRange(disease.x, disease.y)) {
- if (!target || disease.distanceToExit < target.distanceToExit) {
- if (disease.road === this.spawnRoad) {
- target = disease;
- }
- }
- }
- i++;
- }
- if (target) {
- return target;
- }
- return false;
- };
- TowerCellMacrophage.prototype.spawn = function(path, disease) {
- if (!this.readyToRespawn) {
- return;
- }
- this.readyToRespawn = false;
- this.cellPatrol = new dka.CellMacrophage(this, this.level, path);
- return this.level.cellsPatrolLayer.addChild(this.cellPatrol);
- };
- return TowerCellMacrophage;
- })(dka.TowerCell);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.CellPlasma = (function(superClass) {
- extend(CellPlasma, superClass);
- function CellPlasma(mother, level, path, type, memory) {
- var deltaX, deltaY, index, p, ref;
- CellPlasma.__super__.constructor.call(this);
- this.mother = mother;
- this.level = level;
- this.path = path;
- this.type = type;
- this.memory = memory;
- this.sprite = new createjs.Bitmap(dka.academy.assetManager.getAsset('CellB1'));
- this.sprite.set({
- regX: 8,
- regY: 8
- });
- this.addChild(this.sprite);
- this.x = mother.spawnPoint.x;
- this.y = mother.spawnPoint.y;
- this.speed = mother.cellSpeed;
- this.direction = 1;
- ref = mother.closestPathPoint(), p = ref[0], index = ref[1];
- this.spawnIndex = this.pointToReach = index;
- this.ttl = mother.cellTtl;
- this.ttlCounter = 0;
- this.t0 = 0;
- this.t1 = 20;
- this.spawnSpeed = 30;
- this.spawnReloadCounter = 0;
- this.spawnRate = memory ? 2 : 1;
- deltaX = this.path[this.pointToReach].x - this.x;
- deltaY = this.path[this.pointToReach].y - this.y;
- this.speedX = deltaX / this.t1;
- this.speedY = (deltaY - this.t1 * this.t1 / 2) / this.t1;
- this.state = 'jumping';
- }
- CellPlasma.prototype.tick = function() {
- if (this.state === 'jumping') {
- this.jump();
- return;
- }
- this.checkMotherRange();
- this.move();
- if (this.spawnReloadCounter < this.spawnSpeed) {
- return this.spawnReloadCounter++;
- } else {
- this.spawnReloadCounter = 0;
- return this.spawnAntibodies();
- }
- };
- CellPlasma.prototype.checkMotherRange = function() {
- if (!this.mother.inRange(this.x, this.y)) {
- return this.uTurn();
- }
- };
- CellPlasma.prototype.jump = function() {
- this.x = this.mother.x + this.t0 * this.speedX;
- this.y = this.mother.y + this.t0 * this.speedY + this.t0 * this.t0 / 2;
- this.t0++;
- if (this.t0 >= this.t1) {
- return this.state = 'spawning';
- }
- };
- CellPlasma.prototype.move = function() {
- var angle, deltaX, deltaY, nxtX, nxtY, pointToReach;
- pointToReach = this.path[this.pointToReach];
- deltaX = pointToReach.x - this.x;
- deltaY = pointToReach.y - this.y;
- this.dstToWaypoint = this.level.euclidDistance(this.x, this.y, pointToReach.x, pointToReach.y);
- if (this.dstToWaypoint < this.speed) {
- this.reachingWP();
- }
- angle = Math.atan2(deltaY, deltaX);
- nxtX = this.x + this.speed * Math.cos(angle);
- nxtY = this.y + this.speed * Math.sin(angle);
- this.sprite.rotation = angle / Math.PI * 180 + 90;
- this.x = nxtX;
- this.y = nxtY;
- if (!this.level.isVisibleByPlayer(this.x, this.y)) {
- return this.uTurn();
- }
- };
- CellPlasma.prototype.reachingWP = function() {
- this.pointToReach += this.direction;
- if (this.pointToReach === this.spawnIndex) {
- this.ttlCounter++;
- if (this.ttlCounter >= this.ttl) {
- return this.die();
- }
- }
- };
- CellPlasma.prototype.uTurn = function() {
- this.direction *= -1;
- return this.reachingWP();
- };
- CellPlasma.prototype.die = function() {
- return this.remove();
- };
- CellPlasma.prototype.spawnAntibodies = function() {
- var antibody, i, j, piece, ref, results, rotation;
- piece = 360 / this.spawnRate;
- results = [];
- for (i = j = 0, ref = this.spawnRate; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
- rotation = Math.random() * 30 * (piece - 30) * (i + piece);
- switch (this.type) {
- case 'IgG':
- antibody = new dka.AntibodyIgG(this.x, this.y, rotation, this.level);
- break;
- case 'IgA':
- antibody = new dka.AntibodyIgA(this.x, this.y, rotation, this.level);
- break;
- case 'IgM':
- antibody = new dka.AntibodyIgM(this.x, this.y, rotation, this.level);
- }
- results.push(this.level.antibodiesLayer.addChild(antibody));
- }
- return results;
- };
- CellPlasma.prototype.remove = function() {
- this.mother.cellPatrol = null;
- return this.parent.removeChild(this);
- };
- return CellPlasma;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.CellMacrophage = (function(superClass) {
- extend(CellMacrophage, superClass);
- function CellMacrophage(mother, level) {
- CellMacrophage.__super__.constructor.call(this);
- this.mother = mother;
- this.level = level;
- this.hitRadius = 16;
- this.sprite = new createjs.Bitmap(dka.academy.assetManager.getAsset('CellMacrophage'));
- this.sprite.set({
- regX: 16,
- regY: 16
- });
- this.addChild(this.sprite);
- this.x = mother.spawnPoint.x;
- this.y = mother.spawnPoint.y;
- this.speed = mother.cellSpeed;
- this.direction = -1;
- this.damage = mother.cellDamage;
- this.ttl = mother.cellTtl;
- this.ttlCounter = 0;
- this.targetDisease = null;
- this.state = 'following';
- }
- CellMacrophage.prototype.tick = function() {
- switch (this.state) {
- case 'following':
- return this.move();
- case 'eating':
- return this.eat();
- }
- };
- CellMacrophage.prototype.move = function() {
- var angle, target;
- target = this.mother.getTarget();
- if (!target) {
- this.remove();
- return;
- }
- angle = Math.atan2(target.y - this.y, target.x - this.x);
- this.x += this.speed * Math.cos(angle);
- this.y += this.speed * Math.sin(angle);
- if (this.level.euclidDistance(target.x, target.y, this.x, this.y) < 5) {
- target.preventMultiplication();
- target.stopped = true;
- this.disease = target;
- return this.state = 'eating';
- }
- };
- CellMacrophage.prototype.eat = function() {
- if (this.disease.beDamaged(this.damage)) {
- this.ttlCounter++;
- if (this.ttlCounter >= this.ttl) {
- this.remove();
- return;
- }
- return this.state = 'following';
- }
- };
- CellMacrophage.prototype.remove = function() {
- this.mother.cellPatrol = null;
- this.parent.removeChild(this);
- return this.mother.haveToRespawn = true;
- };
- return CellMacrophage;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerLocation = (function(superClass) {
- extend(TowerLocation, superClass);
- function TowerLocation(x, y, level, index) {
- TowerLocation.__super__.constructor.call(this, dka.academy.assetManager.getAsset('towerLocation'));
- this.x = x;
- this.y = y;
- this.level = level;
- this.index = index;
- this.set({
- regX: 24,
- regY: 24,
- cursor: 'pointer'
- });
- this.selected = false;
- this.cache(0, 0, 48, 48);
- this.on('click', this.showMenu);
- this.on('mouseover', this.lighten);
- this.on('mouseout', function() {
- if (this.selected) {
- return;
- }
- return this.unselect();
- });
- }
- TowerLocation.prototype.lighten = function() {
- this.filters = [new createjs.ColorMatrixFilter(new createjs.ColorMatrix().adjustBrightness(30))];
- return this.updateCache();
- };
- TowerLocation.prototype.removeAllFilters = function() {
- this.filters = [];
- return this.updateCache();
- };
- TowerLocation.prototype.select = function() {
- return this.selected = true;
- };
- TowerLocation.prototype.unselect = function() {
- this.selected = false;
- return this.removeAllFilters();
- };
- TowerLocation.prototype.showMenu = function() {
- this.select();
- this.level.towerMenu.load(this.x, this.y, this);
- this.level.towerMenu.addButton(1, {
- action: 'cellMacrophage',
- cost: {
- value: this.level.settings.towers.cellMacrophage.upgrade0.cost,
- ressource: 'dna'
- }
- }, 'MacroCell', {
- title: this.level.settings.towers.cellMacrophage.title,
- description: this.level.settings.towers.cellMacrophage.description,
- props: [
- {
- caption: 'move',
- value: this.level.settings.getMoveString(this.level.settings.towers.cellMacrophage.upgrade0.cellSpeed)
- }, {
- caption: 'lifespan',
- value: this.level.settings.towers.cellMacrophage.upgrade0.cellTtl
- }, {
- caption: 'damage',
- value: this.level.settings.towers.cellMacrophage.upgrade0.cellDamage
- }, {
- caption: 'respawn',
- value: this.level.settings.getRespawnString(this.level.settings.towers.cellMacrophage.upgrade0.respawnReload)
- }
- ]
- }, true, this.level.settings.towers.cellMacrophage.upgrade0.range);
- this.level.towerMenu.addButton(2, {
- action: 'cellB',
- cost: {
- value: this.level.settings.towers.cellB.upgrade0.cost,
- ressource: 'dna'
- }
- }, 'BCell', {
- title: this.level.settings.towers.cellB.title,
- description: this.level.settings.towers.cellB.description,
- props: [
- {
- caption: 'move',
- value: this.level.settings.getMoveString(this.level.settings.towers.cellB.upgrade0.cellSpeed)
- }, {
- caption: 'lifespan',
- value: this.level.settings.towers.cellB.upgrade0.cellTtl
- }
- ]
- }, true, this.level.settings.towers.cellB.upgrade0.range);
- this.level.towerMenu.addButton(3, {
- action: 'pill',
- cost: {
- value: this.level.settings.towers.pill.upgrade0.cost,
- ressource: 'gold'
- }
- }, 'tabletBP', {
- title: this.level.settings.towers.pill.title,
- description: this.level.settings.towers.pill.description,
- props: [
- {
- caption: 'damage',
- value: this.level.settings.towers.pill.upgrade0.bulletDamage
- }, {
- caption: 'reload',
- value: this.level.settings.getReloadString(this.level.settings.towers.pill.upgrade0.reloadTime, this.level.hospital.getUpgradeLevel('supply'))
- }, {
- caption: 'magazine size',
- value: this.level.settings.towers.pill.upgrade0.magazineSize
- }, {
- caption: 'shot precision',
- value: this.level.settings.getPrecisionString(this.level.settings.towers.pill.upgrade0.haziness)
- }
- ]
- }, true, this.level.settings.towers.pill.upgrade0.range);
- return this.level.towerMenu.addButton(4, {
- action: 'antibiotic',
- cost: {
- value: this.level.settings.towers.antibiotic.upgrade0.cost,
- ressource: 'gold'
- }
- }, 'capsuleBP', {
- title: this.level.settings.towers.antibiotic.title,
- description: this.level.settings.towers.antibiotic.description,
- props: [
- {
- caption: 'damage',
- value: this.level.settings.towers.antibiotic.upgrade0.bulletDamage
- }, {
- caption: 'reload',
- value: this.level.settings.getReloadString(this.level.settings.towers.antibiotic.upgrade0.reloadTime, this.level.hospital.getUpgradeLevel('supply'))
- }, {
- caption: 'magazine size',
- value: this.level.settings.towers.antibiotic.upgrade0.magazineSize
- }
- ]
- }, true, this.level.settings.towers.antibiotic.upgrade0.range);
- };
- TowerLocation.prototype.execAction = function(action) {
- return this.level.buildTower(this.index, action);
- };
- return TowerLocation;
- })(createjs.Bitmap);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.TowerRange = (function(superClass) {
- extend(TowerRange, superClass);
- function TowerRange() {
- TowerRange.__super__.constructor.call(this);
- this.alpha = 0.7;
- this.visible = false;
- }
- TowerRange.prototype.load = function(x, y, regX, regY, width, height, newWidth, newHeight) {
- this.x = x;
- this.y = y;
- this.regX = regX;
- this.regY = regY;
- this.visible = true;
- if (newWidth && newHeight) {
- return this.newRange(width, height, newWidth, newHeight);
- } else {
- return this.range(width, height);
- }
- };
- TowerRange.prototype.range = function(width, height) {
- return this.graphics.clear().setStrokeStyle(2).beginStroke(dka.colors.lightBlue).drawEllipse(0, 0, width, height);
- };
- TowerRange.prototype.newRange = function(width, height, newWidth, newHeight) {
- 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);
- };
- TowerRange.prototype.fade = function() {
- return this.visible = false;
- };
- return TowerRange;
- })(createjs.Shape);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Bullet = (function(superClass) {
- extend(Bullet, superClass);
- function Bullet(towerLauncher, disease) {
- Bullet.__super__.constructor.call(this);
- this.towerLauncher = towerLauncher;
- this.disease = disease;
- this.x = towerLauncher.x;
- this.y = towerLauncher.y;
- this.level = towerLauncher.level;
- this.damage = towerLauncher.bulletDamage;
- }
- Bullet.prototype.tick = function() {
- return this.move();
- };
- Bullet.prototype.collideTest = function() {
- if (this.disease && this.disease.alive && this.level.euclidDistance(this.x, this.y, this.disease.x, this.disease.y) < this.hitRadius) {
- return true;
- }
- return false;
- };
- return Bullet;
- })(createjs.Sprite);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.BulletCapsule = (function(superClass) {
- extend(BulletCapsule, superClass);
- function BulletCapsule(towerLauncher, disease) {
- var deltaX, deltaY, nxtWP;
- BulletCapsule.__super__.constructor.call(this, towerLauncher, disease);
- this.radiusDamage = towerLauncher.bulletRadiusDamage;
- this.spriteSheet = dka.academy.assetManager.getAsset('spCapsule');
- this.decalSprite = 'spriteBulletEffect';
- this.hitRadius = 12;
- this.rotationSpeed = (Math.round(Math.random()) * 2 - 1) * 15;
- this.t0 = 0;
- this.t1 = 25;
- if (this.level.moveDiseases) {
- nxtWP = disease.pointToReach + Math.ceil(this.level.distanceBetweenWP * disease.speed);
- if (nxtWP < disease.path.length) {
- this.target = disease.path[nxtWP];
- } else {
- this.target = disease.path[disease.pointToReach];
- }
- } else {
- this.target = new createjs.Point(disease.x, disease.y);
- }
- deltaX = this.target.x - this.x;
- deltaY = this.target.y - this.y;
- this.speedX = deltaX / this.t1;
- this.speedY = (deltaY - this.t1 * this.t1 / 2) / this.t1;
- }
- BulletCapsule.prototype.tick = function() {
- if (this.t0 !== this.t1 + 1) {
- BulletCapsule.__super__.tick.call(this);
- this.rotation += this.rotationSpeed;
- if (this.t0 === this.t1) {
- this.gotoAndPlay(0);
- return this.on('animationend', this.animationend);
- }
- } else {
- return this.impact();
- }
- };
- BulletCapsule.prototype.move = function() {
- this.x = this.towerLauncher.x + this.t0 * this.speedX;
- this.y = this.towerLauncher.y + this.t0 * this.speedY + this.t0 * this.t0 / 2;
- return this.t0++;
- };
- BulletCapsule.prototype.animationend = function() {
- return this.parent.removeChild(this);
- };
- BulletCapsule.prototype.impact = function() {
- var damageToDeal, decal, disease, distanceToDisease, i, range, results;
- this.level.bulletEffectsLayer.addChild(new dka.CapsuleSmoke(this.x, this.y));
- if (!this.collideTest()) {
- decal = new dka.BulletDecal(this.x, this.y, this.level);
- }
- i = 0;
- results = [];
- while (i < this.level.diseasesLayer.numChildren) {
- disease = this.level.diseasesLayer.getChildAt(i);
- range = new geom.Ellipse(this.x, this.y, this.radiusDamage, this.radiusDamage * this.level.coeffPerspective);
- if (disease.type !== 'Bacterium') {
- i++;
- continue;
- }
- if (!range.contains(disease.x, disease.y)) {
- i++;
- continue;
- }
- distanceToDisease = this.level.euclidDistance(this.x, this.y, disease.x, disease.y);
- damageToDeal = 0;
- if (distanceToDisease < this.radiusDamage / 10) {
- damageToDeal = Math.ceil(Math.random() * (this.damage[1] - this.damage[0]) + this.damage[0]);
- } else {
- damageToDeal = Math.ceil(((Math.ceil(Math.random() * (this.damage[1] - this.damage[0]) + this.damage[0])) / distanceToDisease) * 3);
- }
- disease.beDamaged(damageToDeal);
- results.push(i++);
- }
- return results;
- };
- return BulletCapsule;
- })(dka.Bullet);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.BulletTablet = (function(superClass) {
- extend(BulletTablet, superClass);
- function BulletTablet(towerLauncher, disease) {
- BulletTablet.__super__.constructor.call(this, towerLauncher, disease);
- this.haziness = new createjs.Point(this.getHaziness(), this.getHaziness());
- this.target = new createjs.Point(disease.x + this.haziness.x, disease.y + this.haziness.y);
- this.destiny = this.target.clone();
- this.spriteSheet = dka.academy.assetManager.getAsset('spriteTablet');
- this.decalSprite = 'spriteBulletEffect';
- this.acceleration = 17;
- this.hitRadius = 4;
- this.t0 = 0;
- this.t1 = 25;
- this.move();
- }
- BulletTablet.prototype.getHaziness = function() {
- return this.towerLauncher.haziness / -2 + Math.random() * this.towerLauncher.haziness;
- };
- BulletTablet.prototype.tick = function() {
- return BulletTablet.__super__.tick.call(this);
- };
- BulletTablet.prototype.move = function() {
- var angle;
- this.target.x = this.disease ? this.disease.x + this.haziness.x : this.destiny.x;
- this.target.y = this.disease ? this.disease.y + this.haziness.y : this.destiny.y;
- if (this.level.euclidDistance(this.x, this.y, this.target.x, this.target.y) < this.acceleration + 7) {
- this.x = this.target.x;
- this.y = this.target.y;
- return this.impact();
- } else {
- angle = Math.atan2(this.target.y - this.y, this.target.x - this.x);
- this.x += this.acceleration * Math.cos(angle);
- this.y += this.acceleration * Math.sin(angle);
- this.acceleration *= 0.95;
- this.rotation = angle / Math.PI * 180 + 90;
- return this.level.bulletEffectsLayer.addChild(new dka.TabletSmoke(this.x, this.y));
- }
- };
- BulletTablet.prototype.getDamage = function() {
- return Math.ceil(Math.random() * (this.damage[1] - this.damage[0]) + this.damage[0]);
- };
- BulletTablet.prototype.impact = function() {
- var decal;
- this.parent.removeChild(this);
- if (this.collideTest()) {
- this.disease.beDamaged(this.getDamage());
- this.disease.hit();
- return;
- }
- return decal = new dka.BulletDecal(this.x, this.y, this.level);
- };
- return BulletTablet;
- })(dka.Bullet);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.RoadSpawn = (function() {
- function RoadSpawn(wave, road, roadIndex) {
- this.wave = wave;
- this.road = road;
- this.roadIndex = roadIndex;
- this.level = wave.level;
- this.maxDiseasesToPut = this.road.diseasesList.length;
- this.delayForNxtDisease = this.road.diseasesList[0].delay;
- this.finished = false;
- this.diseasesPut = 0;
- this.waitForNewDisease = 0;
- }
- RoadSpawn.prototype.tick = function() {
- if (this.level.moveDiseases) {
- if (this.waitForNewDisease >= this.delayForNxtDisease) {
- this.addDisease();
- }
- if (!this.finished) {
- return this.waitForNewDisease++;
- } else {
- return this.level.lookToLaunchWave();
- }
- }
- };
- RoadSpawn.prototype.addDisease = function() {
- var disease, diseaseName, path;
- path = this.level.waypoints[this.roadIndex][Math.floor(Math.random() * this.level.waypoints[this.roadIndex].length)];
- diseaseName = this.road.diseasesList[this.diseasesPut].dis;
- if (this.level.game.knownDiseases.indexOf(diseaseName) === -1) {
- this.level.game.knownDiseases.push(diseaseName);
- }
- disease = new dka['Disease' + diseaseName](this.level, this.level.waypoints[this.roadIndex], path);
- this.level.diseasesLayer.addChild(disease);
- this.delayForNxtDisease = this.road.diseasesList[this.diseasesPut].delay;
- this.diseasesPut++;
- this.wave.diseasesSpawned++;
- this.waitForNewDisease = 0;
- if (this.diseasesPut === this.maxDiseasesToPut) {
- return this.finished = true;
- }
- };
- return RoadSpawn;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.Wave = (function() {
- function Wave(level) {
- var i, j, len, ref, road;
- this.level = level;
- this.diseasesSpawned = 0;
- this.diseasesKilled = 0;
- this.diseasesArrived = 0;
- this.roads = this.level.waves[level.getFresherWaveIndex() + 1].roads;
- this.roadSpawns = [];
- ref = this.roads;
- for (i = j = 0, len = ref.length; j < len; i = ++j) {
- road = ref[i];
- this.roadSpawns.push(new dka.RoadSpawn(this, road, i));
- }
- }
- Wave.prototype.tickWave = function() {
- var j, len, ref, results, roadSpawn;
- ref = this.roadSpawns;
- results = [];
- for (j = 0, len = ref.length; j < len; j++) {
- roadSpawn = ref[j];
- results.push(roadSpawn.tick());
- }
- return results;
- };
- Wave.prototype.verifFinished = function() {
- var j, len, ref, roadSpawn;
- ref = this.roadSpawns;
- for (j = 0, len = ref.length; j < len; j++) {
- roadSpawn = ref[j];
- if (roadSpawn.finished === false) {
- return;
- }
- }
- if (this.diseasesKilled + this.diseasesArrived === this.diseasesSpawned) {
- return this.level.removeWave(this.level.currentWaves.indexOf(this));
- }
- };
- return Wave;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Level = (function(superClass) {
- extend(Level, superClass);
- function Level(game) {
- this.tickLevel = bind(this.tickLevel, this);
- Level.__super__.constructor.call(this);
- this.game = game;
- this.settings = game.settings;
- this.coeffPerspective = 0.7;
- this.distanceBetweenWP = 5;
- this.currentWaves = [];
- this.locations = [];
- this.waitForNewWave = 0;
- this.delayForNxtWave = 0;
- this.finished = false;
- this.paused = false;
- this.pausable = true;
- this.moveDiseases = true;
- this.nbrWaves = this.waves.length;
- this.on('added', this.init);
- }
- Level.prototype.setEvents = function() {
- this.GOLD_CHANGED_EVENT = 'goldchanged';
- this.DNA_CHANGED_EVENT = 'dnachanged';
- this.TOWER_MENU_OPEN_EVENT = 'towermenuopen';
- this.TOWER_BUILT_EVENT = 'towerbuilt';
- this.MAGAZINE_RELOADED_EVENT = 'magazinereloaded';
- this.WAVE_FLAG_CLICKED_EVENT = 'waveflagclicked';
- this.HOSPITAL_CLICKED_EVENT = 'hospitalclicked';
- return this.FEVER_CLICKED_EVENT = 'feverclicked';
- };
- Level.prototype.init = function() {
- var i, k, ref;
- this.addLayers();
- this.addBackground();
- this.buildHospital();
- for (i = k = 0, ref = this.towers.length; k < ref; i = k += 1) {
- this.addlocation(i);
- if (this.towersToBePlaced[i].type !== '') {
- this.buildTower(i, this.towersToBePlaced[i].type, true, this.towersToBePlaced[i].upgradeLevel);
- }
- }
- return typeof this.buildSpecial === "function" ? this.buildSpecial() : void 0;
- };
- Level.prototype.addLayers = function() {
- this.backgroundLayer = new createjs.Container();
- this.backgroundLayer.on('click', function() {
- return this.parent.towerMenu.fade();
- });
- this.decalsLayer = new createjs.Container();
- this.bulletEffectsLayer = new createjs.Container();
- this.bulletEffectsLayer.on('click', function() {
- return this.parent.towerMenu.fade();
- });
- this.antibodiesLayer = new createjs.Container();
- this.diseasesLayer = new createjs.Container();
- this.diseasesLayer.on('click', function() {
- return this.parent.towerMenu.fade();
- });
- this.towersLayer = new createjs.Container();
- this.onlyTowersLayer = new createjs.Container();
- this.cellsPatrolLayer = new createjs.Container();
- this.bulletsLayer = new createjs.Container();
- this.towerRange = new dka.TowerRange();
- this.towerMenu = new dka.HexaMenu(this);
- this.ui = new dka.Ui(this);
- this.screenPause = new dka.ScreenPause(this.ui);
- this.screenEncyclopedia = new dka.ScreenEncyclopedia(this.ui);
- this.hintBox = new dka.HintBox();
- this.towersLayer.addChild(this.onlyTowersLayer, this.cellsPatrolLayer, this.bulletsLayer, this.towerRange, this.towerMenu);
- return this.addChild(this.backgroundLayer, this.antibodiesLayer, this.decalsLayer, this.diseasesLayer, this.bulletEffectsLayer, this.towersLayer, this.ui, this.screenPause, this.screenEncyclopedia, this.hintBox);
- };
- Level.prototype.addBackground = function() {
- return this.backgroundLayer.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset(this.map)));
- };
- Level.prototype.showPaths = function() {
- var i, j, k, l, len, len1, path, paths, ref, road;
- paths = new createjs.Container();
- this.backgroundLayer.addChild(paths);
- ref = this.waypoints;
- for (i = k = 0, len = ref.length; k < len; i = ++k) {
- road = ref[i];
- for (j = l = 0, len1 = road.length; l < len1; j = ++l) {
- path = road[j];
- this.showPath(path, i, j, paths);
- }
- }
- return paths.cache(0, 0, canvasWidth, canvasHeight);
- };
- Level.prototype.showPath = function(path, i, j, paths) {
- var k, pathShape, ref, results, wp;
- if (i == null) {
- i = 0;
- }
- if (j == null) {
- j = 0;
- }
- pathShape = new createjs.Shape().set({
- alpha: 0.5
- });
- paths.addChild(pathShape);
- results = [];
- for (wp = k = 0, ref = path.length - 1; k < ref; wp = k += 1) {
- 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());
- }
- return results;
- };
- Level.prototype.euclidDistance = function(AX, AY, BX, BY) {
- return Math.sqrt(Math.pow(AX - BX, 2) + Math.pow(AY - BY, 2));
- };
- Level.prototype.tickLevel = function() {
- var base, i;
- if (this.getFresherWave()) {
- this.getFresherWave().tickWave();
- } else {
- this.lookToLaunchWave();
- }
- i = 0;
- while (i < this.diseasesLayer.numChildren) {
- this.diseasesLayer.getChildAt(i).tick();
- i++;
- }
- i = 0;
- while (i < this.cellsPatrolLayer.numChildren) {
- this.cellsPatrolLayer.getChildAt(i).tick();
- i++;
- }
- i = 0;
- while (i < this.antibodiesLayer.numChildren) {
- this.antibodiesLayer.getChildAt(i).tick();
- i++;
- }
- i = 0;
- while (i < this.onlyTowersLayer.numChildren) {
- if (typeof (base = this.onlyTowersLayer.getChildAt(i)).tick === "function") {
- base.tick();
- }
- i++;
- }
- i = 0;
- while (i < this.bulletsLayer.numChildren) {
- this.bulletsLayer.getChildAt(i).tick();
- i++;
- }
- return gameStage.update();
- };
- Level.prototype.lookToLaunchWave = function() {
- var ready;
- if (!this.isLastWaveLaunched()) {
- ready = this.currentWaves.every(function(element) {
- if (element) {
- return element.roadSpawns.every(function(element) {
- return element.finished;
- });
- } else {
- return true;
- }
- });
- if (ready) {
- this.waitForNewWave++;
- if (!this.ui.waveFlags.length) {
- this.ui.showWaveFlags();
- }
- }
- if (this.waitForNewWave >= this.delayForNxtWave) {
- this.ui.removeWaveFlags();
- this.addWave();
- return this.ui.hudBar.updateWaves();
- }
- }
- };
- Level.prototype.addWave = function() {
- if (this.isLastWaveLaunched()) {
- return;
- }
- this.currentWaves.push(new dka.Wave(this));
- this.waitForNewWave = 0;
- if (!this.isLastWaveLaunched()) {
- this.delayForNxtWave = this.waves[this.getFresherWaveIndex() + 1].delay;
- }
- if (this.level === 0) {
- if ((this.getFresherWaveIndex() + 1) === 2) {
- return this.ui.tutoBubles.addChild(new dka.TutoBubble('Click here!', new createjs.Point(this.ui.buttonsPositions[1], 60), this, this.FEVER_CLICKED_EVENT, true));
- } else {
- if ((this.getFresherWaveIndex() + 1) === 3) {
- 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));
- }
- }
- }
- };
- Level.prototype.removeWave = function(waveToRemove) {
- if (typeof waveToRemove === 'number') {
- this.currentWaves[waveToRemove] = null;
- } else {
- this.currentWaves[this.currentWaves.indexOf(waveToRemove)] = null;
- }
- return this.verifFinished();
- };
- Level.prototype.isLastWaveLaunched = function() {
- return !this.waves[this.getFresherWaveIndex() + 1];
- };
- Level.prototype.getFresherWaveIndex = function() {
- return this.currentWaves.length - 1;
- };
- Level.prototype.isVisibleByPlayer = function(x, y) {
- if ((0 <= x && x <= canvasWidth) && (0 <= y && y <= canvasHeight)) {
- return true;
- }
- return false;
- };
- Level.prototype.getFresherWave = function() {
- return this.currentWaves[this.currentWaves.length - 1];
- };
- Level.prototype.verifFinished = function() {
- var navWaves, nbrWavesFinished, verif;
- verif = false;
- nbrWavesFinished = 0;
- if (this.currentWaves.length === this.nbrWaves) {
- navWaves = 0;
- while (navWaves <= (this.currentWaves.length - 1)) {
- if (this.currentWaves[navWaves] === null) {
- nbrWavesFinished++;
- }
- navWaves++;
- }
- if (nbrWavesFinished === this.currentWaves.length) {
- verif = true;
- }
- }
- if (verif) {
- this.finished = true;
- return createjs.Tween.get(gameStage, {
- useTicks: true
- }).wait(60).call((function(_this) {
- return function() {
- return _this.finish();
- };
- })(this));
- }
- };
- Level.prototype.addLevelTicker = function() {
- return this.tickWrapper = createjs.Ticker.on('tick', this.tickLevel);
- };
- Level.prototype.removeLevelTicker = function() {
- return createjs.Ticker.off('tick', this.tickWrapper);
- };
- Level.prototype.finish = function() {
- this.removeLevelTicker();
- dka.academy.dataManager.saveLevelProgress();
- dka.academy.addStageTicker();
- dka.academy.game.addGold(this.playerGold, this.level);
- return this.ui.endScreen();
- };
- Level.prototype.showTowerRange = function(x, y, range) {
- if (range instanceof Array) {
- 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);
- } else {
- return this.towerRange.load(x, y, range, range * this.coeffPerspective, 2 * range, 2 * range * this.coeffPerspective);
- }
- };
- Level.prototype.addlocation = function(index) {
- var location;
- location = new dka.TowerLocation(this.towers[index].x, this.towers[index].y, this, index);
- this.onlyTowersLayer.addChildAt(location, index);
- if (TXT_NBR) {
- return this.ui.addChild(new createjs.Text(index, '20px Arial', '#FFFFFF').set({
- x: this.towers[index].x,
- y: this.towers[index].y - 10,
- textAlign: 'center'
- }));
- }
- };
- Level.prototype.buildTower = function(location, typeTower, free, upgradeLevel) {
- var tower;
- switch (typeTower) {
- case 'pill':
- tower = new dka.TowerPill(this.towers[location].x, this.towers[location].y, location, this, free);
- break;
- case 'antibiotic':
- tower = new dka.TowerAntibiotic(this.towers[location].x, this.towers[location].y, location, this, free);
- break;
- case 'cellB':
- tower = new dka.TowerCellB(this.towers[location].x, this.towers[location].y, location, this, free);
- break;
- case 'cellMacrophage':
- tower = new dka.TowerCellMacrophage(this.towers[location].x, this.towers[location].y, location, this, free);
- }
- if (upgradeLevel > 0) {
- tower.upgrade(true, upgradeLevel);
- }
- this.onlyTowersLayer.removeChildAt(location);
- return this.onlyTowersLayer.addChildAt(tower, location);
- };
- Level.prototype.buildHospital = function() {
- this.hospital = new dka.TowerHospital(new createjs.Point(this.hospitalPosition.x, this.hospitalPosition.y), this);
- return this.onlyTowersLayer.addChild(this.hospital);
- };
- Level.prototype.getHospital = function() {
- return this.hospital;
- };
- Level.prototype.addGold = function(gold) {
- this.playerGold += gold;
- this.dispatchEvent(new createjs.Event('goldchanged', true, false));
- return this.ui.hudBar.updateGold();
- };
- Level.prototype.addDna = function(dna) {
- this.playerDna += dna;
- this.dispatchEvent(new createjs.Event('dnachanged', true, false));
- return this.ui.hudBar.updateDna();
- };
- Level.prototype.loseLives = function(lives) {
- this.playerLives -= lives;
- return this.ui.hudBar.updateLives();
- };
- Level.prototype.addToolTip = function(target, hintData) {
- this.hintBox.load(target, hintData);
- return this.hintBox.visible = true;
- };
- Level.prototype.removeToolTip = function() {
- return this.hintBox.hide();
- };
- return Level;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Level0 = (function(superClass) {
- extend(Level0, superClass);
- function Level0(game) {
- this.level = 0;
- this.name = 'Tuto';
- this.map = 'map0';
- this.hospitalPosition = {
- x: 682,
- y: 122
- };
- this.hospitalImage = 'hospital0';
- this.hospitalSize = {
- regX: 144 / 2,
- regY: 59 / 2,
- width: 144,
- height: 59
- };
- this.goalMarkerPosition = {
- x: 820,
- y: 280
- };
- this.setEvents();
- this.on(this.TOWER_BUILT_EVENT, function() {
- if (this.getFresherWaveIndex() === -1 && !this.ui.callTutoBubble) {
- this.ui.callTutoBubble = true;
- return this.ui.tutoBubles.addChild(new dka.TutoBubble('Call wave!', new createjs.Point(199, 70), this, this.WAVE_FLAG_CLICKED_EVENT, true));
- }
- });
- this.placeDate = 'Africa - Prehistory';
- this.hintLabsMsg = "Hello! I will be your teacher during\nall the time of this game...`Try to be brillant !";
- this.towers = [
- {
- x: 274,
- y: 126,
- cell: {
- road: 0,
- path: 0
- }
- }, {
- x: 287,
- y: 280,
- cell: {
- road: 0,
- path: 0
- }
- }, {
- x: 214,
- y: 367,
- cell: {
- road: 0,
- path: 0
- }
- }, {
- x: 447,
- y: 380,
- cell: {
- road: 0,
- path: 0
- }
- }, {
- x: 526,
- y: 250,
- cell: {
- road: 0,
- path: 0
- }
- }, {
- x: 766,
- y: 233,
- cell: {
- road: 0,
- path: 0
- }
- }, {
- x: 690,
- y: 358,
- cell: {
- road: 0,
- path: 0
- }
- }
- ];
- this.waypoints = [
- [
- [
- {
- x: 224,
- y: -24
- }, {
- x: 222.92,
- y: -19.12
- }, {
- x: 221.83,
- y: -14.24
- }, {
- x: 220.75,
- y: -9.36
- }, {
- x: 219.66,
- y: -4.48
- }, {
- x: 218.58,
- y: 0.4
- }, {
- x: 217.49,
- y: 5.29
- }, {
- x: 216.41,
- y: 10.17
- }, {
- x: 214.49,
- y: 14.78
- }, {
- x: 212.57,
- y: 19.4
- }, {
- x: 210.65,
- y: 24.02
- }, {
- x: 208.74,
- y: 28.64
- }, {
- x: 207.04,
- y: 33.34
- }, {
- x: 205.34,
- y: 38.04
- }, {
- x: 204.16,
- y: 42.9
- }, {
- x: 202.98,
- y: 47.76
- }, {
- x: 201.8,
- y: 52.62
- }, {
- x: 200.61,
- y: 57.48
- }, {
- x: 199.43,
- y: 62.33
- }, {
- x: 199.57,
- y: 67.33
- }, {
- x: 199.71,
- y: 72.33
- }, {
- x: 199.84,
- y: 77.33
- }, {
- x: 199.98,
- y: 82.33
- }, {
- x: 200.93,
- y: 87.24
- }, {
- x: 201.87,
- y: 92.15
- }, {
- x: 202.82,
- y: 97.06
- }, {
- x: 202.87,
- y: 102.06
- }, {
- x: 202.93,
- y: 107.06
- }, {
- x: 202.98,
- y: 112.06
- }, {
- x: 203.28,
- y: 117.05
- }, {
- x: 203.58,
- y: 122.04
- }, {
- x: 203.88,
- y: 127.03
- }, {
- x: 203.91,
- y: 132.03
- }, {
- x: 203.94,
- y: 137.03
- }, {
- x: 203.97,
- y: 142.03
- }, {
- x: 204,
- y: 147.03
- }, {
- x: 206.24,
- y: 151.5
- }, {
- x: 208.48,
- y: 155.97
- }, {
- x: 210.72,
- y: 160.44
- }, {
- x: 212.96,
- y: 164.91
- }, {
- x: 213.52,
- y: 169.88
- }, {
- x: 214.08,
- y: 174.85
- }, {
- x: 214.64,
- y: 179.82
- }, {
- x: 215.2,
- y: 184.78
- }, {
- x: 216.71,
- y: 189.55
- }, {
- x: 218.21,
- y: 194.32
- }, {
- x: 219.71,
- y: 199.09
- }, {
- x: 219.79,
- y: 204.09
- }, {
- x: 219.86,
- y: 209.09
- }, {
- x: 219.93,
- y: 214.09
- }, {
- x: 220,
- y: 219.09
- }, {
- x: 220,
- y: 224.09
- }, {
- x: 220,
- y: 229.09
- }, {
- x: 220,
- y: 234.09
- }, {
- x: 217.12,
- y: 238.17
- }, {
- x: 214.23,
- y: 242.26
- }, {
- x: 212.66,
- y: 247
- }, {
- x: 211.08,
- y: 251.75
- }, {
- x: 209.5,
- y: 256.49
- }, {
- x: 206.17,
- y: 260.22
- }, {
- x: 202.84,
- y: 263.95
- }, {
- x: 199.5,
- y: 267.67
- }, {
- x: 197.44,
- y: 272.23
- }, {
- x: 195.37,
- y: 276.78
- }, {
- x: 193.3,
- y: 281.33
- }, {
- x: 190.93,
- y: 285.73
- }, {
- x: 188.55,
- y: 290.13
- }, {
- x: 186.17,
- y: 294.53
- }, {
- x: 184.32,
- y: 299.17
- }, {
- x: 182.47,
- y: 303.82
- }, {
- x: 178.26,
- y: 306.51
- }, {
- x: 174.05,
- y: 309.21
- }, {
- x: 169.84,
- y: 311.9
- }, {
- x: 165.63,
- y: 314.6
- }, {
- x: 161.8,
- y: 317.82
- }, {
- x: 157.98,
- y: 321.05
- }, {
- x: 154.16,
- y: 324.27
- }, {
- x: 150.34,
- y: 327.5
- }, {
- x: 146.52,
- y: 330.72
- }, {
- x: 144.59,
- y: 335.33
- }, {
- x: 142.66,
- y: 339.94
- }, {
- x: 140.72,
- y: 344.56
- }, {
- x: 138.79,
- y: 349.17
- }, {
- x: 136.86,
- y: 353.78
- }, {
- x: 134.93,
- y: 358.39
- }, {
- x: 133,
- y: 363
- }, {
- x: 131.71,
- y: 367.83
- }, {
- x: 130.42,
- y: 372.67
- }, {
- x: 129.13,
- y: 377.5
- }, {
- x: 127.85,
- y: 382.33
- }, {
- x: 126.56,
- y: 387.16
- }, {
- x: 125.27,
- y: 391.99
- }, {
- x: 125.64,
- y: 396.98
- }, {
- x: 126.02,
- y: 401.96
- }, {
- x: 126.39,
- y: 406.95
- }, {
- x: 126.77,
- y: 411.93
- }, {
- x: 127.14,
- y: 416.92
- }, {
- x: 129.54,
- y: 421.31
- }, {
- x: 131.93,
- y: 425.7
- }, {
- x: 134.32,
- y: 430.09
- }, {
- x: 136.72,
- y: 434.48
- }, {
- x: 141.6,
- y: 435.54
- }, {
- x: 146.49,
- y: 436.59
- }, {
- x: 151.38,
- y: 437.65
- }, {
- x: 156.37,
- y: 437.44
- }, {
- x: 161.37,
- y: 437.23
- }, {
- x: 166.37,
- y: 437.03
- }, {
- x: 171.34,
- y: 436.54
- }, {
- x: 176.32,
- y: 436.05
- }, {
- x: 181.29,
- y: 435.56
- }, {
- x: 186.27,
- y: 435.07
- }, {
- x: 191.21,
- y: 434.3
- }, {
- x: 196.15,
- y: 433.53
- }, {
- x: 201.09,
- y: 432.76
- }, {
- x: 206.03,
- y: 432
- }, {
- x: 211.02,
- y: 432.38
- }, {
- x: 216,
- y: 432.76
- }, {
- x: 220.99,
- y: 433.15
- }, {
- x: 225.97,
- y: 433.53
- }, {
- x: 230.96,
- y: 433.92
- }, {
- x: 234.85,
- y: 430.78
- }, {
- x: 238.75,
- y: 427.65
- }, {
- x: 242.64,
- y: 424.51
- }, {
- x: 246.53,
- y: 421.38
- }, {
- x: 251.22,
- y: 419.63
- }, {
- x: 255.9,
- y: 417.88
- }, {
- x: 260.59,
- y: 416.14
- }, {
- x: 265.27,
- y: 414.39
- }, {
- x: 269.96,
- y: 412.64
- }, {
- x: 273.2,
- y: 408.83
- }, {
- x: 276.43,
- y: 405.02
- }, {
- x: 279.67,
- y: 401.21
- }, {
- x: 283.22,
- y: 397.69
- }, {
- x: 286.78,
- y: 394.18
- }, {
- x: 290.33,
- y: 390.66
- }, {
- x: 294.25,
- y: 387.55
- }, {
- x: 298.17,
- y: 384.45
- }, {
- x: 301.63,
- y: 380.84
- }, {
- x: 305.09,
- y: 377.23
- }, {
- x: 308.54,
- y: 373.61
- }, {
- x: 312,
- y: 370
- }, {
- x: 315.41,
- y: 366.35
- }, {
- x: 318.82,
- y: 362.69
- }, {
- x: 322.23,
- y: 359.03
- }, {
- x: 325.65,
- y: 355.38
- }, {
- x: 329.76,
- y: 352.54
- }, {
- x: 333.87,
- y: 349.69
- }, {
- x: 337.98,
- y: 346.85
- }, {
- x: 342.1,
- y: 344.01
- }, {
- x: 346.21,
- y: 341.16
- }, {
- x: 350.7,
- y: 338.96
- }, {
- x: 355.19,
- y: 336.76
- }, {
- x: 359.68,
- y: 334.56
- }, {
- x: 364.17,
- y: 332.37
- }, {
- x: 368.66,
- y: 330.17
- }, {
- x: 373.02,
- y: 327.72
- }, {
- x: 377.38,
- y: 325.27
- }, {
- x: 381.74,
- y: 322.83
- }, {
- x: 386.1,
- y: 320.38
- }, {
- x: 390.99,
- y: 319.34
- }, {
- x: 395.89,
- y: 318.3
- }, {
- x: 400.78,
- y: 317.26
- }, {
- x: 405.77,
- y: 316.99
- }, {
- x: 410.76,
- y: 316.72
- }, {
- x: 415.75,
- y: 316.45
- }, {
- x: 420.75,
- y: 316.18
- }, {
- x: 425.74,
- y: 315.91
- }, {
- x: 430.73,
- y: 315.67
- }, {
- x: 435.73,
- y: 315.44
- }, {
- x: 440.72,
- y: 315.2
- }, {
- x: 445.72,
- y: 314.97
- }, {
- x: 450.72,
- y: 314.97
- }, {
- x: 455.72,
- y: 314.98
- }, {
- x: 460.72,
- y: 314.99
- }, {
- x: 465.72,
- y: 315
- }, {
- x: 470.64,
- y: 314.1
- }, {
- x: 475.55,
- y: 313.2
- }, {
- x: 480.47,
- y: 312.29
- }, {
- x: 485.39,
- y: 311.39
- }, {
- x: 490.31,
- y: 310.49
- }, {
- x: 495.23,
- y: 309.59
- }, {
- x: 500.08,
- y: 308.41
- }, {
- x: 504.94,
- y: 307.23
- }, {
- x: 509.8,
- y: 306.05
- }, {
- x: 514.73,
- y: 305.22
- }, {
- x: 519.66,
- y: 304.4
- }, {
- x: 524.6,
- y: 303.57
- }, {
- x: 529.53,
- y: 302.75
- }, {
- x: 534.46,
- y: 301.93
- }, {
- x: 539.39,
- y: 301.1
- }, {
- x: 544.34,
- y: 300.37
- }, {
- x: 549.28,
- y: 299.63
- }, {
- x: 554.23,
- y: 298.9
- }, {
- x: 559.17,
- y: 298.16
- }, {
- x: 564.12,
- y: 297.43
- }, {
- x: 569.07,
- y: 296.69
- }, {
- x: 574.04,
- y: 296.22
- }, {
- x: 579.02,
- y: 295.75
- }, {
- x: 584,
- y: 295.28
- }, {
- x: 588.98,
- y: 294.81
- }, {
- x: 593.8,
- y: 293.48
- }, {
- x: 598.62,
- y: 292.15
- }, {
- x: 603.43,
- y: 290.82
- }, {
- x: 608.25,
- y: 289.48
- }, {
- x: 613.04,
- y: 288.03
- }, {
- x: 617.82,
- y: 286.57
- }, {
- x: 622.61,
- y: 285.12
- }, {
- x: 627.59,
- y: 284.69
- }, {
- x: 632.57,
- y: 284.27
- }, {
- x: 637.55,
- y: 283.84
- }, {
- x: 642.53,
- y: 283.41
- }, {
- x: 647.51,
- y: 282.98
- }, {
- x: 652.5,
- y: 282.56
- }, {
- x: 657.48,
- y: 282.13
- }, {
- x: 662.47,
- y: 282.29
- }, {
- x: 667.47,
- y: 282.46
- }, {
- x: 672.47,
- y: 282.62
- }, {
- x: 677.47,
- y: 282.79
- }, {
- x: 682.46,
- y: 282.95
- }, {
- x: 687.45,
- y: 283.28
- }, {
- x: 692.44,
- y: 283.62
- }, {
- x: 697.43,
- y: 283.95
- }, {
- x: 702.42,
- y: 284.29
- }, {
- x: 707.41,
- y: 284.62
- }, {
- x: 712.4,
- y: 284.96
- }, {
- x: 717.38,
- y: 285.36
- }, {
- x: 722.36,
- y: 285.75
- }, {
- x: 727.35,
- y: 286.15
- }, {
- x: 732.33,
- y: 286.55
- }, {
- x: 737.32,
- y: 286.95
- }, {
- x: 742.2,
- y: 288
- }, {
- x: 747.09,
- y: 289.06
- }, {
- x: 751.98,
- y: 290.11
- }, {
- x: 756.87,
- y: 291.17
- }, {
- x: 761.75,
- y: 292.22
- }, {
- x: 766.64,
- y: 293.28
- }, {
- x: 771.53,
- y: 294.33
- }, {
- x: 776.43,
- y: 295.3
- }, {
- x: 781.34,
- y: 296.28
- }, {
- x: 786.24,
- y: 297.25
- }, {
- x: 791.15,
- y: 298.23
- }, {
- x: 795.7,
- y: 300.29
- }, {
- x: 800.26,
- y: 302.34
- }, {
- x: 804.82,
- y: 304.4
- }, {
- x: 809.37,
- y: 306.46
- }, {
- x: 813.93,
- y: 308.52
- }, {
- x: 818.92,
- y: 308.9
- }, {
- x: 823.9,
- y: 309.29
- }, {
- x: 828.89,
- y: 309.67
- }, {
- x: 833.87,
- y: 310.06
- }, {
- x: 838.86,
- y: 310.45
- }, {
- x: 843.84,
- y: 310.83
- }, {
- x: 848.84,
- y: 311.02
- }, {
- x: 853.83,
- y: 311.21
- }, {
- x: 858.83,
- y: 311.39
- }, {
- x: 863.83,
- y: 311.58
- }, {
- x: 868.82,
- y: 311.77
- }, {
- x: 873.82,
- y: 311.96
- }, {
- x: 878.78,
- y: 312.56
- }, {
- x: 883.75,
- y: 313.16
- }, {
- x: 888.71,
- y: 313.76
- }, {
- x: 893.68,
- y: 314.36
- }, {
- x: 898.64,
- y: 314.96
- }
- ], [
- {
- x: 205,
- y: -22
- }, {
- x: 203.49,
- y: -17.23
- }, {
- x: 201.98,
- y: -12.47
- }, {
- x: 200.47,
- y: -7.7
- }, {
- x: 198.96,
- y: -2.94
- }, {
- x: 197.44,
- y: 1.83
- }, {
- x: 195.93,
- y: 6.6
- }, {
- x: 194.42,
- y: 11.36
- }, {
- x: 192.91,
- y: 16.13
- }, {
- x: 191.4,
- y: 20.9
- }, {
- x: 190.01,
- y: 25.7
- }, {
- x: 188.63,
- y: 30.5
- }, {
- x: 187.24,
- y: 35.31
- }, {
- x: 185.85,
- y: 40.11
- }, {
- x: 184.47,
- y: 44.92
- }, {
- x: 183.08,
- y: 49.72
- }, {
- x: 182.06,
- y: 54.61
- }, {
- x: 181.03,
- y: 59.51
- }, {
- x: 180.01,
- y: 64.4
- }, {
- x: 178.98,
- y: 69.3
- }, {
- x: 177.96,
- y: 74.19
- }, {
- x: 178.35,
- y: 79.17
- }, {
- x: 178.75,
- y: 84.16
- }, {
- x: 179.14,
- y: 89.14
- }, {
- x: 179.54,
- y: 94.13
- }, {
- x: 179.93,
- y: 99.11
- }, {
- x: 179.94,
- y: 104.11
- }, {
- x: 179.95,
- y: 109.11
- }, {
- x: 179.97,
- y: 114.11
- }, {
- x: 179.98,
- y: 119.11
- }, {
- x: 179.99,
- y: 124.11
- }, {
- x: 180.01,
- y: 129.11
- }, {
- x: 181.22,
- y: 133.96
- }, {
- x: 182.44,
- y: 138.81
- }, {
- x: 183.65,
- y: 143.66
- }, {
- x: 184.87,
- y: 148.51
- }, {
- x: 186.09,
- y: 153.36
- }, {
- x: 187.3,
- y: 158.21
- }, {
- x: 187.73,
- y: 163.19
- }, {
- x: 188.15,
- y: 168.17
- }, {
- x: 188.57,
- y: 173.16
- }, {
- x: 188.99,
- y: 178.14
- }, {
- x: 189.42,
- y: 183.12
- }, {
- x: 189.84,
- y: 188.1
- }, {
- x: 189.53,
- y: 193.09
- }, {
- x: 189.23,
- y: 198.08
- }, {
- x: 188.92,
- y: 203.07
- }, {
- x: 188.61,
- y: 208.07
- }, {
- x: 188.3,
- y: 213.06
- }, {
- x: 188,
- y: 218.05
- }, {
- x: 186.14,
- y: 222.69
- }, {
- x: 184.28,
- y: 227.33
- }, {
- x: 182.42,
- y: 231.97
- }, {
- x: 180.56,
- y: 236.61
- }, {
- x: 178.7,
- y: 241.25
- }, {
- x: 176.84,
- y: 245.9
- }, {
- x: 174.35,
- y: 250.23
- }, {
- x: 171.86,
- y: 254.57
- }, {
- x: 169.37,
- y: 258.9
- }, {
- x: 166.88,
- y: 263.24
- }, {
- x: 164.39,
- y: 267.57
- }, {
- x: 161.9,
- y: 271.91
- }, {
- x: 160.01,
- y: 276.54
- }, {
- x: 158.12,
- y: 281.17
- }, {
- x: 156.22,
- y: 285.79
- }, {
- x: 154.33,
- y: 290.42
- }, {
- x: 152.44,
- y: 295.05
- }, {
- x: 150.54,
- y: 299.68
- }, {
- x: 146.79,
- y: 302.98
- }, {
- x: 143.04,
- y: 306.28
- }, {
- x: 139.28,
- y: 309.59
- }, {
- x: 135.53,
- y: 312.89
- }, {
- x: 131.78,
- y: 316.2
- }, {
- x: 129.2,
- y: 320.48
- }, {
- x: 126.61,
- y: 324.76
- }, {
- x: 124.03,
- y: 329.04
- }, {
- x: 121.45,
- y: 333.32
- }, {
- x: 118.87,
- y: 337.61
- }, {
- x: 116.29,
- y: 341.89
- }, {
- x: 113.71,
- y: 346.17
- }, {
- x: 111.12,
- y: 350.45
- }, {
- x: 109.29,
- y: 355.1
- }, {
- x: 107.45,
- y: 359.75
- }, {
- x: 105.61,
- y: 364.4
- }, {
- x: 103.77,
- y: 369.05
- }, {
- x: 103.53,
- y: 374.05
- }, {
- x: 103.29,
- y: 379.04
- }, {
- x: 103.05,
- y: 384.03
- }, {
- x: 102.81,
- y: 389.03
- }, {
- x: 102.57,
- y: 394.02
- }, {
- x: 102.33,
- y: 399.02
- }, {
- x: 102.1,
- y: 404.01
- }, {
- x: 102.46,
- y: 409
- }, {
- x: 102.82,
- y: 413.98
- }, {
- x: 103.18,
- y: 418.97
- }, {
- x: 103.54,
- y: 423.96
- }, {
- x: 103.91,
- y: 428.94
- }, {
- x: 104.27,
- y: 433.93
- }, {
- x: 104.63,
- y: 438.92
- }, {
- x: 104.99,
- y: 443.91
- }, {
- x: 109.63,
- y: 445.78
- }, {
- x: 114.27,
- y: 447.65
- }, {
- x: 118.9,
- y: 449.52
- }, {
- x: 123.54,
- y: 451.39
- }, {
- x: 128.18,
- y: 453.26
- }, {
- x: 133.03,
- y: 454.48
- }, {
- x: 137.88,
- y: 455.7
- }, {
- x: 142.72,
- y: 456.91
- }, {
- x: 147.57,
- y: 458.13
- }, {
- x: 152.42,
- y: 459.35
- }, {
- x: 157.27,
- y: 460.56
- }, {
- x: 162.12,
- y: 461.78
- }, {
- x: 167.11,
- y: 461.44
- }, {
- x: 172.1,
- y: 461.1
- }, {
- x: 177.09,
- y: 460.76
- }, {
- x: 182.08,
- y: 460.42
- }, {
- x: 187.07,
- y: 460.08
- }, {
- x: 192.05,
- y: 459.74
- }, {
- x: 197.04,
- y: 459.41
- }, {
- x: 202.03,
- y: 459.07
- }, {
- x: 206.95,
- y: 458.16
- }, {
- x: 211.87,
- y: 457.26
- }, {
- x: 216.78,
- y: 456.35
- }, {
- x: 221.7,
- y: 455.45
- }, {
- x: 226.62,
- y: 454.54
- }, {
- x: 231.54,
- y: 453.64
- }, {
- x: 236.45,
- y: 452.73
- }, {
- x: 241,
- y: 450.65
- }, {
- x: 245.54,
- y: 448.56
- }, {
- x: 250.09,
- y: 446.48
- }, {
- x: 254.63,
- y: 444.39
- }, {
- x: 259.18,
- y: 442.31
- }, {
- x: 263.72,
- y: 440.22
- }, {
- x: 268.27,
- y: 438.14
- }, {
- x: 272.81,
- y: 436.05
- }, {
- x: 277.35,
- y: 433.97
- }, {
- x: 281.9,
- y: 431.88
- }, {
- x: 286.44,
- y: 429.8
- }, {
- x: 290.46,
- y: 426.82
- }, {
- x: 294.47,
- y: 423.84
- }, {
- x: 298.49,
- y: 420.85
- }, {
- x: 302.5,
- y: 417.87
- }, {
- x: 306.52,
- y: 414.89
- }, {
- x: 310.53,
- y: 411.91
- }, {
- x: 314.54,
- y: 408.93
- }, {
- x: 318.56,
- y: 405.95
- }, {
- x: 322.57,
- y: 402.97
- }, {
- x: 326.59,
- y: 399.99
- }, {
- x: 330.6,
- y: 397.01
- }, {
- x: 334.62,
- y: 394.03
- }, {
- x: 338.62,
- y: 391.03
- }, {
- x: 342.62,
- y: 388.03
- }, {
- x: 346.62,
- y: 385.03
- }, {
- x: 350.62,
- y: 382.03
- }, {
- x: 354.62,
- y: 379.03
- }, {
- x: 358.62,
- y: 376.03
- }, {
- x: 362.62,
- y: 373.03
- }, {
- x: 366.62,
- y: 370.03
- }, {
- x: 370.62,
- y: 367.03
- }, {
- x: 374.96,
- y: 364.56
- }, {
- x: 379.31,
- y: 362.08
- }, {
- x: 383.65,
- y: 359.61
- }, {
- x: 388,
- y: 357.13
- }, {
- x: 392.34,
- y: 354.66
- }, {
- x: 396.68,
- y: 352.18
- }, {
- x: 401.52,
- y: 350.89
- }, {
- x: 406.35,
- y: 349.6
- }, {
- x: 411.18,
- y: 348.31
- }, {
- x: 416.01,
- y: 347.02
- }, {
- x: 420.84,
- y: 345.72
- }, {
- x: 425.67,
- y: 344.43
- }, {
- x: 430.5,
- y: 343.14
- }, {
- x: 435.33,
- y: 341.85
- }, {
- x: 440.16,
- y: 340.56
- }, {
- x: 444.99,
- y: 339.27
- }, {
- x: 449.99,
- y: 339.12
- }, {
- x: 454.98,
- y: 338.97
- }, {
- x: 459.98,
- y: 338.82
- }, {
- x: 464.98,
- y: 338.67
- }, {
- x: 469.98,
- y: 338.51
- }, {
- x: 474.98,
- y: 338.36
- }, {
- x: 479.97,
- y: 338.21
- }, {
- x: 484.97,
- y: 338.06
- }, {
- x: 489.97,
- y: 337.89
- }, {
- x: 494.97,
- y: 337.72
- }, {
- x: 499.96,
- y: 337.55
- }, {
- x: 504.96,
- y: 337.38
- }, {
- x: 509.96,
- y: 337.21
- }, {
- x: 514.95,
- y: 337.04
- }, {
- x: 519.83,
- y: 335.93
- }, {
- x: 524.71,
- y: 334.83
- }, {
- x: 529.58,
- y: 333.72
- }, {
- x: 534.46,
- y: 332.62
- }, {
- x: 539.34,
- y: 331.51
- }, {
- x: 544.21,
- y: 330.41
- }, {
- x: 548.99,
- y: 328.93
- }, {
- x: 553.77,
- y: 327.46
- }, {
- x: 558.55,
- y: 325.99
- }, {
- x: 563.33,
- y: 324.52
- }, {
- x: 568.1,
- y: 323.05
- }, {
- x: 572.88,
- y: 321.58
- }, {
- x: 577.66,
- y: 320.1
- }, {
- x: 582.59,
- y: 319.24
- }, {
- x: 587.51,
- y: 318.38
- }, {
- x: 592.44,
- y: 317.52
- }, {
- x: 597.36,
- y: 316.66
- }, {
- x: 602.29,
- y: 315.8
- }, {
- x: 607.21,
- y: 314.94
- }, {
- x: 612.14,
- y: 314.07
- }, {
- x: 617.06,
- y: 313.21
- }, {
- x: 621.99,
- y: 312.35
- }, {
- x: 626.91,
- y: 311.49
- }, {
- x: 631.84,
- y: 310.63
- }, {
- x: 636.76,
- y: 309.77
- }, {
- x: 641.69,
- y: 308.9
- }, {
- x: 646.61,
- y: 308.04
- }, {
- x: 651.54,
- y: 307.18
- }, {
- x: 656.46,
- y: 306.32
- }, {
- x: 661.39,
- y: 305.46
- }, {
- x: 666.31,
- y: 304.59
- }, {
- x: 671.31,
- y: 304.53
- }, {
- x: 676.31,
- y: 304.46
- }, {
- x: 681.31,
- y: 304.39
- }, {
- x: 686.31,
- y: 304.32
- }, {
- x: 691.31,
- y: 304.25
- }, {
- x: 696.31,
- y: 304.19
- }, {
- x: 701.31,
- y: 304.12
- }, {
- x: 706.31,
- y: 304.05
- }, {
- x: 711.31,
- y: 303.98
- }, {
- x: 716.3,
- y: 304.29
- }, {
- x: 721.29,
- y: 304.6
- }, {
- x: 726.28,
- y: 304.91
- }, {
- x: 731.27,
- y: 305.21
- }, {
- x: 736.26,
- y: 305.52
- }, {
- x: 741.25,
- y: 305.83
- }, {
- x: 746.24,
- y: 306.14
- }, {
- x: 750.95,
- y: 307.84
- }, {
- x: 755.65,
- y: 309.54
- }, {
- x: 760.35,
- y: 311.24
- }, {
- x: 765.05,
- y: 312.94
- }, {
- x: 769.76,
- y: 314.63
- }, {
- x: 774.53,
- y: 316.11
- }, {
- x: 779.31,
- y: 317.59
- }, {
- x: 784.09,
- y: 319.07
- }, {
- x: 788.86,
- y: 320.55
- }, {
- x: 793.64,
- y: 322.03
- }, {
- x: 798.41,
- y: 323.51
- }, {
- x: 803.11,
- y: 325.24
- }, {
- x: 807.8,
- y: 326.97
- }, {
- x: 812.49,
- y: 328.7
- }, {
- x: 817.18,
- y: 330.43
- }, {
- x: 821.87,
- y: 332.16
- }, {
- x: 826.56,
- y: 333.89
- }, {
- x: 831.25,
- y: 335.62
- }, {
- x: 835.94,
- y: 337.35
- }, {
- x: 840.79,
- y: 338.59
- }, {
- x: 845.63,
- y: 339.83
- }, {
- x: 850.48,
- y: 341.07
- }, {
- x: 855.32,
- y: 342.31
- }, {
- x: 860.16,
- y: 343.55
- }, {
- x: 865.01,
- y: 344.79
- }, {
- x: 869.85,
- y: 346.03
- }, {
- x: 874.69,
- y: 347.27
- }, {
- x: 879.54,
- y: 348.51
- }, {
- x: 884.38,
- y: 349.75
- }, {
- x: 889.23,
- y: 350.99
- }, {
- x: 894.07,
- y: 352.23
- }, {
- x: 898.91,
- y: 353.47
- }
- ]
- ]
- ];
- this.playerLives = this.levelLives = 100;
- this.playerGold = 200;
- this.playerDna = 0;
- this.towersToBePlaced = [
- {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }
- ];
- this.waves = [
- {
- delay: 0,
- roads: [
- {
- callButton: {
- x: 199,
- y: 40
- },
- diseasesList: [
- {
- dis: 'Tuberculosis',
- delay: 10
- }
- ]
- }
- ]
- }, {
- delay: 300,
- roads: [
- {
- callButton: {
- x: 199,
- y: 40
- },
- diseasesList: [
- {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }
- ]
- }
- ]
- }, {
- delay: 300,
- roads: [
- {
- callButton: {
- x: 199,
- y: 40
- },
- diseasesList: [
- {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 200
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }
- ]
- }
- ]
- }, {
- delay: 300,
- roads: [
- {
- callButton: {
- x: 199,
- y: 40
- },
- diseasesList: [
- {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 300
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }
- ]
- }
- ]
- }, {
- delay: 300,
- roads: [
- {
- callButton: {
- x: 199,
- y: 40
- },
- diseasesList: [
- {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 300
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 300
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }, {
- dis: 'Tuberculosis',
- delay: 50
- }
- ]
- }
- ]
- }
- ];
- Level0.__super__.constructor.call(this, game);
- this.pausable = false;
- }
- Level0.prototype.buildSpecial = function() {
- this.addTutoBubbles();
- return this.addTutoScreen();
- };
- Level0.prototype.addTutoBubbles = function() {
- 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));
- };
- Level0.prototype.addTutoScreen = function() {
- return this.ui.addChild(new dka.ScreenTuto());
- };
- return Level0;
- })(dka.Level);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Level1 = (function(superClass) {
- extend(Level1, superClass);
- function Level1(game) {
- this.level = 0;
- this.name = 'Tuto';
- this.map = 'map0';
- this.hospital = {
- x: 682,
- y: 122
- };
- this.hospitalImage = 'hospital0';
- this.hospitalSize = {
- regX: 144 / 2,
- regY: 59 / 2,
- width: 144,
- height: 59
- };
- this.placeDate = 'Antiquity - Greece';
- this.hintLabsMsg = 'Hello, guy ! ;) I will be your teacher during\nall the time of this game...`Try to be brillant !';
- this.towers = [
- {
- x: 108,
- y: 164,
- cell: {
- road: 1,
- path: 0
- }
- }, {
- x: 296,
- y: 211,
- cell: {
- road: 0,
- path: 2
- }
- }, {
- x: 440,
- y: 53,
- cell: {
- road: 0,
- path: 1
- }
- }, {
- x: 466,
- y: 211,
- cell: {
- road: 0,
- path: 1
- }
- }, {
- x: 450,
- y: 320,
- cell: {
- road: 0,
- path: 1
- }
- }, {
- x: 809,
- y: 321,
- cell: {
- road: 0,
- path: 2
- }
- }, {
- x: 791,
- y: 160,
- cell: {
- road: 0,
- path: 1
- }
- }
- ];
- this.waypoints = [
- [
- [
- {
- x: -27,
- y: 270
- }, {
- x: -22,
- y: 270.06
- }, {
- x: -17,
- y: 270.13
- }, {
- x: -12,
- y: 270.19
- }, {
- x: -7,
- y: 270.26
- }, {
- x: -2,
- y: 270.32
- }, {
- x: 3,
- y: 270.39
- }, {
- x: 8,
- y: 270.45
- }, {
- x: 13,
- y: 270.52
- }, {
- x: 18,
- y: 270.58
- }, {
- x: 23,
- y: 270.65
- }, {
- x: 28,
- y: 270.71
- }, {
- x: 32.99,
- y: 270.78
- }, {
- x: 37.99,
- y: 270.84
- }, {
- x: 42.99,
- y: 270.91
- }, {
- x: 47.99,
- y: 270.97
- }, {
- x: 52.99,
- y: 271.03
- }, {
- x: 57.99,
- y: 271.1
- }, {
- x: 62.99,
- y: 271.16
- }, {
- x: 67.99,
- y: 271.23
- }, {
- x: 72.99,
- y: 271.29
- }, {
- x: 77.99,
- y: 271.36
- }, {
- x: 82.99,
- y: 271.42
- }, {
- x: 87.99,
- y: 271.49
- }, {
- x: 92.99,
- y: 271.55
- }, {
- x: 97.99,
- y: 271.62
- }, {
- x: 102.99,
- y: 271.68
- }, {
- x: 107.99,
- y: 271.75
- }, {
- x: 112.99,
- y: 271.81
- }, {
- x: 117.99,
- y: 271.87
- }, {
- x: 122.99,
- y: 271.94
- }, {
- x: 127.99,
- y: 272
- }, {
- x: 132.99,
- y: 272.07
- }, {
- x: 137.99,
- y: 272.13
- }, {
- x: 142.99,
- y: 272.2
- }, {
- x: 147.99,
- y: 272.26
- }, {
- x: 152.98,
- y: 272.33
- }, {
- x: 157.98,
- y: 272.39
- }, {
- x: 162.98,
- y: 272.46
- }, {
- x: 167.98,
- y: 272.52
- }, {
- x: 172.98,
- y: 272.59
- }, {
- x: 177.98,
- y: 272.65
- }, {
- x: 182.98,
- y: 272.72
- }, {
- x: 187.98,
- y: 272.78
- }, {
- x: 192.98,
- y: 272.84
- }, {
- x: 197.98,
- y: 272.91
- }, {
- x: 202.98,
- y: 272.97
- }, {
- x: 205.06,
- y: 268.43
- }, {
- x: 207.14,
- y: 263.88
- }, {
- x: 209.21,
- y: 259.33
- }, {
- x: 211.29,
- y: 254.78
- }, {
- x: 213.37,
- y: 250.24
- }, {
- x: 215.45,
- y: 245.69
- }, {
- x: 217.53,
- y: 241.14
- }, {
- x: 219.61,
- y: 236.59
- }, {
- x: 221.68,
- y: 232.04
- }, {
- x: 223.76,
- y: 227.5
- }, {
- x: 225.84,
- y: 222.95
- }, {
- x: 227.92,
- y: 218.4
- }, {
- x: 230,
- y: 213.85
- }, {
- x: 232.07,
- y: 209.31
- }, {
- x: 234.15,
- y: 204.76
- }, {
- x: 236.23,
- y: 200.21
- }, {
- x: 238.31,
- y: 195.66
- }, {
- x: 240.39,
- y: 191.11
- }, {
- x: 242.46,
- y: 186.57
- }, {
- x: 244.54,
- y: 182.02
- }, {
- x: 246.62,
- y: 177.47
- }, {
- x: 248.7,
- y: 172.92
- }, {
- x: 250.78,
- y: 168.38
- }, {
- x: 252.85,
- y: 163.83
- }, {
- x: 254.93,
- y: 159.28
- }, {
- x: 257.01,
- y: 154.73
- }, {
- x: 259.09,
- y: 150.19
- }, {
- x: 261.17,
- y: 145.64
- }, {
- x: 266.17,
- y: 145.61
- }, {
- x: 271.17,
- y: 145.59
- }, {
- x: 276.17,
- y: 145.56
- }, {
- x: 281.17,
- y: 145.54
- }, {
- x: 286.17,
- y: 145.51
- }, {
- x: 291.17,
- y: 145.48
- }, {
- x: 296.17,
- y: 145.46
- }, {
- x: 301.17,
- y: 145.43
- }, {
- x: 306.17,
- y: 145.41
- }, {
- x: 311.16,
- y: 145.38
- }, {
- x: 316.16,
- y: 145.36
- }, {
- x: 321.16,
- y: 145.33
- }, {
- x: 326.16,
- y: 145.31
- }, {
- x: 331.16,
- y: 145.28
- }, {
- x: 336.16,
- y: 145.26
- }, {
- x: 341.16,
- y: 145.23
- }, {
- x: 346.16,
- y: 145.21
- }, {
- x: 351.16,
- y: 145.18
- }, {
- x: 356.16,
- y: 145.15
- }, {
- x: 361.16,
- y: 145.13
- }, {
- x: 366.16,
- y: 145.1
- }, {
- x: 371.16,
- y: 145.08
- }, {
- x: 376.16,
- y: 145.05
- }, {
- x: 381.16,
- y: 145.03
- }, {
- x: 386.16,
- y: 145
- }, {
- x: 391.16,
- y: 144.98
- }, {
- x: 396.16,
- y: 144.95
- }, {
- x: 401.16,
- y: 144.93
- }, {
- x: 406.16,
- y: 144.9
- }, {
- x: 411.16,
- y: 144.87
- }, {
- x: 416.16,
- y: 144.85
- }, {
- x: 421.16,
- y: 144.82
- }, {
- x: 426.16,
- y: 144.8
- }, {
- x: 431.16,
- y: 144.77
- }, {
- x: 436.16,
- y: 144.75
- }, {
- x: 441.16,
- y: 144.72
- }, {
- x: 446.16,
- y: 144.7
- }, {
- x: 451.16,
- y: 144.67
- }, {
- x: 456.16,
- y: 144.65
- }, {
- x: 461.16,
- y: 144.62
- }, {
- x: 466.16,
- y: 144.59
- }, {
- x: 471.16,
- y: 144.57
- }, {
- x: 476.16,
- y: 144.54
- }, {
- x: 481.16,
- y: 144.52
- }, {
- x: 486.16,
- y: 144.49
- }, {
- x: 491.16,
- y: 144.47
- }, {
- x: 496.16,
- y: 144.44
- }, {
- x: 501.16,
- y: 144.42
- }, {
- x: 506.16,
- y: 144.39
- }, {
- x: 511.16,
- y: 144.37
- }, {
- x: 516.16,
- y: 144.34
- }, {
- x: 521.16,
- y: 144.31
- }, {
- x: 526.16,
- y: 144.29
- }, {
- x: 531.16,
- y: 144.26
- }, {
- x: 536.16,
- y: 144.24
- }, {
- x: 541.16,
- y: 144.21
- }, {
- x: 546.16,
- y: 144.19
- }, {
- x: 551.16,
- y: 144.16
- }, {
- x: 556.16,
- y: 144.14
- }, {
- x: 561.16,
- y: 144.11
- }, {
- x: 566.16,
- y: 144.09
- }, {
- x: 571.16,
- y: 144.06
- }, {
- x: 576.16,
- y: 144.03
- }, {
- x: 581.16,
- y: 144.01
- }, {
- x: 579.26,
- y: 148.63
- }, {
- x: 577.36,
- y: 153.26
- }, {
- x: 575.46,
- y: 157.88
- }, {
- x: 573.55,
- y: 162.51
- }, {
- x: 571.65,
- y: 167.13
- }, {
- x: 569.75,
- y: 171.75
- }, {
- x: 567.85,
- y: 176.38
- }, {
- x: 565.95,
- y: 181
- }, {
- x: 564.04,
- y: 185.63
- }, {
- x: 562.14,
- y: 190.25
- }, {
- x: 560.24,
- y: 194.87
- }, {
- x: 558.34,
- y: 199.5
- }, {
- x: 556.44,
- y: 204.12
- }, {
- x: 554.53,
- y: 208.75
- }, {
- x: 552.63,
- y: 213.37
- }, {
- x: 550.73,
- y: 218
- }, {
- x: 548.83,
- y: 222.62
- }, {
- x: 546.93,
- y: 227.24
- }, {
- x: 545.02,
- y: 231.87
- }, {
- x: 543.12,
- y: 236.49
- }, {
- x: 541.22,
- y: 241.12
- }, {
- x: 539.32,
- y: 245.74
- }, {
- x: 537.42,
- y: 250.36
- }, {
- x: 535.52,
- y: 254.99
- }, {
- x: 533.61,
- y: 259.61
- }, {
- x: 531.71,
- y: 264.24
- }, {
- x: 529.81,
- y: 268.86
- }, {
- x: 527.91,
- y: 273.49
- }, {
- x: 526.01,
- y: 278.11
- }, {
- x: 524.1,
- y: 282.73
- }, {
- x: 522.2,
- y: 287.36
- }, {
- x: 520.3,
- y: 291.98
- }, {
- x: 518.4,
- y: 296.61
- }, {
- x: 516.5,
- y: 301.23
- }, {
- x: 514.59,
- y: 305.85
- }, {
- x: 512.69,
- y: 310.48
- }, {
- x: 510.79,
- y: 315.1
- }, {
- x: 508.89,
- y: 319.73
- }, {
- x: 506.99,
- y: 324.35
- }, {
- x: 505.08,
- y: 328.97
- }, {
- x: 503.18,
- y: 333.6
- }, {
- x: 501.28,
- y: 338.22
- }, {
- x: 499.38,
- y: 342.85
- }, {
- x: 497.48,
- y: 347.47
- }, {
- x: 495.57,
- y: 352.1
- }, {
- x: 493.67,
- y: 356.72
- }, {
- x: 491.77,
- y: 361.34
- }, {
- x: 489.87,
- y: 365.97
- }, {
- x: 487.97,
- y: 370.59
- }, {
- x: 486.06,
- y: 375.22
- }, {
- x: 484.16,
- y: 379.84
- }, {
- x: 482.26,
- y: 384.46
- }, {
- x: 480.36,
- y: 389.09
- }, {
- x: 478.46,
- y: 393.71
- }, {
- x: 476.56,
- y: 398.34
- }, {
- x: 474.65,
- y: 402.96
- }, {
- x: 472.75,
- y: 407.59
- }, {
- x: 470.85,
- y: 412.21
- }, {
- x: 468.95,
- y: 416.83
- }, {
- x: 467.05,
- y: 421.46
- }, {
- x: 465.14,
- y: 426.08
- }, {
- x: 470.14,
- y: 426.1
- }, {
- x: 475.14,
- y: 426.12
- }, {
- x: 480.14,
- y: 426.15
- }, {
- x: 485.14,
- y: 426.17
- }, {
- x: 490.14,
- y: 426.19
- }, {
- x: 495.14,
- y: 426.21
- }, {
- x: 500.14,
- y: 426.23
- }, {
- x: 505.14,
- y: 426.25
- }, {
- x: 510.14,
- y: 426.27
- }, {
- x: 515.14,
- y: 426.29
- }, {
- x: 520.14,
- y: 426.31
- }, {
- x: 525.14,
- y: 426.33
- }, {
- x: 530.14,
- y: 426.36
- }, {
- x: 535.14,
- y: 426.38
- }, {
- x: 540.14,
- y: 426.4
- }, {
- x: 545.14,
- y: 426.42
- }, {
- x: 550.14,
- y: 426.44
- }, {
- x: 555.14,
- y: 426.46
- }, {
- x: 560.14,
- y: 426.48
- }, {
- x: 565.14,
- y: 426.5
- }, {
- x: 570.14,
- y: 426.52
- }, {
- x: 575.14,
- y: 426.55
- }, {
- x: 580.14,
- y: 426.57
- }, {
- x: 585.14,
- y: 426.59
- }, {
- x: 590.14,
- y: 426.61
- }, {
- x: 595.14,
- y: 426.63
- }, {
- x: 600.14,
- y: 426.65
- }, {
- x: 605.14,
- y: 426.67
- }, {
- x: 610.14,
- y: 426.69
- }, {
- x: 615.14,
- y: 426.71
- }, {
- x: 620.14,
- y: 426.74
- }, {
- x: 625.14,
- y: 426.76
- }, {
- x: 630.14,
- y: 426.78
- }, {
- x: 635.14,
- y: 426.8
- }, {
- x: 640.14,
- y: 426.82
- }, {
- x: 645.14,
- y: 426.84
- }, {
- x: 650.14,
- y: 426.86
- }, {
- x: 655.14,
- y: 426.88
- }, {
- x: 660.14,
- y: 426.9
- }, {
- x: 665.14,
- y: 426.92
- }, {
- x: 670.14,
- y: 426.95
- }, {
- x: 675.14,
- y: 426.97
- }, {
- x: 680.14,
- y: 426.99
- }, {
- x: 685.14,
- y: 427.01
- }, {
- x: 686.78,
- y: 422.29
- }, {
- x: 688.42,
- y: 417.56
- }, {
- x: 690.06,
- y: 412.84
- }, {
- x: 691.71,
- y: 408.12
- }, {
- x: 693.35,
- y: 403.39
- }, {
- x: 694.99,
- y: 398.67
- }, {
- x: 696.63,
- y: 393.95
- }, {
- x: 698.27,
- y: 389.22
- }, {
- x: 699.91,
- y: 384.5
- }, {
- x: 701.55,
- y: 379.78
- }, {
- x: 703.19,
- y: 375.06
- }, {
- x: 704.83,
- y: 370.33
- }, {
- x: 706.48,
- y: 365.61
- }, {
- x: 708.12,
- y: 360.89
- }, {
- x: 709.76,
- y: 356.16
- }, {
- x: 711.4,
- y: 351.44
- }, {
- x: 713.04,
- y: 346.72
- }, {
- x: 714.68,
- y: 341.99
- }, {
- x: 716.32,
- y: 337.27
- }, {
- x: 717.96,
- y: 332.55
- }, {
- x: 719.6,
- y: 327.83
- }, {
- x: 721.24,
- y: 323.1
- }, {
- x: 722.89,
- y: 318.38
- }, {
- x: 724.53,
- y: 313.66
- }, {
- x: 726.17,
- y: 308.93
- }, {
- x: 727.81,
- y: 304.21
- }, {
- x: 729.45,
- y: 299.49
- }, {
- x: 731.09,
- y: 294.76
- }, {
- x: 732.73,
- y: 290.04
- }, {
- x: 734.37,
- y: 285.32
- }, {
- x: 736.01,
- y: 280.6
- }, {
- x: 737.65,
- y: 275.87
- }, {
- x: 739.3,
- y: 271.15
- }, {
- x: 744.3,
- y: 271.17
- }, {
- x: 749.3,
- y: 271.2
- }, {
- x: 754.3,
- y: 271.23
- }, {
- x: 759.3,
- y: 271.25
- }, {
- x: 764.3,
- y: 271.28
- }, {
- x: 769.3,
- y: 271.3
- }, {
- x: 774.3,
- y: 271.33
- }, {
- x: 779.3,
- y: 271.36
- }, {
- x: 784.3,
- y: 271.38
- }, {
- x: 789.3,
- y: 271.41
- }, {
- x: 794.29,
- y: 271.43
- }, {
- x: 799.29,
- y: 271.46
- }, {
- x: 804.29,
- y: 271.48
- }, {
- x: 809.29,
- y: 271.51
- }, {
- x: 814.29,
- y: 271.54
- }, {
- x: 819.29,
- y: 271.56
- }, {
- x: 824.29,
- y: 271.59
- }, {
- x: 829.29,
- y: 271.61
- }, {
- x: 834.29,
- y: 271.64
- }, {
- x: 839.29,
- y: 271.67
- }, {
- x: 844.29,
- y: 271.69
- }, {
- x: 849.29,
- y: 271.72
- }, {
- x: 854.29,
- y: 271.74
- }, {
- x: 859.29,
- y: 271.77
- }, {
- x: 864.29,
- y: 271.79
- }, {
- x: 869.29,
- y: 271.82
- }, {
- x: 874.29,
- y: 271.85
- }, {
- x: 879.29,
- y: 271.87
- }, {
- x: 884.29,
- y: 271.9
- }, {
- x: 889.29,
- y: 271.92
- }, {
- x: 894.29,
- y: 271.95
- }, {
- x: 899.29,
- y: 271.98
- }, {
- x: 904.29,
- y: 272
- }
- ], [
- {
- x: -26,
- y: 241
- }, {
- x: -21,
- y: 241
- }, {
- x: -16,
- y: 241
- }, {
- x: -11,
- y: 241
- }, {
- x: -6,
- y: 241
- }, {
- x: -1,
- y: 241
- }, {
- x: 4,
- y: 241
- }, {
- x: 9,
- y: 241
- }, {
- x: 14,
- y: 241
- }, {
- x: 19,
- y: 241
- }, {
- x: 24,
- y: 241
- }, {
- x: 29,
- y: 241
- }, {
- x: 34,
- y: 241
- }, {
- x: 39,
- y: 241
- }, {
- x: 44,
- y: 241
- }, {
- x: 49,
- y: 241
- }, {
- x: 54,
- y: 241
- }, {
- x: 59,
- y: 241
- }, {
- x: 64,
- y: 241
- }, {
- x: 69,
- y: 241
- }, {
- x: 74,
- y: 241
- }, {
- x: 79,
- y: 241
- }, {
- x: 84,
- y: 241
- }, {
- x: 89,
- y: 241
- }, {
- x: 94,
- y: 241
- }, {
- x: 99,
- y: 241
- }, {
- x: 104,
- y: 241
- }, {
- x: 109,
- y: 241
- }, {
- x: 114,
- y: 241
- }, {
- x: 119,
- y: 241
- }, {
- x: 124,
- y: 241
- }, {
- x: 129,
- y: 241
- }, {
- x: 133.94,
- y: 240.24
- }, {
- x: 138.88,
- y: 239.48
- }, {
- x: 143.83,
- y: 238.72
- }, {
- x: 148.77,
- y: 237.96
- }, {
- x: 153.71,
- y: 237.2
- }, {
- x: 158.4,
- y: 235.46
- }, {
- x: 163.08,
- y: 233.71
- }, {
- x: 167.63,
- y: 231.64
- }, {
- x: 172.18,
- y: 229.56
- }, {
- x: 176.73,
- y: 227.49
- }, {
- x: 181.28,
- y: 225.42
- }, {
- x: 184.26,
- y: 221.4
- }, {
- x: 187.25,
- y: 217.39
- }, {
- x: 190.23,
- y: 213.38
- }, {
- x: 193.21,
- y: 209.37
- }, {
- x: 194.56,
- y: 204.55
- }, {
- x: 195.9,
- y: 199.73
- }, {
- x: 197.24,
- y: 194.92
- }, {
- x: 198.58,
- y: 190.1
- }, {
- x: 199.92,
- y: 185.28
- }, {
- x: 201.9,
- y: 180.69
- }, {
- x: 203.88,
- y: 176.1
- }, {
- x: 205.86,
- y: 171.51
- }, {
- x: 207.84,
- y: 166.92
- }, {
- x: 209.82,
- y: 162.33
- }, {
- x: 211.8,
- y: 157.74
- }, {
- x: 213.78,
- y: 153.14
- }, {
- x: 215.76,
- y: 148.55
- }, {
- x: 218.92,
- y: 144.68
- }, {
- x: 222.08,
- y: 140.8
- }, {
- x: 225.24,
- y: 136.93
- }, {
- x: 229.96,
- y: 135.26
- }, {
- x: 234.67,
- y: 133.59
- }, {
- x: 239.38,
- y: 131.93
- }, {
- x: 244.1,
- y: 130.26
- }, {
- x: 248.76,
- y: 128.47
- }, {
- x: 253.43,
- y: 126.67
- }, {
- x: 258.1,
- y: 124.88
- }, {
- x: 262.77,
- y: 123.09
- }, {
- x: 267.76,
- y: 122.8
- }, {
- x: 272.75,
- y: 122.51
- }, {
- x: 277.74,
- y: 122.22
- }, {
- x: 282.73,
- y: 121.93
- }, {
- x: 287.73,
- y: 121.64
- }, {
- x: 292.72,
- y: 121.35
- }, {
- x: 297.71,
- y: 121.06
- }, {
- x: 302.7,
- y: 120.77
- }, {
- x: 307.69,
- y: 120.48
- }, {
- x: 312.68,
- y: 120.19
- }, {
- x: 317.67,
- y: 119.9
- }, {
- x: 322.67,
- y: 119.61
- }, {
- x: 327.66,
- y: 119.32
- }, {
- x: 332.65,
- y: 119.03
- }, {
- x: 337.64,
- y: 118.74
- }, {
- x: 342.63,
- y: 118.45
- }, {
- x: 347.62,
- y: 118.16
- }, {
- x: 352.62,
- y: 117.87
- }, {
- x: 357.61,
- y: 117.58
- }, {
- x: 362.6,
- y: 117.29
- }, {
- x: 367.59,
- y: 117
- }, {
- x: 372.58,
- y: 116.71
- }, {
- x: 377.57,
- y: 116.42
- }, {
- x: 382.57,
- y: 116.13
- }, {
- x: 387.56,
- y: 115.84
- }, {
- x: 392.55,
- y: 115.55
- }, {
- x: 397.54,
- y: 115.26
- }, {
- x: 402.53,
- y: 114.97
- }, {
- x: 407.52,
- y: 114.68
- }, {
- x: 412.51,
- y: 114.39
- }, {
- x: 417.51,
- y: 114.1
- }, {
- x: 422.5,
- y: 113.81
- }, {
- x: 427.49,
- y: 113.52
- }, {
- x: 432.48,
- y: 113.23
- }, {
- x: 437.47,
- y: 112.94
- }, {
- x: 442.46,
- y: 112.65
- }, {
- x: 447.46,
- y: 112.36
- }, {
- x: 452.45,
- y: 112.07
- }, {
- x: 457.44,
- y: 111.78
- }, {
- x: 462.43,
- y: 111.49
- }, {
- x: 467.42,
- y: 111.2
- }, {
- x: 472.41,
- y: 110.91
- }, {
- x: 477.41,
- y: 110.62
- }, {
- x: 482.4,
- y: 110.33
- }, {
- x: 487.39,
- y: 110.04
- }, {
- x: 492.38,
- y: 109.75
- }, {
- x: 497.37,
- y: 109.46
- }, {
- x: 502.36,
- y: 109.17
- }, {
- x: 507.36,
- y: 108.88
- }, {
- x: 512.35,
- y: 108.59
- }, {
- x: 517.34,
- y: 108.3
- }, {
- x: 522.33,
- y: 108.01
- }, {
- x: 527.32,
- y: 107.72
- }, {
- x: 532.31,
- y: 107.43
- }, {
- x: 537.3,
- y: 107.14
- }, {
- x: 542.3,
- y: 106.85
- }, {
- x: 547.29,
- y: 106.56
- }, {
- x: 552.28,
- y: 106.27
- }, {
- x: 557.27,
- y: 105.98
- }, {
- x: 562,
- y: 107.6
- }, {
- x: 566.74,
- y: 109.21
- }, {
- x: 571.47,
- y: 110.82
- }, {
- x: 576.45,
- y: 111.31
- }, {
- x: 581.42,
- y: 111.79
- }, {
- x: 586.4,
- y: 112.28
- }, {
- x: 591.38,
- y: 112.77
- }, {
- x: 596.35,
- y: 113.25
- }, {
- x: 601.33,
- y: 113.74
- }, {
- x: 606.3,
- y: 114.23
- }, {
- x: 608.96,
- y: 118.46
- }, {
- x: 611.62,
- y: 122.69
- }, {
- x: 614.28,
- y: 126.93
- }, {
- x: 616.94,
- y: 131.16
- }, {
- x: 619.6,
- y: 135.4
- }, {
- x: 622.26,
- y: 139.63
- }, {
- x: 624.92,
- y: 143.87
- }, {
- x: 622.74,
- y: 148.37
- }, {
- x: 620.56,
- y: 152.87
- }, {
- x: 618.38,
- y: 157.37
- }, {
- x: 616.2,
- y: 161.87
- }, {
- x: 614.02,
- y: 166.37
- }, {
- x: 611.84,
- y: 170.87
- }, {
- x: 609.66,
- y: 175.37
- }, {
- x: 607.48,
- y: 179.87
- }, {
- x: 605.31,
- y: 184.37
- }, {
- x: 603.18,
- y: 188.89
- }, {
- x: 601.05,
- y: 193.42
- }, {
- x: 598.92,
- y: 197.94
- }, {
- x: 596.79,
- y: 202.47
- }, {
- x: 594.67,
- y: 206.99
- }, {
- x: 592.54,
- y: 211.52
- }, {
- x: 590.41,
- y: 216.04
- }, {
- x: 588.28,
- y: 220.57
- }, {
- x: 586.16,
- y: 225.09
- }, {
- x: 584.03,
- y: 229.62
- }, {
- x: 581.9,
- y: 234.14
- }, {
- x: 579.77,
- y: 238.66
- }, {
- x: 577.64,
- y: 243.19
- }, {
- x: 575.52,
- y: 247.71
- }, {
- x: 573.39,
- y: 252.24
- }, {
- x: 571.26,
- y: 256.76
- }, {
- x: 569.13,
- y: 261.29
- }, {
- x: 567.01,
- y: 265.81
- }, {
- x: 564.88,
- y: 270.34
- }, {
- x: 562.75,
- y: 274.86
- }, {
- x: 560.62,
- y: 279.39
- }, {
- x: 558.5,
- y: 283.91
- }, {
- x: 556.37,
- y: 288.44
- }, {
- x: 554.24,
- y: 292.96
- }, {
- x: 552.11,
- y: 297.49
- }, {
- x: 549.98,
- y: 302.01
- }, {
- x: 547.86,
- y: 306.53
- }, {
- x: 545.73,
- y: 311.06
- }, {
- x: 543.6,
- y: 315.58
- }, {
- x: 541.47,
- y: 320.11
- }, {
- x: 539.35,
- y: 324.63
- }, {
- x: 537.22,
- y: 329.16
- }, {
- x: 535.09,
- y: 333.68
- }, {
- x: 532.96,
- y: 338.21
- }, {
- x: 529.41,
- y: 341.72
- }, {
- x: 525.85,
- y: 345.24
- }, {
- x: 522.3,
- y: 348.75
- }, {
- x: 518.74,
- y: 352.27
- }, {
- x: 518.81,
- y: 357.27
- }, {
- x: 518.89,
- y: 362.27
- }, {
- x: 518.96,
- y: 367.27
- }, {
- x: 519.03,
- y: 372.27
- }, {
- x: 521.06,
- y: 376.84
- }, {
- x: 523.08,
- y: 381.41
- }, {
- x: 525.11,
- y: 385.98
- }, {
- x: 529.22,
- y: 388.83
- }, {
- x: 533.32,
- y: 391.68
- }, {
- x: 537.43,
- y: 394.53
- }, {
- x: 541.54,
- y: 397.38
- }, {
- x: 546.54,
- y: 397.49
- }, {
- x: 551.54,
- y: 397.61
- }, {
- x: 556.54,
- y: 397.73
- }, {
- x: 561.54,
- y: 397.85
- }, {
- x: 566.54,
- y: 397.97
- }, {
- x: 571.54,
- y: 398.07
- }, {
- x: 576.53,
- y: 398.17
- }, {
- x: 581.53,
- y: 398.27
- }, {
- x: 586.53,
- y: 398.38
- }, {
- x: 591.53,
- y: 398.48
- }, {
- x: 596.53,
- y: 398.58
- }, {
- x: 601.53,
- y: 398.68
- }, {
- x: 606.53,
- y: 398.79
- }, {
- x: 611.53,
- y: 398.89
- }, {
- x: 616.53,
- y: 398.99
- }, {
- x: 621.45,
- y: 398.13
- }, {
- x: 626.38,
- y: 397.28
- }, {
- x: 631.3,
- y: 396.42
- }, {
- x: 636.23,
- y: 395.57
- }, {
- x: 641.16,
- y: 394.71
- }, {
- x: 646.08,
- y: 393.85
- }, {
- x: 651.01,
- y: 393
- }, {
- x: 654.06,
- y: 389.03
- }, {
- x: 657.1,
- y: 385.07
- }, {
- x: 660.15,
- y: 381.11
- }, {
- x: 663.2,
- y: 377.14
- }, {
- x: 666.25,
- y: 373.18
- }, {
- x: 669.3,
- y: 369.22
- }, {
- x: 672.34,
- y: 365.25
- }, {
- x: 673.38,
- y: 360.36
- }, {
- x: 674.41,
- y: 355.47
- }, {
- x: 675.44,
- y: 350.58
- }, {
- x: 676.48,
- y: 345.68
- }, {
- x: 677.51,
- y: 340.79
- }, {
- x: 678.54,
- y: 335.9
- }, {
- x: 679.58,
- y: 331.01
- }, {
- x: 680.13,
- y: 326.04
- }, {
- x: 680.68,
- y: 321.07
- }, {
- x: 681.22,
- y: 316.1
- }, {
- x: 681.77,
- y: 311.13
- }, {
- x: 682.32,
- y: 306.16
- }, {
- x: 682.87,
- y: 301.19
- }, {
- x: 683.42,
- y: 296.22
- }, {
- x: 683.97,
- y: 291.25
- }, {
- x: 685.22,
- y: 286.41
- }, {
- x: 686.46,
- y: 281.56
- }, {
- x: 687.7,
- y: 276.72
- }, {
- x: 688.95,
- y: 271.88
- }, {
- x: 690.19,
- y: 267.04
- }, {
- x: 691.44,
- y: 262.19
- }, {
- x: 694.42,
- y: 258.18
- }, {
- x: 697.41,
- y: 254.18
- }, {
- x: 700.4,
- y: 250.17
- }, {
- x: 703.39,
- y: 246.16
- }, {
- x: 706.38,
- y: 242.15
- }, {
- x: 711.2,
- y: 240.84
- }, {
- x: 716.03,
- y: 239.52
- }, {
- x: 720.85,
- y: 238.21
- }, {
- x: 725.68,
- y: 236.9
- }, {
- x: 730.5,
- y: 235.58
- }, {
- x: 735.32,
- y: 234.27
- }, {
- x: 740.15,
- y: 232.95
- }, {
- x: 744.97,
- y: 231.64
- }, {
- x: 749.8,
- y: 230.33
- }, {
- x: 754.79,
- y: 230.01
- }, {
- x: 759.78,
- y: 229.69
- }, {
- x: 764.77,
- y: 229.37
- }, {
- x: 769.76,
- y: 229.06
- }, {
- x: 774.75,
- y: 228.74
- }, {
- x: 779.74,
- y: 228.42
- }, {
- x: 784.73,
- y: 228.1
- }, {
- x: 789.72,
- y: 227.78
- }, {
- x: 794.71,
- y: 227.46
- }, {
- x: 799.7,
- y: 227.15
- }, {
- x: 804.7,
- y: 227.23
- }, {
- x: 809.7,
- y: 227.31
- }, {
- x: 814.69,
- y: 227.39
- }, {
- x: 819.69,
- y: 227.47
- }, {
- x: 824.69,
- y: 227.55
- }, {
- x: 829.69,
- y: 227.64
- }, {
- x: 834.69,
- y: 227.72
- }, {
- x: 839.69,
- y: 227.8
- }, {
- x: 844.69,
- y: 227.88
- }, {
- x: 849.69,
- y: 227.96
- }, {
- x: 854.67,
- y: 228.42
- }, {
- x: 859.65,
- y: 228.87
- }, {
- x: 864.63,
- y: 229.33
- }, {
- x: 869.61,
- y: 229.78
- }, {
- x: 874.61,
- y: 229.8
- }, {
- x: 879.61,
- y: 229.82
- }, {
- x: 884.61,
- y: 229.84
- }, {
- x: 889.61,
- y: 229.86
- }, {
- x: 894.61,
- y: 229.89
- }, {
- x: 899.61,
- y: 229.91
- }, {
- x: 904.61,
- y: 229.93
- }, {
- x: 909.61,
- y: 229.95
- }, {
- x: 914.61,
- y: 229.97
- }, {
- x: 919.61,
- y: 229.99
- }
- ], [
- {
- x: -18,
- y: 232
- }, {
- x: -13,
- y: 232
- }, {
- x: -8,
- y: 232
- }, {
- x: -3,
- y: 232
- }, {
- x: 2,
- y: 232
- }, {
- x: 7,
- y: 232
- }, {
- x: 12,
- y: 232
- }, {
- x: 17,
- y: 232
- }, {
- x: 22,
- y: 232
- }, {
- x: 27,
- y: 232
- }, {
- x: 32,
- y: 232
- }, {
- x: 37,
- y: 232
- }, {
- x: 42,
- y: 232
- }, {
- x: 47,
- y: 232
- }, {
- x: 52,
- y: 232
- }, {
- x: 57,
- y: 232
- }, {
- x: 62,
- y: 232
- }, {
- x: 67,
- y: 232
- }, {
- x: 72,
- y: 232
- }, {
- x: 77,
- y: 232
- }, {
- x: 82,
- y: 232
- }, {
- x: 87,
- y: 232
- }, {
- x: 92,
- y: 232
- }, {
- x: 97,
- y: 232
- }, {
- x: 102,
- y: 232
- }, {
- x: 107,
- y: 232
- }, {
- x: 112,
- y: 232
- }, {
- x: 117,
- y: 232
- }, {
- x: 122,
- y: 232
- }, {
- x: 127,
- y: 232
- }, {
- x: 132,
- y: 232
- }, {
- x: 137,
- y: 232
- }, {
- x: 142,
- y: 232
- }, {
- x: 147,
- y: 232
- }, {
- x: 152,
- y: 232
- }, {
- x: 157,
- y: 232
- }, {
- x: 162,
- y: 232
- }, {
- x: 167,
- y: 232
- }, {
- x: 172,
- y: 232
- }, {
- x: 177,
- y: 232
- }, {
- x: 182,
- y: 232
- }, {
- x: 186.94,
- y: 232.77
- }, {
- x: 191.88,
- y: 233.54
- }, {
- x: 196.82,
- y: 234.32
- }, {
- x: 201.76,
- y: 235.09
- }, {
- x: 206.7,
- y: 235.86
- }, {
- x: 211.64,
- y: 236.63
- }, {
- x: 216.39,
- y: 238.2
- }, {
- x: 221.14,
- y: 239.76
- }, {
- x: 225.89,
- y: 241.33
- }, {
- x: 230.64,
- y: 242.89
- }, {
- x: 235.38,
- y: 244.46
- }, {
- x: 239.62,
- y: 247.11
- }, {
- x: 243.86,
- y: 249.76
- }, {
- x: 248.1,
- y: 252.41
- }, {
- x: 252.34,
- y: 255.06
- }, {
- x: 256.58,
- y: 257.71
- }, {
- x: 260.82,
- y: 260.36
- }, {
- x: 265.06,
- y: 263.01
- }, {
- x: 269.3,
- y: 265.66
- }, {
- x: 273.54,
- y: 268.31
- }, {
- x: 277.78,
- y: 270.96
- }, {
- x: 282.02,
- y: 273.61
- }, {
- x: 286.26,
- y: 276.26
- }, {
- x: 290.5,
- y: 278.91
- }, {
- x: 294.74,
- y: 281.56
- }, {
- x: 298.98,
- y: 284.21
- }, {
- x: 303.22,
- y: 286.86
- }, {
- x: 307.46,
- y: 289.51
- }, {
- x: 311.7,
- y: 292.16
- }, {
- x: 315.94,
- y: 294.81
- }, {
- x: 320.18,
- y: 297.47
- }, {
- x: 324.42,
- y: 300.12
- }, {
- x: 328.66,
- y: 302.77
- }, {
- x: 332.9,
- y: 305.42
- }, {
- x: 337.14,
- y: 308.07
- }, {
- x: 341.38,
- y: 310.72
- }, {
- x: 345.62,
- y: 313.37
- }, {
- x: 349.86,
- y: 316.02
- }, {
- x: 354.1,
- y: 318.67
- }, {
- x: 358.34,
- y: 321.32
- }, {
- x: 362.58,
- y: 323.97
- }, {
- x: 366.81,
- y: 326.62
- }, {
- x: 371.05,
- y: 329.27
- }, {
- x: 375.29,
- y: 331.92
- }, {
- x: 379.53,
- y: 334.57
- }, {
- x: 383.77,
- y: 337.22
- }, {
- x: 388.01,
- y: 339.87
- }, {
- x: 392.25,
- y: 342.52
- }, {
- x: 396.49,
- y: 345.17
- }, {
- x: 400.73,
- y: 347.82
- }, {
- x: 404.97,
- y: 350.47
- }, {
- x: 409.21,
- y: 353.13
- }, {
- x: 413.45,
- y: 355.78
- }, {
- x: 417.69,
- y: 358.43
- }, {
- x: 421.93,
- y: 361.08
- }, {
- x: 426.17,
- y: 363.73
- }, {
- x: 430.41,
- y: 366.38
- }, {
- x: 434.65,
- y: 369.03
- }, {
- x: 438.89,
- y: 371.68
- }, {
- x: 443.13,
- y: 374.33
- }, {
- x: 447.37,
- y: 376.98
- }, {
- x: 451.61,
- y: 379.63
- }, {
- x: 455.85,
- y: 382.28
- }, {
- x: 460.2,
- y: 384.75
- }, {
- x: 464.55,
- y: 387.21
- }, {
- x: 468.9,
- y: 389.68
- }, {
- x: 473.25,
- y: 392.14
- }, {
- x: 478.22,
- y: 392.68
- }, {
- x: 483.19,
- y: 393.22
- }, {
- x: 488.16,
- y: 393.76
- }, {
- x: 493.13,
- y: 394.3
- }, {
- x: 498.1,
- y: 394.84
- }, {
- x: 503.07,
- y: 395.38
- }, {
- x: 508.04,
- y: 395.92
- }, {
- x: 513.02,
- y: 396.46
- }, {
- x: 517.99,
- y: 397
- }, {
- x: 522.99,
- y: 397.04
- }, {
- x: 527.99,
- y: 397.09
- }, {
- x: 532.99,
- y: 397.13
- }, {
- x: 537.99,
- y: 397.17
- }, {
- x: 542.98,
- y: 397.22
- }, {
- x: 547.98,
- y: 397.26
- }, {
- x: 552.98,
- y: 397.3
- }, {
- x: 557.98,
- y: 397.35
- }, {
- x: 562.98,
- y: 397.39
- }, {
- x: 567.98,
- y: 397.43
- }, {
- x: 572.98,
- y: 397.48
- }, {
- x: 577.98,
- y: 397.52
- }, {
- x: 582.98,
- y: 397.56
- }, {
- x: 587.98,
- y: 397.61
- }, {
- x: 592.98,
- y: 397.65
- }, {
- x: 597.98,
- y: 397.7
- }, {
- x: 602.98,
- y: 397.74
- }, {
- x: 607.98,
- y: 397.78
- }, {
- x: 612.98,
- y: 397.83
- }, {
- x: 617.98,
- y: 397.87
- }, {
- x: 622.98,
- y: 397.91
- }, {
- x: 627.98,
- y: 397.96
- }, {
- x: 632.98,
- y: 398
- }, {
- x: 634.95,
- y: 393.4
- }, {
- x: 636.92,
- y: 388.81
- }, {
- x: 638.89,
- y: 384.21
- }, {
- x: 640.86,
- y: 379.62
- }, {
- x: 642.84,
- y: 375.02
- }, {
- x: 644.81,
- y: 370.43
- }, {
- x: 646.78,
- y: 365.83
- }, {
- x: 648.75,
- y: 361.24
- }, {
- x: 650.72,
- y: 356.64
- }, {
- x: 652.69,
- y: 352.05
- }, {
- x: 654.66,
- y: 347.45
- }, {
- x: 656.63,
- y: 342.86
- }, {
- x: 658.6,
- y: 338.26
- }, {
- x: 660.57,
- y: 333.67
- }, {
- x: 663.38,
- y: 329.53
- }, {
- x: 666.19,
- y: 325.39
- }, {
- x: 669,
- y: 321.26
- }, {
- x: 671.8,
- y: 317.12
- }, {
- x: 674.61,
- y: 312.98
- }, {
- x: 677.42,
- y: 308.84
- }, {
- x: 680.23,
- y: 304.71
- }, {
- x: 683.04,
- y: 300.57
- }, {
- x: 685.84,
- y: 296.43
- }, {
- x: 688.65,
- y: 292.3
- }, {
- x: 691.46,
- y: 288.16
- }, {
- x: 694.27,
- y: 284.02
- }, {
- x: 697.08,
- y: 279.89
- }, {
- x: 701.51,
- y: 277.57
- }, {
- x: 705.94,
- y: 275.26
- }, {
- x: 710.37,
- y: 272.94
- }, {
- x: 714.81,
- y: 270.63
- }, {
- x: 719.24,
- y: 268.32
- }, {
- x: 723.67,
- y: 266
- }, {
- x: 728.1,
- y: 263.69
- }, {
- x: 732.54,
- y: 261.37
- }, {
- x: 736.97,
- y: 259.06
- }, {
- x: 741.94,
- y: 258.56
- }, {
- x: 746.92,
- y: 258.05
- }, {
- x: 751.89,
- y: 257.55
- }, {
- x: 756.87,
- y: 257.05
- }, {
- x: 761.84,
- y: 256.54
- }, {
- x: 766.82,
- y: 256.04
- }, {
- x: 771.79,
- y: 255.54
- }, {
- x: 776.77,
- y: 255.04
- }, {
- x: 781.74,
- y: 254.53
- }, {
- x: 786.71,
- y: 254.03
- }, {
- x: 791.7,
- y: 253.69
- }, {
- x: 796.69,
- y: 253.36
- }, {
- x: 801.68,
- y: 253.03
- }, {
- x: 806.67,
- y: 252.69
- }, {
- x: 811.66,
- y: 252.36
- }, {
- x: 816.65,
- y: 252.02
- }, {
- x: 821.64,
- y: 252.19
- }, {
- x: 826.64,
- y: 252.36
- }, {
- x: 831.64,
- y: 252.53
- }, {
- x: 836.64,
- y: 252.7
- }, {
- x: 841.63,
- y: 252.87
- }, {
- x: 846.63,
- y: 253.03
- }, {
- x: 851.63,
- y: 253.2
- }, {
- x: 856.62,
- y: 253.37
- }, {
- x: 861.62,
- y: 253.54
- }, {
- x: 866.62,
- y: 253.71
- }, {
- x: 871.62,
- y: 253.88
- }, {
- x: 876.61,
- y: 254.04
- }, {
- x: 881.61,
- y: 254.21
- }, {
- x: 886.61,
- y: 254.38
- }, {
- x: 891.61,
- y: 254.55
- }, {
- x: 896.6,
- y: 254.72
- }, {
- x: 901.6,
- y: 254.89
- }, {
- x: 906.6,
- y: 255.05
- }
- ]
- ], [
- [
- {
- x: -30,
- y: 423
- }, {
- x: -26.06,
- y: 419.93
- }, {
- x: -22.11,
- y: 416.85
- }, {
- x: -18.17,
- y: 413.78
- }, {
- x: -14.23,
- y: 410.7
- }, {
- x: -10.29,
- y: 407.63
- }, {
- x: -6.34,
- y: 404.55
- }, {
- x: -2.4,
- y: 401.48
- }, {
- x: 1.54,
- y: 398.4
- }, {
- x: 5.49,
- y: 395.33
- }, {
- x: 9.43,
- y: 392.25
- }, {
- x: 13.37,
- y: 389.18
- }, {
- x: 17.31,
- y: 386.1
- }, {
- x: 21.26,
- y: 383.03
- }, {
- x: 25.2,
- y: 379.95
- }, {
- x: 29.14,
- y: 376.88
- }, {
- x: 33.09,
- y: 373.8
- }, {
- x: 37.03,
- y: 370.73
- }, {
- x: 40.97,
- y: 367.66
- }, {
- x: 44.91,
- y: 364.58
- }, {
- x: 48.86,
- y: 361.51
- }, {
- x: 52.8,
- y: 358.43
- }, {
- x: 56.74,
- y: 355.36
- }, {
- x: 60.69,
- y: 352.28
- }, {
- x: 64.63,
- y: 349.21
- }, {
- x: 68.57,
- y: 346.13
- }, {
- x: 72.51,
- y: 343.06
- }, {
- x: 76.46,
- y: 339.98
- }, {
- x: 80.4,
- y: 336.91
- }, {
- x: 84.34,
- y: 333.83
- }, {
- x: 88.29,
- y: 330.76
- }, {
- x: 92.23,
- y: 327.68
- }, {
- x: 96.17,
- y: 324.61
- }, {
- x: 100.11,
- y: 321.53
- }, {
- x: 104.06,
- y: 318.46
- }, {
- x: 108,
- y: 315.39
- }, {
- x: 111.94,
- y: 312.31
- }, {
- x: 115.89,
- y: 309.24
- }, {
- x: 119.83,
- y: 306.16
- }, {
- x: 123.77,
- y: 303.09
- }, {
- x: 127.71,
- y: 300.01
- }, {
- x: 131.66,
- y: 296.94
- }, {
- x: 135.6,
- y: 293.86
- }, {
- x: 139.54,
- y: 290.79
- }, {
- x: 143.49,
- y: 287.71
- }, {
- x: 147.43,
- y: 284.64
- }, {
- x: 151.37,
- y: 281.56
- }, {
- x: 155.31,
- y: 278.49
- }, {
- x: 159.26,
- y: 275.41
- }, {
- x: 163.2,
- y: 272.34
- }, {
- x: 167.14,
- y: 269.26
- }, {
- x: 171.09,
- y: 266.19
- }, {
- x: 175.03,
- y: 263.12
- }, {
- x: 178.97,
- y: 260.04
- }, {
- x: 182.91,
- y: 256.97
- }, {
- x: 186.86,
- y: 253.89
- }, {
- x: 189,
- y: 249.37
- }, {
- x: 191.13,
- y: 244.85
- }, {
- x: 193.27,
- y: 240.33
- }, {
- x: 195.41,
- y: 235.81
- }, {
- x: 197.55,
- y: 231.29
- }, {
- x: 199.69,
- y: 226.77
- }, {
- x: 201.83,
- y: 222.25
- }, {
- x: 203.96,
- y: 217.73
- }, {
- x: 206.1,
- y: 213.21
- }, {
- x: 208.24,
- y: 208.69
- }, {
- x: 210.38,
- y: 204.17
- }, {
- x: 212.52,
- y: 199.65
- }, {
- x: 214.66,
- y: 195.14
- }, {
- x: 216.79,
- y: 190.62
- }, {
- x: 218.93,
- y: 186.1
- }, {
- x: 221.07,
- y: 181.58
- }, {
- x: 223.21,
- y: 177.06
- }, {
- x: 225.35,
- y: 172.54
- }, {
- x: 227.49,
- y: 168.02
- }, {
- x: 229.62,
- y: 163.5
- }, {
- x: 231.76,
- y: 158.98
- }, {
- x: 233.9,
- y: 154.46
- }, {
- x: 236.04,
- y: 149.94
- }, {
- x: 238.18,
- y: 145.42
- }, {
- x: 240.32,
- y: 140.9
- }, {
- x: 242.45,
- y: 136.38
- }, {
- x: 244.59,
- y: 131.86
- }, {
- x: 249.59,
- y: 131.78
- }, {
- x: 254.59,
- y: 131.7
- }, {
- x: 259.59,
- y: 131.62
- }, {
- x: 264.59,
- y: 131.54
- }, {
- x: 269.59,
- y: 131.46
- }, {
- x: 274.59,
- y: 131.38
- }, {
- x: 279.59,
- y: 131.3
- }, {
- x: 284.59,
- y: 131.22
- }, {
- x: 289.59,
- y: 131.14
- }, {
- x: 294.59,
- y: 131.06
- }, {
- x: 299.59,
- y: 130.98
- }, {
- x: 304.59,
- y: 130.9
- }, {
- x: 309.58,
- y: 130.82
- }, {
- x: 314.58,
- y: 130.74
- }, {
- x: 319.58,
- y: 130.66
- }, {
- x: 324.58,
- y: 130.58
- }, {
- x: 329.58,
- y: 130.5
- }, {
- x: 334.58,
- y: 130.42
- }, {
- x: 339.58,
- y: 130.34
- }, {
- x: 344.58,
- y: 130.26
- }, {
- x: 349.58,
- y: 130.18
- }, {
- x: 354.58,
- y: 130.1
- }, {
- x: 359.58,
- y: 130.02
- }, {
- x: 364.58,
- y: 129.94
- }, {
- x: 369.58,
- y: 129.86
- }, {
- x: 374.58,
- y: 129.78
- }, {
- x: 379.58,
- y: 129.7
- }, {
- x: 384.58,
- y: 129.62
- }, {
- x: 389.57,
- y: 129.54
- }, {
- x: 394.57,
- y: 129.46
- }, {
- x: 399.57,
- y: 129.38
- }, {
- x: 404.57,
- y: 129.3
- }, {
- x: 409.57,
- y: 129.22
- }, {
- x: 414.57,
- y: 129.14
- }, {
- x: 419.57,
- y: 129.06
- }, {
- x: 424.57,
- y: 128.98
- }, {
- x: 429.57,
- y: 128.9
- }, {
- x: 434.57,
- y: 128.82
- }, {
- x: 439.57,
- y: 128.74
- }, {
- x: 444.57,
- y: 128.66
- }, {
- x: 449.57,
- y: 128.58
- }, {
- x: 454.57,
- y: 128.5
- }, {
- x: 459.57,
- y: 128.42
- }, {
- x: 464.57,
- y: 128.34
- }, {
- x: 469.56,
- y: 128.26
- }, {
- x: 474.56,
- y: 128.18
- }, {
- x: 479.56,
- y: 128.1
- }, {
- x: 484.56,
- y: 128.02
- }, {
- x: 489.56,
- y: 127.94
- }, {
- x: 494.56,
- y: 127.86
- }, {
- x: 499.56,
- y: 127.78
- }, {
- x: 504.56,
- y: 127.7
- }, {
- x: 509.56,
- y: 127.62
- }, {
- x: 514.56,
- y: 127.54
- }, {
- x: 519.56,
- y: 127.46
- }, {
- x: 524.56,
- y: 127.38
- }, {
- x: 529.56,
- y: 127.3
- }, {
- x: 534.56,
- y: 127.22
- }, {
- x: 539.56,
- y: 127.14
- }, {
- x: 544.55,
- y: 127.06
- }, {
- x: 549.55,
- y: 126.98
- }, {
- x: 554.55,
- y: 126.9
- }, {
- x: 559.55,
- y: 126.82
- }, {
- x: 564.55,
- y: 126.74
- }, {
- x: 569.55,
- y: 126.66
- }, {
- x: 574.55,
- y: 126.58
- }, {
- x: 579.55,
- y: 126.5
- }, {
- x: 584.55,
- y: 126.42
- }, {
- x: 589.55,
- y: 126.34
- }, {
- x: 594.55,
- y: 126.26
- }, {
- x: 599.55,
- y: 126.18
- }, {
- x: 604.55,
- y: 126.1
- }, {
- x: 609.55,
- y: 126.02
- }, {
- x: 607.61,
- y: 130.63
- }, {
- x: 605.67,
- y: 135.24
- }, {
- x: 603.73,
- y: 139.85
- }, {
- x: 601.79,
- y: 144.46
- }, {
- x: 599.85,
- y: 149.07
- }, {
- x: 597.91,
- y: 153.67
- }, {
- x: 595.97,
- y: 158.28
- }, {
- x: 594.03,
- y: 162.89
- }, {
- x: 592.09,
- y: 167.5
- }, {
- x: 590.15,
- y: 172.11
- }, {
- x: 588.22,
- y: 176.72
- }, {
- x: 586.28,
- y: 181.33
- }, {
- x: 584.34,
- y: 185.94
- }, {
- x: 582.4,
- y: 190.54
- }, {
- x: 580.46,
- y: 195.15
- }, {
- x: 578.52,
- y: 199.76
- }, {
- x: 576.58,
- y: 204.37
- }, {
- x: 574.64,
- y: 208.98
- }, {
- x: 572.7,
- y: 213.59
- }, {
- x: 570.76,
- y: 218.2
- }, {
- x: 568.82,
- y: 222.8
- }, {
- x: 566.88,
- y: 227.41
- }, {
- x: 564.94,
- y: 232.02
- }, {
- x: 563.01,
- y: 236.63
- }, {
- x: 561.07,
- y: 241.24
- }, {
- x: 559.13,
- y: 245.85
- }, {
- x: 557.19,
- y: 250.46
- }, {
- x: 555.25,
- y: 255.06
- }, {
- x: 553.31,
- y: 259.67
- }, {
- x: 551.37,
- y: 264.28
- }, {
- x: 549.43,
- y: 268.89
- }, {
- x: 547.49,
- y: 273.5
- }, {
- x: 545.55,
- y: 278.11
- }, {
- x: 543.61,
- y: 282.72
- }, {
- x: 541.67,
- y: 287.33
- }, {
- x: 539.73,
- y: 291.93
- }, {
- x: 537.8,
- y: 296.54
- }, {
- x: 535.86,
- y: 301.15
- }, {
- x: 533.92,
- y: 305.76
- }, {
- x: 531.98,
- y: 310.37
- }, {
- x: 530.04,
- y: 314.98
- }, {
- x: 528.1,
- y: 319.59
- }, {
- x: 526.16,
- y: 324.19
- }, {
- x: 524.22,
- y: 328.8
- }, {
- x: 522.28,
- y: 333.41
- }, {
- x: 520.34,
- y: 338.02
- }, {
- x: 518.4,
- y: 342.63
- }, {
- x: 516.46,
- y: 347.24
- }, {
- x: 514.52,
- y: 351.85
- }, {
- x: 512.59,
- y: 356.45
- }, {
- x: 510.65,
- y: 361.06
- }, {
- x: 508.71,
- y: 365.67
- }, {
- x: 506.77,
- y: 370.28
- }, {
- x: 504.83,
- y: 374.89
- }, {
- x: 502.89,
- y: 379.5
- }, {
- x: 500.95,
- y: 384.11
- }, {
- x: 499.01,
- y: 388.71
- }, {
- x: 497.07,
- y: 393.32
- }, {
- x: 495.13,
- y: 397.93
- }, {
- x: 493.19,
- y: 402.54
- }, {
- x: 498.19,
- y: 402.46
- }, {
- x: 503.19,
- y: 402.38
- }, {
- x: 508.19,
- y: 402.3
- }, {
- x: 513.19,
- y: 402.22
- }, {
- x: 518.19,
- y: 402.14
- }, {
- x: 523.19,
- y: 402.06
- }, {
- x: 528.19,
- y: 401.98
- }, {
- x: 533.19,
- y: 401.9
- }, {
- x: 538.19,
- y: 401.83
- }, {
- x: 543.19,
- y: 401.75
- }, {
- x: 548.19,
- y: 401.67
- }, {
- x: 553.19,
- y: 401.59
- }, {
- x: 558.19,
- y: 401.51
- }, {
- x: 563.18,
- y: 401.43
- }, {
- x: 568.18,
- y: 401.35
- }, {
- x: 573.18,
- y: 401.27
- }, {
- x: 578.18,
- y: 401.19
- }, {
- x: 583.18,
- y: 401.11
- }, {
- x: 588.18,
- y: 401.03
- }, {
- x: 593.18,
- y: 400.95
- }, {
- x: 598.18,
- y: 400.87
- }, {
- x: 603.18,
- y: 400.79
- }, {
- x: 608.18,
- y: 400.71
- }, {
- x: 613.18,
- y: 400.63
- }, {
- x: 618.18,
- y: 400.55
- }, {
- x: 623.18,
- y: 400.47
- }, {
- x: 628.18,
- y: 400.39
- }, {
- x: 633.18,
- y: 400.32
- }, {
- x: 638.17,
- y: 400.24
- }, {
- x: 643.17,
- y: 400.16
- }, {
- x: 648.17,
- y: 400.08
- }, {
- x: 653.17,
- y: 400
- }, {
- x: 655.38,
- y: 395.51
- }, {
- x: 657.59,
- y: 391.02
- }, {
- x: 659.79,
- y: 386.54
- }, {
- x: 662,
- y: 382.05
- }, {
- x: 664.21,
- y: 377.57
- }, {
- x: 666.42,
- y: 373.08
- }, {
- x: 668.62,
- y: 368.59
- }, {
- x: 670.83,
- y: 364.11
- }, {
- x: 673.04,
- y: 359.62
- }, {
- x: 675.25,
- y: 355.13
- }, {
- x: 677.45,
- y: 350.65
- }, {
- x: 679.66,
- y: 346.16
- }, {
- x: 681.87,
- y: 341.67
- }, {
- x: 684.07,
- y: 337.19
- }, {
- x: 686.28,
- y: 332.7
- }, {
- x: 688.49,
- y: 328.21
- }, {
- x: 690.7,
- y: 323.73
- }, {
- x: 692.9,
- y: 319.24
- }, {
- x: 695.11,
- y: 314.75
- }, {
- x: 697.32,
- y: 310.27
- }, {
- x: 699.52,
- y: 305.78
- }, {
- x: 701.73,
- y: 301.3
- }, {
- x: 703.94,
- y: 296.81
- }, {
- x: 706.15,
- y: 292.32
- }, {
- x: 708.35,
- y: 287.84
- }, {
- x: 710.56,
- y: 283.35
- }, {
- x: 712.77,
- y: 278.86
- }, {
- x: 714.98,
- y: 274.38
- }, {
- x: 717.18,
- y: 269.89
- }, {
- x: 719.39,
- y: 265.4
- }, {
- x: 721.6,
- y: 260.92
- }, {
- x: 723.8,
- y: 256.43
- }, {
- x: 726.01,
- y: 251.94
- }, {
- x: 731.01,
- y: 251.8
- }, {
- x: 736.01,
- y: 251.65
- }, {
- x: 741,
- y: 251.5
- }, {
- x: 746,
- y: 251.35
- }, {
- x: 751,
- y: 251.2
- }, {
- x: 756,
- y: 251.05
- }, {
- x: 761,
- y: 250.91
- }, {
- x: 765.99,
- y: 250.76
- }, {
- x: 770.99,
- y: 250.61
- }, {
- x: 775.99,
- y: 250.46
- }, {
- x: 780.99,
- y: 250.31
- }, {
- x: 785.98,
- y: 250.16
- }, {
- x: 790.98,
- y: 250.02
- }, {
- x: 795.98,
- y: 249.87
- }, {
- x: 800.98,
- y: 249.72
- }, {
- x: 805.98,
- y: 249.57
- }, {
- x: 810.97,
- y: 249.42
- }, {
- x: 815.97,
- y: 249.27
- }, {
- x: 820.97,
- y: 249.13
- }, {
- x: 825.97,
- y: 248.98
- }, {
- x: 830.97,
- y: 248.83
- }, {
- x: 835.96,
- y: 248.68
- }, {
- x: 840.96,
- y: 248.53
- }, {
- x: 845.96,
- y: 248.38
- }, {
- x: 850.96,
- y: 248.24
- }, {
- x: 855.95,
- y: 248.09
- }, {
- x: 860.95,
- y: 247.94
- }, {
- x: 865.95,
- y: 247.79
- }, {
- x: 870.95,
- y: 247.64
- }, {
- x: 875.95,
- y: 247.49
- }, {
- x: 880.94,
- y: 247.57
- }, {
- x: 885.94,
- y: 247.65
- }, {
- x: 890.94,
- y: 247.73
- }, {
- x: 895.94,
- y: 247.81
- }, {
- x: 900.94,
- y: 247.89
- }, {
- x: 905.94,
- y: 247.97
- }, {
- x: 910.93,
- y: 246.46
- }, {
- x: 915.93,
- y: 246.31
- }, {
- x: 920.93,
- y: 246.16
- }, {
- x: 925.92,
- y: 246.01
- }, {
- x: 930.92,
- y: 245.86
- }, {
- x: 935.92,
- y: 245.71
- }, {
- x: 940.92,
- y: 245.57
- }, {
- x: 945.91,
- y: 245.42
- }, {
- x: 950.91,
- y: 245.27
- }, {
- x: 955.91,
- y: 245.12
- }, {
- x: 960.91,
- y: 244.97
- }
- ]
- ]
- ];
- this.playerLives = this.levelLives = 100;
- this.playerGold = 200;
- this.playerDna = 470;
- this.towersToBePlaced = [
- {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }, {
- type: '',
- upgradeLevel: 0
- }
- ];
- this.waves = [
- {
- delay: 0,
- roads: [
- {
- callButton: {
- x: 32,
- y: 256,
- rotation: 0
- },
- diseasesList: [
- {
- dis: 'Plague',
- delay: 10
- }
- ]
- }
- ]
- }, {
- delay: 1500,
- roads: [
- {
- callButton: {
- x: 32,
- y: 256,
- rotation: 0
- },
- diseasesList: [
- {
- dis: 'HIV',
- delay: 20
- }, {
- dis: 'Plague',
- delay: 20
- }, {
- dis: 'HIV',
- delay: 20
- }, {
- dis: 'Plague',
- delay: 20
- }, {
- dis: 'HIV',
- delay: 20
- }, {
- dis: 'Plague',
- delay: 20
- }, {
- dis: 'HIV',
- delay: 20
- }, {
- dis: 'Plague',
- delay: 20
- }, {
- dis: 'HIV',
- delay: 20
- }, {
- dis: 'Plague',
- delay: 20
- }
- ]
- }, {
- callButton: {
- x: 32,
- y: 392,
- rotation: -30
- },
- diseasesList: [
- {
- dis: 'Plague',
- delay: 20
- }
- ]
- }
- ]
- }, {
- delay: 200,
- roads: [
- {
- callButton: {
- x: 32,
- y: 256,
- rotation: 0
- },
- diseasesList: [
- {
- dis: 'Plague',
- delay: 20
- }, {
- dis: 'Plague',
- delay: 20
- }
- ]
- }, {
- callButton: {
- x: 32,
- y: 392,
- rotation: -30
- },
- diseasesList: [
- {
- dis: 'Plague',
- delay: 20
- }, {
- dis: 'Plague',
- delay: 20
- }
- ]
- }
- ]
- }
- ];
- Level1.__super__.constructor.call(this, game);
- }
- return Level1;
- })(dka.Level);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.HUDBar = (function(superClass) {
- extend(HUDBar, superClass);
- function HUDBar(level) {
- var imgDna, imgGold, imgLife, imgWave;
- HUDBar.__super__.constructor.call(this);
- this.level = level;
- this.set({
- y: canvasHeight - 60
- });
- imgLife = (new createjs.Bitmap(dka.academy.assetManager.getAsset('lifeHud'))).set({
- x: 19,
- y: 32
- });
- imgGold = (new createjs.Bitmap(dka.academy.assetManager.getAsset('coinHud'))).set({
- x: 110,
- y: 32
- });
- imgDna = (new createjs.Bitmap(dka.academy.assetManager.getAsset('dnaHud'))).set({
- x: 182,
- y: 32
- });
- imgWave = (new createjs.Bitmap(dka.academy.assetManager.getAsset('waveHud'))).set({
- x: 365,
- y: 32
- });
- this.txtLives = (new createjs.Text(this.level.playerLives + ' k', '20px karnivoreRegular, Arial', dka.colors.lightBlue)).set({
- x: 45,
- y: 49,
- textAlign: 'left',
- textBaseline: 'alphabetic'
- });
- this.txtGold = (new createjs.Text(this.level.playerGold, '20px karnivoreRegular, Arial', dka.colors.lightBlue)).set({
- x: 130,
- y: 49,
- textAlign: 'left',
- textBaseline: 'alphabetic'
- });
- this.txtDna = (new createjs.Text(this.level.playerDna, '20px karnivoreRegular, Arial', dka.colors.lightBlue)).set({
- x: 208,
- y: 49,
- textAlign: 'left',
- textBaseline: 'alphabetic'
- });
- this.txtWaves = (new createjs.Text((this.level.getFresherWaveIndex() + 1) + '/' + this.level.nbrWaves, '20px karnivoreRegular, Arial', dka.colors.lightBlue)).set({
- x: 395,
- y: 49,
- textAlign: 'left',
- textBaseline: 'alphabetic'
- });
- this.addChild(imgLife, imgGold, imgDna, imgWave, this.txtLives, this.txtGold, this.txtDna, this.txtWaves);
- this.cache(0, 0, canvasWidth, 60);
- }
- HUDBar.prototype.updateLives = function() {
- this.txtLives.text = this.level.playerLives + ' k';
- return this.updateCache();
- };
- HUDBar.prototype.updateGold = function() {
- this.txtGold.text = this.level.playerGold;
- return this.updateCache();
- };
- HUDBar.prototype.updateDna = function() {
- this.txtDna.text = this.level.playerDna;
- return this.updateCache();
- };
- HUDBar.prototype.updateWaves = function() {
- this.txtWaves.text = (this.level.getFresherWaveIndex() + 1) + '/' + this.level.nbrWaves;
- return this.updateCache();
- };
- HUDBar.prototype.addMessageBalloon = function() {
- this.msgBalloon = (new dka.MessageBalloon(this.level.hintLabsMsg, this.level)).set({
- x: canvasWidth - 440,
- y: canvasHeight - 68
- });
- this.parent.addChild(this.msgBalloon);
- return this.updateCache();
- };
- return HUDBar;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Ui = (function(superClass) {
- extend(Ui, superClass);
- function Ui(level) {
- var encyclopediaButton, j, pauseButton, ref, road;
- Ui.__super__.constructor.call(this);
- this.level = level;
- this.buttonsPositions = [25, 70];
- this.paused = false;
- this.addKeyEvents();
- dka.academy.addBlurEvent((function(_this) {
- return function() {
- if (_this.level.game.autopause) {
- return _this.easyPause('auto', true);
- }
- };
- })(this));
- this.alpha = 0;
- createjs.Tween.get(this, {
- useTicks: true
- }).to({
- alpha: 1
- }, 20, createjs.Ease.cubicOut);
- this.addChild(new createjs.Bitmap(dka.academy.assetManager.getAsset('border')));
- this.helpButtonsHolder = new dka.HelpButtonsHolder(this.level, this);
- this.addChild(this.helpButtonsHolder);
- this.hudBar = this.addChild(new dka.HUDBar(this.level));
- pauseButton = this.addChild(new dka.Button(canvasWidth - this.buttonsPositions[0], null, new createjs.Bitmap(dka.academy.assetManager.getAsset('PauseBP'))));
- pauseButton.on('click', (function(_this) {
- return function() {
- return _this.easyPause('button');
- };
- })(this));
- encyclopediaButton = this.addChild(new dka.Button(canvasWidth - this.buttonsPositions[1], null, new createjs.Bitmap(dka.academy.assetManager.getAsset('EncyclopediaBP'))));
- encyclopediaButton.on('click', (function(_this) {
- return function() {
- _this.easyPause('encyclopedia');
- return _this.level.screenEncyclopedia.show();
- };
- })(this));
- this.waveFlags = [];
- for (road = j = 0, ref = this.level.waves[0].roads.length; 0 <= ref ? j < ref : j > ref; road = 0 <= ref ? ++j : --j) {
- this.waveFlags.push(new dka.WaveFlag(this.level, road));
- this.addChild(this.waveFlags[this.waveFlags.length - 1]);
- }
- this.tutoBubles = this.addChild(new createjs.Container());
- this.callTutoBubble = false;
- if (this.level.pausable) {
- this.addDecorations();
- }
- }
- Ui.prototype.addDecorations = function() {
- var goalMarker, info;
- info = new dka.TypingText(this.level.placeDate, 'bold 24px karnivoreRegular, Arial', dka.colors.lightBlue, this.level, 20, '_', 2, 8).set({
- x: 32,
- y: canvasHeight - 60,
- textBaseline: 'alphabetic'
- });
- this.addChild(info);
- goalMarker = new createjs.Bitmap(dka.academy.assetManager.getAsset('goalMarker'));
- goalMarker.set({
- x: this.level.goalMarkerPosition.x,
- y: this.level.goalMarkerPosition.y - 50,
- alpha: 0
- });
- this.addChild(goalMarker);
- return createjs.Tween.get(goalMarker, {
- useTicks: true
- }).to({
- alpha: 1,
- y: this.level.goalMarkerPosition.y
- }, 20, createjs.Ease.cubicIn).wait(3 * 30).to({
- alpha: 0,
- y: this.level.goalMarkerPosition.y - 50
- }, 20, createjs.Ease.cubicOut).call(function() {
- return this.parent.removeChild(this);
- });
- };
- Ui.prototype.showWaveFlags = function() {
- var j, ref, results, road;
- results = [];
- 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) {
- this.waveFlags.push(new dka.WaveFlag(this.level, road));
- results.push(this.addChild(this.waveFlags[this.waveFlags.length - 1]));
- }
- return results;
- };
- Ui.prototype.removeWaveFlags = function() {
- var flag, j, len, ref;
- ref = this.waveFlags;
- for (j = 0, len = ref.length; j < len; j++) {
- flag = ref[j];
- flag.remove();
- }
- return this.waveFlags = [];
- };
- Ui.prototype.endScreen = function() {
- this.removeKeyEvents();
- return this.addChild(new dka.ScreenLevelEnd(this.level));
- };
- Ui.prototype.easyPause = function(trigger, value) {
- if (value === this.paused || this.level.finished || !this.level.pausable) {
- return;
- }
- value = value || !this.paused;
- this.level.removeToolTip();
- if (value) {
- this.paused = true;
- if (this.level.getFresherWaveIndex() >= 0) {
- this.level.removeLevelTicker();
- } else {
- dka.academy.removeStageTicker();
- }
- dka.academy.soundManager.pauseAll();
- if (trigger !== 'encyclopedia') {
- this.level.screenPause.show(trigger);
- gameStage.update();
- gameStage.cache(0, 0, canvasWidth, canvasHeight);
- return createjs.Ticker.paused = true;
- }
- } else {
- this.paused = false;
- dka.academy.soundManager.resume();
- this.level.screenPause.hide();
- gameStage.uncache();
- createjs.Ticker.paused = false;
- if (this.level.getFresherWaveIndex() >= 0) {
- return this.level.addLevelTicker();
- } else {
- return dka.academy.addStageTicker();
- }
- }
- };
- Ui.prototype.addKeyEvents = function() {
- Mousetrap.bind('p', (function(_this) {
- return function() {
- return _this.easyPause('key');
- };
- })(this));
- Mousetrap.bind('t', (function(_this) {
- return function() {
- if (!_this.paused) {
- return _this.helpButtonsHolder.feverButton.doAction(true);
- }
- };
- })(this));
- Mousetrap.bind('y', (function(_this) {
- return function() {
- if (!_this.paused) {
- return _this.helpButtonsHolder.vaccineButton.doAction(true);
- }
- };
- })(this));
- return Mousetrap.bind('up up down down left right left right b a enter', (function(_this) {
- return function() {
- var i, j, ref, results;
- results = [];
- for (i = j = 0, ref = _this.level.diseasesLayer.numChildren; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
- results.push(_this.level.diseasesLayer.getChildAt(0).die());
- }
- return results;
- };
- })(this));
- };
- Ui.prototype.removeKeyEvents = function() {
- return Mousetrap.reset();
- };
- return Ui;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.SoundManager = (function() {
- function SoundManager() {}
- SoundManager.prototype.stopAll = function() {};
- SoundManager.prototype.pauseAll = function() {
- if (this.soundtrack) {
- return this.soundtrack.pause();
- }
- };
- SoundManager.prototype.resume = function() {
- if (this.soundtrack) {
- return this.soundtrack.resume();
- }
- };
- SoundManager.prototype.playBackgroundsound = function() {
- return this.soundtrack = createjs.Sound.play('soundMagieder', createjs.Sound.INTERRUPT_ANY, 0, 0, -1);
- };
- SoundManager.prototype.play = function(sound) {};
- return SoundManager;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- dka.DataManager = (function() {
- function DataManager() {}
- DataManager.prototype.saveLevelProgress = function() {
- return typeof localStorage !== "undefined" && localStorage !== null ? localStorage.setItem('levelprogress', dka.academy.game.serialize()) : void 0;
- };
- DataManager.prototype.retrieveLevelProgress = function() {
- return JSON.parse(typeof localStorage !== "undefined" && localStorage !== null ? localStorage.getItem('levelprogress') : void 0);
- };
- DataManager.prototype.saveLabsPurchases = function() {
- return typeof localStorage !== "undefined" && localStorage !== null ? localStorage.setItem('labs', dka.academy.game.labs.serialize()) : void 0;
- };
- DataManager.prototype.retrieveLabsPurchases = function() {
- return JSON.parse(typeof localStorage !== "undefined" && localStorage !== null ? localStorage.getItem('labs') : void 0);
- };
- return DataManager;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty,
- slice = [].slice;
- String.prototype.uppercaseFirstLetter = function() {
- return this.slice(0, 1).toUpperCase() + this.substring(1);
- };
- dka.HintBox = (function(superClass) {
- extend(HintBox, superClass);
- function HintBox() {
- HintBox.__super__.constructor.call(this);
- this.hintOffset = 16;
- this.maxTextWidth = 150;
- this.rectPadding = 7;
- this.bottomMargins = {
- title: 10,
- separator: 5,
- description: 10,
- props: 1
- };
- this.textFonts = {
- title: '16px Arial',
- description: '13px Arial',
- props: '13px Arial'
- };
- this.textColors = {
- title: '#FFE000',
- description: '#F0F0F0',
- prop: '#F0F0F0',
- green: '#10F000',
- red: '#FF0000'
- };
- this.threadPositions = [];
- this.rectWidth = 0;
- this.rectHeight = 0;
- }
- HintBox.prototype.load = function(target, hintData) {
- var backRect, nextY, separator, separatorPos, title;
- this.target = target;
- this.removeAllChildren();
- this.set({
- alpha: 0.8
- });
- this.on('tick', function(e) {
- if (!this.target || !gameStage.contains(this.target)) {
- return createjs.Tween.get(this, {
- useTicks: true
- }).to({
- alpha: 0
- }, 6).call(function() {
- return this.hide();
- });
- }
- });
- separatorPos = new createjs.Point();
- nextY = this.rectPadding + 15;
- title = (new createjs.Text(hintData.title, this.textFonts.title, this.textColors.title)).set({
- x: this.rectPadding,
- y: nextY,
- lineWidth: this.maxTextWidth,
- textBaseline: 'alphabetic'
- });
- this.addChild(title);
- nextY += this.bottomMargins.title;
- separatorPos.x = this.rectPadding;
- separatorPos.y = nextY;
- nextY += this.bottomMargins.separator + title.getMeasuredHeight();
- if (hintData.description) {
- nextY = this.addDescription(hintData.description, nextY);
- }
- if (hintData.props) {
- if (hintData.description) {
- nextY += this.bottomMargins.description;
- }
- nextY = this.addProps(hintData.props, nextY);
- }
- this.rectWidth = this.getRectWidth();
- this.rectHeight = nextY;
- backRect = new createjs.Shape();
- backRect.graphics.beginFill('#1e1e1e').drawRoundRect(0, 0, this.rectWidth, this.rectHeight, 5);
- this.addChildAt(backRect, 0);
- separator = new createjs.Shape().set({
- x: separatorPos.x,
- y: separatorPos.y
- });
- separator.graphics.beginStroke('#000').moveTo(0, 0).lineTo(this.rectWidth - 2 * this.rectPadding, 0);
- this.addChildAt(separator, 1);
- this.position();
- return this.cache(0, 0, this.rectWidth, this.rectHeight);
- };
- HintBox.prototype.addDescription = function(txt, nextY) {
- var description;
- description = (new createjs.Text(txt, this.textFonts.description, this.textColors.description)).set({
- x: this.rectPadding,
- y: nextY,
- lineWidth: this.maxTextWidth,
- textBaseline: 'alphabetic'
- });
- this.addChild(description);
- return nextY + description.getMeasuredHeight();
- };
- HintBox.prototype.addProps = function(props, nextY) {
- var i, j, len, prop, propName, propValue, textLine;
- for (i = j = 0, len = props.length; j < len; i = ++j) {
- prop = props[i];
- propName = new createjs.Text(prop.caption.uppercaseFirstLetter() + (prop.separator || ': '), this.textFonts.props, this.textColors.prop).set({
- lineWidth: this.maxTextWidth,
- textBaseline: 'alphabetic'
- });
- if (prop.value instanceof Array) {
- if (prop.value.length === 2) {
- propValue = new createjs.Text(prop.value[0] + '-' + prop.value[1], this.textFonts.props, this.getColor(prop.color)).set({
- lineWidth: this.maxTextWidth,
- textBaseline: 'alphabetic'
- });
- }
- } else {
- propValue = new createjs.Text(prop.value, this.textFonts.props, this.getColor(prop.color)).set({
- lineWidth: this.maxTextWidth,
- textBaseline: 'alphabetic'
- });
- }
- textLine = this.concateTexts(propName, propValue).set({
- x: this.rectPadding,
- y: nextY
- });
- this.addChild(textLine);
- nextY = textLine.y + propName.getMeasuredHeight();
- if (i < props.length - 1) {
- nextY += this.bottomMargins.props;
- }
- }
- return nextY;
- };
- HintBox.prototype.getRectWidth = function() {
- var i, j, rectWidth, ref, width;
- rectWidth = 0;
- width = 0;
- for (i = j = ref = this.numChildren - 1; j >= 0; i = j += -1) {
- if (this.getChildAt(i).text) {
- width = this.getChildAt(i).getBounds().width;
- if (width < this.maxTextWidth) {
- if (width > rectWidth) {
- rectWidth = width + 2 * this.rectPadding;
- }
- } else {
- return this.maxTextWidth + 2 * this.rectPadding;
- }
- } else {
- if (this.getChildAt(i).width < this.maxTextWidth && this.getChildAt(i).width > rectWidth) {
- rectWidth = this.getChildAt(i).width + 2 * this.rectPadding;
- }
- }
- }
- return rectWidth;
- };
- HintBox.prototype.getColor = function(color) {
- switch (color) {
- case 'green':
- return this.textColors.green;
- case 'red':
- return this.textColors.red;
- default:
- return this.textColors.prop;
- }
- };
- HintBox.prototype.position = function() {
- var hintPoint, objPoint;
- objPoint = new createjs.Point(this.target.x, this.target.y);
- objPoint = this.target.localToGlobal(this.target.regX, this.target.regY);
- hintPoint = new createjs.Point();
- if (objPoint.x + this.rectWidth + this.hintOffset > canvasWidth) {
- hintPoint.x = objPoint.x - (this.rectWidth + this.hintOffset);
- } else {
- hintPoint.x = objPoint.x + this.hintOffset;
- }
- if (objPoint.y + this.rectHeight + this.hintOffset > canvasHeight) {
- hintPoint.y = objPoint.y - (this.rectHeight + this.hintOffset);
- } else {
- hintPoint.y = objPoint.y + this.hintOffset;
- }
- return this.set({
- x: hintPoint.x,
- y: hintPoint.y
- });
- };
- HintBox.prototype.hide = function() {
- this.visible = false;
- return this.removeAllEventListeners();
- };
- HintBox.prototype.concateTexts = function() {
- var j, len, nextX, text, textContainer, texts;
- texts = 1 <= arguments.length ? slice.call(arguments, 0) : [];
- nextX = 0;
- textContainer = new createjs.Container();
- for (j = 0, len = texts.length; j < len; j++) {
- text = texts[j];
- text.x = nextX;
- nextX += text.getMeasuredWidth();
- textContainer.addChild(text);
- }
- textContainer.width = nextX;
- return textContainer;
- };
- return HintBox;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.DiseaseSplash = (function(superClass) {
- extend(DiseaseSplash, superClass);
- function DiseaseSplash(x, y) {
- if (x == null) {
- x = 0;
- }
- if (y == null) {
- y = 0;
- }
- DiseaseSplash.__super__.constructor.call(this, dka.academy.assetManager.getAsset('spriteDiseaseSplash'));
- this.x = x;
- this.y = y;
- this.gotoAndPlay(0);
- this.on('animationend', this.animationend);
- }
- DiseaseSplash.prototype.animationend = function() {
- return this.parent.removeChild(this);
- };
- return DiseaseSplash;
- })(createjs.Sprite);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.Disease = (function(superClass) {
- extend(Disease, superClass);
- function Disease(level, road, path) {
- var settings;
- Disease.__super__.constructor.call(this);
- this.level = level;
- this.road = road;
- this.path = path;
- this.sprite = new createjs.Sprite();
- this.addChild(this.sprite);
- this.antibodies = new createjs.Container();
- this.addChild(this.antibodies);
- this.pointToReach = 0;
- this.isActive = false;
- this.stopped = false;
- this.braked = false;
- this.put(new createjs.Point(path[this.pointToReach].x, path[this.pointToReach].y));
- settings = level.settings.diseases[this.diseaseName];
- this.beforeBrake = this.initialSpeed = this.speed = settings.speed;
- this.initialLife = this.life = settings.life;
- this.damage = settings.damage;
- this.attackReload = settings.attackReload;
- this.lifeCost = settings.lifeCost;
- this.lifeBar = new dka.ProgressBar(false, 28, 6, '#00E400', '#FF0000', dka.colors.darkGrey).set({
- y: -18
- });
- this.lifeBar.setProgress(1);
- this.lifeBar.visible = false;
- this.addChild(this.lifeBar);
- this.wave = this.level.getFresherWave();
- this.alive = true;
- this.readyToAttack = true;
- this.waitToAttack = 0;
- this.antibodiesCounter = 0;
- this.distanceToExit = path.length * level.distanceBetweenWP;
- if (TXT_NBR) {
- this.addTxtNbr();
- }
- }
- Disease.prototype.put = function(position) {
- this.x = position.x;
- return this.y = position.y;
- };
- Disease.prototype.tick = function() {
- var i, l;
- if (this.readyToAttack !== true) {
- this.waitToAttack++;
- if (this.waitToAttack >= this.attackReload) {
- this.waitToAttack = 0;
- this.readyToAttack = true;
- }
- }
- if (this.level.moveDiseases && !this.stopped) {
- this.move();
- }
- i = 0;
- l = this.antibodies.numChildren;
- while (i < l) {
- this.antibodies.getChildAt(i).tick();
- i++;
- }
- if (TXT_NBR) {
- return this.updateTxtNbr();
- }
- };
- Disease.prototype.move = function() {
- var angle, deltaX, deltaY, nxtX, nxtY, pointToReach;
- pointToReach = this.path[this.pointToReach];
- deltaX = pointToReach.x - this.x;
- deltaY = pointToReach.y - this.y;
- this.dstToWaypoint = this.level.euclidDistance(this.x, this.y, pointToReach.x, pointToReach.y);
- if (this.dstToWaypoint < this.speed) {
- this.reachingWP();
- }
- angle = Math.atan2(deltaY, deltaX);
- nxtX = this.x + this.speed * Math.cos(angle);
- nxtY = this.y + this.speed * Math.sin(angle);
- this.x = nxtX;
- this.y = nxtY;
- if (this.level.isVisibleByPlayer(this.x, this.y)) {
- this.isActive = true;
- } else {
- this.isActive = false;
- }
- if (TXT_NBR) {
- this.txtNbr.x = this.x;
- return this.txtNbr.y = this.y + 7;
- }
- };
- Disease.prototype.reachingWP = function() {
- if (this.pointToReach < this.path.length - 1) {
- this.pointToReach++;
- return this.distanceToExit -= this.level.distanceBetweenWP;
- } else {
- this.wave.diseasesArrived++;
- this.level.loseLives(this.lifeCost);
- this.remove();
- if (this.level.playerLives <= 0) {
- return this.level.finish();
- }
- }
- };
- Disease.prototype.isTargetable = function() {
- if (this.isActive && this.alive) {
- return true;
- } else {
- return false;
- }
- };
- Disease.prototype.die = function() {
- var dnaEarned, reward;
- if (!this.alive) {
- return;
- }
- dnaEarned = this.initialLife;
- this.level.addDna(dnaEarned);
- reward = new dka.BouncingText('+' + dnaEarned, 'bold 12px karnivoreRegular, Arial', '#1FC121', new createjs.Point(this.x, this.y));
- this.level.ui.addChild(reward);
- this.wave.diseasesKilled++;
- return this.remove();
- };
- Disease.prototype.remove = function() {
- if (!this.alive) {
- return;
- }
- if (!this.level.finished) {
- this.wave.verifFinished();
- }
- this.alive = false;
- if (this.lifeBar) {
- this.lifeBar.parent.removeChild(this.lifeBar);
- }
- this.parent.removeChild(this);
- return gameStage.removeChild(this.txtNbr);
- };
- Disease.prototype.beDamaged = function(damage) {
- this.life -= damage;
- if (this.life <= 0) {
- this.life = 0;
- this.die();
- return true;
- } else {
- if (this.alive) {
- this.updateLifeBar();
- }
- return false;
- }
- };
- Disease.prototype.hit = function() {
- return this.addChild(new dka.DiseaseSplash());
- };
- Disease.prototype.updateLifeBar = function() {
- this.lifeBar.setProgress(this.life / this.initialLife);
- return this.lifeBar.visible = true;
- };
- Disease.prototype.getDamage = function() {
- return Math.ceil(Math.random() * (this.damage[1] - this.damage[0]) + this.damage[0]);
- };
- Disease.prototype.brake = function(brake) {
- this.braked = true;
- return this.speed *= brake;
- };
- Disease.prototype.preventMultiplication = function() {
- return false;
- };
- Disease.prototype.addAntibody = function(antibody) {
- return this.antibodies.addChild(antibody);
- };
- Disease.prototype.educate = function() {
- return false;
- };
- Disease.prototype.updateTxtNbr = function() {
- return this.txtNbr.text = Math.round(this.speed * 100) / 100;
- };
- Disease.prototype.addTxtNbr = function() {
- this.txtNbr = new createjs.Text(this.speed, '20px Arial', '#FFFFFF').set({
- x: this.x,
- y: this.y + 7,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- return gameStage.addChild(this.txtNbr);
- };
- return Disease;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.DiseaseBacterium = (function(superClass) {
- extend(DiseaseBacterium, superClass);
- function DiseaseBacterium(level, road, path, isDaughter, mother) {
- var malus;
- DiseaseBacterium.__super__.constructor.call(this, level, road, path);
- this.type = 'Bacterium';
- malus = level.getHospital().getAbilityResult('education', this);
- this.delayToMultiplicate = level.settings.diseases[this.diseaseName].delayToMultiplicate + (malus ? malus : 0) + (Math.random() * 50) | 0;
- this.waitToMultipicate = 0;
- this.canMultiplicate = true;
- this.on('mouseover', function() {
- return console.log(this.delayToMultiplicate);
- });
- if (isDaughter) {
- this.daughter = true;
- this.growingState = true;
- this.delayToMultiplicate *= 2;
- this.rotation = mother.rotation;
- this.speed = mother.speed;
- this.pointToReach = mother.pointToReach;
- this.distanceTraveled = mother.distanceTraveled;
- this.distanceToExit = mother.distanceToExit;
- this.wave = mother.wave;
- this.put(new createjs.Point(mother.x, mother.y));
- }
- }
- DiseaseBacterium.prototype.tick = function() {
- if (this.canMultiplicate && this.level.moveDiseases) {
- this.waitToMultipicate++;
- if (this.waitToMultipicate >= this.delayToMultiplicate) {
- this.waitToMultipicate = 0;
- this.addSmallDisease();
- }
- }
- if (this.daughter && this.growingState) {
- if (this.braked) {
- this.growingState = false;
- }
- if (this.speed === this.initialSpeed) {
- this.speed *= 0.5;
- } else {
- this.speed += 0.01;
- if (this.speed >= this.initialSpeed) {
- this.speed = this.initialSpeed;
- this.growingState = false;
- }
- }
- }
- return DiseaseBacterium.__super__.tick.call(this);
- };
- DiseaseBacterium.prototype.addSmallDisease = function() {
- var disease;
- disease = new dka['Disease' + this.diseaseName](this.level, this.road, this.path, true, this);
- this.parent.addChildAt(disease, this.parent.getChildIndex(this));
- return this.wave.diseasesSpawned++;
- };
- DiseaseBacterium.prototype.preventMultiplication = function() {
- return this.canMultiplicate = false;
- };
- DiseaseBacterium.prototype.educate = function(malus) {
- return this.delayToMultiplicate = this.delayToMultiplicate + malus;
- };
- return DiseaseBacterium;
- })(dka.Disease);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.DiseaseVirus = (function(superClass) {
- extend(DiseaseVirus, superClass);
- function DiseaseVirus(level, road, path) {
- DiseaseVirus.__super__.constructor.call(this, level, road, path);
- this.type = 'Virus';
- }
- DiseaseVirus.prototype.tick = function() {
- return DiseaseVirus.__super__.tick.call(this);
- };
- return DiseaseVirus;
- })(dka.Disease);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.DiseaseHIV = (function(superClass) {
- extend(DiseaseHIV, superClass);
- function DiseaseHIV(level, road, path) {
- this.diseaseName = 'HIV';
- DiseaseHIV.__super__.constructor.call(this, level, road, path);
- this.sprite.spriteSheet = dka.academy.assetManager.getAsset('sHIV');
- this.maxAntibodies = 4;
- this.radius = 9;
- }
- return DiseaseHIV;
- })(dka.DiseaseVirus);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.DiseasePlague = (function(superClass) {
- extend(DiseasePlague, superClass);
- function DiseasePlague(level, road, path, isDaughter, mother) {
- this.diseaseName = 'Plague';
- DiseasePlague.__super__.constructor.call(this, level, road, path, isDaughter, mother);
- this.sprite.spriteSheet = dka.academy.assetManager.getAsset('sPlague');
- this.maxAntibodies = 3;
- this.radius = 9;
- }
- return DiseasePlague;
- })(dka.DiseaseBacterium);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.DiseaseTuberculosis = (function(superClass) {
- extend(DiseaseTuberculosis, superClass);
- function DiseaseTuberculosis(level, road, path, isDaughter, mother) {
- this.diseaseName = 'Tuberculosis';
- DiseaseTuberculosis.__super__.constructor.call(this, level, road, path, isDaughter, mother);
- this.sprite.spriteSheet = dka.academy.assetManager.getAsset('sTuberculosis');
- this.maxAntibodies = 3;
- this.radius = 9;
- }
- return DiseaseTuberculosis;
- })(dka.DiseaseBacterium);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.Game = (function() {
- function Game() {
- this.autopause = true;
- this.settings = new dka.GameSettings();
- this.labs = new dka.Labs(this);
- this.knownDiseases = [];
- this.playerGold = [];
- this.usedGold = 0;
- createjs.Sound.stop();
- if (localStorage) {
- if (localStorage.getItem('muted') === 'true') {
- createjs.Sound.setMute(1);
- }
- if (localStorage.getItem('autopause') === 'false') {
- this.autopause = false;
- }
- }
- this.restore();
- }
- Game.prototype.restore = function() {
- var serialized;
- serialized = dka.academy.dataManager.retrieveLevelProgress();
- if (!serialized) {
- return;
- }
- this.knownDiseases = serialized.knownDiseases;
- this.playerGold = serialized.playerGold;
- return this.usedGold = serialized.usedGold;
- };
- Game.prototype.serialize = function() {
- var serialized;
- serialized = {};
- serialized.knownDiseases = this.knownDiseases;
- serialized.playerGold = this.playerGold;
- serialized.usedGold = this.usedGold;
- return JSON.stringify(serialized);
- };
- Game.prototype.launchLevel = function(level) {
- var ref;
- gameStage.removeAllChildren();
- if ((ref = this.currentLevel) != null) {
- ref.removeLevelTicker();
- }
- dka.academy.removeBlurEvent();
- this.currentLevel = new dka['Level' + level](this);
- return gameStage.addChild(this.currentLevel);
- };
- Game.prototype.addGold = function(gold, level) {
- var gain;
- if (this.playerGold.length === level) {
- this.playerGold.push(0);
- }
- gain = gold - this.playerGold[level];
- if (gain > 0) {
- this.playerGold[level] += gain;
- }
- return dka.academy.dataManager.saveLevelProgress();
- };
- Game.prototype.removeGold = function(gold) {
- this.usedGold += gold;
- return dka.academy.dataManager.saveLevelProgress();
- };
- Game.prototype.resetGold = function() {
- this.usedGold = 0;
- return dka.academy.dataManager.saveLevelProgress();
- };
- Game.prototype.getTotalGold = function() {
- var gold, i, len, ref, total;
- if (this.playerGold.length === 0) {
- return 0;
- }
- total = 0;
- ref = this.playerGold;
- for (i = 0, len = ref.length; i < len; i++) {
- gold = ref[i];
- total += gold;
- }
- return total - this.usedGold;
- };
- return Game;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- *
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.AssetManager = (function() {
- function AssetManager() {
- this._assets = {};
- }
- AssetManager.prototype.addAsset = function(assetName, asset) {
- if (assetName && asset) {
- return this._assets[assetName] = asset;
- }
- };
- AssetManager.prototype.getAsset = function(assetName) {
- if (assetName) {
- return this._assets[assetName];
- }
- };
- return AssetManager;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.SpriteSheets = (function() {
- function SpriteSheets() {
- this._spriteSheets = {};
- }
- SpriteSheets.prototype.spriteSheets = function() {
- this._spriteSheets.spriteSyringue = {
- images: [dka.academy.assetManager.getAsset('syringueSP')],
- frames: {
- width: 32,
- height: 32,
- regY: 32
- },
- animations: {
- press: [0, 8]
- }
- };
- this._spriteSheets.sMysterious = {
- images: [dka.academy.assetManager.getAsset('mysterious')],
- frames: {
- width: 32,
- height: 32,
- regX: 16,
- regY: 16
- }
- };
- this._spriteSheets.sHIV = {
- images: [dka.academy.assetManager.getAsset('HIV')],
- frames: {
- width: 32,
- height: 32,
- regX: 16,
- regY: 16
- },
- animations: {
- move: [0, 0]
- }
- };
- this._spriteSheets.sPlague = {
- images: [dka.academy.assetManager.getAsset('Plague')],
- frames: {
- width: 32,
- height: 32,
- regX: 16,
- regY: 16
- },
- animations: {
- move: [0, 0]
- }
- };
- this._spriteSheets.sTuberculosis = {
- images: [dka.academy.assetManager.getAsset('Tuberculosis')],
- frames: {
- width: 30,
- height: 30,
- regX: 15,
- regY: 15
- },
- animations: {
- move: [0, 0]
- }
- };
- this._spriteSheets.spriteDiseaseSplash = {
- images: [dka.academy.assetManager.getAsset('DiseaseSplash')],
- frames: {
- width: 24,
- height: 24,
- regX: 12,
- regY: 12
- }
- };
- this._spriteSheets.spriteTower = {
- images: [dka.academy.assetManager.getAsset('Tour2')],
- frames: {
- width: 48,
- height: 48,
- regX: 24,
- regY: 24
- },
- animations: {
- fire: [0, 0]
- }
- };
- this._spriteSheets.TowerPill = {
- images: [dka.academy.assetManager.getAsset('towerPill')],
- frames: {
- width: 48,
- height: 48,
- regX: 24,
- regY: 9
- },
- animations: {
- fire: [0, 0]
- }
- };
- this._spriteSheets.spriteTowerCellB = {
- images: [dka.academy.assetManager.getAsset('TowerCellB0')],
- frames: {
- width: 48,
- height: 48,
- regX: 24,
- regY: 24
- },
- animations: {
- fire: [0, 0]
- }
- };
- this._spriteSheets.spriteTowerCellMacrophage = {
- images: [dka.academy.assetManager.getAsset('TowerCellMacrophage')],
- frames: {
- width: 48,
- height: 48,
- regX: 24,
- regY: 24
- },
- animations: {
- fire: [0, 0]
- }
- };
- this._spriteSheets.spriteCellB = {
- images: [dka.academy.assetManager.getAsset('CellB1')],
- frames: {
- width: 16,
- height: 16,
- regX: 8,
- regY: 8
- },
- animations: {
- move: [0, 0, 'move'],
- attack: [0, 0, 'move']
- }
- };
- this._spriteSheets.spriteTCellPatrol = {
- images: [dka.academy.assetManager.getAsset('TCellPatrol1')],
- frames: {
- width: 16,
- height: 16,
- regX: 8,
- regY: 8
- },
- animations: {
- move: [0, 0, 'move'],
- attack: [0, 0, 'move']
- }
- };
- this._spriteSheets.spriteTablet = {
- images: [dka.academy.assetManager.getAsset('Tablet')],
- frames: {
- width: 12,
- height: 12,
- regX: 6,
- regY: 6
- },
- animations: {
- touch: [0, 0, 'touch']
- }
- };
- this._spriteSheets.spCapsule = {
- images: [dka.academy.assetManager.getAsset('Capsule')],
- frames: {
- width: 20,
- height: 14,
- regX: 10,
- regY: 7
- }
- };
- this._spriteSheets.spCapsuleSmoke = {
- images: [dka.academy.assetManager.getAsset('CapsuleSmoke')],
- frames: {
- width: 50,
- height: 50,
- regX: 25,
- regY: 25
- }
- };
- this._spriteSheets.spriteTabletSmoke = {
- images: [dka.academy.assetManager.getAsset('TabletSmoke')],
- frames: {
- width: 12,
- height: 12,
- regX: 6,
- regY: 6
- }
- };
- this._spriteSheets.spriteBulletEffect = {
- images: [dka.academy.assetManager.getAsset('SyringueEff1')],
- frames: {
- width: 8,
- height: 8,
- regX: 4,
- regY: 4
- },
- animations: {
- boum: [0, 2]
- }
- };
- this._spriteSheets.sMuteSettingsBP = {
- images: [dka.academy.assetManager.getAsset('MuteSettingsBP')],
- frames: {
- width: 40,
- height: 40,
- regX: 20,
- regY: 20
- }
- };
- this._spriteSheets.sAutopauseSettingsBP = {
- images: [dka.academy.assetManager.getAsset('AutopauseSettingsBP')],
- frames: {
- width: 40,
- height: 40,
- regX: 20,
- regY: 20
- },
- animations: {
- out: [0, 0, 'out'],
- over: [1, 1, 'over'],
- down: [2, 2, 'down']
- }
- };
- this._spriteSheets.spriteVaccineStain = {
- images: [dka.academy.assetManager.getAsset('VaccineStain')],
- frames: {
- width: 64,
- height: 64,
- regX: 32,
- regY: 32
- },
- animations: {
- spread: [0, 3]
- }
- };
- return this._spriteSheets.spriteMenuButton = {
- images: [dka.academy.assetManager.getAsset('bpMenu')],
- frames: {
- width: 44,
- height: 53,
- regX: 22,
- regY: 19
- }
- };
- };
- SpriteSheets.prototype.build = function() {
- var results, spriteName;
- this.spriteSheets();
- results = [];
- for (spriteName in this._spriteSheets) {
- results.push(dka.academy.assetManager.addAsset(spriteName, new createjs.SpriteSheet(this._spriteSheets[spriteName])));
- }
- return results;
- };
- return SpriteSheets;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- 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; },
- hasProp = {}.hasOwnProperty;
- dka.LoadingClock = (function(superClass) {
- extend(LoadingClock, superClass);
- function LoadingClock() {
- LoadingClock.__super__.constructor.call(this);
- this.set({
- x: canvasWidth / 2,
- y: canvasHeight / 2
- });
- this.hourHand = new createjs.Shape();
- this.hourHand.graphics.setStrokeStyle(5, 1).beginStroke(dka.colors.darkBlue).drawCircle(0, 0, 10).moveTo(0, -10).lineTo(0, -100);
- this.minuteHand = new createjs.Shape();
- this.minuteHand.graphics.setStrokeStyle(5, 1).beginStroke(dka.colors.lightBlue).drawCircle(0, 0, 20).moveTo(0, -20).lineTo(0, -150);
- this.timeText = (new createjs.Text('0 %', '30px karnivoreRegular,Arial', dka.colors.darkBlue)).set({
- y: 200,
- textAlign: 'center',
- textBaseline: 'alphabetic'
- });
- this.addChild(this.hourHand, this.minuteHand, this.timeText);
- }
- LoadingClock.prototype.update = function(progress) {
- this.hourHand.rotation = -360 * progress;
- this.minuteHand.rotation = -360 * 12 * progress;
- return this.timeText.text = ((progress * 100) | 0) + ' %';
- };
- return LoadingClock;
- })(createjs.Container);
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.Loader = (function() {
- function Loader() {
- this.fileManifest = [
- {
- src: 'enemies/DiseaseSplash.png'
- }, {
- src: 'enemies/Plague.png'
- }, {
- src: 'FEL/felSplash.png'
- }, {
- src: 'FEL/electron.png'
- }, {
- src: 'enemies/HIV.png'
- }, {
- src: 'enemies/Tuberculosis.png'
- }, {
- src: 'labs/waveFlag1.png'
- }, {
- src: 'labs/vaccine1.png'
- }, {
- src: 'labs/fever1.png'
- }, {
- src: 'labs/back.png'
- }, {
- src: 'labs/reset.png'
- }, {
- src: 'labs/undo.png'
- }, {
- src: 'timeline/timeline.png'
- }, {
- src: 'timeline/clock.png'
- }, {
- src: 'timeline/level0Bp.png'
- }, {
- src: 'timeline/labsBp.png'
- }, {
- src: 'timeline/creditsBp.png'
- }, {
- src: 'interface/capsuleBP.png'
- }, {
- src: 'interface/tabletBP.png'
- }, {
- src: 'interface/credits.png'
- }, {
- src: 'interface/BaseBP1.png'
- }, {
- src: 'interface/tutoBack.png'
- }, {
- src: 'interface/tutoSplash1.png'
- }, {
- src: 'interface/tutoSplash2.png'
- }, {
- src: 'interface/nextButton.png'
- }, {
- src: 'interface/closeButton.png'
- }, {
- src: 'interface/bpStart.png'
- }, {
- src: 'interface/BCell.png'
- }, {
- src: 'interface/pauseBck.png'
- }, {
- src: 'interface/MacroCell.png'
- }, {
- src: 'interface/bpMenu.png'
- }, {
- src: 'interface/menuStartBg.png'
- }, {
- src: 'interface/pauseButtonHolder.png'
- }, {
- src: 'interface/callWave.png'
- }, {
- src: 'interface/coinHud.png'
- }, {
- src: 'interface/dnaHud.png'
- }, {
- src: 'interface/waveHud.png'
- }, {
- src: 'interface/educ.png'
- }, {
- src: 'interface/subsidies.png'
- }, {
- src: 'interface/tutoBubbleSmall.png'
- }, {
- src: 'interface/tutoBubbleLarge.png'
- }, {
- src: 'interface/feverHalo.png'
- }, {
- src: 'interface/gradhat.png'
- }, {
- src: 'interface/lifeIco.png'
- }, {
- src: 'interface/speedIco.png'
- }, {
- src: 'interface/lifeCostIco.png'
- }, {
- src: 'interface/virusBar.png'
- }, {
- src: 'interface/bacteriumBar.png'
- }, {
- src: 'interface/hexMenu.png'
- }, {
- src: 'interface/hudBar.png'
- }, {
- src: 'interface/msgBalloon.png'
- }, {
- src: 'interface/LevelsBP.png'
- }, {
- src: 'interface/lifeHud.png'
- }, {
- src: 'interface/SettingsPauseBP.png'
- }, {
- src: 'interface/LevelsPauseBP.png'
- }, {
- src: 'interface/RetryPauseBP.png'
- }, {
- src: 'interface/MuteSettingsBP.png'
- }, {
- src: 'interface/AutopauseSettingsBP.png'
- }, {
- src: 'interface/vaccineBP.png'
- }, {
- src: 'interface/mysterious.png'
- }, {
- src: 'interface/leftCorner.png'
- }, {
- src: 'interface/border.png'
- }, {
- src: 'interface/PauseBP.png'
- }, {
- src: 'interface/EncyclopediaBP.png'
- }, {
- src: 'interface/encyclopediaBk.png'
- }, {
- src: 'interface/syringueSP.png'
- }, {
- src: 'interface/feverBP.png'
- }, {
- src: 'interface/TryAgainBP.png'
- }, {
- src: 'interface/VaccineStain.png'
- }, {
- src: 'interface/tutoBg.png'
- }, {
- src: 'interface/goalMarker.png'
- }, {
- src: 'levels/FondTest3.png'
- }, {
- src: 'levels/map0.png'
- }, {
- src: 'levels/hospital0.png'
- }, {
- src: 'towers/antibodyIgA.png'
- }, {
- src: 'towers/antibodyIgG.png'
- }, {
- src: 'towers/antibodyIgM.png'
- }, {
- src: 'towers/Capsule.png'
- }, {
- src: 'towers/CapsuleSmoke.png'
- }, {
- src: 'towers/CellB1.png'
- }, {
- src: 'towers/CellMacrophage.png'
- }, {
- src: 'interface/crateBP.png'
- }, {
- src: 'towers/towerLocation.png'
- }, {
- src: 'towers/ReloadBP.png'
- }, {
- src: 'towers/Syringue1.png'
- }, {
- src: 'towers/SyringueEff1.png'
- }, {
- src: 'towers/Tablet.png'
- }, {
- src: 'towers/TabletSmoke.png'
- }, {
- src: 'towers/towerPill.png'
- }, {
- src: 'towers/TCellPatrol1.png'
- }, {
- src: 'towers/Tour2.png'
- }, {
- src: 'towers/TowerCellB0.png'
- }, {
- src: 'towers/TowerCellMacrophage.png'
- }, {
- src: 'interface/upgradeDnaBP.png'
- }, {
- src: 'interface/upgradeGoldBP.png'
- }
- ];
- this.load();
- }
- Loader.prototype.load = function() {
- var queue;
- this.clock = gameStage.addChild(new dka.LoadingClock());
- dka.academy.addStageTicker();
- queue = this.queue = new createjs.LoadQueue(true, 'dist/assets/');
- queue.installPlugin(createjs.Sound);
- createjs.Sound.alternateExtensions = ['mp3'];
- queue.on('progress', this.handleProgress, this);
- queue.on('complete', this.handleComplete, this);
- queue.on('error', this.handleError, this);
- return queue.loadManifest(this.fileManifest);
- };
- Loader.prototype.handleProgress = function(e) {
- return this.clock.update(e.progress);
- };
- Loader.prototype.handleComplete = function(e) {
- gameStage.removeAllChildren();
- gameStage.enableMouseOver(20);
- gameStage.mouseMoveOutside = true;
- this.initResources();
- return dka.academy.launchMagic();
- };
- Loader.prototype.handleError = function(e) {
- return console.log('Error Loader: ' + e.item.src);
- };
- Loader.prototype.initResources = function() {
- var asset, assetName;
- for (asset in this.fileManifest) {
- assetName = this.fileManifest[asset].src.match(/[^\/]*$/)[0].split('.')[0];
- dka.academy.assetManager.addAsset(assetName, this.queue.getResult(this.fileManifest[asset].src));
- }
- return (new dka.SpriteSheets).build();
- };
- return Loader;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- dka.Academy = (function() {
- function Academy() {
- dka.academy = this;
- this.LEVEL_NUMBER = 1;
- this.loader = new dka.Loader();
- this.dataManager = new dka.DataManager();
- this.assetManager = new dka.AssetManager();
- this.soundManager = new dka.SoundManager();
- }
- Academy.prototype.addStageTicker = function() {
- return createjs.Ticker.addEventListener('tick', gameStage);
- };
- Academy.prototype.removeStageTicker = function() {
- return createjs.Ticker.removeEventListener('tick', gameStage);
- };
- Academy.prototype.addBlurEvent = function(func) {
- this.blurFunc = func;
- return window.addEventListener('blur', func);
- };
- Academy.prototype.removeBlurEvent = function() {
- return window.removeEventListener('blur', this.blurFunc);
- };
- Academy.prototype.showFEL = function() {
- gameStage.removeAllChildren();
- return gameStage.addChild(new dka.ScreenFEL());
- };
- Academy.prototype.launchMagic = function() {
- gameStage.removeAllChildren();
- if (LEVEL_MODE) {
- this.launchGame();
- return this.game.launchLevel(0);
- } else {
- if (TIMELINE_MODE) {
- return this.launchGame();
- } else {
- return gameStage.addChild(new dka.ScreenStart());
- }
- }
- };
- Academy.prototype.launchGame = function() {
- gameStage.removeAllChildren();
- this.game = new dka.Game();
- return dka.academy.showTimeline();
- };
- Academy.prototype.showTimeline = function() {
- var ref;
- gameStage.removeAllChildren();
- if ((ref = this.game.currentLevel) != null) {
- ref.removeLevelTicker();
- }
- this.game.currentLevel = null;
- this.removeBlurEvent();
- return gameStage.addChild(new dka.ScreenTimeline());
- };
- Academy.prototype.showCredits = function() {
- return gameStage.addChild(new dka.ScreenCredits());
- };
- Academy.prototype.gotoLabs = function(timeline) {
- return gameStage.addChild(new dka.ScreenLabs(timeline));
- };
- Academy.prototype.fullScreen = function() {
- var canvas;
- canvas = document.getElementById('gameCanvas');
- if (canvas.requestFullScreen) {
- return canvas.requestFullScreen();
- } else if (canvas.webkitRequestFullScreen) {
- return canvas.webkitRequestFullScreen(canvas.ALLOW_KEYBOARD_INPUT);
- } else if (canvas.mozRequestFullScreen) {
- return canvas.mozRequestFullScreen();
- } else {
- return alert('Sorry, your browser does not support fullscreen mode.');
- }
- };
- return Academy;
- })();
- }).call(this);
- /*
- * Copyright © Romain Fouquet, 2012-2015
- * Copyright © Clément Joly, 2012-2015
- #
- * romain.fouquet18@gmail.com
- * leowzukw@vmail.me
- #
- * This file is part of Diseases Killer Academy.
- #
- * Diseases Killer Academy is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- #
- * Diseases Killer Academy is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- #
- * You should have received a copy of the GNU Affero General Public License
- * along with Diseases Killer Academy. If not, see http://www.gnu.org/licenses/agpl-3.0.html.
- */
- (function() {
- 'use strict';
- window.onload = function() {
- var academy, canvas;
- canvas = document.getElementById('gameCanvas');
- canvas.addEventListener('contextmenu', (function(e) {
- e.preventDefault();
- return location.reload();
- }), false);
- if (!(LEO_DEV_MODE || DEBUG_MODE)) {
- window.onbeforeunload = function() {
- return 'If you close, you will lose your progress in the current level.';
- };
- }
- window.gameStage = new createjs.Stage(canvas);
- createjs.MotionGuidePlugin.install();
- window.canvasHeight = canvas.height;
- window.canvasWidth = canvas.width;
- createjs.Ticker.setFPS(30);
- createjs.Touch.enable(gameStage, true);
- academy = new dka.Academy();
- if (DEBUG_MODE) {
- return gameStage.on('click', function(e) {
- if (e.nativeEvent.which === 2) {
- return console.log(e.stageX, e.stageY);
- }
- });
- }
- };
- }).call(this);