1
This commit is contained in:
parent
e7fa639ccb
commit
57decc7d0d
@ -1,5 +1,9 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/vec2.hpp>
|
||||
|
||||
#include "buff/hold_shield.h"
|
||||
|
||||
#include "skill.h"
|
||||
@ -36,6 +40,18 @@ void HoldShieldBuff::Activate()
|
||||
std::set<Creature*> enemys;
|
||||
owner->GetHitEnemys(enemys, owner->GetPos().ToGlmVec3(), check_distance_);
|
||||
for (auto& enemy : enemys) {
|
||||
float distance = owner->GetPos().Distance2D2(enemy->GetPos());
|
||||
float angle = 0.0f;
|
||||
if (distance > 0.0001f) {
|
||||
angle = GlmHelper::CalcAngle
|
||||
(owner->GetAttackDir(),
|
||||
enemy->GetPos().ToGlmVec3() - owner->GetPos().ToGlmVec3());
|
||||
}
|
||||
float angle2 = glm::radians(180.0f) / 2.0f / A8_PI;
|
||||
if (std::abs(angle) > angle2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto itr = hited_objects.find(enemy->GetUniId());
|
||||
if (itr != hited_objects.end()) {
|
||||
if (owner->room->GetFrameNo() - itr->second <
|
||||
|
@ -1,5 +1,9 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/vec2.hpp>
|
||||
|
||||
#include "buff/select_target_with_self_pos.h"
|
||||
|
||||
#include "creature.h"
|
||||
@ -15,7 +19,13 @@ void SelectTargetWithSelfPosBuff::Activate()
|
||||
(
|
||||
[this, &targets] (Creature* c, bool& stop)
|
||||
{
|
||||
if (owner->GetPos().Distance2D2(c->GetPos()) < hold_param3_) {
|
||||
float distance = owner->GetPos().Distance2D2(c->GetPos());
|
||||
float angle = 0.0f;
|
||||
if (distance > 0.0001f) {
|
||||
angle = GlmHelper::CalcAngle(owner->GetAttackDir(),
|
||||
c->GetPos().ToGlmVec3() - owner->GetPos().ToGlmVec3());
|
||||
}
|
||||
if (distance < hold_param3_ && std::abs(angle) <= glm::radians(hold_param4_) / 2.0f / A8_PI) {
|
||||
switch (meta->_int_buff_param1) {
|
||||
case kBST_All:
|
||||
{
|
||||
|
@ -1987,9 +1987,11 @@ bool Creature::ReceiveExplosionDmg(Explosion* explosion)
|
||||
void Creature::CheckAbilityUsed()
|
||||
{
|
||||
if (ability_.use_count() > 1) {
|
||||
#if 0
|
||||
std::shared_ptr<Ability> old_val = ability_;
|
||||
ability_ = std::make_shared<Ability>(GetWeakPtrRef());
|
||||
*ability_.get() = *(old_val.get());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user