protected override bool Run(SimDescription me, bool singleSelection) { if (!ApplyAll) { if (!AcceptCancelDialog.Show(Common.Localize("CleanTraits:Prompt", me.IsFemale, new object[] { me }))) { return(false); } } if (me.TraitManager != null) { List <Trait> traits = new List <Trait>(me.TraitManager.List); foreach (Trait trait in traits) { me.TraitManager.RemoveTraitEffects(me, trait.Guid); me.TraitManager.RemoveElement(trait.Guid); } me.TraitManager.RewardTraits.Clear(); me.TraitManager.RemoveAllElements(); } return(true); }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt"))) { return(OptionResult.Failure); } // Store for later use List <SimDescription> sims = new List <SimDescription>(GameStates.TravelHousehold.AllSimDescriptions); GameStates.sTravelData = null; WorldData.SetVacationWorld(false, true); WorldName currentWorld = GameUtils.GetCurrentWorld(); foreach (SimDescription sim in sims) { MiniSimDescription miniSim = MiniSimDescription.Find(sim.SimDescriptionId); if (miniSim != null) { miniSim.mHomeWorld = currentWorld; } sim.mHomeWorld = currentWorld; } if (Sim.ActiveActor != null) { (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).OnSimAgeChanged(Sim.ActiveActor.ObjectId); } return(OptionResult.SuccessClose); }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { Common.StringBuilder msg = new Common.StringBuilder(); try { Sim actor = parameters.mActor as Sim; Sim target = parameters.mTarget as Sim; if (!AcceptCancelDialog.Show("You are about to run 'ForceError', proceed?")) { return(OptionResult.Failure); } target.mInteractionQueue = null; } catch (Exception e) { GameHitParameters <GameObject> .Exception(parameters, msg, e); } finally { Common.DebugWriteLog(msg); } return(OptionResult.SuccessClose); }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (AcceptCancelDialog.Show(Common.Localize("DropAllDreams:Prompt"))) { int count = 0; List <Sim> list = new List <Sim>(Sims3.Gameplay.Queries.GetObjects <Sim>()); foreach (Sim sim in list) { if (sim.Household == Household.ActiveHousehold) { continue; } if ((sim.DreamsAndPromisesManager != null) || (sim.OpportunityManager != null)) { sim.NullSelectableSimManagers(); count++; } } SimpleMessageDialog.Show(Name, Common.Localize("DropAllDreams:Result", false, new object[] { count })); } return(OptionResult.SuccessClose); }
protected override OptionResult Run(IActor actor, IMausoleum mausoleum) { Dictionary <SimDescription, Pair <IMausoleum, Urnstone> > urnstones = new Dictionary <SimDescription, Pair <IMausoleum, Urnstone> >(); CommonSpace.Helpers.CleanseTheDead.Retrieve(mausoleum, urnstones); if ((urnstones == null) || (urnstones.Count == 0)) { SimpleMessageDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":Empty")); return(OptionResult.Failure); } Sim sim = actor as Sim; Selection.Results choices = new Selection(Name, sim.SimDescription, urnstones.Keys).SelectMultiple(); if (choices.Count == 0) { return(OptionResult.Failure); } if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt", false, new object[] { choices.Count }))) { return(OptionResult.Failure); } CommonSpace.Helpers.CleanseTheDead.Cleanse(choices, urnstones, false, null); return(OptionResult.SuccessClose); }
public override bool Run() // Run { if (Target.IsInActiveHousehold && Target.Service is GrimReaper) { if (!AcceptCancelDialog.Show("Warning: Remove Sim Family Death Good System or Grim Reaper?")) { return(false); } { if (this.Target.IsActiveSim) // Fix Not Household { //UserToolUtils.OnClose(); LotManager.SelectNextSim(); } Target.SimDescription.Household.Remove(this.Target.SimDescription); Household.NpcHousehold.Add(this.Target.SimDescription); } return(true); } if (!AcceptCancelDialog.Show("Force Request Grim Reaper?")) { return(false); } GrimReaper.Instance.MakeServiceRequest(Target.LotCurrent, true, ObjectGuid.InvalidObjectGuid); return(true); }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt"))) { return(OptionResult.Failure); } foreach (SimDescription sim in Household.AllSimsLivingInWorld()) { if (sim.Household == Household.ActiveHousehold) { if (!Dresser.Settings.mCheckAffectActive) { continue; } } if (Dresser.Settings.IsProtected(sim)) { continue; } Process(sim); } return(OptionResult.SuccessClose); }
protected override bool Run() { Instantiator.pShowerCleaning = !Instantiator.pShowerCleaning; if (Instantiator.pShowerCleaning) { if (AcceptCancelDialog.Show("This action will be applied to the bloody mouth and the body blood. Agree?")) { VTBlood.showeringCleans = true; VTConversion.showeringCleans = true; VTBlood.sShowerListener = EventTracker.AddListener(EventTypeId.kEventTakeShower, new ProcessEventDelegate(VTBlood.OnClean)); VTConversion.sConversionShowerListener = EventTracker.AddListener(EventTypeId.kEventTakeShower, new ProcessEventDelegate(VTConversion.OnClean)); } else { } } else { VTBlood.showeringCleans = false; VTConversion.showeringCleans = false; EventTracker.RemoveListener(VTBlood.sShowerListener); EventTracker.RemoveListener(VTConversion.sConversionShowerListener); } return(true); }
protected override void OnPerform() { LoopingAnimationBase interaction = mInteractionInstance as LoopingAnimationBase; string value = StringInputDialog.Show(Common.Localize("Timing:MenuName"), Common.Localize("Timing:Prompt", interaction.TargetSim.IsFemale, new object[] { interaction.TargetSim }), interaction.Timing.ToString()); if (string.IsNullOrEmpty(value)) { return; } float timing = 0; if (!float.TryParse(value, out timing)) { AcceptCancelDialog.Show(Common.Localize("Numeric:Error")); return; } if (timing < 0) { timing = 0; } interaction.Timing = timing; mTone.mTiming = timing; Sims3.UI.Hud.InteractionQueue.Instance.UpdateQueueFull(); }
public override bool Run() { try { if (!AcceptCancelDialog.Show(Common.Localize("DeleteInventory:Prompt", false, new object[] { Target.CatalogName, Target.Inventory.AmountIn <GameObject>() }))) { return(false); } foreach (GameObject obj in Inventories.QuickFind <GameObject>(Target.Inventory)) { try { Target.Inventory.RemoveByForce(obj); obj.Destroy(); } catch (Exception e) { Common.Exception(Target, obj, e); } } } catch (Exception exception) { Common.Exception(Actor, Target, exception); } return(true); }
protected override bool PrivatePerform() { if (!base.PrivatePerform()) { return(false); } if (AcceptCancelDialog.Show(Localize("Prompt", new object[] { DisplayValue }))) { List <IAlertLevelOption> allOptions = new List <IAlertLevelOption>(); Manager.GetOptions(allOptions, false, UpdatesOnAll); foreach (IAlertLevelOption option in allOptions) { option.SetValue(Value); } } if (Value == AlertLevel.None) { Manager.Stories.Clear(); } return(true); }
protected override bool Run(SimDescription me, bool singleSelection) { if (!ApplyAll) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt", me.IsFemale, new object[] { me }))) { return(false); } } if (me.IsPregnant) { me.CreatedSim.RemoveAlarm(me.Pregnancy.PreggersAlarm); me.Pregnancy.PreggersAlarm = AlarmHandle.kInvalidHandle; if (me.IsHuman) { me.Pregnancy.PreggersAlarm = me.CreatedSim.AddAlarmRepeating(1f, TimeUnit.Hours, me.Pregnancy.HourlyCallback, 1f, TimeUnit.Hours, "Hourly Human Pregnancy Update Alarm", AlarmType.AlwaysPersisted); } else { me.Pregnancy.PreggersAlarm = me.CreatedSim.AddAlarmRepeating(1f, TimeUnit.Hours, me.Pregnancy.HourlyCallback, 1f, TimeUnit.Hours, "Hourly Pet Pregnancy Update Alarm", AlarmType.AlwaysPersisted); } } return(true); }
public override bool Run() // Run { if (Target.Service is GrimReaper) { if (!AcceptCancelDialog.Show("Warning: Add Active Family " + Target.Name + "?")) { return(false); } { if (Target.SimDescription.Household != null) { Target.SimDescription.Household.Remove(this.Target.SimDescription); } Household.ActiveHousehold.AddSim(this.Target); this.Target.RequestWalkStyle(Sim.WalkStyle.DeathWalk); //GrimReaper.kDelayBeforeLeaving = uint.MaxValue; //GrimReaper.kCheckTime = uint.MaxValue; } return(true); } if (Target.SimDescription.Household != null) { Target.SimDescription.Household.Remove(this.Target.SimDescription); } Household.ActiveHousehold.AddSim(this.Target); return(true); }
protected override bool Run(SimDescription me, bool singleSelection) { if (!ApplyAll) { if (!AcceptCancelDialog.Show(Common.Localize("DropOpponents:Prompt", me.IsFemale, new object[] { me }))) { return(false); } } LogicSkill logic = me.SkillManager.GetSkill <LogicSkill>(SkillNames.Logic); if (logic != null) { logic.mChessRankingNextChallenger = null; } MartialArts martial = me.SkillManager.GetSkill <MartialArts>(SkillNames.MartialArts); if (martial != null) { martial.mTournamentChallenger = 0; } return(true); }
public override bool ManualSetup(StoryProgressionObject manager) { if (!base.ManualSetup(manager)) { return(false); } int originalID = Scenarios.TrackingID; Scenarios.TrackingID = ID; SimSelection sim = new SimSelection(this); try { if (!sim.Perform()) { if (!AcceptCancelDialog.Show(Common.Localize("FireScenario:ApplyAll"))) { return(false); } } Scenarios.WriteTrack(false); } finally { Scenarios.TrackingID = originalID; } Sim = sim.SimDescription; return(true); }
protected override bool Run(SimDescription me, bool singleSelection) { if (!ApplyAll) { if (MasterController.Settings.SkillStamps.Count == 1) { if (!AcceptCancelDialog.Show(Common.Localize("SkillStamp:Prompt", me.IsFemale, new object[] { me }))) { return(false); } mChoice = MasterController.Settings.SkillStamps[0]; } else { List <Item> allOptions = new List <Item>(); foreach (SkillStamp stamp in MasterController.Settings.SkillStamps) { allOptions.Add(new ApplySkillStamp.Item(stamp)); } Item choice = new CommonSelection <ApplySkillStamp.Item>(Name, allOptions).SelectSingle(); if (choice == null) { return(false); } mChoice = choice.mStamp; } } foreach (KeyValuePair <SkillNames, int> skill in mChoice.Skills) { if (me.SkillManager.GetSkillLevel(skill.Key) > skill.Value) { continue; } Skill mySkill = me.SkillManager.GetElement(skill.Key); if ((mySkill == null) && (skill.Value >= 0)) { mySkill = me.SkillManager.AddElement(skill.Key); } if (mySkill != null) { try { mySkill.ForceSkillLevelUp(skill.Value); } catch (Exception e) { Common.Exception(me, null, "Skill: " + skill.Key, e); } } } return(true); }
public override bool Run() // Run { if (Autonomous || Actor.IsNPC || !Actor.IsInActiveHousehold) { return(false); } if (!AcceptCancelDialog.Show("Are You Sure All Pause?")) { return(false); } List <Sim> list = new List <Sim>(); foreach (Sim sim in LotManager.Actors) { if (!sim.IsInActiveHousehold && !(sim.Service is GrimReaper)) { list.Add(sim); } } if (list.Count > 0) { foreach (Sim nlist in list) { try { nlist.EnableInteractions(); nlist.InteractionQueue.Add(AllPauseNiecDone.Singleton.CreateInstance(nlist, nlist, new InteractionPriority((InteractionPriorityLevel)999, 999f), isAutonomous: false, cancellableByPlayer: false)); } catch (Exception exception) { NiecException.PrintMessage(exception.Message + NiecException.NewLine + exception.StackTrace); try { nlist.InteractionQueue.CancelAllInteractions(); } catch { } return(true); } /* * finally * { * try * { * nlist.InteractionQueue.CancelAllInteractions(); * } * catch (Exception exception) * { * NiecException.PrintMessage(exception.Message + NiecException.NewLine + exception.StackTrace); * nlist.EnableInteractions(); * nlist.InteractionQueue.Add(AllPauseNiecDone.Singleton.CreateInstance(nlist, nlist, new InteractionPriority((InteractionPriorityLevel)999, 999f), isAutonomous: false, cancellableByPlayer: false)); * } * } * */ } } return(true); }
public override bool Run() { if (AcceptCancelDialog.Show(Common.Localize("TestUntranslatedKey:Prompt"))) { Target.mInteractionQueue.mInteractionList.Add(null); } return(true); }
public override bool Run() { try { bool success = false; Actor.SynchronizationLevel = Sim.SyncLevel.NotStarted; Target.SynchronizationLevel = Sim.SyncLevel.NotStarted; if (BeginSocialInteraction(new SocialInteractionB.Definition(null, Localization.LocalizeString(Actor.IsFemale, "Gameplay/Excel/Socializing/Action:BeAskedToMoveIn", new object[0x0]), false), false, true)) { BeginCommodityUpdates(); mCurrentStateMachine = StateMachineClient.Acquire(Simulator.CurrentTask, "social_AskFor"); mCurrentStateMachine.SetActor("x", Actor); mCurrentStateMachine.SetActor("y", Target); mCurrentStateMachine.EnterState("x", "Enter"); mCurrentStateMachine.EnterState("y", "Enter"); if (AcceptCancelDialog.Show(Localization.LocalizeString("Gameplay/Moving:MoveInPrompt", new object[] { Target, Actor }))) { mCurrentStateMachine.RequestState(false, "y", "Friendly"); mCurrentStateMachine.RequestState(true, "x", "Friendly"); if (!MovingSituation.MovingInProgress) { // Custom using (GameplayMovingModelEx.ProtectFunds protect = new GameplayMovingModelEx.ProtectFunds(Target.Household)) { MovingDialogEx.Show(new GameplayMovingModelEx(Target, Actor.Household)); } } } else { mCurrentStateMachine.RequestState(false, "y", "Neutral"); mCurrentStateMachine.RequestState(true, "x", "Neutral"); Actor.SocialComponent.OnMoveInRequestRejected(); } if (Actor.Household != Target.Household) { Actor.SocialComponent.OnMoveInRequestRejected(); } success = true; EndCommodityUpdates(true); } Actor.ClearSynchronizationData(); return(success); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
protected override OptionResult Run(Lot lot, Household house) { if ((lot == null) && (house == null)) { Common.Notify(Common.Localize("ResetLot:NoLot")); return(OptionResult.Failure); } else if (!ApplyAll) { string name = null; if (lot != null) { name = lot.Name; if (string.IsNullOrEmpty(name)) { name = lot.Address; } } else { name = house.Name; } if (!AcceptCancelDialog.Show(Common.Localize("ResetLot:Prompt", false, new object[] { name }))) { return(OptionResult.Failure); } } if (lot != null) { List <IGameObject> objects = new List <IGameObject>(lot.GetObjects <IGameObject>()); foreach (IGameObject obj in objects) { ResetObject(obj, false); if (lot.Household != null) { UniqueObject uniqueObj = obj as UniqueObject; if (uniqueObj != null) { lot.Household.UniqueObjectsObtained |= uniqueObj.SpawnedObjectKey; } } } ResetLot(lot, false); } else { ResetHousehold(house, false); } Common.Notify(Common.Localize("ResetLot:Success")); return(OptionResult.SuccessClose);; }
protected override OptionResult RunAll(List <IMiniSimDescription> sims) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt", false, new object[] { sims.Count }))) { return(OptionResult.Failure); } return(Households.AddSim.Perform(Household.ActiveHousehold.LotHome, Household.ActiveHousehold, sims)); }
public override bool Run() { StandardEntry(); if (!Target.StartComputing(this, SurfaceHeight.Table, true)) { StandardExit(); return(false); } Target.StartVideo(Computer.VideoType.WordProcessor); BeginCommodityUpdates(); bool succeeded = false; try { Definition interactionDefinition = InteractionDefinition as Definition; mJob = Actor.OccupationAsCareer; if (interactionDefinition.Scrap) { AnimateSim("WorkTyping"); string name = (OmniCareer.Career <Journalism>(mJob) != null) ? "ScrapStoryWarning" : "ScrapReportWarning"; if (AcceptCancelDialog.Show(Computer.LocalizeString(name, new object[] { mJob.GetCurrentReportSubject() }))) { base.AnimateSim("WorkTyping"); mJob.SetReportSubject(null); } EndCommodityUpdates(true); Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); StandardExit(); return(true); } if (!interactionDefinition.IsContinuing) { Sim selectedObject = base.GetSelectedObject() as Sim; mJob.SetReportSubject(selectedObject.SimDescription); Journalism job = OmniCareer.Career <Journalism>(mJob); if (job != null) { job.IsStoryNegative = interactionDefinition.IsNegativeReport; } } ProgressMeter.ShowProgressMeter(Actor, mJob.GetCurrentReportCompletion() / 100f, ProgressMeter.GlowType.Weak); AnimateSim("WorkTyping"); succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), new Interaction <Sim, Computer> .InsideLoopFunction(LoopDel), null, 1f); ProgressMeter.HideProgressMeter(Actor, succeeded); } finally { EndCommodityUpdates(succeeded); } Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); StandardExit(); return(succeeded); }
protected override bool PrivatePerform() { if (!AcceptCancelDialog.Show(Localize("Prompt"))) { return(false); } StoryProgression.Reset(); return(true); }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (!AcceptCancelDialog.Show(Common.Localize("ResetSettings:Prompt"))) { return(OptionResult.Failure); } MasterController.ResetSettings(); return(OptionResult.SuccessClose); }
protected override OptionResult Run(GameHitParameters <Sim> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt", parameters.mTarget.IsFemale, new object[] { parameters.mTarget }))) { return(OptionResult.Failure); } CheckOutfitTask.Controller.AddToQueue(parameters.mTarget.SimDescription, CheckOutfitTask.ProcessOptions.Hair | CheckOutfitTask.ProcessOptions.CurrentOutfit); return(OptionResult.SuccessRetain); }
protected override OptionResult Run(GameHitParameters <Sim> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt", parameters.mTarget.IsFemale, new object[] { parameters.mTarget }))) { return(OptionResult.Failure); } CheckOutfitTask.Controller.AddToQueue(parameters.mTarget.SimDescription, CheckOutfitTask.ProcessOptions.Invalid | CheckOutfitTask.ProcessOptions.Accessories | CheckOutfitTask.ProcessOptions.Makeup | CheckOutfitTask.ProcessOptions.BodyHair | CheckOutfitTask.ProcessOptions.Beard | CheckOutfitTask.ProcessOptions.WriteLog); return(OptionResult.SuccessClose); }
protected bool PerformApplyAll(string title, ICollection <IMiniSimDescription> sims, List <IMiniSimDescription> results) { if ((!PromptToApplyAll()) || (AcceptCancelDialog.Show(Common.Localize("SimSelection:Prompt", false, new object[] { title, sims.Count })))) { results.AddRange(sims); return(true); } return(false); }
protected override bool Run(SimDescription me, SimPersonality personality) { if (!AcceptCancelDialog.Show(Common.Localize("RemoveLeader:Prompt", personality.IsFemaleLocalization(), me.IsFemale, new object[] { personality.GetLocalizedName(), me }))) { return(false); } personality.SetLeader(null, true); return(true); }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt"))) { return(OptionResult.Failure); } Register.ResetSettings(); return(OptionResult.SuccessRetain); }
protected override bool PrivatePerform() { if (!AcceptCancelDialog.Show(Localize("Prompt"))) { return(false); } NRaas.StoryProgression.Main.SetValue <AcountingOption, AccountingData>(Manager.House, new AccountingData()); return(true); }