// ROLL public void Roll(DelegateDiceroll callBack) { DiceRoll.CurrentDiceRoll = this; this.CallBack = callBack; if (!ShouldSkipToSync()) { if (!DebugManager.BatchAiSquadTestingModeActive) { foreach (Die die in DiceList) { die.RandomizeRotation(); } RollPreparedDice(); } else { System.Random random = new System.Random(); DieSide[] sides = PossibleSides[Type]; foreach (Die die in DiceList) { die.TrySetSide(sides[random.Next(0, 8)], isInitial: true); } Roster.GetPlayer(Phases.CurrentSubPhase.RequiredPlayer).SyncDiceResults(); Phases.CurrentSubPhase.IsReadyForCommands = true; } } else { Roster.GetPlayer(Phases.CurrentSubPhase.RequiredPlayer).SyncDiceResults(); Phases.CurrentSubPhase.IsReadyForCommands = true; } }
public void RerollSelected(DelegateDiceroll callBack) { this.callBack = callBack; if (ReplaysManager.Mode == ReplaysMode.Write) { if (!Network.IsNetworkGame) { foreach (Die die in DiceList) { if (die.IsSelected) { die.RandomizeRotation(); } } RerollPreparedDice(); } else { if (DebugManager.DebugNetwork) { UI.AddTestLogEntry("DiceRoll.SyncSelectedDice"); } Network.SyncSelectedDiceAndReroll(); } } else { CurrentDiceRoll.DeselectDice(); Phases.CurrentSubPhase.IsReadyForCommands = true; Roster.GetPlayer(Phases.CurrentSubPhase.RequiredPlayer).SyncDiceResults(); } }
public void RollInDice(Action callBack) { this.callBack = delegate { TryUnblockButtons(this); callBack(); }; if (Selection.ActiveShip.Owner.GetType() == typeof(Players.HumanPlayer)) { BlockButtons(); } Die newDie = AddDice(); if (!Network.IsNetworkGame) { newDie.RandomizeRotation(); BeforeRollAdditionalPreparedDice(); } else { Network.GenerateRandom(new Vector2(0, 360), 3, SetAdditionalDiceInitialRotation, BeforeRollAdditionalPreparedDice); } /*Combat.Defender.CallDiceAboutToBeRolled(); * Triggers.ResolveTriggers(TriggerTypes.OnDiceAboutToBeRolled, delegate * { * Combat.CurrentDiceRoll.RollAdditionalDice(1); * Combat.CurrentDiceRoll.OrganizeDicePositions(); * callBack(); * });*/ }
static IEnumerator WaitForResults(DiceRoll diceRoll, DelegateDiceroll callBack) { yield return(new WaitForSeconds(WAIT_FOR_DICE_SECONDS)); //OrganizeDicePositions(diceRoll); diceRoll.CalculateWaitedResults(); callBack(diceRoll); }
public override void Start() { IsTemporary = true; finishAction = FinishAction; checkResults = CheckResults; Prepare(); Initialize(); UpdateHelpInfo(); }
public void Roll(DelegateDiceroll callBack) { this.callBack = callBack; foreach (Dice dice in DiceList) { dice.Roll(); } CalculateResults(); }
public override void Start() { Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); IsTemporary = true; finishAction = FinishAction; checkResults = CheckResults; Prepare(); Initialize(); UpdateHelpInfo(); }
public void RerollSelected(DelegateDiceroll callBack) { this.callBack = callBack; foreach (var dice in DiceList) { if (dice.IsSelected) { dice.Reroll(); } } CalculateResults(); }
public void RollInDice(Action callBack) { this.callBack = delegate { TryUnblockButtons(this); callBack(); }; if (Selection.ActiveShip.Owner.GetType() == typeof(Players.HumanPlayer)) { BlockButtons(); } Die newDie = AddDice(); newDie.RandomizeRotation(); BeforeRollAdditionalPreparedDice(); }
// ROLL IN public void RollInDice(DelegateDiceroll callBack) { CallBack = callBack; Die newDie = AddDice(); if (!ShouldSkipToSync()) { newDie.RandomizeRotation(); Selection.ActiveShip.CallDiceAboutToBeRolled(RollAdditionalPreparedDice); } else { Roster.GetPlayer(Phases.CurrentSubPhase.RequiredPlayer).SyncDiceResults(); Phases.CurrentSubPhase.IsReadyForCommands = true; } }
public override void Start() { base.Start(); IsTemporary = true; if (AfterRoll == null) { AfterRoll = FinishAction; } checkResults = CheckResults; Prepare(); Initialize(); UpdateHelpInfo(); }
public void Roll(DelegateDiceroll callBack) { DiceRoll.CurrentDiceRoll = this; this.callBack = callBack; if (!ShouldSkipToSync()) { foreach (Die die in DiceList) { die.RandomizeRotation(); } RollPreparedDice(); } else { Roster.GetPlayer(Phases.CurrentSubPhase.RequiredPlayer).SyncDiceResults(); } }
public void Roll(DelegateDiceroll callBack) { DiceRoll.CurrentDiceRoll = this; this.callBack = callBack; if (!Network.IsNetworkGame) { foreach (Die die in DiceList) { die.RandomizeRotation(); } RollPreparedDice(); } else { if (DebugManager.DebugNetwork) { UI.AddTestLogEntry("DiceRoll.Roll"); } Network.GenerateRandom(new Vector2(0, 360), DiceList.Count * 3, SetDiceInitialRotation, RollPreparedDice); } }
// REROLL public void RerollSelected(DelegateDiceroll callBack) { DiceRoll.CurrentDiceRoll = this; this.CallBack = callBack; if (!ShouldSkipToSync()) { foreach (Die die in DiceList) { if (die.IsSelected) { die.RandomizeRotation(); } } RerollPreparedDice(); } else { CurrentDiceRoll.DeselectAll(); Roster.GetPlayer(Phases.CurrentSubPhase.RequiredPlayer).SyncDiceResults(); Phases.CurrentSubPhase.IsReadyForCommands = true; } }
public void RerollSelected(DelegateDiceroll callBack) { this.callBack = callBack; if (!Network.IsNetworkGame) { foreach (Die die in DiceList) { if (die.IsSelected) { die.RandomizeRotation(); } } RerollPreparedDice(); } else { if (DebugManager.DebugNetwork) { UI.AddTestLogEntry("DiceRoll.SyncSelectedDice"); } Network.SyncSelectedDiceAndReroll(); } }
public void CalculateResults(DelegateDiceroll callBack) { Dices.PlanWaitForResults(this, callBack); }
public static void PlanWaitForResults(DiceRoll diceRoll, DelegateDiceroll callBack) { Game.StartCoroutine(WaitForResults(diceRoll, callBack)); }
public static void RerollDices(DiceRoll diceRoll, string results, DelegateDiceroll callback) { diceRoll.Reroll(results); Game.StartCoroutine(WaitForResults(diceRoll, callback)); }
public static void RerollOne(DiceRoll diceRoll, DelegateDiceroll callback) { diceRoll.RerollOne(); Game.StartCoroutine(WaitForResults(diceRoll, callback)); }