本文整理汇总了C#中Sim.InheritedPriority方法的典型用法代码示例。如果您正苦于以下问题:C# Sim.InheritedPriority方法的具体用法?C# Sim.InheritedPriority怎么用?C# Sim.InheritedPriority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sim
的用法示例。
在下文中一共展示了Sim.InheritedPriority方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test
public override bool Test(Sim a, AthleticGameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
if (isAutonomous)
{
if (TrainableSim.Service != null) return false;
}
if (SkillBasedCareerBooter.GetSkillBasedCareer(a, SkillNames.Athletic) == null)
{
return false;
}
if ((!target.CanObjectTrainSim() || (a.SkillManager.GetSkillLevel(SkillNames.Athletic) >= AthleticGameObject.TrainSim.AthleticSkillLevelGate)) || ((target.ActorsUsingMe.Count != 0x0) || isAutonomous))
{
return false;
}
if (target.Cardio)
{
return AthleticGameObject.WorkOut.CardioSingleton.CreateInstance(target, TrainableSim, a.InheritedPriority(), false, true).Test();
}
return AthleticGameObject.WorkOut.StrengthSingleton.CreateInstance(target, TrainableSim, a.InheritedPriority(), false, true).Test();
}
示例2: DoAcceptReject
public new static void DoAcceptReject(Sim actor, Sim target, Sim.GiveGift inst)
{
GameObject gift = inst.Gift;
string message = "";
string stingName = null;
if (inst.RejectFromSpoiled)
{
if (DoesSimAlreadyOwnObject(target, gift))
{
message = GiveGiftLocalizeString(target.IsFemale, "SpoiledAlreadyHave", new object[0x0]);
}
else
{
message = GiveGiftLocalizeString(target.IsFemale, "SpoiledTooCheap", new object[0x0]);
}
InteractionInstance instance = Sim.GiveGiftTantrum.Singleton.CreateInstance(target, target, target.InheritedPriority(), false, true);
target.InteractionQueue.PushAsContinuation(instance, true);
}
else
{
Relationship relationship = actor.GetRelationship(target, false);
float liking = relationship.LTR.Liking;
float num2 = 0f;
List<TraitNames> randomList = new List<TraitNames>();
TraitNames unknown = TraitNames.Unknown;
GiveGiftTraitData data = null;
InformationLearnedAboutSim sim = relationship.InformationAbout(target);
foreach (Trait trait in target.TraitManager.List)
{
if (sTraitToTraitDataMap.TryGetValue(trait.Guid, out data) && data.DoesTraitCareAboutObject(gift))
{
randomList.Add(trait.Guid);
num2 += data.Score;
if ((unknown == TraitNames.Unknown) && !sim.KnowsTrait(trait.Guid))
{
unknown = trait.Guid;
}
}
}
if (randomList.Count > 0x0)
{
if (unknown == TraitNames.Unknown)
{
unknown = RandomUtil.GetRandomObjectFromList<TraitNames>(randomList);
}
else
{
sim.LearnTrait(unknown, actor.SimDescription, target.SimDescription);
}
message = sTraitToTraitDataMap[unknown].GetTNS(target);
}
float num3 = liking + num2;
if (num3 >= Sim.GiveGiftTuning.kLTRToAcceptGift)
{
stingName = "sting_give_gift_accept";
if (num3 >= Sim.GiveGiftTuning.kLTRToSuperAcceptGift)
{
message = GiveGiftLocalizeString(target.IsFemale, "UberAcceptGiftTNS", new object[0x0]);
stingName = "sting_give_gift_accept_super";
}
else if (liking >= Sim.GiveGiftTuning.kLTRToAcceptGift)
{
message = GiveGiftLocalizeString(target.IsFemale, "AcceptGiftTNS", new object[0x0]);
}
TransferGiftFromActorToTarget(actor, target, gift);
}
else
{
if (liking < Sim.GiveGiftTuning.kLTRToAcceptGift)
{
message = GiveGiftLocalizeString(target.IsFemale, "RejectGiftTNS", new object[0x0]);
}
EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, actor, target, "PillowFight", false, false, false, CommodityTypes.Undefined));
}
}
if (stingName != null)
{
actor.ShowTNSAndPlayStingIfSelectable(message, StyledNotification.NotificationStyle.kSimTalking, target.ObjectId, gift.ObjectId, stingName);
}
else
{
actor.ShowTNSIfSelectable(message, StyledNotification.NotificationStyle.kSimTalking, target.ObjectId, gift.ObjectId);
}
}
示例3: ForcePushFridgeHave
public static bool ForcePushFridgeHave(Sim sim, GameObject objectToFindFridgeRelativeTo, Recipe chosenRecipe, Recipe.MealDestination destination, Recipe.MealQuantity quantity, Recipe.MealRepetition repetition)
{
Fridge closestObject = GlobalFunctions.GetClosestObject<Fridge>(objectToFindFridgeRelativeTo, false, true, null, null);
if (closestObject == null)
{
return false;
}
InteractionObjectPair iop = new InteractionObjectPair(new OverridedFridge_Have.Definition(null, chosenRecipe, null, objectToFindFridgeRelativeTo, destination, quantity, repetition, false, 0), closestObject);
InteractionInstanceParameters interactionInstanceParameters = new InteractionInstanceParameters(iop, sim, sim.InheritedPriority(), false, true);
return sim.InteractionQueue.AddNext(OverridedFridge_Have.Singleton.CreateInstanceFromParameters(ref interactionInstanceParameters));
}