Example #1
0
 private void AddSharaBeyActionEffect(Ship.GenericShip ship)
 {
     ship.AddAvailableDiceModification(new ActionsList.SharaBeyAction()
     {
         Host = HostShip
     });
 }
Example #2
0
    public static void PlayFly(Ship.GenericShip ship)
    {
        int soundsCount   = ship.SoundFlyPaths.Count;
        int selectedIndex = Random.Range(0, soundsCount);

        PlayShipSound(ship.SoundFlyPaths[selectedIndex]);
    }
Example #3
0
 private void RegisterR5K6Ability(Ship.GenericShip ship, System.Type type)
 {
     if (type == typeof(Tokens.BlueTargetLockToken))
     {
         RegisterAbilityTrigger(TriggerTypes.OnTokenIsSpent, StartSubphaseForR5K6Ability);
     }
 }
Example #4
0
 private void AddJessPavaActionEffect(Ship.GenericShip host)
 {
     ActionsList.GenericAction newAction = new ActionsList.JessPavaActionEffect();
     newAction.Host     = host;
     newAction.ImageUrl = host.ImageUrl;
     host.AddAvailableDiceModification(newAction);
 }
Example #5
0
 private void AddBobaFettSVActionEffect(Ship.GenericShip host)
 {
     ActionsList.GenericAction newAction = new ActionsList.BobaFettSVActionEffect();
     newAction.Host     = host;
     newAction.ImageUrl = host.ImageUrl;
     host.AddAvailableActionEffect(newAction);
 }
Example #6
0
 private void RegisterJakeFarrellAbility(Ship.GenericShip ship, Type tokenType)
 {
     if (tokenType == typeof(Tokens.FocusToken))
     {
         RegisterAbilityTrigger(TriggerTypes.OnTokenIsAssigned, FreeRepositionAction);
     }
 }
Example #7
0
 private void R5D8AddAction(Ship.GenericShip host)
 {
     ActionsList.GenericAction action = new ActionsList.R5D8Action()
     {
         ImageUrl = HostUpgrade.ImageUrl
     };
     host.AddAvailableAction(action);
 }
Example #8
0
        public override void DiscardEffect(Ship.GenericShip host)
        {
            Messages.ShowInfo("Pilot Skill is restored");

            host.RemoveToken(typeof(Tokens.DamagedCockpitCritToken));
            host.RemovePilotSkillModifier(this);
            Roster.UpdateShipStats(host);
        }
Example #9
0
 private void SquadLeaderAddAction(Ship.GenericShip host)
 {
     ActionsList.GenericAction newAction = new ActionsList.SquadLeaderAction()
     {
         ImageUrl = ImageUrl, Host = this.Host
     };
     host.AddAvailableAction(newAction);
 }
Example #10
0
 private void CheckAbility(Ship.GenericShip ship)
 {
     if (Combat.AttackStep == CombatStep.Defence && Combat.Attacker.Tokens.HasToken <JamToken>())
     {
         var action = new CaptainFerophAction(HostShip);
         ship.AddAvailableActionEffect(action);
     }
 }
Example #11
0
        private static void SetShip(Ship.GenericShip ship, int count)
        {
            float distance = CalculateDistance(ship.Owner.Ships.Count);
            float side     = (ship.Owner.PlayerNo == Players.PlayerNo.Player1) ? -1 : 1;

            ship.SetPosition(BoardIntoWorld(new Vector3(-SIZE_X / 2 + count * distance, 0, side * SIZE_Y / 2 + +side * 2 * RANGE_1)));
            ship.SetPosition(BoardIntoWorld(new Vector3(-SIZE_X / 2 + count * distance, 0, side * SIZE_Y / 2 + -side * 2 * RANGE_1)));
        }
        private void AddAction(Ship.GenericShip host)
        {
            var alreadyHasAction = host.BuiltInActions.Find(n => n.GetType() == typeof(T));

            if (alreadyHasAction == null)
            {
                host.AddAvailableAction(new T());
            }
        }
Example #13
0
        public override void AttachToShip(Ship.GenericShip host)
        {
            base.AttachToShip(host);

            host.OnAttackStartAsDefender += RegisterTrigger;

            Phases.OnEndPhaseStart_NoTriggers += Cleanup;
            Host.OnShipIsDestroyed            += StopAbility;
        }
Example #14
0
 private void AddT65BAction(Ship.GenericShip host)
 {
     ActionsList.GenericAction newAction = new ActionsList.T65BAction()
     {
         ImageUrl = ImageUrl,
         Host     = Host
     };
     host.AddAvailableAction(newAction);
 }
Example #15
0
        public override void AttachToShip(Ship.GenericShip host)
        {
            base.AttachToShip(host);

            host.OnActionIsPerformed += CheckConditions;

            Phases.OnEndPhaseStart += Cleanup;
            Host.OnDestroyed       += StopAbility;
        }
Example #16
0
 private void AddGlitterstimDiceModification(Ship.GenericShip host)
 {
     ActionsList.GenericAction newAction = new ActionsList.GlitterstimDiceModification()
     {
         ImageUrl = ImageUrl,
         Host     = Host
     };
     host.AddAvailableActionEffect(newAction);
 }
Example #17
0
 private void CheckR2AstromechAbility(Ship.GenericShip ship, ref Movement.MovementStruct movement)
 {
     if (movement.ColorComplexity != Movement.MovementComplexity.None)
     {
         if ((movement.Speed == Movement.ManeuverSpeed.Speed1) || (movement.Speed == Movement.ManeuverSpeed.Speed2))
         {
             movement.ColorComplexity = Movement.MovementComplexity.Easy;
         }
     }
 }
Example #18
0
 private void TurnManeuversAreHarder(Ship.GenericShip ship, ref Movement.ManeuverHolder movement)
 {
     if (movement.ColorComplexity != Movement.MovementComplexity.None)
     {
         if (movement.Bearing == Movement.ManeuverBearing.Turn)
         {
             movement.ColorComplexity = Movement.GenericMovement.IncreaseComplexity(movement.ColorComplexity);
         }
     }
 }
Example #19
0
 private void T65DA1Ability(Ship.GenericShip ship, ref Movement.MovementStruct movement)
 {
     if (movement.ColorComplexity != Movement.ManeuverColor.None)
     {
         if (movement.Speed == Movement.ManeuverSpeed.Speed2)
         {
             movement.ColorComplexity = Movement.ManeuverColor.Green;
         }
     }
 }
Example #20
0
        public virtual bool IsShotAvailable(Ship.GenericShip targetShip)
        {
            bool result = true;

            if (isDiscarded)
            {
                return(false);
            }

            int range;

            if (!CanShootOutsideArc)
            {
                Board.ShipShotDistanceInformation shotInfo = new Board.ShipShotDistanceInformation(Host, targetShip, this);
                range = shotInfo.Range;

                if (!shotInfo.InShotAngle)
                {
                    return(false);
                }
            }
            else
            {
                Board.ShipDistanceInformation distanceInfo = new Board.ShipDistanceInformation(Host, targetShip);
                range = distanceInfo.Range;
            }

            if (range < MinRange)
            {
                return(false);
            }
            if (range > MaxRange)
            {
                return(false);
            }

            if (RequiresTargetLockOnTargetToShoot)
            {
                if (!Actions.HasTargetLockOn(Host, targetShip))
                {
                    return(false);
                }
            }

            if (RequiresFocusToShoot)
            {
                if (!Host.HasToken(typeof(Tokens.FocusToken)))
                {
                    return(false);
                }
            }

            return(result);
        }
Example #21
0
        private Dictionary <string, float> GetSpaceBetween(Ship.GenericShip thisShip, Ship.GenericShip anotherShip)
        {
            Dictionary <string, float> result = new Dictionary <string, float>();

            Dictionary <string, float> thisShipBounds    = thisShip.ShipBase.GetBounds();
            Dictionary <string, float> anotherShipBounds = anotherShip.ShipBase.GetBounds();

            result.Add("Left", thisShipBounds["minX"] - anotherShipBounds["maxX"]);
            result.Add("Right", anotherShipBounds["minX"] - thisShipBounds["maxX"]);
            result.Add("Down", thisShipBounds["minZ"] - anotherShipBounds["maxZ"]);
            result.Add("Up", anotherShipBounds["minZ"] - thisShipBounds["maxZ"]);

            return(result);
        }
Example #22
0
 private void RegisterNienNunbAbility(Ship.GenericShip ship, System.Type tokenType)
 {
     if (tokenType == typeof(Tokens.StressToken))
     {
         var shipCount = Roster.AllShips.Values
                         .Where(s => s.Owner.Id != HostShip.Owner.Id)
                         .Where(s =>
         {
             ShotInfo arcInfo = new ShotInfo(HostShip, s, HostShip.PrimaryWeapon);
             return(arcInfo.InArc && arcInfo.Range <= 1);
         })
                         .Count();
         if (shipCount >= 1)
         {
             RegisterAbilityTrigger(TriggerTypes.OnTokenIsAssigned, AskRemoveStress);
         }
     }
 }
Example #23
0
        private void DoSecondAction(Ship.GenericShip ship)
        {
            Host.OnActionDecisionSubphaseEnd -= DoSecondAction;

            if (!ship.HasToken(typeof(Tokens.StressToken)) || ship.CanPerformActionsWhileStressed)
            {
                IsUsed = true;
                Triggers.RegisterTrigger(
                    new Trigger()
                {
                    Name         = "Push The Limit Action",
                    TriggerOwner = ship.Owner.PlayerNo,
                    TriggerType  = TriggerTypes.OnFreeAction,
                    EventHandler = PerformPushAction
                }
                    );
            }
        }
Example #24
0
        public override bool ThisShipCanBeSelected(Ship.GenericShip ship, int mouseKeyIsPressed)
        {
            bool result = false;

            if ((ship.Owner.PlayerNo == RequiredPlayer) && (ship.PilotSkill == RequiredPilotSkill) && (Roster.GetPlayer(RequiredPlayer).GetType() == typeof(Players.HumanPlayer)))
            {
                if (ship.IsSetupPerformed == false)
                {
                    result = true;
                }
                else
                {
                    Messages.ShowErrorToHuman("Ship cannot be selected: Starting position is already set");
                }
            }
            else
            {
                Messages.ShowErrorToHuman("Ship cannot be selected:\n Need " + Phases.CurrentSubPhase.RequiredPlayer + " and pilot skill " + Phases.CurrentSubPhase.RequiredPilotSkill);
            }
            return(result);
        }
Example #25
0
 public override void AttachToShip(Ship.GenericShip host)
 {
     base.AttachToShip(host);
 }
 public static Movement.GenericMovement MovementFromString(string parameters, Ship.GenericShip ship = null)
 {
     Movement.MovementStruct movementStruct = new Movement.MovementStruct(parameters, ship);
     return(MovementFromStruct(movementStruct));
 }
Example #27
0
        public override void AttachToShip(Ship.GenericShip host)
        {
            base.AttachToShip(host);

            host.AfterGenerateAvailableActionsList += MarksmanshipAddAction;
        }
Example #28
0
 public override bool IsAllowedForShip(Ship.GenericShip ship)
 {
     return(ship.faction == Faction.Rebel);
 }
Example #29
0
 private void MarksmanshipAddAction(Ship.GenericShip host)
 {
     ActionsList.GenericAction newAction = new ActionsList.MarksmanshipAction();
     newAction.ImageUrl = ImageUrl;
     host.AddAvailableAction(newAction);
 }
Example #30
0
 private void MarksmanshipAddDiceModification(Ship.GenericShip ship)
 {
     ship.AddAvailableActionEffect(this);
 }