Skip to content

Commit

Permalink
可把女俘納妾
Browse files Browse the repository at this point in the history
  • Loading branch information
luiges90 committed Feb 24, 2024
1 parent 207c5a1 commit ea182c5
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions WorldOfTheThreeKingdoms/GameObjects/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ea182c5

Please sign in to comment.