private void OnShowActorEx(StateMachineClient smc, IEvent evt) { if (mFairy != null) { OccultFairyEx.ShowHumanAndHideTrueForm(mFairy); } Actor.AddExitReason(ExitReason.Finished); }
public new void LoopDel(StateMachineClient smc, Interaction<Sim, Computer>.LoopData loopData) { Journalism job = OmniCareer.Career<Journalism>(Actor.Occupation); Definition def = InteractionDefinition as Definition; if (job.UpdateReview(def.Review)) { Actor.AddExitReason(ExitReason.Finished); } }
private void OnShowActorEx(StateMachineClient smc, IEvent evt) { if (mActorFairy != null) { OccultFairyEx.ShowHumanAndHideTrueForm(mActorFairy); } else { Actor.SetOpacity(1f, 0f); } }
public void SnapOnExit(StateMachineClient sender, IEvent evt) { Vector3 forwardVector = Actor.ForwardVector; // Quaternion val = Quaternion.MakeFromEulerAngles(0f, MathF.PI, 0f); TODO: It can't find MathF, not sure why. Don't want to deal. Quaternion val = Quaternion.MakeFromEulerAngles(0f, 3.14159274f, 0f); Matrix44 val2 = val.ToMatrix(); forwardVector = val2.TransformVector(forwardVector); Actor.SetPosition(Actor.Position + 0.283f * forwardVector); Vector3 position = Actor.Position; position.y = World.GetTerrainHeight(position.x, position.z); Actor.SetPosition(position); Actor.SetForward(forwardVector); }
public static bool PerformAnimation(Sim actor, OnPerform onPerform) { IGameObject obj2 = actor.Inventory.SetInUse(typeof(MagicWand), TestFunction, typeof(MagicWand)); actor.CarryStateMachine = StateMachineClient.Acquire(actor.Proxy.ObjectId, "wand"); actor.CarryStateMachine.SetActor("x", actor); actor.CarryStateMachine.EnterState("x", "Cast Spell - Practice"); Simulator.Sleep(0x23); bool result = onPerform(); Simulator.Sleep(0x41); actor.Inventory.SetNotInUse(obj2); return(result); }
protected new void LoopDelegate(StateMachineClient smc, Interaction <Sim, RabbitHole> .LoopData loopData) { try { mCareer.WhileWorking(); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
protected override bool Run() { StateMachineClient client = StateMachineClient.Acquire(base.Actor, "single_animation"); client.SetActor("x", base.Actor); client.EnterState("x", "Enter"); Definition interactionDefinition = base.InteractionDefinition as Definition; if (Sim.AnimationClipDataForCAS.SimCanPlayAnimation(base.Actor, interactionDefinition.ClipName)) { client.SetParameter("AnimationClip", interactionDefinition.ClipName); client.RequestState("x", "Animate"); client.RequestState(false, "x", "Enter"); } return(true); }
// Methods public new void EventCallbackExcavate(StateMachineClient sender, IEvent evt) { try { mFoundLast = Target.NumTreasuresRemaining == 0x1; ExcavateSomething(Target, this); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
public override bool Run() { this.mClothingPile = this.Actor.GetObjectInRightHand() as ClothingPileWet; if (mClothingPile == null) { ClothingPileWet closestObject1 = GlobalFunctions.GetClosestObject <ClothingPileWet>((IEnumerable <ClothingPileWet>) this.Target.LotCurrent.GetObjects <ClothingPileWet>(), (IGameObject)this.Target); if (closestObject1 != null) { this.Actor.InteractionQueue.PushAsContinuation(ClothingPileWet.DryClothesInDryer.Singleton, (IGameObject)closestObject1, true); return(true); } WashingMachine closestObject2 = GlobalFunctions.GetClosestObject <WashingMachine>((IEnumerable <WashingMachine>) this.Target.LotCurrent.GetObjects <WashingMachine>(), (IGameObject)this.Target, new Predicate <WashingMachine>(WashingMachineDoLaundryEx.IsWashingDone)); if (closestObject2 != null) { this.Actor.InteractionQueue.PushAsContinuation(WashingMachine.DryClothesInDryer.Singleton, (IGameObject)closestObject2, true); return(true); } return(false); } if (!this.Target.RouteToDryerAndCheckInUse((InteractionInstance)this) || this.Target.CurDryerState != Dryer.DryerState.Empty) { CarrySystem.PutDownOnFloor(this.Actor, new SacsEventHandler(this.OnPutdownAnimationEvent), 102U); return(false); } this.StandardEntry(); this.Target.mDryerStateMachine = StateMachineClient.Acquire((IHasScriptProxy)this.Target, "dryer"); StateMachineClient dryerStateMachine = this.Target.mDryerStateMachine; dryerStateMachine.SetActor("x", (IHasScriptProxy)this.Actor); dryerStateMachine.SetActor("clothesBag", (IHasScriptProxy)this.mClothingPile); dryerStateMachine.SetActor("dryer", (IHasScriptProxy)this.Target); dryerStateMachine.EnterState("x", "Enter"); dryerStateMachine.EnterState("dryer", "Enter"); dryerStateMachine.AddPersistentScriptEventHandler(0U, new SacsEventHandler(this.OnAnimationEvent)); this.BeginCommodityUpdates(); CarrySystem.ExitAndKeepHolding(this.Actor); dryerStateMachine.RequestState(false, "dryer", "Start Dryer"); dryerStateMachine.RequestState(true, "x", "Start Dryer"); this.EndCommodityUpdates(true); dryerStateMachine.RequestState(false, "dryer", "Loop Operate"); dryerStateMachine.RequestState(true, "x", "Exit Add Clothes"); Punishment.ApplyAbsolvingActionToSim(this.Actor, Punishment.AbsolvingActionType.DoingLaundry); this.StandardExit(); return(true); }
protected override bool Run() { StateMachineClient client = StateMachineClient.Acquire(base.Actor, "single_looping_animation"); client.SetActor("x", base.Actor); client.EnterState("x", "EnterExit"); Definition interactionDefinition = base.InteractionDefinition as Definition; if (Sim.AnimationClipDataForCAS.SimCanPlayAnimation(base.Actor, interactionDefinition.ClipName)) { client.SetParameter("AnimationClip", interactionDefinition.ClipName); client.RequestState("x", "Animate"); base.DoLoop(~(ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)); client.RequestState("x", "EnterExit"); return(true); } return(false); }
private void LearnLoop(StateMachineClient smc, InteractionInstance.LoopData data) { try { if (data.mLifeTime > 30) { Actor.AddExitReason(ExitReason.Finished); } } catch (ResetException) { throw; } catch (Exception exception) { Common.Exception(Actor, Target, exception); } }
public override bool Run() { // Switch out the state machine used by CarryingChildPosture to my custom one StateMachineClient feedMachine = AcquireBreastfeedStateMachine(Actor, Target); ChildUtils.StartCarry(Actor, Target, feedMachine, false); SocialInteractionB interactionB = new CarriedChildInteractionB.Definition("BeGivenBottle") .CreateInstance(Actor, Target, GetPriority(), EffectivelyAutonomous, CancellableByPlayer) as SocialInteractionB; if (!ChildUtils.StartInteractionWithCarriedChild(this, interactionB)) { return(false); } BeginCommodityUpdates(); if (Loader.kEnableBreastFeedCensor) { mCensorEnabled = true; Actor.EnableCensor(CensorType.FullBody); } Actor.CarryingChildPosture.AnimateInteractionWithCarriedChild("Nurse"); Actor.CarryingChildPosture.AnimateInteractionWithCarriedChild("Exit"); Target.Motives.SetMax(CommodityKind.Hunger); Actor.GetRelationship(Target, true).LTR.UpdateLiking(kLTRIncreaseFromNursing); EndCommodityUpdates(true); ApplyBuffs(); DoPostFeed(); FinishLinkedInteraction(); WaitForSyncComplete(3); // Not sure why the ChildUtils finish method did not work here. // Restore the EA's child carry state machine (JAZZ script "CarryToddler") StateMachineClient carryMachine = ChildUtils.AcquireCarryStateMachine(Actor, Target); ChildUtils.StartCarry(Actor, Target, carryMachine, false); Cleanup(); return(true); }
public override bool Run() { List <ObjectListPickerInfo> Entries = ListExpressions(); string text = (string)ObjectListPickerDialog.Show("Expression", Entries); if (text != null && text != "") { ReactionTypes reaction = (ReactionTypes)Enum.Parse(typeof(ReactionTypes), text); Array reactionTypes = Enum.GetValues(typeof(ReactionTypes)); CustomOverlayData data = null; CmoPoseBox box = PoseManager.FindPoseBox(); string poseData = PoseManager.GetCurrentPose(Actor); if (poseData == null) { return(false); } Actor.LookAtManager.DisableLookAts(); PoseManager.SetCurrentPose(Actor, poseData); box.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, poseData, true, ProductVersion.BaseGame); Actor.ResetAllAnimation(); Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayFace);//OverlayUpperbody); StateMachineClient stateMachineClient = StateMachineClient.Acquire(Actor.ObjectId, "facial_idle", AnimationPriority.kAPDefault, true); data = (CustomOverlayData)OverlayComponent.GetOverlayData(reaction, Actor); stateMachineClient.UseActorBridgeOrigins = false; stateMachineClient.SetActor("x", Actor); stateMachineClient.RemoveEventHandler(new SacsEventHandler(Actor.OverlayComponent.InteractionPartLevelCallback)); stateMachineClient.RemoveEventHandler(new SacsEventHandler(Actor.OverlayComponent.ClearInteractionPartLevelCallback)); stateMachineClient.EnterState("x", "Enter"); stateMachineClient.SetProductVersion(data.ProductVersion); stateMachineClient.RequestState("x", data.AnimClipName); //Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayFace); box.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, poseData, true, ProductVersion.BaseGame); Actor.ResetAllAnimation(); Actor.WaitForExitReason(3.40282347E+38f, ExitReason.UserCanceled); Actor.LookAtManager.EnableLookAts(); return(true); } return(false); }
private void WaitPeriodLoop(StateMachineClient smc, InteractionInstance.LoopData loopData) { if (mBegin) { Actor.AddExitReason(ExitReason.StageComplete); } else { Sim actor = LinkedInteractionInstance.InstanceActor; if ((actor == null) || (actor.HasBeenDestroyed)) { Actor.AddExitReason(ExitReason.StageComplete); } else if (!actor.InteractionQueue.HasInteraction(LinkedInteractionInstance)) { Actor.AddExitReason(ExitReason.StageComplete); } } }
private void OnBabyCheckEventEx(StateMachineClient smc, IEvent evt) { try { ISaunaWooHooDefinition definition = InteractionDefinition as ISaunaWooHooDefinition; if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this))) { Pregnancy pregnancy = CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this)); if (pregnancy != null) { switch (RandomUtil.GetWeightedIndex(SaunaClassic.kBabyTraitChance)) { case 1: pregnancy.SetForcedBabyTrait(TraitNames.Hydrophobic); break; case 2: pregnancy.SetForcedBabyTrait(TraitNames.PartyAnimal); break; } Audio.StartSound("sting_baby_conception"); if (definition.TryingFor == TryingFor.TryForBoy) { pregnancy.mGender = CASAgeGenderFlags.Male; } else if (definition.TryingFor == TryingFor.TryForGirl) { pregnancy.mGender = CASAgeGenderFlags.Female; } } } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
// Token: 0x0600A7E4 RID: 42980 RVA: 0x002FB840 File Offset: 0x002FA840 private void EventCallbackCreateAshPile(StateMachineClient sender, IEvent evt) { this.mAshPile = (GlobalFunctions.CreateObjectOutOfWorld("AshPile") as AshPile); if (this.Actor.SimDescription.IsMummy || this.Actor.SimDescription.DeathStyle == SimDescription.DeathType.MummyCurse) { this.mAshPile.SetMaterial("mummy"); } this.mAshPile.AddToWorld(); this.mAshPile.SetPosition(this.Actor.Position); this.mAshPile.SetTooltipText(this.Actor.SimDescription.FirstName + " " + this.Actor.SimDescription.LastName); LotLocation invalid = LotLocation.Invalid; World.GetLotLocation(this.mAshPile.Position, ref invalid); FireManager.BurnTile(this.mAshPile.LotCurrent.LotId, invalid); SimDescription.DeathType deathStyle = this.Actor.SimDescription.DeathStyle; float fadeTime = (deathStyle == SimDescription.DeathType.MummyCurse || deathStyle == SimDescription.DeathType.Thirst) ? 1.2f : GameObject.kGlobalObjectFadeTime; this.Actor.FadeOut(false, false, fadeTime); }
public void PlayFaceoffAnims(bool reverseRoles) { Sim sim = Actor; Sim sim2 = Target; if (reverseRoles) { sim = Target; sim2 = Actor; } mCurrentStateMachine = StateMachineClient.Acquire(sim, "ChaseMean", AnimationPriority.kAPDefault); mCurrentStateMachine.SetActor("x", sim); mCurrentStateMachine.SetActor("y", sim2); mCurrentStateMachine.EnterState("x", "Enter"); mCurrentStateMachine.EnterState("y", "Enter"); BeginCommodityUpdates(); AnimateJoinSims("Face Off"); AnimateJoinSims("Exit"); EndCommodityUpdates(succeeded: true); }
public void LoopFunc(StateMachineClient smc, LoopData ld) { if (ld.mLifeTime > kWatchPlantMaxTime) { Actor.AddExitReason(ExitReason.Finished); return; } ThoughtBalloonManager.BalloonData balloonData = new ThoughtBalloonManager.BalloonData(Target.GetThumbnailKey()); balloonData.BalloonType = ThoughtBalloonTypes.kThoughtBalloon; balloonData.mPriority = ThoughtBalloonPriority.Low; balloonData.mFlags = ThoughtBalloonFlags.ShowIfSleeping; Actor.ThoughtBalloonManager.ShowBalloon(balloonData); AcquireStateMachine("catdoginvestigate"); EnterStateMachine("catdoginvestigate", "Enter", "x"); AnimateSim("Investigate"); AnimateSim("Exit"); ReactionTypes reactionType = kReactionList[RandomUtil.GetInt(kReactionList.Length - 1)]; Actor.PlayReaction(reactionType, ReactionSpeed.ImmediateWithoutOverlay); }
protected override bool Run() { StateMachineClient client = StateMachineClient.Acquire(base.Actor, "single_animation"); client.SetActor("x", base.Actor); client.EnterState("x", "Enter"); Definition interactionDefinition = base.InteractionDefinition as Definition; Sim.AnimationClipDataForCAS[] rcasArray = (interactionDefinition.MenuText == "Full Body Animation Suite") ? Sim.AnimationClipDataForCAS.sCasAnimations["CasFullBodyAnimations"] : Sim.AnimationClipDataForCAS.sCasAnimations["CasFaceAnimations"]; foreach (Sim.AnimationClipDataForCAS rcas in rcasArray) { if (Sim.AnimationClipDataForCAS.SimCanPlayAnimation(base.Actor, rcas.AnimationClipName)) { client.SetParameter("AnimationClip", rcas.AnimationClipName); client.RequestState("x", "Animate"); client.RequestState(false, "x", "Enter"); } } return(true); }
// Token: 0x06006FBA RID: 28602 RVA: 0x0026CE70 File Offset: 0x0026BE70 public void EventCallbackResurrectSimDeathFlower(StateMachineClient sender, IEvent evt) { EventTracker.SendEvent(EventTypeId.kGotSavedByDeathFlower, this.Target); this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.DeathFlowerPostEvent; if (GrimReaperSituation.ShouldDoDeathEvent(this.Target)) { StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Gameplay/Services/GrimReaper:DeathFlower1", new object[] { this.Target }), this.Actor.ObjectId, StyledNotification.NotificationStyle.kSimTalking); StyledNotification.Show(format); } ThoughtBalloonManager.BalloonData balloonData = new ThoughtBalloonManager.BalloonData(this.mDeathFlower.GetThoughtBalloonThumbnailKey()); balloonData.mPriority = ThoughtBalloonPriority.High; balloonData.Duration = ThoughtBalloonDuration.Medium; balloonData.mCoolDown = ThoughtBalloonCooldown.Medium; balloonData.LowAxis = ThoughtBalloonAxis.kLike; this.Actor.ThoughtBalloonManager.ShowBalloon(balloonData); this.EventCallbackResurrectSim(); }
// Methods public new void DigThroughLoopCallback(StateMachineClient smc, Interaction <Sim, JunkPile> .LoopData ld) { try { EventTracker.SendEvent(EventTypeId.kLootAJunkPile, Actor, Target); if (!Autonomous) { int numScraps = 0x1; InventingSkill skill = Actor.SkillManager.GetSkill <InventingSkill>(SkillNames.Inventing); if ((skill != null) && skill.OppTheScrapperCompleted) { numScraps += (int)Math.Ceiling((double)(numScraps * InventingSkill.kTheScraperScrapMultiplier)); } ScrapInitParameters initData = new ScrapInitParameters(numScraps); Scrap scrap = GlobalFunctions.CreateObject("scrapPile", ProductVersion.EP2, Vector3.Origin, 0x0, Vector3.UnitZ, null, initData) as Scrap; if (Inventories.TryToMove(scrap, Actor)) { mScrapCollected++; } Target.DecrementScrapAmount(); if (Target.IsEmpty) { Actor.AddExitReason(ExitReason.Finished); } } else { Actor.AddExitReason(ExitReason.Finished); } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
// Methods public new void DigThroughLoopCallback(StateMachineClient smc, Interaction<Sim, JunkPile>.LoopData ld) { try { EventTracker.SendEvent(EventTypeId.kLootAJunkPile, Actor, Target); if (!Autonomous) { int numScraps = 0x1; InventingSkill skill = Actor.SkillManager.GetSkill<InventingSkill>(SkillNames.Inventing); if ((skill != null) && skill.OppTheScrapperCompleted) { numScraps += (int) Math.Ceiling((double) (numScraps * InventingSkill.kTheScraperScrapMultiplier)); } ScrapInitParameters initData = new ScrapInitParameters(numScraps); Scrap scrap = GlobalFunctions.CreateObject("scrapPile", ProductVersion.EP2, Vector3.Origin, 0x0, Vector3.UnitZ, null, initData) as Scrap; if (Inventories.TryToMove(scrap, Actor)) { mScrapCollected++; } Target.DecrementScrapAmount(); if (Target.IsEmpty) { Actor.AddExitReason(ExitReason.Finished); } } else { Actor.AddExitReason(ExitReason.Finished); } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
private new void GiveBirthLoopFunc(StateMachineClient smc, InteractionInstance.LoopData loopData) { try { if (!bHasSpawnedOffspring && (loopData.mLifeTime > kDistressLengthBeforeSpawnNewborns)) { bHasSpawnedOffspring = true; // Custom call SpawnOffspring(); } if (loopData.mLifeTime > kDistressTotalLength) { Actor.AddExitReason(ExitReason.Finished); } } catch (Exception e) { Common.Exception(Actor, Target, e); } }
public override void OnReset() { try { if (mSMC != null) { mSMC.Dispose(); mSMC = null; } if (mPortal != null) { if (mCurrentlyRoutingSim != null) { mPortal.RemoveFromUseList(mCurrentlyRoutingSim); } } if ((mCurrentlyRoutingSim != null) && (!mCurrentlyRoutingSim.HasBeenDestroyed)) { mCurrentlyRoutingSim.SetHiddenFlags(HiddenFlags.Nothing); AncientPortal targetPortal = null; if (sTargetPortals.TryGetValue(mCurrentlyRoutingSim, out targetPortal)) { targetPortal.RemoveFromUseList(mCurrentlyRoutingSim); targetPortal.DisableFootprint(AncientPortal.CatchABeam.FootprintPlacementHash); } } mCurrentlyRoutingSim = null; base.OnReset(); } catch (Exception e) { Common.Exception(Owner, e); } }
public static StateMachineClient CreateStateMachine(Sim s, HarvestPlant p, out Soil dummyIk) { dummyIk = Soil.Create(isDummyIk: true); StateMachineClient val = StateMachineClient.Acquire(s, "petgardening"); //dummyIk.SetHiddenFlags(HiddenFlags.Nothing); dummyIk.SetPosition(p.GetSoil().Position); Vector3 forward = p.GetSoil().Position - s.Position; dummyIk.SetForward(forward); dummyIk.AddToWorld(); val.SetActor("x", s); val.SetActor("gardenPlantBush", p); val.SetActor("gardenSoil", p.GetSoil()); val.SetActor("Dummy", dummyIk); if (!p.PlantDef.GetPlantHeight(out PlantHeight height)) { height = PlantHeight.Medium; } val.SetParameter("Plant Height", height); return(val); }
public new bool DoHarvest() { Target.RemoveHarvestStateTimeoutAlarm(); StandardEntry(); BeginCommodityUpdates(); Soil dummyIk; // Todo: Fix state machine StateMachineClient stateMachine = Target.GetStateMachine(Actor, out dummyIk); mDummyIk = dummyIk; bool hasHarvested = true; if (stateMachine != null) { stateMachine.RequestState("x", "Loop Harvest"); } Plant.StartStagesForTendableInteraction(this); while (!Actor.WaitForExitReason(Sim.kWaitForExitReasonDefaultTime, ExitReason.Default)) { if (base.ActiveStage != null && base.ActiveStage.IsComplete((InteractionInstance)this)) { Actor.AddExitReason(ExitReason.StageComplete); } } Plant.PauseTendGardenInteractionStage(Actor.CurrentInteraction); if (Actor.HasExitReason(ExitReason.StageComplete)) { Target.DoHarvest(Actor, hasHarvested, mBurglarSituation); } if (stateMachine != null) { stateMachine.RequestState("x", "Exit Standing"); } EndCommodityUpdates(succeeded: true); StandardExit(); Plant.UpdateTendGardenTimeSpent(this, SetHarvestTimeSpent); return(Actor.HasExitReason(ExitReason.StageComplete)); }
private new void LoopDel(StateMachineClient smc, Interaction <Sim, Computer> .LoopData loopData) { try { base.LoopDel(smc, loopData); if (SimClock.CurrentTime() > mStart) { Actor.AddExitReason(ExitReason.Finished); } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); Actor.AddExitReason(ExitReason.Finished); } }
private bool StartCookingProcessWithFoodTray(string menuText, string[] menuPath, Recipe.MealDestination destination, Recipe.MealQuantity quantity, Recipe.MealRepetition repetition) { List <Ingredient> ingredientsUsed = new List <Ingredient>(); if (!this.Actor.IsNPC && !AniRecipe.UseUpIngredientsFrom(this.ChosenRecipe, this.Actor, ref ingredientsUsed, quantity, false)) { return(false); } this.Actor.SkillManager.AddElement(SkillNames.Cooking); FoodTray foodTray = (FoodTray)GlobalFunctions.CreateObject("FoodTray", Vector3.OutOfWorld, 0, Vector3.UnitZ); foodTray.CookingProcess = new CookingProcess(this.ChosenRecipe, ingredientsUsed, this.Target, this.Target.LotCurrent, destination, quantity, repetition, menuText, menuPath, foodTray, this.Actor); foodTray.CreateFoodProp(Slots.Hash("Slot_0"), foodTray.CookingProcess.Recipe.ModelsAndMaterials.GrillModel_FoodTray); CookingProcess.MoveToNextStep(foodTray, this.Actor); CookingProcess.MoveToNextStep(foodTray, this.Actor); CookingProcess.MoveToNextStep(foodTray, this.Actor); StateMachineClient stateMachineClient = StateMachineClient.Acquire(this.Actor.Proxy.ObjectId, "Grill"); if (stateMachineClient == null) { return(false); } stateMachineClient.AddInterest <TraitNames>(TraitNames.Clumsy); stateMachineClient.SetActor("x", this.Actor); stateMachineClient.SetActor("FoodTray", foodTray); stateMachineClient.EnterState("x", "Enter - Hands Empty"); stateMachineClient.RequestState("x", "Take Out Food Tray"); stateMachineClient.RequestState("x", "Exit - Holding Food Tray"); if (this.Actor.HasExitReason(ExitReason.Canceled)) { CarrySystem.EnterWhileHolding(this.Actor, foodTray); Food.PutHeldObjectDownOnCounterTableOrFloor(this.Actor, SurfaceType.Normal); return(false); } CarrySystem.EnterWhileHolding(this.Actor, foodTray); InteractionInstance instance = FoodTray_Prepare.Singleton.CreateInstance(foodTray, this.Actor, this.Actor.InheritedPriority(), base.Autonomous, true); return(this.Actor.InteractionQueue.PushAsContinuation(instance, true)); }
private new void OnAnimationEvent(StateMachineClient smc, IEvent evt) { try { if (evt.EventId == 0x65) { if (Target.mDummyModel != null) { Target.mDummyModel.UnParent(); Target.mDummyModel.Destroy(); } Target.mDummyModel = null; Target.mInventionProgress = 0f; Target.mWasFinishedByGnome = false; GameObject invention = null; CreateInventionAndAddToInventory(mCurData, Actor, mIsCheapToy, out invention); if (invention != null) { Actor.ShowTNSIfSelectable(TNSNames.inventDiscoveredSomething, Actor, invention, null, Actor.IsFemale, Actor.IsFemale, new object[] { Actor.SimDescription, invention.CatalogName }); } } else if (evt.EventId == 0x67) { Target.mDummyModel = GlobalFunctions.CreateObject("genericInvention", ProductVersion.EP2, Vector3.OutOfWorld, 0x0, Vector3.UnitZ, null, null) as GameObject; Target.mDummyModel.ParentToSlot(Target, Slot.ContainmentSlot_0); } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
private bool AbductSim() { if (!StartSync(true)) { return(false); } Target.SetPosition(mJig.Position); Target.SetForward(mJig.ForwardVector); mPreAbductFX = VisualEffect.Create("ep8UfoCloaked"); mPreAbductFX.SetPosAndOrient(Target.Position, Target.ForwardVector, Target.UpVector); mPreAbductFX.Start(); Actor.SynchronizationLevel = Sim.SyncLevel.Routed; if (!Actor.WaitForSynchronizationLevelWithSim(SimToAbduct, Sim.SyncLevel.Routed, 60f)) { FinishLinkedInteraction(true); return(false); } StateMachineClient mCurrentStateMachine = LinkedInteractionInstance.mCurrentStateMachine; mCurrentStateMachine.SetActor("x", Actor); mCurrentStateMachine.SetActor("UFO", Target); mCurrentStateMachine.EnterState("x", "Enter Abducter"); mCurrentStateMachine.EnterState("UFO", "Enter Abducter"); mCurrentStateMachine.AddOneShotScriptEventHandler(100u, new SacsEventHandler(OnAnimationEvent)); mCurrentStateMachine.AddOneShotScriptEventHandler(101u, new SacsEventHandler(OnAnimationEvent)); mCurrentStateMachine.AddOneShotScriptEventHandler(102u, new SacsEventHandler(OnAnimationEvent)); mCurrentStateMachine.RequestState(false, "UFO", "UFO idle"); mCurrentStateMachine.RequestState(true, "x", "UFO idle"); DoTimedLoop(CarUFO.kAbductUFOHoverTime, ExitReason.None); mCurrentStateMachine.RequestState(false, "UFO", "Exit Abduct"); mCurrentStateMachine.RequestState(false, "y", "Exit Abduct"); mCurrentStateMachine.RequestState(true, "x", "Exit Abduct"); return(true); }
private new void TippingLoop(StateMachineClient smc, Interaction <Sim, TTarget> .LoopData ld) { try { WatchLoopBase(smc, ld); if (Actor.IsNPC) { int mLifeTime = (int)ld.mLifeTime; if ((mTippingStatus == Tipping.NoTip) && (mLifeTime > mGoalTimeToTestTip)) { if (RandomUtil.RandomChance01(mTipChancePerCheck)) { mTippingStatus = Tipping.WillTip; } mGoalTimeToTestTip = mLifeTime + Tuning.TimePerTipTest; } if (timeTillTip < mLifeTime) { SongFinished(false, true); timeTillTip = mLifeTime + RandomUtil.RandomFloatGaussianDistribution(Target.Tuning.ShortestSongLengthForTip, Target.Tuning.LongestSongLengthForTip); } } else if (mTippingStatus == Tipping.WillTip) { SongFinished(false, true); mTippingStatus = Tipping.HasTipped; } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
public new void LoopDel(StateMachineClient smc, Interaction <Sim, IOutdoorAcceptsGarbage> .LoopData loopData) { int mLifeTime = (int)loopData.mLifeTime; if (Autonomous) { if (mLifeTime >= (TrashcanOutside.kRevealItemEveryXMinutes * TrashcanOutside.kRummageMaxItems)) { Actor.AddExitReason(ExitReason.Finished); } } else if ((mLifeTime % base.Target.RevealItemEveryXMinutes) == 0) { Target.GiveObject(mNetWorth, Actor); mNumItemsFound++; if (mNumItemsFound >= TrashcanOutside.kRummageMaxItems) { Actor.AddExitReason(ExitReason.Finished); if ((Target.LotCurrent != Actor.LotHome) && (Target.LotCurrent.Household != null)) { Journalism journalism = OmniCareer.Career <Journalism>(Actor.Occupation); LawEnforcement law = OmniCareer.Career <LawEnforcement>(Actor.Occupation); Common.DebugNotify("RummageEx:LoopDel"); if ((journalism != null) && Actor.Occupation.CanInterview()) { JournalismRummage(Actor, Target); } else if ((law != null) && Actor.Occupation.CanInterview()) { LawEnforcementRummage(Actor, Target); } } } } }
protected void WatchLoopEx(StateMachineClient smc, InteractionInstance.LoopData ld) { try { int mLifeTime = (int)ld.mLifeTime; if ((base.Actor.IsNPC && (mTippingStatus == Tipping.NoTip)) && (mLifeTime > mGoalTimeToTestTip)) { if (RandomUtil.RandomChance01(mTipChancePerCheck)) { mTippingStatus = Tipping.WillTip; } mGoalTimeToTestTip = mLifeTime + TimePerTipTest; } if (mShouldReactNow) { ReactToPerformance(); mShouldReactNow = false; } if (mTippingStatus == Tipping.WillTip) { Vector3 position = Actor.Position; //Custom AttemptToGiveATipEx(); RouteBackToViewingPosition(position); } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
public new void LoopDel(StateMachineClient smc, Interaction<Sim, IOutdoorAcceptsGarbage>.LoopData loopData) { int mLifeTime = (int)loopData.mLifeTime; if (Autonomous) { if (mLifeTime >= (TrashcanOutside.kRevealItemEveryXMinutes * TrashcanOutside.kRummageMaxItems)) { Actor.AddExitReason(ExitReason.Finished); } } else if ((mLifeTime % base.Target.RevealItemEveryXMinutes) == 0) { Target.GiveObject(mNetWorth, Actor); mNumItemsFound++; if (mNumItemsFound >= TrashcanOutside.kRummageMaxItems) { Actor.AddExitReason(ExitReason.Finished); if ((Target.LotCurrent != Actor.LotHome) && (Target.LotCurrent.Household != null)) { Journalism journalism = OmniCareer.Career<Journalism>(Actor.Occupation); LawEnforcement law = OmniCareer.Career<LawEnforcement>(Actor.Occupation); Common.DebugNotify("RummageEx:LoopDel"); if ((journalism != null) && Actor.Occupation.CanInterview()) { JournalismRummage(Actor, Target); } else if ((law != null) && Actor.Occupation.CanInterview()) { LawEnforcementRummage(Actor, Target); } } } } }
public static bool StateMachineEnterAndSit(MultiSeatObject ths, StateMachineClient smc, SittingPosture sitPosture, Slot routingSlot, object sitContext) { if (!SittableComponentEx.StateMachineEnterAndSit(ths.Sittable, smc, sitPosture, routingSlot, sitContext)) { return false; } SittableComponent.SitContext context = sitContext as SittableComponent.SitContext; if (((context != null) && (context.PreferredSeat != null)) && (context.PreferredSeat.ContainedSim == null)) { Scoot entry = (Scoot)Scoot.Singleton.CreateInstance(sitPosture.Container, sitPosture.Sim, sitPosture.Sim.InteractionQueue.GetHeadInteraction().GetPriority(), false, true); entry.TargetSeat = context.PreferredSeat as Seat; if (entry.TargetSeat != null) { sitPosture.Sim.InteractionQueue.AddNext(entry); } } if ((ths.SculptureComponent != null) && (ths.SculptureComponent.Material == SculptureComponent.SculptureMaterial.Ice)) { sitPosture.Sim.BuffManager.AddElementPaused(BuffNames.Chilly, Origin.FromSittingOnIce); } return true; }
public static bool StateMachineEnterAndSit(SittableComponent ths, StateMachineClient smc, SittingPosture sitPosture, Slot routingSlot, object sitContext) { if ((smc == null) || (sitPosture == null)) { return(false); } SitData target = sitPosture.Part.Target; bool paramValue = (ths.Owner.BoobyTrapComponent != null) ? ths.Owner.BoobyTrapComponent.CanTriggerTrap(sitPosture.Sim.SimDescription) : false; smc.SetParameter("isBoobyTrapped", paramValue); smc.SetParameter("sitTemplateSuffix", target.IKSuffix); smc.EnterState("x", ths.GetEnterStateName(routingSlot)); smc.RequestState("x", ths.GetSitStateName()); if (paramValue) { (ths.Owner as IBoobyTrap).TriggerTrap(sitPosture.Sim); smc.SetParameter("isBoobyTrapped", false); } ths.TurnOnFootDiscouragmentArea(target); return(true); }
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); } } }
public override bool OnPortalStart(Sim sim) { try { if ((mCurrentlyRoutingSim != null) && (mCurrentlyRoutingSim.HasBeenDestroyed)) { if (mSMC != null) { mSMC.Dispose(); mSMC = null; } } mCurrentlyRoutingSim = sim; if (mSMC != null) { sim.PlayRouteFailure(mPortal); return false; } AncientPortal targetPortal = null; if (!sTargetPortals.TryGetValue(sim, out targetPortal)) { sim.PlayRouteFailure(mPortal); return false; } if (targetPortal == mPortal) { return false; } mPortal.AddToUseList(sim); sim.SimRoutingComponent.OnRouteActionsFinished -= OnPortalApproachCancelledAndFinished; sim.SetExitReasonsInterruptForMultiPortalRoute(); sim.SimRoutingComponent.StartIgnoringObstacles(); targetPortal.AddToUseList(sim); targetPortal.EnableFootprint(AncientPortal.CatchABeam.FootprintPlacementHash); targetPortal.PushSimsFromFootprint(AncientPortal.CatchABeam.FootprintPlacementHash, sim, null, false); Vector3 slotFoward = mPortal.GetForwardOfSlot(mPortal.GetRoutingSlots()[0]); sim.SetForward(slotFoward); mSMC = StateMachineClient.Acquire(sim, "AncientPortal", AnimationPriority.kAPDefault); mSMC.SetActor("x", sim); mSMC.SetActor("portal", mPortal); mSMC.EnterState("x", "Enter"); mSMC.EnterState("portal", "Enter"); mSMC.AddOneShotScriptEventHandler(0x65, HideSim); mSMC.AddOneShotScriptEventHandler(0x66, ShowSim); mSMC.RequestState("x", "InsidePortal"); mPortal.RemoveFromUseList(sim); return true; } catch (ResetException) { if (mCurrentlyRoutingSim != null) { mCurrentlyRoutingSim.SetHiddenFlags(HiddenFlags.Nothing); } throw; } catch (Exception e) { if (mCurrentlyRoutingSim != null) { mCurrentlyRoutingSim.SetHiddenFlags(HiddenFlags.Nothing); } Common.Exception(sim, Owner, e); return false; } }
private void ShowSim(StateMachineClient sender, IEvent evt) { try { if (mCurrentlyRoutingSim != null) { mCurrentlyRoutingSim.SetHiddenFlags(HiddenFlags.Nothing); } } catch (Exception e) { Common.Exception(mCurrentlyRoutingSim, e); } }
private void HideSim(StateMachineClient sender, IEvent evt) { try { mCurrentlyRoutingSim.SetHiddenFlags(HiddenFlags.Model); } catch (Exception e) { Common.Exception(mCurrentlyRoutingSim, e); } }
protected abstract void PrivatePerform(StateMachineClient smc, InteractionInstance.LoopData loopData);
public void Perform(StateMachineClient smc, InteractionInstance.LoopData loopData) { try { PrivatePerform(smc, loopData); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(mInteraction.Actor, mInteraction.Target, e); } }
public override void SniffLoop(StateMachineClient smc, InteractionInstance.LoopData data) { try { if (mInitialSkill == -1) { mInitialSkill = Actor.SkillManager.GetSkillLevel(SkillNames.DogHunting); } else if (mInitialSkill == Actor.SkillManager.GetSkillLevel(SkillNames.DogHunting)) { base.SniffLoop(smc, data); } else { Actor.AddExitReason(ExitReason.RouteFailed); } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
protected override void PrivatePerform(StateMachineClient smc, InteractionInstance.LoopData loopData) { if (SimClock.ElapsedTime(TimeUnit.Minutes, mInteraction.mLastLTRUpdateDateAndTime) >= GoToSchoolInRabbitHole.kSimMinutesBetweenLTRUpdates) { if (RandomUtil.RandomChance(kGeologyClubCollectChance)) { List<RockGemMetalBase> rocks = new List<RockGemMetalBase>(Sims3.Gameplay.Queries.GetObjects<RockGemMetalBase>()); if (rocks.Count > 0) { RockGemMetalBase rock = RandomUtil.GetRandomObjectFromList(rocks); if (Inventories.TryToMove(rock, mInteraction.Actor)) { rock.RegisterCollected(mInteraction.Actor, false); rock.RemoveFromWorld(); string msg = Common.Localize("AfterschoolFoundObject:Notice", mInteraction.Actor.IsFemale, new object[] { mInteraction.Actor, rock.GetLocalizedName() }); mInteraction.Actor.ShowTNSIfSelectable(msg, StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, rock.ObjectId); } } } } mInteraction.AfterschoolActivityLoopDelegate(smc, loopData); }
public void ShowEpicFailVfx(StateMachineClient sender, IEvent evt) { ShowEpicFailVfxCB(sender, evt); }
protected override void PrivatePerform(StateMachineClient smc, InteractionInstance.LoopData loopData) { if (SimClock.ElapsedTime(TimeUnit.Minutes, mInteraction.mLastLTRUpdateDateAndTime) >= GoToSchoolInRabbitHole.kSimMinutesBetweenLTRUpdates) { if (RandomUtil.RandomChance(kBugClubCollectChance)) { List<InsectJig> insects = new List<InsectJig>(Sims3.Gameplay.Queries.GetObjects<InsectJig>()); if (insects.Count > 0) { InsectJig insect = RandomUtil.GetRandomObjectFromList(insects); Terrarium terrarium = InsectTerrarium.Create(insect, mInteraction.Actor); if (terrarium != null) { string msg = Common.Localize("AfterschoolFoundObject:Notice", mInteraction.Actor.IsFemale, new object[] { mInteraction.Actor, terrarium.GetLocalizedName() }); mInteraction.Actor.ShowTNSIfSelectable(msg, StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, terrarium.ObjectId); } } } } mInteraction.AfterschoolActivityLoopDelegate(smc, loopData); }
protected override void PrivatePerform(StateMachineClient smc, InteractionInstance.LoopData loopData) { if (SimClock.ElapsedTime(TimeUnit.Minutes, mInteraction.mLastLTRUpdateDateAndTime) >= GoToSchoolInRabbitHole.kSimMinutesBetweenLTRUpdates) { if (RandomUtil.RandomChance(kExplorerClubCollectChance)) { IGameObject huntable = GetHuntable(); if (huntable != null) { if (Inventories.TryToMove(huntable, mInteraction.Actor)) { RockGemMetalBase rock = huntable as RockGemMetalBase; if (rock != null) { rock.RegisterCollected(mInteraction.Actor, false); } string msg = Common.Localize("AfterschoolFoundObject:Notice", mInteraction.Actor.IsFemale, new object[] { mInteraction.Actor, huntable.GetLocalizedName() }); mInteraction.Actor.ShowTNSIfSelectable(msg, StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, huntable.ObjectId); } else { huntable.Destroy(); } } } } mInteraction.AfterschoolActivityLoopDelegate(smc, loopData); }
public void ShowSuccessVfx(StateMachineClient sender, IEvent evt) { ShowSuccessVfxCB(sender, evt); }
protected new void LoopDelegate(StateMachineClient smc, Interaction<Sim, RabbitHole>.LoopData loopData) { try { mCareer.WhileWorking(); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
public new void MakeLoopCallback(StateMachineClient smc, Interaction<Sim, InventionWorkbench>.LoopData ld) { try { Target.mInventionProgress += ld.mDeltaTime / mTotalTime; if (Target.mInventionProgress >= 1f) { AddSynchronousOneShotScriptEventHandler(0x65, new SacsEventHandler(OnAnimationEvent)); AnimateSim("Swipe"); if (mMakeMany) { if (!Target.ConsumeScrap(mCurData.GetScrapCost(Actor, mIsCheapToy), Actor)) { ShowOutOfScrapTNS(); Actor.AddExitReason(ExitReason.Finished); } else { AddSynchronousOneShotScriptEventHandler(0x67, new SacsEventHandler(OnAnimationEvent)); SetParameter("skillLevel", InventionWorkbench.GetSkillLevelParam(mInventSkill)); AnimateSim("Loop Invent"); mFinalModelShown = false; mTimeUntilModelSwap = GetTimeForNextModelChange(); } } else { Actor.AddExitReason(ExitReason.Finished); } } else if (!mFinalModelShown) { if (Target.mInventionProgress >= InventionWorkbench.kShowFinalModelPercent) { string miniModelName = mCurData.MiniModelName; ProductVersion prodVersion = mCurData.ProdVersion; Slot finalModelSlot = mCurData.FinalModelSlot; if (Target.mDummyModel == null) { Actor.AddExitReason(ExitReason.Finished); } else { Target.mDummyModel.UnParent(); Target.mDummyModel.ParentToSlot(Target, finalModelSlot); Target.mDummyModel.SetModel(miniModelName, prodVersion); mFinalModelShown = true; } } else { mTimeUntilModelSwap -= ld.mDeltaTime; if (mTimeUntilModelSwap <= 0f) { Target.SwapToRandomDummyGeoState(false); mTimeUntilModelSwap = GetTimeForNextModelChange(); } } } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
private new void LoopDel(StateMachineClient smc, InteractionInstance.LoopData loopData) { try { bool flag = false; if (simToChat == null) { flag = true; } else { SimDescription simDescription = simToChat.SimDescription; if ((simDescription == null) || !simDescription.IsValidDescription) { flag = true; } } if (flag) { Actor.AddExitReason(ExitReason.Finished); } else { int lifeTime = (int)loopData.mLifeTime; if (Actor.HasTrait(TraitNames.AntiTV) && (lifeTime > Computer.kTechnophobeTraitMaximumChatTime)) { Actor.AddExitReason(ExitReason.Finished); } int chatRelationshipIncreaseEveryXMinutes = Target.ComputerTuning.ChatRelationshipIncreaseEveryXMinutes; if (chatRelationshipIncreaseEveryXMinutes != 0) { if ((lifeTime / Target.ComputerTuning.ChatRelationshipIncreaseEveryXMinutes) > RelationshipIncreases) { RelationshipIncreases++; Target.ChatUpdate(Actor, simToChat, Target); } } int cyberWoohooChanceToClimaxEveryXMinutes = KamaSimtra.Settings.mCyberWoohooChanceToClimaxEveryXMinutes; if (cyberWoohooChanceToClimaxEveryXMinutes != 0) { if ((lifeTime / cyberWoohooChanceToClimaxEveryXMinutes) > mClimaxChances) { mClimaxChances++; if (RandomUtil.RandomChance(KamaSimtra.Settings.mCyberWoohooChanceToClimax * mClimaxChances)) { CommonWoohoo.RunPostWoohoo(Actor, simToChat, Target, CommonWoohoo.WoohooStyle.Safe, CommonWoohoo.WoohooLocation.Computer, false); Actor.AddExitReason(ExitReason.Finished); } } } if (timeTillLearn < lifeTime) { Relationship relation = Relationship.Get(Actor, simToChat, true); if (relation != null) { relation.ConsiderLearningAboutTargetSim(Actor, simToChat, Target.ComputerTuning.ChatIntimacylevel); } timeTillLearn = lifeTime + RandomUtil.RandomFloatGaussianDistribution(Target.ComputerTuning.ChatLearnSomethingFrequencyStart, Target.ComputerTuning.ChatLearnSomethingFrequencyEnd); } } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); Actor.AddExitReason(ExitReason.Finished); } }
public static bool StateMachineEnterAndSit(SaunaClassic ths, bool forWoohoo, StateMachineClient smc, SittingPosture sitPosture, Slot routingSlot, object sitContext) { /* if (sitPosture.Sim.SimDescription.IsVisuallyPregnant) { ThoughtBalloonManager.BalloonData bd = null; bd = new ThoughtBalloonManager.BalloonData("balloon_moodlet_pregnant"); if (bd != null) { sitPosture.Sim.ThoughtBalloonManager.ShowBalloon(bd); } return false; } */ if ((sitPosture.Sim.CarryingChildPosture != null) || (sitPosture.Sim.CarryingPetPosture != null)) { return false; } if (!sitPosture.Sim.HasTrait(TraitNames.NeverNude)) { bool change = false; if ((Woohooer.Settings.mNakedOutfitSaunaGeneral) || ((forWoohoo) && (Woohooer.Settings.mNakedOutfitSaunaWoohoo))) { if (sitPosture.Sim.SimDescription.Teen) { if (Woohooer.Settings.mAllowTeenWoohoo) { change = true; } } else if (sitPosture.Sim.SimDescription.YoungAdultOrAbove) { change = true; } } if (change) { sitPosture.Sim.SwitchToOutfitWithSpin(OutfitCategories.Naked, 0); Woohooer.Settings.AddChange(sitPosture.Sim); } else { sitPosture.Sim.SwitchToOutfitWithSpin(Sim.ClothesChangeReason.GoingToSwim); } } if (!MultiSeatObjectEx.StateMachineEnterAndSit(ths, smc, sitPosture, routingSlot, sitContext)) { return false; } sitPosture.Interactions.Remove(new InteractionObjectPair(StartSeatedCuddleA.Singleton, sitPosture.Sim)); sitPosture.Sim.RemoveInteractionByType(StartSeatedCuddleA.Singleton); List<InteractionDefinition> list = sitPosture.mSocialInteractionDefinitions as List<InteractionDefinition>; if (list != null) { list.Remove(StartSeatedCuddleA.Singleton); } sitPosture.AddInteraction(SaunaClassic.CuddleSeatedWooHooSauna.Singleton, sitPosture.Sim); sitPosture.AddInteraction(SaunaClassic.CuddleSeatedWooHooSauna.TryForBoySingleton, sitPosture.Sim); sitPosture.AddInteraction(SaunaClassic.CuddleSeatedWooHooSauna.TryForGirlSingleton, sitPosture.Sim); sitPosture.AddInteraction(SaunaClassic.StartSaunaSeatedCuddleA.Singleton, sitPosture.Sim); sitPosture.AddSocialInteraction(SaunaClassic.StartSaunaSeatedCuddleA.Singleton); sitPosture.Sim.BuffManager.AddElementPaused((BuffNames)(0x9a7f5f1919df0018L), Origin.None); return true; }
private new void LoopFunc(StateMachineClient smc, Interaction<Sim, Terrain>.LoopData ld) { try { WaterTypes waterType = FishingSpot.GetWaterType(Hit.mType); EventTracker.SendEvent(new FishingLoopEvent(EventTypeId.kWentFishing, Actor, waterType, ld.mLifeTime)); Actor.TryGroupTalk(); //Actor.TrySinging(); Fishing skill = Actor.SkillManager.GetSkill<Fishing>(SkillNames.Fishing); if (mShowTns && (ld.mLifeTime > kTimeToShowFishingTns)) { string str; if (BaitInUse != null) { str = Common.LocalizeEAString("Gameplay/Objects/Fishing:NoFishWithBait"); } else { str = Common.LocalizeEAString("Gameplay/Objects/Fishing:NoFishNoBait"); } Actor.ShowTNSIfSelectable(str, StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid); if ((mLoopLengthForNextFish - ld.mLifeTime) < kTimeToCatchPostTns) { mLoopLengthForNextFish = ld.mLifeTime + kTimeToCatchPostTns; } mShowTns = false; } if (ld.mLifeTime > mLoopLengthForNextFish) { mLoopLengthForNextFish += mFishingData.GetNextFishTimeLength(mIsAngler, skill.IsFisherman()); FishType none = FishType.None; string baitUsed = null; if (BaitInUse != null) { baitUsed = BaitInUse.Key; } if (!mShowTns) { none = mFishingData.GetFishCaught(Actor, baitUsed); } if ((mSittingInBoatPosture != null) && (none == FishType.Box)) { none = FishType.None; } FishType type3 = none; if (type3 == FishType.None) { bool flag = false; if (Actor.TraitManager.HasElement(TraitNames.Clumsy)) { flag = RandomUtil.RandomChance01(kChanceOfPlayingLostFishAnimIfClumsy); } else { flag = RandomUtil.RandomChance01(kChanceOfPlayingLostFishAnim); } if (!flag) { return; } AnimateSim("CatchNothing"); } else if (type3 == FishType.Box) { int num = 0x0; WorldType currentWorldType = GameUtils.GetCurrentWorldType(); WorldName currentWorld = GameUtils.GetCurrentWorld(); List<int> list = new List<int>(); for (int i = 0x0; i < sBoxData.Count; i++) { BoxData data = sBoxData[i]; if (((data.AllowedWorldType == WorldType.Undefined) || (data.AllowedWorldType == currentWorldType)) && (((data.AllowedWorlds == null) || (data.AllowedWorlds.Count == 0x0)) || (data.AllowedWorlds.Contains(currentWorld) || data.AllowedWorlds.Contains(WorldName.Undefined)))) { num += sBoxChances[i]; list.Add(i); } } int chance = RandomUtil.GetInt(num - 0x1); int num4 = 0x0; foreach (int num5 in list) { num4 = num5; if (chance < sBoxChances[num5]) { break; } chance -= sBoxChances[num5]; } IGameObject obj2 = GlobalFunctions.CreateObject(sBoxData[num4].ItemName, Vector3.OutOfWorld, 0x1, Vector3.UnitZ); if (obj2 == null) { return; } bool happy = sBoxData[num4].Happy; if (Actor.TraitManager.HasElement(TraitNames.Insane)) { happy = !happy; } SetSplashAndDripEffects(EffectSize.Small); if (happy) { AnimateSim("CatchBoxHappy"); Actor.Inventory.TryToAdd(obj2, false); } else { AnimateSim("CatchBoxSad"); Actor.Inventory.TryToAdd(obj2, false); } Actor.ShowTNSIfSelectable(Common.LocalizeEAString(Actor.IsFemale, "Gameplay/Objects/Fishing:CaughtBox", new object[] { Actor, obj2 }), StyledNotification.NotificationStyle.kGameMessagePositive, obj2.ObjectId, Actor.ObjectId); } else { int num6; string str3; Fish actor = Fish.CreateFish(none, Actor, skill, BaitInUse, out num6, out str3); actor.UpdateVisualState(CatHuntingComponent.CatHuntingModelState.InInventory); mNumberFishCaught++; SetActor("fish", actor); SetSplashAndDripEffects(actor.EffectSize); PlayFishCatchAnimation(num6); if (str3 != null) { Actor.ShowTNSIfSelectable(str3, StyledNotification.NotificationStyle.kGameMessagePositive, actor.ObjectId, Actor.ObjectId); } EventTracker.SendEvent(new CaughtFishEvent(EventTypeId.kCaughtFish, Actor, actor, baitUsed)); Actor.Inventory.TryToAdd(actor,false); if ((BaitInUse != null) && RandomUtil.RandomChance(kPercentChanceBaitLost)) { Actor.Inventory.SetNotInUse(BaitInUse); Actor.Inventory.RemoveByForce(BaitInUse); IFishBait baitInUse = BaitInUse; BaitInUse = FindProperBait(new Fishing.BaitInfo(baitInUse)); if (BaitInUse == null) { ThoughtBalloonManager.BalloonData bd = new ThoughtBalloonManager.BalloonData(baitInUse.GetThoughtBalloonThumbnailKey()); bd.mCoolDown = ThoughtBalloonCooldown.Medium; bd.LowAxis = ThoughtBalloonAxis.kDislike; Actor.ThoughtBalloonManager.ShowBalloon(bd); Actor.InteractionQueue.FireQueueChanged(); string message = Common.LocalizeEAString(Actor.IsFemale, "Gameplay/Objects/Fishing:NoMoreBait", new object[] { Actor, baitInUse.GetLocalizedName() }); Actor.ShowTNSIfSelectable(message, StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, Actor.ObjectId); } baitInUse.Destroy(); } } if (!ActiveStage.IsComplete((InteractionInstance) this)) { mCurrentStateMachine.SetParameter("skillLevel", skill.GetSkillLevelParameterForJazzGraph()); AnimateSim("Fish"); } } } catch (ResetException) { throw; } catch (Exception e) { Common.DebugException(Actor, Target, e); } }