private void OnHotKeyPressed(object sender, KeyPressedEventArgs e) { var kc = new KeyConverter(); if (e.HotKey.Key == (Key)kc.ConvertFromString(Settings.Default.hotKeyQ)) { ForegroundW.SetForeground("Shell_TrayWnd"); textBox.Focus(); textBox.Clear(); } if (e.HotKey.Key == (Key)kc.ConvertFromString(Settings.Default.hotKeyW)) { if (Shower == null) { Shower = new QShower(); } Shower.ShowOrHide(ActualHeight, ActualWidth, PointToScreen(new Point()).X); } if (e.HotKey.Key == (Key)kc.ConvertFromString(Settings.Default.hotKeyB)) { Sim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_C); Thread.Sleep(20); string str = ClipboardGetText(); Process.Start("https://www.baidu.com/s?ie=UTF-8&wd=" + str); } if (e.HotKey.Key == (Key)kc.ConvertFromString(Settings.Default.hotKeyG)) { Sim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_C); Thread.Sleep(20); string str = ClipboardGetText(); Process.Start("http://google.com#q=" + str); } }
public Instance(Shower master) : base(master) { operational = master.GetComponent <Operational>(); consumer = master.GetComponent <ConduitConsumer>(); dispenser = master.GetComponent <ConduitDispenser>(); }
public JsonResult EditShower(Shower shower) { if (shower.ShowerDate != null) { Pet pet = db.Pets.Find(shower.PetId); if (pet != null) { shower.PetName = pet.PetName; shower.Owner = pet.Owner.OwnerFullName; shower.OwnerPhone = pet.Owner.OwnerPhone; if (pet.PetSpecie == Species.Canina) { shower.PetSpecie = "Canina"; } else { shower.PetSpecie = "Felina"; } } db.Entry(shower).State = EntityState.Modified; db.SaveChanges(); return(new JsonResult { Data = new { status = true, petId = shower.PetId, petName = shower.PetName, owner = shower.Owner, ownerPhone = shower.OwnerPhone, specie = shower.PetSpecie, date = shower.ShowerDate.ToString("yyyy-MM-dd"), dateTitle = shower.ShowerDate.ToString("D") } }); } else { return(new JsonResult { Data = new { status = false } }); } }
public void SetProperties() { GameObject showerObject = Selection.activeGameObject; Shower ShowerRoom = showerObject.GetComponent <Shower>(); ShowerRoom.showerheads = showerObject.GetComponentsInChildren <ShowerHead>(); }
private void ShowerTime() { Shower curShower = RoomManager.instance.GetClosestShower(this.gameObject); ShowerHead showerHead = curShower.GetShower(); agent.SetDestination(showerHead.transform.position); }
public void Test_Shower_Option_Can_Be_Chosen() { _form1 = new Form1(); _mysql = new Mysql_Connect(); _home = new HomePage(_form1, _mysql); _shower = new MedicTalk.Shower(_home, _mysql, _form1); _form1.Username_Textbox.Text = "resident"; _form1.Password_Textbox.Text = "resident"; _form1.UserNameProperty = "resident"; _form1.PasswordProperty = "resident"; // Simulate user logging in _form1.Login_Click(new object(), EventArgs.Empty); // Simulate user creating a request at 12:32 _shower._minute = "32"; _shower._hour = "12"; _shower.Shower_Button_Changed(new object(), EventArgs.Empty); _shower.Submit_Button_Click(new object(), EventArgs.Empty); Assert.AreEqual(_shower.result, DialogResult.OK); // Now delete the entry, so that this test can be re-tested again at a later time _mysql.Delete("DELETE FROM NEWTimedRequests WHERE UID = 5 AND TypeOfRequest = 'Shower' AND TimeToComplete = '12:32:00'"); }
private Shower DeSerializeShower(string _filename) { Shower _shower = new Shower(); try { _shower.ShowerName = _filename; ShowerToSerialize showerToDeSerialize = new ShowerToSerialize(); Serializer serializer = new Serializer(); showerToDeSerialize = serializer.DeSerializeObject <ShowerToSerialize>(_shower.ShowerName); _shower.YankeeSpeed = showerToDeSerialize.Shower.YankeeSpeed; _shower.YankeeWidth = showerToDeSerialize.Shower.YankeeWidth; _shower.YankeeDiameter = showerToDeSerialize.Shower.YankeeDiameter; _shower.DwellDistance = showerToDeSerialize.Shower.DwellDistance; _shower.OperatingPressure = showerToDeSerialize.Shower.OperatingPressure; _shower.ShowerTemperature = showerToDeSerialize.Shower.ShowerTemperature; _shower.NumberNozzles = showerToDeSerialize.Shower.NumberNozzles; _shower.Nozzles = showerToDeSerialize.Shower.Nozzles; _shower.CoverageColour = showerToDeSerialize.Shower.CoverageColour; } catch { return(null); } return(_shower); }
/// <summary> /// Gets closest shower /// </summary> /// <param name="curAI"></param> /// <returns>The closest shower</returns> public Shower GetClosestShower(GameObject curAI) { if (showers.Count == 1) { return(showers[0]); } float curDistance = 0; Shower returnShower = null; for (int i = 0; i < showers.Count; i++) { float latestDistance = Vector3.Distance(curAI.transform.position, showers[i].gameObject.transform.position); if (curDistance != 0) { if (latestDistance < curDistance) { curDistance = latestDistance; returnShower = showers[i]; } } else { curDistance = latestDistance; returnShower = showers[i]; } } return(returnShower); }
public async Task <IActionResult> CreateShowerAsync(Shower s) { var mapped = _mapper.Map <DAL.Entities.Shower>(s); await _roomService.AddRoomAsync(mapped); return(CreatedAtRoute("GetRoomById", new { id = mapped.Id }, mapped)); }
// 输入文字处理 private void TextBox_KeyUp(object sender, KeyEventArgs e) { if (Shower == null) { Shower = new QShower(); } Shower.InputStrProsessing(sender, e); }
// 打开/关闭 翻译详情 private void Logo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (Shower == null) { Shower = new QShower(); } Shower.ShowOrHide(ActualHeight, ActualWidth, PointToScreen(new Point()).X); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <LoopingSounds>(); go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.WashStation); go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.AdvancedWashStation); Shower shower = go.AddOrGet <Shower>(); shower.overrideAnims = new KAnimFile[1] { Assets.GetAnim((HashedString)"anim_interacts_shower_kanim") }; shower.workTime = 15f; shower.outputTargetElement = SimHashes.DirtyWater; shower.fractionalDiseaseRemoval = 0.95f; shower.absoluteDiseaseRemoval = -2000; shower.workLayer = Grid.SceneLayer.BuildingFront; shower.trackUses = true; ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>(); conduitConsumer.conduitType = ConduitType.Liquid; conduitConsumer.capacityTag = ElementLoader.FindElementByHash(SimHashes.Water).tag; conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Store; conduitConsumer.capacityKG = 5f; ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>(); conduitDispenser.conduitType = ConduitType.Liquid; conduitDispenser.invertElementFilter = true; conduitDispenser.elementFilter = new SimHashes[1] { SimHashes.Water }; ElementConverter elementConverter = go.AddOrGet <ElementConverter>(); elementConverter.consumedElements = new ElementConverter.ConsumedElement[2] { new ElementConverter.ConsumedElement(new Tag("Water"), 1f), new ElementConverter.ConsumedElement(SimHashes.BleachStone.CreateTag(), 0.0005f), }; elementConverter.outputElements = new ElementConverter.OutputElement[1] { new ElementConverter.OutputElement(1f, SimHashes.DirtyWater, 0.0f, true, 0.0f, 0.5f, true, 0f, 0, 0) }; Storage storage = go.AddOrGet <Storage>(); storage.capacityKg = 12f; storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage); go.AddOrGet <RequireOutputs>().ignoreFullPipe = true; ManualDeliveryKG manualDeliveryKg1 = go.AddOrGet <ManualDeliveryKG>(); manualDeliveryKg1.SetStorage(storage); manualDeliveryKg1.requestedItemTag = SimHashes.BleachStone.CreateTag(); manualDeliveryKg1.capacity = 2f; manualDeliveryKg1.refillMass = 1f; manualDeliveryKg1.minimumMass = 1f; manualDeliveryKg1.choreTypeIDHash = Db.Get().ChoreTypes.FetchCritical.IdHash; }
public virtual int Show() { if (visible == true) { return(Shower.Show(this)); } else { return(-1); } }
public override void Show(int lvl = 0) { Shower.DrawText(new String(' ', lvl * 2) + "BorderDecorator {" + Environment.NewLine); Shower.SetBrushForShow(System.Drawing.Brushes.Red); decoratedFigure.ShowBorder(lvl, Shower); SetBrushForShow(System.Drawing.Brushes.Black); base.Show(lvl); Shower.DrawText(new String(' ', lvl * 2) + "}" + Environment.NewLine); }
public JsonResult DeleteShower(int showerId) { var status = false; Shower shower = db.Showers.Find(showerId); if (shower != null) { db.Showers.Remove(shower); db.SaveChanges(); status = true; } return(Json(status, JsonRequestBehavior.AllowGet)); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <LoopingSounds>(); go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.WashStation, false); go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.AdvancedWashStation, false); Shower shower = go.AddOrGet <Shower>(); shower.overrideAnims = new KAnimFile[1] { Assets.GetAnim("anim_interacts_shower_kanim") }; shower.workTime = 15f; shower.outputTargetElement = SimHashes.DirtyWater; shower.fractionalDiseaseRemoval = 0.95f; shower.absoluteDiseaseRemoval = -2000; shower.workLayer = Grid.SceneLayer.BuildingFront; shower.trackUses = true; ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>(); conduitConsumer.conduitType = ConduitType.Liquid; conduitConsumer.capacityTag = ElementLoader.FindElementByHash(SimHashes.Water).tag; conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Store; conduitConsumer.capacityKG = 5f; ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>(); conduitDispenser.conduitType = ConduitType.Liquid; conduitDispenser.invertElementFilter = true; conduitDispenser.elementFilter = new SimHashes[1] { SimHashes.Water }; ElementConverter elementConverter = go.AddOrGet <ElementConverter>(); elementConverter.consumedElements = new ElementConverter.ConsumedElement[1] { new ElementConverter.ConsumedElement(new Tag("Water"), 1f) }; elementConverter.outputElements = new ElementConverter.OutputElement[1] { new ElementConverter.OutputElement(1f, SimHashes.DirtyWater, 0f, false, true, 0f, 0.5f, 1f, byte.MaxValue, 0) }; Storage storage = go.AddOrGet <Storage>(); storage.capacityKg = 10f; storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage); RequireOutputs requireOutputs = go.AddOrGet <RequireOutputs>(); requireOutputs.ignoreFullPipe = true; }
public async Task InsertAsync(/*Order order*/) { var room = new Shower { Price = 200 }; _context.Rooms.Add(room); var room2 = new Bedroom { Price = 100 }; _context.Rooms.Add(room2); var room3 = new Bedroom { Price = 100 }; _context.Rooms.Add(room3); _context.Add(new Order { Costumer = new Costumer { Name = "nevem" }, StartDate = DateTime.Now.AddDays(-5), EndDate = DateTime.Now.AddDays(1), OrderRooms = new List <OrderRoom> { new OrderRoom { Room = room, Note = "megrendeles" }, new OrderRoom { Room = room2, Note = "megrendeles" }, new OrderRoom { Room = room3, Note = "megrendeles " } }, Price = (room.Price + room2.Price + room3.Price) * 6 }); await _context.SaveChangesAsync(); //var foglalasi_szobak = order.Rooms.Select(r => r.Id).ToList(); //var marFoglalva = await _context.Orders.AnyAsync(o => o.Rooms.Any(r => foglalasi_szobak.Contains(r.Id))); //var roomId = 7; //var szabad = _context.Rooms.Where(r => r.Id == roomId && r.OrderRooms.Any(or => or.Order.EndDate < DateTime.Now )) }
private void SerializeShower(string _filename) { try { Shower _shower = new Shower { ShowerName = _filename, YankeeSpeed = YankeeSpeed, YankeeWidth = YankeeWidth, YankeeDiameter = YankeeDiameter, DwellDistance = DwellDistance, OperatingPressure = OperatingPressure, ShowerTemperature = ShowerTemperature, NumberNozzles = NumberNozzles, CoverageColour = CoverageColour }; SerializedNozzle _sernozzle; foreach (NozzleControl nc in Nozzles) { _sernozzle = new SerializedNozzle { NozzleSprayWidth = nc.NozzleSprayWidth, NozzleSpacing = nc.NozzleSpacing, SprayAngle = nc.SprayAngle, MaximumSprayAngle = nc.MaximumSprayAngle, NozzleToYankee = nc.NozzleToYankee, SprayRotation = nc.SprayRotation, NozzleFlow = nc.NozzleFlow, NozzlePressure = nc.NozzlePressure, NozzleOrificeID = nc.NozzleOrificeID, NozzleTypeName = nc.NozzleTypeName, SprayPattern = nc.SprayPattern }; _shower.Nozzles.Add(_sernozzle); } ShowerToSerialize showerToSerialize = new ShowerToSerialize { Shower = _shower }; Serializer serializer = new Serializer(); serializer.SerializeObject <ShowerToSerialize>(_shower.ShowerName, showerToSerialize); } catch { } }
public static void Postfix(ref Shower __instance, float dt) { if (!Settings.Instance.Bathroom.IncludeRoom) { return; } if (string.IsNullOrEmpty(PlumbedBathroomId)) { PlumbedBathroomId = Db.Get().RoomTypes.PlumbedBathroom.Id; } if ((RoomTypes_AllModded.IsInTheRoom(__instance, RoomTypeBathroomData.RoomId) || RoomTypes_AllModded.IsInTheRoom(__instance, PlumbedBathroomId)) && Settings.Instance.Bathroom.Bonus.HasValue) { __instance.WorkTimeRemaining -= dt * Settings.Instance.Bathroom.Bonus.Value; } }
static void Main(string[] args) { Shower shower = new Shower(); Console.Clear(); int ms = 0; while (true) { DateTime time = DateTime.Now; shower.ShowSymbol(); ms = 200 - (int)(DateTime.Now - time).TotalMilliseconds; if (ms > 0) { System.Threading.Thread.Sleep(ms); } } }
public static void Postfix(Shower __instance, Worker worker) { GermySinkManager.Instance?.FinishGermyWork(__instance, worker); }
public override void Show() { Shower?.Invoke(); base.Show(); }
public static void Prefix(Shower __instance, float dt) { GermySinkManager.Instance?.ShowerWorkTick(__instance, dt); }
public override bool Run() { Common.StringBuilder msg = new Common.StringBuilder("ShowerWoohoo:Run" + Common.NewLine); try { IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition; Actor.BuffManager.RemoveElement(BuffNames.RobotForm); mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToBathe); mSwitchOutfitHelper.Start(); if (WaitForBToEnterShower) { //Actor.RouteToObjectRadialRange(Shower, 1.5f, 4f); SpeedTrap.Sleep(0xa); while (Shower.SimInShower != Target) { if ((Target.InteractionQueue.GetCurrentInteraction() != TakeShowerInst) || Target.HasExitReason(ExitReason.Canceled)) { mSwitchOutfitHelper.Dispose(); return(false); } SpeedTrap.Sleep(0xa); } } msg += "A"; if (!Actor.RouteToSlot(Shower, Slot.RoutingSlot_0)) { mSwitchOutfitHelper.Dispose(); return(false); } msg += "B"; mSwitchOutfitHelper.Wait(true); bool flag = Actor.GetCurrentOutfitCategoryFromOutfitInGameObject() == OutfitCategories.Singed; Shower.AddToUseList(Actor); mInUseList = true; mCurrentStateMachine = TakeShowerInst.mCurrentStateMachine; SetActorAndEnter("y", Actor, "Enter"); if (!WaitForBToEnterShower) { mCurrentStateMachine.RequestState("y", "Ask"); } msg += "C"; string socialName = CommonWoohoo.GetSocialName(definition.GetStyle(this), Actor); StartSocial(socialName); if (WaitForBToEnterShower) { Rejected = false; } InitiateSocialUI(Actor, Target); msg += "D"; bool succeeded = true; if (Rejected) { succeeded = false; mCurrentStateMachine.RequestState("y", "Reject"); mCurrentStateMachine.RemoveActor(Actor); FinishSocial(socialName, true); Actor.BuffManager.AddElement(BuffNames.WalkOfShame, Origin.FromRejectedWooHooOffHome); } else { mCurrentStateMachine.RequestState("y", "ShooSims"); SetParameter("SimShouldClothesChange", !flag && !Actor.OccultManager.DisallowClothesChange()); mSwitchOutfitHelper.AddScriptEventHandler(this); Actor.LoopIdle(); msg += "E"; if (CommonWoohoo.NeedPrivacy(Shower.IsOutside, Actor, Target)) { mSituation = new BedWoohoo.WooHooPrivacySituation(this); if (!mSituation.Start()) { mSwitchOutfitHelper.Dispose(); succeeded = false; } } msg += "F"; if ((succeeded) && (Actor.RouteToSlot(Shower, Slot.RoutingSlot_0))) { MotiveDelta[] deltaArray = new MotiveDelta[6]; deltaArray[0] = AddMotiveDelta(CommodityKind.Fun, 1500f); deltaArray[1] = TakeShowerInst.AddMotiveDelta(CommodityKind.Fun, 1500f); deltaArray[2] = AddMotiveDelta(CommodityKind.Social, 50f); deltaArray[3] = TakeShowerInst.AddMotiveDelta(CommodityKind.Social, 50f); if (Actor.SimDescription.IsPlantSim) { deltaArray[4] = AddMotiveDelta(CommodityKind.Hygiene, 800f * Sims3.Gameplay.Objects.Plumbing.Shower.kPlantSimHygieneModifier); } else { deltaArray[4] = AddMotiveDelta(CommodityKind.Hygiene, 800f); } if (Actor.SimDescription.IsMermaid) { deltaArray[5] = AddMotiveDelta(CommodityKind.MermaidDermalHydration, 800f); } Target.EnableCensor(Sim.CensorType.FullHeight); RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo); mCurrentStateMachine.AddOneShotScriptEventHandler(0x65, OnJealousyEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x66, OnAnimationEvent); if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this))) { mCurrentStateMachine.AddOneShotScriptEventHandler(0x67, OnPregnancyEvent); } msg += "G"; mSteamVfx = VisualEffect.Create(Shower.SteamVfxName); mSteamVfx.ParentTo(Shower, Shower.IsShowerTub ? Slot.FXJoint_2 : Slot.FXJoint_0); mSteamVfx.Start(); mCurrentStateMachine.RequestState(null, "BreatheIdle"); RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo); CommonWoohoo.RunPostWoohoo(Actor, Target, Shower, definition.GetStyle(this), definition.GetLocation(Shower), true); msg += "H"; Sims3.Gameplay.Objects.Plumbing.Shower.WaitToLeaveShower(Actor, Shower); // Custom ShowerEx.ApplyPostShowerEffects(Actor, Shower); if (flag) { mSwitchOutfitHelper.Dispose(); mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToBathe); mSwitchOutfitHelper.Start(); mSwitchOutfitHelper.Wait(false); mSwitchOutfitHelper.ChangeOutfit(); } msg += "I"; mSwitchOutfitHelper.Dispose(); mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GettingOutOfBath); mSwitchOutfitHelper.Start(); mSwitchOutfitHelper.AddScriptEventHandler(this); mSwitchOutfitHelper.Wait(false); RemoveMotiveDelta(deltaArray[0x0]); TakeShowerInst.RemoveMotiveDelta(deltaArray[0x1]); RemoveMotiveDelta(deltaArray[0x2]); TakeShowerInst.RemoveMotiveDelta(deltaArray[0x3]); RemoveMotiveDelta(deltaArray[0x4]); if (Actor.SimDescription.IsMermaid) { RemoveMotiveDelta(deltaArray[0x5]); } mCurrentStateMachine.RequestState("y", "Exit Working Y"); Target.AutoEnableCensor(); msg += "J"; } mCurrentStateMachine.RemoveActor(Actor); FinishSocial(socialName, true); } msg += "K"; Shower.RemoveFromUseList(Actor); mInUseList = false; Actor.RouteAway(Sims3.Gameplay.Objects.Plumbing.Shower.kMinDistanceToMoveAwayFromShower, Sims3.Gameplay.Objects.Plumbing.Shower.kMaxDistanceToMoveAwayFromShower, false, GetPriority(), true, true, true, RouteDistancePreference.PreferFurthestFromRouteOrigin); if (mSteamVfx != null) { mSteamVfx.Stop(); mSteamVfx = null; } msg += "L"; EndCommodityUpdates(succeeded); return(succeeded); } catch (ResetException) { throw; } catch (Exception exception) { Common.Exception(Actor, Target, exception); return(false); } finally { if (TakeShowerInst != null) { TakeShowerInst.HavingWooHoo = false; } } }
private void displayProducts() { foreach (Control c in panel1.Controls) { c.Hide(); c.Dispose(); panel1.Controls.Remove(c); } Point[] p = new Point[show.Count]; Shower[] prod = new Shower[show.Count]; for (int i = 0; i < prod.GetLength(0); i++) { String name = show[i].NAME; String ide = show[i].IDENTIFIER; prod[i] = new Shower(); prod[i].Height = 90; prod[i].Width = 90; prod[i].Name = "shower"; prod[i].ProductIdentifier = ide; prod[i].Click += (sender2, e2) => addItem(sender2, e2, ide); prod[i].SizeMode = PictureBoxSizeMode.StretchImage; p[i] = new Point(); p[i].X = i * 7; p[i].Y = 0; if (show[i].useOverlay == true) { prod[i].Image = Imaging.makeShower(Databases.getImage(show[i].IDENTIFIER)); } else { prod[i].Image = Databases.getImage(show[i].IDENTIFIER); } prod[i].Paint += new PaintEventHandler((sender, e) => { e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; string text = name; SizeF textSize = e.Graphics.MeasureString(text, Font); PointF locationToDraw = new PointF(); locationToDraw.X = (90 / 2) - (textSize.Width / 2); locationToDraw.Y = 74; e.Graphics.DrawString(text, Font, Brushes.Black, locationToDraw); }); prod[i].PointToClient(p[i]); prod[i].Show(); } FlowLayoutPanel pan = new FlowLayoutPanel(); pan.Location = new Point(0, 0); pan.Size = panel1.Size; pan.Controls.AddRange(prod); pan.AutoScroll = true; panel1.Controls.Add(pan); }
public override bool Run() { try{ if (!Target.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.DefaultEvict, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), Shower.kTimeToWaitToEvict)) { return(false); } try{ mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToBathe); }catch { return(false); } mSwitchOutfitHelper.Start(); if (Actor.HasTrait(TraitNames.Hydrophobic)) { Actor.PlayReaction(ReactionTypes.WhyMe, Target as GameObject, ReactionSpeed.ImmediateWithoutOverlay); } if (Actor.HasTrait(TraitNames.Daredevil)) { TraitTipsManager.ShowTraitTip(0xb82d0015b9294260L, Actor, TraitTipsManager.TraitTipCounterIndex.Daredevil, TraitTipsManager.kDaredevilCountOfShowersTaken); } if (!Actor.RouteToSlotAndCheckInUse(Target, Slot.RoutingSlot_0)) { return(false); } // mSituation=new Shower.ShowerPrivacySituation(this); //if(!mSituation.Start()){ // return(false); //} StandardEntry(); if (!Actor.RouteToSlot(Target, Slot.RoutingSlot_0)) { if (mSituation != null) { mSituation.Exit(); } StandardExit(); return(false); } if (Autonomous) { mPriority = new InteractionPriority(InteractionPriorityLevel.UserDirected); } mSwitchOutfitHelper.Wait(true); bool daredevilPerforming = Actor.DaredevilPerforming; bool flag2 = Actor.GetCurrentOutfitCategoryFromOutfitInGameObject() == OutfitCategories.Singed; EnterStateMachine("Shower", "Enter", "x"); SetActor("Shower", Target); if (mSituation != null) { mSituation.StateMachine = mCurrentStateMachine; } SetParameter("IsShowerTub", Target.IsShowerTub); SetParameter("SimShouldCloseDoor", true); SetParameter("SimShouldClothesChange", ((!daredevilPerforming && !flag2) && !Actor.OccultManager.DisallowClothesChange()) && !Actor.BuffManager.DisallowClothesChange()); bool paramValue = false; if ((Target.BoobyTrapComponent != null) && Target.BoobyTrapComponent.CanTriggerTrap(Actor.SimDescription)) { paramValue = !Actor.OccultManager.DisallowClothesChange() && !Actor.BuffManager.DisallowClothesChange(); } SimDescription description = ((Target.BoobyTrapComponent != null) && (Target.BoobyTrapComponent.TrapSetter != 0L)) ? SimDescription.Find(Target.BoobyTrapComponent.TrapSetter) : null; if (((description != null) && description.IsFairy) && Actor.BuffManager.HasElement(BuffNames.TrickedByAFairy)) { paramValue = false; } SetParameter("isBoobyTrapped", paramValue); mSwitchOutfitHelper.AddScriptEventHandler(this); AddOneShotScriptEventHandler(0x3e9, EventCallbackStartShoweringSound); if (Actor.HasTrait(TraitNames.Virtuoso) || RandomUtil.RandomChance((float)Target.TuningShower.ChanceOfSinging)) { AddOneShotScriptEventHandler(0xc8, EventCallbackStartSinging); } PetStartleBehavior.CheckForStartle(Target as GameObject, StartleType.ShowerOn); AnimateSim("Loop Shower"); Actor.BuffManager.AddElement(BuffNames.SavingWater, Origin.FromShower, ProductVersion.EP2, TraitNames.EnvironmentallyConscious); mShowerStage.ResetCompletionTime(GetShowerTime()); StartStages(); if (Actor.HasTrait(TraitNames.EnvironmentallyConscious)) { BeginCommodityUpdate(CommodityKind.Hygiene, Shower.kEnvironmentallyConsciousShowerSpeedMultiplier); } if (Actor.SimDescription.IsPlantSim) { ModifyCommodityUpdate(CommodityKind.Hygiene, Shower.kPlantSimHygieneModifier); } BeginCommodityUpdates(); if (paramValue) { ApplyBoobyTrapOutfit(); if ((description != null) && description.IsFairy) { Actor.BuffManager.AddElement(BuffNames.TrickedByAFairy, Origin.FromFairy); } } bool succeeded = (false); try{ try{ Target.SimInShower = Actor; succeeded = DoLoop(~( ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), DuringShower, null); if (HavingWooHoo && Actor.HasExitReason(ExitReason.StageComplete)) { succeeded = DoLoop(~( ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached | ExitReason.StageComplete), DuringShower, null); } }finally{ Target.SimInShower = null; } while (HavingWooHoo) { SpeedTrap.Sleep(10); } }finally{ EndCommodityUpdates(succeeded); } Shower.WaitToLeaveShower(Actor, Target); if (succeeded) { Shower.ApplyPostShowerEffects(Actor, Target); } if (paramValue) { SetParameter("isBoobyTrapped", false); AddOneShotScriptEventHandler(0xc9, EventCallbackStopSinging); AddOneShotScriptEventHandler(0x3ea, EventCallbackStopShoweringSound); if ((description != null) && description.IsFairy) { AnimateSim("TriggerFairyTrap"); } else { AnimateSim("Booby Trap Reaction"); } AddOneShotScriptEventHandler(0x3e9, EventCallbackStartShoweringSound); AnimateSim("Loop Shower"); RemoveBoobyTrapOutfit(); SpeedTrap.Sleep(60); } try{ if (flag2 && succeeded) { mSwitchOutfitHelper.Dispose(); try{ mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToBathe); mSwitchOutfitHelper.Start(); mSwitchOutfitHelper.Wait(false); mSwitchOutfitHelper.ChangeOutfit(); }catch {} } bool flag5 = (false); if ((flag2 && succeeded) || (!flag2 && !daredevilPerforming)) { SetParameter("SimShouldClothesChange", !Actor.OccultManager.DisallowClothesChange()); mSwitchOutfitHelper.Dispose(); try{ mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, GetOutfitReason(Actor)); mSwitchOutfitHelper.Start(); mSwitchOutfitHelper.AddScriptEventHandler(this); mSwitchOutfitHelper.Wait(false); }catch {} flag5 = (true); } Target.Cleanable.DirtyInc(Actor); AddOneShotScriptEventHandler(0xc9, EventCallbackStopSinging); AddOneShotScriptEventHandler(0x3ea, EventCallbackStopShoweringSound); if (flag5 && InventingSkill.IsBeingDetonated(Target as GameObject)) { SetParameter("SimShouldClothesChange", false); mSwitchOutfitHelper.Abort(); mSwitchOutfitHelper.Dispose(); } if (Target.Repairable.UpdateBreakage(Actor)) { Target.StartBrokenFXInAnim(mCurrentStateMachine); AnimateSim("Exit Broken"); } else { AnimateSim("Exit Working"); } if ((Actor.SimDescription.IsMummy || Actor.DaredevilPerforming) || (Actor.TraitManager.HasElement(TraitNames.Slob) && RandomUtil.RandomChance01(TraitTuning.SlobTraitChanceToLeavePuddle))) { PuddleManager.AddPuddle(Actor.Position); } if (succeeded) { Actor.BuffManager.RemoveElement(BuffNames.GotFleasHuman); } }finally{ StandardExit(); } return(succeeded); }catch (ResetException exception) { Alive.WriteLog(exception.Message + "\n\n" + exception.StackTrace + "\n\n" + exception.Source); return(false); }catch (Exception exception) { Alive.WriteLog(exception.Message + "\n\n" + exception.StackTrace + "\n\n" + exception.Source); return(false); } }
public override bool Test(Sim a, Shower target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { return(target.Repairable.Broken); }
public static void Prefix(Shower __instance) { GermySinkManager.Instance?.StartGermyWork(__instance); }
public static ApartmentMap Create() { const int width = 8; const int height = 8; var map = new ApartmentMap(); map.Add(new TileWalker(1, width, 1, height).Get(x => new ClickableTile("2/floor", x, false, 0))); map.Add(new TileWalker(0, 1, 1, height - 1).Get(x => new ClickableTile("2/wall147", x, true, 1))); map.Add(new TileWalker(width, 1, 1, height - 1).Get(x => new ClickableTile("2/wall369", x, true, 1))); map.Add(new TileWalker(1, width - 1, 0, 1).Get(x => new ClickableTile("2/wall123top", x, true, 1))); map.Add(new TileWalker(1, width - 1, 1, 1).Get(x => new ClickableTile("2/wall123bot", x, true, 1))); map.Add(new TileWalker(1, width - 1, height, 1).Get(x => new ClickableTile("2/wall789", x, true, 1))); map.Add(new ClickableTile("2/wall124", new TileLocation(0, 0), true, 1)); map.Add(new ClickableTile("2/wall236", new TileLocation(width, 0), true, 1)); map.Add(new ClickableTile("2/wall478", new TileLocation(0, height), true, 1)); map.Add(new ClickableTile("2/wall689", new TileLocation(width, height), true, 1)); map.Add(new ClickableTile("2/bed-top", new TileLocation(1, 2), true, () => World.Publish(new PreparingForBed()), 1)); map.Add(new ClickableTile("2/bed-bot", new TileLocation(1, 3), true, () => World.Publish(new PreparingForBed()), 1)); map.Add(new ClickableTile("2/laundry2", new TileLocation(2, 4), false, () => World.Publish(new HadAThought(Laundry.GetThought())), 1)); map.Add(new ClickableTile("2/door-top", new TileLocation(width - 1, 0), false, () => World.Publish(new HadAThought(Outside.GetThought())), 2)); map.Add(new ClickableTile("2/door-bot", new TileLocation(width - 1, 1), false, () => World.Publish(new HadAThought(Outside.GetThought())), 2)); map.Add(new ClickableTile("2/security1", new TileLocation(width - 2, 1), false, 2)); map.Add(new ClickableTile("2/boxofstims", new TileLocation(1, height - 2), true, () => World.Publish(new HadAThought(BottleBox.GetThought())), 2)); map.Add(new ClickableTile("2/tv1", new TileLocation(1, 0), false, 2)); map.Add(new ClickableTile("2/shower-top", new TileLocation(width - 1, 5), true, () => World.Publish(new HadAThought(Shower.GetThought())), 2)); map.Add(new ClickableTile("2/shower-bot", new TileLocation(width - 1, 6), true, () => World.Publish(new HadAThought(Shower.GetThought())), 2)); map.Add(new ClickableTile("2/sink-right", new TileLocation(width - 1, 7), true, 2)); map.Add(new ClickableTile("2/poster1-top", new TileLocation(4, 0), false, 2)); map.Add(new ClickableTile("2/poster1-bot", new TileLocation(4, 1), false, 2)); map.Add(new ClickableTile("2/desk1-1", new TileLocation(width / 2 - 1, height - 3), true, () => World.Publish(new HadAThought(ComputerRig.GetThought())), 2)); map.Add(new ClickableTile("2/desk1-2", new TileLocation(width / 2, height - 3), true, () => World.Publish(new HadAThought(ComputerRig.GetThought())), 2)); map.Add(new ClickableTile("2/desk1-3", new TileLocation(width / 2 - 1, height - 2), true, () => World.Publish(new HadAThought(ComputerRig.GetThought())), 2)); map.Add(new ClickableTile("2/desk1-4", new TileLocation(width / 2, height - 2), true, () => World.Publish(new HadAThought(ComputerRig.GetThought())), 2)); var counter = new FoodCounter(new TileLocation(width - 1, 3)); map.Add(counter.Tile); map.Add(counter.FoodTile); return(map); }
private void OpenSelectedShowerFile(string _filename) { if (!string.IsNullOrEmpty(_filename) && File.Exists(_filename)) { try { Shower _shower = DeSerializeShower(_filename); if (_shower != null) { YankeeSpeed = _shower.YankeeSpeed; YankeeWidth = _shower.YankeeWidth; YankeeDiameter = _shower.YankeeDiameter; DwellDistance = _shower.DwellDistance; OperatingPressure = _shower.OperatingPressure; ShowerTemperature = _shower.ShowerTemperature; CoverageColour = _shower.CoverageColour; Nozzles.Clear(); int ctr = 0; NozzleControl nc; foreach (SerializedNozzle _sernozzle in _shower.Nozzles) { ctr++; nc = new NozzleControl { NozzleID = ctr, NozzleOrificeID = _sernozzle.NozzleOrificeID, NozzleSpacing = _sernozzle.NozzleSpacing, NozzleToYankee = _sernozzle.NozzleToYankee, SprayRotation = _sernozzle.SprayRotation, SprayAngle = _sernozzle.SprayAngle, NozzlePressure = _sernozzle.NozzlePressure, NozzleTypeName = _sernozzle.NozzleTypeName, NozzleSprayWidth = _sernozzle.NozzleSprayWidth, MaximumSprayAngle = _sernozzle.MaximumSprayAngle, NozzleFlow = _sernozzle.NozzleFlow, SprayPattern = _sernozzle.SprayPattern, NozzleTypes = NozzleTypes }; Nozzles.Add(nc); } NumberNozzles = ctr; MenuItems = MRUList.AddFile(MenuItems, _filename, OpenShowerFile); } else { //MenuItems = MRUList.RemoveFile(MenuItems, _filename); MessageBox.Show("The shower file appears to be corrupted and cannot be loaded.", "Unable to load shower file", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK); } } catch { //MenuItems = MRUList.RemoveFile(MenuItems, _filename); MessageBox.Show("The shower file appears to be corrupted and cannot be loaded.", "Unable to load shower file", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK); } } else { MenuItems = MRUList.RemoveFile(MenuItems, _filename); } }