public override bool CheckConditionKind(Person person)
 {
     return person.BelongedFactionWithPrincess != null && !person.Closes(person.BelongedFactionWithPrincess.Leader);
 }
예제 #2
0
 public override bool CheckConditionKind(Person person)
 {
     return person.BelongedFaction != null && person.Closes(person.BelongedFaction.Leader);
 }
예제 #3
0
        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 });
            }
        }