From d2f33cd1b212a701c5ae96618d9978afc609282c Mon Sep 17 00:00:00 2001 From: kawagiri Date: Fri, 17 Apr 2026 00:35:08 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefab/UI/Info/UIInfoDiplomacy.prefab | 6 +-- .../Skill/AllSkill/KomeijiRiderTransSkill.cs | 4 +- .../Skill/AllSkill/ReisenFrenchKillSkill.cs | 2 +- .../Skill/AllSkill/UtsuhoBoneMakerSkill.cs | 2 +- .../Scripts/TH1_Logic/Unit/UnitLogic.cs | 52 ++++++++++++++----- .../TH1_UI/View/Info/UIInfoDiplomacyView.cs | 16 ++++-- 6 files changed, 59 insertions(+), 23 deletions(-) diff --git a/Unity/Assets/Resources/Prefab/UI/Info/UIInfoDiplomacy.prefab b/Unity/Assets/Resources/Prefab/UI/Info/UIInfoDiplomacy.prefab index 0375b23cb..257388b82 100644 --- a/Unity/Assets/Resources/Prefab/UI/Info/UIInfoDiplomacy.prefab +++ b/Unity/Assets/Resources/Prefab/UI/Info/UIInfoDiplomacy.prefab @@ -815,7 +815,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 190.005, y: -26.9039} - m_SizeDelta: {x: 160.01, y: 32.0265} + m_SizeDelta: {x: 0, y: 32.0265} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5866609754386538054 CanvasRenderer: @@ -5708,7 +5708,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 335.375, y: -624.9437} + m_AnchoredPosition: {x: 335.375, y: -439.94373} m_SizeDelta: {x: 670.75, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &884861749768500113 @@ -6586,7 +6586,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 195.7, y: -25.23105} - m_SizeDelta: {x: 351.4, y: 50.4621} + m_SizeDelta: {x: 0, y: 50.4621} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5922426833342361725 CanvasRenderer: diff --git a/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/KomeijiRiderTransSkill.cs b/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/KomeijiRiderTransSkill.cs index 08d9d9ab9..d6846db10 100644 --- a/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/KomeijiRiderTransSkill.cs +++ b/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/KomeijiRiderTransSkill.cs @@ -30,7 +30,7 @@ namespace Logic.Skill public override void OnDamageOther(MapData mapData, SettlementInfo info) { - if (!info.IsKill) return; + if (!info.IsKill || info.IsDeathReplaced) return; if (info.DamageOrigin == null || info.DamageTarget == null) return; if (info.DamageTarget.UnitFullType.UnitType == UnitType.Giant) return; if (info.DamageTarget.TreatedAsHero(mapData,info.DamageOrigin)) return; @@ -38,7 +38,7 @@ namespace Logic.Skill var city = info.DamageOrigin.City(mapData); if (city == null) return; if (!mapData.CheckLandTypeForGrid(info.DamageTarget.UnitFullType, info.DamageTargetGrid)) return; - + info.IsDeathReplaced = true; int originHealth = info.DamageOrigin.Health; var originRenderer = info.DamageOrigin.Renderer(mapData); var originGrid = info.DamageOrigin.Grid(mapData); diff --git a/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/ReisenFrenchKillSkill.cs b/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/ReisenFrenchKillSkill.cs index 53f30d30f..6e16330d7 100644 --- a/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/ReisenFrenchKillSkill.cs +++ b/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/ReisenFrenchKillSkill.cs @@ -38,7 +38,7 @@ namespace Logic.Skill public override void AfterDamageOther(MapData mapData, SettlementInfo info) { - if (!info.IsKill || info.DamageOrigin == null || info.DamageTargetGrid == null) return; + if (!info.IsKill || info.IsDeathReplaced || info.DamageOrigin == null || info.DamageTargetGrid == null) return; if (info.DamageTargetGrid.RealUnit(mapData, out _)) return; if (!mapData.GetPlayerDataByUnitId(info.DamageOrigin.Id, out var player)) return; if (!mapData.GetCapitalCityDataByPlayerId(player.Id, out var capitalCity)) return; diff --git a/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/UtsuhoBoneMakerSkill.cs b/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/UtsuhoBoneMakerSkill.cs index acfc06fc4..0a1b7960e 100644 --- a/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/UtsuhoBoneMakerSkill.cs +++ b/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/UtsuhoBoneMakerSkill.cs @@ -32,7 +32,7 @@ namespace Logic.Skill { if (info.DamageType != DamageType.DelayAttack && info.DamageType != DamageType.Splash) return; - if (!info.IsKill || info.DamageTarget == null || info.DamageTargetGrid == null) return; + if (!info.IsKill || info.IsDeathReplaced || info.DamageTarget == null || info.DamageTargetGrid == null) return; if (info.DamageTarget.UnitFullType.UnitType == UnitType.Giant || info.DamageTarget.CarryUnitFullType.UnitType == UnitType.Giant) return; if (!mapData.GetPlayerDataByUnitId(info.DamageOrigin.Id, out var player)) return; if (!mapData.GetCapitalCityDataByPlayerId(player.Id, out var capitalCity)) return; diff --git a/Unity/Assets/Scripts/TH1_Logic/Unit/UnitLogic.cs b/Unity/Assets/Scripts/TH1_Logic/Unit/UnitLogic.cs index aa9bb78b2..f1e945e4c 100644 --- a/Unity/Assets/Scripts/TH1_Logic/Unit/UnitLogic.cs +++ b/Unity/Assets/Scripts/TH1_Logic/Unit/UnitLogic.cs @@ -611,13 +611,29 @@ namespace Logic return 0; } - //Step #1处理恢复生命 + //Step #1 如果目标身上有KomeijiFear,消除恐惧替代本次回血 + if (target.GetSkill(SkillType.KomeijiFear, out _)) + { + target.RemoveSkill(SkillType.KomeijiFear, map); + //处理View + if (map == Main.MapData && !target.IsHideAndCantSee(map, map.PlayerMap.SelfPlayerData)) + { + var fearGrid = target.Grid(map); + if (fearGrid != null) + fearGrid.Renderer(map)?.PlayVFXInSight(new GridVFXParams(GridVFXType.Heal)); + target.Renderer(map)?.InstantUpdateUnit(true); + origin.Renderer(map)?.InstantUpdateUnit(true); + } + return 0; + } + + //Step #2处理恢复生命 int realRecover = target.AddHealth(recover); - - //Step #2处理恢复技能的herotask生命周期 + + //Step #3处理恢复技能的herotask生命周期 origin.HeroTask(map)?.OnHealthReturn(map,realRecover,recover); - - //Step #3 处理View(隐身且不可见的单位不播放特效) + + //Step #4 处理View(隐身且不可见的单位不播放特效) if (map == Main.MapData && target.IsHideAndCantSee(map, map.PlayerMap.SelfPlayerData)) return realRecover; var grid = target.Grid(map); @@ -1441,16 +1457,26 @@ namespace Logic && mapData.GetPlayerDataByUnitId(unitData.Id, out var player) ) { - unitData.Health += 2; - //如果是自家或者盟军领土 - if (mapData.CheckGridIdBelongPlayerIdUnion(grid.Id, player.Id)) + //如果有KomeijiFear,消除恐惧替代本次回血 + if (unitData.GetSkill(SkillType.KomeijiFear, out _)) + { + unitData.RemoveSkill(SkillType.KomeijiFear, mapData); + grid.Renderer(mapData)?.PlayVFXInSight(new GridVFXParams(GridVFXType.Heal)); + unitData.Renderer(mapData)?.InstantUpdateUnit(true); + } + else + { unitData.Health += 2; - if (unitData.Health > unitData.GetMaxHealth()) - unitData.Health = unitData.GetMaxHealth(); - grid.Renderer(mapData)?.PlayVFXInSight(new GridVFXParams(GridVFXType.Heal)); - unitData.Renderer(mapData)?.InstantUpdateUnit(true); + //如果是自家或者盟军领土 + if (mapData.CheckGridIdBelongPlayerIdUnion(grid.Id, player.Id)) + unitData.Health += 2; + if (unitData.Health > unitData.GetMaxHealth()) + unitData.Health = unitData.GetMaxHealth(); + grid.Renderer(mapData)?.PlayVFXInSight(new GridVFXParams(GridVFXType.Heal)); + unitData.Renderer(mapData)?.InstantUpdateUnit(true); + } } - + } } diff --git a/Unity/Assets/Scripts/TH1_UI/View/Info/UIInfoDiplomacyView.cs b/Unity/Assets/Scripts/TH1_UI/View/Info/UIInfoDiplomacyView.cs index 5bd2879ff..015bf9bc5 100644 --- a/Unity/Assets/Scripts/TH1_UI/View/Info/UIInfoDiplomacyView.cs +++ b/Unity/Assets/Scripts/TH1_UI/View/Info/UIInfoDiplomacyView.cs @@ -151,9 +151,19 @@ namespace TH1_UI.View.Info player.GetCountryDiplomacyInfo(Main.MapData.PlayerMap.SelfPlayerId, out var dipInfo); bool meetus = dipInfo.DiplomacyState != DiplomacyState.NoDiplomacy; - BubbleChat.gameObject.SetActive(meetus); - if (!meetus) return; - MultilingualManager.Instance.SetUIText(BubbleChatText,Table.Instance.DiplomacyDataAssets.GetDiplomacyTextByFeeling((Forces)(player.PlayerForceId),dipInfo.FeelingState)); + if (!meetus) + { + BubbleChat.gameObject.SetActive(false); + return; + } + var chatText = Table.Instance.DiplomacyDataAssets.GetDiplomacyTextByFeeling((Forces)(player.PlayerForceId),dipInfo.FeelingState); + if (string.IsNullOrEmpty(chatText) || chatText == "0") + { + BubbleChat.gameObject.SetActive(false); + return; + } + BubbleChat.gameObject.SetActive(true); + MultilingualManager.Instance.SetUIText(BubbleChatText, chatText); LayoutRebuilder.ForceRebuildLayoutImmediate(BubbleChat); }