本文整理汇总了C#中Sim.GetRelationship方法的典型用法代码示例。如果您正苦于以下问题:C# Sim.GetRelationship方法的具体用法?C# Sim.GetRelationship怎么用?C# Sim.GetRelationship使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sim
的用法示例。
在下文中一共展示了Sim.GetRelationship方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanShareBed
public static bool CanShareBed(Sim newSim, Sim simUsingBed, CommodityKind use, bool isTent)
{
try
{
if ((simUsingBed != null) && (simUsingBed != newSim))
{
Relationship relationship = newSim.GetRelationship(simUsingBed, false);
if (relationship == null) return false;
if ((relationship.LTR == null) || (relationship.LTR.SimWasBetrayed(newSim)) || (relationship.LTR.SimWasBetrayed(simUsingBed)))
{
return false;
}
if (simUsingBed.InteractionQueue != null)
{
WooHoo runningInteraction = simUsingBed.InteractionQueue.RunningInteraction as WooHoo;
if ((runningInteraction != null) && (newSim != runningInteraction.Target))
{
return false;
}
}
}
return true;
}
catch (Exception e)
{
Common.Exception(newSim, e);
return false;
}
}
示例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: GiveGiftProceduralTest
public static bool GiveGiftProceduralTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
OccultImaginaryFriend friend;
if (actor.GetRelationship(target, false) == null)
{
return false;
}
if (SocialComponent.IsInServicePreventingSocialization(target))
{
return false;
}
if (!SocialComponent.WouldShowMultiLevelSocialPieMenu(actor, target))
{
return false;
}
if (OccultImaginaryFriend.TryGetOccultFromSim(target, out friend) && !friend.IsReal)
{
return false;
}
/*
if (!Sim.GiveGift.Definition.DoesGiftForTargetSimExist(actor, target))
{
greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Sim.GiveGift.GiveGiftLocalizeString(actor.IsFemale, "NoGiftsToGive", new object[0]));
return false;
}
*/
return true;
}
示例4: UnicornInviteTest
public static bool UnicornInviteTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
try
{
if (!target.IsUnicorn)
{
return false;
}
if (!OccultUnicorn.IsNPCPoolUnicorn(target))
{
return false;
}
Relationship relationship = actor.GetRelationship(target, false);
if ((relationship == null) || (relationship.CurrentLTRLiking < PetSocialTunables.kUnicornMinLtrForInvite))
{
return false;
}
/*
if (!actor.Household.CanAddSpeciesToHousehold(target.SimDescription.Species))
{
greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString("Ui/Caption/MovingDialog:TooManyPets", new object[0x0]));
return false;
}
*/
return true;
}
catch (Exception e)
{
Common.Exception(actor, target, e);
return false;
}
}