Ejemplo n.º 1
0
        //pAR= Player Attack Roll
        //Uses the same calculation as before, but a roll for the damage of the weapon is added.
        public void Attack(Villain badman)
        {
            Random rnd     = new Random();
            int    pAR     = rnd.Next(1, 21);
            int    wpnRoll = rnd.Next(wpn.wpnMinBaseDamage, wpn.wpnMaxBaseDamage);

            if ((pAR + AB) < (badman.villainBaseAC + badman.villainArmorAC))
            {
                Console.WriteLine("You roll " + (pAR + AB) + " against "
                                  + badman.villainName + "'s armorclass of " + (badman.villainBaseAC + badman.villainArmorAC) + ". You miss.");
            }
            else
            {
                Console.WriteLine("You roll " + (pAR + AB) + " against "
                                  + badman.villainName + "'s armorclass of " + (badman.villainBaseAC + badman.villainArmorAC) +
                                  ". You hit " + badman.villainName + " for " + (Damage + wpnRoll) + " damage.");
                badman.currentHP = badman.currentHp - (Damage + wpnRoll);
                Console.WriteLine(badman.villainName + " has " + badman.currentHP + " HP left.");
            }


            Console.ReadLine();
        }
Ejemplo n.º 2
0
 public Combat(Player p, Villain cpu)
 {
     p1    = p;
     enemy = cpu;
 }