public Statue(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 100; EP = 1; Damage = 0; Food = false; Loot = new List <char>(); InfoText = "An ancient statue. Seems to be safe, but when you look at it, chills run down your spine. It's better not to touch this thing."; SpecialText = "???"; while (true) { int coordY = DataBase.RNG.Next(1, 40); int coordX = DataBase.RNG.Next(1, 40); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public Ghost(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 4; EP = 1; Damage = 1; Food = false; Loot = new List <char>() { 's', 'p', 'r', 't', 'b' }; InfoText = "A wandering ghost. It seems, that this creature doesn't want to attack you, but it's still dangerous to come close."; SpecialText = "A vicious attack, that chills you to your bones. Deals damage both to your health and stamina."; while (true) { int coordY = DataBase.RNG.Next(41); int coordX = DataBase.RNG.Next(41); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == '0' || dungeon.Map[coordY, coordX].ID == 'e' || dungeon.Map[coordY, coordX].ID == 'b' || dungeon.Map[coordY, coordX].ID == 'w') { Position = new Coords(coordY, coordX); break; } } }
public Ooze(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 7; EP = 1; Damage = 1; Food = false; Loot = new List <char>() { 's', 'p', 'r', 'b' }; InfoText = "A giant slime. Try not to get in it's way."; SpecialText = "The ooze covers your weapons in it's goo. They will be useless in this fight."; while (true) { int coordY = DataBase.RNG.Next(1, 40); int coordX = DataBase.RNG.Next(1, 40); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public MainWindow() { InitializeComponent(); Application.Current.MainWindow = this; Dungeon = new Labyrinth(); Sam = new Hero(Dungeon.Start); Killed = new List <Monster>(); NoEnergy += Fatigue; NoHealth += Death; Table = new Cell[5, 5]; for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { string name = "cell" + i + j; Table[i, j] = new Cell((Label)Grid2.FindName(name)); } } //Рисуем начальное положение и вставляем руки Table[0, 0].Visible = false; Table[0, 4].Visible = false; Table[4, 0].Visible = false; Table[4, 4].Visible = false; var ImageL = new Image(); ImageL.Source = DataBase.WeaponImages[Sam.LeftHand]; LeftHand.Content = ImageL; var ImageR = new Image(); ImageR.Source = DataBase.WeaponImages[Sam.RightHand]; RightHand.Content = ImageR; Redraw(); }
public Shadow(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 6; EP = 1; Damage = 3; if (sam.LeftHand == 't' || sam.RightHand == 't') { Damage--; } Food = false; Loot = new List <char>(); InfoText = "You stare into the swirling darkness and see something watching back. The shadow of this very dungeon is here. Perhaps, it's unstable energy can transport you somewhere..."; SpecialText = "The shadow becomes ethereal, making this fight even harder. Your strikes can barely damage it then."; while (true) { int coordY = DataBase.RNG.Next(1, 40); int coordX = DataBase.RNG.Next(1, 40); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public Skeleton(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 4; EP = 1; Damage = 3; Food = false; Loot = new List <char>() { 's' }; InfoText = "A living skeleton stands in your way. Beware of it's sharp sword!"; SpecialText = "The skeleton inflicts a deadly blow, dealing massive damage."; while (true) { int coordY = DataBase.RNG.Next(1, 40); int coordX = DataBase.RNG.Next(1, 40); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public Spider(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 6; EP = 1; Damage = 2; Food = true; Loot = new List <char>() { 's', 'p', 'r', 't', 'b' }; InfoText = "A giant spider. Fortuntely, it won't go out of it's lair even to attack you."; SpecialText = "You get stuck in sticky web. Can't run away anymore."; while (true) { int coordY = DataBase.RNG.Next(1, 40); int coordX = DataBase.RNG.Next(1, 40); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public Zombie(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 8; EP = 1; Damage = 1; Food = false; Loot = new List <char>() { 's', 'p', 'r', 't', 'b' }; InfoText = "A terrifying creature stands in front of you. It's a walking dead, which hungers for flesh. Your flesh."; SpecialText = "The zombie gets you in a deadly grip. You get poisoned by it's rotten bite."; while (true) { int coordY = DataBase.RNG.Next(1, 40); int coordX = DataBase.RNG.Next(1, 40); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public Rat(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 5; EP = 1; Damage = 2; Food = true; Loot = new List <char>() { 'r' }; InfoText = "A giant rat. It seems to be rather aggressive."; SpecialText = "The rat knocks you down and rummages in your bags for something edible. Hopefully, you have something in there."; while (true) { int coordY = DataBase.RNG.Next(1, 40); int coordX = DataBase.RNG.Next(1, 40); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public override void Wander(Hero sam, Labyrinth dungeon) { Coords[] newCoords = new Coords[4]; if (Position.Y > 0) { newCoords[0] = new Coords(Position.Y - 1, Position.X); } if (Position.X < 40) { newCoords[1] = new Coords(Position.Y, Position.X + 1); } if (Position.Y < 40) { newCoords[2] = new Coords(Position.Y + 1, Position.X); } if (Position.X > 0) { newCoords[3] = new Coords(Position.Y, Position.X - 1); } int index = DataBase.RNG.Next(4); for (int i = 0; i < 4; i++) { Coords move = newCoords[(index + i) % 4]; if (move == null) { continue; } if (dungeon.Map[move.Y, move.X].ID == 'e' && !sam.Position.Equals(move)) { Position = move; break; } } }
public Goblin(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 4; EP = 1; Damage = 1; Food = true; Loot = new List <char>(); InfoText = "That's greedy goblin! Who knows, what treasures he has in his bag?"; SpecialText = "The goblin pushes you and runs away!"; while (true) { int coordY = DataBase.RNG.Next(1, 40); int coordX = DataBase.RNG.Next(1, 40); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (tableX > -1 && tableX < 3 && tableY > -1 && tableY < 3 && table[tableY, tableX].Visible == true) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public Tentacle(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 5; EP = 1; Damage = 0; Food = false; Loot = new List <char>(); InfoText = "A tentacle!"; SpecialText = "The tentacle drags you into the deeps. Only cold death awaits you there."; Position = new Coords(0, 0); }
public Bat(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 6; EP = 1; Damage = 1; Food = true; Loot = new List <char>(); InfoText = "A bat!"; SpecialText = "A vampiric bite, which heals the bat."; Position = new Coords(0, 0); }
public Mimic(Labyrinth dungeon, Hero sam, Cell[,] table) { HP = 6; EP = 1; Damage = 2; Food = true; Loot = new List <char>() { 's', 'p', 'r', 't', 'b' }; InfoText = "A mimic!"; SpecialText = "Mimic doesn't have a special attack."; Position = new Coords(0, 0); }
public override void Wander(Hero sam, Labyrinth dungeon) { while (true) { int coordY = DataBase.RNG.Next(Math.Max(1, sam.Position.Y - 2), Math.Min(6, sam.Position.Y + 2)); int coordX = DataBase.RNG.Next(Math.Max(1, sam.Position.X - 2), Math.Min(6, sam.Position.X + 2)); int tableY = sam.Position.Y - coordY + 2; int tableX = sam.Position.X - coordX + 2; if (sam.Position.Y == coordY && sam.Position.X == coordX) { continue; } if (dungeon.Map[coordY, coordX].ID == 'e') { Position = new Coords(coordY, coordX); break; } } }
public override void Wander(Hero sam, Labyrinth dungeon) { }
public abstract void Wander(Hero sam, Labyrinth dungeon);
public override void Wander(Hero sam, Labyrinth dungeon) { HP = 100; EP = 1; }