diff options
| author | chai <215380520@qq.com> | 2024-05-19 16:05:01 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-19 16:05:01 +0800 |
| commit | c5f145786f4c6d2fe4bea831dfc16e52228920a5 (patch) | |
| tree | a6ead7ea8266c767d58ed0f816dcd7a1dd75bd65 /GameCode/Nighthorn.cs | |
| parent | 48b64e573a1709dc923cb9162b55be0246b3ff63 (diff) | |
* move
Diffstat (limited to 'GameCode/Nighthorn.cs')
| -rw-r--r-- | GameCode/Nighthorn.cs | 168 |
1 files changed, 0 insertions, 168 deletions
diff --git a/GameCode/Nighthorn.cs b/GameCode/Nighthorn.cs deleted file mode 100644 index f89fcd5..0000000 --- a/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); - } -} |
