From 62188b271cce5e3aec5ca40d58c30f08643e2f60 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 04 九月 2025 23:20:17 +0800
Subject: [PATCH] 117 【武将】武将系统 - 天赋部分,优化自动战斗
---
Main/System/Battle/BattleObject/BattleObject.cs | 46 +++++++++++++++++++++++++++-------------------
1 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/Main/System/Battle/BattleObject/BattleObject.cs b/Main/System/Battle/BattleObject/BattleObject.cs
index 6299053..110afc0 100644
--- a/Main/System/Battle/BattleObject/BattleObject.cs
+++ b/Main/System/Battle/BattleObject/BattleObject.cs
@@ -92,6 +92,12 @@
heroInfoBar = heroGo.GetComponentInChildren<BattleHeroInfoBar>(true);
heroInfoBar.SetBattleObject(this);
+
+ // 鏍规嵁闃佃惀缈昏浆琛�鏉�
+ var heroInfoBarScale = heroInfoBar.transform.localScale;
+ heroInfoBarScale.x *= Camp == BattleCamp.Red ? 1 : -1;
+ heroInfoBar.transform.localScale = heroInfoBarScale;
+
}
@@ -145,7 +151,7 @@
teamHero.rage = (int)GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
break;
default:
- BattleDebug.LogError("BattleObject.ObjInfoRefresh 鍑虹幇鎰忓绫诲瀷 " + _refreshInfo.RefreshType.ToString());
+ Debug.LogError("BattleObject.ObjInfoRefresh 鍑虹幇鎰忓绫诲瀷 " + _refreshInfo.RefreshType.ToString());
break;
}
}
@@ -233,14 +239,24 @@
return true;
}
- public virtual void Hurt(List<long> damageValues, long _totalDamage, uint attackType)
+ public virtual void Hurt(List<long> damageValues, long _totalDamage, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig)
{
- PopDamage(teamHero.curHp, damageValues, attackType);
+ PopDamage(damageValues, hurt, skillConfig);
motionBase.PlayAnimation(MotionName.hit, false);
- // 鎵h
+ // 鎵h娴佺粰鍒殑鏁屾柟鍒锋柊濂戒簡
teamHero.curHp -= _totalDamage;
+ }
+
+ public void SuckHp(uint suckHP, SkillConfig skillConfig)
+ {
+
+ }
+
+ public void HurtByReflect(uint bounceHP, SkillConfig skillConfig)
+ {
+
}
// 闂伩寮�濮�
@@ -268,14 +284,13 @@
public virtual void OnDeath(Action _onDeathAnimationComplete)
{
- BattleDebug.LogError(ObjID + " OnDeath called");
onDeathAnimationComplete = _onDeathAnimationComplete;
motionBase.PlayAnimation(MotionName.dead, false);
}
- protected virtual void OnAnimationComplete(MotionName motionName)
+ protected virtual void OnAnimationComplete(string motionName)
{
- if (motionName == MotionName.dead)
+ if (motionName == MotionName.dead.ToString().ToLower())
{
OnDeadAnimationComplete();
onDeathAnimationComplete?.Invoke();
@@ -298,18 +313,9 @@
}
// 浼ゅ杩樿鐪� 鏄惁闂伩 鏆村嚮 and so on 闇�瑕佹湁涓�涓狣amageType 鏈嶅姟鍣ㄥ簲璇ヤ細缁�
- protected virtual void PopDamage(long curHp, List<long> damageValues, uint attackType)
+ protected virtual void PopDamage(List<long> damageValues, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig)
{
- // 鍏跺疄搴旇閫氱煡鍑哄幓缁橴I鐣岄潰瑙h�� 璁︰I鐣岄潰鑷繁鏉ユ樉绀虹殑 YYL TODO
- // 鎾斁浼ゅ鏁板瓧
- // 杩欓噷鍙互瀹炵幇涓�涓激瀹虫暟瀛楃殑寮瑰嚭鏁堟灉
- // 姣斿浣跨敤涓�涓猆I缁勪欢鏉ユ樉绀轰激瀹虫暟瀛�
- foreach (var damage in damageValues)
- {
- Debug.Log($"Damage: {damage}");
- }
-
- BattleDmgInfo battleDmgInfo = new BattleDmgInfo(battleField.guid, damageValues, this, (int)attackType);
+ BattleDmgInfo battleDmgInfo = new BattleDmgInfo(battleField.guid, damageValues, this, hurt, skillConfig);
// YYL TODO 鏄惁闇�瑕佹寕鍦ㄥ湪鑷韩鐨刦ollow鐐逛笂
EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo);
@@ -347,7 +353,7 @@
public void PerformDrop()
{
- if (null == battleDrops)
+ if (null == battleDrops || battleDrops.dropItemPackIndex.Count == 0)
return;
EventBroadcast.Instance.Broadcast<string, BattleDrops, Action>(
@@ -361,6 +367,8 @@
+
+
#if UNITY_EDITOR_STOP_USING
public void EditorRevive()
{
--
Gitblit v1.8.0