Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/luiges90/ZHSan
Browse files Browse the repository at this point in the history
  • Loading branch information
lemingcen committed Apr 27, 2019
2 parents 3319118 + bd9fa9e commit 1c4da04
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions WorldOfTheThreeKingdoms/GameObjects/Routeway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -245,6 +248,7 @@ public bool EndedInArchitectureRoutewayStartArea(Architecture des)

private void ExpandActiveRouteway(LinkedListNode<RoutePoint> node)
{
this.Developing = false;
Troop troopByPositionNoCheck;
int routewayWorkForce = this.BelongedFaction.RoutewayWorkForce;
if (node == null)
Expand All @@ -257,6 +261,7 @@ private void ExpandActiveRouteway(LinkedListNode<RoutePoint> node)
return;
}
this.StartArchitecture.DecreaseFund(node.Value.BuildFundCost);
this.Developing = true;
this.LastActivePointIndex++;
this.AddRoutePointArea(node.Value);
routewayWorkForce -= node.Value.BuildWorkCost;
Expand All @@ -277,6 +282,7 @@ private void ExpandActiveRouteway(LinkedListNode<RoutePoint> node)
break;
}
this.StartArchitecture.DecreaseFund(decrement);
this.Developing = true;
this.LastActivePointIndex++;
this.AddRoutePointArea(node.Next.Value);
routewayWorkForce -= node.Next.Value.BuildWorkCost;
Expand Down
17 changes: 17 additions & 0 deletions WorldOfTheThreeKingdoms/GameObjects/Troop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Point, CreditPack> positionCredits = new Dictionary<Point, CreditPack>();
foreach (Point point in dayArea.Area)
{
Expand Down

0 comments on commit 1c4da04

Please sign in to comment.