From 3d35e125bac6aca342d3b35140e0ee28eb97d29e Mon Sep 17 00:00:00 2001 From: Lucas Coelho <58010418+LucasVinicius314@users.noreply.github.com> Date: Thu, 27 Oct 2022 13:58:23 -0300 Subject: [PATCH 1/5] Spawn de inimigos segmentado por dificuldade, sistema de spawn mais completo --- Assets/Prefabs/Canvas.prefab | 164 +++++++++++++++++++- Assets/Scenes/MainScene.unity | 85 +++++++++- Assets/Scripts/GameManagerScript.cs | 88 +++-------- Assets/Scripts/Models/EnemySpawnSettings.cs | 11 +- Assets/Scripts/PlayerScript.cs | 2 + Assets/Scripts/RoomScript.cs | 79 ++++++++++ Assets/Scripts/StatsScript.cs | 10 ++ 7 files changed, 360 insertions(+), 79 deletions(-) diff --git a/Assets/Prefabs/Canvas.prefab b/Assets/Prefabs/Canvas.prefab index 6d845e6..c07f291 100644 --- a/Assets/Prefabs/Canvas.prefab +++ b/Assets/Prefabs/Canvas.prefab @@ -3557,6 +3557,86 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: Dano +--- !u!1 &5786165326313048569 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9129343121021219635} + - component: {fileID: 3850002207610289737} + - component: {fileID: 6943966996809970594} + m_Layer: 0 + m_Name: Difficulty + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9129343121021219635 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5786165326313048569} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6541826974359309613} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3850002207610289737 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5786165326313048569} + m_CullTransparentMesh: 1 +--- !u!114 &6943966996809970594 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5786165326313048569} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 0e446559229638f448d0706b0656bbe0, type: 3} + m_FontSize: 12 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 0 --- !u!1 &5941958435114552132 GameObject: m_ObjectHideFlags: 0 @@ -3670,6 +3750,86 @@ RectTransform: m_AnchoredPosition: {x: -5, y: 0} m_SizeDelta: {x: -20, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &6624794674392374493 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 846873939859871888} + - component: {fileID: 2762014832840752568} + - component: {fileID: 4684092489768213349} + m_Layer: 0 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &846873939859871888 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6624794674392374493} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6541826974359309613} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2762014832840752568 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6624794674392374493} + m_CullTransparentMesh: 1 +--- !u!114 &4684092489768213349 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6624794674392374493} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 0e446559229638f448d0706b0656bbe0, type: 3} + m_FontSize: 12 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Dificuldade atual --- !u!1 &7334273576904498236 GameObject: m_ObjectHideFlags: 0 @@ -3940,13 +4100,15 @@ RectTransform: - {fileID: 7463554454055162917} - {fileID: 7482012678611493145} - {fileID: 4213524155332047350} + - {fileID: 846873939859871888} + - {fileID: 9129343121021219635} m_Father: {fileID: 2932101239374365858} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 80, y: -200} - m_SizeDelta: {x: 180, y: 180} + m_SizeDelta: {x: 180, y: 240} m_Pivot: {x: 0, y: 1} --- !u!222 &8980498674201781340 CanvasRenderer: diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index e2ca601..f8c1de6 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -700,22 +700,45 @@ MonoBehaviour: - {fileID: 4026393600238520495, guid: 4f847d9983c9b47469670e627d94626e, type: 3} enemySpawnSettings: isEnemySpawnEnabled: 1 + difficultyIndexWeight: 1 + difficultyCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: -0.017335435 + value: 0.99400204 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 16.033 + value: 10.165251 + inSlope: 0.54586494 + outSlope: 0.54586494 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.15172148 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 spawnBatchSize: 2 - spawnInterval: 10 - maxEnemiesAlive: 5 + bossPrefab: {fileID: 2422363816341469345, guid: d1a345f2a0f822246a75854118660aab, type: 3} enemyPrefabs: - {fileID: 2422363816341469345, guid: 878f06b5ada303f47b84bdd84f0d4917, type: 3} - {fileID: 2422363816341469345, guid: d8fc18198181de64a9748ac34ed8bbd3, type: 3} - - {fileID: 2422363816341469345, guid: d1a345f2a0f822246a75854118660aab, type: 3} enemyDropSettings: enableDrops: 1 enemyDrops: - prefab: {fileID: 3578579234224482949, guid: 69c28c34c6fbeeb4b91ecb764913c032, type: 3} chance: 0.11 - prefab: {fileID: 4227791301383778845, guid: e5b6e2820f4646d44bf2868c20e6048e, type: 3} - chance: 0.071 + chance: 0.25 - prefab: {fileID: 6724353180413059161, guid: f1a5ddd8653b52941b34911e403e9c05, type: 3} - chance: 0.069 + chance: 0.24 isNavMeshBaked: 0 currentRoom: {fileID: 0} --- !u!114 &1524951598 @@ -1089,6 +1112,10 @@ PrefabInstance: propertyPath: m_Mesh value: objectReference: {fileID: 764316535} + - target: {fileID: 4026393600420885624, guid: b9519a0483ddad14d827540255bc2c9f, type: 3} + propertyPath: m_VersionIndex + value: 5318 + objectReference: {fileID: 0} - target: {fileID: 4026393600420885628, guid: b9519a0483ddad14d827540255bc2c9f, type: 3} propertyPath: m_Mesh value: @@ -1305,6 +1332,30 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 846873939859871888, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 846873939859871888, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 846873939859871888, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 846873939859871888, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 846873939859871888, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 846873939859871888, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 887981261800075050, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -1945,6 +1996,30 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 9129343121021219635, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9129343121021219635, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9129343121021219635, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9129343121021219635, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9129343121021219635, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9129343121021219635, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 9148812110294212001, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} propertyPath: m_AnchorMax.y value: 0 diff --git a/Assets/Scripts/GameManagerScript.cs b/Assets/Scripts/GameManagerScript.cs index 9aa2b1f..05981cd 100644 --- a/Assets/Scripts/GameManagerScript.cs +++ b/Assets/Scripts/GameManagerScript.cs @@ -26,6 +26,7 @@ public class GameManagerScript : MonoBehaviour MinimapScript? minimapScript; RoomNetwork roomNetwork = new RoomNetwork(); List enemies = new List(); + HashSet visitedRooms = new HashSet(); // State. MenuState menuState = MenuState.closed; @@ -36,6 +37,7 @@ public class GameManagerScript : MonoBehaviour // Getters de state. public MenuState GetMenuState => menuState; public ControlState GetControlState => controlState; + public List GetEnemies => enemies; // Getters de tipo primitivo. public string GetTargetControlScheme => controlState == ControlState.keyboard @@ -52,6 +54,23 @@ public class GameManagerScript : MonoBehaviour public EnemySpawnSettings GetEnemySpawnSettings => enemySpawnSettings; public EnemyDropSettings GetEnemyDropSettings => enemyDropSettings; + public void AttemptEnemySpawn() + { + // TODO: Terminar spawn do boss + + if (currentRoom == null || visitedRooms.Contains(currentRoom)) + { + return; + } + + visitedRooms.Add(currentRoom); + + if (enemySpawnSettings.isEnemySpawnEnabled) + { + currentRoom.GetComponent()?.SpawnEnemies(); + } + } + public void BakeNavMesh() { GetComponent().BuildNavMesh(); @@ -131,70 +150,6 @@ public void KillEnemy(GameObject enemy) Destroy(enemy); } - System.Collections.IEnumerator SpawnLoop() - { - while (true) - { - if (enemySpawnSettings.isEnemySpawnEnabled && - enemies.Count < enemySpawnSettings.maxEnemiesAlive) - { - for (int i = 0; i < enemySpawnSettings.spawnBatchSize; i++) - { - var prefab = enemySpawnSettings.GetRandomEnemyPrefab(); - - var tries = 0; - - while (true) - { - tries++; - - // Sistema de segurança para não cair em loop. - if (tries > 10) - { - break; - } - - var vector2 = Random.insideUnitCircle * 10f; - - var position = new Vector3(x: vector2.x, y: 4f, z: vector2.y); - - RaycastHit hit; - if ( - !Physics.Raycast( - position, - Vector3.down, - out hit, - 10f, - Layers.geometryMask - ) - ) - { - continue; - } - - // Não deixar o inimigo spawnar em cima de paredes. - if (hit.point.y > 1f) - { - continue; - } - - var enemy = Instantiate( - prefab, - hit.point, - Quaternion.identity - ); - - enemies.Add(enemy); - - break; - } - } - } - - yield return new WaitForSeconds(enemySpawnSettings.spawnInterval); - } - } - void Awake() { instance = this; @@ -215,11 +170,6 @@ void OnGUI() GUI.Label(new Rect(100, 36, 100, 20), $"Enemies alive: {enemies.Count}"); } - void Start() - { - StartCoroutine(SpawnLoop()); - } - void Update() { #if UNITY_EDITOR diff --git a/Assets/Scripts/Models/EnemySpawnSettings.cs b/Assets/Scripts/Models/EnemySpawnSettings.cs index 225dcf5..9a5f663 100644 --- a/Assets/Scripts/Models/EnemySpawnSettings.cs +++ b/Assets/Scripts/Models/EnemySpawnSettings.cs @@ -6,14 +6,17 @@ [System.Serializable] public class EnemySpawnSettings { + [Header("General spawn settings")] public bool isEnemySpawnEnabled; + [Min(0f)] + public float difficultyIndexWeight = 1f; + public AnimationCurve difficultyCurve = default!; + + [Header("Room spawn settings")] [Min(1)] public int spawnBatchSize; - [Min(1f)] - public float spawnInterval; - [Min(1)] - public int maxEnemiesAlive = 5; + public GameObject bossPrefab = default!; public List enemyPrefabs = default!; public GameObject GetRandomEnemyPrefab() diff --git a/Assets/Scripts/PlayerScript.cs b/Assets/Scripts/PlayerScript.cs index 1941170..f585d6e 100644 --- a/Assets/Scripts/PlayerScript.cs +++ b/Assets/Scripts/PlayerScript.cs @@ -80,6 +80,8 @@ public void CalculatePath(bool isFirstRender) // Atualiza a sala atual. manager.currentRoom = parent.gameObject; + manager.AttemptEnemySpawn(); + // Verifica se faz sentido procurar um caminho. if (manager.currentRoom != null && network.bossRoom != null) { diff --git a/Assets/Scripts/RoomScript.cs b/Assets/Scripts/RoomScript.cs index d337064..93cf493 100644 --- a/Assets/Scripts/RoomScript.cs +++ b/Assets/Scripts/RoomScript.cs @@ -10,6 +10,7 @@ public class RoomScript : MonoBehaviour [SerializeField] Vector3 dimensions; + public float difficultyIndex = 0f; public RoomType roomType; public Vector3 GetDimensions => dimensions; @@ -227,6 +228,84 @@ bool IsRoomPlacementAvailable(Vector3 checkArea, Transform origin) ); } + public void SpawnEnemies() + { + var manager = GameManagerScript.instance; + var settings = manager.GetEnemySpawnSettings; + + var batchSize = + settings.spawnBatchSize * + settings.difficultyIndexWeight * + settings.difficultyCurve.Evaluate(difficultyIndex / 20); + + StatsScript.instance.UpdateDifficulty(difficultyIndex); + + Debug.Log( + $"Current room difficulty: {difficultyIndex}: {batchSize} enemies." + ); + + for (int i = 0; i < batchSize; i++) + { + var prefab = settings.GetRandomEnemyPrefab(); + + var tries = 0; + + while (true) + { + tries++; + + // Sistema de segurança para não cair em loop. + if (tries > 10) + { + break; + } + + var vector2 = Random.insideUnitCircle * 10f; + + var position = new Vector3( + x: vector2.x + transform.position.x, + y: 4f, + z: vector2.y + transform.position.z + ); + + RaycastHit hit; + if ( + !Physics.Raycast( + position, + Vector3.down, + out hit, + 10f, + Layers.geometryMask + ) + ) + { + continue; + } + + // Não deixar o inimigo spawnar em cima de paredes. + if (hit.point.y > 1f) + { + continue; + } + + var enemy = Instantiate( + prefab, + hit.point, + Quaternion.identity + ); + + manager.GetEnemies.Add(enemy); + + break; + } + } + } + + void Awake() + { + difficultyIndex = transform.position.magnitude; + } + void Start() { if (isRoot) diff --git a/Assets/Scripts/StatsScript.cs b/Assets/Scripts/StatsScript.cs index c8e0571..be7e68e 100644 --- a/Assets/Scripts/StatsScript.cs +++ b/Assets/Scripts/StatsScript.cs @@ -8,9 +8,18 @@ public class StatsScript : MonoBehaviour Text? damageText; Text? movementSpeedText; Text? attackRangeText; + Text? difficultyText; public static StatsScript instance = default!; + public void UpdateDifficulty(float difficulty) + { + if (difficultyText != null) + { + difficultyText.text = difficulty.ToString("0.00"); + } + } + public void UpdateStats(PlayerBuffs buffs) { if (damageText != null) @@ -42,5 +51,6 @@ void Awake() damageText = transform.Find("Damage").GetComponent(); movementSpeedText = transform.Find("MovementSpeed").GetComponent(); attackRangeText = transform.Find("AttackRange").GetComponent(); + difficultyText = transform.Find("Difficulty").GetComponent(); } } From 29b0ba3fb6b97ee6151310c7b4bdcc176445c889 Mon Sep 17 00:00:00 2001 From: Lucas Coelho <58010418+LucasVinicius314@users.noreply.github.com> Date: Fri, 28 Oct 2022 12:03:37 -0300 Subject: [PATCH 2/5] Floating text de dano e buff, efeito sonoro de pegar buff, spawn do boss, cores --- Assets/Animations.meta | 8 + Assets/Animations/FloatingTextAnimation.anim | 295 ++++++++++++++++++ .../FloatingTextAnimation.anim.meta | 8 + .../FloatingTextAnimator.controller | 72 +++++ .../FloatingTextAnimator.controller.meta | 8 + Assets/Audio/gulp.mp3 | Bin 0 -> 7489 bytes Assets/Audio/gulp.mp3.meta | 22 ++ Assets/Prefabs/Buffs/HitPointBuff.prefab | 1 + Assets/Prefabs/Buffs/RangeBuff.prefab | 1 + Assets/Prefabs/Buffs/SpeedBuff.prefab | 1 + Assets/Prefabs/Enemies/Boss.prefab | 2 +- Assets/Prefabs/Enemies/Enemy.prefab | 2 +- Assets/Prefabs/FloatingText.prefab | 266 ++++++++++++++++ Assets/Prefabs/FloatingText.prefab.meta | 7 + Assets/Prefabs/Player.prefab | 12 +- Assets/Scenes/MainScene.unity | 5 +- Assets/Scripts/DropScript.cs | 52 ++- Assets/Scripts/FloatingTextScript.cs | 36 +++ Assets/Scripts/FloatingTextScript.cs.meta | 11 + Assets/Scripts/GameManagerScript.cs | 20 +- Assets/Scripts/Models/AudioSettings.cs | 6 + Assets/Scripts/PlayerScript.cs | 14 +- Assets/Scripts/RoomScript.cs | 99 +++--- Assets/Scripts/SoundManagerScript.cs | 13 + Assets/Scripts/Utils/Colors.cs | 22 ++ Assets/Scripts/Utils/Colors.cs.meta | 11 + README.md | 23 +- 27 files changed, 951 insertions(+), 66 deletions(-) create mode 100644 Assets/Animations.meta create mode 100644 Assets/Animations/FloatingTextAnimation.anim create mode 100644 Assets/Animations/FloatingTextAnimation.anim.meta create mode 100644 Assets/Animations/FloatingTextAnimator.controller create mode 100644 Assets/Animations/FloatingTextAnimator.controller.meta create mode 100644 Assets/Audio/gulp.mp3 create mode 100644 Assets/Audio/gulp.mp3.meta create mode 100644 Assets/Prefabs/FloatingText.prefab create mode 100644 Assets/Prefabs/FloatingText.prefab.meta create mode 100644 Assets/Scripts/FloatingTextScript.cs create mode 100644 Assets/Scripts/FloatingTextScript.cs.meta create mode 100644 Assets/Scripts/Utils/Colors.cs create mode 100644 Assets/Scripts/Utils/Colors.cs.meta diff --git a/Assets/Animations.meta b/Assets/Animations.meta new file mode 100644 index 0000000..a5addf8 --- /dev/null +++ b/Assets/Animations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 13eb702d3f0cbbd418ab2dd7b588e14b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/FloatingTextAnimation.anim b/Assets/Animations/FloatingTextAnimation.anim new file mode 100644 index 0000000..625d26e --- /dev/null +++ b/Assets/Animations/FloatingTextAnimation.anim @@ -0,0 +1,295 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FloatingTextAnimation + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 1, y: 1, z: 1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1 + value: {x: 0.2, y: 0.2, z: 0.2} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Text (Legacy) + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_AnchoredPosition.x + path: Text (Legacy) + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 50 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_AnchoredPosition.y + path: Text (Legacy) + classID: 224 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 3763599388 + attribute: 3 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 3763599388 + attribute: 538195251 + script: {fileID: 0} + typeID: 224 + customType: 28 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 3763599388 + attribute: 1460864421 + script: {fileID: 0} + typeID: 224 + customType: 28 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_AnchoredPosition.x + path: Text (Legacy) + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 50 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_AnchoredPosition.y + path: Text (Legacy) + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.2 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.x + path: Text (Legacy) + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.2 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.y + path: Text (Legacy) + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.2 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.z + path: Text (Legacy) + classID: 224 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Animations/FloatingTextAnimation.anim.meta b/Assets/Animations/FloatingTextAnimation.anim.meta new file mode 100644 index 0000000..37d5f74 --- /dev/null +++ b/Assets/Animations/FloatingTextAnimation.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 36a151da134da8e428d76d586653c6c0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/FloatingTextAnimator.controller b/Assets/Animations/FloatingTextAnimator.controller new file mode 100644 index 0000000..57d7bc0 --- /dev/null +++ b/Assets/Animations/FloatingTextAnimator.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-8752376183361602918 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FloatingTextAnimation + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 36a151da134da8e428d76d586653c6c0, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FloatingTextAnimator + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 255323769566786112} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &255323769566786112 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -8752376183361602918} + m_Position: {x: 50, y: 180, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -8752376183361602918} diff --git a/Assets/Animations/FloatingTextAnimator.controller.meta b/Assets/Animations/FloatingTextAnimator.controller.meta new file mode 100644 index 0000000..5eb5a7c --- /dev/null +++ b/Assets/Animations/FloatingTextAnimator.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28ee252a0c822fc49a1a90b24cb95abb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/gulp.mp3 b/Assets/Audio/gulp.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..28c443a2d4e2c89e668f2733fbb1ce998c5ca82e GIT binary patch literal 7489 zcmeHsXHb(-*KI-#)zGULAV8>wsuVRqfKa6*N|hcu(h*S!y(_(gl+e305s{8`se*uj z^o}Tqg2D&9`p*4z|J}JWckY@w^UOYZGC5g$pSAZsM-?ef2)Mv?v?^Nc{7G>>L?uK; z#UxDOa51#LzW(_H_&{AoLPR7s$CpvZb&Q51m?B?1Bv*}T_8u7tLMAk6)NU%nzllS$jY{(>XGl=AQ= z*GNyvLeFq*-_P*Z&ZnP%U2tHcbL*EU0RV?%CLI0TuU>QKc*m)_SLbd{0OV)bZBd9D zfJ5F8&<1CSWp<%~D{_E-(J?_OZ`^u zBfJ_}aMSP;)y)qqePqgr$nbA9GTdgelYAqrq z(hse#sVRCWFd8`)D`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`C750)91+@BhEsx#jXMQ>- zD!nohJ=xiw-Wf5?&zxp!wLUfd{$JN+Yj z{rX){eIhsIi0}=Ofs%?HkK|rxv>0#{4@sewz$z$1?`f+wYBE3R)r#^cYE$G60g0G? z7a$Yk45VQty~2tL3m_257eI&^zUJwr@&5p2-E>B&p$gD1g^OUSL}{p`*J--lAyc&C zmHlKDWhjIYlMc>{tI^b6TG&9gZ0O}r&oU`kv@GiJ%llrGcJL*&=V}kuc1aV2>xtHH zgWYFtj=nUovd7#iR!o|0y7{|z{=L)kkRGq!3Z_&G6Jp12XZH-fgDz|mPODUXV5A~a zI@og^-Q=8}aOm>1WOGMy(ng@^WwAOoUs7{PeOh(*)U(dl(|3m1w4-t9>}}J@d&9He z4>!A_ng)ElUdpum?JU$CD0j^LUOOax`ppZM@Ki^DK^LtF$(^XyCO?yR^=GI2XQgM` z|GhlIU@#Z8>>+^oj^W@RYcqlivd`~OxK}nLf4#l<>g65E`D_0l|F;-8JAqgY0|2jq e%Dm7Ek6a#;ou3=y*#Q8^g@ewI$^Or-?SBA;{;og( literal 0 HcmV?d00001 diff --git a/Assets/Audio/gulp.mp3.meta b/Assets/Audio/gulp.mp3.meta new file mode 100644 index 0000000..4e2c278 --- /dev/null +++ b/Assets/Audio/gulp.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: d9256230b21fa9649a81f9e8f8471858 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Buffs/HitPointBuff.prefab b/Assets/Prefabs/Buffs/HitPointBuff.prefab index b600502..8673eb8 100644 --- a/Assets/Prefabs/Buffs/HitPointBuff.prefab +++ b/Assets/Prefabs/Buffs/HitPointBuff.prefab @@ -56,6 +56,7 @@ MonoBehaviour: movementSpeedMultiplierBuff: 0 baseAttackRangeBuff: 0 attackRangeMultiplierBuff: 0 + buffTypes: 02000000 --- !u!54 &3578579234224482947 Rigidbody: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Buffs/RangeBuff.prefab b/Assets/Prefabs/Buffs/RangeBuff.prefab index 184dc94..60abee1 100644 --- a/Assets/Prefabs/Buffs/RangeBuff.prefab +++ b/Assets/Prefabs/Buffs/RangeBuff.prefab @@ -88,6 +88,7 @@ MonoBehaviour: movementSpeedMultiplierBuff: 0 baseAttackRangeBuff: 0.01 attackRangeMultiplierBuff: 0.02 + buffTypes: 0000000001000000 --- !u!54 &6724353180413059167 Rigidbody: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Buffs/SpeedBuff.prefab b/Assets/Prefabs/Buffs/SpeedBuff.prefab index 9721e78..8fa30ab 100644 --- a/Assets/Prefabs/Buffs/SpeedBuff.prefab +++ b/Assets/Prefabs/Buffs/SpeedBuff.prefab @@ -56,6 +56,7 @@ MonoBehaviour: movementSpeedMultiplierBuff: 0.01 baseAttackRangeBuff: 0 attackRangeMultiplierBuff: 0 + buffTypes: 03000000 --- !u!54 &4227791301383778843 Rigidbody: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Enemies/Boss.prefab b/Assets/Prefabs/Enemies/Boss.prefab index 3065b17..e425f3b 100644 --- a/Assets/Prefabs/Enemies/Boss.prefab +++ b/Assets/Prefabs/Enemies/Boss.prefab @@ -117,7 +117,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4e8ee19c6594fb44995e9be99b792976, type: 3} m_Name: m_EditorClassIdentifier: - initialHitPoints: 300 + initialHitPoints: 1000 maxRange: 5 minRange: 0 enemyType: 0 diff --git a/Assets/Prefabs/Enemies/Enemy.prefab b/Assets/Prefabs/Enemies/Enemy.prefab index a9d71ee..3438465 100644 --- a/Assets/Prefabs/Enemies/Enemy.prefab +++ b/Assets/Prefabs/Enemies/Enemy.prefab @@ -152,7 +152,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: initialHitPoints: 50 - maxRange: 1 + maxRange: 2 minRange: 0 enemyType: 0 deathEffectPrefab: {fileID: 1390118265774136416, guid: a17030364649a5944926716399bd79f7, type: 3} diff --git a/Assets/Prefabs/FloatingText.prefab b/Assets/Prefabs/FloatingText.prefab new file mode 100644 index 0000000..94dc655 --- /dev/null +++ b/Assets/Prefabs/FloatingText.prefab @@ -0,0 +1,266 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &447568330374579020 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5324389711825702197} + - component: {fileID: 2104627390132447484} + - component: {fileID: 912684518070665534} + - component: {fileID: 5236096453491067154} + m_Layer: 5 + m_Name: Text (Legacy) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5324389711825702197 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 447568330374579020} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4825974650470439566} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2104627390132447484 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 447568330374579020} + m_CullTransparentMesh: 1 +--- !u!114 &912684518070665534 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 447568330374579020} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8745098, g: 0.16078432, b: 0.20784314, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 0e446559229638f448d0706b0656bbe0, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 0 +--- !u!114 &5236096453491067154 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 447568330374579020} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 1, g: 1, b: 1, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!1 &1907699245600943604 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4825974650470439566} + - component: {fileID: 8532543957740818481} + - component: {fileID: 2814400045687422827} + - component: {fileID: 1739560474030555045} + - component: {fileID: 3460573454964742793} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4825974650470439566 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1907699245600943604} + m_LocalRotation: {x: -0, y: -0.9999999, z: -0, w: 0.00050868094} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5324389711825702197} + m_Father: {fileID: 5964903305613226832} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: -179.942, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 300, y: 40} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &8532543957740818481 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1907699245600943604} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &2814400045687422827 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1907699245600943604} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!114 &1739560474030555045 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1907699245600943604} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!95 &3460573454964742793 +Animator: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1907699245600943604} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 28ee252a0c822fc49a1a90b24cb95abb, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &5964903305613226833 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5964903305613226832} + - component: {fileID: 5353872678894379532} + m_Layer: 0 + m_Name: FloatingText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5964903305613226832 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5964903305613226833} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.015, y: 0.015, z: 0.015} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 4825974650470439566} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5353872678894379532 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5964903305613226833} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aba2804828b61574888daf5fc0f669ce, type: 3} + m_Name: + m_EditorClassIdentifier: + text: {fileID: 912684518070665534} diff --git a/Assets/Prefabs/FloatingText.prefab.meta b/Assets/Prefabs/FloatingText.prefab.meta new file mode 100644 index 0000000..d32085d --- /dev/null +++ b/Assets/Prefabs/FloatingText.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3e6770ff9b5bcea4890640572be4507b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 916c1a4..95ff09f 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -413,8 +413,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fb6a582212765b040a4042927b8af493, type: 3} m_Name: m_EditorClassIdentifier: - hitPoints: 0 - initialHitPoints: 100 --- !u!114 &-3976935303735240655 MonoBehaviour: m_ObjectHideFlags: 0 @@ -680,15 +678,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 207563730290847909, guid: 759c6a17a9b0f46478c36ce23600fce4, type: 3} propertyPath: m_LocalScale.x - value: 0.015 + value: 0.008 objectReference: {fileID: 0} - target: {fileID: 207563730290847909, guid: 759c6a17a9b0f46478c36ce23600fce4, type: 3} propertyPath: m_LocalScale.y - value: 0.015 + value: 0.008 objectReference: {fileID: 0} - target: {fileID: 207563730290847909, guid: 759c6a17a9b0f46478c36ce23600fce4, type: 3} propertyPath: m_LocalScale.z - value: 0.015 + value: 0.008 objectReference: {fileID: 0} - target: {fileID: 207563730290847909, guid: 759c6a17a9b0f46478c36ce23600fce4, type: 3} propertyPath: m_LocalPosition.x @@ -738,6 +736,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 207563730290847909, guid: 759c6a17a9b0f46478c36ce23600fce4, type: 3} + propertyPath: m_ConstrainProportionsScale + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9132880458430860385, guid: 759c6a17a9b0f46478c36ce23600fce4, type: 3} propertyPath: m_LocalRotation.w value: 0 diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index f8c1de6..329705f 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -739,6 +739,7 @@ MonoBehaviour: chance: 0.25 - prefab: {fileID: 6724353180413059161, guid: f1a5ddd8653b52941b34911e403e9c05, type: 3} chance: 0.24 + floatingTextPrefab: {fileID: 5964903305613226833, guid: 3e6770ff9b5bcea4890640572be4507b, type: 3} isNavMeshBaked: 0 currentRoom: {fileID: 0} --- !u!114 &1524951598 @@ -785,6 +786,8 @@ MonoBehaviour: m_EditorClassIdentifier: musicAudioSource: {fileID: 1524951600} audioSettings: + gulpAudioClips: + - {fileID: 8300000, guid: d9256230b21fa9649a81f9e8f8471858, type: 3} npcDeathAudioClips: - {fileID: 8300000, guid: a31a2fe54b0256647b35682b2de79aac, type: 3} - {fileID: 8300000, guid: 2204296455ff86a47b5d3b7dff7317bf, type: 3} @@ -1534,7 +1537,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2932101238397256823, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} propertyPath: m_AnchoredPosition.y - value: 637.7245 + value: 756.13184 objectReference: {fileID: 0} - target: {fileID: 2932101238483661021, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} propertyPath: m_AnchorMax.x diff --git a/Assets/Scripts/DropScript.cs b/Assets/Scripts/DropScript.cs index b124266..2253283 100644 --- a/Assets/Scripts/DropScript.cs +++ b/Assets/Scripts/DropScript.cs @@ -1,17 +1,30 @@ +using System.Collections.Generic; using UnityEngine; #nullable enable +public enum BuffType +{ + attackRange, + damage, + hitpoints, + movementSpeed, +} + public class DropScript : MonoBehaviour { [SerializeField] PlayerBuffs playerBuffs = default!; + [SerializeField] + List buffTypes = new List(); void OnCollisionEnter(Collision collision) { if (collision.collider.name == "DropCollider") { - var playerScript = GameManagerScript.instance?.GetPlayerScript; + var manager = GameManagerScript.instance; + + var playerScript = manager?.GetPlayerScript; if (playerScript != null) { @@ -27,6 +40,43 @@ void OnCollisionEnter(Collision collision) buffs.attackRangeMultiplierBuff += playerBuffs.attackRangeMultiplierBuff; playerScript.TriggerUpdateStats(); + + int index = 0; + foreach (var item in buffTypes) + { + var text = ""; + var color = Color.white; + + switch (item) + { + case BuffType.attackRange: + text = "+ Alcance"; + color = Colors.spanishGreen; + break; + case BuffType.damage: + text = "+ Dano"; + color = Colors.orangePantone; + break; + case BuffType.hitpoints: + text = "+ Vida"; + color = Colors.roseMadder; + break; + case BuffType.movementSpeed: + text = "+ Velocidade"; + color = Colors.blueCrayola; + break; + } + + manager?.SpawnFloatingText( + transform.position + Vector3.up * index * .3f, + text, + color + ); + + SoundManagerScript.instance.PlayGulp(); + + index++; + } } Destroy(gameObject); diff --git a/Assets/Scripts/FloatingTextScript.cs b/Assets/Scripts/FloatingTextScript.cs new file mode 100644 index 0000000..e0acaed --- /dev/null +++ b/Assets/Scripts/FloatingTextScript.cs @@ -0,0 +1,36 @@ +using UnityEngine; +using UnityEngine.UI; + +#nullable enable + +public class FloatingTextScript : MonoBehaviour +{ + [SerializeField] + Text? text; + + public void UpdateColor(Color color) + { + if (text != null) + { + text.color = color; + } + } + + public void UpdateText(string newText) + { + if (text != null) + { + text.text = newText; + } + } + + void LateUpdate() + { + transform.LookAt(Camera.main.transform); + } + + void Start() + { + Destroy(gameObject, 1.1f); + } +} diff --git a/Assets/Scripts/FloatingTextScript.cs.meta b/Assets/Scripts/FloatingTextScript.cs.meta new file mode 100644 index 0000000..e82f6a8 --- /dev/null +++ b/Assets/Scripts/FloatingTextScript.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aba2804828b61574888daf5fc0f669ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GameManagerScript.cs b/Assets/Scripts/GameManagerScript.cs index 05981cd..03b3d56 100644 --- a/Assets/Scripts/GameManagerScript.cs +++ b/Assets/Scripts/GameManagerScript.cs @@ -12,6 +12,8 @@ public class GameManagerScript : MonoBehaviour EnemySpawnSettings enemySpawnSettings = default!; [SerializeField] EnemyDropSettings enemyDropSettings = default!; + [SerializeField] + GameObject? floatingTextPrefab; public bool isNavMeshBaked = false; @@ -56,7 +58,7 @@ public class GameManagerScript : MonoBehaviour public void AttemptEnemySpawn() { - // TODO: Terminar spawn do boss + currentRoom?.GetComponent()?.UpdateDifficulty(); if (currentRoom == null || visitedRooms.Contains(currentRoom)) { @@ -150,6 +152,22 @@ public void KillEnemy(GameObject enemy) Destroy(enemy); } + public void SpawnFloatingText(Vector3 position, string text, Color? color) + { + if (floatingTextPrefab != null) + { + var script = Instantiate(floatingTextPrefab, position + Vector3.up, Quaternion.identity) + .GetComponent(); + + script.UpdateText(text); + + if (color != null) + { + script.UpdateColor((Color)color!); + } + } + } + void Awake() { instance = this; diff --git a/Assets/Scripts/Models/AudioSettings.cs b/Assets/Scripts/Models/AudioSettings.cs index ff7601a..df05e91 100644 --- a/Assets/Scripts/Models/AudioSettings.cs +++ b/Assets/Scripts/Models/AudioSettings.cs @@ -6,10 +6,16 @@ [System.Serializable] class AudioSettings { + public List gulpAudioClips = default!; public List npcDeathAudioClips = default!; public List swordHitAudioClips = default!; public List swordSwingAudioClips = default!; + public AudioClip GetRandomGulpAudioClip() + { + return gulpAudioClips[Random.Range(0, gulpAudioClips.Count)]; + } + public AudioClip GetRandomNpcDeathAudioClip() { return npcDeathAudioClips[Random.Range(0, npcDeathAudioClips.Count)]; diff --git a/Assets/Scripts/PlayerScript.cs b/Assets/Scripts/PlayerScript.cs index f585d6e..f78e564 100644 --- a/Assets/Scripts/PlayerScript.cs +++ b/Assets/Scripts/PlayerScript.cs @@ -213,9 +213,17 @@ void HandleAttack() if (enemyScript != null) { - enemyDied = enemyScript.InflictDamage( - playerBuffs.baseDamageBuff * playerBuffs.damageMultiplierBuff - ); + var damage = + playerBuffs.baseDamageBuff * playerBuffs.damageMultiplierBuff; + + enemyDied = enemyScript.InflictDamage(damage); + + GameManagerScript.instance + .SpawnFloatingText( + collider.transform.position, + damage.ToString("0"), + null + ); } if (enemyDied) diff --git a/Assets/Scripts/RoomScript.cs b/Assets/Scripts/RoomScript.cs index 93cf493..0716c91 100644 --- a/Assets/Scripts/RoomScript.cs +++ b/Assets/Scripts/RoomScript.cs @@ -238,69 +238,84 @@ public void SpawnEnemies() settings.difficultyIndexWeight * settings.difficultyCurve.Evaluate(difficultyIndex / 20); - StatsScript.instance.UpdateDifficulty(difficultyIndex); - Debug.Log( $"Current room difficulty: {difficultyIndex}: {batchSize} enemies." ); + if (roomType == RoomType.boss) + { + var bossPrefab = settings.bossPrefab; + + SpawnEnemy(prefab: bossPrefab, manager: manager); + } + for (int i = 0; i < batchSize; i++) { var prefab = settings.GetRandomEnemyPrefab(); - var tries = 0; + SpawnEnemy(prefab: prefab, manager: manager); + } + } - while (true) - { - tries++; + void SpawnEnemy(GameObject prefab, GameManagerScript manager) + { + var tries = 0; - // Sistema de segurança para não cair em loop. - if (tries > 10) - { - break; - } + while (true) + { + tries++; - var vector2 = Random.insideUnitCircle * 10f; + // Sistema de segurança para não cair em loop. + if (tries > 10) + { + break; + } - var position = new Vector3( - x: vector2.x + transform.position.x, - y: 4f, - z: vector2.y + transform.position.z - ); + var vector2 = Random.insideUnitCircle * 10f; - RaycastHit hit; - if ( - !Physics.Raycast( - position, - Vector3.down, - out hit, - 10f, - Layers.geometryMask - ) + var position = new Vector3( + x: vector2.x + transform.position.x, + y: 4f, + z: vector2.y + transform.position.z + ); + + RaycastHit hit; + if ( + !Physics.Raycast( + position, + Vector3.down, + out hit, + 10f, + Layers.geometryMask ) - { - continue; - } + ) + { + continue; + } - // Não deixar o inimigo spawnar em cima de paredes. - if (hit.point.y > 1f) - { - continue; - } + // Não deixar o inimigo spawnar em cima de paredes. + if (hit.point.y > 1f) + { + continue; + } - var enemy = Instantiate( - prefab, - hit.point, - Quaternion.identity - ); + var enemy = Instantiate( + prefab, + hit.point, + Quaternion.identity + ); - manager.GetEnemies.Add(enemy); + manager.GetEnemies.Add(enemy); - break; - } + break; } } + public void UpdateDifficulty() + { + StatsScript.instance.UpdateDifficulty(difficultyIndex); + } + void Awake() { difficultyIndex = transform.position.magnitude; diff --git a/Assets/Scripts/SoundManagerScript.cs b/Assets/Scripts/SoundManagerScript.cs index 1e3e195..13b4c0e 100644 --- a/Assets/Scripts/SoundManagerScript.cs +++ b/Assets/Scripts/SoundManagerScript.cs @@ -14,6 +14,19 @@ public class SoundManagerScript : MonoBehaviour AudioSource? audioSource; + public void PlayGulp() + { + var volume = LocalPrefs.GetSFXVolume(); + + if (audioSource != null) + { + audioSource.PlayOneShot( + audioSettings.GetRandomGulpAudioClip(), + volume + ); + } + } + public void PlayNpcDeath() { var volume = LocalPrefs.GetSFXVolume(); diff --git a/Assets/Scripts/Utils/Colors.cs b/Assets/Scripts/Utils/Colors.cs new file mode 100644 index 0000000..cc88300 --- /dev/null +++ b/Assets/Scripts/Utils/Colors.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +#nullable enable + +public static class Colors +{ + public static Color jet = Parse("#2A2826"); + public static Color roseMadder = Parse("#Df2935"); + public static Color blueCrayola = Parse("#3772FF"); + public static Color sunglow = Parse("#FDCA40"); + public static Color spanishGreen = Parse("#018E42"); + public static Color orangePantone = Parse("#FE5F00"); + + static Color Parse(string hex) + { + Color color; + + ColorUtility.TryParseHtmlString(hex, out color); + + return color; + } +} diff --git a/Assets/Scripts/Utils/Colors.cs.meta b/Assets/Scripts/Utils/Colors.cs.meta new file mode 100644 index 0000000..c258770 --- /dev/null +++ b/Assets/Scripts/Utils/Colors.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 08cce4d1671e4434291fd55f6e6629fd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md b/README.md index 706306a..6922e82 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,17 @@ -* [About](#about) -* [Built With](#built-with) -* [Getting Started](#getting-started) - + [Prerequisites](#prerequisites) -* [Resources](#resources) -* [License](#license) -* [Credits](#credits) - + [Music](#music) - + [SFX](#sfx) - + [Background](#background) -* [Members](#members) +- [About](#about) +- [Built With](#built-with) +- [Getting Started](#getting-started) + - [Prerequisites](#prerequisites) +- [Resources](#resources) +- [License](#license) +- [Credits](#credits) + - [Music](#music) + - [SFX](#sfx) + - [Background](#background) +- [Members](#members) ## About @@ -82,6 +82,7 @@ Special thanks to [prod. ayc](https://www.youtube.com/channel/UC06oKQ_VOHjSXtXnU * https://freesound.org/people/tonsil5/sounds/555411/ * https://freesound.org/people/scorpion67890/sounds/614315/ * https://freesound.org/people/spookymodem/sounds/249813/ +* https://freesound.org/people/swordofkings128/sounds/397611/ ### Background From 8f4b200e3259019ece69edf543a3535e03238af1 Mon Sep 17 00:00:00 2001 From: Lucas Coelho <58010418+LucasVinicius314@users.noreply.github.com> Date: Fri, 28 Oct 2022 12:34:44 -0300 Subject: [PATCH 3/5] =?UTF-8?q?Hit=20marker,=20ajustes=20nos=20proj=C3=A9t?= =?UTF-8?q?eis,=20build=20experimental=20de=20attack=20speed=20ranged?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Audio/hit-marker.mp3 | Bin 0 -> 2263 bytes Assets/Audio/hit-marker.mp3.meta | 22 ++++++++++++++++++++++ Assets/Prefabs/Enemies/Enemy.prefab | 2 +- Assets/Prefabs/Enemies/RangedEnemy.prefab | 4 ++-- Assets/Prefabs/MobileProjectile.prefab | 5 +++-- Assets/Prefabs/Player.prefab | 2 +- Assets/Prefabs/Projectile.prefab | 5 +++-- Assets/Scenes/MainScene.unity | 4 +++- Assets/Scripts/MinimapScript.cs | 1 - Assets/Scripts/Models/AudioSettings.cs | 6 ++++++ Assets/Scripts/PlayerScript.cs | 8 ++++++++ Assets/Scripts/ProjectileScript.cs | 6 +++++- Assets/Scripts/RoomScript.cs | 1 - Assets/Scripts/SoundManagerScript.cs | 13 +++++++++++++ 14 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 Assets/Audio/hit-marker.mp3 create mode 100644 Assets/Audio/hit-marker.mp3.meta diff --git a/Assets/Audio/hit-marker.mp3 b/Assets/Audio/hit-marker.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..fdbc8edcb363c116426178c468704d7215629923 G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wDVSxZA! zO_63!$l+~>Ugww1Hvj+OC^rz8e>ijI z%+~+^R;}7?TEA-5y{$X}8&7WlgN+Lv9bFwABe={L?6DFE2ncWGg%`k~qkyCk`2RZ~ oR3oJaDWv90BFBBKmY&$ literal 0 HcmV?d00001 diff --git a/Assets/Audio/hit-marker.mp3.meta b/Assets/Audio/hit-marker.mp3.meta new file mode 100644 index 0000000..f23e069 --- /dev/null +++ b/Assets/Audio/hit-marker.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: fe20883c957e3c047811ee785915fdc3 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Enemies/Enemy.prefab b/Assets/Prefabs/Enemies/Enemy.prefab index 3438465..b01c5b1 100644 --- a/Assets/Prefabs/Enemies/Enemy.prefab +++ b/Assets/Prefabs/Enemies/Enemy.prefab @@ -152,7 +152,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: initialHitPoints: 50 - maxRange: 2 + maxRange: 1.7 minRange: 0 enemyType: 0 deathEffectPrefab: {fileID: 1390118265774136416, guid: a17030364649a5944926716399bd79f7, type: 3} diff --git a/Assets/Prefabs/Enemies/RangedEnemy.prefab b/Assets/Prefabs/Enemies/RangedEnemy.prefab index d068123..7d20c2a 100644 --- a/Assets/Prefabs/Enemies/RangedEnemy.prefab +++ b/Assets/Prefabs/Enemies/RangedEnemy.prefab @@ -138,8 +138,8 @@ MonoBehaviour: projectilePrefab: {fileID: 6122725168259043706, guid: 39884e848128ee84b922aad6a24877c4, type: 3} mobileProjectilePrefab: {fileID: 4802643116889572473, guid: 3a11f9dbbd4a23d4db2b2401bd79afa2, type: 3} attackPoint: {fileID: 4625630236950262534} - secondsBeteweenAttacks: 1 - projectileForce: 5 + secondsBeteweenAttacks: 0.05 + projectileForce: 20 --- !u!1 &7070262502191703618 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/MobileProjectile.prefab b/Assets/Prefabs/MobileProjectile.prefab index 83d8296..577a46b 100644 --- a/Assets/Prefabs/MobileProjectile.prefab +++ b/Assets/Prefabs/MobileProjectile.prefab @@ -105,8 +105,8 @@ Transform: m_GameObject: {fileID: 4802643116889572473} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_ConstrainProportionsScale: 1 m_Children: - {fileID: 7568223880189098785} - {fileID: 1366430865760550512} @@ -142,6 +142,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fd4b2615f25f5314aa86f1937ebc1f2a, type: 3} m_Name: m_EditorClassIdentifier: + damage: 1 --- !u!1 &7043519708395930104 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 95ff09f..ae9bd73 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -396,7 +396,7 @@ CharacterController: serializedVersion: 2 m_Height: 2 m_Radius: 0.5 - m_SlopeLimit: 45 + m_SlopeLimit: 5.79 m_StepOffset: 0.3 m_SkinWidth: 0.08 m_MinMoveDistance: 0.001 diff --git a/Assets/Prefabs/Projectile.prefab b/Assets/Prefabs/Projectile.prefab index 8179820..b767cfe 100644 --- a/Assets/Prefabs/Projectile.prefab +++ b/Assets/Prefabs/Projectile.prefab @@ -199,8 +199,8 @@ Transform: m_GameObject: {fileID: 6122725168259043706} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_ConstrainProportionsScale: 1 m_Children: - {fileID: 9176537122068082210} - {fileID: 335704814497852275} @@ -237,6 +237,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fd4b2615f25f5314aa86f1937ebc1f2a, type: 3} m_Name: m_EditorClassIdentifier: + damage: 1 --- !u!1 &8638391970917913851 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index 329705f..ec6a74c 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -788,6 +788,8 @@ MonoBehaviour: audioSettings: gulpAudioClips: - {fileID: 8300000, guid: d9256230b21fa9649a81f9e8f8471858, type: 3} + hitMarkerAudioClips: + - {fileID: 8300000, guid: fe20883c957e3c047811ee785915fdc3, type: 3} npcDeathAudioClips: - {fileID: 8300000, guid: a31a2fe54b0256647b35682b2de79aac, type: 3} - {fileID: 8300000, guid: 2204296455ff86a47b5d3b7dff7317bf, type: 3} @@ -1537,7 +1539,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2932101238397256823, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} propertyPath: m_AnchoredPosition.y - value: 756.13184 + value: 637.7245 objectReference: {fileID: 0} - target: {fileID: 2932101238483661021, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} propertyPath: m_AnchorMax.x diff --git a/Assets/Scripts/MinimapScript.cs b/Assets/Scripts/MinimapScript.cs index 2e851c4..a61d615 100644 --- a/Assets/Scripts/MinimapScript.cs +++ b/Assets/Scripts/MinimapScript.cs @@ -91,7 +91,6 @@ public void Layout(RoomNetwork network) lineRenderer.color = new Color(0.6f, 0.6f, 0.6f); lineRenderer.LineThickness = 6f; - // TODO: Colocar mask em volta dos ícones lineRenderer.Points = new Vector2[]{ Vector2.zero, diff diff --git a/Assets/Scripts/Models/AudioSettings.cs b/Assets/Scripts/Models/AudioSettings.cs index df05e91..3bdd788 100644 --- a/Assets/Scripts/Models/AudioSettings.cs +++ b/Assets/Scripts/Models/AudioSettings.cs @@ -7,6 +7,7 @@ class AudioSettings { public List gulpAudioClips = default!; + public List hitMarkerAudioClips = default!; public List npcDeathAudioClips = default!; public List swordHitAudioClips = default!; public List swordSwingAudioClips = default!; @@ -16,6 +17,11 @@ public AudioClip GetRandomGulpAudioClip() return gulpAudioClips[Random.Range(0, gulpAudioClips.Count)]; } + public AudioClip GetRandomHitMarkerAudioClip() + { + return hitMarkerAudioClips[Random.Range(0, hitMarkerAudioClips.Count)]; + } + public AudioClip GetRandomNpcDeathAudioClip() { return npcDeathAudioClips[Random.Range(0, npcDeathAudioClips.Count)]; diff --git a/Assets/Scripts/PlayerScript.cs b/Assets/Scripts/PlayerScript.cs index f78e564..72dd3f5 100644 --- a/Assets/Scripts/PlayerScript.cs +++ b/Assets/Scripts/PlayerScript.cs @@ -421,6 +421,14 @@ public void TakeDamage(float damage) { var newHitPoints = playerBuffs.baseHitPoints - damage; + GameManagerScript.instance.SpawnFloatingText( + transform.position, + damage.ToString("- 0"), + Colors.roseMadder + ); + + SoundManagerScript.instance.PlayHitMarker(); + if (newHitPoints <= 0) { Die(); diff --git a/Assets/Scripts/ProjectileScript.cs b/Assets/Scripts/ProjectileScript.cs index e88ce43..dabb4d1 100644 --- a/Assets/Scripts/ProjectileScript.cs +++ b/Assets/Scripts/ProjectileScript.cs @@ -4,6 +4,10 @@ public class ProjectileScript : MonoBehaviour { + [SerializeField] + [Min(0f)] + float damage = 10f; + void Despawn() { gameObject.SetActive(false); @@ -25,7 +29,7 @@ void OnCollisionEnter(Collision collision) { Despawn(); - GameManagerScript.instance.GetPlayerScript?.TakeDamage(10f); + GameManagerScript.instance.GetPlayerScript?.TakeDamage(damage); } } } diff --git a/Assets/Scripts/RoomScript.cs b/Assets/Scripts/RoomScript.cs index 0716c91..3fb2575 100644 --- a/Assets/Scripts/RoomScript.cs +++ b/Assets/Scripts/RoomScript.cs @@ -106,7 +106,6 @@ void GenerateDeadEnd(GameObject attachment) } } - // TODO: Trabalhar probabilidade de geração de cada attachment. if (Random.value > 0.2f) { GenerateDeadEnd(attachment: attachment); diff --git a/Assets/Scripts/SoundManagerScript.cs b/Assets/Scripts/SoundManagerScript.cs index 13b4c0e..e39b6c3 100644 --- a/Assets/Scripts/SoundManagerScript.cs +++ b/Assets/Scripts/SoundManagerScript.cs @@ -27,6 +27,19 @@ public void PlayGulp() } } + public void PlayHitMarker() + { + var volume = LocalPrefs.GetSFXVolume(); + + if (audioSource != null) + { + audioSource.PlayOneShot( + audioSettings.GetRandomHitMarkerAudioClip(), + volume + ); + } + } + public void PlayNpcDeath() { var volume = LocalPrefs.GetSFXVolume(); From 810aec90e448cae60ac9e36a890025345acdf2df Mon Sep 17 00:00:00 2001 From: Lucas Coelho <58010418+LucasVinicius314@users.noreply.github.com> Date: Fri, 28 Oct 2022 13:36:08 -0300 Subject: [PATCH 4/5] Tamanho da hotbar desktop --- Assets/Prefabs/Enemies/RangedEnemy.prefab | 4 ++-- Assets/Scripts/GameManagerScript.cs | 13 +++++++++++++ .../Scripts/UI Scripts/StaticInventoryDisplay.cs | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Assets/Prefabs/Enemies/RangedEnemy.prefab b/Assets/Prefabs/Enemies/RangedEnemy.prefab index 7d20c2a..14c52ab 100644 --- a/Assets/Prefabs/Enemies/RangedEnemy.prefab +++ b/Assets/Prefabs/Enemies/RangedEnemy.prefab @@ -138,8 +138,8 @@ MonoBehaviour: projectilePrefab: {fileID: 6122725168259043706, guid: 39884e848128ee84b922aad6a24877c4, type: 3} mobileProjectilePrefab: {fileID: 4802643116889572473, guid: 3a11f9dbbd4a23d4db2b2401bd79afa2, type: 3} attackPoint: {fileID: 4625630236950262534} - secondsBeteweenAttacks: 0.05 - projectileForce: 20 + secondsBeteweenAttacks: 0.7 + projectileForce: 10 --- !u!1 &7070262502191703618 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/GameManagerScript.cs b/Assets/Scripts/GameManagerScript.cs index 03b3d56..9bc6424 100644 --- a/Assets/Scripts/GameManagerScript.cs +++ b/Assets/Scripts/GameManagerScript.cs @@ -145,6 +145,14 @@ void HandleConfigInitialization() } } + void HandleStartConfigInitialization() + { + if (!Application.isMobilePlatform) + { + StaticInventoryDisplay.instance.SetHotbarSizeDesktop(); + } + } + public void KillEnemy(GameObject enemy) { enemies.Remove(enemy); @@ -188,6 +196,11 @@ void OnGUI() GUI.Label(new Rect(100, 36, 100, 20), $"Enemies alive: {enemies.Count}"); } + void Start() + { + HandleStartConfigInitialization(); + } + void Update() { #if UNITY_EDITOR diff --git a/Assets/Scripts/UI Scripts/StaticInventoryDisplay.cs b/Assets/Scripts/UI Scripts/StaticInventoryDisplay.cs index bacf546..359ec2d 100644 --- a/Assets/Scripts/UI Scripts/StaticInventoryDisplay.cs +++ b/Assets/Scripts/UI Scripts/StaticInventoryDisplay.cs @@ -6,6 +6,22 @@ public class StaticInventoryDisplay : InventoryDisplay { [SerializeField] private InventoryHolder inventoryHolder; [SerializeField] private InventorySlot_UI[] slots; + + public static StaticInventoryDisplay instance = default!; + + public void SetHotbarSizeDesktop() + { + var rect = (RectTransform)transform; + + rect.localScale = Vector3.one * .5f; + rect.Translate(Vector3.down * 50); + } + + void Awake() + { + instance = this; + } + protected override void Start() { base.Start(); From c2b060625c005aca4ae7570085181d9786c0c83e Mon Sep 17 00:00:00 2001 From: Lucas Coelho <58010418+LucasVinicius314@users.noreply.github.com> Date: Fri, 28 Oct 2022 13:54:11 -0300 Subject: [PATCH 5/5] Dificuldade da sala do boss --- Assets/Prefabs/Enemies/RangedEnemy.prefab | 2 +- Assets/Prefabs/MobileProjectile.prefab | 2 +- Assets/Prefabs/Projectile.prefab | 2 +- Assets/Scenes/MainScene.unity | 2 +- Assets/Scripts/RoomScript.cs | 10 ++++++++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Assets/Prefabs/Enemies/RangedEnemy.prefab b/Assets/Prefabs/Enemies/RangedEnemy.prefab index 14c52ab..b8e1039 100644 --- a/Assets/Prefabs/Enemies/RangedEnemy.prefab +++ b/Assets/Prefabs/Enemies/RangedEnemy.prefab @@ -139,7 +139,7 @@ MonoBehaviour: mobileProjectilePrefab: {fileID: 4802643116889572473, guid: 3a11f9dbbd4a23d4db2b2401bd79afa2, type: 3} attackPoint: {fileID: 4625630236950262534} secondsBeteweenAttacks: 0.7 - projectileForce: 10 + projectileForce: 6 --- !u!1 &7070262502191703618 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/MobileProjectile.prefab b/Assets/Prefabs/MobileProjectile.prefab index 577a46b..aee3819 100644 --- a/Assets/Prefabs/MobileProjectile.prefab +++ b/Assets/Prefabs/MobileProjectile.prefab @@ -142,7 +142,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fd4b2615f25f5314aa86f1937ebc1f2a, type: 3} m_Name: m_EditorClassIdentifier: - damage: 1 + damage: 5 --- !u!1 &7043519708395930104 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Projectile.prefab b/Assets/Prefabs/Projectile.prefab index b767cfe..83c825a 100644 --- a/Assets/Prefabs/Projectile.prefab +++ b/Assets/Prefabs/Projectile.prefab @@ -237,7 +237,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fd4b2615f25f5314aa86f1937ebc1f2a, type: 3} m_Name: m_EditorClassIdentifier: - damage: 1 + damage: 5 --- !u!1 &8638391970917913851 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index ec6a74c..229e9b1 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -1539,7 +1539,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2932101238397256823, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} propertyPath: m_AnchoredPosition.y - value: 637.7245 + value: 645.7085 objectReference: {fileID: 0} - target: {fileID: 2932101238483661021, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3} propertyPath: m_AnchorMax.x diff --git a/Assets/Scripts/RoomScript.cs b/Assets/Scripts/RoomScript.cs index 3fb2575..9db9afb 100644 --- a/Assets/Scripts/RoomScript.cs +++ b/Assets/Scripts/RoomScript.cs @@ -235,7 +235,7 @@ public void SpawnEnemies() var batchSize = settings.spawnBatchSize * settings.difficultyIndexWeight * - settings.difficultyCurve.Evaluate(difficultyIndex / 20); + settings.difficultyCurve.Evaluate(difficultyIndex / 20f); Debug.Log( $"Current room difficulty: {difficultyIndex}: {batchSize} enemies." @@ -317,7 +317,13 @@ public void UpdateDifficulty() void Awake() { - difficultyIndex = transform.position.magnitude; + var magnitude = transform.position.magnitude; + + var newDifficultyIndex = roomType == RoomType.boss + ? magnitude * 2f + 200f + : magnitude; + + difficultyIndex = newDifficultyIndex; } void Start()