private void AddSharaBeyActionEffect(Ship.GenericShip ship) { ship.AddAvailableDiceModification(new ActionsList.SharaBeyAction() { Host = HostShip }); }
public static void PlayFly(Ship.GenericShip ship) { int soundsCount = ship.SoundFlyPaths.Count; int selectedIndex = Random.Range(0, soundsCount); PlayShipSound(ship.SoundFlyPaths[selectedIndex]); }
private void RegisterR5K6Ability(Ship.GenericShip ship, System.Type type) { if (type == typeof(Tokens.BlueTargetLockToken)) { RegisterAbilityTrigger(TriggerTypes.OnTokenIsSpent, StartSubphaseForR5K6Ability); } }
private void AddJessPavaActionEffect(Ship.GenericShip host) { ActionsList.GenericAction newAction = new ActionsList.JessPavaActionEffect(); newAction.Host = host; newAction.ImageUrl = host.ImageUrl; host.AddAvailableDiceModification(newAction); }
private void AddBobaFettSVActionEffect(Ship.GenericShip host) { ActionsList.GenericAction newAction = new ActionsList.BobaFettSVActionEffect(); newAction.Host = host; newAction.ImageUrl = host.ImageUrl; host.AddAvailableActionEffect(newAction); }
private void RegisterJakeFarrellAbility(Ship.GenericShip ship, Type tokenType) { if (tokenType == typeof(Tokens.FocusToken)) { RegisterAbilityTrigger(TriggerTypes.OnTokenIsAssigned, FreeRepositionAction); } }
private void R5D8AddAction(Ship.GenericShip host) { ActionsList.GenericAction action = new ActionsList.R5D8Action() { ImageUrl = HostUpgrade.ImageUrl }; host.AddAvailableAction(action); }
public override void DiscardEffect(Ship.GenericShip host) { Messages.ShowInfo("Pilot Skill is restored"); host.RemoveToken(typeof(Tokens.DamagedCockpitCritToken)); host.RemovePilotSkillModifier(this); Roster.UpdateShipStats(host); }
private void SquadLeaderAddAction(Ship.GenericShip host) { ActionsList.GenericAction newAction = new ActionsList.SquadLeaderAction() { ImageUrl = ImageUrl, Host = this.Host }; host.AddAvailableAction(newAction); }
private void CheckAbility(Ship.GenericShip ship) { if (Combat.AttackStep == CombatStep.Defence && Combat.Attacker.Tokens.HasToken <JamToken>()) { var action = new CaptainFerophAction(HostShip); ship.AddAvailableActionEffect(action); } }
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()); } }
public override void AttachToShip(Ship.GenericShip host) { base.AttachToShip(host); host.OnAttackStartAsDefender += RegisterTrigger; Phases.OnEndPhaseStart_NoTriggers += Cleanup; Host.OnShipIsDestroyed += StopAbility; }
private void AddT65BAction(Ship.GenericShip host) { ActionsList.GenericAction newAction = new ActionsList.T65BAction() { ImageUrl = ImageUrl, Host = Host }; host.AddAvailableAction(newAction); }
public override void AttachToShip(Ship.GenericShip host) { base.AttachToShip(host); host.OnActionIsPerformed += CheckConditions; Phases.OnEndPhaseStart += Cleanup; Host.OnDestroyed += StopAbility; }
private void AddGlitterstimDiceModification(Ship.GenericShip host) { ActionsList.GenericAction newAction = new ActionsList.GlitterstimDiceModification() { ImageUrl = ImageUrl, Host = Host }; host.AddAvailableActionEffect(newAction); }
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; } } }
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); } } }
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; } } }
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); }
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); }
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); } } }
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 } ); } }
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); }
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)); }
public override void AttachToShip(Ship.GenericShip host) { base.AttachToShip(host); host.AfterGenerateAvailableActionsList += MarksmanshipAddAction; }
public override bool IsAllowedForShip(Ship.GenericShip ship) { return(ship.faction == Faction.Rebel); }
private void MarksmanshipAddAction(Ship.GenericShip host) { ActionsList.GenericAction newAction = new ActionsList.MarksmanshipAction(); newAction.ImageUrl = ImageUrl; host.AddAvailableAction(newAction); }
private void MarksmanshipAddDiceModification(Ship.GenericShip ship) { ship.AddAvailableActionEffect(this); }