From bd9fa9e6269f403215970f1590f188d624fbd009 Mon Sep 17 00:00:00 2001 From: Peter WONG Date: Sat, 27 Apr 2019 18:13:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AA=BF=E6=95=B4=E7=B3=A7=E9=81=93=E9=83=A8?= =?UTF-8?q?=E9=9A=8AAI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WorldOfTheThreeKingdoms/GameObjects/Routeway.cs | 6 ++++++ WorldOfTheThreeKingdoms/GameObjects/Troop.cs | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/WorldOfTheThreeKingdoms/GameObjects/Routeway.cs b/WorldOfTheThreeKingdoms/GameObjects/Routeway.cs index e934e1590..188e9bff9 100644 --- a/WorldOfTheThreeKingdoms/GameObjects/Routeway.cs +++ b/WorldOfTheThreeKingdoms/GameObjects/Routeway.cs @@ -59,6 +59,9 @@ public void Init() [DataMember] public int BelongedFactionString { get; set; } + [DataMember] + public Boolean Developing { get; private set; } + public Architecture StartArchitecture; private void AddRoutePointArea(RoutePoint routePoint) @@ -245,6 +248,7 @@ public bool EndedInArchitectureRoutewayStartArea(Architecture des) private void ExpandActiveRouteway(LinkedListNode node) { + this.Developing = false; Troop troopByPositionNoCheck; int routewayWorkForce = this.BelongedFaction.RoutewayWorkForce; if (node == null) @@ -257,6 +261,7 @@ private void ExpandActiveRouteway(LinkedListNode node) return; } this.StartArchitecture.DecreaseFund(node.Value.BuildFundCost); + this.Developing = true; this.LastActivePointIndex++; this.AddRoutePointArea(node.Value); routewayWorkForce -= node.Value.BuildWorkCost; @@ -277,6 +282,7 @@ private void ExpandActiveRouteway(LinkedListNode node) break; } this.StartArchitecture.DecreaseFund(decrement); + this.Developing = true; this.LastActivePointIndex++; this.AddRoutePointArea(node.Next.Value); routewayWorkForce -= node.Next.Value.BuildWorkCost; diff --git a/WorldOfTheThreeKingdoms/GameObjects/Troop.cs b/WorldOfTheThreeKingdoms/GameObjects/Troop.cs index b92c42f94..4e9b7e9fc 100644 --- a/WorldOfTheThreeKingdoms/GameObjects/Troop.cs +++ b/WorldOfTheThreeKingdoms/GameObjects/Troop.cs @@ -1387,6 +1387,23 @@ private bool AIResetDestination() }*/ this.OffenceOnlyBeforeMoveFlag = false; + if (this.BelongedLegion != null && this.BelongedLegion.PreferredRouteway != null && + !this.BelongedLegion.PreferredRouteway.Developing && this.BelongedLegion.PreferredRouteway.LastPoint != null + && this.BelongedLegion.PreferredRouteway.LastPoint.Index < this.BelongedLegion.PreferredRouteway.RoutePoints.Count - 1) + { + if (this.CurrentCombatMethod == null) + { + this.AttackDefaultKind = TroopAttackDefaultKind.防最弱; + this.AttackTargetKind = TroopAttackTargetKind.目标默认; + } + if (this.CurrentStratagem == null) + { + this.CastTargetKind = TroopCastTargetKind.特定默认; + } + this.RealDestination = this.BelongedLegion.PreferredRouteway.LastPoint.Position; + return true; + } + Dictionary positionCredits = new Dictionary(); foreach (Point point in dayArea.Area) {