diff --git a/Assets/Audio/hit-marker.mp3 b/Assets/Audio/hit-marker.mp3 new file mode 100644 index 0000000..fdbc8ed Binary files /dev/null and b/Assets/Audio/hit-marker.mp3 differ 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();