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] 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()