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] =?UTF-8?q?Hit=20marker,=20ajustes=20nos=20proj=C3=A9teis,?= =?UTF-8?q?=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 GIT binary patch literal 2263 zcmeZtF=l1}0!HRvLmY^M^V3So6N^$Ad=ksjOpW!7jr0r+44?`GfeLaHv+|4L zlZq1aQW$azOpKsX0wAf(JfKurYEf}!ejWo%lQd8!IX|}`u_QAoCl#Wzm?5(`KNm^6 z5>SzAUUGg)W?s5NNoH;;gOP!uiLQaAu93Ndp|O>Lft8WL|KAf*fa>sq2%rH#1^hq^ z^c;s8Lj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+++ 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();