1
This commit is contained in:
parent
6102b0714a
commit
0097af1830
@ -8,6 +8,9 @@
|
|||||||
#include "movement.h"
|
#include "movement.h"
|
||||||
#include "trigger.h"
|
#include "trigger.h"
|
||||||
#include "glmhelper.h"
|
#include "glmhelper.h"
|
||||||
|
#include "mapinstance.h"
|
||||||
|
|
||||||
|
#include "mt/Map.h"
|
||||||
|
|
||||||
HeroAgent::HeroAgent():BaseAgent()
|
HeroAgent::HeroAgent():BaseAgent()
|
||||||
{
|
{
|
||||||
@ -446,7 +449,25 @@ behaviac::EBTStatus HeroAgent::DoHelpAttack(int target_uniid)
|
|||||||
|
|
||||||
behaviac::EBTStatus HeroAgent::FlyToMasterAround()
|
behaviac::EBTStatus HeroAgent::FlyToMasterAround()
|
||||||
{
|
{
|
||||||
|
if (!GetOwner()->AsHero()->master.Get()) {
|
||||||
|
return behaviac::BT_FAILURE;
|
||||||
|
}
|
||||||
|
glm::vec3 ref_point = GetOwner()->AsHero()->master.Get()->GetPos().ToGlmVec3();
|
||||||
|
glm::vec3 point = GetOwner()->AsHero()->master.Get()->GetPos().ToGlmVec3();
|
||||||
|
GetOwner()->room->map_instance->Scale(ref_point);
|
||||||
|
if (GetOwner()->room->map_instance->FindRandomPointAroundCircle
|
||||||
|
(
|
||||||
|
ref_point,
|
||||||
|
30 * GetOwner()->room->GetMapMeta()->scale(),
|
||||||
|
point
|
||||||
|
)) {
|
||||||
|
GetOwner()->room->map_instance->UnScale(point);
|
||||||
|
}
|
||||||
|
Global::Instance()->verify_set_pos = 1;
|
||||||
|
GetOwner()->GetMutablePos().FromGlmVec3(point);
|
||||||
|
Global::Instance()->verify_set_pos = 0;
|
||||||
|
GetOwner()->room->grid_service->MoveCreature(GetOwner());
|
||||||
|
return behaviac::BT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
behaviac::EBTStatus HeroAgent::FollowMaster()
|
behaviac::EBTStatus HeroAgent::FollowMaster()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user