public static IEnumerator ApplyPetrificationCharmCoroutine(BodyPart bodyPart, float seconds, int goldCost) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); clock.StartClockUntil(seconds); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.ActionInProgress(); while (clock.isTimePassing) { yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { ApplyPetrificationCharmProcess(bodyPart); GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost; buttonActions.SelectCharmAction(); } else { clock.actionCancelFlag = false; } }
private static IEnumerator AddBloodCoroutine(BodyPart bodyPart, float seconds, int goldCost, int blood) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); clock.StartClockUntil(seconds); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.UpdateMenuButtonsInteractivity(false); buttonActions.ActionInProgress(); while (clock.isTimePassing) { yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { bodyPart.GetComponent <BodyPart>().blood += blood; MonoBehaviour.FindObjectOfType <ActionTracker>().blood_injected += blood; GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost; buttonActions.SelectBloodAction(); } else { clock.actionCancelFlag = false; } }
public static IEnumerator ApplyBloodRegenCharmCoroutine(BodyPart bodyPart, float seconds, int goldCost) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); clock.StartClockUntil(seconds); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.ActionInProgress(); while (clock.isTimePassing) { yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { bodyPart.gameObject.AddComponent <BloodRegenCharm>(); MonoBehaviour.FindObjectOfType <ActionTracker>().charm_petrification += 1; GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost; } else { clock.actionCancelFlag = false; } }
public static IEnumerator RemoveOrganCoroutine(Organ organ, float seconds, int goldCost, float bloodLossRateInduced, float damageInduced) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); clock.StartClockUntil(seconds); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.UpdateMenuButtonsInteractivity(false); buttonActions.ActionInProgress(); while (clock.isTimePassing) { RemoveOrganDuring(organ, clock, seconds, bloodLossRateInduced, damageInduced); yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { RemoveOrganProcess(organ); GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost; buttonActions.SelectSurgeryAction(); } }
public static IEnumerator DeleteBodyPartCoroutine(BodyPart bodyPart, float seconds, int goldCost) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); clock.StartClockUntil(seconds); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.UpdateMenuButtonsInteractivity(false); buttonActions.ActionInProgress(); while (clock.isTimePassing) { yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { DeleteBodyPartProcess(bodyPart); GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost; if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene") { MonoBehaviour.FindObjectOfType <BodyPartStatusManager>().UpdateStatusCollection(); } buttonActions.SelectSurgeryAction(); } }
public static IEnumerator ConnectBodyPartCoroutine(BodyPart bodyPart1, BodyPart bodyPart2, float seconds, int goldCost, float bloodLossRateInduced, float damageInduced) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); clock.StartClockUntil(seconds); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.UpdateMenuButtonsInteractivity(false); buttonActions.ActionInProgress(); while (clock.isTimePassing) { ConnectBodyPartDuring(bodyPart1, bodyPart2, clock, seconds, bloodLossRateInduced, damageInduced); yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { ConnectBodyPartProcess(bodyPart1, bodyPart2); GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost; MonoBehaviour.FindObjectOfType <BodyPartStatusManager>().UpdateStatusCollection(); buttonActions.SelectSurgeryAction(); } }
public static IEnumerator WaitSecondsCoroutine(float seconds) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.ActionInProgress(); while (clock.isTimePassing) { yield return(null); } buttonActions.ActionFinished(); clock.actionCancelFlag = false; }
public static IEnumerator DischargePatientCoroutine() { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.ActionInProgress(); while (clock.isTimePassing) { yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { GameObject.FindObjectOfType <LifeMonitor>().VictoryCheck(); } clock.actionCancelFlag = false; }
public static IEnumerator SpawnBodyPartCoroutineTemplate(float seconds, int goldCost, string partName, Func <string, BodyPart> spawnMethod, int menuReset) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); clock.StartClockUntil(seconds); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.ActionInProgress(); while (clock.isTimePassing) { yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { SpawnBodyPartProcessTemplate(goldCost, partName, spawnMethod, menuReset); } else { clock.actionCancelFlag = false; } MonoBehaviour.FindObjectOfType <BodyPartSelectorManager>().ResetSelectors(); }
public static IEnumerator InjectPotionCoroutine(BodyPart bodyPart, string type, float amount, float seconds, int goldCost) { Clock clock = MonoBehaviour.FindObjectOfType <Clock>(); clock.StartClockUntil(seconds); ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>(); buttonActions.ActionInProgress(); while (clock.isTimePassing) { yield return(null); } buttonActions.ActionFinished(); if (!clock.actionCancelFlag) { InjectPotionProcess(bodyPart.GetComponent <BodyPart>(), type, amount); GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost; buttonActions.SelectMedicineAction(); } else { clock.actionCancelFlag = false; } }