SAGA2: Implement teleport party here command

This commit is contained in:
a/ 2021-08-03 20:19:20 +09:00
parent 7ecc231fcd
commit 108c5222a2
2 changed files with 19 additions and 0 deletions

View File

@ -71,6 +71,8 @@ Console::Console(Saga2Engine *vm) : GUI::Debugger() {
registerCmd("teleport_npc_here", WRAP_METHOD(Console, cmdTeleportNPCHere));
registerCmd("teleport_party_here", WRAP_METHOD(Console, cmdTeleportPartyHere));
registerCmd("save_loc", WRAP_METHOD(Console, cmdSaveLoc));
registerCmd("load_loc", WRAP_METHOD(Console, cmdLoadLoc));
@ -289,6 +291,21 @@ bool Console::cmdTeleportNPCHere(int argc, const char **argv) {
return true;
}
bool Console::cmdTeleportPartyHere(int argc, const char **argv) {
if (argc != 1)
debugPrintf("Usage: %s\n", argv[0]);
else {
TilePoint loc = getCenterActor()->getLocation();
for (ObjectID id = ActorBaseID; id < ActorBaseID + kPlayerActors; ++id) {
Actor *p = (Actor *)GameObject::objectAddress(id);
p->setLocation(loc);
}
}
return true;
}
bool Console::cmdSaveLoc(int argc, const char **argv) {
if (argc != 1)
debugPrintf("Usage: %s\n", argv[0]);

View File

@ -69,6 +69,8 @@ private:
bool cmdTeleportNPCHere(int argc, const char **argv);
bool cmdTeleportPartyHere(int argc, const char **argv);
bool cmdSaveLoc(int argc, const char **argv);
bool cmdLoadLoc(int argc, const char **argv);