Bugfixy, odstranění nepoužívaných tříd CameraSystem a ITargetingEnemy, přidání dedikované třídy ReturnToMenuElement, předělání pathfinding algoritmu z DFS na BFS, přesun správy obtížnosti do abstraktní třídy Enemy, přidání scriptů pro kompilaci na aplikaci nevyžadující dotnet
This commit is contained in:
parent
ceac37920b
commit
e5d746d597
24 changed files with 258 additions and 138 deletions
|
|
@ -6,7 +6,7 @@ using PacketLib;
|
|||
namespace ONDServer.Enemies;
|
||||
|
||||
public class DashEnemy : Enemy {
|
||||
public DashEnemy(int difficulty) : base(difficulty) {
|
||||
public DashEnemy(int difficulty) : base(difficulty, 5000) {
|
||||
movementOpportunity = new(5000);
|
||||
SetDifficulty(difficulty);
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ public class DashEnemy : Enemy {
|
|||
public override int TypeId{ get; } = (int)EnemyType.DASH;
|
||||
public override bool BlocksTile{ get; set; } = false;
|
||||
|
||||
private MovementOpportunity movementOpportunity;
|
||||
// private MovementOpportunity movementOpportunity;
|
||||
|
||||
private readonly (MapTile tile, Direction p1AttackDir, Direction p2AttackDir)[] positions =[
|
||||
(MapManager.Get(7), Direction.EAST, Direction.WEST),
|
||||
|
|
@ -34,10 +34,10 @@ public class DashEnemy : Enemy {
|
|||
Server.SendUpdateToAll([GameEvent.ENEMY_RESET(Id, Location.Id)]);
|
||||
}
|
||||
|
||||
public override void SetDifficulty(int difficulty) {
|
||||
Difficulty = difficulty;
|
||||
movementOpportunity.MovementChance = (2 * Math.Sign(difficulty) + difficulty) / 12.0;
|
||||
}
|
||||
// public override void SetDifficulty(int difficulty) {
|
||||
// Difficulty = difficulty;
|
||||
// movementOpportunity.MovementChance = (2 * Math.Sign(difficulty) + difficulty) / 12.0;
|
||||
// }
|
||||
|
||||
public override void Spawn(MapTile location) {
|
||||
currentPosIndex = positions.ToList().FindIndex(p => p.tile == location);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue