Merge remote-tracking branch 'github/master'

This commit is contained in:
Renge 2022-04-25 21:44:19 -04:00
commit b2505ffd48
9 changed files with 142 additions and 22 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -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"
}
]
}
]
}

View File

@ -216,17 +216,18 @@ export default class EnemyAI extends StateMachineAI implements BattlerAI {
if(this.burnTimer.isStopped() && this.burnCounter >0){ if(this.burnTimer.isStopped() && this.burnCounter >0){
this.burnCounter --; this.burnCounter --;
this.burnTimer.start(); this.burnTimer.start();
this.damage(5 + (<PlayerController>this.player._ai).extraDotDmg + (<PlayerController>this.player._ai).CURRENT_ATK * .2); this.damage(12 + (<PlayerController>this.player._ai).extraDotDmg );
} }
if(this.poisonTimer.isStopped() && this.poisonCounter >0){ if(this.poisonTimer.isStopped() && this.poisonCounter >0){
this.poisonCounter --; this.poisonCounter --;
this.poisonTimer.start(); this.poisonTimer.start();
this.damage(5 + (<PlayerController>this.player._ai).extraDotDmg + (<PlayerController>this.player._ai).CURRENT_ATK * .2); this.damage( Math.round(this.CURRENT_HP/20) + (<PlayerController>this.player._ai).extraDotDmg );
} }
if(this.bleedTimer.isStopped() && this.bleedCounter >0){ if(this.bleedTimer.isStopped() && this.bleedCounter >0){
this.bleedCounter --; this.bleedCounter --;
this.bleedTimer.start(); this.bleedTimer.start();
this.damage(5 + (<PlayerController>this.player._ai).extraDotDmg + (<PlayerController>this.player._ai).CURRENT_ATK * .08); this.damage(3 +Math.round(this.CURRENT_HP/33) + (<PlayerController>this.player._ai).extraDotDmg );
} }
if (this.healthBar) { if (this.healthBar) {

View File

@ -133,17 +133,16 @@ export default class PlayerController extends StateMachineAI implements BattlerA
cooldownMultiplier : number = 1; cooldownMultiplier : number = 1;
fullHpBonus: Boolean = false; fullHpBonus: Boolean = false;
//TODO - add new buffs here poisonTimer : Timer;
/* poisonCounter : number = 0;
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
}
*/
burnTimer : Timer ;
burnCounter : number =0;
bleedTimer : Timer;
bleedCounter :number = 0;
enemiesKilled : number =0;
//TODO - get the correct tilemap //TODO - get the correct tilemap
@ -158,9 +157,6 @@ export default class PlayerController extends StateMachineAI implements BattlerA
this.lookDirection = new Vec2(); this.lookDirection = new Vec2();
//this.CURRENT_BUFFS = {hp:0, atk:0, def:0, speed:0, range:0};
//i frame timer //i frame timer
PlayerController.invincibilityTimer = new Timer(2000); PlayerController.invincibilityTimer = new Timer(2000);
@ -174,6 +170,11 @@ export default class PlayerController extends StateMachineAI implements BattlerA
PlayerController.buffPool.push(BuffCategory.HEALTH); 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 //to test the buffs
//this.addBuff( {type:BuffType.HEALTH, value:1} ); //this.addBuff( {type:BuffType.HEALTH, value:1} );
//this.addBuff({type:BuffType.BURN, value:1, category:BuffCategory.DOT}); //this.addBuff({type:BuffType.BURN, value:1, category:BuffCategory.DOT});
@ -238,6 +239,23 @@ export default class PlayerController extends StateMachineAI implements BattlerA
} }
} }
//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}, buffs.push({type:BuffType.FLAT_ATK, value:num, category: BuffCategory.EXTRA},
{type:BuffType.SPEED, value:num, category: BuffCategory.EXTRA}, {type:BuffType.SPEED, value:num, category: BuffCategory.EXTRA},
{type:BuffType.FLAT_HEALTH, value:num, category: BuffCategory.SHIELD}, {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}, {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); this.damage_multiplier *= (1-buff.value);
break; break;
case BuffType.RANGE: case BuffType.RANGE:
//this.CURRENT_BUFFS.range += buff.value;
if (item) { if (item) {
(<Weapon>item).EXTRA_RANGE += buff.value; (<Weapon>item).EXTRA_RANGE += buff.value;
} }

View File

@ -289,8 +289,7 @@ export default class GameLevel extends Scene {
(<PlayerController>this.player._ai).giveExp(event.data.get("ai").exp_val); (<PlayerController>this.player._ai).giveExp(event.data.get("ai").exp_val);
} }
node.destroy(); //destroy enemy node node.destroy(); //destroy enemy node
//TODO - this is for testing, add some chance here later (<PlayerController>this.player._ai).enemiesKilled++ ;
//this.emitter.fireEvent(Player_Events.GIVE_BUFF);
break; break;
case Player_Events.GIVE_REGULAR_BUFF: case Player_Events.GIVE_REGULAR_BUFF:
@ -957,7 +956,7 @@ export default class GameLevel extends Scene {
protected playStartStory() { protected playStartStory() {
if (!this.touchedStartCheckPoint) { if (!this.touchedStartCheckPoint) {
this.touchedStartCheckPoint = true; this.touchedStartCheckPoint = true;
this.storyLoader("shattered_sword_assets/jsons/story.json"); this.storyLoader("shattered_sword_assets/jsons/level1story.json");
this.startTimer(); this.startTimer();
} }
} }