Skip to content

Commit

Permalink
城破時當作被圍
Browse files Browse the repository at this point in the history
  • Loading branch information
luiges90 committed Jan 5, 2020
1 parent f6bc609 commit 52ea39c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion WorldOfTheThreeKingdoms/GameObjects/Architecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12512,7 +12512,7 @@ private void Sourrounded()

public bool IsSurrounded()
{
if (((this.BelongedFaction != null) && (this.Endurance > 0)) && this.Kind.HasDomination)
if (((this.BelongedFaction != null) && (this.Endurance > 0)))
{
int num = 0;
foreach (Point point in this.ContactArea.Area)
Expand All @@ -12528,6 +12528,24 @@ public bool IsSurrounded()
return true;
}
}
if (this.Endurance <= 0)
{
foreach (Point point in this.ContactArea.Area)
{
Troop troopByPosition = Session.Current.Scenario.GetTroopByPosition(point);
if (!((troopByPosition == null) || this.IsFriendlyWithoutTruce(troopByPosition.BelongedFaction)))
{
return true;
}
}
foreach (Point point in this.ArchitectureArea.Area)
{
Troop troopByPosition = Session.Current.Scenario.GetTroopByPosition(point);
if (!((troopByPosition == null) || this.IsFriendlyWithoutTruce(troopByPosition.BelongedFaction)))
{
return true;
}
}
return false;
}

Expand Down

0 comments on commit 52ea39c

Please sign in to comment.