コード例 #1
0
    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++;
    }
コード例 #2
0
 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);
 }
コード例 #3
0
 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;
 }
コード例 #4
0
    private void ActivateRequestFlicker(MinigameType minigame)
    {
        RequestUI request = requests.Find(t => t.minigameType == minigame);

        if (request != null)
        {
            request.ActivateFlickering();
        }
        else
        {
            Debug.Log("request not nound");
        }
    }
コード例 #5
0
    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;
    }
コード例 #6
0
    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");
        }
    }
コード例 #7
0
    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");
        }
    }
コード例 #8
0
    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);
    }
コード例 #9
0
    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());
    }
コード例 #10
0
    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);
        }
    }
コード例 #11
0
    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;
    }
コード例 #12
0
    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();
    }
コード例 #13
0
 private List <Interactable> GetAllAvailableInteractablesForMinigame(MinigameType minigameType)
 {
     return(interactables.FindAll(t => t.minigame == minigameType && t.IsInteractable == false && t.InMinigame == false));
 }
コード例 #14
0
 public static LaunchMinigame launchMinigame(MinigameType game) =>
 new LaunchMinigame(game);
コード例 #15
0
            }                                // hide default constructor

            public LaunchMinigame(
                MinigameType game
                )
            {
                this.game = game;
            }
コード例 #16
0
 public static CollectCoin collectCoin(MinigameType island) =>
 new CollectCoin(island);
コード例 #17
0
            }                             // hide default constructor

            public CollectCoin(
                MinigameType island
                )
            {
                this.island = island;
            }
コード例 #18
0
ファイル: UIEvents.cs プロジェクト: BusMihail/BobSqueaksWeek
 public static void DisplayRequest(MinigameType type)
 {
     OnDisplayRequest?.Invoke(type);
 }
コード例 #19
0
 public static CompletedMinigame completedMinigame(MinigameType game) =>
 new CompletedMinigame(game);
コード例 #20
0
ファイル: UIEvents.cs プロジェクト: BusMihail/BobSqueaksWeek
 public static void EndRequest(MinigameType type)
 {
     OnEndRequest?.Invoke(type);
 }
コード例 #21
0
 public void LockMinigame(MinigameType game)
 {
     minigames.Find(t => t.MinigameType == game).canBeRequested = false;
 }
コード例 #22
0
ファイル: UIEvents.cs プロジェクト: BusMihail/BobSqueaksWeek
 public static void StartFlickering(MinigameType type)
 {
     OnStartFlickering?.Invoke(type);
 }
コード例 #23
0
 public void completedMinigame(MinigameType game) => send(Msg.completedMinigame(game));
コード例 #24
0
 /// <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;
 }
コード例 #25
0
 public Minigame GetMinigameOfType(MinigameType type)
 {
     return(minigames.Find(t => t.MinigameType == type));
 }
コード例 #26
0
            }                                   // hide default constructor

            public CompletedMinigame(
                MinigameType game
                )
            {
                this.game = game;
            }
コード例 #27
0
 public IterationProgress updateMinigameState(MinigameType type, MinigameState state)
 {
     minigames.Add(type, state);
     return(withMinigames(minigames));
 }
コード例 #28
0
 public void UnlockMinigame(MinigameType game)
 {
     minigames.Find(t => t.MinigameType == game).canBeRequested = true;
 }