public override int GetSelectionShares(Actor collector) { if (collector.GetPrimaryWeapon() == null && collector.GetSecondaryWeapon() == null) return 0; return base.GetSelectionShares(collector); }
public AttackBase(Actor self) { var primaryWeapon = self.GetPrimaryWeapon(); var secondaryWeapon = self.GetSecondaryWeapon(); primaryBurst = primaryWeapon != null ? primaryWeapon.Burst : 1; secondaryBurst = secondaryWeapon != null ? secondaryWeapon.Burst : 1; }
public static float GetMaximumRange(Actor self) { return new[] { self.GetPrimaryWeapon(), self.GetSecondaryWeapon() } .Where(w => w != null).Max(w => w.Range); }
protected virtual void QueueAttack(Actor self, Order order) { /* todo: choose the appropriate weapon, when only one works against this target */ var weapon = self.GetPrimaryWeapon() ?? self.GetSecondaryWeapon(); self.QueueActivity(new Activities.Attack(order.TargetActor, Math.Max(0, (int)weapon.Range))); }