35 lines
No EOL
1,003 B
C#
35 lines
No EOL
1,003 B
C#
using FNAF_Server.Map;
|
|
using GlobalClassLib;
|
|
using PacketLib;
|
|
|
|
namespace FNAF_Server.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);
|
|
} |