Skip to content

Commit

Permalink
Hit marker, ajustes nos projéteis, build experimental de attack speed…
Browse files Browse the repository at this point in the history
… ranged
  • Loading branch information
LucasVinicius314 committed Oct 28, 2022
1 parent 29b0ba3 commit 8f4b200
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 12 deletions.
Binary file added Assets/Audio/hit-marker.mp3
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Audio/hit-marker.mp3.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Prefabs/Enemies/Enemy.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions Assets/Prefabs/Enemies/RangedEnemy.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions Assets/Prefabs/MobileProjectile.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Assets/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions Assets/Prefabs/Projectile.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scenes/MainScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Assets/Scripts/MinimapScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions Assets/Scripts/Models/AudioSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class AudioSettings
{
public List<AudioClip> gulpAudioClips = default!;
public List<AudioClip> hitMarkerAudioClips = default!;
public List<AudioClip> npcDeathAudioClips = default!;
public List<AudioClip> swordHitAudioClips = default!;
public List<AudioClip> swordSwingAudioClips = default!;
Expand All @@ -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)];
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/PlayerScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion Assets/Scripts/ProjectileScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

public class ProjectileScript : MonoBehaviour
{
[SerializeField]
[Min(0f)]
float damage = 10f;

void Despawn()
{
gameObject.SetActive(false);
Expand All @@ -25,7 +29,7 @@ void OnCollisionEnter(Collision collision)
{
Despawn();

GameManagerScript.instance.GetPlayerScript?.TakeDamage(10f);
GameManagerScript.instance.GetPlayerScript?.TakeDamage(damage);
}
}
}
1 change: 0 additions & 1 deletion Assets/Scripts/RoomScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 13 additions & 0 deletions Assets/Scripts/SoundManagerScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8f4b200

Please sign in to comment.