This commit is contained in:
aozhiwei 2023-04-21 19:26:30 +08:00
parent 314591a587
commit bb5a856abc
2 changed files with 11 additions and 2 deletions

View File

@ -30,6 +30,11 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg)
std::string cmd = cmds[0]; std::string cmd = cmds[0];
if (cmd == "gps") { if (cmd == "gps") {
SendDebugMsg(a8::Format("gps: %f,%f,%f", {GetPos().GetX(), GetPos().GetY(), GetPos().GetZ()})); SendDebugMsg(a8::Format("gps: %f,%f,%f", {GetPos().GetX(), GetPos().GetY(), GetPos().GetZ()}));
} else if (cmd == "info") {
SendDebugMsg(a8::Format("attack_dir: %f,%f,%f",
{GetAttackDir().x,
GetAttackDir().y,
GetAttackDir().z}));
} else if (cmd == "goto" && cmds.size() >= 3) { } else if (cmd == "goto" && cmds.size() >= 3) {
float x = a8::XValue(cmds[1]).GetDouble(); float x = a8::XValue(cmds[1]).GetDouble();
float y = a8::XValue(cmds[2]).GetDouble(); float y = a8::XValue(cmds[2]).GetDouble();

View File

@ -12,6 +12,8 @@
#include "mt/Hero.h" #include "mt/Hero.h"
#include "mt/Skill.h" #include "mt/Skill.h"
const static glm::vec3 HERO_DEFAULT_DIR = glm::vec3(0.589955806732,0.001084076823,0.807434678078);
void Guide::Init(Human* owner) void Guide::Init(Human* owner)
{ {
owner_ = owner; owner_ = owner;
@ -203,13 +205,14 @@ void Guide::ProcKillEnemy()
nullptr, nullptr,
hero_meta, hero_meta,
pos, pos,
pos, HERO_DEFAULT_DIR,
666 666
); );
if (!hero) { if (!hero) {
abort(); abort();
} }
hero->SetHP(0.1f); hero->SetHP(0.1f);
hero->SetMaxHP(0.1f);
context->heros[i] = hero->GetUniId(); context->heros[i] = hero->GetUniId();
} }
}, },
@ -283,13 +286,14 @@ void Guide::ProcUseSkillAndKillEnemy()
nullptr, nullptr,
hero_meta, hero_meta,
pos, pos,
pos, HERO_DEFAULT_DIR,
666 666
); );
if (!hero) { if (!hero) {
abort(); abort();
} }
hero->SetHP(0.1f); hero->SetHP(0.1f);
hero->SetMaxHP(0.1f);
context->heros[i] = hero->GetUniId(); context->heros[i] = hero->GetUniId();
} }
}, },