public void Payout() { HitNumber currentHitType = GetCurrentHitType(); foreach (BigWheelBettingTerminal terminal in terminals) { if (terminal.isClient) { continue; } bool flag = false; bool flag2 = false; Item slot = terminal.inventory.GetSlot((int)currentHitType.hitType); if (slot != null) { int num = currentHitType.ColorToMultiplier(currentHitType.hitType); if (Interface.CallHook("OnBigWheelWin", this, slot, terminal, num) != null) { return; } slot.amount += slot.amount * num; slot.RemoveFromContainer(); slot.MoveToContainer(terminal.inventory, 5); flag = true; } for (int i = 0; i < 5; i++) { Item slot2 = terminal.inventory.GetSlot(i); if (Interface.CallHook("OnBigWheelLoss", this, slot2, terminal) != null) { return; } if (slot2 != null) { slot2.Remove(); flag2 = true; } } if (flag || flag2) { terminal.ClientRPC(null, "WinOrLoseSound", flag); } } ItemManager.DoRemoves(); SetTerminalsLocked(false); }
public void Payout() { HitNumber currentHitType = this.GetCurrentHitType(); foreach (BigWheelBettingTerminal terminal in this.terminals) { if (terminal.isClient) { continue; } bool flag = false; bool flag1 = false; Item slot = terminal.inventory.GetSlot((int)currentHitType.hitType); if (slot != null) { int multiplier = currentHitType.ColorToMultiplier(currentHitType.hitType); Item item = slot; item.amount = item.amount + slot.amount * multiplier; slot.RemoveFromContainer(); slot.MoveToContainer(terminal.inventory, 5, true); flag = true; } for (int i = 0; i < 5; i++) { Item slot1 = terminal.inventory.GetSlot(i); if (slot1 != null) { Interface.CallHook("OnBigWheelLoss", this, slot1); slot1.Remove(0f); flag1 = true; } } if (!(flag | flag1)) { continue; } terminal.ClientRPC <bool>(null, "WinOrLoseSound", flag); } ItemManager.DoRemoves(); this.SetTerminalsLocked(false); }
public void Payout() { HitNumber currentHitType = this.GetCurrentHitType(); foreach (BigWheelBettingTerminal terminal in this.terminals) { if (!terminal.isClient) { bool flag1 = false; bool flag2 = false; Item slot1 = terminal.inventory.GetSlot((int)currentHitType.hitType); if (slot1 != null) { int multiplier = currentHitType.ColorToMultiplier(currentHitType.hitType); slot1.amount += slot1.amount * multiplier; slot1.RemoveFromContainer(); slot1.MoveToContainer(terminal.inventory, 5, true); flag1 = true; } for (int slot2 = 0; slot2 < 5; ++slot2) { Item slot3 = terminal.inventory.GetSlot(slot2); if (slot3 != null) { slot3.Remove(0.0f); flag2 = true; } } if (flag1 | flag2) { terminal.ClientRPC <bool>((Connection)null, "WinOrLoseSound", flag1); } } } ItemManager.DoRemoves(); this.SetTerminalsLocked(false); }