From 28ec28f774ba794fe89315db3fb66a705faeb31b Mon Sep 17 00:00:00 2001 From: k45399735 Date: Sun, 4 Aug 2013 21:20:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BB=BA=E7=AD=91=E6=89=A9?= =?UTF-8?q?=E5=BB=BAAI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GameObjects/GameObjects/Architecture.cs | 30 +++++++++++++++++++ .../YouxiPingmu/ScreenManager.cs | 19 +----------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/GameObjects/GameObjects/Architecture.cs b/GameObjects/GameObjects/Architecture.cs index 926ab29e..2c5eaf69 100644 --- a/GameObjects/GameObjects/Architecture.cs +++ b/GameObjects/GameObjects/Architecture.cs @@ -703,9 +703,18 @@ public void AI() this.AIWork(false); this.AITransfer(); this.InsideTacticsAI(); + this.AIExpand(); ExtensionInterface.call("AIArchitecture", new Object[] { this.Scenario, this }); } + private void AIExpand() + { + if (this.ExpandAvail()) + { + this.Expand(); + } + } + private void AIExecute() { if (base.Scenario.IsPlayer(this.BelongedFaction)) return; @@ -13429,6 +13438,27 @@ public bool ExpandAvail() return true; } + public void Expand() + { + this.Fund -= this.ExpandFund(); + foreach (Point point in this.ExpandPoint()) + { + this.ArchitectureArea.AddPoint(point); + } + + + this.ContactArea = this.ArchitectureArea.GetContactArea(false); + this.ViewArea = GameArea.GetAreaFromArea(this.ArchitectureArea, this.ViewDistance, this.Kind.HasObliqueView, base.Scenario, this.BelongedFaction); + this.LongViewArea = GameArea.GetAreaFromArea(this.ArchitectureArea, this.LongViewDistance, this.Kind.HasObliqueView, base.Scenario, this.BelongedFaction); + this.BaseFoodSurplyArea = this.LongViewArea; + + foreach (Point point in this.ArchitectureArea.Area) + { + base.Scenario.MapTileData[point.X, point.Y].TileArchitecture = this; + } + + base.Scenario.SetMapTileArchitecture(this); + } public PersonList meifaxianhuaiyundefeiziliebiao() { diff --git a/WorldOfTheThreeKingdoms/YouxiPingmu/ScreenManager.cs b/WorldOfTheThreeKingdoms/YouxiPingmu/ScreenManager.cs index fb83154e..e24c2d95 100644 --- a/WorldOfTheThreeKingdoms/YouxiPingmu/ScreenManager.cs +++ b/WorldOfTheThreeKingdoms/YouxiPingmu/ScreenManager.cs @@ -1094,24 +1094,7 @@ public void SetCreatingTroopPosition(Point position) internal void ArchitectureExpand() { - this.CurrentArchitecture.Fund -= this.CurrentArchitecture.ExpandFund(); - foreach (Point point in this.CurrentArchitecture.ExpandPoint()) - { - this.CurrentArchitecture.ArchitectureArea.AddPoint(point); - } - - - this.CurrentArchitecture.ContactArea = this.CurrentArchitecture.ArchitectureArea.GetContactArea(false); - this.CurrentArchitecture.ViewArea = GameArea.GetAreaFromArea(this.CurrentArchitecture.ArchitectureArea, this.CurrentArchitecture.ViewDistance, this.CurrentArchitecture.Kind.HasObliqueView, this.gameScenario, this.CurrentArchitecture.BelongedFaction); - this.CurrentArchitecture.LongViewArea = GameArea.GetAreaFromArea(this.CurrentArchitecture.ArchitectureArea, this.CurrentArchitecture.LongViewDistance, this.CurrentArchitecture.Kind.HasObliqueView, this.gameScenario, this.CurrentArchitecture.BelongedFaction); - this.CurrentArchitecture.BaseFoodSurplyArea = this.CurrentArchitecture.LongViewArea; - - foreach (Point point in this.CurrentArchitecture.ArchitectureArea.Area) - { - this.gameScenario.MapTileData[point.X, point.Y].TileArchitecture = this.CurrentArchitecture; - } - - this.gameScenario.SetMapTileArchitecture(this.CurrentArchitecture); + this.CurrentArchitecture.Expand(); } }