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)); }
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); } } }
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); }
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)); }
public static void OnPickFromPanel(SimDescription ths, UIMouseEventArgs eventArgs, GameObjectHit gameObjectHit) { try { Sims3.Gameplay.UI.PieMenu.ClearInteractions(); Sims3.Gameplay.UI.PieMenu.HidePieMenuSimHead = true; Sims3.UI.Hud.PieMenu.sIncrementalButtonIndexing = true; Sim activeActor = Sim.ActiveActor; if (activeActor != null) { if (activeActor.InteractionQueue.CanPlayerQueue()) { bool success = false; try { IPhone activePhone = null; if (activeActor.Inventory != null) { activePhone = activeActor.Inventory.Find <IPhone>(); } List <InteractionObjectPair> interactions = new List <InteractionObjectPair>(); bool isServiceAlien = (ths.Household != null) && ths.Household.IsAlienHousehold; if (GameUtils.IsInstalled(ProductVersion.EP8) && !isServiceAlien) { interactions.Add(new InteractionObjectPair(new Mailbox.WriteLoveLetter.Definition(ths.SimDescriptionId), activeActor)); } if (GameUtils.IsInstalled(ProductVersion.EP10)) { interactions.Add(new InteractionObjectPair(new OccultMermaid.SignalMermaid.Definition(ths), activeActor)); } if (ths.CreatedSim != null) { List <InteractionObjectPair> others = ths.CreatedSim.GetAllInteractionsForActor(activeActor); if (others != null) { interactions.AddRange(others); } } if (ths.IsHuman) { if (ths.CreatedSim != null) { interactions.Add(new InteractionObjectPair(CallOver.Singleton, ths.CreatedSim)); } if (activePhone != null) { interactions.Add(new InteractionObjectPair(activePhone.GetCallChatFromRelationPanelDefinition(ths), activePhone)); if (GameUtils.IsInstalled(ProductVersion.EP4)) { interactions.Add(new InteractionObjectPair(activePhone.GetCallPrank(ths), activePhone)); } if (GameUtils.IsInstalled(ProductVersion.EP9)) { interactions.Add(new InteractionObjectPair(activePhone.GetSendChatTextFromRelationPanelDefinition(ths), activePhone)); interactions.Add(new InteractionObjectPair(activePhone.GetSendInsultTextFromRelationPanelDefinition(ths), activePhone)); interactions.Add(new InteractionObjectPair(activePhone.GetSendPictureTextFromRelationPanelDefinition(ths), activePhone)); interactions.Add(new InteractionObjectPair(activePhone.GetSendSecretAdmirerTextFromRelationPanelDefinition(ths), activePhone)); interactions.Add(new InteractionObjectPair(activePhone.GetSendBreakUpTextFromRelationPanelDefinition(ths), activePhone)); if (!sGetSendWooHootyTextDefinition.Valid) { interactions.Add(new InteractionObjectPair(activePhone.GetSendWooHootyTextFromRelationPanelDefinition(ths), activePhone)); } else { InteractionDefinition instance = null; instance = sGetSendWooHootyTextDefinition.Invoke <InteractionDefinition>(new object[] { ths }); interactions.Add(new InteractionObjectPair(instance, activePhone)); } } if ((!ths.IsEnrolledInBoardingSchool() && !ths.IsDroppingOut) && !GameStates.IsEarlyDepartureSim(ths.SimDescriptionId)) { interactions.Add(new InteractionObjectPair(activePhone.GetCallInviteOverFromRelationPanelDefinition(ths, true), activePhone)); interactions.Add(new InteractionObjectPair(activePhone.GetCallInviteToLotFromRelationPanelDefintion(ths), activePhone)); interactions.Add(new InteractionObjectPair(activePhone.GetCallAskOutOnDateFromRelationPanelDefintion(ths), activePhone)); if (!isServiceAlien) { interactions.Add(new InteractionObjectPair(activePhone.GetCallInviteHouseholdOverFromRelationshipPanelDefiniton(ths), activePhone)); } interactions.Add(new InteractionObjectPair(activePhone.GetCallInviteToAttendGraduationFromRelationPanelDefinition(ths), activePhone)); } else { interactions.Add(new InteractionObjectPair(activePhone.GetRemoveFromBoardingSchool(ths), activePhone)); } } } else if (ths.IsPet) { if (ths.CreatedSim != null) { interactions.Add(new InteractionObjectPair(Sim.CallPet.Singleton, ths.CreatedSim)); } if (activePhone != null) { interactions.Add(new InteractionObjectPair(activePhone.GetCallBringPetOverFromRelationshipPanelDefinition(ths), activePhone)); } } if (CelebrityManager.CanSocialize(activeActor.SimDescription, ths)) { Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(ths.CreatedSim, eventArgs, gameObjectHit, interactions, InteractionMenuTypes.Normal); success = true; } } catch (Exception e) { Common.Exception(activeActor.SimDescription, ths, e); } if ((!success) && (ths.CreatedSim != null)) { Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(ths.CreatedSim, eventArgs, gameObjectHit, InteractionsEx.GetImmediateInteractions(ths.CreatedSim), InteractionMenuTypes.Normal); } } else { Vector2 mousePosition; if (eventArgs.DestinationWindow != null) { mousePosition = eventArgs.DestinationWindow.WindowToScreen(eventArgs.MousePosition); } else { mousePosition = eventArgs.MousePosition; } Sims3.Gameplay.UI.PieMenu.ShowGreyedOutTooltip(Common.LocalizeEAString("Gameplay/Abstracts/GameObject:TooManyInteractions"), mousePosition); } } } catch (Exception e) { Common.Exception(ths, e); } }
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); } }