This commit is contained in:
aozhiwei 2023-02-24 12:06:06 +08:00
parent e0f9efedd1
commit b2f3dd6403

View File

@ -10,6 +10,11 @@
#include "mt/Grasp.h"
#include "mt/Hero.h"
const int BUFF_TARGET_SELF = 1;
const int BUFF_TARGET_ENEMY = 2;
const int BUFF_TARGET_GUN = 3;
const int BUFF_TARGET_PET = 4;
struct GraspBuff
{
list_head entry;
@ -43,9 +48,15 @@ struct GraspBuff
{
std::array<const mt::GraspBuff*, 2> grasp_triggers_ = {std::get<0>(buffs), std::get<1>(buffs)};
for (auto& buff : grasp_triggers_) {
if (buff) {
if (buff &&
(buff->graspbuff_target() == BUFF_TARGET_SELF ||
buff->graspbuff_target() == BUFF_TARGET_ENEMY)) {
int buff_time = buff->GetBuffTime(gun_grasp->GetHeroLv());
int attr_num = buff->GetAttrNum(gun_grasp->GetHeroLv());
Creature* target = gun_grasp->GetOwner();
if (buff->graspbuff_target() == BUFF_TARGET_ENEMY) {
target = enemy;
}
if (buff->attr_id()) {
switch (buff->attr_add_pattern()) {
case 1: