Merge branch 'main' of http://10.27.17.121:3000/kawagiri/TH1
This commit is contained in:
commit
954a07a0c3
@ -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:
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user