public void checkRibbon() { int[] levelInfo = FugoUtils.getLevelInfo(); if (GameController.endType == EndType.Level || GameController.endType == EndType.Hidden) { return; } Movements.instance.executeWithDelay((Movements.Execute)SoundManager.instance.playPop2, 0.5f); ribbon.SetActive(value: true); GameObject gameObject = ribbon.transform.Find("LevelName").gameObject; if (UISwapper.flipGame) { ArabicText arabicText = gameObject.GetComponent <ArabicText>(); if (arabicText == null) { arabicText = gameObject.AddComponent <ArabicText>(); } arabicText.Text = AutoLanguage.dict["SetCompleteText"].Replace("%@%", GameController.set.SetFullName.ToUpper()); } else { ribbon.transform.Find("LevelName").GetComponent <Text>().text = AutoLanguage.dict["SetCompleteText"].Replace("%@%", GameController.set.SetFullName.ToUpper()); } ribbon.GetComponent <Image>().color = FugoUtils.HexToColor(GameController.section.FirstSetColor); Movements.instance.scale(ribbon, Vector3.zero, Vector3.one, 0.5f); }
private void setName() { int levelNumber = (levelToOpen != -1) ? levelToOpen : PlayerPrefsManager.GetLevel(); int[] levelInfo = FugoUtils.getLevelInfo(levelNumber); if (UISwapper.flipGame) { ArabicText arabicText = name.gameObject.AddComponent <ArabicText>(); if (game.mode == GameMode.ADVENTURE) { arabicText.Text = set.SetFullName + " ● " + adventureGameId; } else { arabicText.Text = set.SetFullName + " ● " + (levelInfo[2] + 1); } } else { try { if (game.mode == GameMode.ADVENTURE) { name.text = (set.SetFullName + " ● " + adventureGameId).AddSpaces(); } else { name.text = (set.SetFullName + " ● " + (levelInfo[2] + 1)).AddSpaces(); } } catch (Exception) { } } }
public int getSectionNumber() { if (levelToOpen == -1) { return(FugoUtils.getLevelInfo(PlayerPrefsManager.GetLevel())[0]); } return(FugoUtils.getLevelInfo(levelToOpen)[0]); }
public void OpenQuestPopup(string type) { DisableAll(); int index = FugoUtils.getLevelInfo(PlayerPrefsManager.GetQuestEndLevel() - 1)[0]; int index2 = FugoUtils.getLevelInfo(PlayerPrefsManager.GetQuestEndLevel() - 1)[1]; string setFullName = Games.sections[index].sets[index2].SetFullName; if (type.ToLower() == "offer") { string newValue = "<color=#FFC687FF>" + setFullName + "</color>"; if (PlayerPrefsManager.GetLang() == "Arabic" || PlayerPrefsManager.GetLang() == "Hebrew") { newValue = setFullName; } if (givenHours > 1) { questPopup.Find("QuestSection/QuestText").GetComponent <Text>().text = LanguageScript.AdventureQuestText.Split('/')[1].Replace("%@", givenHours.ToString()).Replace("@%", newValue); } else { questPopup.Find("QuestSection/QuestText").GetComponent <Text>().text = LanguageScript.AdventureQuestText.Split('/')[0].Replace("%@", givenHours.ToString()).Replace("@%", newValue); } questPopup.Find("QuestSection").gameObject.SetActive(value: true); ArabicController.MakeArabicMenu(questPopup.Find("QuestSection/QuestText")); } else if (type.ToLower() == "gift") { questPopup.Find("GiftSection").gameObject.SetActive(value: true); } else if (type.ToLower() == "info") { string text = "<color=#FFC687FF>" + setFullName + "</color>"; if (PlayerPrefsManager.GetLang() == "Arabic" || PlayerPrefsManager.GetLang() == "Hebrew") { text = setFullName; } questPopup.Find("InfoSection/QuestSection").GetComponent <Text>().text = text; questPopup.Find("InfoSection/RemainingLevel").GetComponent <Text>().text = LanguageScript.AdventureRemainingText.Replace("%@", (PlayerPrefsManager.GetQuestEndLevel() - PlayerPrefsManager.GetLevel()).ToString()); TimeSpan ts = DateTime.Parse(PlayerPrefsManager.GetQuestEndTime()) - DateTime.Now; questPopup.Find("InfoSection/RemainingTime").GetComponent <Text>().text = LanguageScript.AdventureRemainingTimeText.Replace("%@", FugoUtils.DateFormatterLong(LanguageScript.DayHourText, ts)); questPopup.Find("InfoSection").gameObject.SetActive(value: true); ArabicController.MakeArabicMenu(questPopup.Find("InfoSection/QuestSection")); ArabicController.MakeArabicMenu(questPopup.Find("InfoSection/RemainingLevel")); ArabicController.MakeArabicMenu(questPopup.Find("InfoSection/RemainingTime")); } else if (type.ToLower() == "reward") { questPopup.Find("RewardSection/GemRewardHolder/AmountText").GetComponent <Text>().text = PlayerPrefsManager.GetQuestRewardAmount().ToString(); ArabicController.MakeArabicMenu(questPopup.Find("RewardSection/GemRewardHolder/AmountText")); questPopup.Find("RewardSection").gameObject.SetActive(value: true); } else if (type.ToLower() == "fail") { questPopup.Find("FailSection").gameObject.SetActive(value: true); } MenuController.instance.OpenQuestPopup(); }
public int getLevelNumber() { try { if (levelToOpen == -1) { return(FugoUtils.getLevelInfo(PlayerPrefsManager.GetLevel() % (PlayerPrefsManager.CountLevels() + 2))[2]); } return(FugoUtils.getLevelInfo(levelToOpen)[2]); } catch (Exception) { return(1); } }
public void init() { animTime = 0.1f; instance = this; pointIndex = 0; angle = 0f; angleRange = 1.2f; ribbon = base.transform.Find("Ribbon").gameObject; positions = new Vector3[32]; calculatePositions(); base.gameObject.SetActive(value: false); int levelNumber = PlayerPrefsManager.GetLevel(); if (GameController.levelToOpen != -1) { levelNumber = GameController.levelToOpen; } GameObject gameObject = UnityEngine.Object.Instantiate(lines[FugoUtils.getLevelInfo(levelNumber)[1] % lines.Length]); gameObject.transform.SetParent(base.transform); gameObject.transform.SetSiblingIndex(1); gameObject.transform.localScale = Vector3.one; gameObject.transform.localPosition = Vector3.zero; gameObject.name = "Lines"; points = new GameObject[gameObject.transform.childCount]; for (int i = 0; i < gameObject.transform.childCount; i++) { points[i] = gameObject.transform.GetChild(i).gameObject; points[i].SetActive(value: false); points[i].name = "point " + i; } points[0].SetActive(value: true); Vector3 localScale = gameObject.transform.localScale; if (localScale.x < 0f) { } setColors(); calculatePartial(); }
private IEnumerator PlayButtonThread() { SoundManager.instance.Click(); int[] levelIndex = new int[3]; try { levelIndex = FugoUtils.getLevelInfo(); } catch (Exception) { } GameController.levelToOpen = -1; GameController.daily = false; try { BeforeGameFadeOut(Games.sections[levelIndex[0]].sets[levelIndex[1]]); } catch (Exception) { } yield return(new WaitForSeconds(0.2f)); SceneManager.LoadScene("GameNew"); }
public void GiveQuest() { PlayerPrefsManager.SetLastQuestTime(DateTime.Now.ToString("yy-MM-dd")); StopAllCoroutines(); questButton.localScale = Vector3.one; int firstLevelOfNextSet = FugoUtils.GetFirstLevelOfNextSet(); int num = firstLevelOfNextSet - PlayerPrefsManager.GetLevel(); int num2 = FugoUtils.getLevelInfo()[0]; int[] array = new int[5] { 30, 40, 50, 60, 0 }; int[] array2 = new int[5] { 40, 60, 0, 0, 0 }; PlayerPrefsManager.SetQuestEndLevel(firstLevelOfNextSet); if (num <= 6) { FugoUtils.ShuffleArray(array); giftAmount = array[0]; PlayerPrefsManager.SetQuestRewardAmount(75); if (num2 > 13) { givenHours = 3; } else if (num2 > 7) { givenHours = 2; } else { givenHours = 1; } } else { FugoUtils.ShuffleArray(array2); giftAmount = array2[0]; PlayerPrefsManager.SetQuestRewardAmount(100); if (num2 > 13) { givenHours = 3; } else if (num2 > 7) { givenHours = 2; } else { givenHours = 1; } } OpenQuestPopup("offer"); }
private void tempStart() { int num = 0; if (daily) { DateTime now = DateTime.Now; section = Games.dailyPuzzles; set = section.sets[now.Month - 1]; game = set.levels[now.Day - 1]; game.mode = GameMode.DAILY; } else { num = ((levelToOpen != -1) ? levelToOpen : PlayerPrefsManager.GetLevel()); int[] levelInfo = FugoUtils.getLevelInfo(num); if (mode == GameMode.ADVENTURE) { section = Games.GetSection(adventureSectionId); set = section.getHiddenSet(adventureSetId); UnityEngine.Debug.Log(adventureGameId + " " + adventureSetId + " " + adventureSectionId); Adventure adventure = Games.adventure = new Adventure(section, set, set.getLevelsWithID(adventureGameId)); if (slidePos == 0) { Games.adventure.curPos = 0; } else { Games.adventure.curPos = slidePos - 1; } game = Games.adventure.Levels[Games.adventure.curPos]; game.setId = int.Parse(adventureSetId); game.mode = GameMode.ADVENTURE; UnityEngine.Debug.Log(game.part); if (game.adventure.Width == -1) { calculateSize(); } } else { section = Games.sections[levelInfo[0]]; set = section.sets[levelInfo[1]]; game = set.levels[levelInfo[2]]; } UnityEngine.Debug.Log("game name " + UISwapper.flipGame); name.gameObject.SetActive(value: true); } string path = "BGImages/" + set.bgImage; game.set = set; background.sprite = Resources.Load <Sprite>(path); background.gameObject.SetActive(value: true); newGame(game); if (UISwapper.flipGame) { StartCoroutine(ArabicText.fixAllNextFrame()); } name.color = HeaderColor; Color headerColor = HeaderColor; headerColor.a = 0f; name.color = headerColor; }
private void loadGame(int id) { int[] levelInfo = FugoUtils.getLevelInfo(id); }
public static GameObject getLevel(int level) { GameObject original = Resources.Load <GameObject>("Prefabs/BoardTemplate"); GameObject original2 = Resources.Load <GameObject>("Prefabs/DebugCell"); int[] levelInfo = FugoUtils.getLevelInfo(level); Section section = Games.sections[levelInfo[0]]; LevelSet levelSet = section.sets[levelInfo[1]]; Level level2 = levelSet.levels[levelInfo[2]]; float num = FugoUtils.boardHeight; float num2 = num * FugoUtils.getBoardRatio(); GameObject gameObject = UnityEngine.Object.Instantiate(original); Transform transform = gameObject.transform.Find("Board"); float val = 7.5f / (float)level2.width; float val2 = num / 100f / (float)level2.height; float num3 = Math.Min(val, val2); float num4 = 100f * num3; float val3 = num2 / (float)level2.width; float val4 = num / (float)level2.height; num4 = Math.Min(val3, val4); float num5 = num2 - (float)level2.width * num4; float num6 = num - (float)level2.height * num4; UnityEngine.Debug.Log(num + " " + level2.height + " " + cellSize); num5 *= 0.5f; num6 *= 0.5f; RectTransform component = transform.GetComponent <RectTransform>(); UnityEngine.Debug.Log("board size " + component.sizeDelta); Vector2 sizeDelta = component.sizeDelta; sizeDelta.y = FugoUtils.adBoardHeight; component.sizeDelta = sizeDelta; Vector2 anchoredPosition = component.anchoredPosition; anchoredPosition.y = -100f; component.anchoredPosition = anchoredPosition; List <Word> words = level2.words; foreach (Word item in words) { int length = item.length; int x = item.X; int y = item.Y; for (int i = 0; i < length; i++) { GameObject gameObject2 = UnityEngine.Object.Instantiate(original2); gameObject2.GetComponent <Image>().color = FugoUtils.HexToColor(levelSet.InGameSelectedLetterBGColor); gameObject2.transform.Find("Text").GetComponent <Text>().color = FugoUtils.HexToColor(levelSet.InGameSelectedLetterColor); gameObject2.transform.Find("Text").GetComponent <Text>().text = item.word[i].ToString(); RectTransform component2 = gameObject2.GetComponent <RectTransform>(); gameObject2.transform.SetParent(transform.transform); component2.anchorMin = Vector2.up; component2.anchorMax = Vector2.up; component2.pivot = Vector2.up; component2.sizeDelta = Vector2.one * num4; component2.anchoredPosition = Vector2.right * x * num4 + Vector2.down * y * num4; component2.anchoredPosition += Vector2.down * num6 + Vector2.right * num5; if (item.orientation == Orientation.HORIZONTAL) { component2.anchoredPosition += Vector2.right * i * num4; } else { component2.anchoredPosition += Vector2.down * i * num4; } gameObject2.transform.localScale = Vector3.one; } } return(gameObject); }
public void createBoard() { logLevelStart(); bonus = null; scale = base.transform.Find("Scale"); Vector2 sizeDelta = cellTemp.GetComponent <RectTransform>().sizeDelta; cellSize = sizeDelta.x; float num = 1336f / (float)Screen.height; width = (float)Screen.width * num / cellSize; Vector2 sizeDelta2 = scale.parent.GetComponent <RectTransform>().sizeDelta; height = sizeDelta2.y / cellSize; if (levelToOpen == PlayerPrefsManager.GetLevel()) { levelToOpen = -1; } if (levelToOpen == -1) { info = FugoUtils.getLevelInfo(); } else { info = FugoUtils.getLevelInfo(levelToOpen); } DateTime now = DateTime.Now; if (daily) { sec = Games.dailyPuzzles; set = sec.sets[now.Month - 1]; level = set.levels[now.Day - 1]; } else { sec = Games.sections[info[0]]; set = sec.sets[info[1]]; level = set.levels[info[2]]; } ParticleAnimationManager.instance.PlayAnimation(set); Cell.cellColor = set.InGameTileColor; Cell.strokeColor = set.InGameSelectedLetterBGColor; nextSet = (set.levels.Count - 1 == info[2] && (levelToOpen == -1 || levelToOpen == PlayerPrefsManager.GetLevel())); nextSec = (sec.sets.Count - 1 == info[1] && (levelToOpen == -1 || levelToOpen == PlayerPrefsManager.GetLevel()) && nextSet); if (nextSet) { GameMenuController.instance.setGoldAmount(25); } if (nextSec) { GameMenuController.instance.setGoldAmount(100); } cellBGColor = FugoUtils.HexToColor(set.InGameSelectedLetterBGColor); board = new GameObject[level.width, level.height]; background.SetActive(value: true); string path = "BGImages/" + set.bgImage; Sprite sprite = Resources.Load <Sprite>(path); background.GetComponent <Image>().sprite = sprite; background.transform.Find("Blur").gameObject.SetActive(value: false); if (PlayerPrefsManager.IsBlueMode()) { background.SetActive(value: false); } if (levelToOpen != -1) { int[] levelInfo = FugoUtils.getLevelInfo(); int[] levelInfo2 = FugoUtils.getLevelInfo(levelToOpen); UnityEngine.Debug.Log(levelInfo[1]); UnityEngine.Debug.Log(levelInfo2[1]); blur = (levelInfo[1] == levelInfo2[1]); } else { blur = true; } if (blur) { background.transform.Find("Blur").gameObject.SetActive(value: true); } else { background.transform.Find("Blur").gameObject.SetActive(value: true); FugoUtils.ChangeAlpha(background.transform.Find("Blur").GetComponent <Image>(), 0f); BlurControl.instance.enableBlur(); } if (daily) { background.transform.Find("Blur").gameObject.SetActive(value: false); } name.GetComponent <Text>().text = set.SetFullName + " ● " + (info[2] + 1); name.GetComponent <Text>().color = FugoUtils.HexToColor(set.InGameHeaderColor); float a = width / (float)level.width; float b = height / (float)level.height; scaleAmount = Mathf.Min(a, b); scaleAmount *= 0.9f; cellSize *= scaleAmount; offsetX = Vector2.up * ((float)level.height - height) * cellSize * 0.5f * scaleAmount; offsetY = Vector2.left * ((float)level.width - width) * cellSize * 0.5f * scaleAmount; offsetX = Vector2.left * cellSize * level.width * 0.5f + Vector2.right * cellSize * 0.5f; offsetY = Vector2.up * cellSize * level.height * 0.5f + Vector2.down * cellSize * 0.5f; for (int i = 0; i < level.width; i++) { for (int j = 0; j < level.height; j++) { GameObject gameObject = UnityEngine.Object.Instantiate(cellTemp); gameObject.transform.SetParent(scale); gameObject.transform.localPosition = Vector3.zero; gameObject.transform.SetAsFirstSibling(); gameObject.SetActive(value: false); RectTransform component = gameObject.GetComponent <RectTransform>(); component.anchoredPosition = (Vector3.right * i + Vector3.down * j) * cellSize; component.anchoredPosition += offsetX + offsetY; board[i, j] = gameObject; gameObject.transform.localScale = Vector3.one; gameObject.transform.Find("BG").localScale = Vector3.zero; gameObject.transform.Find("BG/Text").GetComponent <Text>().color = FugoUtils.HexToColor(set.InGameHintColor); component.sizeDelta = Vector2.one * cellSize; Cell component2 = gameObject.GetComponent <Cell>(); component2.x = i; component2.y = j; } } GameObject[,] array = board; int length = array.GetLength(0); int length2 = array.GetLength(1); for (int k = 0; k < length; k++) { for (int l = 0; l < length2; l++) { GameObject gameObject2 = array[k, l]; if (gameObject2.activeSelf) { } } } bool flag = false; foreach (Word word in level.words) { if (word.bonus) { flag = true; bonus = word; } try { placeWord(word); } catch (Exception) { } } if (flag) { Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openBonus, 0.5f); } byte[] bytes = Encoding.Default.GetBytes(SystemInfo.deviceUniqueIdentifier); int seed = PlayerPrefsManager.GetLevel() + BitConverter.ToInt32(bytes, 0); UnityEngine.Random.InitState(seed); UnityEngine.Random.InitState(DateTime.Now.Millisecond); Movements.instance.executeWithDelay((Movements.Execute)WheelController.instance.newGame, 0.55f); MapController.instance.setColors(); if (daily && PlayerPrefsManager.IsItFirstDaily()) { Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openDaily, 1.5f); } if (levelToOpen == -1) { if (PlayerPrefsManager.GetLevel() == 1) { WheelController.running = false; UnityEngine.Debug.Log("tutorial1"); Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openFirst, 1.5f); } if (PlayerPrefsManager.GetLevel() == 3) { WheelController.running = false; UnityEngine.Debug.Log("tutorial2"); Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openSecond, 1.5f); } if (PlayerPrefsManager.GetLevel() == 5) { WheelController.running = false; UnityEngine.Debug.Log("tutorial3"); Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openThird, 1.5f); } } }