moved snaksspawn to tutorial only

This commit is contained in:
OfficialCHenry 2022-04-21 13:46:09 -04:00
parent e90c67e2fd
commit d79d00370b
5 changed files with 34 additions and 25 deletions

View File

@ -19,7 +19,7 @@ export default class BattleManager {
if(this.enemies.length != 0){ if(this.enemies.length != 0){
for (let enemy of this.enemies) { for (let enemy of this.enemies) {
if (weapon.hits(enemy.owner)) { if (weapon.hits(enemy.owner)) {
enemy.damage(weapon.type.damage * (<PlayerController>this.players[0]).CURRENT_ATK/100); enemy.damage(Math.round(weapon.type.damage * (<PlayerController>this.players[0]).CURRENT_ATK/100));
//console.log("enemy took dmg"); //console.log("enemy took dmg");
//TODO - test shield, //TODO - test shield,
@ -39,10 +39,10 @@ export default class BattleManager {
} }
if(player.hasDoubleStrike){ if(player.hasDoubleStrike){
enemy.damage(weapon.type.damage * (<PlayerController>this.players[0]).CURRENT_ATK/200); enemy.damage(Math.round(weapon.type.damage * (<PlayerController>this.players[0]).CURRENT_ATK/200));
} }
if(player.hasLifesteal){ if(player.hasLifesteal){
player.addHealth(weapon.type.damage * player.CURRENT_ATK/100 * player.lifestealratio); player.addHealth(Math.round(weapon.type.damage * player.CURRENT_ATK/100 * player.lifestealratio));
} }
} }
} }

View File

@ -21,7 +21,7 @@ export default class Slice extends WeaponType {
// TODO - need to rotate the anim properly // TODO - need to rotate the anim properly
//sliceSprite.rotation = attacker.rotation; //sliceSprite.rotation = attacker.rotation;
//sliceSprite.rotation = (<Sprite>attacker).invertX? .5* Math.PI : 1.5 * Math.PI; //sliceSprite.rotation = (<Sprite>attacker).invertX? .5* Math.PI : 1.5 * Math.PI;
//sliceSprite.invertX = (<Sprite>attacker).invertX; sliceSprite.invertX = (<Sprite>attacker).invertX;
//TODO- //TODO-
//4 to scale up the default sprite - may be different later depending on atk anim //4 to scale up the default sprite - may be different later depending on atk anim

View File

@ -174,6 +174,8 @@ export default class PlayerController extends StateMachineAI implements BattlerA
//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});
this.addBuff({type:BuffType.BLEED, value:1, category:BuffCategory.DOT});
this.addBuff({type:BuffType.POISON, value:1, category:BuffCategory.DOT});
} }
@ -331,7 +333,7 @@ export default class PlayerController extends StateMachineAI implements BattlerA
//TODO - implement better buff genertion - some buffs dont want multiple of //TODO - implement better buff genertion - some buffs dont want multiple of
let attackBuffs : Buff[] = [ let attackBuffs : Buff[] = [
{type:BuffType.RANGE, value:num, category: BuffCategory.ATTACK}, {type:BuffType.RANGE, value:num/10, category: BuffCategory.ATTACK},
{type:BuffType.ATKSPEED, value:num, category: BuffCategory.ATTACK}, {type:BuffType.ATKSPEED, value:num, category: BuffCategory.ATTACK},
]; ];
if(!this.hasDoubleStrike){ if(!this.hasDoubleStrike){

View File

@ -415,23 +415,6 @@ export default class GameLevel extends Scene {
//spawn snake()
if(Math.random() < .002){
console.log("RANDOM SNAKE!");
this.addEnemy("Snake", this.player.position.clone().add(new Vec2(0,-320)),{
player: this.player,
health: 50,
tilemap: "Main",
goal: Statuses.REACHED_GOAL,
size: new Vec2(16,16),
offset : new Vec2(0, 16),
exp: 50,
actions: [new AttackAction(3, [Statuses.IN_RANGE], [Statuses.REACHED_GOAL]),
new Move(2, [], [Statuses.IN_RANGE], {inRange: 60})],
status : [Statuses.CAN_RETREAT, Statuses.CAN_BERSERK],
weapon : this.createWeapon("knife")
})
}
} }
// TODO put UI changes in here // TODO put UI changes in here
@ -793,13 +776,13 @@ export default class GameLevel extends Scene {
(<EnemyAI>enemy._ai).healthBar.color = Color.GREEN; (<EnemyAI>enemy._ai).healthBar.color = Color.GREEN;
(<EnemyAI>enemy._ai).poisonStat = this.add.sprite("poisoning", "primary"); (<EnemyAI>enemy._ai).poisonStat = this.add.sprite("poisoning", "primary");
(<EnemyAI>enemy._ai).poisonStat.position = enemy.collisionShape.center.clone().add(new Vec2((((<AABB>enemy.collisionShape).hw)*-1, -((<AABB>enemy.collisionShape).hh+5)))); (<EnemyAI>enemy._ai).poisonStat.position = enemy.collisionShape.center.clone().add(new Vec2((((<AABB>enemy.collisionShape).hw)*-1, -((<AABB>enemy.collisionShape).hh+5))));
(<EnemyAI>enemy._ai).poisonStat.scale.set(0.2, 0.2); (<EnemyAI>enemy._ai).poisonStat.scale.set(0.5, 0.5);
(<EnemyAI>enemy._ai).burnStat = this.add.sprite("burning", "primary"); (<EnemyAI>enemy._ai).burnStat = this.add.sprite("burning", "primary");
(<EnemyAI>enemy._ai).burnStat.position = (<EnemyAI>enemy._ai).poisonStat.position.clone().add(new Vec2(15, 0)); (<EnemyAI>enemy._ai).burnStat.position = (<EnemyAI>enemy._ai).poisonStat.position.clone().add(new Vec2(15, 0));
(<EnemyAI>enemy._ai).burnStat.scale.set(0.2, 0.2); (<EnemyAI>enemy._ai).burnStat.scale.set(0.5, 0.5);
(<EnemyAI>enemy._ai).bleedStat = this.add.sprite("bleeding", "primary"); (<EnemyAI>enemy._ai).bleedStat = this.add.sprite("bleeding", "primary");
(<EnemyAI>enemy._ai).bleedStat.position = (<EnemyAI>enemy._ai).poisonStat.position.clone().add(new Vec2(30, 0)); (<EnemyAI>enemy._ai).bleedStat.position = (<EnemyAI>enemy._ai).poisonStat.position.clone().add(new Vec2(30, 0));
(<EnemyAI>enemy._ai).bleedStat.scale.set(0.2, 0.2); (<EnemyAI>enemy._ai).bleedStat.scale.set(0.5, 0.5);
enemy.setGroup("Enemy"); enemy.setGroup("Enemy");
enemy.setTrigger("player", Player_Events.PLAYER_COLLIDE, null); enemy.setTrigger("player", Player_Events.PLAYER_COLLIDE, null);
let actionsDefault = [new AttackAction(3, [Statuses.IN_RANGE], [Statuses.REACHED_GOAL]), let actionsDefault = [new AttackAction(3, [Statuses.IN_RANGE], [Statuses.REACHED_GOAL]),

View File

@ -11,6 +11,8 @@ import { Statuses } from "../sword_enums";
import AABB from "../../Wolfie2D/DataTypes/Shapes/AABB"; import AABB from "../../Wolfie2D/DataTypes/Shapes/AABB";
import EnemyAI from "../AI/EnemyAI"; import EnemyAI from "../AI/EnemyAI";
import BattlerAI from "../AI/BattlerAI"; import BattlerAI from "../AI/BattlerAI";
import AttackAction from "../AI/EnemyActions/AttackAction";
import Move from "../AI/EnemyActions/Move";
export default class Tutorial extends GameLevel { export default class Tutorial extends GameLevel {
loadScene(): void { loadScene(): void {
@ -30,4 +32,26 @@ export default class Tutorial extends GameLevel {
//load music here //load music here
} }
updateScene(deltaT: number): void {
super.updateScene(deltaT);
//spawn snake()
if(Math.random() < .002){
console.log("RANDOM SNAKE!");
this.addEnemy("Snake", this.player.position.clone().add(new Vec2(0,-320)),{
player: this.player,
health: 50,
tilemap: "Main",
goal: Statuses.REACHED_GOAL,
size: new Vec2(16,16),
offset : new Vec2(0, 16),
exp: 50,
actions: [new AttackAction(3, [Statuses.IN_RANGE], [Statuses.REACHED_GOAL]),
new Move(2, [], [Statuses.IN_RANGE], {inRange: 60})],
status : [Statuses.CAN_RETREAT, Statuses.CAN_BERSERK],
weapon : this.createWeapon("knife")
})
}
}
} }