Example #1
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();
        }