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"))); }
private void SubscribeToShipSetup(GenericShip host) { host.OnShipIsPlaced += AskForMobileFiringArcDirection; }
private void RegisterSecondAttackTrigger(GenericShip ship) { HostShip.OnCombatCheckExtraAttack -= RegisterSecondAttackTrigger; RegisterAbilityTrigger(TriggerTypes.OnCombatCheckExtraAttack, UseGunnerAbility); }
protected virtual void SnapShotRestrictionForDefender(GenericShip ship, GenericAction action, ref bool data) { // Do nothing }
private void DoAnotherAction(GenericShip ship) { HostShip.OnActionDecisionSubphaseEnd -= DoAnotherAction; RegisterAbilityTrigger(TriggerTypes.OnFreeAction, PerformAction); }
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); }
protected void PerformManeuverOfShip(GenericShip ship) { ShipMovementScript.ActivateAndMove(ship.ShipId); }
private void RegisterExtraAttackAbility(GenericShip ship) { ship.OnCombatCheckExtraAttack -= RegisterAbility; RegisterAbilityTrigger(TriggerTypes.OnCombatCheckExtraAttack, DoCounterAttack); }
private bool FreeAttackFilter(GenericShip targetShip, IShipWeapon weapon, bool isSilent) { return(true); }
public TailGunnerCondition(GenericShip host) : base(host) { Name = "Debuff Token"; Temporary = false; Tooltip = new UpgradesList.FirstEdition.TailGunner().ImageUrl; }
protected override bool CheckRequirements(GenericShip ship) { var match = ship.Owner.PlayerNo == HostShip.Owner.PlayerNo; return(match); }
public override void AttachToShip(GenericShip host) { base.AttachToShip(host); host.OnGenerateActions += PerformDropBombAction; }
private void RegisterAssignStressAfterManeuver(GenericShip ship) { HostShip.OnMovementFinish -= RegisterAssignStressAfterManeuver; RegisterAbilityTrigger(TriggerTypes.OnMovementFinish, AssignStress); }
protected virtual void CheckAbility(GenericShip ship) { RegisterTrigger(); }
private bool FilterShipsToSetup(GenericShip ship) { return(ship.PilotSkill == RequiredPilotSkill && !ship.IsSetupPerformed && ship.Owner.PlayerNo == RequiredPlayer); }
// REMOVE CONDITIONS private void RemoveOwnConditions(GenericShip ship) { HostShip.Tokens.RemoveCondition(AssignedCondition); AssignedCondition = null; }
public override bool IsAllowedForShip(GenericShip ship) { return((ship is TIEInterceptor) && (ship.PilotSkill > 4)); }
public ZamWesellSecretCondition(GenericShip host) : base(host) { Name = ImageName = "Zam Wesell Secret Condition"; Temporary = false; }
public virtual void ActivateShip(GenericShip ship) { Selection.ChangeActiveShip("ShipId:" + ship.ShipId); PerformManeuverOfShip(ship); }
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; }
public override bool IsAllowedForShip(GenericShip ship) { return(ship is Ship.G1AStarfighter.G1AStarfighter); }
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; }
private void RemoveSnapShotRestrictionForAttacker(GenericShip ship) { ship.OnTryAddAvailableDiceModification -= SnapShotRestrictionForAttacker; ship.OnAttackFinish -= RemoveSnapShotRestrictionForAttacker; }
protected virtual void LoseCharges(GenericShip ship) { Messages.ShowInfo($"{HostShip.PilotInfo.PilotName}: 2 Charges are lost during Setup"); HostShip.State.Charges -= 2; }
private bool FilterTargets(GenericShip ship) { return(FilterByTargetType(ship, TargetTypes.Enemy) && FilterTargetsByRange(ship, 0, 1)); }
private void CheckAbility(GenericShip ship, ref bool flag) { flag = true; }
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(); }
// ASSIGN CONDITION private void RegisterAbility(GenericShip ship) { RegisterAbilityTrigger(TriggerTypes.OnSystemsAbilityActivation, AskToAssignCondition); }
public override bool AnotherShipCanBeSelected(GenericShip targetShip, int mouseKeyIsPressed) { Messages.ShowError("Select an obstacle"); return(false); }
public override void TimedBombActivationTime(GenericShip ship) { ship.OnManeuverIsRevealed -= BombsManager.CheckBombDropAvailabilityGeneral; ship.OnManeuverIsRevealed += BombsManager.CheckBombDropAvailabilityGeneral; }