Skip to content

Commit

Permalink
調整納妃厭惡。厭惡君主武將不再教子女
Browse files Browse the repository at this point in the history
  • Loading branch information
luiges90 committed Oct 16, 2023
1 parent c2cb04e commit d5d63a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 59 deletions.
18 changes: 9 additions & 9 deletions WorldOfTheThreeKingdoms/GameObjects/GameScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6023,7 +6023,7 @@ public void TrainChildren()
foreach (Person p in this.Persons)
{
//if (p.Trainable && GameObject.Random(30) == 0)
if (p.Trainable && GameObject.Random((int)(20 / (IsPlayer(p.Father.BelongedFaction) ? 1 : Session.Current.Scenario.Parameters.AIExtraPerson) / Session.Parameters.DayInTurn)) == 0)
if (p.Trainable && GameObject.Random((int)(10 / (IsPlayer(p.Father.BelongedFaction) ? 1 : Session.Current.Scenario.Parameters.AIExtraPerson) / Session.Parameters.DayInTurn)) == 0)
{
if (p.TrainPolicy == null)
{
Expand Down Expand Up @@ -6121,7 +6121,7 @@ public void TrainChildren()
{
if (p.Hates(q)) continue;
if (q.Hates(p)) continue;
if (GameObject.Chance(85 - q.Ambition * 15) && (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q))) continue;
if (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q)) continue;
if (GameObject.Chance((int)((q.Strength - p.Strength + 50 + q.childrenAbilityIncrease) * ((float)p.StrengthPotential / p.Strength))))
{
p.Strength += GameObject.Random(Math.Max((p.StrengthPotential * 6 / 5 - p.Strength) / 10, 1) + 1);
Expand Down Expand Up @@ -6167,7 +6167,7 @@ public void TrainChildren()
{
if (p.Hates(q)) continue;
if (q.Hates(p)) continue;
if (GameObject.Chance(85 - q.Ambition * 15) && (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q))) continue;
if (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q)) continue;
if (GameObject.Chance((int)((q.Command - p.Command + 50 + q.childrenAbilityIncrease) * ((float)p.CommandPotential / p.Command))))
{
p.Command += GameObject.Random(Math.Max((p.CommandPotential * 6 / 5 - p.Command) / 10, 1) + 1);
Expand Down Expand Up @@ -6212,7 +6212,7 @@ public void TrainChildren()
{
if (p.Hates(q)) continue;
if (q.Hates(p)) continue;
if (GameObject.Chance(85 - q.Ambition * 15) && (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q))) continue;
if (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q)) continue;
if (GameObject.Chance((int)((q.Intelligence - p.Intelligence + 50 + q.childrenAbilityIncrease) * ((float)p.IntelligencePotential / p.Intelligence))))
{
p.Intelligence += GameObject.Random(Math.Max((p.IntelligencePotential * 6 / 5 - p.Intelligence) / 10, 1) + 1);
Expand Down Expand Up @@ -6258,7 +6258,7 @@ public void TrainChildren()
{
if (p.Hates(q)) continue;
if (q.Hates(p)) continue;
if (GameObject.Chance(85 - q.Ambition * 15) && (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q))) continue;
if (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q)) continue;
if (GameObject.Chance((int)((q.Politics - p.Politics + 50 + q.childrenAbilityIncrease) * ((float)p.PoliticsPotential / p.Politics))))
{
p.Politics += GameObject.Random(Math.Max((p.PoliticsPotential * 6 / 5 - p.Politics) / 10, 1) + 1);
Expand Down Expand Up @@ -6304,7 +6304,7 @@ public void TrainChildren()
{
if (p.Hates(q)) continue;
if (q.Hates(p)) continue;
if (GameObject.Chance(85 - q.Ambition * 15) && (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q))) continue;
if (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q)) continue;
if (GameObject.Chance((int)((q.Glamour - p.Glamour + 50 + q.childrenAbilityIncrease) * ((float)p.GlamourPotential / p.Glamour))))
{
p.Glamour += GameObject.Random(Math.Max((p.GlamourPotential * 6 / 5 - p.Glamour) / 10, 1) + 1);
Expand Down Expand Up @@ -6350,7 +6350,7 @@ public void TrainChildren()
{
if (p.Hates(q)) continue;
if (q.Hates(p)) continue;
if (GameObject.Chance(85 - q.Ambition * 15) && (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q))) continue;
if (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q)) continue;
if (q.Skills.Count <= 0) continue;
List<Skill> skillToTeach = new List<Skill>();
foreach (Skill s in q.Skills.Skills.Values)
Expand Down Expand Up @@ -6428,7 +6428,7 @@ public void TrainChildren()
{
if (p.Hates(q)) continue;
if (q.Hates(p)) continue;
if (GameObject.Chance(85 - q.Ambition * 15) && (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q))) continue;
if (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q)) continue;
List<Stunt> stuntToTeach = new List<Stunt>();
foreach (Stunt s in q.Stunts.Stunts.Values)
{
Expand Down Expand Up @@ -6506,7 +6506,7 @@ public void TrainChildren()
{
if (p.Hates(q)) continue;
if (q.Hates(p)) continue;
if (GameObject.Chance(85 - q.Ambition * 15) && (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q))) continue;
if (q.Hates(p.Father) || q.Hates(p.Mother) || p.Father.Hates(q) || p.Mother.Hates(q)) continue;
List<Title> toTeach = q.Titles;
int maxLevel = 1;
foreach (Title t in toTeach)
Expand Down
52 changes: 2 additions & 50 deletions WorldOfTheThreeKingdoms/GameObjects/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10410,7 +10410,7 @@ public Person XuanZeMeiNv(Person nvren)

if (addHate)
{
nvren.AdjustRelation(leader, 0, -100 * nvren.PersonalLoyalty * nvren.PersonalLoyalty);
nvren.AdjustRelation(leader, 0, Math.Max(0, -100 * (nvren.PersonalLoyalty - 2) * (nvren.PersonalLoyalty - 2)));
this.DecreaseKarma(1 + nvren.PersonalLoyalty * 2 + Math.Max(0, this.Karma / 5));

foreach (Person p in Session.Current.Scenario.Persons)
Expand Down Expand Up @@ -10535,58 +10535,10 @@ public void GoForHouGong(Person nvren)

if (!q.Hates(this) && !this.Hates(q))
{
if (GameObject.Random(10000 / (this.CommandExperience + 1)) == 0)
{
q.AddCommandExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.StrengthExperience + 1)) == 0)
{
q.AddStrengthExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.IntelligenceExperience + 1)) == 0)
{
q.AddIntelligenceExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.PoliticsExperience + 1)) == 0)
{
q.AddPoliticsExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.GlamourExperience + 1)) == 0)
if (GameObject.Random(2500 / (this.GlamourExperience + 1)) == 0)
{
q.AddGlamourExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.BubingExperience + 1)) == 0)
{
q.AddBubingExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.NubingExperience + 1)) == 0)
{
q.AddNubingExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.QibingExperience + 1)) == 0)
{
q.AddQibingExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.ShuijunExperience + 1)) == 0)
{
q.AddShuijunExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.QixieExperience + 1)) == 0)
{
q.AddQixieExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.TacticsExperience + 1)) == 0)
{
q.AddTacticsExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.StratagemExperience + 1)) == 0)
{
q.AddStratagemExperience(GameObject.Random(houGongDays) + 1);
}
if (GameObject.Random(10000 / (this.InternalExperience + 1)) == 0)
{
q.AddInternalExperience(GameObject.Random(houGongDays) + 1);
}
this.AddGlamourExperience(houGongDays);
q.AddGlamourExperience(houGongDays);
q.IncreaseReputation(houGongDays * 2);
Expand Down

0 comments on commit d5d63a5

Please sign in to comment.