From ea182c57b60e7f11aaff6bcbe53c13e7c46029a5 Mon Sep 17 00:00:00 2001 From: Peter WONG Date: Sat, 24 Feb 2024 11:16:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E6=8A=8A=E5=A5=B3=E4=BF=98=E7=B4=8D?= =?UTF-8?q?=E5=A6=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WorldOfTheThreeKingdoms/GameObjects/Person.cs | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/WorldOfTheThreeKingdoms/GameObjects/Person.cs b/WorldOfTheThreeKingdoms/GameObjects/Person.cs index fb4978e5..ee65f292 100644 --- a/WorldOfTheThreeKingdoms/GameObjects/Person.cs +++ b/WorldOfTheThreeKingdoms/GameObjects/Person.cs @@ -2444,6 +2444,15 @@ public PersonList MakeMarryable2()//找妾 result.Add(p); } } + foreach (Captive c in this.LocationArchitecture.Captives) + { + Person p = c.CaptivePerson; + if (p.Sex && p.isLegalFeiZi(this) && this.isLegalFeiZi(p) && Person.GetIdealOffset(p, this) <= Session.Parameters.MakeMarrigeIdealLimit + && !p.Hates(this) && !this.Hates(p)) + { + result.Add(p); + } + } return result; } @@ -2514,9 +2523,33 @@ public void Marry(Person p, Person maker) if (!(this.Spouse == p || p.Spouse == this)) { this.LocationArchitecture.DecreaseFund(Session.Parameters.MakeMarriageCost); + } + + if (p.Status == PersonStatus.Captive) + { + p.SetBelongedCaptive(null, PersonStatus.Normal); + p.ChangeFaction(this.BelongedFaction); + p.NvGuan = true; + + p.AdjustRelation(maker, 0, Math.Max(0, -100 * (p.PersonalLoyalty - 1) * (p.PersonalLoyalty - 1))); + maker.DecreaseKarma(1 + p.PersonalLoyalty + Math.Max(0, p.Karma / 5)); - //makeHateCausedByAffair(this, p, maker); + foreach (Person q in Session.Current.Scenario.Persons) + { + if (q == p) continue; + if (q == maker) continue; + if (q.IsVeryCloseTo(p)) + { + q.AdjustRelation(maker, 0, -50 * q.PersonalLoyalty * q.PersonalLoyalty); + } + if (q.HasCloseStrainTo(p)) + { + q.AdjustRelation(maker, 0, -50 * q.PersonalLoyalty * q.PersonalLoyalty); + } + } } + + makeHateCausedByAffair(this, p, maker); if (this.Spouse == null) { this.Spouse = p; @@ -4877,10 +4910,6 @@ public static float GetIdealAttraction(Person target, Person src, float idealFac { v += 20; } - if (src.Spouse == target) - { - v += 30; - } if (src.Brothers.GameObjects.Contains(target)) { v += 40; @@ -8111,9 +8140,9 @@ public int Loyalty { v += 10; } - else if (this.IsVeryCloseTo(this.BelongedFaction.Leader)) + else if (this.Brothers.GameObjects.Contains(this.BelongedFaction.Leader)) { - v += 30; + v += 50; } v += Math.Max(-200, TempLoyaltyChange);