本文整理汇总了C#中Relationship.TestWasNewHighScore方法的典型用法代码示例。如果您正苦于以下问题:C# Relationship.TestWasNewHighScore方法的具体用法?C# Relationship.TestWasNewHighScore怎么用?C# Relationship.TestWasNewHighScore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relationship
的用法示例。
在下文中一共展示了Relationship.TestWasNewHighScore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateAttractionScore
public static void CalculateAttractionScore(Relationship ths, bool displayNotice)
{
if (ths == null) return;
ths.AttractionScore = 0;
//if (ths.AttractionScore == float.PositiveInfinity)
{
SimDescription simA = ths.SimDescriptionA;
SimDescription simB = ths.SimDescriptionB;
if ((simA != null) && (simB != null) && (simA.IsHuman) && (simB.IsHuman))
{
string reason;
GreyedOutTooltipCallback greyedOutTooltipCallback = null;
if (CommonSocials.CanGetRomantic(simA, simB, true, false, true, ref greyedOutTooltipCallback, out reason))
{
float score = RandomUtil.GetFloat(Relationship.kBaseRandomAttraction[0x0], Relationship.kBaseRandomAttraction[0x1]);
score += Woohooer.Settings.mAttractionBaseChanceScoringV3[PersistedSettings.GetSpeciesIndex(simA)];
float origScore = score;
float highScore = 0f;
float newScore = 0f;
switch (ths.LTR.CurrentLTR)
{
case LongTermRelationshipTypes.Spouse:
case LongTermRelationshipTypes.Fiancee:
if (score > 0)
{
score *= 2;
}
else
{
score = 0;
}
break;
}
newScore = score - origScore;
origScore = score;
Relationship.AttractionType attractionType = Relationship.AttractionType.None;
foreach (Trait traitA in simA.TraitManager.List)
{
if (traitA.IsReward) continue;
foreach (Trait traitB in simB.TraitManager.List)
{
if (traitB.IsReward) continue;
if (traitA.TraitGuid == traitB.TraitGuid)
{
score += Relationship.kTraitModifier;
}
else if (TraitManager.DoTraitsConflict(traitA.Guid, traitB.Guid))
{
score -= Relationship.kTraitModifier;
}
}
}
newScore = score - origScore;
origScore = score;
if (ths.TestWasNewHighScore(Relationship.AttractionType.Trait, newScore, ref highScore))
{
attractionType = Relationship.AttractionType.Trait;
}
Occupation occupation = simA.Occupation;
if (occupation != null)
{
score += occupation.CareerLevel * Relationship.kCareerBonusPerLevel;
}
Occupation occupation2 = simB.Occupation;
if (occupation2 != null)
{
score += occupation2.CareerLevel * Relationship.kCareerBonusPerLevel;
}
newScore = score - origScore;
origScore = score;
if (ths.TestWasNewHighScore(Relationship.AttractionType.Career, newScore, ref highScore))
{
attractionType = Relationship.AttractionType.Career;
}
foreach (Skill skill in simA.SkillManager.List)
{
score += skill.SkillLevel * Relationship.kSkillBonusPerLevel;
}
foreach (Skill skill2 in simB.SkillManager.List)
{
score += skill2.SkillLevel * Relationship.kSkillBonusPerLevel;
}
//.........这里部分代码省略.........