Ejemplo n.º 1
0
 public Battle(BaseCharacter combatant, BaseCharacter opponent)
 {
     this.combatant               = combatant;
     this.CombatantAtStart        = (BaseCharacter)combatant.Clone();
     this.opponent                = opponent;
     this.OpponentAtStart         = (BaseCharacter)opponent.Clone();
     CombatantInitiative          = this.combatant.Initiative + DiceRoller.TwentySidedDie();
     OpponentInitiative           = this.opponent.Initiative + DiceRoller.TwentySidedDie();
     startingCharacterStatistics  = new BattleStatistics(StartingCharacter, CharacterGoingLast);
     characterGoingLastStatistics = new BattleStatistics(CharacterGoingLast, StartingCharacter);
     estimatedPowerDifference     = combatant.CalculateRelativePower(opponent);
     if (combatant.CurHitPoints <= 0 || opponent.CurHitPoints <= 0)
     {
         throw new ArgumentException("Can't have a battle without at least two living combatants!");
     }
     StartBattle();
 }