本文整理汇总了C#中Business.AddPerformance方法的典型用法代码示例。如果您正苦于以下问题:C# Business.AddPerformance方法的具体用法?C# Business.AddPerformance怎么用?C# Business.AddPerformance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Business
的用法示例。
在下文中一共展示了Business.AddPerformance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckIfAttemptingPrankOnConsecutiveDay
public bool CheckIfAttemptingPrankOnConsecutiveDay(Business business)
{
if ((business.LastPrankedSim == null) || (business.LastPrankedSim != business.SimAffectedByPrank))
{
return false;
}
if (business.WasLastPrankSuccessful)
{
string titleText = LocalizeString(business.SimConspiringPrank, "AttemptToPrankAgain", new object[0x0]);
StyledNotification.Format format = new StyledNotification.Format(titleText, business.SimAffectedByPrank.CreatedSim.ObjectId, StyledNotification.NotificationStyle.kSimTalking);
StyledNotification.Show(format);
}
else
{
string str2 = LocalizeString(business.SimConspiringPrank, "BossGettingAngry", new object[] { business.SimConspiringPrank });
StyledNotification.Format format2 = new StyledNotification.Format(str2, StyledNotification.NotificationStyle.kGameMessagePositive);
if (business.SimConspiringPrank.CreatedSim != null)
{
format2.mObject2 = business.SimConspiringPrank.CreatedSim.ObjectId;
}
else
{
format2.mObject2Key = business.SimConspiringPrank.GetThumbnailKey(ThumbnailSize.Medium, 0x0);
}
StyledNotification.Show(format2);
business.AddPerformance(Business.kCareerPerformanceLostWhenPrankRepeated);
}
business.WasLastPrankSuccessful = false;
business.IsPrankSet = false;
return true;
}
示例2: PerformPrank
public void PerformPrank(Business business)
{
if (!CheckIfAttemptingPrankOnConsecutiveDay(business))
{
bool flag = false;
Sim createdSim = business.SimConspiringPrank.CreatedSim;
Sim sim2 = business.SimAffectedByPrank.CreatedSim;
bool flag2 = business.SimAffectedByPrank == createdSim.Occupation.Boss;
Relationship relationship = Relationship.Get(createdSim, sim2, true);
LTRData data = LTRData.Get(relationship.LTR.CurrentLTR);
if (!relationship.STC.InNegativeContext || (data.RelationshipClass >= LTRData.RelationshipClassification.Medium))
{
base.Display(LocalizeString(createdSim.SimDescription, "FunnyPrankWorked", new object[] { createdSim.SimDescription, business.SimAffectedByPrank }), createdSim.ObjectId, business);
flag = true;
float change = flag2 ? Business.kLTRIncreaseWhenPrankSucceedsOnBoss : Business.kLTRIncreaseWhenPrankSucceeds;
relationship.LTR.UpdateLiking(change);
relationship.UpdateSTCFromOutsideConversation(sim2, createdSim, CommodityTypes.Funny, (float) Business.kSTCValueOnPranks);
}
else if (relationship.STC.InNegativeContext || (data.RelationshipClass == LTRData.RelationshipClassification.Low))
{
base.Display(LocalizeString(createdSim.SimDescription, "BadPrankFailed", new object[] { createdSim.SimDescription, business.SimAffectedByPrank }), createdSim.ObjectId, business);
CommodityTypes[] randomList = new CommodityTypes[] { CommodityTypes.Boring, CommodityTypes.Creepy, CommodityTypes.Insulting, CommodityTypes.Awkward, CommodityTypes.Steamed };
float num2 = flag2 ? Business.kLTRDecreaseWhenPrankFailsOnBoss : Business.kLTRDecreaseWhenPrankFails;
relationship.LTR.UpdateLiking(num2);
relationship.UpdateSTCFromOutsideConversation(sim2, createdSim, RandomUtil.GetRandomObjectFromList(randomList), (float) Business.kSTCValueOnPranks);
}
if (flag2)
{
float perfChange = flag ? Business.kCareerPerformanceChange : (-1f * Business.kCareerPerformanceChange);
business.AddPerformance(perfChange);
}
business.WasLastPrankSuccessful = flag;
business.IsPrankSet = false;
}
}