This commit is contained in:
aozhiwei 2022-10-09 10:49:43 +08:00
parent 2909f844f3
commit f13fe5ec82
3 changed files with 27 additions and 1 deletions

View File

@ -36,6 +36,7 @@
#include "killmgr.h" #include "killmgr.h"
#include "tracemgr.h" #include "tracemgr.h"
#include "httpproxy.h" #include "httpproxy.h"
#include "skillhelper.h"
const int kReviveTimeAdd = 12; const int kReviveTimeAdd = 12;
const int kSkinNum = 4; const int kSkinNum = 4;
@ -3584,7 +3585,11 @@ void Human::OnBulletHit(Bullet* bullet)
RemoveBuffByEffectId(kBET_PeaceMode); RemoveBuffByEffectId(kBET_PeaceMode);
if (!dead && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) { if (!dead && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
float finaly_dmg = bullet->sender.Get()->GetBattleContext()->CalcDmg(this, bullet); float finaly_dmg = 0;
if (bullet->skill_meta && SkillHelper::ProcBulletDmg(bullet, this, finaly_dmg)) {
} else {
finaly_dmg = bullet->sender.Get()->GetBattleContext()->CalcDmg(this, bullet);
}
if (bullet->sender.Get()->IsHuman()) { if (bullet->sender.Get()->IsHuman()) {
bullet->sender.Get()->AsHuman()->stats.damage_amount_out += finaly_dmg; bullet->sender.Get()->AsHuman()->stats.damage_amount_out += finaly_dmg;
} }

View File

@ -246,3 +246,23 @@ float SkillHelper::GetYmczDmg(Creature* sender, Creature* target, const MetaData
{ {
return 0; return 0;
} }
bool SkillHelper::ProcBulletDmg(Bullet* bullet, Creature* target, float& finaly_dmg)
{
finaly_dmg = 0.0f;
MetaData::Skill* skill_meta = bullet->skill_meta;
if (!skill_meta) {
return false;
}
switch (skill_meta->GetMagicId()) {
case MAGIC_AXXF:
{
}
break;
default:
{
}
break;
}
return false;
}

View File

@ -35,6 +35,7 @@ class SkillHelper
static float GetYmczDmg(Creature* sender, Creature* target, const MetaData::Skill* skill_meta); static float GetYmczDmg(Creature* sender, Creature* target, const MetaData::Skill* skill_meta);
static void ProcBulletHitBuff(Bullet* bullet, Creature* c, int buff_uniid); static void ProcBulletHitBuff(Bullet* bullet, Creature* c, int buff_uniid);
static bool ProcBulletDmg(Bullet* bullet, Creature* target, float& finaly_dmg);
private: private: