Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        // 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();
        }
Esempio n. 3
0
 public void SetDefenseBehavior(IDefend value)
 {
     defenseBehavior = value;
 }
Esempio n. 4
0
 public DefendCommand(IDefend defender)
 {
     this.defender = defender;
 }