From ca85c0a70922aa219f6cad5e8af8ad004c3cb4b3 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 05 十一月 2025 14:36:02 +0800
Subject: [PATCH] 125 战斗 天子血条刷新包
---
Main/System/Battle/BattleObject/BattleObject.cs | 29 ++++++++++-------------------
1 files changed, 10 insertions(+), 19 deletions(-)
diff --git a/Main/System/Battle/BattleObject/BattleObject.cs b/Main/System/Battle/BattleObject/BattleObject.cs
index f868dee..24b2e63 100644
--- a/Main/System/Battle/BattleObject/BattleObject.cs
+++ b/Main/System/Battle/BattleObject/BattleObject.cs
@@ -293,11 +293,12 @@
public virtual void Hurt(List<long> damageValues, long _totalDamage,
HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig, int hitIndex,
- BattleDrops battleDrops, HB422_tagMCTurnFightObjDead deadPack)
+ BattleDrops battleDrops, HB422_tagMCTurnFightObjDead deadPack,
+ long fromHp, long toHp)
{
bool isLastHit = hitIndex >= skillConfig.DamageDivide.Length - 1;
bool firstHit = hitIndex == 0;
- BattleDmgInfo dmgInfo = PopDamage(damageValues, _totalDamage, hurt, skillConfig, isLastHit);
+ BattleDmgInfo dmgInfo = PopDamage(damageValues, _totalDamage, hurt, skillConfig, isLastHit, fromHp, toHp);
// 杩欓噷
@@ -346,18 +347,16 @@
}
}
-
-
}
public void SuckHp(uint suckHP, SkillConfig skillConfig)
{
- teamHero.curHp = Math.Min(teamHero.maxHp, teamHero.curHp + (int)suckHP);
+ // teamHero.curHp = Math.Min(teamHero.maxHp, teamHero.curHp + (int)suckHP);
}
public void HurtByReflect(uint bounceHP, SkillConfig skillConfig)
{
- teamHero.curHp = Math.Max(0, teamHero.curHp - (int)bounceHP);
+ // teamHero.curHp = Math.Max(0, teamHero.curHp - (int)bounceHP);
}
@@ -422,22 +421,14 @@
}
// 浼ゅ杩樿鐪� 鏄惁闂伩 鏆村嚮 and so on 闇�瑕佹湁涓�涓狣amageType 鏈嶅姟鍣ㄥ簲璇ヤ細缁�
- protected virtual BattleDmgInfo PopDamage(List<long> damageValues, long _totalDamage, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig, bool isLastHit)
+ protected virtual BattleDmgInfo PopDamage(List<long> damageValues, long _totalDamage,
+ HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig, bool isLastHit,
+ long fromHp, long toHp)
{
BattleDmgInfo battleDmgInfo = new BattleDmgInfo(battleField.guid, damageValues, this, hurt, skillConfig, isLastHit);
- int currentHurtHp = 0;
- for (int i = 0; i < damageValues.Count; i++)
- {
- currentHurtHp += (int)damageValues[i];
- }
-
- bool isRecovery = battleDmgInfo.IsType(DamageType.Recovery);
-
- long toHp = Math.Max(0, teamHero.curHp + (isRecovery ? currentHurtHp : -currentHurtHp));
-
- heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp);
- teamHero.curHp = toHp;
+ // 浣跨敤浼犲叆鐨� fromHp 鍜� toHp 鏇存柊琛�鏉℃樉绀�
+ heroInfoBar.UpdateHP(fromHp, toHp, teamHero.maxHp);
// YYL TODO 鏄惁闇�瑕佹寕鍦ㄥ湪鑷韩鐨刦ollow鐐逛笂
EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo);
--
Gitblit v1.8.0