diff --git a/Assets/Scenes/Forest.unity b/Assets/Scenes/Forest.unity index a1303387f4d276cd80dda90f4a94350ecfc06556..32b5a35f302f95d8965c093a62e59189327dad89 100644 --- a/Assets/Scenes/Forest.unity +++ b/Assets/Scenes/Forest.unity @@ -460,6 +460,10 @@ PrefabInstance: propertyPath: startSprite value: objectReference: {fileID: 21300000, guid: d42cfe7bed8439c439378d1a7e76f4e3, type: 3} + - target: {fileID: 1805415820362754139, guid: afeb708bd829d8a4aa0310ed2cd87a74, type: 3} + propertyPath: delayAfterAntiHeroDeath + value: 1.75 + objectReference: {fileID: 0} - target: {fileID: 5959683136170450115, guid: afeb708bd829d8a4aa0310ed2cd87a74, type: 3} propertyPath: m_Name value: GlobalScripts diff --git a/Assets/Scripts/Fighters/AntiPlayer.cs b/Assets/Scripts/Fighters/AntiPlayer.cs index e159efec3860a76a01079f6e000b6c1de51db5d7..3312aa2b4e910eb96e50a62104430e83e3c21bf8 100644 --- a/Assets/Scripts/Fighters/AntiPlayer.cs +++ b/Assets/Scripts/Fighters/AntiPlayer.cs @@ -74,6 +74,10 @@ public class AntiPlayer : Fighter, IFighterCallback { var actualDamage = base.DealDamage(dmg); StatsManager.instance.AddDamageBasedMana(actualDamage, !alive); + if (!alive) + { + StatsManager.instance.UpgradeAntiPlayer(); + } return actualDamage; } diff --git a/Assets/Scripts/RoundController.cs b/Assets/Scripts/RoundController.cs index 2d8ee1358454e5510a615c2705de44fecabbd1ed..1cf58d2d7d079cff313a7358f1a54fdb45220b14 100644 --- a/Assets/Scripts/RoundController.cs +++ b/Assets/Scripts/RoundController.cs @@ -11,11 +11,15 @@ public interface IRoundCallback public class RoundController : MonoBehaviour, IFighterCallback { + public static RoundController instance { get; private set; } public List<IRoundCallback> roundCallbacks = new List<IRoundCallback>(); public bool roundRunning { get; private set; } + [SerializeField, Tooltip("After the AntiHero died, how many seconds to wait until ending the current round")] + float delayAfterAntiHeroDeath = 1.75f; + BaseCameraController cameraController; public void StartRound() @@ -76,7 +80,10 @@ public class RoundController : MonoBehaviour, IFighterCallback public void OnFighterDeath(Fighter fighter) { + // The AntiHero has died SetGameSpeed(0.5f); cameraController.AnimateToPosition(fighter.transform.position + new Vector3(0f, 0.75f), 1.5f, 0.05f); + Invoke(nameof(StopRound), delayAfterAntiHeroDeath); } + } diff --git a/Assets/Scripts/StatsManager.cs b/Assets/Scripts/StatsManager.cs index 6ecacf6c0a5ff0ce749be85199c98d788c9037bc..63abd6a0f9b49e9d413e40039135a684a82706e1 100644 --- a/Assets/Scripts/StatsManager.cs +++ b/Assets/Scripts/StatsManager.cs @@ -123,6 +123,15 @@ public class StatsManager : MonoBehaviour } } + public void UpgradeAntiPlayer() + { + var playerStats = fighterStats[FighterTypes.ANTI_PLAYER]; + playerStats.healthMultiplier += 0.2f; + playerStats.damageMultiplier += 0.2f; + playerStats.armorMultiplier += 0.1f; + fighterStats[FighterTypes.ANTI_PLAYER] = playerStats; + } + void RecalculateStatMultipliers() { var enemyStats = fighterStats[FighterTypes.ENEMY];