From 401e93075d1af1013bd0473475499120536e8604 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 19 Feb 2025 16:11:15 +0100 Subject: [PATCH] Fixed Monster rooms unable to be '=' --- .../netstandard2.0/DiceProbabilities.dll | Bin 6656 -> 6656 bytes .../bin/Debug/net9.0/DiceProbabilities.dll | Bin 6656 -> 6656 bytes .../Debug/net9.0/DungeonMapConsolePrinter.dll | Bin 6144 -> 6144 bytes .../Debug/net9.0/DungeonMapConsolePrinter.exe | Bin 145920 -> 145920 bytes .../bin/Debug/net9.0/DungeonMapGenerator.dll | Bin 29184 -> 29184 bytes .../netstandard2.0/DiceProbabilities.dll | Bin 6656 -> 6656 bytes .../netstandard2.0/DungeonMapGenerator.dll | Bin 29184 -> 29184 bytes Dungeons/dungeon06.json | 1915 ++ Dungeons/dungeon07.json | 1814 ++ .../Assets/Another Hard Start.unity | 13656 +++++++++++++++ .../Assets/Another Hard Start.unity.meta | 7 + .../Scenes/TestDungeons/Hard Start.unity | 14538 ++++++++++++++++ .../Scenes/TestDungeons/Hard Start.unity.meta | 7 + .../Assets/Scripts/Rooms/EmptyRoom.cs | 11 +- .../Assets/Scripts/Rooms/Monster Room.cs | 5 +- .../Assets/Scripts/Rooms/Room.cs | 12 + 16 files changed, 31954 insertions(+), 11 deletions(-) create mode 100644 Dungeons/dungeon06.json create mode 100644 Dungeons/dungeon07.json create mode 100644 PuzzleGameProject/Assets/Another Hard Start.unity create mode 100644 PuzzleGameProject/Assets/Another Hard Start.unity.meta create mode 100644 PuzzleGameProject/Assets/Scenes/TestDungeons/Hard Start.unity create mode 100644 PuzzleGameProject/Assets/Scenes/TestDungeons/Hard Start.unity.meta diff --git a/DiceProbabilities/DiceProbabilities/bin/Debug/netstandard2.0/DiceProbabilities.dll b/DiceProbabilities/DiceProbabilities/bin/Debug/netstandard2.0/DiceProbabilities.dll index 146b3c08e96c8f2004302ec1b9548bec01d07562..417e586d0a0898b7f5cd1bf074acb04f7da160d6 100644 GIT binary patch delta 237 zcmZoLX)u}4!D8?)p?zb|20np(_J)eb7vJ?;S>Dr5PC+S*D~J7^N5)rzR#D8CjSc8=I#k8zwS9fZc~Tw`RH8KKX}WfPmZ?sq8iE%|7!s zSFteMyV*K9La0^&DmVuw2vjYuZGT^qLF_>M+}gL_H-8nfX7NvBNMSH!FlR6T!W0HG z22&uN%wWWj1QbnXumrM97!rXvnZW`mVhSWvf!GMlHwE&OfGiV+G@!~9Aj^1jy?7%N E0RAIH3jhEB diff --git a/DungeonMapGenerator/DungeonMapConsolePrinter/bin/Debug/net9.0/DiceProbabilities.dll b/DungeonMapGenerator/DungeonMapConsolePrinter/bin/Debug/net9.0/DiceProbabilities.dll index 146b3c08e96c8f2004302ec1b9548bec01d07562..417e586d0a0898b7f5cd1bf074acb04f7da160d6 100644 GIT binary patch delta 237 zcmZoLX)u}4!D8?)p?zb|20np(_J)eb7vJ?;S>Dr5PC+S*D~J7^N5)rzR#D8CjSc8=I#k8zwS9fZc~Tw`RH8KKX}WfPmZ?sq8iE%|7!s zSFteMyV*K9La0^&DmVuw2vjYuZGT^qLF_>M+}gL_H-8nfX7NvBNMSH!FlR6T!W0HG z22&uN%wWWj1QbnXumrM97!rXvnZW`mVhSWvf!GMlHwE&OfGiV+G@!~9Aj^1jy?7%N E0RAIH3jhEB diff --git a/DungeonMapGenerator/DungeonMapConsolePrinter/bin/Debug/net9.0/DungeonMapConsolePrinter.dll b/DungeonMapGenerator/DungeonMapConsolePrinter/bin/Debug/net9.0/DungeonMapConsolePrinter.dll index 789017006c43241bbf747e1a1cabe33e11ea3c3d..dd40b1b8cf0c69daa7c31226fd25eb5bb3138bfa 100644 GIT binary patch delta 260 zcmZoLXfT-2!SbVI#-xosF&qLLw$8kAVoHGZ~)7!HBA`<`c;u9k3F{&dT;0)x{jn}2X5F?yw?7@8Xxq?nl+ zBpW3eCR-YrB$^~!7@At7S{Nl;n3^Ufo1|H$BpWj@ure|*f=LDj1`b9BZXg8*J)a-% zp1g!BKwwi>74yeSPyH7yoPSm2`Bb6FEZnUMP{IC3P(hIDid#QiyHS*kOcfNkEnfLmE(J3Xo;I{ktg>Ckp@_Q4+xb diff --git a/DungeonMapGenerator/DungeonMapConsolePrinter/bin/Debug/net9.0/DungeonMapGenerator.dll b/DungeonMapGenerator/DungeonMapConsolePrinter/bin/Debug/net9.0/DungeonMapGenerator.dll index 1a1c83765dfd7a5947633ce051fa71cd8f485078..0578497a4be9f5999f7a1ed4ce303a359b7b09c4 100644 GIT binary patch delta 238 zcmZp8!r1VHaY6@6@#nY~8+(343%pXuWizh%=(6ZV+0E)5obsEe#H`@aFiJB_GDLGBUDENi#4?F)~g~OfoXEFgG?fPfIpT+?!yb77XSYIUFtWH`TYGKtlB@uMV=On$ z9JbK$ZhY<;91wjaZ!$}EvjSA`HcSwtdisf@|D4wJ8-4Je?X`J%_FQKFG=>xgLk4pO z10YOcFk>(U(#Z@)3`s!IWClwh%Y-2jh?5yCfFhS>Dr5PC+S*D~J7^N5)rzR#D8CjSc8=I#k8zwS9fZc~Tw`RH8KKX}WfPmZ?sq8iE%|7!s zSFteMyV*K9La0^&DmVuw2vjYuZGT^qLF_>M+}gL_H-8nfX7NvBNMSH!FlR6T!W0HG z22&uN%wWWj1QbnXumrM97!rXvnZW`mVhSWvf!GMlHwE&OfGiV+G@!~9Aj^1jy?7%N E0RAIH3jhEB diff --git a/DungeonMapGenerator/DungeonMapGenerator/bin/Debug/netstandard2.0/DungeonMapGenerator.dll b/DungeonMapGenerator/DungeonMapGenerator/bin/Debug/netstandard2.0/DungeonMapGenerator.dll index 1a1c83765dfd7a5947633ce051fa71cd8f485078..0578497a4be9f5999f7a1ed4ce303a359b7b09c4 100644 GIT binary patch delta 238 zcmZp8!r1VHaY6@6@#nY~8+(343%pXuWizh%=(6ZV+0E)5obsEe#H`@aFiJB_GDLGBUDENi#4?F)~g~OfoXEFgG?fPfIpT+?!yb77XSYIUFtWH`TYGKtlB@uMV=On$ z9JbK$ZhY<;91wjaZ!$}EvjSA`HcSwtdisf@|D4wJ8-4Je?X`J%_FQKFG=>xgLk4pO z10YOcFk>(U(#Z@)3`s!IWClwh%Y-2jh?5yCfFh(); - if (_locks[0] is NumberLock ) - { - numberText.SetText(((NumberLock)_locks[0]).GetNumber().ToString()); - } - else if (_locks[0] is MatchingDiceLock) - { - numberText.SetText("="); - } + TextMeshProUGUI text = numberTextObject.GetComponent(); + SetLockGUI(text, _locks[0]); } public override bool TryUnlock(DicePair pair) diff --git a/PuzzleGameProject/Assets/Scripts/Rooms/Monster Room.cs b/PuzzleGameProject/Assets/Scripts/Rooms/Monster Room.cs index 9337b97..4be0c49 100644 --- a/PuzzleGameProject/Assets/Scripts/Rooms/Monster Room.cs +++ b/PuzzleGameProject/Assets/Scripts/Rooms/Monster Room.cs @@ -16,7 +16,8 @@ public class MonsterRoom : Room base.InitializeRoom(); // Create the lock numbers on the room. - numberTextObject.GetComponent().text = ((NumberLock)_locks[0]).GetNumber().ToString(); + TextMeshProUGUI text = numberTextObject.GetComponent(); + SetLockGUI(text, _locks[0]); GameObject lockToDuplicate = numberTextObject; for (int i = 1; i < _locks.Length; i++) { @@ -34,7 +35,7 @@ public class MonsterRoom : Room } public override bool TryUnlock(DicePair pair) { - foreach (NumberLock numberLock in _locks) + foreach (Lock numberLock in _locks) { if (numberLock.CheckIfKeyFits(pair)) { diff --git a/PuzzleGameProject/Assets/Scripts/Rooms/Room.cs b/PuzzleGameProject/Assets/Scripts/Rooms/Room.cs index c2f516f..ca28ac7 100644 --- a/PuzzleGameProject/Assets/Scripts/Rooms/Room.cs +++ b/PuzzleGameProject/Assets/Scripts/Rooms/Room.cs @@ -118,6 +118,18 @@ public abstract class Room : MonoBehaviour RoomExploredByDice?.Invoke(this, this); } + protected void SetLockGUI(TextMeshProUGUI text, Lock _lock) + { + if (_lock is NumberLock ) + { + text.SetText(((NumberLock)_locks[0]).GetNumber().ToString()); + } + else if (_lock is MatchingDiceLock) + { + text.SetText("="); + } + } + private void OnRoomExploredByTorch() { RoomExploredByTorch?.Invoke(this);