diff --git a/dist/shattered_sword_assets/images/controls.png b/dist/shattered_sword_assets/images/controls.png new file mode 100644 index 0000000..3a1c0c3 Binary files /dev/null and b/dist/shattered_sword_assets/images/controls.png differ diff --git a/dist/shattered_sword_assets/images/guide1.png b/dist/shattered_sword_assets/images/guide1.png new file mode 100644 index 0000000..76340f7 Binary files /dev/null and b/dist/shattered_sword_assets/images/guide1.png differ diff --git a/dist/shattered_sword_assets/images/guide2.png b/dist/shattered_sword_assets/images/guide2.png new file mode 100644 index 0000000..364b5fb Binary files /dev/null and b/dist/shattered_sword_assets/images/guide2.png differ diff --git a/dist/shattered_sword_assets/images/guide3.png b/dist/shattered_sword_assets/images/guide3.png new file mode 100644 index 0000000..c4d633a Binary files /dev/null and b/dist/shattered_sword_assets/images/guide3.png differ diff --git a/dist/shattered_sword_assets/images/guide4.png b/dist/shattered_sword_assets/images/guide4.png new file mode 100644 index 0000000..3cf8c87 Binary files /dev/null and b/dist/shattered_sword_assets/images/guide4.png differ diff --git a/dist/shattered_sword_assets/jsons/level1story.json b/dist/shattered_sword_assets/jsons/level1story.json new file mode 100644 index 0000000..6083912 --- /dev/null +++ b/dist/shattered_sword_assets/jsons/level1story.json @@ -0,0 +1,102 @@ +{ + "texts": [ + { + "speaker": "", + "content": "Press A/LEFT to go LEFT and D/RIGHT to go right", + "actions": [ + { + "type": "loadSprite", + "key": "rightleft", + "path": "shattered_sword_assets/images/guide1.png", + "positon": [ + 300, + 150 + ], + "scale": [ + 2, + 2 + ] + } + ] + }, + { + "speaker": "", + "content": "Press Z or space to jump, double-click to double-jump", + "actions": [ + { + "type": "hideSprite", + "key": "rightleft" + }, + { + "type": "loadSprite", + "key": "jump", + "path": "shattered_sword_assets/images/guide2.png", + "positon": [ + 300, + 150 + ], + "scale": [ + 2, + 2 + ] + } + ] + }, + { + "speaker": "", + "content": "Press X to attack", + "actions": [ + { + "type": "hideSprite", + "key": "rightleft" + }, + { + "type": "loadSprite", + "key": "attack", + "path": "shattered_sword_assets/images/guide3.png", + "positon": [ + 300, + 150 + ], + "scale": [ + 2, + 2 + ] + } + ] + }, + { + "speaker": "", + "content": "Press C to dash", + "actions": [ + { + "type": "hideSprite", + "key": "attack" + }, + { + "type": "loadSprite", + "key": "dash", + "path": "shattered_sword_assets/images/guide4.png", + "positon": [ + 300, + 150 + ], + "scale": [ + 2, + 2 + ] + } + ] + }, + { + "speaker": "", + "content": "", + "actions": [ + { + "type": "hideSprite", + "key": "dash" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/shattered_sword/AI/EnemyAI.ts b/src/shattered_sword/AI/EnemyAI.ts index 65aee5e..4050bfb 100644 --- a/src/shattered_sword/AI/EnemyAI.ts +++ b/src/shattered_sword/AI/EnemyAI.ts @@ -216,17 +216,18 @@ export default class EnemyAI extends StateMachineAI implements BattlerAI { if(this.burnTimer.isStopped() && this.burnCounter >0){ this.burnCounter --; this.burnTimer.start(); - this.damage(5 + (this.player._ai).extraDotDmg + (this.player._ai).CURRENT_ATK * .2); + this.damage(12 + (this.player._ai).extraDotDmg ); } if(this.poisonTimer.isStopped() && this.poisonCounter >0){ this.poisonCounter --; this.poisonTimer.start(); - this.damage(5 + (this.player._ai).extraDotDmg + (this.player._ai).CURRENT_ATK * .2); + this.damage( Math.round(this.CURRENT_HP/20) + (this.player._ai).extraDotDmg ); } + if(this.bleedTimer.isStopped() && this.bleedCounter >0){ this.bleedCounter --; this.bleedTimer.start(); - this.damage(5 + (this.player._ai).extraDotDmg + (this.player._ai).CURRENT_ATK * .08); + this.damage(3 +Math.round(this.CURRENT_HP/33) + (this.player._ai).extraDotDmg ); } if (this.healthBar) { diff --git a/src/shattered_sword/Player/PlayerController.ts b/src/shattered_sword/Player/PlayerController.ts index 6b375bb..246f3a8 100644 --- a/src/shattered_sword/Player/PlayerController.ts +++ b/src/shattered_sword/Player/PlayerController.ts @@ -133,17 +133,16 @@ export default class PlayerController extends StateMachineAI implements BattlerA cooldownMultiplier : number = 1; fullHpBonus: Boolean = false; - //TODO - add new buffs here - /* - CURRENT_BUFFS: { - atk: number; //flat value to add to weapon - hp: number; //flat value - def: number; //flat value - speed: number; //flat value - range:number; //range will be a multiplier value: 1.5 = 150% range - } - */ - + poisonTimer : Timer; + poisonCounter : number = 0; + + burnTimer : Timer ; + burnCounter : number =0; + + bleedTimer : Timer; + bleedCounter :number = 0; + + enemiesKilled : number =0; //TODO - get the correct tilemap @@ -157,9 +156,6 @@ export default class PlayerController extends StateMachineAI implements BattlerA this.inventory = options.inventory; this.lookDirection = new Vec2(); - - //this.CURRENT_BUFFS = {hp:0, atk:0, def:0, speed:0, range:0}; - //i frame timer PlayerController.invincibilityTimer = new Timer(2000); @@ -174,6 +170,11 @@ export default class PlayerController extends StateMachineAI implements BattlerA PlayerController.buffPool.push(BuffCategory.HEALTH); } + //initialize dot timers + this.burnTimer = new Timer(1000); + this.bleedTimer = new Timer(1000); + this.poisonTimer = new Timer(1000); + //to test the buffs //this.addBuff( {type:BuffType.HEALTH, value:1} ); //this.addBuff({type:BuffType.BURN, value:1, category:BuffCategory.DOT}); @@ -237,6 +238,23 @@ export default class PlayerController extends StateMachineAI implements BattlerA item.use(this.owner, "player", this.lookDirection); } } + + //check dot effects + if(this.burnTimer.isStopped() && this.burnCounter >0){ + this.burnCounter --; + this.burnTimer.start(); + this.damage(5); + } + if(this.poisonTimer.isStopped() && this.poisonCounter >0){ + this.poisonCounter --; + this.poisonTimer.start(); + this.damage( Math.round(this.CURRENT_HP/33) ); + } + if(this.bleedTimer.isStopped() && this.bleedCounter >0){ + this.bleedCounter --; + this.bleedTimer.start(); + this.damage( 2 + Math.round(this.CURRENT_HP/50) ); + } } @@ -345,7 +363,7 @@ export default class PlayerController extends StateMachineAI implements BattlerA buffs.push({type:BuffType.FLAT_ATK, value:num, category: BuffCategory.EXTRA}, {type:BuffType.SPEED, value:num, category: BuffCategory.EXTRA}, {type:BuffType.FLAT_HEALTH, value:num, category: BuffCategory.SHIELD}, - {type:BuffType.RANGE, value:num/10, category: BuffCategory.ATTACK}, + {type:BuffType.RANGE, value:num/100, category: BuffCategory.ATTACK, string: "\n\nIncrease range \nby "+num+"%"}, {type:BuffType.ATKSPEED, value:num, category: BuffCategory.ATTACK}, ); @@ -539,7 +557,7 @@ export default class PlayerController extends StateMachineAI implements BattlerA this.damage_multiplier *= (1-buff.value); break; case BuffType.RANGE: - //this.CURRENT_BUFFS.range += buff.value; + if (item) { (item).EXTRA_RANGE += buff.value; } diff --git a/src/shattered_sword/Scenes/GameLevel.ts b/src/shattered_sword/Scenes/GameLevel.ts index d02c904..77f49e2 100644 --- a/src/shattered_sword/Scenes/GameLevel.ts +++ b/src/shattered_sword/Scenes/GameLevel.ts @@ -289,8 +289,7 @@ export default class GameLevel extends Scene { (this.player._ai).giveExp(event.data.get("ai").exp_val); } node.destroy(); //destroy enemy node - //TODO - this is for testing, add some chance here later - //this.emitter.fireEvent(Player_Events.GIVE_BUFF); + (this.player._ai).enemiesKilled++ ; break; case Player_Events.GIVE_REGULAR_BUFF: @@ -957,7 +956,7 @@ export default class GameLevel extends Scene { protected playStartStory() { if (!this.touchedStartCheckPoint) { this.touchedStartCheckPoint = true; - this.storyLoader("shattered_sword_assets/jsons/story.json"); + this.storyLoader("shattered_sword_assets/jsons/level1story.json"); this.startTimer(); } }