]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/cmd.qc
Bot waypoints: remove all incoming links from waypoints with a support waypoint;...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / cmd.qc
index 915fea7ee0ca2ca02ffb14d9341d539b4b4a7d14..e599231c6586d80acb81c44c15c2ec18b956f53e 100644 (file)
@@ -184,10 +184,12 @@ void ClientCommand_wpeditor(entity caller, int request, int argc)
                        {
                                if (argv(1) == "spawn")
                                {
+                                       string s = argv(2);
                                        if (!IS_PLAYER(caller))
                                                sprint(caller, "ERROR: this command works only if you are player\n");
                                        else
-                                               waypoint_spawn_fromeditor(caller);
+                                               waypoint_spawn_fromeditor(caller, (s == "crosshair"), (s == "jump"), (s == "crouch"), (s == "support"));
+                                       return;
                                }
                                else if (argv(1) == "remove")
                                {
@@ -195,6 +197,12 @@ void ClientCommand_wpeditor(entity caller, int request, int argc)
                                                sprint(caller, "ERROR: this command works only if you are player\n");
                                        else
                                                waypoint_remove_fromeditor(caller);
+                                       return;
+                               }
+                               else if (argv(1) == "hardwire")
+                               {
+                                       waypoint_start_hardwiredlink(caller);
+                                       return;
                                }
                                else if (argv(1) == "unreachable")
                                {
@@ -202,13 +210,34 @@ void ClientCommand_wpeditor(entity caller, int request, int argc)
                                                sprint(caller, "ERROR: this command works only if you are player\n");
                                        else
                                                waypoint_unreachable(caller);
+                                       return;
                                }
                                else if (argv(1) == "saveall")
+                               {
                                        waypoint_saveall();
+                                       return;
+                               }
                                else if (argv(1) == "relinkall")
+                               {
                                        waypoint_schedulerelinkall();
-
-                               return;
+                                       return;
+                               }
+                               else if (argv(1) == "symaxis")
+                               {
+                                       if (argv(2) == "set" || argv(2) == "get")
+                                       {
+                                               waypoint_getSymmetricalAxis_cmd(caller, (argv(2) == "set"), 3);
+                                               return;
+                                       }
+                               }
+                               else if (argv(1) == "symorigin")
+                               {
+                                       if (argv(2) == "set" || argv(2) == "get")
+                                       {
+                                               waypoint_getSymmetricalOrigin_cmd(caller, (argv(2) == "set"), 3);
+                                               return;
+                                       }
+                               }
                        }
                }
 
@@ -217,7 +246,22 @@ void ClientCommand_wpeditor(entity caller, int request, int argc)
                case CMD_REQUEST_USAGE:
                {
                        sprint(caller, "\nUsage:^3 cmd wpeditor action\n");
-                       sprint(caller, "  Where 'action' can be: spawn, remove, unreachable, saveall, relinkall\n");
+                       sprint(caller, "  Where 'action' can be:\n");
+                       sprint(caller, "   ^5spawn^7: spawns a waypoint at player's position\n");
+                       sprint(caller, "   ^5remove^7: remove player's nearest waypoint\n");
+                       sprint(caller, "   ^5unreachable^7: useful to reveal waypoints and items unreachable from the current position and spawnpoints without a nearest waypoint\n");
+                       sprint(caller, "   ^5saveall^7: saves all waypoints and links to file\n");
+                       sprint(caller, "   ^5relinkall^7: relink all waypoints as if they were respawned\n");
+                       sprint(caller, "   ^5spawn crosshair^7: spawns a waypoint at crosshair's position (useful to spawn custom jumppad waypoints (spawn another waypoint to create destination))\n");
+                       sprint(caller, "   ^5spawn jump^7: spawns a jump waypoint (spawn another waypoint to create destination)\n");
+                       sprint(caller, "   ^5spawn crouch^7: spawns a crouch waypoint\n");
+                       sprint(caller, "   ^5spawn support^7: spawns a support waypoint (spawn another waypoint to create destination from which all incoming links are removed), useful to replace links to preblematic jumppad/teleport waypoints\n");
+                       sprint(caller, "   ^5hardwire^7: marks the nearest waypoint as origin of a new hardwired link (spawn another waypoint over an existing one to create destination)\n");
+                       sprint(caller, "   ^5symorigin get|set\n");
+                       sprint(caller, "   ^5symorigin get|set p1 p2 ... pX\n");
+                       sprint(caller, "   ^5symaxis get|set p1 p2\n");
+                       sprint(caller, "   ^7 where p1 p2 ... pX are positions (\"x y z\", z can be omitted) that you know are perfectly symmetrical");
+                       sprint(caller, "   ^7 so you can determine origin/axis of symmetry of maps without ctf flags or where flags aren't perfectly symmetrical\n");
                        return;
                }
        }
@@ -247,6 +291,36 @@ void ClientCommand_join(entity caller, int request)
        }
 }
 
+void ClientCommand_kill(entity caller, int request)
+{
+       switch (request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if(IS_SPEC(caller) || IS_OBSERVER(caller))
+                               return; // no point warning about this, command does nothing
+
+                       if(GetResource(caller, RES_HEALTH) <= 0)
+                       {
+                               sprint(caller, "Can't die - you are already dead!\n");
+                               return;
+                       }
+
+                       ClientKill(caller);
+
+                       return;  // never fall through to usage
+               }
+
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       sprint(caller, "\nUsage:^3 cmd kill\n");
+                       sprint(caller, "  No arguments required.\n");
+                       return;
+               }
+       }
+}
+
 void ClientCommand_physics(entity caller, int request, int argc)
 {
        switch (request)
@@ -730,6 +804,7 @@ void ClientCommand_(entity caller, int request)
        CLIENT_COMMAND("autoswitch", ClientCommand_autoswitch(ent, request, arguments), "Whether or not to switch automatically when getting a better weapon") \
        CLIENT_COMMAND("clientversion", ClientCommand_clientversion(ent, request, arguments), "Release version of the game") \
        CLIENT_COMMAND("join", ClientCommand_join(ent, request), "Become a player in the game") \
+       CLIENT_COMMAND("kill", ClientCommand_kill(ent, request), "Become a member of the dead") \
        CLIENT_COMMAND("minigame", ClientCommand_minigame(ent, request, arguments, command), "Start a minigame") \
        CLIENT_COMMAND("mv_getpicture", ClientCommand_mv_getpicture(ent, request, arguments), "Retrieve mapshot picture from the server") \
        CLIENT_COMMAND("physics", ClientCommand_physics(ent, request, arguments), "Change physics set") \