diff --git a/MrBigsock/Assets/Code/FollowPlayer.cs b/MrBigsock/Assets/Code/FollowPlayer.cs index cce2166e4432144c3c37c7350f994ea44f973757..6f178e01850ac03da8d9eb4807a5fa1507a04488 100644 --- a/MrBigsock/Assets/Code/FollowPlayer.cs +++ b/MrBigsock/Assets/Code/FollowPlayer.cs @@ -16,6 +16,8 @@ namespace Bigsock private CinemachineConfiner2D cameraMap; Vector3 offset = new Vector3(0, 0, -10); + int i = 0; + void Start() { @@ -31,5 +33,12 @@ namespace Bigsock i++; } } + + private void OnDestroy() + { + NeighbourMapGenerator.ClearRoomList(); + TilemapGenerator.SetRoomIDZero(); + TilemapGenerator.resetMaps(); + } } } diff --git a/MrBigsock/Assets/Code/InteractionSystem/Door.cs b/MrBigsock/Assets/Code/InteractionSystem/Door.cs index d90a8a7f49ba39a438a01294923b878ba024ba07..7ce964c2d521220b255d6fb35c7f625b237a1ec8 100644 --- a/MrBigsock/Assets/Code/InteractionSystem/Door.cs +++ b/MrBigsock/Assets/Code/InteractionSystem/Door.cs @@ -19,7 +19,7 @@ namespace BigSock.Interact { public bool Interact(Interactor interactor) { if(i > 0)enemies = GameObject.FindGameObjectsWithTag((i - 1).ToString()); - else if (i > 0) enemies = GameObject.FindGameObjectsWithTag((0).ToString()); + else if (i == 0) enemies = GameObject.FindGameObjectsWithTag((i).ToString()); if (enemies.Length == 0) { Debug.Log("Opening door!"); diff --git a/MrBigsock/Assets/Code/Map/Data/NeigbourParameters_BossRoom.asset b/MrBigsock/Assets/Code/Map/Data/NeigbourParameters_BossRoom.asset index 503c5feb1cdb75de9e9d8a5780f9488a432b1089..0336fc03745e6cbcfd5ac9700c9f6455aa8a626e 100644 --- a/MrBigsock/Assets/Code/Map/Data/NeigbourParameters_BossRoom.asset +++ b/MrBigsock/Assets/Code/Map/Data/NeigbourParameters_BossRoom.asset @@ -12,8 +12,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fbfb0de6beb24664cbb2d7f616b15910, type: 3} m_Name: NeigbourParameters_BossRoom m_EditorClassIdentifier: - width: 0 - height: 0 + width: 50 + height: 50 smoothCount: 0 empty: 0 edgesAreWalls: 0 diff --git a/MrBigsock/Assets/Code/Map/Data/NeigbourParameters_medium.asset b/MrBigsock/Assets/Code/Map/Data/NeigbourParameters_medium.asset index bf18c5092f6d61e73b7f2b60b55f2eacd1673d14..beeec598bfa7edea1ca0672b2a5d16793b1ca70f 100644 --- a/MrBigsock/Assets/Code/Map/Data/NeigbourParameters_medium.asset +++ b/MrBigsock/Assets/Code/Map/Data/NeigbourParameters_medium.asset @@ -12,8 +12,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fbfb0de6beb24664cbb2d7f616b15910, type: 3} m_Name: NeigbourParameters_medium m_EditorClassIdentifier: - width: 50 - height: 40 + width: 30 + height: 24 smoothCount: 0 empty: 0 edgesAreWalls: 0 diff --git a/MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs b/MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs index 23e3a32c8bd96c71868207094619988c0d4e8a7e..4dd6c90bdac929e4453f94ccc989b3e1aaf61758 100644 --- a/MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs +++ b/MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs @@ -14,6 +14,7 @@ namespace Bigsock public override void RunProceduralGeneration() { + roomList.Clear(); for (int i = 0; i <= RoomCount - 1; i++) { @@ -41,5 +42,10 @@ namespace Bigsock { return roomList.Count; } + + public static void ClearRoomList() + { + roomList.Clear(); + } } } \ No newline at end of file diff --git a/MrBigsock/Assets/Code/Map/TilemapGenerator.cs b/MrBigsock/Assets/Code/Map/TilemapGenerator.cs index a5dd3007e8f0d8bda403ea8f0ce5cf6aeba3370b..7b73c7854c6df828f07d11d25385096eacb83005 100644 --- a/MrBigsock/Assets/Code/Map/TilemapGenerator.cs +++ b/MrBigsock/Assets/Code/Map/TilemapGenerator.cs @@ -231,6 +231,16 @@ namespace Bigsock return roomID++; } + public static void SetRoomIDZero() { + roomID = 0; + } + + public static void resetMaps() + { + DoorLocations.Clear(); + MapBoundaryList.Clear(); + } + /* Returns the ID of the previous room*/ public static int LastRoom() @@ -252,7 +262,9 @@ namespace Bigsock { int enemyRandom = Random.Range(0, Enemy.Length); int randomLocation_x = Random.Range(1, map.GetUpperBound(0) - 1); + if (randomLocation_x == DoorLocations[roomNr].x) randomLocation_x += 1; int randomLocation_y = Random.Range(map.GetLowerBound(1) + 2, map.GetUpperBound(1) - 1); + if (randomLocation_x == DoorLocations[roomNr].y) randomLocation_y += 1; Instantiate(Enemy[enemyRandom], new Vector3Int((int)FloorTilemap[roomNr].transform.position.x + randomLocation_x, (int)FloorTilemap[roomNr].transform.position.y + randomLocation_y, 0), Quaternion.identity); } @@ -260,6 +272,7 @@ namespace Bigsock public void SpawnBoss(int[,] bossRoom, int roomNr) { + Boss.tag = "Boss"; Instantiate(Boss, new Vector3Int((int)FloorTilemap[roomNr].transform.position.x + bossRoom.GetUpperBound(0)/2, (int)FloorTilemap[roomNr].transform.position.y + bossRoom.GetUpperBound(1) / 2, 0), Quaternion.identity); } diff --git a/MrBigsock/Assets/Resources/Prefabs/Bosses/Skeleton_Boss.prefab b/MrBigsock/Assets/Resources/Prefabs/Bosses/Skeleton_Boss.prefab index 2d63c2fe3a762a192cc1f917865f59c482ca8b2d..a0a60b26809606146e9d59150b37a4c4f4bda9e3 100644 --- a/MrBigsock/Assets/Resources/Prefabs/Bosses/Skeleton_Boss.prefab +++ b/MrBigsock/Assets/Resources/Prefabs/Bosses/Skeleton_Boss.prefab @@ -138,7 +138,7 @@ GameObject: - component: {fileID: 4762512358206024136} m_Layer: 6 m_Name: Skeleton_Boss - m_TagString: Untagged + m_TagString: Boss m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -247,15 +247,18 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: baseAttackSpeed: 3 + source: [] + TakeDamageAudio: {fileID: 0} baseMovementSpeed: 200 - baseDamage: 3 + baseDamage: 2 knockbackForce: 3 - baseHP: 1000 - baseMaxHP: 1000 + baseHP: 75 + baseMaxHP: 75 dropXP: 0 xp: 0 maxXp: 0 level: 0 + HpBarEnemy: {fileID: 0} collisionOffset: 0.05 movementFilter: useTriggers: 0 diff --git a/MrBigsock/Assets/Resources/Prefabs/Enemy_Slime.prefab b/MrBigsock/Assets/Resources/Prefabs/Enemy_Slime.prefab index fce3c623ed7c553e3d551a03d5c1b57b5c560da5..65c081ce1c376acbd62ac5f135eded7a2aa63ea9 100644 --- a/MrBigsock/Assets/Resources/Prefabs/Enemy_Slime.prefab +++ b/MrBigsock/Assets/Resources/Prefabs/Enemy_Slime.prefab @@ -176,8 +176,8 @@ MonoBehaviour: baseMovementSpeed: 2 baseDamage: 1 knockbackForce: 3 - baseHP: 10 - baseMaxHP: 10 + baseHP: 20 + baseMaxHP: 20 dropXP: 0 xp: 0 maxXp: 0 diff --git a/MrBigsock/Assets/Resources/Prefabs/attack.prefab b/MrBigsock/Assets/Resources/Prefabs/attack.prefab index 8b60b9425a269e7bb29d93d2fdb32a5ada3da3a5..0b5ef7e781e1f3803f3e22632f5feaf47e55736f 100644 --- a/MrBigsock/Assets/Resources/Prefabs/attack.prefab +++ b/MrBigsock/Assets/Resources/Prefabs/attack.prefab @@ -159,4 +159,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3ae233c400f83844da0350aabdf5097d, type: 3} m_Name: m_EditorClassIdentifier: - speed: 10 + speed: 15 diff --git a/MrBigsock/Assets/Scenes/GenTilemap.unity b/MrBigsock/Assets/Scenes/GenTilemap.unity index c14dbd729c8b6d34f1b5d3bcac12d649f1b89537..e9f64e9b8dbb74c91bc31b753cc93b76dca2ade4 100644 --- a/MrBigsock/Assets/Scenes/GenTilemap.unity +++ b/MrBigsock/Assets/Scenes/GenTilemap.unity @@ -76072,6 +76072,63 @@ Tilemap: m_CorrespondingSourceObject: {fileID: 8298925029994248936, guid: 9ad55898a5aa5e340ba56d310f32f741, type: 3} m_PrefabInstance: {fileID: 8298925029637945467} m_PrefabAsset: {fileID: 0} +--- !u!1001 &481723729 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_RootOrder + value: 15 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalPosition.x + value: 9.668067 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalPosition.y + value: 2.2499247 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalPosition.z + value: 0.22078483 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526256, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7113940451868526258, guid: d1bdff0715a06334f89add2380e94407, type: 3} + propertyPath: m_Name + value: backgroundMusic + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: d1bdff0715a06334f89add2380e94407, type: 3} --- !u!1 &498579220 GameObject: m_ObjectHideFlags: 0 @@ -76394,6 +76451,7 @@ GameObject: - component: {fileID: 866945743} - component: {fileID: 866945745} - component: {fileID: 866945744} + - component: {fileID: 866945746} m_Layer: 0 m_Name: WallTop m_TagString: Untagged @@ -76551,6 +76609,22 @@ Tilemap: e31: 0 e32: 0 e33: 1 +--- !u!19719996 &866945746 +TilemapCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 866945742} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_MaximumTileChangeCount: 1000 + m_ExtrusionFactor: 0.00001 --- !u!1839735485 &871285029 stripped Tilemap: m_CorrespondingSourceObject: {fileID: 8298925029036549884, guid: 9ad55898a5aa5e340ba56d310f32f741, type: 3} @@ -83200,6 +83274,7 @@ GameObject: - component: {fileID: 1576245751} - component: {fileID: 1576245753} - component: {fileID: 1576245752} + - component: {fileID: 1576245754} m_Layer: 0 m_Name: WallSides m_TagString: Untagged @@ -83341,6 +83416,22 @@ Tilemap: e31: 0 e32: 0 e33: 1 +--- !u!19719996 &1576245754 +TilemapCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1576245750} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_MaximumTileChangeCount: 1000 + m_ExtrusionFactor: 0.00001 --- !u!1001 &1698585129 PrefabInstance: m_ObjectHideFlags: 0 @@ -121524,6 +121615,7 @@ GameObject: - component: {fileID: 2071785559} - component: {fileID: 2071785561} - component: {fileID: 2071785560} + - component: {fileID: 2071785562} m_Layer: 0 m_Name: WallBottom m_TagString: Untagged @@ -121669,6 +121761,22 @@ Tilemap: e31: 0 e32: 0 e33: 1 +--- !u!19719996 &2071785562 +TilemapCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2071785558} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_MaximumTileChangeCount: 1000 + m_ExtrusionFactor: 0.00001 --- !u!1839735485 &2110004376 stripped Tilemap: m_CorrespondingSourceObject: {fileID: 8298925029612890527, guid: 9ad55898a5aa5e340ba56d310f32f741, type: 3} diff --git a/MrBigsock/ProjectSettings/TagManager.asset b/MrBigsock/ProjectSettings/TagManager.asset index 8bf17cd56c6e83c45f9932712ef5d5348098569b..31a12849571026e5ca9bf16a7584f075bef6cb3f 100644 --- a/MrBigsock/ProjectSettings/TagManager.asset +++ b/MrBigsock/ProjectSettings/TagManager.asset @@ -10,6 +10,7 @@ TagManager: - 3 - 4 - 5 + - Boss layers: - Default - TransparentFX