Ejemplo n.º 1
0
        /// <summary>
        /// Performs driller combat between two subs
        /// </summary>
        /// <returns>If the event was succesfull</returns>
        public bool ForwardAction()
        {
            if (Validator.ValidateICombatable(_combatant1) && Validator.ValidateICombatable(_combatant2))
            {
                _preCombatDrillers1 = _combatant1.GetDrillerCount();
                _preCombatDrillers2 = _combatant2.GetDrillerCount();
                _combatant1.RemoveDrillers(_preCombatDrillers2);
                _combatant2.RemoveDrillers(_preCombatDrillers1);

                // Remove any subs that should be removed after combat.
                if (_combatant1 is Sub && (_combatant1.GetDrillerCount() < 0 || (_combatant1.GetDrillerCount() == 0 && _combatant1.GetSpecialistManager().GetSpecialistCount() == 0)))
                {
                    Game.TimeMachine.GetState().RemoveSub((Sub)_combatant1);
                }

                if (_combatant2 is Sub && (_combatant2.GetDrillerCount() < 0 || (_combatant2.GetDrillerCount() == 0 && _combatant2.GetSpecialistManager().GetSpecialistCount() == 0)))
                {
                    Game.TimeMachine.GetState().RemoveSub((Sub)_combatant2);
                }

                this._eventSuccess = true;
            }
            else
            {
                this._eventSuccess = false;
            }

            return(this._eventSuccess);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Performs driller combat between two subs
        /// </summary>
        /// <returns>If the event was succesfull</returns>
        public bool ForwardAction(TimeMachine timeMachine, GameState state)
        {
            if (Validator.ValidateICombatable(state, _combatant1) && Validator.ValidateICombatable(state, _combatant2))
            {
                _preCombatDrillers1 = _combatant1.GetDrillerCount();
                _preCombatDrillers2 = _combatant2.GetDrillerCount();
                _combatant1.RemoveDrillers(_preCombatDrillers2);
                _combatant2.RemoveDrillers(_preCombatDrillers1);
                this._eventSuccess = true;
            }
            else
            {
                this._eventSuccess = false;
            }

            return(this._eventSuccess);
        }
Ejemplo n.º 3
0
 public void BackwardEffect(ICombatable friendly, ICombatable enemy)
 {
     friendly.RemoveDrillers(_drillerCount * _scaleFactor);
 }
Ejemplo n.º 4
0
 public void ForwardEffect(ICombatable friendly, ICombatable enemy)
 {
     enemy.RemoveDrillers((int)(enemy.GetDrillerCount() * _stealPercent));
 }