// Use this for initialization void Start() { newSymbolTimer = MAX_SymbolTimer; if (symbolStartDelay == 0) { symbolStartDelay = Random.Range(1.0f, 3.0f); } if (StartingSymbolPool == null) { Debug.Log("NO Starting Symobl pool given destroying Roullette"); Destroy(this.gameObject); } int counter = 0; //create 3 of each kind of symbol and put them into the pool foreach (string s in symbolController.symbolTypes) { symbolController tempSymbol = null; if (s.ToLower() == "dojhu") { setUpSymbol(s, 0.0f); counter++; setUpSymbol(s, 0.0f); counter++; setUpSymbol(s, 0.0f); counter++; } else if (s.ToLower() == "yog") { setUpSymbol(s, 0.0f); counter++; setUpSymbol(s, 0.0f); counter++; setUpSymbol(s, 0.0f); counter++; } else if (s.ToLower() == "kholw") { setUpSymbol(s, 0.0f); counter++; setUpSymbol(s, 0.0f); counter++; setUpSymbol(s, 0.0f); counter++; } else if (s.ToLower() == "xoytil") { setUpSymbol(s, 0.0f); counter++; setUpSymbol(s, 0.0f); counter++; setUpSymbol(s, 0.0f); counter++; } } }
public static void castSymbol(symbolController symbol) { Debug.Log("Cast Symbol"); Debug.Log(symbol.color); Debug.Log(symbol.symbol); //get the top spell off the seal list spell currentSpell = _mseals[0]; //restore spell is referring to a backup copy of the target spell //if the player does not put it in, in the correct order ///then the curernt spell will revert to the restore spell. if (restoreSpell == null) { restoreSpell = new spell() { spellString = new List <KeyValuePair <string, string> >() }; foreach (KeyValuePair <string, string> s in currentSpell.spellString) { restoreSpell.spellString.Add(new KeyValuePair <string, string>(s.Key.ToString(), s.Value.ToString())); } // restoreSpell.spellString = currentSpell.spellString; } else { Debug.Log("ITS been SET"); } //loop through current allies //for each ally loop through their spell and see if //this symbol matches any of them KeyValuePair <string, string> currentSymbol = currentSpell.spellString[0]; bool correctSymbol = false; if (currentSymbol.Key == symbol.color) { if (currentSymbol.Value == symbol.symbol) { correctSymbol = true; } } if (correctSymbol) { //remove the symbol currentSpell.spellString.Remove(currentSymbol); if (currentSpell.spellString.Count <= 0) { _mseals.Remove(currentSpell); restoreSpell.spellString.Clear(); // restoreSpell = _mseals[0]; foreach (KeyValuePair <string, string> s in _mseals[0].spellString) { restoreSpell.spellString.Add(new KeyValuePair <string, string>(s.Key.ToString(), s.Value.ToString())); } } } else { _mseals[0].spellString.Clear(); //restore the spell foreach (KeyValuePair <string, string> s in restoreSpell.spellString) { _mseals[0].spellString.Add(new KeyValuePair <string, string>(s.Key, s.Value)); } } }