public void UnsealDoor(DungeonRoomInfo.WallDirection dir) { if (!IsDoorSealed(dir)) { return; } SetWallTypeForDirection(dir, DungeonRoomInfo.WallType.DoorOpen); PlayUnlockSound(); }
public void SetWallTypeForDirection(DungeonRoomInfo.WallDirection direction, DungeonRoomInfo.WallType type) { Info.SetWallTypeForDirection(direction, type); // Now we update the wall's Material GameObject wall = GetWallForDirection(direction); wall.GetComponent <Renderer>().material = CommonObjects.CurrentDungeonFactory.GetWallMaterial(direction, type); wall.GetComponent <LightsOnOffMaterial>().OnMaterialChanged(); }
void AssignToWall(DungeonRoomInfo.WallDirection newWallDir) { wallDir = newWallDir; if (WorldInfo.Instance.IsInDungeon) { DungeonRoom dr = _enemy.DungeonRoomRef; wall = dr.GetWallForDirection(wallDir); } _wallNormal = DungeonRoomInfo.NormalForWallDirection(wallDir); _wallTangent = DungeonRoomInfo.TangentForWallDirection(wallDir); if (Extensions.FlipCoin()) { _wallTangent *= -1; } }
public void OnPlayerEnteredRoom(DungeonRoomInfo.WallDirection direction = DungeonRoomInfo.WallDirection.None) { PlayerHasVisited = true; if (!EnemiesHaveSpawned) { SpawnEnemies(); if (ContainsBoss && ALWAYS_SEAL_DOORS_FOR_BOSS) { SealDoors(); } if (ContainsGannon) { PlaySequence_GannonIntro(); } } if (NeedTriforceToPass && Inventory.Instance.HasAllTriforcePieces()) { UnsealDoors(); } if (direction != DungeonRoomInfo.WallDirection.None) { if (GetWallTypeForDirection(direction) == DungeonRoomInfo.WallType.DoorSealed) { PlaySealDoorSound(); } } if (WillShowNpcText) { ShowNpcText(); } if (ContainsSubDungeonSpawnPoint) { if (!Info.pushBlockSpawnsSubDungeon || _hasPushBlockBeenPushed) { SpawnSubDungeon(); } } }
public void UnlockDoor(DungeonRoomInfo.WallDirection dir) { if (!IsDoorLocked(dir)) { //Debug.LogError("Trying to Unlock door that is not Locked."); return; } SetWallTypeForDirection(dir, DungeonRoomInfo.WallType.DoorOpen); DungeonRoom adjoiningRoom = GetAdjoiningRoom(dir); if (adjoiningRoom != null) { adjoiningRoom.UnlockDoor(DungeonRoomInfo.GetOppositeDirection(dir)); } PlayUnlockSound(); }
public GameObject GetWallForDirection(DungeonRoomInfo.WallDirection direction) { GameObject wall = null; switch (direction) { case DungeonRoomInfo.WallDirection.North: wall = wall_N; break; case DungeonRoomInfo.WallDirection.East: wall = wall_E; break; case DungeonRoomInfo.WallDirection.South: wall = wall_S; break; case DungeonRoomInfo.WallDirection.West: wall = wall_W; break; default: break; } return(wall); }
public DungeonRoom GetAdjoiningRoom(DungeonRoomInfo.WallDirection dir) { DungeonRoom dr = null; switch (dir) { case DungeonRoomInfo.WallDirection.North: dr = NorthRoom; break; case DungeonRoomInfo.WallDirection.East: dr = EastRoom; break; case DungeonRoomInfo.WallDirection.South: dr = SouthRoom; break; case DungeonRoomInfo.WallDirection.West: dr = WestRoom; break; default: break; } return(dr); }
public void BlowHoleInWall(DungeonRoomInfo.WallDirection dir) { if (IsWallBombedOpen(dir)) { //Debug.LogError("Trying to Blow Hole In Wall that is already bombed open."); return; } if (!Info.IsBombable(dir)) { Debug.LogError("Trying to Blow Hole In Wall that is not bombable."); return; } SetWallTypeForDirection(dir, DungeonRoomInfo.WallType.Bombed); DungeonRoom adjoiningRoom = GetAdjoiningRoom(dir); if (adjoiningRoom != null) { adjoiningRoom.BlowHoleInWall(DungeonRoomInfo.GetOppositeDirection(dir)); } }
void BlastWall(GameObject wall) { Transform p1 = wall.transform.parent; if (p1 == null) { return; } Transform p2 = p1.parent; if (p2 == null) { return; } DungeonRoom dr = p2.GetComponent <DungeonRoom>(); if (dr == null) { return; } DungeonRoomInfo.WallDirection wallDir = dr.GetWallDirectionForWall(wall); if (!dr.Info.IsBombable(wallDir)) { return; } Vector3 wallCenter = wall.transform.position; wallCenter.y = 0; float dist = Vector3.Distance(wallCenter, transform.position); if (dist < radius * 1.5f) { dr.BlowHoleInWall(wallDir); } }
public DungeonRoomInfo.WallDirection GetWallDirectionForWall(GameObject wall) { DungeonRoomInfo.WallDirection wallDir = DungeonRoomInfo.WallDirection.None; if (wall == wall_N) { wallDir = DungeonRoomInfo.WallDirection.North; } else if (wall == wall_E) { wallDir = DungeonRoomInfo.WallDirection.East; } else if (wall == wall_S) { wallDir = DungeonRoomInfo.WallDirection.South; } else if (wall == wall_W) { wallDir = DungeonRoomInfo.WallDirection.West; } return(wallDir); }
public Material GetWallMaterial(DungeonRoomInfo.WallDirection direction, DungeonRoomInfo.WallType wallType) { bool northSouthWall = DungeonRoomInfo.IsNorthOrSouth(direction); Material mat = null; switch (wallType) { case DungeonRoomInfo.WallType.Closed: mat = northSouthWall ? wall : wall_EW; break; case DungeonRoomInfo.WallType.DoorOpen: mat = northSouthWall ? wallOpen : wallOpen_EW; break; case DungeonRoomInfo.WallType.DoorSealed: mat = northSouthWall ? wallSealed : wallSealed_EW; break; case DungeonRoomInfo.WallType.DoorLocked: mat = northSouthWall ? wallLocked : wallLocked_EW; break; case DungeonRoomInfo.WallType.Bombed: mat = northSouthWall ? wallBombed : wallBombed_EW; break; case DungeonRoomInfo.WallType.Top: mat = northSouthWall ? wallTop : wallTop_EW; break; default: break; } return(mat); }
public bool IsDoorSealed(DungeonRoomInfo.WallDirection dir) { return(GetWallTypeForDirection(dir) == DungeonRoomInfo.WallType.DoorSealed); }
public bool IsWallBombedOpen(DungeonRoomInfo.WallDirection dir) { return(GetWallTypeForDirection(dir) == DungeonRoomInfo.WallType.Bombed); }
public bool CanPassThrough(DungeonRoomInfo.WallDirection direction) { return(Info.CanPassThrough(direction)); }
public DungeonRoomInfo.WallType GetWallTypeForDirection(DungeonRoomInfo.WallDirection direction) { return(Info.GetWallTypeForDirection(direction)); }
void AssignToRandomWall() { DungeonRoomInfo.WallDirection d = WorldInfo.Instance.IsInDungeon ? DungeonRoomInfo.GetRandomWallDirection() : wallDir; AssignToWall(d); }