Exemplo n.º 1
0
 public void StartDrag()
 {
     if (Phases.CurrentPhase.GetType() == typeof(MainPhases.SetupPhase))
     {
         StartingZone         = BoardManager.GetStartingZone(Phases.CurrentSubPhase.RequiredPlayer);
         isInsideStartingZone = false;
         Roster.SetRaycastTargets(false);
         Roster.AllShipsHighlightOff();
         BoardManager.HighlightStartingZones();
         inReposition = true;
     }
 }
Exemplo n.º 2
0
        public override void Initialize()
        {
            UI.HideContextMenu();

            Selection.ThisShip.IsManeuverPerformed = true;
            Roster.AllShipsHighlightOff();

            Selection.ThisShip.ObstaclesHit = new List <GenericObstacle>();
            Selection.ThisShip.MinesHit     = new List <GameObject>();

            CheckAssignedManeuver();
        }
Exemplo n.º 3
0
 private void HighlightShips()
 {
     Roster.AllShipsHighlightOff();
     foreach (var ship in Roster.GetPlayer(RequiredPlayer).Ships)
     {
         if ((ship.Value.PilotSkill == RequiredPilotSkill) && (!ship.Value.IsManeuverPerformed))
         {
             ship.Value.HighlightCanBeSelectedOn();
             Roster.RosterPanelHighlightOn(ship.Value);
         }
     }
 }
Exemplo n.º 4
0
    private static void InitializeAttack()
    {
        Roster.AllShipsHighlightOff();

        AttackStep = CombatStep.Attack;
        CallAttackStartEvents();
        Selection.ActiveShip = Attacker;
        if (SecondaryWeapon != null)
        {
            SecondaryWeapon.PayAttackCost();
        }
    }
Exemplo n.º 5
0
    private static void InitializeAttack(Action callBack)
    {
        Roster.AllShipsHighlightOff();

        AttackStep = CombatStep.Attack;
        CallAttackStartEvents();
        Selection.ActiveShip = Attacker;
        Triggers.ResolveTriggers(TriggerTypes.OnAttackStart, delegate
        {
            ChosenWeapon.PayAttackCost(callBack);
        });
    }
Exemplo n.º 6
0
        public override void Initialize()
        {
            UI.HideContextMenu();

            Selection.ThisShip.IsManeuverPerformed = true;
            Roster.AllShipsHighlightOff();

            Selection.ThisShip.ObstaclesHit = new List <Collider>();
            Selection.ThisShip.MinesHit     = new List <GameObject>();

            Selection.ThisShip.CallManeuverIsReadyToBeRevealed(RevealManeuver);
        }
Exemplo n.º 7
0
 public void StartDrag()
 {
     if (Phases.CurrentPhase.GetType() == typeof(MainPhases.SetupPhase))
     {
         StartingZone         = BoardManager.GetStartingZone(Phases.CurrentSubPhase.RequiredPlayer);
         isInsideStartingZone = false;
         Roster.SetRaycastTargets(false);
         Roster.AllShipsHighlightOff();
         BoardManager.HighlightStartingZones();
         Selection.ThisShip.Model.GetComponentInChildren <ObstaclesStayDetector>().checkCollisions = true;
         inReposition = true;
     }
 }
Exemplo n.º 8
0
 public void ClickNextPhase()
 {
     HideNextButton();
     Roster.AllShipsHighlightOff();
     if (Phases.CurrentSubPhase.GetType() == typeof(SubPhases.CombatSubPhase))
     {
         foreach (var shipHolder in Roster.GetPlayer(Phases.CurrentPhasePlayer).Ships)
         {
             if (shipHolder.Value.PilotSkill == Phases.CurrentSubPhase.RequiredPilotSkill)
             {
                 shipHolder.Value.IsAttackPerformed = true;
             }
         }
     }
     Phases.CallNextSubPhase();
 }
Exemplo n.º 9
0
        public void StartDrag()
        {
            Roster.SetRaycastTargets(false);
            Roster.AllShipsHighlightOff();
            inReposition = true;

            if (CameraScript.InputTouchIsEnabled)
            {
                // Setup touch handler
                touchObjectPlacementHandler.SetShip(Selection.ThisShip);

                // With touch controls, wait for confirmation before setting the position
                UI.ShowNextButton();
            }

            IsReadyForCommands = true;
        }
Exemplo n.º 10
0
    // CHECK LEGALITY OF ATTACK

    public static void TryPerformAttack()
    {
        UI.HideContextMenu();
        MovementTemplates.ReturnRangeRuler();

        if (IsTargetLegalForAttack())
        {
            UI.HideSkipButton();
            Roster.AllShipsHighlightOff();

            DeclareAttackerAndDefender();

            CheckFireLineCollisions();
        }
        else
        {
            Roster.GetPlayer(Phases.CurrentPhasePlayer).OnTargetNotLegalForAttack();
        }
    }
Exemplo n.º 11
0
        public void StartDrag()
        {
            StartingZone         = Board.GetStartingZone(Phases.CurrentSubPhase.RequiredPlayer);
            isInsideStartingZone = false;
            Roster.SetRaycastTargets(false);
            Roster.AllShipsHighlightOff();
            Board.HighlightStartingZones(Phases.CurrentSubPhase.RequiredPlayer);
            Selection.ThisShip.Model.GetComponentInChildren <ObstaclesStayDetector>().checkCollisions = true;
            inReposition = true;

            if (CameraScript.InputTouchIsEnabled)
            {
                // Setup touch handler
                touchObjectPlacementHandler.SetShip(Selection.ThisShip);

                // With touch controls, wait for confirmation before setting the position
                UI.ShowNextButton();
                IsReadyForCommands = true;
            }
        }
Exemplo n.º 12
0
    // CHECK LEGALITY OF ATTACK

    public static void TryPerformAttack(bool isSilent)
    {
        UI.HideContextMenu();
        MovementTemplates.ReturnRangeRuler();

        if (IsTargetLegalForAttack(Selection.AnotherShip, ChosenWeapon, isSilent))
        {
            UI.HideSkipButton();
            Roster.AllShipsHighlightOff();

            DeclareAttackerAndDefender();

            CheckFireLineCollisions();
        }
        else
        {
            IsAttackAlreadyCalled = false;
            Roster.GetPlayer(Phases.CurrentPhasePlayer).OnTargetNotLegalForAttack();
        }
    }
Exemplo n.º 13
0
 public override void Next()
 {
     Roster.AllShipsHighlightOff();
     Phases.CurrentSubPhase = Phases.CurrentSubPhase.PreviousSubPhase;
     UpdateHelpInfo();
 }
Exemplo n.º 14
0
 public override void Initialize()
 {
     Roster.AllShipsHighlightOff();
     PlayerAssignsManeuvers();
 }