diff options
| author | chai <215380520@qq.com> | 2024-05-19 16:46:27 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-19 16:46:27 +0800 |
| commit | 8b1fc7063b387542803c6bc214ccf8acb32870bd (patch) | |
| tree | d310eb99872c8215f1c1f67731ec21f0915cd778 /Thronefall_1_0/GameCode/Nighthorn.cs | |
| parent | 8e13e7e2874adc8982e16d1d2ed2e28d7480b45f (diff) | |
* rename
Diffstat (limited to 'Thronefall_1_0/GameCode/Nighthorn.cs')
| -rw-r--r-- | Thronefall_1_0/GameCode/Nighthorn.cs | 168 |
1 files changed, 0 insertions, 168 deletions
diff --git a/Thronefall_1_0/GameCode/Nighthorn.cs b/Thronefall_1_0/GameCode/Nighthorn.cs deleted file mode 100644 index f89fcd5..0000000 --- a/Thronefall_1_0/GameCode/Nighthorn.cs +++ /dev/null @@ -1,168 +0,0 @@ -using MoreMountains.Feedbacks; -using UnityEngine; - -public class Nighthorn : InteractorBase, DayNightCycle.IDaytimeSensitive -{ - public static Nighthorn instance; - - public GameObject nightCue; - - public GameObject harvestCue; - - public string autoCollectGoldTooltip; - - public string startNightTooltip; - - public string startPreFinalNightTooltip; - - public string startFinalNightTooltip; - - public MMF_Player onBlowFeedback; - - private TutorialManager tutorialManager; - - public int CoinCountToBeHarvested - { - get - { - int num = 0; - foreach (BuildingInteractor playerBuildingInteractor in TagManager.instance.playerBuildingInteractors) - { - if ((bool)playerBuildingInteractor.coinSpawner) - { - num += playerBuildingInteractor.coinSpawner.CoinsLeft; - } - if (playerBuildingInteractor.canBeHarvested) - { - num += playerBuildingInteractor.GoldIncome; - } - } - return num; - } - } - - public bool AllCoinsHarvested - { - get - { - bool result = true; - foreach (BuildingInteractor playerBuildingInteractor in TagManager.instance.playerBuildingInteractors) - { - if (playerBuildingInteractor.canBeHarvested) - { - result = false; - break; - } - } - foreach (Coin freeCoin in TagManager.instance.freeCoins) - { - if (freeCoin.IsFree) - { - return false; - } - } - return result; - } - } - - private void Awake() - { - instance = this; - } - - public override string ReturnTooltip() - { - if (!AllCoinsHarvested) - { - return autoCollectGoldTooltip; - } - if (EnemySpawner.instance.PreFinalWaveComingUp) - { - return startPreFinalNightTooltip; - } - if (EnemySpawner.instance.FinalWaveComingUp) - { - return startFinalNightTooltip; - } - return startNightTooltip; - } - - private void Start() - { - DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this); - tutorialManager = TutorialManager.instance; - } - - public override void InteractionBegin(PlayerInteraction player) - { - if ((bool)tutorialManager && !TutorialManager.AllowStartingTheNight) - { - return; - } - if (AllCoinsHarvested) - { - onBlowFeedback.PlayFeedbacks(); - DayNightCycle.Instance.SwitchToNight(); - return; - } - foreach (BuildingInteractor playerBuildingInteractor in TagManager.instance.playerBuildingInteractors) - { - playerBuildingInteractor.Harvest(player); - } - foreach (Coin freeCoin in TagManager.instance.freeCoins) - { - if (freeCoin.IsFree) - { - freeCoin.SetTarget(player); - } - } - ActivateAndRefreshCues(); - } - - public void OnDawn_AfterSunrise() - { - base.gameObject.SetActive(value: true); - } - - public void OnDusk() - { - base.gameObject.SetActive(value: false); - DeactivateCues(); - } - - public override void Focus(PlayerInteraction player) - { - ActivateAndRefreshCues(); - } - - public override void Unfocus(PlayerInteraction player) - { - DeactivateCues(); - EnemySpawner.instance.EnemySpawnersHornUnFocussed(); - } - - public void OnDawn_BeforeSunrise() - { - } - - public void ActivateAndRefreshCues() - { - if (AllCoinsHarvested) - { - nightCue.SetActive(value: true); - harvestCue.SetActive(value: false); - EnemySpawner.instance.EnemySpawnersHornFocussed(); - } - else - { - nightCue.SetActive(value: false); - harvestCue.SetActive(value: true); - } - } - - public void DeactivateCues() - { - nightCue.SetActive(value: false); - harvestCue.SetActive(value: false); - } -} |
