Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void OnTokenReady(PuzzleToken token)
- {
- if (this._unreadyTokens.IndexOf(token) != -1)
- {
- this._unreadyTokens.Remove(token);
- }
- if (this.puzzleGameState == PuzzleGameState.WAITING || this.puzzleGameState == PuzzleGameState.MOVING || this.puzzleGameState == PuzzleGameState.STOPPING || this.puzzleGameState == PuzzleGameState.ABILITY)
- {
- if (this.puzzleGameState == PuzzleGameState.WAITING)
- {
- PuzzleMatch puzzleMatch = this.GetMatch(token.gridPosition, false, null);
- if (puzzleMatch != null)
- {
- this.ProcessMatch(puzzleMatch);
- this._matchComboCount++;
- }
- }
- else if (this.puzzleGameState == PuzzleGameState.MOVING || this.puzzleGameState == PuzzleGameState.STOPPING)
- {
- PuzzleMatch puzzleMatch = this.GetMatch(token.gridPosition, true, null);
- if (puzzleMatch != null)
- {
- this._moveTokenMatchSet.AddMatch(puzzleMatch, true);
- }
- else
- {
- puzzleMatch = this._moveTokenMatchSet.GetMatchWithGridPosition(token.gridPosition);
- this._moveTokenMatchSet.RemoveMatch(puzzleMatch);
- }
- }
- if (!this._initialTokenDropped)
- {
- this._initialTokenDropped = true;
- }
- if (this._unreadyTokens.Count == 0)
- {
- if (this.puzzleGameState == PuzzleGameState.WAITING && (this._movesRemaining > 0 || this._isBonusRound) && this._currentAffection < this._goalAffection && !this.IsThereAnAvailableMove(false))
- {
- List<PuzzleTokenType> list = new List<PuzzleTokenType>
- {
- PuzzleTokenType.BROKEN,
- PuzzleTokenType.PASSION,
- PuzzleTokenType.SENTIMENT,
- PuzzleTokenType.JOY,
- PuzzleTokenType.AFFECTION
- };
- int num = 0;
- PuzzleGroup puzzleGroup = null;
- while (puzzleGroup == null)
- {
- puzzleGroup = this.GetPositionsContainingAsGroup(list[num]);
- num++;
- }
- this.DestroyPuzzleGroup(puzzleGroup, true);
- }
- else
- {
- if (this.PuzzleGameReadyEvent != null && this._tutorialMoveMade)
- {
- this._tutorialMoveMade = false;
- this.PuzzleGameReadyEvent();
- }
- this.RefreshDateGiftSlots(false);
- if (this.puzzleGameState == PuzzleGameState.WAITING || this.puzzleGameState == PuzzleGameState.ABILITY)
- {
- this._puzzleGrid.tokenContainer.interactive = true;
- }
- this._matchComboCount = 0;
- if (this._isTutorial && !this._tutorialStarted)
- {
- this._tutorialStarted = true;
- GameManager.System.Dialog.PlayDialogScene(GameManager.Stage.uiGirl.openingScenes[GameManager.System.Player.tutorialStep]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment