70 lines
1.4 KiB
C++
70 lines
1.4 KiB
C++
#include "precompile.h"
|
|
|
|
#ifdef NEW_BT
|
|
#else
|
|
#include <glm/glm.hpp>
|
|
#include <glm/gtc/matrix_transform.hpp>
|
|
|
|
#include "android_agent.h"
|
|
#include "android.h"
|
|
#include "room.h"
|
|
#include "movement.h"
|
|
#include "trigger.h"
|
|
#include "glmhelper.h"
|
|
#include "skill.h"
|
|
#include "btcontext.h"
|
|
#include "btevent.h"
|
|
#include "btcoroutine.h"
|
|
|
|
#include "mt/Robot.h"
|
|
|
|
AndroidAgent::AndroidAgent():BaseAgent()
|
|
{
|
|
|
|
}
|
|
|
|
AndroidAgent::~AndroidAgent()
|
|
{
|
|
}
|
|
|
|
glm::vec3& AndroidAgent::AdjustShotDir(glm::vec3& shot_dir)
|
|
{
|
|
if (GetOwner()->IsAndroid()) {
|
|
float angle_offset = GetOwner()->AsAndroid()->robot_meta->RandBulletAngleOfsset();
|
|
GlmHelper::RotateY(shot_dir, glm::radians(angle_offset));
|
|
GetOwner()->SetAttackDir(shot_dir);
|
|
}
|
|
return shot_dir;
|
|
}
|
|
|
|
bool AndroidAgent::IsCrazeMode()
|
|
{
|
|
return a8::HasBitFlag(GetOwner()->status, CS_CrazeMode);
|
|
}
|
|
|
|
bool AndroidAgent::IsCrazeModePrepareMode()
|
|
{
|
|
if (!IsCrazeMode()) {
|
|
return false;
|
|
}
|
|
if (GetOwner()->room->IsMiniMap() ||
|
|
GetOwner()->room->IsNewerMap()) {
|
|
return false;
|
|
}
|
|
if (GetOwner()->room->GetFrameNo() - GetOwner()->AsHuman()->enable_frameno > SERVER_FRAME_RATE * 20) {
|
|
return false;
|
|
} else {
|
|
if (GetSafeAreaRadius() < 200) {
|
|
return false;
|
|
}
|
|
if (IsGameOver()) {
|
|
return false;
|
|
}
|
|
if (IsDead()) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
#endif
|