Esempio n. 1
0
 public void displayedWinLine(SlotWinData data, bool isFirstLoop)
 {
     if (OnLineWinDisplayed != null)
     {
         OnLineWinDisplayed(data, isFirstLoop);
     }
 }
Esempio n. 2
0
    void showWin()
    {
        winLineOffset = findNextWin();
        if (winLineOffset == -1)
        {
            return;
        }

        winTimeout = 0;

        currentWin = slot.refs.compute.lineResultData[winLineOffset];
        GetComponent <Slot>().displayedWinLine(currentWin, !cycled);

        for (int i = 0; i < currentWin.symbols.Count; i++)
        {
            if (slot.winboxPrefabs[currentWin.symbols[i].GetComponent <SlotSymbol>().symbolIndex] != null)
            {
                GameObject winbox;
                if (slot.usePool)
                {
                    winbox = slot.getWinboxFromPool(currentWin.symbols[i].GetComponent <SlotSymbol>().symbolIndex);
                }
                else
                {
                    winbox = (GameObject)Instantiate(slot.winboxPrefabs[currentWin.symbols[i].GetComponent <SlotSymbol>().symbolIndex]);
                }
                winbox.transform.localScale = Vector3.Scale(winbox.transform.localScale, transform.localScale);
                winbox.transform.parent     = currentWin.symbols[i].transform;            //.parent.transform;// GetComponent<Slot>().reels[i].symbols[pos[i]].transform;
                winbox.transform.position   = currentWin.symbols[i].transform.position;
                winboxes.Add(winbox);
            }
        }
    }
Esempio n. 3
0
 public void beginDelayOnWin(SlotWinData data)
 {
     if (OnBeginDelayBetweenLineWinDisplayed != null)
     {
         OnBeginDelayBetweenLineWinDisplayed(data);
     }
 }
Esempio n. 4
0
 public void computedWinLine(SlotWinData data)
 {
     if (OnLineWinComputed != null)
     {
         OnLineWinComputed(data);
     }
 }
Esempio n. 5
0
    public void reset()
    {
        playingstate = PlayingWinsState.starting;
        releaseWinBoxes();
        //CancelInvoke(resumeWinsInvoke);
        //currentWin.readout = "";
        winLineOffset   = -1;
        winTimeout      = 0;
        winDisplayCount = 0;

        cycled     = false;
        currentWin = null;

        slot.refs.lines.hideLines();
    }
Esempio n. 6
0
    public void reset()
    {
        playingstate = PlayingWinsState.starting;
        releaseWinBoxes();
        //CancelInvoke(resumeWinsInvoke);
        //currentWin.readout = "";
        winLineOffset = -1;
        winTimeout = 0;
        winDisplayCount = 0;

        cycled = false;
        currentWin = null;

        slot.refs.lines.hideLines ();
    }
Esempio n. 7
0
 private void OnLineWinDisplayed(SlotWinData win, bool isFirstLoop)
 {
     slot.log("OnLineWinDisplayed Callback");
     slot.log("win line " + win.lineNumber + " :: set: " + win.setName + " (" + win.setIndex + ") paid: " + win.paid + " matches: " + win.matches);
 }
Esempio n. 8
0
 private void OnLineWinComputed(SlotWinData win)
 {
     slot.log("OnLineWinComputed Callback");
     slot.log("win line " + win.lineNumber + " :: set: " + win.setName + " (" + win.setIndex + ") paid: " + win.paid + " matches: " + win.matches);
 }
Esempio n. 9
0
 private void OnSpinBegin(SlotWinData data)
 {
     slot.refs.lines.hideLines();
     slot.log("OnSpinBegin Callback");
 }
Esempio n. 10
0
 public void displayedWinLine(SlotWinData data, bool isFirstLoop)
 {
     if (OnLineWinDisplayed != null)
         OnLineWinDisplayed(data, isFirstLoop);
 }
Esempio n. 11
0
 public void computedWinLine(SlotWinData data)
 {
     if (OnLineWinComputed != null)
         OnLineWinComputed(data);
 }
Esempio n. 12
0
 public void beginDelayOnWin(SlotWinData data)
 {
     if (OnBeginDelayBetweenLineWinDisplayed != null)
         OnBeginDelayBetweenLineWinDisplayed(data);
 }
Esempio n. 13
0
 private void OnLineWinDisplayed(SlotWinData win, bool isFirstLoop)
 {
     slot.log ("OnLineWinDisplayed Callback");
     slot.log ("win line " + win.lineNumber + " :: set: " + win.setName + " (" + win.setIndex + ") paid: " + win.paid + " matches: " + win.matches);
 }
Esempio n. 14
0
	private void OnSpinBegin(SlotWinData data)
	{
		slot.refs.lines.hideLines ();
		leveling.AwardXp(slot.refs.credits.totalBet());
		slot.log ("OnSpinBegin Callback");
	}
Esempio n. 15
0
    int calculatePayForLine(int lineNumber)
    {
        int highMatches = 0;
        int highPaid    = 0;
        int highSet     = 0;

        if (slot.symbolSets.Count == 0)
        {
            slot.logConfigError(SlotErrors.NO_SYMBOLSETS);
            return(0);
        }

        SlotWinData winData = new SlotWinData(lineNumber);

        List <int> linePositions = slot.lines[lineNumber].positions;

        for (int currentSymbolSetIndex = 0; currentSymbolSetIndex < slot.symbolSets.Count; currentSymbolSetIndex++)
        {
            SetsWrapper currentSet = slot.symbolSets[currentSymbolSetIndex];
            if (currentSet.typeofSet != SetsType.normal)
            {
                continue;
            }

            int numberOfMatchingSymbols      = 0;
            List <GameObject> winningSymbols = new List <GameObject>();

            for (int currentLinePosition = 0; currentLinePosition < linePositions.Count; currentLinePosition++)
            {
                int symbolIndexToCompare = slot.reels[currentLinePosition].symbols[linePositions[currentLinePosition]].GetComponent <SlotSymbol>().symbolIndex;

                bool foundMatchingSymbolInSet = false;
                foreach (int symbolInSet in currentSet.symbols)
                {
                    if ((symbolInSet == symbolIndexToCompare) || (slot.symbolPrefabs[symbolIndexToCompare].GetComponent <SlotSymbol>().isWild&& currentSet.allowWilds))
                    {
                        foundMatchingSymbolInSet = true;
                        numberOfMatchingSymbols++;
                        winningSymbols.Add(slot.reels[currentLinePosition].symbols[linePositions[currentLinePosition]]);
                        break;
                    }
                }
                // if no match is found, abort the search, since the set is no longer consecutive
                if (!foundMatchingSymbolInSet)
                {
                    break;
                }
            }
            if ((numberOfMatchingSymbols >= highMatches) && numberOfMatchingSymbols > 0)
            {
                int pay = slot.setPays[currentSymbolSetIndex].pays[numberOfMatchingSymbols - 1] * slot.refs.credits.betPerLine;

                if (pay > highPaid)
                {
                    highMatches     = numberOfMatchingSymbols;
                    highPaid        = pay;
                    highSet         = currentSymbolSetIndex;
                    winData.symbols = winningSymbols;
                }
            }
        }

        if (highPaid > 0)
        {
            winData.lineNumber = lineNumber;
            winData.matches    = highMatches;
            winData.paid       = highPaid;
            winData.setIndex   = highSet;
            winData.setType    = slot.symbolSets[winData.setIndex].typeofSet;
            winData.setName    = slot.symbolSetNames[winData.setIndex];
            winData.readout    = winData.matches + " " + winData.setName + " on line " + (winData.lineNumber + 1) + " pays " + winData.paid;
            lineResultData.Add(winData);

            slot.computedWinLine(winData);
        }
        return(highPaid);
    }
Esempio n. 16
0
	void calculateScatterPays()
	{
		if (slot.symbolSets.Count == 0)
		{
			slot.logConfigError(SlotErrors.NO_SYMBOLSETS);
			return;
		}
		//int totalWon = 0;
		//int totalLineWon = 0;
		for(int currentSymbolSetIndex = 0; currentSymbolSetIndex < slot.symbolSets.Count; currentSymbolSetIndex++)
		{
			SetsWrapper currentSet = slot.symbolSets[currentSymbolSetIndex];
			if (currentSet.typeofSet != SetsType.scatter) continue;

			int matches = 0;
			SlotWinData winData = new SlotWinData(-1);

			for (int reel = 0; reel < slot.numberOfReels; reel++)
			{
				for (int range = slot.reelIndent; range < (slot.reelHeight - slot.reelIndent); range++)
				{
					int symbolIndexToCompare = slot.reels[reel].symbols[range].GetComponent<SlotSymbol>().symbolIndex;
					foreach(int symbolInSet in currentSet.symbols)
					{
						if (symbolInSet == symbolIndexToCompare) {
							matches++;
							winData.symbols.Add(slot.reels[reel].symbols[range]);
							break;
						}
					}

				}

			}

			if (matches > 0)
			{
				if (slot.setPays[currentSymbolSetIndex].pays.Count < matches)
				{
					slot.logConfigError(SlotErrors.CLAMP_SCATTER);
					return;
				}
				int pay = slot.setPays[currentSymbolSetIndex].pays[matches-1] * slot.GetComponent<SlotCredits>().betPerLine;
				if (pay > 0)
				{
					winData.lineNumber = -1;
					winData.matches = matches;
					winData.paid = pay;
					winData.setType = currentSet.typeofSet;
					winData.setIndex = currentSymbolSetIndex;
					winData.setName = slot.symbolSetNames[winData.setIndex];
					winData.readout = winData.matches + " " + winData.setName + " SCATTER PAYS " + winData.paid;
					winData.readout = winData.readout.ToUpper();
					lineResultData.Add (winData);

					slotWinSpin.totalWon += lineResultData[lineResultData.Count-1].paid;
					slot.computedWinLine(winData);
					slotWinSpin.totalWonAdjusted += lineResultData[lineResultData.Count-1].paid;
				}

			}
		}
		//return totalLineWon;
	}
Esempio n. 17
0
	private void OnLineWinComputed(SlotWinData win)
	{
		slot.log ("OnLineWinComputed Callback");

		int matches = 5;
		while (matches < 8) {
			// search line results for the set name and the matches
			int jackPot = slot.refs.compute.lineResultData.FindIndex(item => item.setName == "Jackpot" && item.matches == matches);

			if (jackPot > -1) {
				win.setPaid(scatters.GetScatter(matches-5));
				slot.refs.compute.lineResultData[jackPot] = win;
				scatters.ResetScatter(matches-5);
				matches=8;
			}
			matches++;
		}

		slot.log ("win line " + win.lineNumber + " :: set: " + win.setName + " (" + win.setIndex + ") paid: " + win.paid + " matches: " + win.matches);
	}
Esempio n. 18
0
    void showWin()
    {
        winLineOffset = findNextWin ();
        if (winLineOffset == -1) return;

        winTimeout = 0;

        currentWin = slot.refs.compute.lineResultData[winLineOffset];
        GetComponent<Slot>().displayedWinLine(currentWin, !cycled);

        for (int i = 0; i < currentWin.symbols.Count; i++)
        {
            if (slot.winboxPrefabs[currentWin.symbols[i].GetComponent<SlotSymbol>().symbolIndex] != null)
            {
                GameObject winbox;
                if (slot.usePool)
                {
                    winbox = slot.getWinboxFromPool(currentWin.symbols[i].GetComponent<SlotSymbol>().symbolIndex);
                } else {
                    winbox = (GameObject)Instantiate(slot.winboxPrefabs[currentWin.symbols[i].GetComponent<SlotSymbol>().symbolIndex]);
                }
                winbox.transform.localScale = Vector3.Scale(winbox.transform.localScale, transform.localScale);
                winbox.transform.parent = currentWin.symbols[i].transform;//.parent.transform;// GetComponent<Slot>().reels[i].symbols[pos[i]].transform;
                winbox.transform.position = currentWin.symbols[i].transform.position;
                winboxes.Add (winbox);
            }
        }
    }
Esempio n. 19
0
	void showWin()
	{
		winLineOffset = findNextWin ();
		if (winLineOffset == -1) return;

		winTimeout = 0; 

		currentWin = slot.refs.compute.lineResultData[winLineOffset];
		GetComponent<Slot>().displayedWinLine(currentWin, !cycled);

		//for (int i = 0; i < slot.displayLineBoxes; i++)
		int winSymbolCount = slot.reels.Count;
		switch (currentWin.setType) {
		case SetsType.normal:
			break;
		case SetsType.scatter:
			winSymbolCount = currentWin.symbols.Count;
			break;
		}

		for (int i = 0; i < winSymbolCount; i++)
		{
			//if ((currentWin.setType == SetsType.normal) && (i >= slot.displayLineBoxes)) continue;
			if (i < currentWin.matches)
			{

				//if (slot.displayLineBoxes[currentWin.symbols[i].GetComponent<SlotSymbol>().reelIndex] == false) continue;
				//Debug.Log ("reel:" + currentWin.symbols[i].GetComponent<SlotSymbol>().reelIndex);
				if (slot.winboxPrefabs[currentWin.symbols[i].GetComponent<SlotSymbol>().symbolIndex] != null)
				{
					GameObject winbox;
					if (slot.usePool)
					{
						winbox = slot.getWinboxFromPool(currentWin.symbols[i].GetComponent<SlotSymbol>().symbolIndex);
					} else {
						winbox = (GameObject)Instantiate(slot.winboxPrefabs[currentWin.symbols[i].GetComponent<SlotSymbol>().symbolIndex]);
					}
					winbox.transform.localScale = Vector3.Scale(winbox.transform.localScale, transform.localScale);
					winbox.transform.parent = currentWin.symbols[i].transform;//.parent.transform;// GetComponent<Slot>().reels[i].symbols[pos[i]].transform;
					winbox.transform.position = currentWin.symbols[i].transform.position;
					winboxes.Add (winbox);
				}
			} else {
				//if (slot.displayLineBoxes[i] == false) continue;
				if ((slot.lineboxPrefab != null) && (currentWin.setType != SetsType.scatter))
				{
					GameObject linebox;
					linebox = (GameObject)Instantiate(slot.lineboxPrefab);

					linebox.transform.localScale = Vector3.Scale(linebox.transform.localScale, transform.localScale);
					linebox.transform.parent = slot.reels[i].symbols[slot.lines[slot.refs.compute.lineResultData[winLineOffset].lineNumber].positions[i]].transform;// currentWin.symbols[i].transform;//.parent.transform;// GetComponent<Slot>().reels[i].symbols[pos[i]].transform;
					linebox.transform.position = slot.reels[i].symbols[slot.lines[slot.refs.compute.lineResultData[winLineOffset].lineNumber].positions[i]].transform.position; // currentWin.symbols[i].transform.position;
					lineboxes.Add (linebox);
				}
			}

		}
	}
Esempio n. 20
0
	private void OnLineWinDisplayed(SlotWinData win, bool isFirstLoop)
	{
		// Itterate through symbols that make up the win
		foreach(GameObject symbol in win.symbols)
		{
			// if there is an animator component, play the win animation
			if (symbol.GetComponent<Animator>())
				symbol.GetComponent<Animator>().SetTrigger("playwin");
		}
		slot.log ("OnLineWinDisplayed Callback");
		slot.log ("win line " + win.lineNumber + " :: set: " + win.setName + " (" + win.setIndex + ") paid: " + win.paid + " matches: " + win.matches);
	}
Esempio n. 21
0
	int calculatePayForLine(int lineNumber) {

		int highMatches = 0;
		int highPaid = 0;
		int highSet = 0;

		if (slot.symbolSets.Count == 0)
		{
			slot.logConfigError(SlotErrors.NO_SYMBOLSETS);
			return 0;
		}

		SlotWinData winData = new SlotWinData(lineNumber);

		List<int> linePositions = slot.lines[lineNumber].positions;

		for(int currentSymbolSetIndex = 0; currentSymbolSetIndex < slot.symbolSets.Count; currentSymbolSetIndex++)
		{
			SetsWrapper currentSet = slot.symbolSets[currentSymbolSetIndex];
			if (currentSet.typeofSet != SetsType.normal) continue;

			int numberOfMatchingSymbols = 0;
			List<GameObject> winningSymbols = new List<GameObject>();

			for (int currentLinePosition = 0; currentLinePosition < linePositions.Count; currentLinePosition++)
			{
				int symbolIndexToCompare = slot.reels[currentLinePosition].symbols[linePositions[currentLinePosition]].GetComponent<SlotSymbol>().symbolIndex;

				bool foundMatchingSymbolInSet = false;
				foreach(int symbolInSet in currentSet.symbols)
				{
					if ((symbolInSet == symbolIndexToCompare) || (slot.symbolInfo[symbolIndexToCompare].isWild && currentSet.allowWilds))
					//if ((symbolInSet == symbolIndexToCompare) || (slot.symbolPrefabs[symbolIndexToCompare].GetComponent<SlotSymbol>().isWild && currentSet.allowWilds))
					{ 
						foundMatchingSymbolInSet = true; 
						numberOfMatchingSymbols++; 
						winningSymbols.Add(slot.reels[currentLinePosition].symbols[linePositions[currentLinePosition]]);
						break;
					}
				}
				// if no match is found, abort the search, since the set is no longer consecutive
				if (!foundMatchingSymbolInSet)
					break;
			}
			if ((numberOfMatchingSymbols >= highMatches) && numberOfMatchingSymbols > 0)
			{
				int pay = slot.setPays[currentSymbolSetIndex].pays[numberOfMatchingSymbols-1] * slot.refs.credits.betPerLine;

				if (pay > highPaid)
				{
					highMatches = numberOfMatchingSymbols;
					highPaid = pay;
					highSet = currentSymbolSetIndex;
					winData.symbols = winningSymbols;
				}
			}
		}

		if (highPaid > 0) {
			winData.lineNumber = lineNumber;
			winData.matches = highMatches;
			winData.paid = highPaid;
			winData.setIndex = highSet;
			winData.setType = slot.symbolSets[winData.setIndex].typeofSet;
			winData.setName = slot.symbolSetNames[winData.setIndex];
			winData.readout = winData.matches + " " +  winData.setName + " ON LINE " + (winData.lineNumber + 1) + " PAYS " + winData.paid;
			winData.readout = winData.readout.ToUpper();
			lineResultData.Add (winData);

			slotWinSpin.totalWon += lineResultData[lineResultData.Count-1].paid;
			slot.computedWinLine(winData);
			slotWinSpin.totalWonAdjusted += lineResultData[lineResultData.Count-1].paid;
		}

		return highPaid;
	}
Esempio n. 22
0
 private void OnSpinBegin(SlotWinData data)
 {
     slot.refs.lines.hideLines ();
     slot.log ("OnSpinBegin Callback");
 }
Esempio n. 23
0
    int calculateScatterPays()
    {
        if (slot.symbolSets.Count == 0)
        {
            slot.logConfigError(SlotErrors.NO_SYMBOLSETS);
            return(0);
        }
        int totalWon = 0;

        for (int currentSymbolSetIndex = 0; currentSymbolSetIndex < slot.symbolSets.Count; currentSymbolSetIndex++)
        {
            SetsWrapper currentSet = slot.symbolSets[currentSymbolSetIndex];
            if (currentSet.typeofSet != SetsType.scatter)
            {
                continue;
            }

            int         matches = 0;
            SlotWinData winData = new SlotWinData(-1);

            for (int reel = 0; reel < slot.numberOfReels; reel++)
            {
                for (int range = slot.reelIndent; range < (slot.reelHeight - slot.reelIndent); range++)
                {
                    int symbolIndexToCompare = slot.reels[reel].symbols[range].GetComponent <SlotSymbol>().symbolIndex;
                    foreach (int symbolInSet in currentSet.symbols)
                    {
                        if (symbolInSet == symbolIndexToCompare)
                        {
                            matches++;
                            winData.symbols.Add(slot.reels[reel].symbols[range]);
                            break;
                        }
                    }
                }
            }

            if (matches > 0)
            {
                if (slot.setPays[currentSymbolSetIndex].pays.Count < matches)
                {
                    slot.logConfigError(SlotErrors.CLAMP_SCATTER);
                    return(0);
                }
                int pay = slot.setPays[currentSymbolSetIndex].pays[matches - 1] * slot.GetComponent <SlotCredits>().betPerLine;
                if (pay > 0)
                {
                    winData.lineNumber = -1;
                    winData.matches    = matches;
                    winData.paid       = pay;
                    winData.setType    = currentSet.typeofSet;
                    winData.setIndex   = currentSymbolSetIndex;
                    winData.setName    = slot.symbolSetNames[winData.setIndex];
                    winData.readout    = winData.matches + " " + winData.setName + " Scatter pays " + winData.paid;
                    lineResultData.Add(winData);

                    slot.computedWinLine(winData);
                    totalWon += lineResultData[lineResultData.Count - 1].paid;
                }
            }
        }
        return(totalWon);
    }
Esempio n. 24
0
 private void OnLineWinComputed(SlotWinData win)
 {
     slot.log ("OnLineWinComputed Callback");
     slot.log ("win line " + win.lineNumber + " :: set: " + win.setName + " (" + win.setIndex + ") paid: " + win.paid + " matches: " + win.matches);
 }