add more gems, next is to add functionality to gems, also need to add way to upgrade gems
BIN
public/assets/gems/Soulforge/1.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
public/assets/gems/Soulforge/2.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
public/assets/gems/Titalium/1.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
public/assets/gems/Titalium/2.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
public/assets/gems/Titalium/3.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
public/assets/gems/Yeti/1.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
public/assets/gems/Yeti/2.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
@ -39,5 +39,142 @@
|
|||||||
"frostfire": 0
|
"frostfire": 0
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Yeti Gem",
|
||||||
|
"description": "Yeti gem description. Something something, write this while drunk or something.",
|
||||||
|
"type": "Yeti",
|
||||||
|
"totalLevels": 2,
|
||||||
|
"textures": [],
|
||||||
|
"cantCombineWith": [],
|
||||||
|
"specialCombine": [],
|
||||||
|
"genericImprovements": [
|
||||||
|
{
|
||||||
|
"damageUp": 2,
|
||||||
|
"attackSpeedUp": 100,
|
||||||
|
"rangeUp": 0.5,
|
||||||
|
"timeToLiveUp": 0,
|
||||||
|
"pierceUp": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"damageUp": 2,
|
||||||
|
"attackSpeedUp": 100,
|
||||||
|
"rangeUp": 0.5,
|
||||||
|
"timeToLiveUp": 0,
|
||||||
|
"pierceUp": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"gemResistanceModifications": [
|
||||||
|
{
|
||||||
|
"physical": 0,
|
||||||
|
"divine": 0,
|
||||||
|
"fire": 0,
|
||||||
|
"ice": 0,
|
||||||
|
"frostfire": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"physical": 0,
|
||||||
|
"divine": 0,
|
||||||
|
"fire": 0,
|
||||||
|
"ice": 0,
|
||||||
|
"frostfire": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Titalium Gem",
|
||||||
|
"description": "Titalium gem description. Something something zombie creeps working for you something something.",
|
||||||
|
"type": "Titalium",
|
||||||
|
"totalLevels": 3,
|
||||||
|
"textures": [],
|
||||||
|
"cantCombineWith": [],
|
||||||
|
"specialCombine": [],
|
||||||
|
"genericImprovements": [
|
||||||
|
{
|
||||||
|
"damageUp": 2,
|
||||||
|
"attackSpeedUp": 100,
|
||||||
|
"rangeUp": 0.5,
|
||||||
|
"timeToLiveUp": 0,
|
||||||
|
"pierceUp": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"damageUp": 2,
|
||||||
|
"attackSpeedUp": 100,
|
||||||
|
"rangeUp": 0,
|
||||||
|
"timeToLiveUp": 0,
|
||||||
|
"pierceUp": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"damageUp": 2,
|
||||||
|
"attackSpeedUp": 100,
|
||||||
|
"rangeUp": 0,
|
||||||
|
"timeToLiveUp": 0,
|
||||||
|
"pierceUp": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"gemResistanceModifications": [
|
||||||
|
{
|
||||||
|
"physical": 0,
|
||||||
|
"divine": 0,
|
||||||
|
"fire": 0,
|
||||||
|
"ice": 0,
|
||||||
|
"frostfire": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"physical": 0,
|
||||||
|
"divine": 0,
|
||||||
|
"fire": 0,
|
||||||
|
"ice": 0,
|
||||||
|
"frostfire": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"physical": 0,
|
||||||
|
"divine": 0,
|
||||||
|
"fire": 0,
|
||||||
|
"ice": 0,
|
||||||
|
"frostfire": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Soulforge Gem",
|
||||||
|
"description": "Soulforge gem description, have to write later.",
|
||||||
|
"type": "Soulforge",
|
||||||
|
"totalLevels": 2,
|
||||||
|
"textures": [],
|
||||||
|
"cantCombineWith": [],
|
||||||
|
"specialCombine": [],
|
||||||
|
"genericImprovements": [
|
||||||
|
{
|
||||||
|
"damageUp": 2,
|
||||||
|
"attackSpeedUp": 100,
|
||||||
|
"rangeUp": 0.5,
|
||||||
|
"timeToLiveUp": 0,
|
||||||
|
"pierceUp": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"damageUp": 2,
|
||||||
|
"attackSpeedUp": 100,
|
||||||
|
"rangeUp": 0.5,
|
||||||
|
"timeToLiveUp": 0,
|
||||||
|
"pierceUp": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"gemResistanceModifications": [
|
||||||
|
{
|
||||||
|
"physical": 0,
|
||||||
|
"divine": 0,
|
||||||
|
"fire": 0,
|
||||||
|
"ice": 0,
|
||||||
|
"frostfire": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"physical": 0,
|
||||||
|
"divine": 0,
|
||||||
|
"fire": 0,
|
||||||
|
"ice": 0,
|
||||||
|
"frostfire": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -33,8 +33,8 @@ export class Engine {
|
|||||||
Engine.NotificationManager.Notify('Loaded testing suite.', 'danger');
|
Engine.NotificationManager.Notify('Loaded testing suite.', 'danger');
|
||||||
Engine.TowerManager.ToggleChoosingTowerLocation('RESET');
|
Engine.TowerManager.ToggleChoosingTowerLocation('RESET');
|
||||||
Engine.TowerManager.PlaceTower(GameAssets.Towers[1], 8, 10, GameAssets.Towers[0].behaviour, true);
|
Engine.TowerManager.PlaceTower(GameAssets.Towers[1], 8, 10, GameAssets.Towers[0].behaviour, true);
|
||||||
for (let i = 0; i < 16; i++) {
|
for (let i = 0; i < 29; i++) {
|
||||||
this.GameScene.MissionStats.giveGem(new Gem(GemType.Fire), true);
|
this.GameScene.MissionStats.giveGem(new Gem(i % 4), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,15 @@ export default class Gem {
|
|||||||
public texture: PIXI.Texture;
|
public texture: PIXI.Texture;
|
||||||
public level: number = 1;
|
public level: number = 1;
|
||||||
public definition: GemDefinition;
|
public definition: GemDefinition;
|
||||||
public id: number;
|
public id: number | string;
|
||||||
constructor(gemType: GemType) {
|
constructor(gemType: GemType, doNotIncrement?: boolean) {
|
||||||
this.definition = GameAssets.Gems[gemType];
|
this.definition = GameAssets.Gems[gemType];
|
||||||
this.texture = this.definition.textures[0];
|
this.texture = this.definition.textures[0];
|
||||||
this.id = latestGemId + 1;
|
|
||||||
latestGemId++;
|
if (!doNotIncrement) {
|
||||||
|
this.id = latestGemId + 1;
|
||||||
|
latestGemId++;
|
||||||
|
} else this.id = '';
|
||||||
}
|
}
|
||||||
public currentGemImprovement() {
|
public currentGemImprovement() {
|
||||||
let totalGemImprovement: GenericGemImprovement = {
|
let totalGemImprovement: GenericGemImprovement = {
|
||||||
|
@ -50,9 +50,9 @@ export default class MissionStats extends GameObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public giveGem(gem: Gem, noNotify?) {
|
public giveGem(gem: Gem, noNotify?) {
|
||||||
if (this.inventory.length >= 48)
|
if (this.inventory.length >= 32)
|
||||||
return Engine.NotificationManager.Notify(
|
return Engine.NotificationManager.Notify(
|
||||||
"Can't hold more than 48 Gems. Extra Gem was thrown away.",
|
"Can't hold more than 32 Gems. Extra Gem was thrown away.",
|
||||||
'danger'
|
'danger'
|
||||||
);
|
);
|
||||||
this.inventory.push(gem);
|
this.inventory.push(gem);
|
||||||
|
@ -24,7 +24,7 @@ function projectileCheck(tower: Tower, elapsedMS: number) {
|
|||||||
*
|
*
|
||||||
* @param tower - The tower whose damage is being computed.
|
* @param tower - The tower whose damage is being computed.
|
||||||
*/
|
*/
|
||||||
export function computeDamage(tower: Tower) {
|
export function computeGemImprovements(tower: Tower) {
|
||||||
let gemDamage = 0;
|
let gemDamage = 0;
|
||||||
tower.slottedGems.forEach((gem) => {
|
tower.slottedGems.forEach((gem) => {
|
||||||
gemDamage += gem.currentGemImprovement().damageUp;
|
gemDamage += gem.currentGemImprovement().damageUp;
|
||||||
@ -40,7 +40,7 @@ export function computeDamage(tower: Tower) {
|
|||||||
* @param elapsedMS - The elapsed time in milliseconds since the last update.
|
* @param elapsedMS - The elapsed time in milliseconds since the last update.
|
||||||
*/
|
*/
|
||||||
export function BasicTowerBehaviour(tower: Tower, elapsedMS: number) {
|
export function BasicTowerBehaviour(tower: Tower, elapsedMS: number) {
|
||||||
computeDamage(tower);
|
if (tower.ticksUntilNextShot % 2 == 0) computeGemImprovements(tower);
|
||||||
projectileCheck(tower, elapsedMS);
|
projectileCheck(tower, elapsedMS);
|
||||||
if (tower.ticksUntilNextShot > 0) tower.ticksUntilNextShot--;
|
if (tower.ticksUntilNextShot > 0) tower.ticksUntilNextShot--;
|
||||||
let creepsInRange = tower.GetCreepsInRange();
|
let creepsInRange = tower.GetCreepsInRange();
|
||||||
|
@ -32,7 +32,7 @@ export default class GemTab extends GuiObject {
|
|||||||
this.gemTabSprite.x = 0;
|
this.gemTabSprite.x = 0;
|
||||||
this.gemTabSprite.y = 0;
|
this.gemTabSprite.y = 0;
|
||||||
this.gemTabSprite.width = this.bounds.width;
|
this.gemTabSprite.width = this.bounds.width;
|
||||||
this.gemTabSprite.height = this.bounds.height;
|
this.gemTabSprite.height = this.bounds.height - 255;
|
||||||
this.container.addChild(this.gemTabSprite);
|
this.container.addChild(this.gemTabSprite);
|
||||||
Engine.app.canvas.addEventListener('pointermove', () => {
|
Engine.app.canvas.addEventListener('pointermove', () => {
|
||||||
this.pointerMoveEvent();
|
this.pointerMoveEvent();
|
||||||
|
@ -7,7 +7,7 @@ import Button, { ButtonTexture } from './Button';
|
|||||||
import { Tower } from '../game/Tower';
|
import { Tower } from '../game/Tower';
|
||||||
import Gem from '../game/Gem';
|
import Gem from '../game/Gem';
|
||||||
import { GemEvents } from '../Events';
|
import { GemEvents } from '../Events';
|
||||||
import { computeDamage } from '../game/TowerBehaviours';
|
import { computeGemImprovements } from '../game/TowerBehaviours';
|
||||||
|
|
||||||
export class VisualGemSlot extends GuiObject {
|
export class VisualGemSlot extends GuiObject {
|
||||||
public iconSprite: PIXI.Sprite;
|
public iconSprite: PIXI.Sprite;
|
||||||
@ -220,7 +220,7 @@ export default class TowerPanel extends GuiObject {
|
|||||||
}
|
}
|
||||||
public Show(tower: Tower) {
|
public Show(tower: Tower) {
|
||||||
this.isShown = true;
|
this.isShown = true;
|
||||||
computeDamage(tower);
|
computeGemImprovements(tower);
|
||||||
this.SetContent(tower);
|
this.SetContent(tower);
|
||||||
this.MakeSlots(tower);
|
this.MakeSlots(tower);
|
||||||
this.showingTower = tower;
|
this.showingTower = tower;
|
||||||
|
@ -213,7 +213,7 @@ export class GameScene extends Scene {
|
|||||||
// offerText.x -= offerText.width;
|
// offerText.x -= offerText.width;
|
||||||
Engine.GameMaster.currentScene.stage.addChildAt(offerText, 0);
|
Engine.GameMaster.currentScene.stage.addChildAt(offerText, 0);
|
||||||
gemsToOffer.forEach((gType, index) => {
|
gemsToOffer.forEach((gType, index) => {
|
||||||
let _Gem = new Gem(gType);
|
let _Gem = new Gem(gType, true);
|
||||||
let vGem = new VisualGemSlot(0, Engine.app.stage, _Gem);
|
let vGem = new VisualGemSlot(0, Engine.app.stage, _Gem);
|
||||||
this.visualGems.push(vGem);
|
this.visualGems.push(vGem);
|
||||||
vGem.container.x = this.offerGemsSprite.x - 15 + 69 * (index + 1);
|
vGem.container.x = this.offerGemsSprite.x - 15 + 69 * (index + 1);
|
||||||
@ -228,7 +228,7 @@ export class GameScene extends Scene {
|
|||||||
vGem.onClick = () => {
|
vGem.onClick = () => {
|
||||||
Engine.GameScene.tooltip.Hide();
|
Engine.GameScene.tooltip.Hide();
|
||||||
offerText.destroy();
|
offerText.destroy();
|
||||||
this.PlayerPickedGem(_Gem);
|
this.PlayerPickedGem(new Gem(gType));
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|