public override bool CheckConditionKind(Person person) { return person.BelongedFaction != null && person.Hates(person.BelongedFaction.Leader); }
public Person XuanZeMeiNv(Person nvren) { Person tookSpouse = null; nvren.LocationArchitecture.DecreaseFund(50000); nvren.Status = PersonStatus.Princess; nvren.workKind = ArchitectureWorkKind.无; nvren.LocationTroop = null; nvren.TargetArchitecture = null; if (nvren.Spouse != null) { Person p = new Person(); foreach (Person person in base.Scenario.Persons) { if (person == nvren.Spouse) { p = person; break; } } if ((p != null) && p.ID != nvren.LocationArchitecture.BelongedFaction.LeaderID) { if (p.Alive) { tookSpouse = p; p.Hates(this.BelongedFaction.Leader); } } }// end if (this.CurrentPerson.Spouse != -1) ExtensionInterface.call("TakeToHouGong", new Object[] { this.Scenario, this, nvren }); return tookSpouse; }
public override bool CheckConditionKind(Person person) { return person.BelongedFactionWithPrincess != null && !person.Hates(person.BelongedFactionWithPrincess.Leader); }
public void GoForHouGong(Person nvren) { if (this.LocationArchitecture != null && this.Status == PersonStatus.Normal) { int houGongDays = nvren.Glamour / 4 + GameObject.Random(6) + 10; if (houGongDays > 60) { houGongDays = GameObject.Random(10) + 60; } if (!nvren.Hates(this) && GlobalVariables.getChildrenRate > 0) { float extraRate = 1; if (this.Closes(nvren)) { extraRate += 0.2f; } if (nvren.Closes(this)) { extraRate += 0.2f; } if (nvren.Ideal == this.Ideal) { extraRate += 0.2f; } if (this.Spouse == nvren) { extraRate += 1.6f; } float pregnantChance = GlobalVariables.getChildrenRate / 100.0f; if (GlobalVariables.PersonNaturalDeath) { pregnantChance /= this.NumberOfChildren; } pregnantChance *= houGongDays * extraRate; pregnantChance += this.pregnantChance + nvren.pregnantChance; if (GameObject.Chance(Math.Max((int)pregnantChance, Parameters.MinPregnantProb)) && !nvren.huaiyun && !this.huaiyun && this.isLegalFeiZi(nvren) && (this.LocationArchitecture.BelongedFaction.Leader.meichushengdehaiziliebiao().Count - this.LocationArchitecture.yihuaiyundefeiziliebiao().Count > 0 || GlobalVariables.createChildren)) { nvren.suoshurenwu = this.ID; this.suoshurenwu = nvren.ID; if (nvren.Sex) { nvren.huaiyun = true; nvren.huaiyuntianshu = -GameObject.Random(houGongDays); } else { this.huaiyun = true; this.huaiyuntianshu = -GameObject.Random(houGongDays); } } } this.OutsideTask = OutsideTaskKind.后宮; this.TargetArchitecture = this.LocationArchitecture; this.ArrivingDays = houGongDays; this.Status = PersonStatus.Moving; this.TaskDays = this.ArrivingDays; ExtensionInterface.call("GoForHouGong", new Object[] { this.Scenario, this, nvren }); } }