Exemplo n.º 1
0
 /// <summary>
 /// the cons
 /// </summary>
 /// <param name="aktchar">actual char</param>
 /// <param name="time">disp timer</param>
 public Character_window(Character_classes aktchar, DispatcherTimer time)
 {
     InitializeComponent();
     this.vmcv        = new Viewmodel_charstatview(aktchar);
     timer            = time;
     this.DataContext = vmcv;
 }
Exemplo n.º 2
0
        /// <summary>
        /// the tower
        /// </summary>
        /// <param name="chare">the character</param>
        /// <param name="map">the map</param>
        public Tower(Character_classes chare, Maps map) : base((chare.LVL * 350), 0, (chare.LVL * 5), 0, chare.LVL, "Tower", map.Width - 100, (map.Height / 2) - 40, map, chare, (chare.LVL * 45))
        {
            EllipseGeometry eg = new EllipseGeometry(new Point(map.Width - 60, (map.Height / 2) - 40), 35, 55);

            Geometry = eg;
            Image    = new ImageBrush(new BitmapImage(new Uri(@"images\Tower.PNG", UriKind.Relative)));
            Actpoint = new Point(map.Width - 60, (map.Height / 2) - 40);
            this.Map.Monsters.Add(this);
        }
Exemplo n.º 3
0
 /// <summary>
 /// boss narratos
 /// </summary>
 /// <param name="chare">chare of cons</param>
 /// <param name="x">x cordinate of monster</param>
 /// <param name="y">y cordinate of monster</param>
 /// <param name="map">the map</param>
 /// <param name="dirX">direction x</param>
 /// <param name="dirY">direction y</param>
 public Naratos(Character_classes chare, double x, double y, Maps map, double dirX, double dirY) : base("Naratos", chare.LVL, 10 + (chare.LVL * 15), 500 + (chare.LVL * 350), 150, 10 + (chare.LVL * 10), x, y, map, chare, (chare.LVL * 25))
 {
     Image    = new ImageBrush(new BitmapImage(new Uri(@"images\Naratos.PNG", UriKind.Relative)));
     Geometry = new EllipseGeometry(new Point(x, y), 45, 60);
     Actpoint = new Point(x, y);
     DirX     = DirX;
     DirY     = DirY;
     map.Monsters.Add(this);
 }
Exemplo n.º 4
0
 /// <summary>
 /// skeleton cons
 /// </summary>
 /// <param name="chare">chare of cons</param>
 /// <param name="x">x cordinate of monster</param>
 /// <param name="y">y cordinate of monster</param>
 /// <param name="map">the map</param>
 /// <param name="dirX">direction x</param>
 /// <param name="dirY">direction y</param>
 public Skeleton(Character_classes chare, int x, int y, Maps map, double dirX, double dirY) : base(10 + (chare.LVL * 10), 0, 10 + (chare.LVL * 3), 8 + (chare.LVL * 3), chare.LVL, "Skeleton", x, y, map, chare, 10)
 {
     Geometry = new EllipseGeometry(new Point(x, y), 25, 30);
     Image    = new ImageBrush(new BitmapImage(new Uri(@"images\skeleton.PNG", UriKind.Relative)));
     DirX     = dirX;
     DirY     = dirY;
     Actpoint = new Point(x, y);
     this.Map.Monsters.Add(this);
 }
Exemplo n.º 5
0
 /// <summary>
 /// helldog cons
 /// </summary>
 /// <param name="chare">chare of cins</param>
 /// <param name="x">x cordinate of monster</param>
 /// <param name="y">y cordinate of monster</param>
 /// <param name="map">the map</param>
 /// <param name="dirX">the direction x</param>
 /// <param name="dirY">the direction y</param>
 public HellDog(Character_classes chare, int x, int y, Maps map, double dirX, double dirY) : base(35 + (chare.LVL * 15), 0, 20 + (chare.LVL * 6), 20 + (chare.LVL * 8), chare.LVL, "HellDog", x, y, map, chare, 15)
 {
     Geometry = new EllipseGeometry(new Point(x, y), 25, 30);
     Image    = new ImageBrush(new BitmapImage(new Uri(@"images\Helldog.PNG", UriKind.Relative)));
     Actpoint = new Point(x, y);
     DirX     = dirX;
     DirY     = dirY;
     this.Map.Monsters.Add(this);
 }
Exemplo n.º 6
0
 /// <summary>
 /// map cons
 /// </summary>
 /// <param name="width">map width</param>
 /// <param name="height">map height</param>
 /// <param name="player">map player character</param>
 public Maps(int width, int height, Character_classes player)
 {
     this.width         = width;
     this.height        = height;
     this.player        = player;
     this.monsters      = new List <Monsters>();
     this.skill         = new List <Skills>();
     this.potions       = new List <Potion>();
     this.Removeelement = new List <object>();
 }
Exemplo n.º 7
0
        /// <summary>
        /// mariel cons
        /// </summary>
        /// <param name="chare">chare of cons</param>
        /// <param name="x">x cordinate of monster</param>
        /// <param name="y">y cordinate of monster</param>
        /// <param name="map">the map</param>
        /// <param name="dirX">the direction x</param>
        /// <param name="dirY">the direction y</param>
        public Mariel(Character_classes chare, double x, double y, Maps map, double dirX, double dirY) : base("Mariel", chare.LVL, 20 + (chare.LVL * 10), 500 + (chare.LVL * 400), 150, 15 + (chare.LVL * 5), x, y, map, chare, (chare.LVL * 40))
        {
            EllipseGeometry eg = new EllipseGeometry(new Point(x, y), 50, 65);

            Geometry = eg;
            Image    = new ImageBrush(new BitmapImage(new Uri(@"images\Mariel.PNG", UriKind.Relative)));
            Actpoint = new Point(x, y);
            DirX     = dirX;
            DirY     = dirY;
            this.Map.Monsters.Add(this);
        }
Exemplo n.º 8
0
        /// <summary>
        /// ghoul cons
        /// </summary>
        /// <param name="chare">chare of cons</param>
        /// <param name="x">x cordinate of monster</param>
        /// <param name="y">y cordinate of monster</param>
        /// <param name="map">the map</param>
        /// <param name="dirX">direction x</param>
        /// <param name="dirY">direction y</param>
        public Ghoul(Character_classes chare, double x, double y, Maps map, double dirX, double dirY) : base(20 + (chare.LVL * 15), 0, 10 + (chare.LVL * 4), 8 + (chare.LVL * 5), chare.LVL, "Ghoul", x, y, map, chare, 25)
        {
            EllipseGeometry eg = new EllipseGeometry(new Point(x, y), 25, 30);

            Geometry = eg;
            Image    = new ImageBrush(new BitmapImage(new Uri(@"images\Ghoul.PNG", UriKind.Relative)));
            DirX     = dirX;
            DirY     = dirY;
            Actpoint = new Point(x, y);
            this.Map.Monsters.Add(this);
        }
        /// <summary>
        /// deeeath boss
        /// </summary>
        /// <param name="chare">chare of cins</param>
        /// <param name="x">x cordinate of monster</param>
        /// <param name="y">y cordinate of monster</param>
        /// <param name="map">the map</param>
        /// <param name="dirX">direction x</param>
        /// <param name="dirY">direction y</param>
        public DeathKing(Character_classes chare, double x, double y, Maps map, double dirX, double dirY) : base("DeathKing", chare.LVL, 50 + (chare.LVL * 10), 500 + (chare.LVL * 650), 150, 25 + (chare.LVL * 5), x, y, map, chare, (chare.LVL * 50))
        {
            EllipseGeometry eg = new EllipseGeometry(new Point(x, y), 60, 80);

            Geometry = eg;
            Image    = new ImageBrush(new BitmapImage(new Uri(@"images\Deathking.PNG", UriKind.Relative)));
            Actpoint = new Point(x, y);
            DirX     = dirX;
            DirY     = dirY;
            this.Map.Monsters.Add(this);
        }
Exemplo n.º 10
0
 /// <summary>
 /// if already exist this acc
 /// </summary>
 public void Createacc()
 {
     if (File.Exists(this.accname + ".txt"))
     {
         throw new Account_already_have();
     }
     else
     {
         chars = new DarkMage();
     }
 }
Exemplo n.º 11
0
        /// <summary>
        /// fireee boss of game
        /// </summary>
        /// <param name="chare">chare of cons</param>
        /// <param name="x">x cordinate of monster</param>
        /// <param name="y">y cordinate of monster</param>
        /// <param name="map">the map</param>
        /// <param name="dirX">direction x</param>
        /// <param name="dirY">direction y</param>
        public FireLord(Character_classes chare, double x, double y, Maps map, double dirX, double dirY) : base(45 + (chare.LVL * 20), 10, 10 + (chare.LVL * 4), 8 + (chare.LVL * 5), chare.LVL, "FireLord", x, y, map, chare, 30)
        {
            EllipseGeometry eg = new EllipseGeometry(new Point(x, y), 25, 30);

            Geometry = eg;
            Image    = new ImageBrush(new BitmapImage(new Uri(@"images\Firelord.PNG", UriKind.Relative)));
            Actpoint = new Point(x, y);
            DirX     = dirX;
            DirY     = dirY;
            this.Map.Monsters.Add(this);
        }
Exemplo n.º 12
0
 /// <summary>
 /// the mp potion cons
 /// </summary>
 /// <param name="player">the player</param>
 /// <param name="map">the map</param>
 /// <param name="x">x cord</param>
 /// <param name="y">y cord</param>
 public PotionMP(Character_classes player, Maps map, double x, double y) : base(map)
 {
     this.player = player;
     Removable   = false;
     timer       = new DispatcherTimer();
     Geometry    = new EllipseGeometry(new Point(x, y), 15, 15);
     Image       = new ImageBrush(new BitmapImage(new Uri(@"images\MPpotion.PNG", UriKind.Relative)));
     this.Map.Potions.Add(this);
     timer.Interval = new TimeSpan(0, 0, 10);
     timer.Tick    += Timer_Tick;
     timer.Start();
 }
Exemplo n.º 13
0
 /// <summary>
 /// Hit player
 /// </summary>
 /// <param name="player">the player</param>
 /// <param name="damage">damage value</param>
 public void Hit(Character_classes player, int damage)
 {
     if (hitable && alive)
     {
         player.Getdmg(damage);
         hitable = false;
     }
     else if (!alive)
     {
         timer.Stop();
     }
 }
        /// <summary>
        /// cons of data read
        /// </summary>
        /// <param name="filename">filename of cons</param>
        /// <param name="pass">pass of cons</param>
        public DataRead_Write(string filename, string pass)
        {
            this.sr = new StreamReader(filename, true);
            this.r  = this.Readfile();
            if ((pass + "\r").Equals(this.Passwd))
            {
                if (this.r[2] == "DM\r")
                {
                    try
                    {
                        this.read             = new DarkMage();
                        this.read.Name        = this.r[3];
                        this.read.MaxHP       = int.Parse(this.r[4]);
                        this.read.LVL         = int.Parse(this.r[5]);
                        this.read.Exp         = int.Parse(this.r[6]);
                        this.read.Expneed     = int.Parse(this.r[7]);
                        this.read.MaxResource = int.Parse(this.r[8]);
                        this.read.DMG         = double.Parse(this.r[9]);
                        this.read.CriticalDMG = double.Parse(this.r[10]);
                        this.read.CritRate    = double.Parse(this.r[11]);
                        this.read.Def         = int.Parse(this.r[12]);
                        this.read.STR         = int.Parse(this.r[13]);
                        this.read.INT         = int.Parse(this.r[14]);
                        this.read.VIT         = int.Parse(this.r[15]);
                        this.read.WIT         = int.Parse(this.r[16]);
                        this.read.Men         = int.Parse(this.r[17]);
                        this.read.Statpoint   = int.Parse(this.r[18]);
                        this.read.Skillpoint  = int.Parse(this.r[19]);
                        (this.read as DarkMage).DarkBallSkillPoint  = int.Parse(this.r[20]);
                        (this.read as DarkMage).LightingSkillPoint  = int.Parse(this.r[21]);
                        (this.read as DarkMage).IonShieldSkillPoint = int.Parse(this.r[22]);
                        (this.read as DarkMage).ContractSkillPoint  = int.Parse(this.r[23]);
                        this.read.CriticalDMG -= (0.05 * this.read.CriticalDMG);
                        this.read.CritRate    -= (0.03 * this.read.CritRate);
                        this.read.DMG         -= (0.02 * this.read.DMG);
                        this.read.HP          -= 3;
                        this.read.Def         -= 5;
                        this.read.MaxResource -= 10;
                    }
                    catch (Exception k)
                    {
                        MessageBox.Show(k.Message);
                        Application.Current.Shutdown();
                    }
                }
            }

            this.sr.Close();
        }
Exemplo n.º 15
0
 /// <summary>
 /// if already exists an acc
 /// </summary>
 /// <returns>the haveacc</returns>
 public bool Haveacc()
 {
     if (File.Exists(this.accname + ".txt") && (this.passwd + "\r").Equals((rw = new DataRead_Write(this.accname + ".txt", this.passwd)).Passwd))
     {
         this.chars = rw.Readed;
         return(true);
     }
     else if (File.Exists(this.accname + ".txt") && !(this.passwd + "\r").Equals(rw.Passwd))
     {
         throw new IncorrectAcc_username();
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 16
0
 /// <summary>
 /// monsters cons
 /// </summary>
 /// <param name="hp">hp of monster</param>
 /// <param name="mp">mp of monster</param>
 /// <param name="defense">defense of monster</param>
 /// <param name="damage">damage of monster</param>
 /// <param name="lvl">lvl of monster</param>
 /// <param name="name">name of monster</param>
 /// <param name="x">x codinate</param>
 /// <param name="y">y cordinate</param>
 /// <param name="map">the map</param>
 /// <param name="chare">the character</param>
 /// <param name="giveexp">the given exp</param>
 public Monsters(int hp, int mp, int defense, int damage, int lvl, string name, double x, double y, Maps map, Character_classes chare, int giveexp)
 {
     this.hp        = hp;
     this.mp        = mp;
     this.defense   = defense;
     this.damage    = damage;
     this.lvl       = lvl;
     this.name      = name;
     this.alive     = true;
     this.map       = map;
     this.chare     = chare;
     this.giveexp   = giveexp;
     this.MaxHP     = hp;
     timer          = new DispatcherTimer();
     hitable        = false;
     timer.Interval = new TimeSpan(0, 0, 0, 1);
     timer.Tick    += Timer_Tick;
     timer.Start();
 }
        /// <summary>
        /// startgame constructor
        /// </summary>
        /// <param name="character">character class</param>
        /// <param name="main">main window</param>
        public StartGameScreen(Character_classes character, MainWindow main)
        {
            this.start        = new Grid();
            this.character    = character;
            this.start.Width  = 1000;
            this.start.Height = 800;
            ImageBrush ib = new ImageBrush(new BitmapImage(new Uri(@"images\Startbackground.PNG", UriKind.Relative)));

            this.start.Background = ib;
            this.main             = main;
            main.Vml.Display      = new Displaying_engine(main.Vml.Map, main, this);
            firstmap = false;
            secmap   = false;
            thirdmap = false;
            firtmap  = new Firstmap(1000, 800, main.Vml.User.Chars);
            smap     = new Secondmap(1000, 800, main.Vml.User.Chars);
            thmap    = new Thirdmap(1000, 800, main.Vml.User.Chars);
            this.Initalize();
        }
        /// <summary>
        /// cons of data write
        /// </summary>
        /// <param name="filename">filename of cons</param>
        /// <param name="ch">char of cons</param>
        /// <param name="username">username of cons</param>
        /// <param name="passwd">passwd of cons</param>
        public DataRead_Write(string filename, Character_classes ch, string username, string passwd)
        {
            this.sw = new StreamWriter(filename, false);
            this.sw.WriteLine(username);
            this.sw.WriteLine(passwd);
            if (ch is DarkMage)
            {
                this.sw.WriteLine("DM");
            }

            this.sw.WriteLine(ch.Name);
            this.sw.WriteLine(ch.MaxHP);
            this.sw.WriteLine(ch.LVL);
            this.sw.WriteLine(ch.Exp);
            this.sw.WriteLine(ch.Expneed);
            this.sw.WriteLine(ch.MaxResource);
            this.sw.WriteLine(ch.DMG);
            this.sw.WriteLine(ch.CriticalDMG);
            this.sw.WriteLine(ch.CritRate);
            this.sw.WriteLine(ch.Def);
            this.sw.WriteLine(ch.STR);
            this.sw.WriteLine(ch.INT);
            this.sw.WriteLine(ch.VIT);
            this.sw.WriteLine(ch.WIT);
            this.sw.WriteLine(ch.Men);
            this.sw.WriteLine(ch.Statpoint);
            this.sw.WriteLine(ch.Skillpoint);

            if (ch is DarkMage)
            {
                this.sw.WriteLine((ch as DarkMage).DarkBallSkillPoint);
                this.sw.WriteLine((ch as DarkMage).LightingSkillPoint);
                this.sw.WriteLine((ch as DarkMage).IonShieldSkillPoint);
                this.sw.WriteLine((ch as DarkMage).ContractSkillPoint);
            }

            this.sw.Close();
        }
Exemplo n.º 19
0
 /// <summary>
 /// first map constructor
 /// </summary>
 /// <param name="width">width of map</param>
 /// <param name="height">height of map</param>
 /// <param name="player">player of map</param>
 public Thirdmap(int width, int height, Character_classes player) : base(width, height, player)
 {
 }
Exemplo n.º 20
0
 /// <summary>
 /// vm cons
 /// </summary>
 /// <param name="aktchar">aktchar of the statview</param>
 public Viewmodel_charstatview(Character_classes aktchar)
 {
     this.aktchar = aktchar;
 }
Exemplo n.º 21
0
 /// <summary>
 /// bosses cons
 /// </summary>
 /// <param name="name">name of monster</param>
 /// <param name="lvl">lvl of monster</param>
 /// <param name="dmg">dmg of monster</param>
 /// <param name="hp">hp point of monster</param>
 /// <param name="mp">mp of monster</param>
 /// <param name="defense">defense of monster</param>
 /// <param name="x">x cordinate</param>
 /// <param name="y">y cordinate</param>
 /// <param name="map">the map</param>
 /// <param name="chare">the character</param>
 /// <param name="giveexp">the given exp</param>
 public Bosses(string name, int lvl, int dmg, int hp, int mp, int defense, double x, double y, Maps map, Character_classes chare, int giveexp) : base(hp, mp, defense, dmg, lvl, name, x, y, map, chare, giveexp)
 {
 }