Exemplo n.º 1
0
        //methods
        public void Use(ITargetable Target)
        {
            if (!CanCast())
            {
                return;
            }

            if (Target.GetType() != typeof(Objects.Monsters.Exemples.EvilSinger) || Target.GetType() != typeof(Objects.Monsters.Exemples.Necromant) || Target.GetType() != typeof(Objects.Monsters.Exemples.Zombie))
            {
                return;
            }

            //costing
            HeroRef.Csp -= Cost;

            //dmg
            Int32 Dmg = this.Dmg(Target);

            Target.Chp -= Dmg;

            //msg
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += " deal ";
            Line += DCLine.New(Dmg.ToString(), Color, Back);
            Line += " damage!";
            Temp.State.Current.Chat.Message(Line);
        }
Exemplo n.º 2
0
        private void MagicAttacking()
        {
            Int32 Dmg = Cast(State.Current.Hero.Barrier);

            State.Current.Hero.Chp -= Dmg;

            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = ConsoleColor.DarkGreen;
            Line.DefaultBackgroundColor = ConsoleColor.Black;

            if (this.GetType().GetInterface("IThing") != null)
            {
                Line += DCLine.New((this as IThing).Name, (this as IThing).Color, (this as IThing).Back);
            }
            else
            {
                Line += "Monster";
            }

            Line += " deal ";
            Line += DCLine.New(Dmg.ToString(), ConsoleColor.White, ConsoleColor.Red);
            Line += DCLine.New(" magic", ConsoleColor.Magenta, ConsoleColor.White);
            Line += " damage!";

            State.Current.Chat.Message(Line);
        }
Exemplo n.º 3
0
        //methods
        public void Use(ITargetable Target)
        {
            //costing
            HeroRef.Csp -= Cost;

            //dmg
            Dmged = this.Dmg();

            (Target as IFighter).MinDmg += Dmged;
            (Target as IFighter).MaxDmg += Dmged;
            (Target as IFighter).Ad     += Dmged;

            (Target as Heroes.Person).HeroIcon.OnGetChr(gForm);
            (Target as Heroes.Person).HeroColor.OnGet(gColor);
            (Target as Heroes.Person).HeroBack.OnGet(gBack);

            //msg
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += " immprove attack on ";
            Line += DCLine.New(Dmged.ToString(), Color, Back);
            Line += " !";
            Temp.State.Current.Chat.Message(Line);

            PressedNow     = Input.Pressed;
            Input.OnInput += Input_OnInput;
        }
Exemplo n.º 4
0
        //methods
        public void Use(ITargetable Target)
        {
            if (!CanCast())
            {
                return;
            }

            //costing
            HeroRef.Csp -= Cost;

            //additional (heal)
            Int32 HDmg = this.Dmg();

            if (HeroRef.Chp.Int() < HeroRef.Mhp.Int())
            {
                if (HeroRef.Chp.Int() + HDmg > HeroRef.Mhp.Int())
                {
                    HeroRef.Chp = HeroRef.Mhp;
                }
                else
                {
                    HeroRef.Chp += HDmg;
                }
            }
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += " heal ";
            Line += DCLine.New(HDmg.ToString(), Color, Back);
            Line += " your hp!";
            Temp.State.Current.Chat.Message(Line);
        }
Exemplo n.º 5
0
        //methods
        public void Use(ITargetable Target)
        {
            if (!CanCast())
            {
                return;
            }

            //costing
            HeroRef.Csp -= Cost;

            for (int i = 0; i < HeroRef.R.Level + 1; i++)
            {
                //dmg
                Int32 Dmg = this.Dmg(Target);
                Target.Chp -= Dmg;

                //msg
                DrawerLine Line = new DrawerLine();
                Line.DefaultForegroundColor = HeroRef.Color;
                Line.DefaultBackgroundColor = HeroRef.Back;
                Line += DCLine.New("Rainbow splatter", Color, Back);
                Line += " deal ";
                Line += DCLine.New(Dmg.ToString(), Color, Back);
                Line += " damage!";
                Temp.State.Current.Chat.Message(Line);
            }

            if (HeroRef.R.Level > 0)
            {
                new Blessingoftheelements().Use(null);
            }
        }
Exemplo n.º 6
0
        //methods
        public void Use(ITargetable Target)
        {
            if (!CanCast())
            {
                return;
            }

            //costing
            HeroRef.Csp -= Cost;

            //dmg
            Int32 Dmg = this.Dmg(Target);

            Target.Chp -= Dmg;

            //msg
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New((Target as IThing).Name, (Target as IThing).Color, (Target as IThing).Back);
            Line += " take ";
            Line += DCLine.New(Dmg.ToString(), Color, Back);
            Line += " damage from ";
            Line += DCLine.New(Name, Color, Back);
            Line += "!";
            Temp.State.Current.Chat.Message(Line);
        }
Exemplo n.º 7
0
        //methods
        public void Use(ITargetable Target)
        {
            //costing
            HeroRef.Csp -= Cost;

            //dmg
            Dmged = this.Dmg();

            Target.Armor            += Dmged;
            Target.Barrier          += Dmged;
            (Target as IMagican).Ap += Dmged;

            //msg
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += " immprove arm,bar,ap on";
            Line += DCLine.New(Dmged.ToString(), Color, Back);
            Line += " !";
            Temp.State.Current.Chat.Message(Line);

            PressedNow     = Input.Pressed;
            Input.OnInput += Input_OnInput;
        }
Exemplo n.º 8
0
 public void Action()
 {
     Loudmouth.Yell(
         DCLine.New("barrier", ConsoleColor.DarkMagenta, ConsoleColor.Black),
         _Value,
         Position,
         () => { State.Current.Hero.Barrier += _Value; },
         new DrawerLine("Мase exploded. Again.", ConsoleColor.Magenta));
 }
Exemplo n.º 9
0
 public void Action()
 {
     Loudmouth.Yell(
         DCLine.New("armor", ConsoleColor.DarkCyan, ConsoleColor.Black),
         _Value,
         Position,
         () => { State.Current.Hero.Armor += _Value; },
         new DrawerLine("A pile of garbage disappears...", ConsoleColor.DarkGreen));
 }
Exemplo n.º 10
0
 public void Action()
 {
     Loudmouth.Yell(
         DCLine.New("ability power", ConsoleColor.Magenta, ConsoleColor.DarkMagenta),
         _Value,
         Position,
         () => { State.Current.Hero.Barrier += _Value; },
         new DrawerLine("The book was burned in the magical flames.", ConsoleColor.Magenta));
 }
Exemplo n.º 11
0
 public void Action()
 {
     Loudmouth.Yell(
         DCLine.New("attack power", ConsoleColor.Cyan, ConsoleColor.DarkMagenta),
         _Value,
         Position,
         () => { State.Current.Hero.Barrier += _Value; },
         new DrawerLine("The new weapon was old.", ConsoleColor.Cyan));
 }
Exemplo n.º 12
0
        public static void Yell(DCLine StatName, Int32 _Value, Coord Position, Action IncreaseEffect, DrawerLine DisposeString)
        {
            while (true)
            {
                IO.DrawerLine line = new IO.DrawerLine();
                line.DefaultForegroundColor = ConsoleColor.White;
                line.DefaultBackgroundColor = ConsoleColor.Red;

                line += "It's improvement pack! You taked " + State.Current.Hero.ImpPackCurrent + "/" + State.Current.Hero.ImpPackMax + ", take this one? Y/N";
                State.Current.Chat.Message(line);

                switch (Console.ReadKey(true).Key)
                {
                case ConsoleKey.Y:
                {
                    IO.DrawerLine linew = new IO.DrawerLine();
                    linew.DefaultForegroundColor = ConsoleColor.Cyan;
                    linew.DefaultBackgroundColor = ConsoleColor.DarkRed;

                    linew += DCLine.New("You", State.Current.Hero.Color, State.Current.Hero.Back);
                    linew += " use IPack and inc ";
                    linew += StatName;
                    linew += " on the ";
                    linew += DCLine.New(_Value.ToString(), ConsoleColor.Red, ConsoleColor.Cyan);
                    linew += "!";

                    State.Current.Chat.Message(linew);

                    if (State.Current.Hero.ImpPackCurrent < State.Current.Hero.ImpPackMax)
                    {
                        State.Current.Hero.ImpPackIncrease();
                        IncreaseEffect();
                    }
                    else
                    {
                        DrawerLine newline = new DrawerLine();
                        newline.DefaultForegroundColor = ConsoleColor.Red;
                        newline.DefaultBackgroundColor = ConsoleColor.White;
                        newline += "Oh no! You cant't take more improvements at this level!";
                    }

                    State.Current.GameField.Map[Position.X, Position.Y] = new Objects.Mapped.EThing();
                    State.Current.GameField.Draw();
                    return;
                }

                case ConsoleKey.N:
                {
                    State.Current.Chat.Message(DisposeString);
                    State.Current.GameField.Map[Position.X, Position.Y] = new Objects.Mapped.EThing();
                    State.Current.GameField.Draw();
                    return;
                }
                }
            }
        }
Exemplo n.º 13
0
        //methods
        public void Use(ITargetable Target)
        {
            if (!CanCast())
            {
                return;
            }

            //costing
            HeroRef.Csp -= Cost;

            //additional (heal and restore sp)
            Int32 HDmg = this.Dmg();

            if (HeroRef.Chp.Int() < HeroRef.Mhp.Int())
            {
                if (HeroRef.Chp.Int() + HDmg > HeroRef.Mhp.Int())
                {
                    HeroRef.Chp = HeroRef.Mhp;
                }
                else
                {
                    HeroRef.Chp += HDmg;
                }
            }
            if (HeroRef.Csp.Int() < HeroRef.Msp.Int())
            {
                if (HeroRef.Csp.Int() + HDmg > HeroRef.Msp.Int())
                {
                    HeroRef.Csp = HeroRef.Msp;
                }
                else
                {
                    HeroRef.Csp += HDmg;
                }
            }
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += " heal and restore ";
            Line += DCLine.New(HDmg.ToString(), Color, Back);
            Line += " elements!";
            Temp.State.Current.Chat.Message(Line);

            if (HeroRef.R.Level > 0)
            {
                new Blessingoftheelements().Use(null);
            }
        }
Exemplo n.º 14
0
        protected Boolean CanCast()
        {
            if (HeroRef.Csp.Int() - Cost <= 0)
            {
                DrawerLine Line = new DrawerLine();
                Line.DefaultForegroundColor = HeroRef.Color;
                Line.DefaultBackgroundColor = HeroRef.Back;
                Line += "Not enough ";
                Line += DCLine.New(HeroRef.SPName, (ConsoleColor)HeroRef.SPColor.Enum(), ConsoleColor.White);
                Line += " !";
                Temp.State.Current.Chat.Message(Line);

                return(false);
            }
            return(true);
        }
Exemplo n.º 15
0
        void Input_OnInput()
        {
            if (PressedNow + 15 <= Input.Pressed)
            {
                HeroRef.Armor   -= Dmged;
                HeroRef.Barrier -= Dmged;
                HeroRef.Ap      -= Dmged;

                DrawerLine Line = new DrawerLine();
                Line.DefaultForegroundColor = HeroRef.Color;
                Line.DefaultBackgroundColor = HeroRef.Back;
                Line += DCLine.New(Name, Color, Back);
                Line += " completed his action.";
                Temp.State.Current.Chat.Message(Line);
                Input.OnInput -= Input_OnInput;
            }
        }
Exemplo n.º 16
0
        public void WhenDies()
        {
            if (Loot != null && Loot.GetType() != typeof(EThing))
            {
                DrawerLine Line = new DrawerLine();
                Line.DefaultBackgroundColor = ConsoleColor.DarkGreen;
                Line.DefaultForegroundColor = ConsoleColor.White;
                Line += DCLine.New("You", State.Current.Hero.Color, State.Current.Hero.Back);
                Line += " get a ";
                Line += DCLine.New(Loot.Name, Loot.Color, Loot.Back);
                Line += " !";
                State.Current.Chat.Message(Line);
                Loot.Action();
            }

            State.Current.Hero.Cexp += Exp;

            if (this.GetType().GetInterface("IThing") != null)
            {
                DrawerLine Line = new DrawerLine();
                Line.DefaultBackgroundColor = ConsoleColor.DarkGreen;
                Line.DefaultForegroundColor = ConsoleColor.Black;
                Line += DCLine.New((this as IThing).Name, (this as IThing).Color, (this as IThing).Back);
                Line += " died! ";
                Line += DCLine.New("You", State.Current.Hero.Color, State.Current.Hero.Back);
                Line += " get ";
                Line += DCLine.New(Exp.ToString(), ConsoleColor.Blue, ConsoleColor.White);
                Line += " exp!";
                State.Current.Chat.Message(Line);
            }
            else
            {
                State.Current.Chat.Message(new DrawerLine("Monster died! You get " + Exp.ToString() + " exp!", ConsoleColor.Magenta));
            }

            if (this.GetType().GetInterface("IThing") != null)
            {
                State.Current.GameField.Map[(this as IThing).Position.X, (this as IThing).Position.Y] = new Mapped.EThing();
            }

            State.Current.GameField.Draw();
            State.Current.Info.Draw();
        }
Exemplo n.º 17
0
        void Input_OnInput()
        {
            if (PressedNow + 30 <= Input.Pressed)
            {
                HeroRef.MinDmg -= Dmged;
                HeroRef.MaxDmg -= Dmged;
                HeroRef.Ad     -= Dmged;

                HeroRef.HeroIcon.RemoveChr(gForm);
                HeroRef.HeroColor.Remove(gColor);
                HeroRef.HeroBack.Remove(gBack);

                DrawerLine Line = new DrawerLine();
                Line.DefaultForegroundColor = HeroRef.Color;
                Line.DefaultBackgroundColor = HeroRef.Back;
                Line += DCLine.New(Name, Color, Back);
                Line += " completed his action.";
                Temp.State.Current.Chat.Message(Line);
                Input.OnInput -= Input_OnInput;
            }
        }
Exemplo n.º 18
0
        //methods
        public void Use(ITargetable Target)
        {
            //costing
            HeroRef.Csp -= Cost;

            //dmg
            Int32 Dmg = this.Dmg(Target);

            Target.Chp -= Dmg;

            //msg
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += " deal ";
            Line += DCLine.New(Dmg.ToString(), Color, Back);
            Line += " damage!";
            Temp.State.Current.Chat.Message(Line);
        }
Exemplo n.º 19
0
        public override void Handle()
        {
            while (true)
            {
                ISkill Skill = null;
                switch (Console.ReadKey(true).Key)
                {
                case ConsoleKey.NumPad1:
                case ConsoleKey.D1: Skill = State.Current.Hero.Q; break;

                case ConsoleKey.NumPad2:
                case ConsoleKey.D2: Skill = State.Current.Hero.W; break;

                case ConsoleKey.NumPad3:
                case ConsoleKey.D3: Skill = State.Current.Hero.E; break;

                case ConsoleKey.NumPad4:
                case ConsoleKey.D4: Skill = State.Current.Hero.R; break;
                }
                if (Skill != null)
                {
                    IO.DrawerLine linew = new IO.DrawerLine();
                    linew.DefaultForegroundColor = ConsoleColor.Cyan;
                    linew.DefaultBackgroundColor = ConsoleColor.DarkRed;

                    linew += DCLine.New("You", State.Current.Hero.Color, State.Current.Hero.Back);
                    linew += " increase ";
                    linew += DCLine.New(Skill.Name, Skill.Color, Skill.Back);
                    linew += " by one point!";

                    State.Current.Chat.Message(linew);
                    Skill.LevelUp();
                    break;
                }
            }
        }
Exemplo n.º 20
0
        private static void Educable()
        {
            State.Current.Hero.Cexp.OnSet((Int32 Prev) =>
            {
                if (State.Current.Hero.Cexp.Int() + Prev >= State.Current.Hero.Mexp.Int())
                {
                    IO.DrawerLine linew          = new IO.DrawerLine();
                    linew.DefaultForegroundColor = ConsoleColor.Green;
                    linew.DefaultBackgroundColor = ConsoleColor.Yellow;

                    linew += DCLine.New("You", State.Current.Hero.Color, State.Current.Hero.Back);
                    linew += " reach a new level!";

                    State.Current.Chat.Message(linew);
                    State.Current.Hero.Improve();

                    return(0);
                }
                else
                {
                    return(Prev);
                }
            });
        }
Exemplo n.º 21
0
        //methods
        public void Use(ITargetable Target)
        {
            if (!CanCast())
            {
                return;
            }

            //costing
            HeroRef.Csp -= Cost;

            //dmg
            Int32 Dmg = this.Dmg(Target);

            Target.Chp -= Dmg;

            //additional (heal)
            Int32 HDmg = (Int32)(Dmg * 1.3);

            if (HeroRef.Chp.Int() < HeroRef.Mhp.Int())
            {
                if (HeroRef.Chp.Int() + HDmg > HeroRef.Mhp.Int())
                {
                    HeroRef.Chp = HeroRef.Mhp;
                }
                else
                {
                    HeroRef.Chp += HDmg;
                }
            }

            //msg
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += " deal ";
            Line += DCLine.New(Dmg.ToString(), Color, Back);
            Line += " damage!";
            Temp.State.Current.Chat.Message(Line);

            for (int i = 0; i < HeroRef.R.Level + 1; i++)
            {
                //dmg
                Dmg             = 1;
                Target.Armor   -= 1;
                Target.Barrier -= 1;

                //msg
                Line = new DrawerLine();
                Line.DefaultForegroundColor = HeroRef.Color;
                Line.DefaultBackgroundColor = HeroRef.Back;
                Line += DCLine.New(Name, Color, Back);
                Line += " decreases ";
                Line += DCLine.New((Target as IThing).Name, (Target as IThing).Color, (Target as IThing).Back);
                Line += " arm and bar by 1!";
                Temp.State.Current.Chat.Message(Line);
            }

            Line = new DrawerLine();
            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += " heal ";
            Line += DCLine.New(HDmg.ToString(), Color, Back);
            Line += " your hp!";
            Temp.State.Current.Chat.Message(Line);


            if (HeroRef.R.Level > 0)
            {
                new Blessingoftheelements().Use(null);
            }
        }
Exemplo n.º 22
0
        //methods
        public void Use(ITargetable Target)
        {
            String       stat         = "";
            ConsoleColor ElementColor = ConsoleColor.Black;

            Dmged = 1;

            switch (Element = State.Random.Next(4))
            {
            case 0:
            {
                stat            = "improve dmg"; ElementColor = ConsoleColor.Red;
                HeroRef.MinDmg += 1;
                HeroRef.MaxDmg += 1;
                PressedNow      = Input.Pressed;
                Input.OnInput  += Input_OnInput;
                break;
            }

            case 1:
            {
                stat = "heal hp"; ElementColor = ConsoleColor.Blue;
                if (HeroRef.Chp.Int() < HeroRef.Mhp.Int())
                {
                    if (HeroRef.Chp.Int() + 1 > HeroRef.Mhp.Int())
                    {
                        HeroRef.Chp = HeroRef.Mhp;
                    }
                    else
                    {
                        HeroRef.Chp += 1;
                    }
                }
                break;
            }

            case 2:
            {
                stat         = "add element"; ElementColor = ConsoleColor.Cyan;
                HeroRef.Msp += 1;
                HeroRef.Csp += 1;
                break;
            }

            case 3:
            {
                stat         = "add mhp"; ElementColor = ConsoleColor.DarkYellow;
                HeroRef.Mhp += 1;
                HeroRef.Chp += 1;
                break;
            }
            }

            //msg
            DrawerLine Line = new DrawerLine();

            Line.DefaultForegroundColor = HeroRef.Color;
            Line.DefaultBackgroundColor = HeroRef.Back;
            Line += DCLine.New(Name, Color, Back);
            Line += DCLine.New(stat, ElementColor, ConsoleColor.Black);
            Line += " !";
            Temp.State.Current.Chat.Message(Line);
        }