public Character() { var rand = new Random(); MaxPower = rand.Next(99) + 1; Health = 100; AttackPower = rand.Next(MaxPower) + 1; DefensePower = rand.Next(MaxPower) + 1; defenseBehavior = new BasicDefense(); }
// generates stats for a character public void GenerateStats() { var randomNum = new Random(); MaxPower = randomNum.Next(1, 100); Health = 100; AttackPower = randomNum.Next(1, MaxPower); DefensePower = randomNum.NextDouble(); // characters are allowed to resist up to 99% of their opponents attack Speed = randomNum.Next(1, MaxPower); // speed stat is used to decide who attacks first defendBehavior = new Defense(); }
public void SetDefenseBehavior(IDefend value) { defenseBehavior = value; }
public DefendCommand(IDefend defender) { this.defender = defender; }