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,9 +6,13 @@ namespace ONDServer.Enemies;
|
|||
|
||||
public abstract class Enemy : GlobalEnemy<MapTile, TileConnector> {
|
||||
public int Difficulty { get; protected set; }
|
||||
|
||||
protected MovementOpportunity movementOpportunity;
|
||||
|
||||
protected Enemy(int difficulty) {
|
||||
Difficulty = difficulty;
|
||||
|
||||
protected Enemy(int difficulty, int movementInterval) {
|
||||
movementOpportunity = new(movementInterval);
|
||||
SetDifficulty(difficulty);
|
||||
}
|
||||
|
||||
public abstract bool BlocksTile { get; set; }
|
||||
|
|
@ -30,6 +34,9 @@ public abstract class Enemy : GlobalEnemy<MapTile, TileConnector> {
|
|||
Server.SendUpdateToAll([GameEvent.ENEMY_ATTACK(Id, player.state.pid)]);
|
||||
GameLogic.DeclareWinner(Server.OtherPlayer(player));
|
||||
}
|
||||
|
||||
public abstract void SetDifficulty(int difficulty);
|
||||
|
||||
public virtual void SetDifficulty(int difficulty) {
|
||||
Difficulty = difficulty;
|
||||
movementOpportunity.MovementChance = ((5 + Math.Pow(1.5f, Difficulty)) * Math.Sign(Difficulty)) / (5 + Math.Pow(1.5f, 10));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue