本文整理汇总了C#中GameObjects.Person.GetRelation方法的典型用法代码示例。如果您正苦于以下问题:C# Person.GetRelation方法的具体用法?C# Person.GetRelation怎么用?C# Person.GetRelation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.Person
的用法示例。
在下文中一共展示了Person.GetRelation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckConditionKind
public override bool CheckConditionKind(Person person)
{
return person.BelongedFactionWithPrincess != null && person.GetRelation(person.BelongedFactionWithPrincess.Leader) >= this.number;
}
示例2: createChildren
//.........这里部分代码省略.........
calmness = b.Calmness;
personalLoyalty = b.PersonalLoyalty;
ambition = b.Ambition;
if (b.Text.Count > 0)
{
adjectives.Add(b.Text[GameObject.Random(b.Text.Count)]);
}
if (b.SuffixText.Count > 0)
{
suffixes.Add(b.SuffixText[GameObject.Random(b.SuffixText.Count)]);
}
}
}
if (adjectives.Count > 0)
{
foreach (String s in adjectives)
{
biography += s + ",";
}
biography = biography.Substring(0, biography.Length - 1);
if (adjectives.Count > 0)
{
biography += "的" + (suffixes.Count > 0 ? suffixes[GameObject.Random(suffixes.Count)] : "將領");
}
biography += "。";
}
Biography bio = new Biography();
bio.Brief = biography;
bio.ID = r.ID;
Biography fatherBio = father.Scenario.GameCommonData.AllBiographies.GetBiography(father.ID);
if (fatherBio != null)
{
bio.FactionColor = fatherBio.FactionColor;
bio.MilitaryKinds = fatherBio.MilitaryKinds;
}
else
{
bio.FactionColor = 52;
bio.MilitaryKinds.AddBasicMilitaryKinds(father.Scenario);
}
father.Scenario.GameCommonData.AllBiographies.AddBiography(bio);
r.PersonBiography = bio;
/*r.LocationArchitecture = father.BelongedArchitecture; //mother has no location arch!
r.BelongedFaction = r.BelongedArchitecture.BelongedFaction;
r.Available = true;*/
r.Alive = true;
father.Scenario.Persons.Add(r);
r.Scenario = father.Scenario;
foreach (Person p in father.Scenario.Persons)
{
int fatherRel = father.GetRelation(p);
int motherRel = mother.GetRelation(p);
if (fatherRel != 0 && motherRel != 0)
{
int rel = GameObject.Random(Math.Abs(fatherRel - motherRel)) + Math.Min(fatherRel, motherRel);
p.SetRelation(p, rel);
}
}
foreach (Person p in father.GetClosePersons())
{
if (!GameObject.Chance((int)r.personalLoyalty * 25))
{
r.AddClose(p);
}
}
foreach (Person p in father.GetClosePersons())
{
if (!GameObject.Chance((int)r.personalLoyalty * 25))
{
r.AddClose(p);
}
}
foreach (Person p in father.GetHatedPersons())
{
if (!GameObject.Chance((int)r.personalLoyalty * 25))
{
r.AddHated(p);
}
}
foreach (Person p in father.GetHatedPersons())
{
if (!GameObject.Chance((int)r.personalLoyalty * 25))
{
r.AddHated(p);
}
}
ExtensionInterface.call("CreateChildren", new Object[] { father.Scenario, r });
return r;
}