Blazephlozard

Untitled

Feb 13th, 2021
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. private void OnTokenReady(PuzzleToken token)
  2. {
  3. if (this._unreadyTokens.IndexOf(token) != -1)
  4. {
  5. this._unreadyTokens.Remove(token);
  6. }
  7. if (this.puzzleGameState == PuzzleGameState.WAITING || this.puzzleGameState == PuzzleGameState.MOVING || this.puzzleGameState == PuzzleGameState.STOPPING || this.puzzleGameState == PuzzleGameState.ABILITY)
  8. {
  9. if (this.puzzleGameState == PuzzleGameState.WAITING)
  10. {
  11. PuzzleMatch puzzleMatch = this.GetMatch(token.gridPosition, false, null);
  12. if (puzzleMatch != null)
  13. {
  14. this.ProcessMatch(puzzleMatch);
  15. this._matchComboCount++;
  16. }
  17. }
  18. else if (this.puzzleGameState == PuzzleGameState.MOVING || this.puzzleGameState == PuzzleGameState.STOPPING)
  19. {
  20. PuzzleMatch puzzleMatch = this.GetMatch(token.gridPosition, true, null);
  21. if (puzzleMatch != null)
  22. {
  23. this._moveTokenMatchSet.AddMatch(puzzleMatch, true);
  24. }
  25. else
  26. {
  27. puzzleMatch = this._moveTokenMatchSet.GetMatchWithGridPosition(token.gridPosition);
  28. this._moveTokenMatchSet.RemoveMatch(puzzleMatch);
  29. }
  30. }
  31. if (!this._initialTokenDropped)
  32. {
  33. this._initialTokenDropped = true;
  34. }
  35. if (this._unreadyTokens.Count == 0)
  36. {
  37. if (this.puzzleGameState == PuzzleGameState.WAITING && (this._movesRemaining > 0 || this._isBonusRound) && this._currentAffection < this._goalAffection && !this.IsThereAnAvailableMove(false))
  38. {
  39. List<PuzzleTokenType> list = new List<PuzzleTokenType>
  40. {
  41. PuzzleTokenType.BROKEN,
  42. PuzzleTokenType.PASSION,
  43. PuzzleTokenType.SENTIMENT,
  44. PuzzleTokenType.JOY,
  45. PuzzleTokenType.AFFECTION
  46. };
  47. int num = 0;
  48. PuzzleGroup puzzleGroup = null;
  49. while (puzzleGroup == null)
  50. {
  51. puzzleGroup = this.GetPositionsContainingAsGroup(list[num]);
  52. num++;
  53. }
  54. this.DestroyPuzzleGroup(puzzleGroup, true);
  55. }
  56. else
  57. {
  58. if (this.PuzzleGameReadyEvent != null && this._tutorialMoveMade)
  59. {
  60. this._tutorialMoveMade = false;
  61. this.PuzzleGameReadyEvent();
  62. }
  63. this.RefreshDateGiftSlots(false);
  64. if (this.puzzleGameState == PuzzleGameState.WAITING || this.puzzleGameState == PuzzleGameState.ABILITY)
  65. {
  66. this._puzzleGrid.tokenContainer.interactive = true;
  67. }
  68. this._matchComboCount = 0;
  69. if (this._isTutorial && !this._tutorialStarted)
  70. {
  71. this._tutorialStarted = true;
  72. GameManager.System.Dialog.PlayDialogScene(GameManager.Stage.uiGirl.openingScenes[GameManager.System.Player.tutorialStep]);
  73. }
  74. }
  75. }
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment