1
This commit is contained in:
parent
498f7350d9
commit
8a389c0371
@ -14,9 +14,6 @@ void AutoShotBuff::Activate()
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
if (owner->IsHuman()) {
|
||||
#if 0
|
||||
owner->AsHuman()->shot_start = true;
|
||||
#endif
|
||||
owner->AsHuman()->shot_hold = true;
|
||||
owner->AsHuman()->series_shot_frames = 0;
|
||||
}
|
||||
|
@ -12,6 +12,18 @@
|
||||
#include "mt/SkillNumber.h"
|
||||
|
||||
void MachineGunBuff::Activate()
|
||||
{
|
||||
SwitchWeapons();
|
||||
ProcSkill();
|
||||
}
|
||||
|
||||
void MachineGunBuff::Deactivate()
|
||||
{
|
||||
owner->GetTrigger()->DispatchEvent(kEndSwitchWeaponBuffEvent, {this});
|
||||
RecoverHoldWeapons();
|
||||
}
|
||||
|
||||
void MachineGunBuff::SwitchWeapons()
|
||||
{
|
||||
hold_curr_weapon_idx_ = caster_.Get()->GetCurrWeapon()->weapon_idx;
|
||||
{
|
||||
@ -40,6 +52,10 @@ void MachineGunBuff::Activate()
|
||||
caster_.Get()->MarkSyncActivePlayer(__FILE__, __LINE__, __func__);
|
||||
caster_.Get()->UpdateCharImage(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
void MachineGunBuff::ProcSkill()
|
||||
{
|
||||
if (skill_meta && skill_meta->_number_meta) {
|
||||
switch (skill_meta->GetMagicId()) {
|
||||
case MAGIC_HLYZ:
|
||||
@ -150,9 +166,3 @@ void MachineGunBuff::Activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MachineGunBuff::Deactivate()
|
||||
{
|
||||
owner->GetTrigger()->DispatchEvent(kEndSwitchWeaponBuffEvent, {this});
|
||||
RecoverHoldWeapons();
|
||||
}
|
||||
|
@ -9,4 +9,8 @@ class MachineGunBuff : public Buff
|
||||
virtual void Activate() override;
|
||||
virtual void Deactivate() override;
|
||||
|
||||
private:
|
||||
|
||||
void SwitchWeapons();
|
||||
void ProcSkill();
|
||||
};
|
||||
|
@ -2092,22 +2092,26 @@ float Creature::GetHPRate()
|
||||
}
|
||||
|
||||
void Creature::GetHitEnemys(std::set<Creature*>& enemys, float radius)
|
||||
{
|
||||
GetHitEnemys(enemys, GetPos().ToGlmVec3(), radius);
|
||||
}
|
||||
|
||||
void Creature::GetHitEnemys(std::set<Creature*>& enemys, const glm::vec3 center, float radius)
|
||||
{
|
||||
float min_distance = 9999999999;
|
||||
room->grid_service->TraverseCreatures
|
||||
(room->GetRoomIdx(),
|
||||
GetGridList(),
|
||||
[this, &enemys, radius, &min_distance] (Creature* c, bool& stop)
|
||||
[this, &enemys, center, radius, &min_distance] (Creature* c, bool& stop)
|
||||
{
|
||||
if (IsProperTarget(c)) {
|
||||
float distance = GetPos().Distance2D2(c->GetPos());
|
||||
float distance = GetPos().DistanceGlmVec3(center);
|
||||
min_distance = std::min(min_distance, distance);
|
||||
if (distance < radius) {
|
||||
enemys.insert(c);
|
||||
}
|
||||
}
|
||||
});
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
void Creature::AddHp(float hp)
|
||||
|
@ -248,6 +248,7 @@ class Creature : public MoveableEntity
|
||||
float GetMaxHP();
|
||||
float GetHPRate();
|
||||
void GetHitEnemys(std::set<Creature*>& enemys, float radius);
|
||||
void GetHitEnemys(std::set<Creature*>& enemys, const glm::vec3 center, float radius);
|
||||
bool TryMove(const Position& target_pos, Position& out_pos);
|
||||
void SetInfiniteBulletMode();
|
||||
void FindLocation();
|
||||
|
Loading…
x
Reference in New Issue
Block a user