public void BossDoorBehavior(Creature _, Prop prop)
{
// Get door
var door = prop as Door;
if (door == null)
{
Log.Error("Dungeon.BossDoorBehavior: Boss door... is not a door!?");
return;
}
// Make sure it got unlocked
if (door.IsLocked)
return;
// Check if bosses were already spawned
if (_bossSpawned)
return;
_bossSpawned = true;
// Remove all monsters
this.Regions.ForEach(a => a.RemoveAllMonsters());
// Call OnBoss
if (this.Script != null)
this.Script.OnBoss(this);
// Open boss and exit door if no bosses were spawned
if (_bossesRemaining == 0)
{
_bossDoor.SetState("open");
_bossExitDoor.SetState("open");
}
}