예제 #1
0
파일: Goji.cs 프로젝트: vitreuz/FlyCasual
        private void CheckAbility()
        {
            if (Combat.Defender.Owner.PlayerNo != HostShip.Owner.PlayerNo)
            {
                return;
            }

            DistanceInfo distInfo = new DistanceInfo(HostShip, Combat.Defender);

            if (distInfo.Range > 3)
            {
                return;
            }

            BombsAndMinesInRangeCount = 0;
            foreach (var bombHolder in BombsManager.GetBombsOnBoard().Where(n => n.Value.HostShip.Owner.PlayerNo == HostShip.Owner.PlayerNo))
            {
                //January 2020 errata: This ability now only works with bombs
                if (bombHolder.Value.UpgradeInfo.SubType != UpgradeSubType.Bomb)
                {
                    break;
                }

                if (BombsManager.IsShipInRange(Combat.Defender, bombHolder.Key, 1))
                {
                    BombsAndMinesInRangeCount++;
                    break;
                }
            }

            if (BombsAndMinesInRangeCount > 0)
            {
                RegisterAbilityTrigger(TriggerTypes.OnDefenseStart, AskToAddExtraDice);
            }
        }
예제 #2
0
 private void CheckCatAbility(ref int count)
 {
     if (Combat.ChosenWeapon.WeaponType == WeaponTypes.PrimaryWeapon)
     {
         foreach (var bombHolder in BombsManager.GetBombsOnBoard())
         {
             if (bombHolder.Value.HostShip.Owner.PlayerNo == HostShip.Owner.PlayerNo &&
                 BombsManager.IsShipInRange(Combat.Defender, bombHolder.Key, 1))
             {
                 Messages.ShowInfo(HostShip.PilotInfo.PilotName + " gains +1 attack die");
                 count++;
                 return;
             }
         }
     }
 }