Projekt přejmenován. Neko nastaven na výchozí pozici
This commit is contained in:
parent
1a27dd6fab
commit
ceac37920b
104 changed files with 873 additions and 208 deletions
35
ONDServer/Enemies/Enemy.cs
Normal file
35
ONDServer/Enemies/Enemy.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using GlobalClassLib;
|
||||
using ONDServer.Map;
|
||||
using PacketLib;
|
||||
|
||||
namespace ONDServer.Enemies;
|
||||
|
||||
public abstract class Enemy : GlobalEnemy<MapTile, TileConnector> {
|
||||
public int Difficulty { get; protected set; }
|
||||
|
||||
protected Enemy(int difficulty) {
|
||||
Difficulty = difficulty;
|
||||
}
|
||||
|
||||
public abstract bool BlocksTile { get; set; }
|
||||
public bool Spawned { get; set; }
|
||||
|
||||
public virtual void SpawnSilent(MapTile location) {
|
||||
Console.WriteLine($"!!! Silent spawn not implemented for enemy {TypeId} ({Name}), reverting to regular spawn");
|
||||
Spawn(location);
|
||||
}
|
||||
|
||||
public override void Spawn(MapTile location) {
|
||||
base.Spawn(location);
|
||||
Spawned = true;
|
||||
}
|
||||
|
||||
public abstract void Reset();
|
||||
|
||||
public virtual void Attack(ServerPlayer player) {
|
||||
Server.SendUpdateToAll([GameEvent.ENEMY_ATTACK(Id, player.state.pid)]);
|
||||
GameLogic.DeclareWinner(Server.OtherPlayer(player));
|
||||
}
|
||||
|
||||
public abstract void SetDifficulty(int difficulty);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue