本文整理汇总了C#中GameObjects.Person.getTitleOfKind方法的典型用法代码示例。如果您正苦于以下问题:C# Person.getTitleOfKind方法的具体用法?C# Person.getTitleOfKind怎么用?C# Person.getTitleOfKind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.Person
的用法示例。
在下文中一共展示了Person.getTitleOfKind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createChildren
//.........这里部分代码省略.........
GameObject.Chance(father.childrenStuntChanceIncrease + mother.childrenStuntChanceIncrease)) && i.CanBeBorn(r))
{
bool ok = true;
foreach (Condition j in i.LearnConditions.Conditions.Values)
{
if (j.Kind.ID == 600 || j.Kind.ID == 610) //check personality kind only
{
if (!j.CheckCondition(r))
{
ok = false;
break;
}
}
}
if (ok)
{
r.Stunts.AddStunt(i);
}
}
}
GameObjectList rawTitles = father.Scenario.GameCommonData.AllTitles.GetTitleList().GetRandomList();
Dictionary<TitleKind, List<Title>> titles = new Dictionary<TitleKind, List<Title>>();
foreach (Title t in rawTitles)
{
if (!titles.ContainsKey(t.Kind))
{
titles[t.Kind] = new List<Title>();
}
titles[t.Kind].Add(t);
}
foreach (KeyValuePair<TitleKind, List<Title>> i in titles)
{
Title ft = father.getTitleOfKind(i.Key);
Title mt = mother.getTitleOfKind(i.Key);
int levelTendency = (((ft == null ? 0 : ft.Level) + (mt == null ? 0 : mt.Level)) / 2)
+ father.childrenTitleChanceIncrease + mother.childrenTitleChanceIncrease;
if (GameObject.Chance(20) && ft != null && ft.CanBeBorn(r))
{
r.RealTitles.Add(ft);
}
else if (GameObject.Chance(25) && mt != null && mt.CanBeBorn(r)) //20% of remaining 80% = 25%
{
r.RealTitles.Add(mt);
}
else
{
int targetLevel = levelTendency + GameObject.Random(3) - 1;
if (targetLevel <= 0) continue;
List<Title> candidates = new List<Title>();
List<Title> lesserCandidates = new List<Title>();
List<Title> leastCandidates = new List<Title>();
foreach (Title t in i.Value)
{
if (t.Level == targetLevel && t.CanBeBorn(r))
{
candidates.Add(t);
}
else if ((t.Level + 1 == targetLevel || t.Level - 1 == targetLevel) && t.CanBeBorn(r))
{
lesserCandidates.Add(t);
}
else if (t.Level < targetLevel && t.CanBeBorn(r))