Пример #1
0
        public override void Skill(creature target)
        {
            if (mp >= 3)
            {
                musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/trait_drain.wav";
                musicPlayer.Play();
                Random chance = new Random();
                mp -= 3;

                Console.WriteLine("");
                skillDMG = (INT - 4 + mp / 4 + chance.Next(0, 2));

                // drain life and heal urself with it
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Yellow;
                Console.WriteLine("the ghost drained " + skillDMG + "life, and gained " + skillDMG / 3 + " through this!                                   ");
                Console.ForegroundColor = ConsoleColor.White;
                Console.BackgroundColor = ConsoleColor.Black;
                target.TakeDamage(skillDMG);

                if (this.health < 20)
                {
                    this.healUrself(skillDMG / 3);
                    manager.instance.yPositionBattleCursor++;
                }
                Console.WriteLine(" ");
                manager.instance.yPositionBattleCursor++;
            }
            else
            {
                Attack(target);
            }
        }
Пример #2
0
        public override void Skill(creature target)
        {
            if (mp >= 3)
            {
                // troll bashes, makes enemy stunned chance 1/5, and different dmg calculation
                skillDMG = CON / 7 * 3;

                mp -= 3;

                Console.WriteLine("");
                musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/trait_bash.wav";
                musicPlayer.Play();
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Yellow;

                Console.WriteLine("the troll dealt (" + skillDMG + " damage) and crippled his enemy                   ");
                Console.ForegroundColor = ConsoleColor.White;
                Console.BackgroundColor = ConsoleColor.Black;
                target.TakeDamage(skillDMG);
                if (target.CON > 1)
                {
                    target.CON = target.CON - 1;
                }                // now add a stun effect to target
                manager.instance.yPositionBattleCursor++;
                Console.WriteLine(" ");
                manager.instance.yPositionBattleCursor++;
            }
            else
            {
                Attack(target);
            }
        }
Пример #3
0
        public virtual void Attack(creature target)
        {
            if (stunned == false)
            {
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Yellow;
                if (classInt == 0) //this is an attacker
                {
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/att_sword.wav";
                    musicPlayer.Play();
                    myDMG = dmg / 7 * STR + CON / target.CON;
                    Console.WriteLine("\n" + name + " attacks with a sword (" + myDMG + " damage)                        ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    target.TakeDamage(myDMG);
                }
                if (classInt == 1) //this is a defender
                {
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/att_mace.wav";
                    musicPlayer.Play();
                    myDMG = dmg / 8 * CON + STR / target.CON;
                    Console.WriteLine("\n" + name + " attacks with a mace (" + myDMG + " damage)                           ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    target.TakeDamage(myDMG);
                }
                if (classInt == 2) //this is a mage
                {
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/att_staff.wav";
                    musicPlayer.Play();
                    myDMG = dmg / target.INT * INT + DEX / target.CON;
                    Console.WriteLine("\n" + name + " attacks with a staff (" + myDMG + " damage)                                ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    target.TakeDamage(myDMG);
                }
                if (classInt == 3) //this is a rogue
                {
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/att_dagger.wav";
                    musicPlayer.Play();
                    myDMG = dmg / 6 * DEX + STR / target.CON;
                    Console.WriteLine("\n" + name + " attacks with a dagger (" + myDMG + " damage)                               ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    target.TakeDamage(myDMG);
                }


                //Console.WriteLine(" ");
                manager.instance.yPositionBattleCursor++;
            }
        }
Пример #4
0
        /*public override void Attack (creature target)
         * {
         *  float newDmg = dmg / 100 * critDamage + dmg;
         *  target.TakeDamage(newDmg);
         * }*/

        public override void Skill(creature target)
        {
            if (mp >= 3)
            {
                Random random = new Random();
                myChance = random.Next(1, 4);
                int dmg;
                mp -= 3;

                Console.WriteLine("");
                Console.ForegroundColor   = ConsoleColor.Black;
                Console.BackgroundColor   = ConsoleColor.Yellow;
                musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/trait_slingshot.wav";
                musicPlayer.Play();


                if (myChance > 1)
                {
                    int chance = random.Next(2, 5);
                    chance = chance * 2;
                    Console.WriteLine("the goblin hits well with the slingshot (" + chance + " dmg)                               ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    // you hit very well!
                    target.TakeDamage(chance);
                }

                else
                {
                    Console.WriteLine("the goblin uses a slingshot and shoots itself accidentally                            ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    //you hit yourself, dummy!
                    this.TakeDamage(0.8f);
                }
                Console.WriteLine(" ");
                manager.instance.yPositionBattleCursor++;
            }
            else
            {
                Attack(target);
            }
        }
Пример #5
0
        public override void Skill(creature target)
        {
            if (mp >= 3)
            {
                musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/trait_bow.wav";
                musicPlayer.Play();
                mp -= 3;

                Random chance = new Random();
                skillDMG = chance.Next(1, DEX) / 3 + DEX / 2;
                Console.WriteLine("");
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Yellow;
                //shoot an arrow!
                Console.WriteLine("use bow and arrow, shoot first arrow (" + skillDMG + " dmg) and second arrow (" + skillDMG + " dmg)                       ");
                Console.ForegroundColor = ConsoleColor.White;
                Console.BackgroundColor = ConsoleColor.Black;
                float skillDMG2 = chance.Next(1, DEX) / 3 + DEX / 2;
                Console.WriteLine("");
                target.TakeDamage(skillDMG + skillDMG2);
                manager.instance.yPositionBattleCursor++;
                //arrows weaken the enemies con by 1 point! Cant be lower than 1..
                if (target.CON > 1)
                {
                    target.CON = target.CON - 1;
                }
                Thread.Sleep(300);
                musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/trait_bow.wav";
                musicPlayer.Play();

                Console.WriteLine(" ");
                manager.instance.yPositionBattleCursor++;
            }
            else
            {
                Attack(target);
            }
        }
Пример #6
0
        public override void Skill(creature target)
        {
            if (mp >= 3)
            {
                musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/trait_gun_shoot.wav";
                musicPlayer.Play();
                Random chance = new Random();
                skillDMG = DEX / 2 + chance.Next(1, STR);
                Console.WriteLine("");
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Yellow;
                //shoot an arrow!
                mp -= 3;

                Console.WriteLine("use a wooden handcannon (" + skillDMG + " dmg) and reduce the enemies DEX                         ");
                Console.ForegroundColor = ConsoleColor.White;
                Console.BackgroundColor = ConsoleColor.Black;
                target.TakeDamage(skillDMG);
                manager.instance.yPositionBattleCursor++;
                //arrows weaken the enemies con by 1 point! Cant be lower than 1..
                if (target.DEX > 1)
                {
                    target.DEX = target.DEX - 1;
                }
                Console.WriteLine(" ");
                Thread.Sleep(300);
                musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/skill_missile_exp.wav";
                musicPlayer.Play();


                manager.instance.yPositionBattleCursor++;
            }
            else
            {
                Attack(target);
            }
        }
Пример #7
0
        // to make it better use divide by target.CON or target.DEX!!

        public virtual void classSkill(creature target)
        {
            if (stunned == false)
            {
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Yellow;

                if (classInt == 0 && mp > 7) //this is an attacker - fatalattack
                {
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/skill_fatalattack.wav";
                    musicPlayer.Play();
                    Random chance = new Random();
                    myDMG = (STR + chance.Next(-2, 4));
                    Console.WriteLine("\n" + name + " launches a fatal sword attack (" + myDMG + " damage)                                                 ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    target.TakeDamage(myDMG);
                    mp -= 7;
                    return;
                }
                else if (classInt == 1 && mp > 6) //this is a defender - triple attack
                {
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/att_mace.wav";
                    musicPlayer.Play();
                    Random chance = new Random();
                    myDMG = CON / 4 + chance.Next(0, 2);
                    int secondDMG = CON / 4 + chance.Next(0, 2);
                    int thirdDMG  = CON / 3 + chance.Next(0, 2);
                    Console.WriteLine("\n" + name + " hits (" + myDMG + " damage),  hits (" + secondDMG + " damage), hits (" + thirdDMG + " damage)                ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    target.TakeDamage(myDMG + secondDMG + thirdDMG);
                    mp -= 7;
                    Thread.Sleep(200);
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/att_mace.wav";
                    musicPlayer.Play();
                    Thread.Sleep(200);
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/att_mace.wav";
                    musicPlayer.Play();
                    return;
                }
                else if (classInt == 2 && mp > 6) //this is a mage - magic missile
                {
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/skill_missile_homing.wav";
                    musicPlayer.Play();
                    Random chance = new Random();
                    myDMG = (INT - 3 + mp / 4 + chance.Next(0, 5));
                    Console.WriteLine("\n" + name + " shoots a magic projectile (" + myDMG + " damage)                                             ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    target.TakeDamage(myDMG);
                    mp -= 7;
                    Thread.Sleep(400);
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/skill_missile_exp.wav";
                    musicPlayer.Play();
                    return;
                }
                else if (classInt == 3 && mp > 8) //this is a rogue - backstab
                {
                    musicPlayer.SoundLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Properties/skill_backstab.wav";
                    musicPlayer.Play();
                    Random chance = new Random();
                    myDMG = DEX / 3 * 2 + mp / 3;
                    Console.WriteLine("\n" + name + " stabs the enemy brutally (" + myDMG + " damage)                                           ");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.BackgroundColor = ConsoleColor.Black;
                    manager.instance.yPositionBattleCursor++;
                    target.TakeDamage(myDMG);
                    mp -= 7;
                    return;
                }
                else
                {
                    Attack(target);
                }

                Console.ForegroundColor = ConsoleColor.White;
                Console.BackgroundColor = ConsoleColor.Black;
                //Console.WriteLine(" ");
                manager.instance.yPositionBattleCursor++;
            }
        }
Пример #8
0
 public virtual void Skill(creature target)
 {
     Console.Write("");
     target.TakeDamage(skillDMG);
     mp = mp - 3;
 }