Exemplo n.º 1
0
 public override string GetPilotImageUrl(GenericShip ship, string filename)
 {
     return(RootUrlForImages + "pilots/" + ImageUrls.FormatFaction(ship.SubFaction) + "/" + ImageUrls.FormatShipType(ship.ShipInfo.ShipName) + "/" + (filename ?? (ImageUrls.FormatName(ship.PilotInfo.PilotName) + ".png")));
 }
Exemplo n.º 2
0
 private void SubscribeToShipSetup(GenericShip host)
 {
     host.OnShipIsPlaced += AskForMobileFiringArcDirection;
 }
Exemplo n.º 3
0
        private void RegisterSecondAttackTrigger(GenericShip ship)
        {
            HostShip.OnCombatCheckExtraAttack -= RegisterSecondAttackTrigger;

            RegisterAbilityTrigger(TriggerTypes.OnCombatCheckExtraAttack, UseGunnerAbility);
        }
Exemplo n.º 4
0
 protected virtual void SnapShotRestrictionForDefender(GenericShip ship, GenericAction action, ref bool data)
 {
     // Do nothing
 }
Exemplo n.º 5
0
        private void DoAnotherAction(GenericShip ship)
        {
            HostShip.OnActionDecisionSubphaseEnd -= DoAnotherAction;

            RegisterAbilityTrigger(TriggerTypes.OnFreeAction, PerformAction);
        }
Exemplo n.º 6
0
        private GenericShip TryToDeclareTarget(GenericShip targetShip, float distance)
        {
            GenericShip selectedTargetShip = targetShip;

            if (DebugManager.DebugAI)
            {
                Debug.Log("AI checks target for attack: " + targetShip);
            }

            if (targetShip.IsReadyToBeDestroyed)
            {
                if (DebugManager.DebugAI)
                {
                    Debug.Log("But this target is already destroyed");
                }
                return(null);
            }

            if (!IsTargetValidForAdditionalAttack(targetShip))
            {
                if (DebugManager.DebugAI)
                {
                    Debug.Log("But this target didn't pass filter of additional attack opportunity");
                }
                return(null);
            }

            if (DebugManager.DebugAI)
            {
                Debug.Log("Ship is selected before validation: " + selectedTargetShip);
            }
            Selection.AnotherShip = selectedTargetShip;

            IShipWeapon chosenWeapon = null;

            foreach (var upgrade in Selection.ThisShip.UpgradeBar.GetUpgradesOnlyFaceup())
            {
                IShipWeapon secondaryWeapon = (upgrade as IShipWeapon);
                if (secondaryWeapon != null)
                {
                    if (Combat.IsTargetLegalForAttack(targetShip, secondaryWeapon, isSilent: true))
                    {
                        chosenWeapon = secondaryWeapon;
                        break;
                    }
                }
            }

            Combat.ChosenWeapon = chosenWeapon ?? Selection.ThisShip.PrimaryWeapon;
            Combat.ShotInfo     = new ShotInfo(Selection.ThisShip, Selection.AnotherShip, Combat.ChosenWeapon);

            if (Combat.IsTargetLegalForAttack(targetShip, Combat.ChosenWeapon, isSilent: true))
            {
                if (DebugManager.DebugAI)
                {
                    Debug.Log("AI target legal: " + Selection.AnotherShip);
                }
            }
            else
            {
                if (DebugManager.DebugAI)
                {
                    Debug.Log("But validation is not passed: " + selectedTargetShip);
                }
                selectedTargetShip = null;
            }

            if (DebugManager.DebugAI)
            {
                Debug.Log("AI decision about " + targetShip + " : " + selectedTargetShip);
            }

            return(selectedTargetShip);
        }
Exemplo n.º 7
0
 protected void PerformManeuverOfShip(GenericShip ship)
 {
     ShipMovementScript.ActivateAndMove(ship.ShipId);
 }
Exemplo n.º 8
0
        private void RegisterExtraAttackAbility(GenericShip ship)
        {
            ship.OnCombatCheckExtraAttack -= RegisterAbility;

            RegisterAbilityTrigger(TriggerTypes.OnCombatCheckExtraAttack, DoCounterAttack);
        }
Exemplo n.º 9
0
 private bool FreeAttackFilter(GenericShip targetShip, IShipWeapon weapon, bool isSilent)
 {
     return(true);
 }
Exemplo n.º 10
0
 public TailGunnerCondition(GenericShip host) : base(host)
 {
     Name      = "Debuff Token";
     Temporary = false;
     Tooltip   = new UpgradesList.FirstEdition.TailGunner().ImageUrl;
 }
Exemplo n.º 11
0
        protected override bool CheckRequirements(GenericShip ship)
        {
            var match = ship.Owner.PlayerNo == HostShip.Owner.PlayerNo;

            return(match);
        }
Exemplo n.º 12
0
        public override void AttachToShip(GenericShip host)
        {
            base.AttachToShip(host);

            host.OnGenerateActions += PerformDropBombAction;
        }
Exemplo n.º 13
0
        private void RegisterAssignStressAfterManeuver(GenericShip ship)
        {
            HostShip.OnMovementFinish -= RegisterAssignStressAfterManeuver;

            RegisterAbilityTrigger(TriggerTypes.OnMovementFinish, AssignStress);
        }
Exemplo n.º 14
0
 protected virtual void CheckAbility(GenericShip ship)
 {
     RegisterTrigger();
 }
Exemplo n.º 15
0
 private bool FilterShipsToSetup(GenericShip ship)
 {
     return(ship.PilotSkill == RequiredPilotSkill && !ship.IsSetupPerformed && ship.Owner.PlayerNo == RequiredPlayer);
 }
Exemplo n.º 16
0
        // REMOVE CONDITIONS

        private void RemoveOwnConditions(GenericShip ship)
        {
            HostShip.Tokens.RemoveCondition(AssignedCondition);
            AssignedCondition = null;
        }
Exemplo n.º 17
0
 public override bool IsAllowedForShip(GenericShip ship)
 {
     return((ship is TIEInterceptor) && (ship.PilotSkill > 4));
 }
Exemplo n.º 18
0
 public ZamWesellSecretCondition(GenericShip host) : base(host)
 {
     Name      = ImageName = "Zam Wesell Secret Condition";
     Temporary = false;
 }
Exemplo n.º 19
0
 public virtual void ActivateShip(GenericShip ship)
 {
     Selection.ChangeActiveShip("ShipId:" + ship.ShipId);
     PerformManeuverOfShip(ship);
 }
Exemplo n.º 20
0
 public YouShouldThankMeCondition(GenericShip host) : base(host)
 {
     Name    = "You Should Thank Me";
     Tooltip = (IsRevealed) ? "https://images-cdn.fantasyflightgames.com/filer_public/30/68/3068be81-f299-4c69-b5ee-307ac1da9c89/swz82_a1_thank-me.png" : null;
 }
Exemplo n.º 21
0
 public override bool IsAllowedForShip(GenericShip ship)
 {
     return(ship is Ship.G1AStarfighter.G1AStarfighter);
 }
Exemplo n.º 22
0
 public YoudBetterMeanBusiness(GenericShip host) : base(host)
 {
     Name    = "You'd Better Mean Business";
     Tooltip = (IsRevealed) ? "https://images-cdn.fantasyflightgames.com/filer_public/24/92/2492e698-3402-4ec8-9a8d-bc7e30aea98c/swz82_a1_mean-business.png" : null;
 }
Exemplo n.º 23
0
 private void RemoveSnapShotRestrictionForAttacker(GenericShip ship)
 {
     ship.OnTryAddAvailableDiceModification -= SnapShotRestrictionForAttacker;
     ship.OnAttackFinish -= RemoveSnapShotRestrictionForAttacker;
 }
Exemplo n.º 24
0
 protected virtual void LoseCharges(GenericShip ship)
 {
     Messages.ShowInfo($"{HostShip.PilotInfo.PilotName}: 2 Charges are lost during Setup");
     HostShip.State.Charges -= 2;
 }
Exemplo n.º 25
0
 private bool FilterTargets(GenericShip ship)
 {
     return(FilterByTargetType(ship, TargetTypes.Enemy) && FilterTargetsByRange(ship, 0, 1));
 }
Exemplo n.º 26
0
 private void CheckAbility(GenericShip ship, ref bool flag)
 {
     flag = true;
 }
Exemplo n.º 27
0
        public ArcDualTurretA(GenericShipBase shipBase) : base(shipBase)
        {
            ArcType = ArcType.SingleTurret;

            // Arcs

            MobileArcParameters = new List <MobileSubArc>
            {
                new MobileSubArc
                (
                    ArcFacing.Front,
                    new Dictionary <Vector3, float>()
                {
                    { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), -40f },
                    { new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), 40f }
                },
                    new List <Vector3>()
                {
                    new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0),
                    new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0),
                }
                ),
                new MobileSubArc
                (
                    ArcFacing.Left,
                    new Dictionary <Vector3, float>()
                {
                    { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), -140f },
                    { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), -40f }
                },
                    new List <Vector3>()
                {
                    new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0),
                    new Vector3(-shipBase.HALF_OF_SHIPSTAND_SIZE, 0, 0),
                    new Vector3(-shipBase.HALF_OF_SHIPSTAND_SIZE, 0, -shipBase.SHIPSTAND_SIZE),
                    new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE),
                }
                ),
                new MobileSubArc
                (
                    ArcFacing.Right,
                    new Dictionary <Vector3, float>()
                {
                    { new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), 40f },
                    { new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), 140f },
                },
                    new List <Vector3>()
                {
                    new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0),
                    new Vector3(shipBase.HALF_OF_SHIPSTAND_SIZE, 0, 0),
                    new Vector3(shipBase.HALF_OF_SHIPSTAND_SIZE, 0, -shipBase.SHIPSTAND_SIZE),
                    new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE),
                }
                ),
                new MobileSubArc
                (
                    ArcFacing.Rear,
                    new Dictionary <Vector3, float>()
                {
                    { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), -140f },
                    { new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), 140f }
                },
                    new List <Vector3>()
                {
                    new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE),
                    new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE),
                }
                )
            };

            ActiveMobileSubArc = MobileArcParameters[0];

            // Events
            Host = shipBase.Host;
            SubscribeToShipSetup(Host);

            // Pointer
            ShowMobileArcPointer();
        }
Exemplo n.º 28
0
        // ASSIGN CONDITION

        private void RegisterAbility(GenericShip ship)
        {
            RegisterAbilityTrigger(TriggerTypes.OnSystemsAbilityActivation, AskToAssignCondition);
        }
Exemplo n.º 29
0
 public override bool AnotherShipCanBeSelected(GenericShip targetShip, int mouseKeyIsPressed)
 {
     Messages.ShowError("Select an obstacle");
     return(false);
 }
Exemplo n.º 30
0
 public override void TimedBombActivationTime(GenericShip ship)
 {
     ship.OnManeuverIsRevealed -= BombsManager.CheckBombDropAvailabilityGeneral;
     ship.OnManeuverIsRevealed += BombsManager.CheckBombDropAvailabilityGeneral;
 }