Exemplo n.º 1
0
        private bool SnapShotAttackFilter(GenericShip defender, IShipWeapon weapon, bool isSilent)
        {
            bool result = true;

            if (defender != snapShotTarget)
            {
                if (!isSilent)
                {
                    Messages.ShowErrorToHuman(
                        string.Format("Snap Shot's target must be {0}", snapShotTarget.PilotInfo.PilotName));
                }
                result = false;
            }
            else if (!(weapon.GetType() == HostUpgrade.GetType()))
            {
                if (!isSilent)
                {
                    Messages.ShowErrorToHuman(
                        string.Format("This attack must be Snap Shot attack"));
                }
                result = false;
            }

            return(result);
        }
Exemplo n.º 2
0
 private void SetRangeToOne(GenericShip thisShip, GenericShip anotherShip, IShipWeapon chosenWeapon, ref int range)
 {
     if (thisShip.ShipId == HostShip.ShipId)
     {
         if ((range <= 3) && (chosenWeapon.GetType() == typeof(PrimaryWeaponClass)))
         {
             range = 1;
         }
     }
 }
Exemplo n.º 3
0
 private bool IsSecondaryShot(GenericShip defender, IShipWeapon weapon, bool isSilent)
 {
     bool result = false;
     if (weapon.GetType() != typeof(PrimaryWeaponClass))
     {
         result = true;
     }
     else
     {
         if (!isSilent) Messages.ShowError("Attack must be performed from secondary weapon");
     }
     return result;
 }
Exemplo n.º 4
0
        private bool SnapShotAttackFilter(GenericShip defender, IShipWeapon weapon)
        {
            bool result = true;

            if (defender != snapShotTarget || !(weapon.GetType() == HostUpgrade.GetType()))
            {
                Messages.ShowErrorToHuman(
                    string.Format("Snap Shot target must be {0}, using Snap Shot weapon", snapShotTarget.PilotName));
                result = false;
            }

            return(result);
        }
Exemplo n.º 5
0
        private bool IsPrimaryShot(GenericShip defender, IShipWeapon weapon)
        {
            bool result = false;

            if (weapon.GetType() == typeof(PrimaryWeaponClass))

            {
                result = true;
            }
            else
            {
                Messages.ShowError("Attack must be performed from primary weapon");
            }

            return(result);
        }
Exemplo n.º 6
0
        private bool ForesightAttackFilter(GenericShip defender, IShipWeapon weapon, bool isSilent)
        {
            bool result = true;

            if (defender != blasterTarget)
            {
                if (!isSilent)
                {
                    Messages.ShowErrorToHuman(
                        string.Format("Underslung Blaster Cannon's target must be {0}", blasterTarget.PilotInfo.PilotName));
                }
                result = false;
            }
            else if (!(weapon.GetType() == HostUpgrade.GetType()))
            {
                if (!isSilent)
                {
                    Messages.ShowErrorToHuman("This attack must be Underslung Blaster Cannon attack");
                }
                result = false;
            }

            return(result);
        }