public void StartMinigame(MinigameDisplayComponent display, MinigameType type, int playerID, Action <MinigameTickResult> callback = null) { BaseMinigame minigame = null; switch (type) { case MinigameType.Sequence: minigame = new SequenceMinigame(); minigame.Setup(m_CurrentMinigameID, display, new Rect(100, 100, 10, 10), playerID, callback); break; case MinigameType.Screwdriver: minigame = new ScrewdriverMinigame(); minigame.Setup(m_CurrentMinigameID, display, new Rect(200, 100, 10, 10), playerID, callback); break; case MinigameType.Morse: minigame = new MorseMinigame(); minigame.Setup(m_CurrentMinigameID, display, new Rect(300, 100, 10, 10), playerID, callback); break; case MinigameType.Matcher: minigame = new MatcherMinigame(); minigame.Setup(m_CurrentMinigameID, display, new Rect(400, 100, 10, 10), playerID, callback); break; } BeginMinigame(minigame); m_CurrentMinigameID++; }
bool TryCreateNewProblem(MinigameType type = MinigameType.LAST) { Debug.Log("Trying to create new problem"); if (organsReady.Count == 0) { return(false); } if (type == MinigameType.LAST) { type = organsReady[Random.Range(0, organsReady.Count)]; } Debug.Log("New problem will occur in the " + type); // if( !tutorialDone[(int) type] ) { // if( allTutorials[(int) type] != null ) { allTutorials[(int)type].StartEvent(); PauseCountdown(); // } else { // Debug.LogWarning("No tutorial found for " + type ); // } // tutorialDone[(int) type] = true; // } // organsWithProblems.Add( type ); // organsReady.Remove( type ); allMinigames[(int)type].StartEvent(); Debug.Log("Created at problem in the " + type); return(true); }
public BotEntry(MinigameType _Type, int _Target, RewardLevel _DesiredLevel, int _DesiredReward, ResolutionType _Resolution) { Type = _Type; Target = _Target; Running = false; DesiredLevel = _DesiredLevel; DesiredReward = _DesiredReward; Progress = 0; Resolution = _Resolution; }
private void ActivateRequestFlicker(MinigameType minigame) { RequestUI request = requests.Find(t => t.minigameType == minigame); if (request != null) { request.ActivateFlickering(); } else { Debug.Log("request not nound"); } }
public void LoadMinigame(MinigameType game, Interactable interactable) { GameObject prefab = GetMinigameOfType(game).minigamePrefab; GameObject instance = Instantiate(prefab); IMinigame iminigame = instance.GetComponent <IMinigame>(); iminigame.minigame = game; iminigame.OnMinigameFinished += MinigameFinished; print("subscribed"); GameManager.Instance.FreezeGame = true; currentInteractable = interactable; }
private void EndRequest(MinigameType minigame) { RequestUI request = requests.Find(t => t.minigameType == minigame); if (request != null) { request.isUsed = false; request.EndRequest(); } else { Debug.Log("request not found"); } }
private void DisplayRequest(MinigameType minigame) { RequestUI request = requests.Find(t => t.isUsed == false); if (request != null) { request.minigameType = minigame; request.isUsed = true; request.DisplayRequest(sprites[(int)minigame]); } else { Debug.Log("no requestUI available"); } }
public static BaseMinigame CreateMinigame(MinigameType type) { switch (type) { case MinigameType.Sequence: return(new SequenceMinigame()); case MinigameType.Screwdriver: return(new ScrewdriverMinigame()); default: Debug.LogError("Not implemented yet"); break; } return(null); }
public void MinigameWon(EventTracker callback) { MinigameType offender = MinigameType.LAST; for (int i = 0; i < allMinigames.Count; i++) { if (allMinigames[i] == callback) { offender = (MinigameType)i; } } if (offender == MinigameType.LAST) { Debug.LogError("Couldn't find minigame associated with " + callback); } organsWithProblems.Remove(offender); organsReady.Add(offender); StopCoroutine(currentCountdownRoutine); currentCountdownRoutine = StartCoroutine(CountdownRoutine()); }
public void PlayMinigame(MinigameType type) { BaseBaseMinigame minigame = null; for (byte i = 0; i < minigames.Count; ++i) { if (minigames[i].type == type) { minigame = minigames[i]; break; } } if (minigame != null) { ScreenState = PlayerScreenState.Minigame; gameMenu.HideMainMenu(); StartSingleMinigame(minigame); } }
public void MinigameFailedButAlive(EventTracker callback) { // who heck'd up MinigameType offender = MinigameType.LAST; for (int i = 0; i < allMinigames.Count; i++) { if (allMinigames[i] == callback) { offender = (MinigameType)i; } } if (offender == MinigameType.LAST) { Debug.LogError("Couldn't find minigame associated with " + callback); } organsWithProblems.Remove(offender); organsReady.Add(offender); // PUNISH PUNISH PUNISH maxCountdown -= countdownPenalty; }
public static void SetGameType(MinigameType gameType) { // Set the current game based on the game type. switch (gameType) { case MinigameType.SEE: currentGame = "see"; break; case MinigameType.HEAR: currentGame = "hear"; break; case MinigameType.WHERE: currentGame = "where"; break; default: Debug.Log("Invalid GameType"); break; } //Restart(); }
private List <Interactable> GetAllAvailableInteractablesForMinigame(MinigameType minigameType) { return(interactables.FindAll(t => t.minigame == minigameType && t.IsInteractable == false && t.InMinigame == false)); }
public static LaunchMinigame launchMinigame(MinigameType game) => new LaunchMinigame(game);
} // hide default constructor public LaunchMinigame( MinigameType game ) { this.game = game; }
public static CollectCoin collectCoin(MinigameType island) => new CollectCoin(island);
} // hide default constructor public CollectCoin( MinigameType island ) { this.island = island; }
public static void DisplayRequest(MinigameType type) { OnDisplayRequest?.Invoke(type); }
public static CompletedMinigame completedMinigame(MinigameType game) => new CompletedMinigame(game);
public static void EndRequest(MinigameType type) { OnEndRequest?.Invoke(type); }
public void LockMinigame(MinigameType game) { minigames.Find(t => t.MinigameType == game).canBeRequested = false; }
public static void StartFlickering(MinigameType type) { OnStartFlickering?.Invoke(type); }
public void completedMinigame(MinigameType game) => send(Msg.completedMinigame(game));
/// <summary> /// Setup a new minigame, remember to assign it to the player with API.setEntityData(player, "Minigame", classInstanceHere); /// </summary> public MinigameInfo() { score = 0; type = MinigameType.none; }
public Minigame GetMinigameOfType(MinigameType type) { return(minigames.Find(t => t.MinigameType == type)); }
} // hide default constructor public CompletedMinigame( MinigameType game ) { this.game = game; }
public IterationProgress updateMinigameState(MinigameType type, MinigameState state) { minigames.Add(type, state); return(withMinigames(minigames)); }
public void UnlockMinigame(MinigameType game) { minigames.Find(t => t.MinigameType == game).canBeRequested = true; }