예제 #1
0
        protected override bool Allow(SimDescription sim)
        {
            if ((SimTypes.IsSelectable(sim)) && (sim.SkillManager.GetSkillLevel(SkillNames.DogHunting) < 1))
            {
                IncStat("Active Skill Denied");
                return(false);
            }
            else if (InteractionsEx.HasInteraction <Terrain.SniffOut.SniffOutDefinition>(sim))
            {
                IncStat("Has Interaction");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #2
0
        protected static void OnRoomChanged(Event e)
        {
            Sim obj = e.Actor as Sim;

            if (obj != null)
            {
                if (Woohooer.Settings.NeedsChange(obj))
                {
                    if (Woohooer.Settings.mChangeRoomClothings)
                    {
                        bool needsChange = false;

                        try
                        {
                            if (obj.CurrentOutfitCategory == Sims3.SimIFace.CAS.OutfitCategories.Naked)
                            {
                                needsChange = (SkinnyDipClothingPile.FindClothingPile(obj) == null);
                            }
                        }
                        catch
                        {
                        }

                        if (needsChange)
                        {
                            if (!InteractionsEx.HasInteraction <Shower.TakeShower.Definition>(obj))
                            {
                                Sim.ClothesChangeReason reason = Sim.ClothesChangeReason.GoingToBed;
                                if (obj.IsOutside)
                                {
                                    reason = Sim.ClothesChangeReason.GoingOutside;
                                }
                                else if (Woohooer.Settings.mSwitchToEverydayAfterNakedWoohoo)
                                {
                                    reason = Sim.ClothesChangeReason.LeavingRoom;
                                }

                                SwitchOutfits.SwitchNoSpin(obj, reason);
                            }
                        }
                    }

                    Woohooer.Settings.RemoveChange(obj);
                }
            }
        }
예제 #3
0
            public override bool Test(Sim a, FairyHouse target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if ((!InteractionsEx.HasInteraction <FairyHouseWoohoo.BaseDefinition>(a)) &&
                    (!InteractionsEx.HasInteraction <FairyHouseWoohoo.ProxyDefinition>(a)))
                {
                    if (!target.IsAllowedSim(a))
                    {
                        return(false);
                    }
                }

                if (target.IsActorUsingMe(a))
                {
                    return(false);
                }
                return(true);
            }
예제 #4
0
        protected override bool Allow(SimDescription sim)
        {
            if ((SimTypes.IsSelectable(sim)) && (sim.SkillManager.GetSkillLevel(SkillNames.CatHunting) < 1))
            {
                IncStat("Active Skill Denied");
                return(false);
            }
            else if (InteractionsEx.HasInteraction <Terrain.CatFishHere.Definition>(sim))
            {
                IncStat("Has Interaction");
                return(false);
            }
            else if (InteractionsEx.HasInteraction <CatHuntingComponent.StalkForPrey.Definition>(sim))
            {
                IncStat("Has Interaction");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #5
0
        protected bool Test(Sim sim, List <InteractionDefinition> interactions)
        {
            if (InteractionsEx.HasInteraction <ICountsAsWorking>(sim))
            {
                IncStat("At Work");
                return(false);
            }
            else if (Situations.HasInteraction(sim, interactions, true))
            {
                IncStat("At Work");
                return(false);
            }
            else
            {
                if (Situations.DebuggingLevel >= Common.DebugLevel.High)
                {
                    if (sim.InteractionQueue == null)
                    {
                        IncStat("Interaction Queue = null");
                    }
                    else
                    {
                        if (sim.InteractionQueue.Count == 0)
                        {
                            IncStat("Interaction Queue empty");
                        }
                        else
                        {
                            foreach (InteractionInstance instance2 in sim.InteractionQueue.InteractionList)
                            {
                                IncStat("Interaction: " + instance2.ToString());
                            }
                        }
                    }
                }

                VisitSituation.AnnounceTimeToGoToWork(sim);

                if (SimTypes.IsSpecial(Sim))
                {
                    IncStat("Special Pushed to Work");
                }
                else
                {
                    IncStat("Pushed to Work");
                }

                try
                {
                    // Don't queue stomp on their birthday
                    if (sim.SimDescription.YearsSinceLastAgeTransition != 0)
                    {
                        sim.InteractionQueue.CancelAllInteractions();

                        IncStat("Queue Stomped");

                        if ((!SimTypes.IsSelectable(sim.SimDescription)) && (sim.LotCurrent != null) && (sim.LotCurrent.CanSimTreatAsHome(sim)))
                        {
                            Callbox callbox = sim.LotHome.FindCallbox();
                            if (callbox != null)
                            {
                                Vector3 fwd = Vector3.Invalid;
                                Vector3 pos = Vector3.Invalid;

                                World.FindGoodLocationParams fglParams = new World.FindGoodLocationParams(callbox.Position);
                                fglParams.BooleanConstraints = FindGoodLocationBooleans.Routable | FindGoodLocationBooleans.PreferEmptyTiles;
                                if (GlobalFunctions.FindGoodLocation(sim, fglParams, out pos, out fwd))
                                {
                                    sim.ResetBindPoseWithRotation();
                                    sim.SetPosition(pos);
                                    sim.SetForward(fwd);
                                    sim.RemoveFromWorld();
                                    sim.AddToWorld();
                                    sim.SetHiddenFlags(HiddenFlags.Nothing);
                                    sim.SetOpacity(1f, 0f);

                                    IncStat("Bounce to Mailbox");
                                }
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Common.DebugException(sim, e);

                    IncStat("Cancel Fail");
                }

                sim.InteractionQueue.RemoveGoHomeInteractions(true);

                return(true);
            }
        }