Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- namespace ConsoleApplication1
- {
- class Movements : Info
- {
- public void Action()
- {
- //This cleans up player after it moves
- Console.SetCursorPosition(x, y);
- Console.Write(" ");
- x = x + xspeed;
- y = y + yspeed;
- //this is the control input from the player
- if (Console.KeyAvailable)
- {
- ConsoleKeyInfo Keyinfo = Console.ReadKey(true);
- switch (Keyinfo.Key)
- {
- case ConsoleKey.W:
- y = y - 1;
- figure = "^.^";
- break;
- case ConsoleKey.S:
- y = y + 1;
- figure = "v.v";
- break;
- case ConsoleKey.A:
- x = x - 1;
- figure = "<.<";
- break;
- case ConsoleKey.D:
- x = x + 1;
- figure = ">.>";
- break;
- case ConsoleKey.T:
- pla.Screen();
- break;
- }
- if (x > 77)
- {
- x = 77;
- }
- if (y >= 23)
- {
- y = 23;
- }
- if (x < 1)
- {
- x = 1;
- }
- if (y <= 4)
- {
- y = 4;
- }
- if (location == 3)
- {
- Random waten = new Random(DateTime.Now.Millisecond);
- Thread.Sleep(5);
- int we = waten.Next(1, 101);
- Random fi = new Random();
- int n = fi.Next(1, 101);
- if (n <= 1)
- {
- Console.Clear();
- Console.SetCursorPosition(25, 11);
- Console.Write("An Enemy Stops you in your tracks!");
- Thread.Sleep(1500);
- Console.Clear();
- if (we <= 90)
- {
- fight = 4;
- bat.Battle();
- }
- else
- {
- fight = 1;
- bat.Battle();
- }
- }
- }
- if (location == 4)
- {
- Random waten = new Random(DateTime.Now.Millisecond);
- Thread.Sleep(5);
- int we = waten.Next(1, 101);
- Random fi = new Random();
- int n = fi.Next(1, 101);
- if (n <= 2)
- {
- Console.Clear();
- Console.SetCursorPosition(25, 11);
- Console.Write("An Enemy Stops you in your tracks!");
- Thread.Sleep(1500);
- Console.Clear();
- if (we <= 90)
- {
- fight = 1;
- bat.Battle();
- }
- else
- {
- fight = 2;
- bat.Battle();
- }
- }
- }
- }
- //this draws the player on to screen
- Console.SetCursorPosition(x, y);
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write(figure);
- Console.ForegroundColor = ConsoleColor.White;
- //this controls game speed
- Thread.Sleep(20);
- if (location == 5)
- {
- Console.SetCursorPosition(1, 1);
- Console.WriteLine("Location: Stone City Gates T. View Status ");
- Console.Write("_____________________________________________________________________\n");
- //draw inn
- Console.ForegroundColor = ConsoleColor.DarkGray;
- Console.SetCursorPosition(30, 4);
- Console.Write("Bad Omen Inn");
- Console.ForegroundColor = ConsoleColor.White;
- //draw town square
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.SetCursorPosition(4, 10);
- Console.Write("Town Square");
- Console.ForegroundColor = ConsoleColor.White;
- //draw castle
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.SetCursorPosition(60, 10);
- Console.Write("Castle");
- Console.ForegroundColor = ConsoleColor.White;
- //draw gates
- Console.ForegroundColor = ConsoleColor.Cyan;
- Console.SetCursorPosition(35, 20);
- Console.Write("Gates");
- Console.ForegroundColor = ConsoleColor.White;
- }
- if (location == 6)
- {
- Console.SetCursorPosition(1, 1);
- Console.WriteLine("Location: Stone City's Square T. View Status ");
- Console.Write("_____________________________________________________________________\n");
- //draw inn
- Console.SetCursorPosition(20, 6);
- Console.Write("Weapon Shop");
- Console.SetCursorPosition(20, 17);
- Console.Write("Armor Shop");
- Console.SetCursorPosition(50, 17);
- Console.Write("Magic Shop");
- Console.SetCursorPosition(50, 6);
- Console.Write("Kosh's House");
- Console.SetCursorPosition(70, 10);
- Console.Write("GO BACK");
- }
- if (location == 7)
- {
- Console.SetCursorPosition(1, 1);
- Console.WriteLine("Location: Stone City's Castle T. View Status ");
- Console.Write("_____________________________________________________________________\n");
- //draw inn
- Console.SetCursorPosition(40, 7);
- Console.Write("Castle");
- Console.SetCursorPosition(1, 7);
- Console.Write("G\n O\n\n B\n A\n C\n K");
- }
- if (location == 4)
- {
- Console.SetCursorPosition(1, 1);
- Console.WriteLine("Location: Cave Moor T. View Status ");
- Console.Write("_____________________________________________________________________\n");
- //this draws man
- if (killedman == 0)
- {
- Console.SetCursorPosition(4, 10);
- Console.Write("Misterious Man");
- }
- if (killedman == 1 & openedchest == 0)
- {
- Console.SetCursorPosition(4, 10);
- Console.Write("Chest");
- }
- if (questsemicompleted5 == 1 & killedguard == 0)
- {
- Console.SetCursorPosition(35, 5);
- Console.Write("Guard");
- }
- Console.SetCursorPosition(65, 11);
- Console.Write("go back");
- }
- if (location == 3)
- {
- //this draws HUD
- Console.SetCursorPosition(1, 1);
- Console.WriteLine("Location: South-East Warren T. View Status ");
- Console.Write("_____________________________________________________________________\n");
- //this draws cave moor
- Console.ForegroundColor = ConsoleColor.DarkCyan;
- Console.SetCursorPosition(1, 15);
- ma.LocationNames();
- Console.Write(cavemoorname);
- Console.ForegroundColor = ConsoleColor.White;
- //this draws stone city
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.SetCursorPosition(20, 4);
- ma.LocationNames();
- Console.Write(stonecityname);
- Console.ForegroundColor = ConsoleColor.White;
- //this draws shang
- Console.ForegroundColor = ConsoleColor.Cyan;
- Console.SetCursorPosition(60, 14);
- Console.Write("Shang City");
- Console.ForegroundColor = ConsoleColor.White;
- }
- if (location == 1)
- {
- //this draws HUD
- Console.SetCursorPosition(1, 1);
- Console.WriteLine("Location: Shang Gates T. View Status");
- Console.Write("_____________________________________________________________________\n");
- //this draws gates
- Console.SetCursorPosition(1, 15);
- Console.ForegroundColor = ConsoleColor.Cyan;
- Console.Write("Gates");
- Console.ForegroundColor = ConsoleColor.White;
- //this draws gatekeeper
- Console.SetCursorPosition(1, 7);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Gatekeeper");
- Console.ForegroundColor = ConsoleColor.White;
- //this draws town square
- Console.SetCursorPosition(60, 10);
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.Write("Town Square");
- Console.ForegroundColor = ConsoleColor.White;
- }
- if (location == 2)
- {
- //this draws HUD
- Console.SetCursorPosition(1, 1);
- Console.WriteLine("Location: Shang's Town Square T. View Status");
- Console.Write("_____________________________________________________________________");
- //this draws go back
- Console.SetCursorPosition(1, 7);
- Console.Write("G\n O\n\n B\n A\n C\n K");
- //this draws generalstore
- Console.SetCursorPosition(5, 4);
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.Write("General Store");
- Console.ForegroundColor = ConsoleColor.White;
- //this draws weapon shop
- Console.SetCursorPosition(30, 4);
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Weapon shop");
- Console.ForegroundColor = ConsoleColor.White;
- //this draws armor shop
- Console.SetCursorPosition(50, 4);
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("Armor Shop");
- //this draws pawnshop
- Console.SetCursorPosition(20, 20);
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.Write("Pawn Shop");
- Console.ForegroundColor = ConsoleColor.White;
- //this draws sun's inn
- Console.SetCursorPosition(50, 12);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Sun's Inn");
- Console.ForegroundColor = ConsoleColor.White;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment