コード例 #1
0
ファイル: NewEnemyScenario.cs プロジェクト: yakoder/NRaas
        protected override bool TargetAllow(SimDescription sim)
        {
            if (!Relationship.AreStrangers(Sim, Target))
            {
                IncStat("Known");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
コード例 #2
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (Delta < 0)
            {
                IncStat("Enemy");
                return(false);
            }
            else if (Relationship.AreStrangers(Sim, Target))
            {
                IncStat("Unknown");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
コード例 #3
0
ファイル: YouShouldEx.cs プロジェクト: yakoder/NRaas
            public override InteractionTestResult Test(ref InteractionInstanceParameters parameters, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                InteractionTestResult result = base.Test(ref parameters, ref greyedOutTooltipCallback);

                if (result == InteractionTestResult.Def_TestFailed)
                {
                    Sim actor  = parameters.Actor as Sim;
                    Sim target = parameters.Target as Sim;

                    if (!actor.SimDescription.IsVampire)
                    {
                        return(InteractionTestResult.Def_TestFailed);
                    }
                    else if (!actor.Posture.AllowsNormalSocials() || !target.Posture.AllowsNormalSocials())
                    {
                        return(InteractionTestResult.GenericFail);
                    }
                    else if ((actor.Posture is SwimmingInPool) || (target.Posture is SwimmingInPool))
                    {
                        return(InteractionTestResult.Social_TargetInPool);
                    }
                    else if (Relationship.AreStrangers(actor, target) || target.NeedsToBeGreeted(actor))
                    {
                        return(InteractionTestResult.Social_TargetIsUngreetedOnCurrentLot);
                    }
                    else if (!CelebrityManager.CanSocialize(actor, target))
                    {
                        return(InteractionTestResult.Social_TargetCannotBeSocializedWith);
                    }
                    else if (GetYouShouldTargets(actor, target).Count == 0x0)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(YouShould.LocalizeString("InteractionUnavailable", new object[0x0]));
                        return(InteractionTestResult.GenericFail);
                    }

                    return(InteractionTestResult.Pass);
                }

                return(result);
            }
コード例 #4
0
ファイル: NewCoworkerScenario.cs プロジェクト: yakoder/NRaas
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Career job = Career;

            LawEnforcement lawCareer = job as LawEnforcement;

            if (lawCareer != null)
            {
                SimDescription partner = lawCareer.Partner;
                if (partner != null)
                {
                    if (IsValidPartner(lawCareer, partner, false))
                    {
                        try
                        {
                            job.AddCoworker(partner);
                        }
                        catch (Exception e)
                        {
                            Common.Exception(Career.OwnerDescription, partner, e);
                        }
                    }
                }
            }

            base.PrivateUpdate(frame);

            if (lawCareer != null)
            {
                if (!IsValidPartner(lawCareer, lawCareer.Partner, false))
                {
                    lawCareer.Partner = null;

                    if (job.Coworkers != null)
                    {
                        foreach (SimDescription coworker in job.Coworkers)
                        {
                            if (HandlePartner(lawCareer, coworker, SimTypes.IsSelectable(Sim)))
                            {
                                break;
                            }
                        }
                    }

                    if (lawCareer.Partner == null)
                    {
                        HandlePartner(lawCareer, lawCareer.Boss, SimTypes.IsSelectable(Sim));
                    }
                }

                if (lawCareer.Partner != null)
                {
                    if (Relationship.AreStrangers(Sim, lawCareer.Partner))
                    {
                        Relationship.Get(Sim, lawCareer.Partner, true).MakeAcquaintances();
                    }
                }
            }

            Careers.VerifyTone(Sim);
            return(mNewCoworkers.Count > 0);
        }