// Use this for initialization void Start() { s = this; myPanel.SetActive(false); isCombo = PlayerPrefs.GetInt("isCombo", 0) == 1; isNoPointCard = PlayerPrefs.GetInt("isNoPointCard", 0) == 1; isZoomableMap = PlayerPrefs.GetInt("isZoomableMap", 0) == 1; }
// Use this for initialization void Start() { s = this; pc = GetComponent <LocalPlayerController> (); myCam = Camera.main.gameObject.transform; if (GS.a.gridSettings.gridSizeX <= 9 && GS.a.gridSettings.gridSizeY <= 3) { isScrollEnabled = false; } else { isScrollEnabled = true; Tutorial_FirstTimeStuff.ZoomableMap(); } }
//combo numbers >> //1 - 2 - 3 - 4 - 5 - 6 //same color = ceil(n*1.5) public void ProcessCombo(int playerId, bool isdelayed, IndividualCard card1, IndividualCard card2) { /*if (myCardType < GS.a.cardSettings.cardScores.Length) * CardMatchCoolEffect.s.MatchTwo (myPlayerinteger, cardsToCheck[k], cardsToCheck[l], GS.a.cardSettings.cardScores[myCardType]);*/ CardBase cbase1 = card1.cBase; CardBase cbase2 = card2.cBase; if (playerId == DataHandler.NPCInteger) { if (card1.cBase.npcMatchOverride != null) { cbase1 = card1.cBase.npcMatchOverride; cbase2 = card2.cBase.npcMatchOverride; } } //print ("Adding with combo check"); if (!cbase1.isItem) { //we got a card int scoreToAdd = cbase1.score; int enemyScoreToAdd = cbase1.enemyScore; if (GS.a.canCombo && playerId == DataHandler.s.myPlayerInteger) { bool isSame = false; DataLogger.LogMessage("Combo count: " + comboCount.ToString()); if (scoreToAdd == 0 && enemyScoreToAdd == 0) { lastCardType = -1; if (cbase1.isPowerUpRelated) { CharacterStuffController.s.PowerUpRelatedCardMatched(cbase1.specialTypeID); } return; } if (card1.cBase.dynamicCardID != lastCardType) { scoreToAdd *= comboCount; enemyScoreToAdd *= comboCount; } else { scoreToAdd *= Mathf.CeilToInt((float)comboCount * 1.5f); enemyScoreToAdd *= Mathf.CeilToInt((float)comboCount * 1.5f); isSame = true; } if (comboCount > 1) { Tutorial_FirstTimeStuff.ComboCheck(); GameObject toIns = isSame ? sameCardComboEffect : comboEffect; GameObject myObj = Instantiate(toIns); BetweenCardsEffect.AlignBetweenCards(myObj, card1, card2, BetweenCardsEffect.AlignMode.both); //increase a lot until 8 then keep increasing but a bit more slowly so that we wont occupy the whole screen. float scale = comboCount < 8 ? (isSame ? 1f : 0.5f + ((comboCount) * 0.15f)) : (isSame ? 2.2f : 1.7f + ((comboCount - 8) * 0.05f)); myObj.transform.localScale = new Vector3(scale, scale, scale); try { myObj.GetComponentInChildren <TMPro.TextMeshPro> ().text = (isSame ? ("Same Type Combo! x" + (Mathf.CeilToInt(comboCount * 1.5f)).ToString()) : ("Combo! x" + (comboCount).ToString())); } catch { DataLogger.LogError("Combo text not found"); } } lastCardType = card1.cBase.dynamicCardID; comboCount++; } /*if (isIncreaseScoreReach) { * GS.a.scoreReach += scoreToAdd; * DelayedScoreboard.s.UpdateScoreReach (); * }*/ if (scoreToAdd != 0) { ScoreBoardManager.s.AddScore(playerId, card1.cBase.dynamicCardID, scoreToAdd, isdelayed); } else { Tutorial_FirstTimeStuff.NoPointCards(); } if (enemyScoreToAdd != 0) { ScoreBoardManager.s.AddScoreToOthers(playerId, card1.cBase.dynamicCardID, enemyScoreToAdd, isdelayed); } } else { //we didnt get a card, but an item DataLogger.LogMessage("Got an item: " + card1.cBase.myItem.name); InventoryMaster.s.Add(card1.cBase.myItem, 1); } }