This commit is contained in:
aozhiwei 2023-10-18 14:06:33 +08:00
parent be78c86650
commit 0dff30fbe6
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,7 @@
#include "target_agent.h"
#include "mt/Hero.h"
#include "mt/Equip.h"
TargetAgent::TargetAgent():BaseAgent()
{
@ -85,3 +86,11 @@ Room* TargetAgent::GetRoom()
{
return owner_->room;
}
float TargetAgent::GetShotRange()
{
if (target_.Get() && target_.Get()->GetCurrWeapon()) {
return target_.Get()->GetCurrWeapon()->meta->range();
}
return 0.0f;
}

View File

@ -21,6 +21,7 @@ public:
float GetMaxHp();
int GetHeroId();
int GetLevel();
float GetShotRange();
void Abandon();
void SetOwner(Creature* owner);