Browse Source

Finished the environment turns for the traps

Added fog to the camera
master
ClairePeta 5 years ago
parent
commit
6bfb58f4be
11 changed files with 1402 additions and 1177 deletions
  1. +1077
    -1072
      Assets/Prefabs/Map Sections/Start 4-player.prefab
  2. +214
    -8
      Assets/Prefabs/Traps/CrushingBoulder.prefab
  3. +26
    -25
      Assets/Prefabs/Traps/InGroundTrap.prefab
  4. +7
    -2
      Assets/Prefabs/Traps/ShootingCannon + Block.prefab
  5. +2
    -2
      Assets/Scenes/Levels/RaceTrack Beta.unity
  6. +2
    -2
      Assets/Scenes/Menus/Lobby.unity
  7. +22
    -23
      Assets/Scripts/Map Generation/MapManager.cs
  8. +17
    -18
      Assets/Scripts/Traps/CrushingBoulder.cs
  9. +12
    -13
      Assets/Scripts/Traps/CubeWithCrystals.cs
  10. +9
    -3
      Assets/Scripts/Traps/InGroundTrap.cs
  11. +14
    -9
      Assets/Scripts/Traps/ShootingCannon.cs

+ 1077
- 1072
Assets/Prefabs/Map Sections/Start 4-player.prefab
File diff suppressed because it is too large
View File


+ 214
- 8
Assets/Prefabs/Traps/CrushingBoulder.prefab View File

@ -237,6 +237,7 @@ Transform:
m_Children:
- {fileID: 6741087515541790872}
- {fileID: 6745622315908332759}
- {fileID: 7212950232714103513}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -252,25 +253,143 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 87ae70f1ec0c67743923bd4a83ee85d8, type: 3}
m_Name:
m_EditorClassIdentifier:
triggeranimate: 0
triggeranimate1: 0
VisualOffset: {x: 0, y: 0, z: 0}
is_Walkable: 0
isWater: 0
isPit: 0
isSpawnable: 0
SpawnDirection: 2
countdowntimer: 3
counter: {fileID: 6745622315908332755}
--- !u!1001 &6745622316608603784
--- !u!1001 &1839697205776302118
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6745622317302131140}
m_TransformParent: {fileID: 7212950232714103513}
m_Modifications:
- target: {fileID: 1252527896654764, guid: d2a34a5082f5c524b845ab11a78a7214, type: 3}
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_Name
value: Rock_2 (2)
value: Cube_GroundU
objectReference: {fileID: 0}
- target: {fileID: 1252527896654764, guid: d2a34a5082f5c524b845ab11a78a7214, type: 3}
propertyPath: m_StaticEditorFlags
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.y
value: -1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
--- !u!1001 &2825495671297622863
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 7212950232714103513}
m_Modifications:
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_Name
value: Cube_GroundL
objectReference: {fileID: 0}
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.y
value: -2
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
--- !u!1001 &6745622316608603784
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6745622317302131140}
m_Modifications:
- target: {fileID: 4614242176542224, guid: d2a34a5082f5c524b845ab11a78a7214, type: 3}
propertyPath: m_LocalPosition.x
value: 0
@ -323,6 +442,14 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1.2289
objectReference: {fileID: 0}
- target: {fileID: 1252527896654764, guid: d2a34a5082f5c524b845ab11a78a7214, type: 3}
propertyPath: m_Name
value: Rock_2 (2)
objectReference: {fileID: 0}
- target: {fileID: 1252527896654764, guid: d2a34a5082f5c524b845ab11a78a7214, type: 3}
propertyPath: m_StaticEditorFlags
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d2a34a5082f5c524b845ab11a78a7214, type: 3}
--- !u!4 &6741087515541790872 stripped
@ -331,3 +458,82 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 6745622316608603784}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7212084370745998701
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6745622317302131140}
m_Modifications:
- target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_Name
value: Cube_GroundWGrass (11)
objectReference: {fileID: 0}
- target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_TagString
value: Coloured
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalPosition.y
value: -2
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalRotation.y
value: -1
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalRotation.w
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
--- !u!4 &7212950232714103513 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
m_PrefabInstance: {fileID: 7212084370745998701}
m_PrefabAsset: {fileID: 0}

+ 26
- 25
Assets/Prefabs/Traps/InGroundTrap.prefab View File

@ -32,7 +32,7 @@ Transform:
- {fileID: 3280778023726093299}
- {fileID: 3280778022459986741}
- {fileID: 3280778023471378434}
- {fileID: 1068379521905336273}
- {fileID: 59766719020348958}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -48,78 +48,79 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a1b0e7f03e96f154cb9c6ecd542406b7, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1063799847781320221
VisualOffset: {x: 0, y: 0, z: 0}
is_Walkable: 1
isWater: 0
isPit: 0
isSpawnable: 0
SpawnDirection: 2
--- !u!1001 &61813983148133772
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 3281312547625224782}
m_Modifications:
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 1745447707790088, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_Name
value: Cube_Pit
value: Cube_Lava
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalPosition.y
value: -0.84
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
- target: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6060536008043278799, guid: e5fac62723232674aa487c9073f1ca07,
type: 3}
propertyPath: is_Walkable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6060536008043278799, guid: e5fac62723232674aa487c9073f1ca07,
- target: {fileID: 9117651094070773091, guid: 94b25f84ad255eb45ac650f2140605f6,
type: 3}
propertyPath: isPit
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
--- !u!4 &1068379521905336273 stripped
m_SourcePrefab: {fileID: 100100000, guid: 94b25f84ad255eb45ac650f2140605f6, type: 3}
--- !u!4 &59766719020348958 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07,
m_CorrespondingSourceObject: {fileID: 4449718510517138, guid: 94b25f84ad255eb45ac650f2140605f6,
type: 3}
m_PrefabInstance: {fileID: 1063799847781320221}
m_PrefabInstance: {fileID: 61813983148133772}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3281312545920754357
PrefabInstance:

+ 7
- 2
Assets/Prefabs/Traps/ShootingCannon + Block.prefab View File

@ -24,7 +24,7 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6179448856766749154}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.5, y: -0.5, z: -0.5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
@ -47,8 +47,13 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 44366bd8a25270844bdd9a5db9f2b0e0, type: 3}
m_Name:
m_EditorClassIdentifier:
VisualOffset: {x: 0, y: 0, z: 0}
is_Walkable: 0
isWater: 0
isPit: 0
isSpawnable: 0
SpawnDirection: 2
shootingRight: 1
triggeranimate: 0
shootingObject: {fileID: 3506936643819969965, guid: e8cf547bc36bd094f860f652fbe08047,
type: 3}
spawnLocation: {fileID: 6183695074135418386}

+ 2
- 2
Assets/Scenes/Levels/RaceTrack Beta.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d5b17b077ec5bf78c41162b5e3c5024b0c8c06fc191232c67d00d4ec4a1de61f
size 30956
oid sha256:8be6d12cb624b41bbec4263d925f0ff9c62f13f2a60df314dae7bfa3c3132aeb
size 33586

+ 2
- 2
Assets/Scenes/Menus/Lobby.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d468b9a3a6350ef29c53054b57586286bf9187c8023a26dc2b1add45b8465c0
size 46620
oid sha256:645eb7de71edda6ae053639cdb1fe76431b0b94a13287c4e7e2ff250c83313d5
size 46629

+ 22
- 23
Assets/Scripts/Map Generation/MapManager.cs View File

@ -54,11 +54,11 @@ public class MapManager : ScriptableObject
}
}
Debug.Log("sections.Count = " + sections.Count);
//Debug.Log("sections.Count = " + sections.Count);
foreach (MapSection section in sections)
{
Debug.Log("Possible section: " + section.name);
//Debug.Log("Possible section: " + section.name);
}
initialPlayerCount = clients.ConnectedClients.Count;
@ -181,14 +181,14 @@ public class MapManager : ScriptableObject
foreach (MapSection section in validSections)
{
Debug.Log("Valid section: " + section.name);
//Debug.Log("Valid section: " + section.name);
}/**/
Debug.Log("Choosing section");
//Debug.Log("Choosing section");
MapSection nextSection = validSections[(int)Random.Range(0.0f, (float)validSections.Count)];
Debug.Log("Chosen section: " + nextSection.name);
//Debug.Log("Chosen section: " + nextSection.name);
addSection(nextSection);
}
@ -220,29 +220,28 @@ public class MapManager : ScriptableObject
{
int connections = 0;
Debug.Log("Checking " + first.name + ", " + second.name);
//Debug.Log("Checking " + first.name + ", " + second.name);
//if (second.difficulty < diffMin || second.difficulty > diffMax)
if (second.difficultyMax < difficulty || second.difficultyMin > difficulty) //Check that we're in the right difficulty range for this section
{
Debug.Log("Difficulty = " + difficulty + ", max = " + second.difficultyMax + ", min = " + second.difficultyMin);
//Debug.Log("Difficulty = " + difficulty + ", max = " + second.difficultyMax + ", min = " + second.difficultyMin);
return false;
}
if (second.widthIn < widthMin || second.widthIn > widthMax) //And that it's in the right width range
{
Debug.Log("width = " + second.widthIn + ", max = " + widthMin + ", min = " + widthMax);
//Debug.Log("width = " + second.widthIn + ", max = " + widthMin + ", min = " + widthMax);
return false;
}
//Debug.Log("Checking sections: first = " + first.name + ", second = " + second.name);
////Debug.Log("Checking sections: first = " + first.name + ", second = " + second.name);
foreach (GameObject exit in first.exits)
{
foreach (GameObject entry in second.entrances)
{
Debug.Log("Checking connections: exit = " + exit.transform.localPosition.z + ", " + exit.transform.localPosition.x
+ ", entry = " + entry.transform.localPosition.z + ", " + entry.transform.localPosition.x);/**/
//Debug.Log("Checking connections: exit = " + exit.transform.localPosition.z + ", " + exit.transform.localPosition.x+ ", entry = " + entry.transform.localPosition.z + ", " + entry.transform.localPosition.x);/**/
if (checkConnection(exit, entry))
{
connections++;
@ -250,15 +249,15 @@ public class MapManager : ScriptableObject
}
}
//Debug.Log("Connections = " + connections);
////Debug.Log("Connections = " + connections);
if (connections >= minConns)
{
//Debug.Log("Valid section!");
////Debug.Log("Valid section!");
}
else
{
//Debug.Log("Invalid section!");
////Debug.Log("Invalid section!");
}
return (connections >= minConns);
@ -266,12 +265,12 @@ public class MapManager : ScriptableObject
bool checkConnection(GameObject exit, GameObject entry)
{
/*Debug.Log("Checking connections: exit = " + exit.transform.localPosition.z + ", " + exit.transform.localPosition.x
/*//Debug.Log("Checking connections: exit = " + exit.transform.localPosition.z + ", " + exit.transform.localPosition.x
+ ", entry = " + entry.transform.localPosition.z + ", " + entry.transform.localPosition.x);*/
//If the squares being checked don't line up, the connection is invalid
if (exit.transform.localPosition.z != entry.transform.localPosition.z)
{
//Debug.Log(exit.transform.localPosition.z + " != " + entry.transform.localPosition.z);
////Debug.Log(exit.transform.localPosition.z + " != " + entry.transform.localPosition.z);
return false;
}
@ -279,22 +278,22 @@ public class MapManager : ScriptableObject
//It's technically possible to cross two water blocks, but we don't count that
if (requiresJump(exit) && requiresJump(entry))
{
//Debug.Log("Invalid connection - both water");
////Debug.Log("Invalid connection - both water");
return false;
}
//Debug.Log("Exit.is_Walkable = " + exit.GetComponent<Block>().is_Walkable + ", Entry.is_Walkable = " + entry.GetComponent<Block>().is_Walkable);
////Debug.Log("Exit.is_Walkable = " + exit.GetComponent<Block>().is_Walkable + ", Entry.is_Walkable = " + entry.GetComponent<Block>().is_Walkable);
//Since we currently don't let people jump over walls, if either block is a wall, the connection is invalid
if (isWall(exit) || isWall(entry))
{
//Debug.Log("Invalid connection - not walkable");
////Debug.Log("Invalid connection - not walkable");
return false;
}
//Debug.Log("Exit.isWater = " + exit.GetComponent<Block>().isWater + ", Entry.isWater = " + entry.GetComponent<Block>().isWater);
////Debug.Log("Exit.isWater = " + exit.GetComponent<Block>().isWater + ", Entry.isWater = " + entry.GetComponent<Block>().isWater);
//Debug.Log("Valid connection!");
////Debug.Log("Valid connection!");
//If we've passed all these tests, the connection is valid!
return true;
@ -389,7 +388,7 @@ public class MapManager : ScriptableObject
{
if (clients.ConnectedClients.Count <= (float)(0.5f * initialPlayerCount))
{
Debug.Log("Initial players = " + initialPlayerCount + ", current players = " + clients.ConnectedClients.Count + ", player count at half or below");
//Debug.Log("Initial players = " + initialPlayerCount + ", current players = " + clients.ConnectedClients.Count + ", player count at half or below");
/*diffMin++;
diffMax++;*/
difficulty++;
@ -400,7 +399,7 @@ public class MapManager : ScriptableObject
if (clients.ConnectedClients.Count <= (float)(0.33f * initialPlayerCount))
{
Debug.Log("Initial players = " + initialPlayerCount + ", current players = " + clients.ConnectedClients.Count + ", player count below 33%");
//Debug.Log("Initial players = " + initialPlayerCount + ", current players = " + clients.ConnectedClients.Count + ", player count below 33%");
/*diffMin++;
diffMax += 2;*/
difficulty += 2;

+ 17
- 18
Assets/Scripts/Traps/CrushingBoulder.cs View File

@ -3,14 +3,16 @@ using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class CrushingBoulder : MonoBehaviour
public class CrushingBoulder : ActiveBlock
{
public bool triggeranimate;
public bool triggeranimate1;
public int countdowntimer;
public TextMeshPro counter;
int countdown;
public override int GetInitative()
{
return 3;
}
private void Start()
{
countdown = countdowntimer;
@ -19,6 +21,18 @@ public class CrushingBoulder : MonoBehaviour
{
counter.text = countdown.ToString();
}
public override IEnumerator OnEnvironmentTurn(PlayerData[] allPlayers)
{
countdown--;
if (countdown == 0)
{
StartCoroutine(FallRaiseCoroutine(-2.0f));
yield return new WaitForSeconds(5);
StartCoroutine(FallRaiseCoroutine(2.0f));
countdown = countdowntimer;
}
isFinished = true;
}
IEnumerator FallRaiseCoroutine(float dropDistance)
{
@ -34,19 +48,4 @@ public class CrushingBoulder : MonoBehaviour
}
transform.position = endPosition;
}
public void Animate()
{
countdown--;
if (countdown == 0)
{
StartCoroutine(FallRaiseCoroutine(-2.0f));
countdown = countdowntimer;
returnToPosition();
}
}
public void returnToPosition()
{
StartCoroutine(FallRaiseCoroutine(2.0f));
}
}

+ 12
- 13
Assets/Scripts/Traps/CubeWithCrystals.cs View File

@ -2,15 +2,22 @@
using System.Collections.Generic;
using UnityEngine;
public class CubeWithCrystals : MonoBehaviour
public class CubeWithCrystals : ActiveBlock
{
public GameObject crystals;
public bool triggeranimate;
public bool triggeranimate1;
private void Update()
public override int GetInitative()
{
return 3;
}
public override IEnumerator OnRoundEnd(PlayerData[] allPlayers)
{
StartCoroutine(GrowCoroutine());
yield return new WaitForSeconds(5);
StartCoroutine(ShrinkCoroutine());
isFinished = true;
//yield break;
}
IEnumerator GrowCoroutine()
@ -27,6 +34,7 @@ public class CubeWithCrystals : MonoBehaviour
}
crystals.transform.position = endPosition;
}
IEnumerator ShrinkCoroutine()
{
float elapsedTime = 0;
@ -41,13 +49,4 @@ public class CubeWithCrystals : MonoBehaviour
}
crystals.transform.position = endPosition;
}
public void Animate()
{
StartCoroutine(GrowCoroutine());
}
public void returnToPosition()
{
StartCoroutine(ShrinkCoroutine());
}
}

+ 9
- 3
Assets/Scripts/Traps/InGroundTrap.cs View File

@ -2,10 +2,16 @@
using System.Collections.Generic;
using UnityEngine;
public class InGroundTrap : MonoBehaviour
public class InGroundTrap : ActiveBlock
{
public void Animate()
public override int GetInitative()
{
Debug.Log("trap");
return 1;
}
public override IEnumerator OnRoundEnd(PlayerData[] allPlayers)
{
isFinished = true;
yield break;
}
}

+ 14
- 9
Assets/Scripts/Traps/ShootingCannon.cs View File

@ -4,16 +4,21 @@ using TMPro;
using UnityEngine;
public class ShootingCannon : MonoBehaviour
public class ShootingCannon : ActiveBlock
{
public bool shootingRight;
public bool triggeranimate;
public GameObject shootingObject;
public Transform spawnLocation;
public TextMeshPro counter;
public int countdowntimer;
int countdown;
public override int GetInitative()
{
//order
return 4;
}
private void Start()
{
countdown = countdowntimer;
@ -23,20 +28,20 @@ public class ShootingCannon : MonoBehaviour
counter.text = countdown.ToString();
}
public void Animate()
public override IEnumerator OnEnvironmentTurn(PlayerData[] allPlayers)
{
countdown--;
if (countdown == 0){
if (countdown == 0)
{
GameObject shot = Instantiate(shootingObject, spawnLocation.position, Quaternion.identity);
if (shootingRight == true)
{
if (shootingRight == true){
shot.GetComponent<Rigidbody>().AddForce(shot.transform.forward * -500);
}
else
{
}else{
shot.GetComponent<Rigidbody>().AddForce(shot.transform.forward * 500);
}
countdown = countdowntimer;
}
isFinished = true;
yield break;
}
}

Loading…
Cancel
Save