feat: bull & tiger bleed dot
This commit is contained in:
parent
a762810fdd
commit
a226cb977b
|
@ -1,6 +1,7 @@
|
||||||
import Vec2 from "../../Wolfie2D/DataTypes/Vec2";
|
import Vec2 from "../../Wolfie2D/DataTypes/Vec2";
|
||||||
import AnimatedSprite from "../../Wolfie2D/Nodes/Sprites/AnimatedSprite";
|
import AnimatedSprite from "../../Wolfie2D/Nodes/Sprites/AnimatedSprite";
|
||||||
import Timer from "../../Wolfie2D/Timing/Timer";
|
import Timer from "../../Wolfie2D/Timing/Timer";
|
||||||
|
import PlayerController from "../Player/PlayerController";
|
||||||
import EnemyAI, { EnemyStates } from "./EnemyAI";
|
import EnemyAI, { EnemyStates } from "./EnemyAI";
|
||||||
import BullAttack from "./EnemyStates/BullAttack";
|
import BullAttack from "./EnemyStates/BullAttack";
|
||||||
|
|
||||||
|
@ -11,11 +12,10 @@ export default class BullAI extends EnemyAI {
|
||||||
this.attackTimer = new Timer(4000);
|
this.attackTimer = new Timer(4000);
|
||||||
}
|
}
|
||||||
|
|
||||||
canAttack(position: Vec2): boolean {
|
collideWithPlayer(player: PlayerController): void {
|
||||||
return this.attackTimer.isStopped();
|
player.damage(10);
|
||||||
}
|
if (this.isAttaking && !player.invincible && !player.godMode) {
|
||||||
|
player.bleedCounter += 3;
|
||||||
getPlayerPosition(): Vec2 {
|
}
|
||||||
return this.player.position;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
import Vec2 from "../../Wolfie2D/DataTypes/Vec2";
|
import Vec2 from "../../Wolfie2D/DataTypes/Vec2";
|
||||||
import AnimatedSprite from "../../Wolfie2D/Nodes/Sprites/AnimatedSprite";
|
import AnimatedSprite from "../../Wolfie2D/Nodes/Sprites/AnimatedSprite";
|
||||||
|
import PlayerController from "../Player/PlayerController";
|
||||||
import EnemyAI, { EnemyStates } from "./EnemyAI";
|
import EnemyAI, { EnemyStates } from "./EnemyAI";
|
||||||
import TigerAttack from "./EnemyStates/TigerAttack";
|
import TigerAttack from "./EnemyStates/TigerAttack";
|
||||||
|
|
||||||
|
@ -9,11 +10,17 @@ export default class TigerAI extends EnemyAI {
|
||||||
this.addState(EnemyStates.ATTACK, new TigerAttack(this, owner));
|
this.addState(EnemyStates.ATTACK, new TigerAttack(this, owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
canAttack(position: Vec2): boolean {
|
getPlayerPosition(): Vec2 {
|
||||||
return this.attackTimer.isStopped();
|
if (this.owner.position.distanceTo(this.player.position) <= 800) {
|
||||||
|
return this.player.position;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlayerPosition(): Vec2 {
|
collideWithPlayer(player: PlayerController): void {
|
||||||
return this.player.position;
|
player.damage(10);
|
||||||
|
if (this.isAttaking && !player.invincible && !player.godMode) {
|
||||||
|
player.bleedCounter += 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user