当前位置: 首页>>代码示例>>C#>>正文


C# Sim.IsGreetedOnLot方法代码示例

本文整理汇总了C#中Sim.IsGreetedOnLot方法的典型用法代码示例。如果您正苦于以下问题:C# Sim.IsGreetedOnLot方法的具体用法?C# Sim.IsGreetedOnLot怎么用?C# Sim.IsGreetedOnLot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sim的用法示例。


在下文中一共展示了Sim.IsGreetedOnLot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnPortalStop

        public override bool OnPortalStop(Sim sim)
        {
            try
            {
                AncientPortal targetPortal = null;
                if (!sTargetPortals.TryGetValue(sim, out targetPortal))
                {
                    sim.PlayRouteFailure(mPortal);
                    return false;
                }

                mSMC.SetActor("portal", targetPortal);

                Slot slotName = targetPortal.GetRoutingSlots()[0x0];
                Vector3 positionOfSlot = targetPortal.GetPositionOfSlot(slotName);
                Vector3 forwardOfSlot = targetPortal.GetForwardOfSlot(slotName);
                sim.SetPosition(positionOfSlot);
                sim.SetForward(forwardOfSlot);

                targetPortal.DisableFootprint(AncientPortal.CatchABeam.FootprintPlacementHash);

                mSMC.RequestState("x", "Exit");

                if (SimTypes.IsSelectable(sim))
                {
                    for (int i = 0x0; i < AncientPortal.CatchABeam.kPotentialTravelBuffs.Length; i++)
                    {
                        if (RandomUtil.RandomChance(AncientPortal.CatchABeam.kChanceForEachBuff))
                        {
                            sim.BuffManager.AddElement(AncientPortal.CatchABeam.kPotentialTravelBuffs[i], Origin.FromAncientPortal);
                        }
                    }
                }

                targetPortal.RemoveFromUseList(sim);

                if (targetPortal.LotCurrent.IsResidentialLot && !sim.IsGreetedOnLot(targetPortal.LotCurrent))
                {
                    sim.GreetSimOnLot(targetPortal.LotCurrent);
                }

                if (mSMC != null)
                {
                    mSMC.Dispose();
                    mSMC = null;
                }

                mCurrentlyRoutingSim = null;

                return true;
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(sim, Owner, e);
                return false;
            }
            finally
            {
                if (mCurrentlyRoutingSim != null)
                {
                    mCurrentlyRoutingSim.SetHiddenFlags(HiddenFlags.Nothing);
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:68,代码来源:AncientPortalComponent.cs

示例2: TestAskToStayOver

        public static bool TestAskToStayOver(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (isAutonomous)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Autonomous");
                    return false;
                }
                if (!target.IsAtHome)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Not At Home");
                    return false;
                }
                if (actor.LotCurrent != target.LotCurrent)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Not Same Lot");
                    return false;
                }
                if (actor.LotHome == target.LotHome)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Same Home");
                    return false;
                }
                if (!actor.IsSelectable)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("IsSelectable Fail");
                    return false;
                }
                if (!SimClock.IsTimeBetweenTimes(SimClock.HoursPassedOfDay, VisitSituation.AskToStayOverTimeStart, VisitSituation.AskToStayOverTimeEnd))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Not Time");
                    return false;
                }
                if (!actor.IsGreetedOnLot(target.LotCurrent))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Not Greeted");
                    return false;
                }

                Relationship relationship = Relationship.Get(actor, target, false);
                if ((relationship != null) && (((relationship.mWhenAllowedToStayOverSimA.Ticks != 0L) && (SimClock.ElapsedTime(TimeUnit.Days, relationship.mWhenAllowedToStayOverSimA) < VisitSituation.AskToStayOverDaysPermission)) || ((relationship.mWhenAllowedToStayOverSimB.Ticks != 0L) && (SimClock.ElapsedTime(TimeUnit.Days, relationship.mWhenAllowedToStayOverSimB) < VisitSituation.AskToStayOverDaysPermission))))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Relation Fail");
                    return false;
                }

                // Age related code replaced
                return OnDefaultTest(actor, target, topic, isAutonomous, ref greyedOutTooltipCallback);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:60,代码来源:CommonSocials.cs

示例3: Perform

        public override void Perform(Sim sim, DiseaseVector vector)
        {
            if (SimTypes.IsDead(sim.SimDescription)) return;

            if (!mAllowActive)
            {
                if (SimTypes.IsSelectable(sim.SimDescription)) return;
            }

            bool found = false;

            foreach (Sim other in sim.LotCurrent.GetSims())
            {
                if (other == sim) continue;

                if (ScoringLookup.GetScore(mScoring, other.SimDescription) >= mMinimum)
                {
                    found = true;
                    break;
                }
            }

            if (found) return;

            List<Lot> lots = new List<Lot>(LotManager.sLots.Values);

            while (lots.Count > 0)
            {
                Lot lot = RandomUtil.GetRandomObjectFromList(lots);
                lots.Remove(lot);

                if (lot.IsWorldLot) continue;

                if (lot == sim.LotCurrent) continue;

                foreach (Sim other in lot.GetSims())
                {
                    if (ScoringLookup.GetScore(mScoring, other.SimDescription) >= mMinimum)
                    {
                        InteractionDefinition definition = null;

                        if (lot.IsCommunityLot)
                        {
                            definition = VisitCommunityLot.Singleton;
                        }
                        else
                        {
                            if (sim.IsGreetedOnLot(lot))
                            {
                                definition = GoToLot.Singleton;
                            }
                            else
                            {
                                definition = VisitLot.Singleton;
                            }
                        }

                        InteractionInstance instance = definition.CreateInstance(lot, sim, new InteractionPriority(InteractionPriorityLevel.Autonomous), true, true);
                        sim.InteractionQueue.Add(instance);

                        return;
                    }
                }              
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:65,代码来源:FindSimSymptom.cs

示例4: TestAskNPCToStayOver

        public static bool TestAskNPCToStayOver(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                OccultImaginaryFriend friend;
                if (isAutonomous)
                {
                    return false;
                }
                else if (!actor.IsAtHome)
                {
                    return false;
                }
                else if (actor.LotCurrent != target.LotCurrent)
                {
                    return false;
                }
                else if (actor.LotHome == target.LotHome)
                {
                    return false;
                }
                else if (!actor.IsSelectable)
                {
                    return false;
                }
                else if (!SimClock.IsTimeBetweenTimes(SimClock.HoursPassedOfDay, VisitSituation.AskToStayOverTimeStart, VisitSituation.AskToStayOverTimeEnd))
                {
                    return false;
                }
                else if (target.Service != null)
                {
                    return false;
                }
                else if (!target.IsGreetedOnLot(actor.LotCurrent))
                {
                    return false;
                }
                else if (OccultImaginaryFriend.TryGetOccultFromSim(target, out friend) && !friend.IsReal)
                {
                    return false;
                }

                Relationship relationship = Relationship.Get(actor, target, false);
                if ((relationship != null) && (((relationship.mWhenAllowedToStayOverSimA.Ticks != 0x0L) && (SimClock.ElapsedTime(TimeUnit.Days, relationship.mWhenAllowedToStayOverSimA) < VisitSituation.AskToStayOverDaysPermission)) || ((relationship.mWhenAllowedToStayOverSimB.Ticks != 0x0L) && (SimClock.ElapsedTime(TimeUnit.Days, relationship.mWhenAllowedToStayOverSimB) < VisitSituation.AskToStayOverDaysPermission))))
                {
                    return false;
                }

                SimDescription targetSim = target.SimDescription;
                SimDescription actorSim = actor.SimDescription;
                if (actorSim.Child && !targetSim.Child) //|| (actorSim.Teen && !targetSim.Teen)) || (actorSim.YoungAdultOrAbove && !targetSim.YoungAdultOrAbove))
                {
                    return false;
                }

                SlumberParty situationOfType = target.GetSituationOfType<SlumberParty>();
                if ((situationOfType != null) && situationOfType.Guests.Contains(target))
                {
                    return false;
                }
                return true;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:68,代码来源:CommonSocials.cs


注:本文中的Sim.IsGreetedOnLot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。