This commit is contained in:
aozhiwei 2023-03-30 12:51:26 +08:00
parent a3ba1e2e71
commit 67af9c6066
3 changed files with 107 additions and 20 deletions

View File

@ -21,6 +21,7 @@
#include "battledatacontext.h"
#include "buff.h"
#include "stats.h"
#include "hero.h"
#include "mt/Hero.h"
#include "mt/Equip.h"
@ -300,11 +301,32 @@ void Car::OnBulletHit(IBullet* bullet)
if (bullet->GetSender().Get() &&
!bullet->GetSender().Get()->dead &&
dmg_out > 0.0f &&
!bullet->GetSkillMeta() &&
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
float recover_hp = dmg_out *
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
bullet->GetSender().Get()->AddHp(recover_hp);
!bullet->GetSkillMeta()
) {
{
if (bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
float recover_hp = dmg_out *
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
if (recover_hp > 0.0f) {
bullet->GetSender().Get()->AddHp(recover_hp);
}
}
}
{
if (bullet->GetSender().Get()->IsEntityType(ET_Hero)) {
Hero* hero = (Hero*)bullet->GetSender().Get();
if (hero->GetAbility()->GetSwitchTimes(kEnableDmgForwardTimes) > 0 &&
hero->master.Get() &&
!hero->master.Get()->dead &&
hero->master.Get()->GetBattleContext()->GetBrainLifePct() > 0.0f){
float recover_hp = dmg_out *
hero->master.Get()->GetBattleContext()->GetBrainLifePct();
if (recover_hp > 0.0f) {
hero->master.Get()->AddHp(recover_hp);
}
}
}
}
}
}
if (bullet->GetBulletMeta()->_buff_meta) {

View File

@ -19,6 +19,7 @@
#include "stats.h"
#include "hero_agent.h"
#include "movement.h"
#include "ability.h"
#include "f8/btmgr.h"
@ -183,11 +184,32 @@ void Hero::OnBulletHit(IBullet* bullet)
if (bullet->GetSender().Get() &&
!bullet->GetSender().Get()->dead &&
dmg_out > 0.0f &&
!bullet->GetSkillMeta() &&
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
float recover_hp = dmg_out *
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
bullet->GetSender().Get()->AddHp(recover_hp);
!bullet->GetSkillMeta()
) {
{
if (bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
float recover_hp = dmg_out *
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
if (recover_hp > 0.0f) {
bullet->GetSender().Get()->AddHp(recover_hp);
}
}
}
{
if (bullet->GetSender().Get()->IsEntityType(ET_Hero)) {
Hero* hero = (Hero*)bullet->GetSender().Get();
if (hero->GetAbility()->GetSwitchTimes(kEnableDmgForwardTimes) > 0 &&
hero->master.Get() &&
!hero->master.Get()->dead &&
hero->master.Get()->GetBattleContext()->GetBrainLifePct() > 0.0f){
float recover_hp = dmg_out *
hero->master.Get()->GetBattleContext()->GetBrainLifePct();
if (recover_hp > 0.0f) {
hero->master.Get()->AddHp(recover_hp);
}
}
}
}
}
}
}

View File

@ -41,6 +41,8 @@
#include "trigger.h"
#include "ability.h"
#include "stats.h"
#include "hero.h"
#include "buff/sprint.h"
#include "mt/Param.h"
@ -2143,11 +2145,32 @@ void Human::OnBulletHit(IBullet* bullet)
if (bullet->GetSender().Get() &&
!bullet->GetSender().Get()->dead &&
dmg_out > 0.0f &&
!bullet->GetSkillMeta() &&
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
float recover_hp = dmg_out *
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
bullet->GetSender().Get()->AddHp(recover_hp);
!bullet->GetSkillMeta()
) {
{
if (bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
float recover_hp = dmg_out *
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
if (recover_hp > 0.0f) {
bullet->GetSender().Get()->AddHp(recover_hp);
}
}
}
{
if (bullet->GetSender().Get()->IsEntityType(ET_Hero)) {
Hero* hero = (Hero*)bullet->GetSender().Get();
if (hero->GetAbility()->GetSwitchTimes(kEnableDmgForwardTimes) > 0 &&
hero->master.Get() &&
!hero->master.Get()->dead &&
hero->master.Get()->GetBattleContext()->GetBrainLifePct() > 0.0f){
float recover_hp = dmg_out *
hero->master.Get()->GetBattleContext()->GetBrainLifePct();
if (recover_hp > 0.0f) {
hero->master.Get()->AddHp(recover_hp);
}
}
}
}
}
}
} else {
@ -2168,11 +2191,31 @@ void Human::OnBulletHit(IBullet* bullet)
if (bullet->GetSender().Get() &&
!bullet->GetSender().Get()->dead &&
dmg_out > 0.0f &&
!bullet->GetSkillMeta() &&
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
float recover_hp = dmg_out *
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
bullet->GetSender().Get()->AddHp(recover_hp);
!bullet->GetSkillMeta()) {
{
if (bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
float recover_hp = dmg_out *
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
if (recover_hp > 0.0f) {
bullet->GetSender().Get()->AddHp(recover_hp);
}
}
}
{
if (bullet->GetSender().Get()->IsEntityType(ET_Hero)) {
Hero* hero = (Hero*)bullet->GetSender().Get();
if (hero->GetAbility()->GetSwitchTimes(kEnableDmgForwardTimes) > 0 &&
hero->master.Get() &&
!hero->master.Get()->dead &&
hero->master.Get()->GetBattleContext()->GetBrainLifePct() > 0.0f){
float recover_hp = dmg_out *
hero->master.Get()->GetBattleContext()->GetBrainLifePct();
if (recover_hp > 0.0f) {
hero->master.Get()->AddHp(recover_hp);
}
}
}
}
}
}
}