2026-03-08 16:55:49 +01:00
|
|
|
using FNAF_Server.Map;
|
|
|
|
|
using GlobalClassLib;
|
2026-03-09 20:05:21 +01:00
|
|
|
using PacketLib;
|
2026-03-08 16:55:49 +01:00
|
|
|
|
|
|
|
|
namespace FNAF_Server.Enemies;
|
|
|
|
|
|
|
|
|
|
public abstract class Enemy : GlobalEnemy<MapTile, TileConnector> {
|
2026-03-17 20:14:29 +01:00
|
|
|
public int Difficulty { get; protected set; }
|
|
|
|
|
|
|
|
|
|
protected Enemy(int difficulty) {
|
|
|
|
|
Difficulty = difficulty;
|
2026-03-08 16:55:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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();
|
2026-03-09 20:05:21 +01:00
|
|
|
|
|
|
|
|
public virtual void Attack(ServerPlayer player) {
|
|
|
|
|
Server.SendUpdateToAll([GameEvent.ENEMY_ATTACK(Id, player.state.pid)]);
|
|
|
|
|
GameLogic.DeclareWinner(Server.OtherPlayer(player));
|
|
|
|
|
}
|
2026-03-17 20:14:29 +01:00
|
|
|
|
|
|
|
|
public abstract void SetDifficulty(int difficulty);
|
2026-03-08 16:55:49 +01:00
|
|
|
}
|