Пример #1
0
 private void RegisterTrigger(GenericShip ship)
 {
     Ability.RegisterAbilityTrigger
     (
         TriggerTypes.OnCombatActivation,
         delegate { Ability.Action.DoAction(Ability); }
     );
 }
Пример #2
0
 private void RegisterAbility()
 {
     Ability.RegisterAbilityTrigger
     (
         TriggerTypes.OnSetupEnd,
         delegate { Ability.Action.DoAction(Ability); }
     );
 }
Пример #3
0
 private void RegisterAbility()
 {
     Ability.RegisterAbilityTrigger
     (
         TriggerTypes.OnCombatPhaseStart,
         delegate { Ability.Action.DoAction(Ability); }
     );
 }
Пример #4
0
 private void RegisterTrigger(GenericShip ship)
 {
     Ability.RegisterAbilityTrigger
     (
         TriggerTypes.OnAttackFinish,
         delegate { Ability.Action.DoAction(Ability); }
     );
 }
 private void CheckConditions()
 {
     if (WeaponIsNeeded == null || Combat.ChosenWeapon == WeaponIsNeeded)
     {
         Ability.RegisterAbilityTrigger
         (
             TriggerTypes.OnShotHit,
             delegate { Ability.Action.DoAction(Ability); }
         );
     }
 }
Пример #6
0
 private void RegisterTrigger(GenericAction action)
 {
     if (action.GetType() == ActionType &&
         ((HasToken == null) || (HasToken != null && Ability.HostShip.Tokens.HasToken((HasToken), '*')))
         )
     {
         Ability.RegisterAbilityTrigger
         (
             TriggerTypes.OnActionIsPerformed,
             delegate { Ability.Action.DoAction(Ability); }
         );
     }
 }
Пример #7
0
 private void CheckConditions(GenericShip ship)
 {
     if (
         (AttackRangeMin == -1 || (Combat.ShotInfo.Range >= AttackRangeMin)) &&
         (AttackRangeMax == -1 || (Combat.ShotInfo.Range <= AttackRangeMax)) &&
         (!OnlyIfAttackIsModifiedByAttacker || Combat.DiceRollAttack.ModifiedByPlayers.Contains(Combat.Attacker.Owner.PlayerNo))
         )
     {
         Ability.RegisterAbilityTrigger
         (
             TriggerTypes.OnAttackFinish,
             delegate { Ability.Action.DoAction(Ability); }
         );
     }
 }
Пример #8
0
 private void CheckConditions(GenericShip ship)
 {
     if (ship.AssignedManeuver.Speed >= MinSpeed &&
         ship.AssignedManeuver.Speed <= MaxSpeed &&
         (Complexity == MovementComplexity.None || ship.AssignedManeuver.ColorComplexity == Complexity) &&
         (OnlyIfFullyExecuted == false || (OnlyIfFullyExecuted && ship.CheckSuccessOfManeuver())) &&
         (OnlyIfPartialExecuted == false || (OnlyIfPartialExecuted && ship.IsBumped)) &&
         (OnlyIfMovedThroughFriendlyShip == false || (OnlyIfMovedThroughFriendlyShip && ship.ShipsMovedThrough.Any(n => n.Owner.PlayerNo == Ability.HostShip.Owner.PlayerNo))) &&
         BearingIsCorrect() &&
         ((HasToken == null) || (Ability.HostShip.Tokens.HasToken((HasToken), '*')))
         )
     {
         Ability.RegisterAbilityTrigger
         (
             TriggerTypes.OnMovementFinish,
             delegate { Ability.Action.DoAction(Ability); }
         );
     }
 }
Пример #9
0
        private void CheckConditions(GenericShip ship)
        {
            bool conditionsAreMet = false;

            if (IfBank && ship.RevealedManeuver.Bearing == ManeuverBearing.Bank)
            {
                conditionsAreMet = true;
            }
            if (IfTurn && ship.RevealedManeuver.Bearing == ManeuverBearing.Turn)
            {
                conditionsAreMet = true;
            }

            if (conditionsAreMet)
            {
                Ability.RegisterAbilityTrigger
                (
                    TriggerTypes.OnManeuverIsRevealed,
                    delegate { Ability.Action.DoAction(Ability); }
                );
            }
        }