private static ArcType ArcToSector(GenericArc arc) { switch (arc.Facing) { case ArcFacing.Front: return(ArcType.Front); case ArcFacing.Left: return(ArcType.Left); case ArcFacing.Right: return(ArcType.Right); case ArcFacing.Rear: return(ArcType.Rear); case ArcFacing.FullFront: return(ArcType.FullFront); case ArcFacing.FullRear: return(ArcType.FullRear); case ArcFacing.Bullseye: return(ArcType.Bullseye); default: return(ArcType.None); } }
public bool IsShipInSector(GenericShip anotherShip, ArcType arcType) { GenericArc arc = Arcs.First(n => n.ArcType == arcType); ShotInfoArc arcInfo = new ShotInfoArc(HostShip, anotherShip, arc); return(arcInfo.IsShotAvailable); }
public int RangeToShipBySector(GenericShip anotherShip, ArcType arcType) { GenericArc arc = Arcs.First(n => n.ArcType == arcType); ShotInfoArc arcInfo = new ShotInfoArc(HostShip, anotherShip, arc); return(arcInfo.Range); }
private void InitializeShipBaseArc() { switch (ShipBaseArcsType) { case BaseArcsType.ArcDefault: ArcInfo = new GenericArc(this); break; case BaseArcsType.ArcRear: ArcInfo = new ArcRear(this); break; case BaseArcsType.Arc180: ArcInfo = new Arc180(this); break; case BaseArcsType.Arc360: ArcInfo = new Arc360(this); break; case BaseArcsType.ArcMobile: ArcInfo = new ArcMobile(this); break; default: break; } }
private static void SetArcAsUsedForAttack() { Combat.ArcForShot = Combat.ShotInfo.ShotAvailableFromArcs.FirstOrDefault(); if (ArcForShot != null) { ArcForShot.WasUsedForAttackThisRound = true; } }
public ShotInfoArc(GenericShip ship1, GenericShip ship2, GenericArc arc, IShipWeapon weapon) : base(ship1, ship2) { Weapon = weapon ?? ship1.PrimaryWeapons.First(); Arc = arc; CheckRange(); }
private void ToggleAbility(bool isActive) { GenericArc rearArc = HostShip.ArcInfo.GetArc <ArcRear>(); rearArc.ShotPermissions.CanShootCannon = isActive; rearArc.ShotPermissions.CanShootTorpedoes = isActive; rearArc.ShotPermissions.CanShootMissiles = isActive; }
private static void CleanupCombatData() { AttackStep = CombatStep.None; Attacker = null; Defender = null; ChosenWeapon = null; ShotInfo = null; ArcForShot = null; hitsCounter = 0; ExtraAttackFilter = null; IsAttackAlreadyCalled = false; }
public ShotInfoArc GetSectorInfo(GenericShip anotherShip, ArcType arcType) { GenericArc arc = Arcs.FirstOrDefault(n => n.ArcType == arcType); if (arc != null) { return(new ShotInfoArc(HostShip, anotherShip, arc)); } else { return(null); } }
public bool IsShipInSector(GenericShip anotherShip, ArcType arcType) { GenericArc arc = Arcs.First(n => n.ArcType == arcType); ShotInfoArc arcInfo = new ShotInfoArc(HostShip, anotherShip, arc); bool result = arcInfo.IsShotAvailable; if (arcType == ArcType.Bullseye) { HostShip.CallOnBullseyeArcCheck(anotherShip, ref result); } return(result); }
public ShotInfoArc(GenericShip ship1, GenericShip ship2, GenericArc arc) : base(ship1, ship2) { Arc = arc; CheckRange(); }
public virtual void RotateMobileFiringArcAlt(GenericArc arc, ArcFacing facing) { }