Bloodlock encounter gates

A Bloodlock encounter locks a doorway when the player enters its trigger. It tracks the assigned enemies and unlocks the doorway when none of them is still active.

Gameplay video

Locking the encounter

public void ActivateBloodlock()
{
    if (bl_alreadyTriggered) return;
    bl_alreadyTriggered = true;

    doorToLock.LockDoor();
    foreach (GameObject enemy in enemiesToTrack)
    {
        if (enemy.TryGetComponent(out FN_NPC_Health health))
        {
            health.onDeath.AddListener(CheckBloodlockClear);
        }
    }
}
Locks the door once and subscribes to the assigned enemies’ death events.

Checking the tracked enemies

private void CheckBloodlockClear()
{
    foreach (GameObject enemy in enemiesToTrack)
    {
        if (enemy != null && enemy.activeInHierarchy)
            return;
    }
    doorToLock.UnlockDoor();
}
Unlocks the door when none of the tracked enemies are active.
← Return to Arc of the Isles