示例#1
0
 private static bool loc(String[] words)
 {
     try {
         player.say($"im at {player.getLocation().X} , {player.getLocation().Y}");
         return(true);
     }
     catch (Exception e) {
         VConsole.writeLine("Error with command: " + e);
         return(false);
     }
 }
示例#2
0
 private static bool clearConsole()
 {
     try {
         VConsole.clear();
         return(true);
     }
     catch (Exception e) {
         VConsole.writeLine("Error with command: " + e);
         return(false);
     }
 }
示例#3
0
 private static bool changeRange(String[] words)
 {
     try {
         int newRange = Convert.ToInt32(words[1]);
         player.setViewRange(newRange);
         return(true);
     }
     catch (Exception e) {
         VConsole.writeLine("Error with command: " + e);
         return(false);
     }
 }
示例#4
0
 private static bool setCon(String[] words)
 {
     try {
         int newSize = Convert.ToInt32(words[1]);
         GameData.levelViewSize = newSize;
         return(true);
     }
     catch (Exception e) {
         VConsole.writeLine("Error with command: " + e);
         return(false);
     }
 }
示例#5
0
        private static bool setSpeed(String[] words)
        {
            try {
                float newSpeed = float.Parse(words[1]);
                player.setSpeed(newSpeed);

                return(true);
            }
            catch (Exception e) {
                VConsole.writeLine("Error with command: " + e);
                return(false);
            }
        }
示例#6
0
        private static bool teleport(String[] words)
        {
            try {
                int   x   = Convert.ToInt32(words[2]);
                int   y   = Convert.ToInt32(words[3]);
                Level lvl = allLevels[words[1] + ".txt"];;

                player.level.world[player.getLocation().X, player.getLocation().Y].topObject = null; //deletes player
                player.level = lvl;
                player.move(new Point(x, y));                                                        //moves player to targetlocation
                return(true);
            }
            catch (Exception e) {
                VConsole.writeLine("Error with command: " + e);
                return(false);
            }
        }
示例#7
0
 public void say(String text)
 {
     VConsole.writeLine($"{name}: {text}");
 }