private void btnTotalCost_Click(object sender, EventArgs e) { double totalCost; int numberofguests; int.TryParse(txtNumberOfGuest.Text,out numberofguests); if (cboPartyType.SelectedItem.ToString() == "Wedding") { WeddingParty weddingParty = new WeddingParty(chkFancyDecoration.Checked , numberofguests); totalCost = weddingParty.GetTotalCost(); } else if (cboPartyType.SelectedItem.ToString() == "Birthday") { double cakeSize; double.TryParse(txtBirthdayCakeSize.Text, out cakeSize); BirthdayParty birthdayParty = new BirthdayParty(numberofguests, cakeSize); totalCost = birthdayParty.GetTotalCost(); } else { Party party = new Party(numberofguests); totalCost = party.GetTotalCost(); } lblTotalCost.Text = "Total cost for your event will be: BDT " + totalCost.ToString("0.00"); }
public Form1() { InitializeComponent(); dinnerParty = new DinnerParty((int)numericUpDown1.Value, healthyBox.Checked, fancyBox.Checked); DisplayDinnerPartyCost(); birthdayParty = new BirthdayParty((int)numberBirthday.Value, fancyBirthday.Checked, txtCakeWriting.Text); DisplayBirthdayPartyCost(); }
public void NegativeCakeWritingTooLongTest() { //arrange int numberOfPeople = 35; bool fancyDecoration = true; string cakeWriting = "Happy Birthday"; //act BirthdayParty party = new BirthdayParty(numberOfPeople, fancyDecoration, cakeWriting); party.CakeSize(); party.MaxWritingLength(); bool actual1 = party.CakeWritingTooLong; //assert }
public override bool UseItem(Player player) { BirthdayParty.ToggleManualParty(); NetMessage.SendData(MessageID.WorldData); if (!NPC.AnyNPCs(NPCID.PartyGirl)) { NPC.SpawnOnPlayer(player.whoAmI, NPCID.PartyGirl); } Main.NewText("Looks like someone's throwing a Party!", new Color(255, 0, 160)); Main.PlaySound(28, player.position); return(true); }
public void T08_AddPartyOrderedTest() { Controller target = new Controller(); // TODO: Initialize to an appropriate value DinnerParty d1 = new DinnerParty(10, false); target.AddParty(d1); BirthdayParty b1 = new BirthdayParty(20, true, "Hello"); target.AddParty(b1); Assert.AreEqual(2, target.PartyList.Count, "Nach zwei hinzugefügten Party sollten zwei Party in der Collection sein!"); Assert.AreEqual(b1, target.PartyList[0], "Die teuerste Party sollte an erster Stelle der Liste stehen!"); target.AddParty(new DinnerParty(100, true)); Assert.AreEqual(b1, target.PartyList[1], "Die teuerste Party sollte an erster Stelle der Liste stehen!"); target.AddParty(new DinnerParty(1, false)); Assert.AreEqual(1, target.PartyList[3].NumberOfPeople, "Die günstigste Party sollte an letzter Stelle der Liste stehen!"); target.AddParty(new DinnerParty(2, false)); Assert.AreEqual(2, target.PartyList[3].NumberOfPeople, "Die zweitgünstigste Party sollte an vorletzter Stelle der Liste stehen!"); }
private static void Main(string[] args) { string[] parties; string[] partyData; bool headingsNotRead = true; Controller controller = new Controller(); parties = File.ReadAllLines("Parties.csv"); foreach (string party in parties) { //Partytyp; Personenanzahl; Spezielle Deko; Tortentext; //B; 10; nein; Franz; //D; 15; nein; ; //D; 7; ja; ; //B; 5; ja; Happy Birthday; if (headingsNotRead) { headingsNotRead = false; } else { bool specialDecoration = false; partyData = party.Split(';'); if (partyData[2].Contains("j")) { specialDecoration = true; } if (partyData[0].Contains("B")) { BirthdayParty birthdayParty = new BirthdayParty(Convert.ToInt32(partyData[1]), specialDecoration, partyData[3]); controller.AddParty(birthdayParty); } else { DinnerParty dinnerParty = new DinnerParty(Convert.ToInt32(partyData[1]), specialDecoration); controller.AddParty(dinnerParty); } } } Console.WriteLine($"Gesamtkosten aller Parties: {controller.CalculateTotalCosts(),6}"); }
public void CakeSizeTest() { //arrange int numberOfPeople1 = 15; int numberOfPeople2 = 3; bool fancyDecoration = true; string cakeWriting = "Happy"; int expected1 = 16; int expected2 = 8; //act BirthdayParty party1 = new BirthdayParty(numberOfPeople1, fancyDecoration, cakeWriting); int actual1 = party1.CakeSize(); BirthdayParty party2 = new BirthdayParty(numberOfPeople2, fancyDecoration, cakeWriting); int actual2 = party2.CakeSize(); //assert Assert.AreEqual(expected1, actual1); Assert.AreEqual(expected2, actual2); }
public override bool?UseItem(Player player) { if (player.altFunctionUse == ItemAlternativeFunctionID.ActivatedAndUsed) { Main.sundialCooldown = 0; if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendData(MessageID.WorldData, number: Main.myPlayer, number2: 3f); return(true); } Main.fastForwardTime = true; NetMessage.SendData(MessageID.WorldData); SoundEngine.PlaySound(SoundID.Item4, player.position); } else { Main.dayTime = !Main.dayTime; Main.time = 0; Chest.SetupTravelShop(); //change moon phases when switching to night if (!Main.dayTime && ++Main.moonPhase > 7) { Main.moonPhase = 0; } if (Main.dayTime) { BirthdayParty.CheckMorning(); } else { BirthdayParty.CheckNight(); } } return(true); }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { //if (!UIUtils.IsOkayToStartModalDialog()) return false; bool hasExclusiveAccess; Lot partyVenue = GetVenue(parameters.mActor, out hasExclusiveAccess); float num2; OutfitCategories formalwear; Sims3.Gameplay.Situations.Party party = null; bool isPartyAtHome = (partyVenue == parameters.mActor.LotHome); if (partyVenue == null) { return(OptionResult.Failure); } if (!parameters.mActor.IsSelectable) { return(OptionResult.Failure); } PartyPickerDialog.PartyType partyTypes = PartyPickerDialog.PartyType.kAll; // Keep as GameUtils if (GameUtils.IsOnVacation()) { partyTypes &= ~PartyPickerDialog.PartyType.kBirthday; } if (partyVenue.LastDiedSim == null) { partyTypes &= ~PartyPickerDialog.PartyType.kFuneral; } Sim actorSim = parameters.mActor as Sim; Political job = actorSim.Occupation as Political; if ((job == null) || (!job.HasCampaignMoneyMetric())) { partyTypes &= ~PartyPickerDialog.PartyType.kCampaign; } partyTypes &= ~PartyPickerDialog.PartyType.kWedding; foreach (Sim sim in CommonSpace.Helpers.Households.AllSims(parameters.mActor.Household)) { if (sim.IsEngaged) { partyTypes |= PartyPickerDialog.PartyType.kWedding; break; } } if (!GameUtils.IsInstalled(ProductVersion.EP4)) { partyTypes &= ~PartyPickerDialog.PartyType.kBachelorParty; partyTypes &= ~PartyPickerDialog.PartyType.kChildSlumberParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenSlumberParty; } else { if (isPartyAtHome) { if (!actorSim.SimDescription.Child) { partyTypes &= ~PartyPickerDialog.PartyType.kChildSlumberParty; } if (!actorSim.SimDescription.Teen) { partyTypes &= ~PartyPickerDialog.PartyType.kTeenParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenSlumberParty; } } else { partyTypes &= ~PartyPickerDialog.PartyType.kChildSlumberParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenSlumberParty; } } partyTypes &= ~PartyPickerDialog.PartyType.kPoolParty; partyTypes &= ~PartyPickerDialog.PartyType.kFeastParty; partyTypes &= ~PartyPickerDialog.PartyType.kCostumeParty; partyTypes &= ~PartyPickerDialog.PartyType.kGiftGivingParty; if (GameUtils.IsInstalled(ProductVersion.EP8) /*&& isPartyAtHome*/) { partyTypes |= PartyPickerDialog.PartyType.kFeastParty; partyTypes |= PartyPickerDialog.PartyType.kCostumeParty; partyTypes |= PartyPickerDialog.PartyType.kGiftGivingParty; //if (PoolParty.CanSimThrowPoolParty(actorSim)) if (partyVenue.GetSwimmingPoolCount() > 0) { partyTypes |= PartyPickerDialog.PartyType.kPoolParty; } } partyTypes &= ~PartyPickerDialog.PartyType.kJuiceKeggerParty; partyTypes &= ~PartyPickerDialog.PartyType.kBonfire; partyTypes &= ~PartyPickerDialog.PartyType.kTailgatingParty; partyTypes &= ~PartyPickerDialog.PartyType.kVideoGameLANParty; partyTypes &= ~PartyPickerDialog.PartyType.kMasqueradeBall; partyTypes &= ~PartyPickerDialog.PartyType.kVictoryParty; if (GameUtils.IsInstalled(ProductVersion.EP9)) { partyTypes |= PartyPickerDialog.PartyType.kTailgatingParty; partyTypes |= PartyPickerDialog.PartyType.kVideoGameLANParty; partyTypes |= PartyPickerDialog.PartyType.kMasqueradeBall; partyTypes |= PartyPickerDialog.PartyType.kVictoryParty; if (JuiceKeggerParty.CanSimThrowJuiceKeggerParty(actorSim)) { partyTypes |= PartyPickerDialog.PartyType.kJuiceKeggerParty; } if (BonfireParty.CanSimThrowBonfire(actorSim)) { partyTypes |= PartyPickerDialog.PartyType.kBonfire; } } bool criteriaCanceled; SimSelection list = SimSelection.Create(Common.Localize("Party:SelectTitle"), actorSim.SimDescription, this, GetCriteria(parameters), false, false, out criteriaCanceled); if (list.IsEmpty) { SimpleMessageDialog.Show(Common.LocalizeEAString("Gameplay/Objects/Electronics/Phone/CallThrowParty:NoSimsWT"), Common.LocalizeEAString(parameters.mActor.IsFemale, "Gameplay/Objects/Electronics/Phone/CallThrowParty:NoSims", new object[] { parameters.mActor }), ModalDialog.PauseMode.PauseSimulator); return(OptionResult.Failure); } float openHour = -1f; float closingHour = -1f; PartyPickerDialog.PartyInfo info = PartyPickerDialogEx.Show(partyTypes, list.GetPickerInfo(), parameters.mActor.GetThumbnailKey(), isPartyAtHome, 25, -1, openHour, closingHour, PartyPickerDialog.ClothingType.kNone, actorSim.IsFemale); if ((info == null) || (info.PartyType == PartyPickerDialog.PartyType.kNone)) { return(OptionResult.Failure); } float hoursPassedOfDay = SimClock.HoursPassedOfDay; if (hoursPassedOfDay > info.Time) { num2 = 24f - (hoursPassedOfDay - info.Time); } else { num2 = info.Time - hoursPassedOfDay; } if (num2 < 1f) { num2 += 24f; } long ticks = SimClock.ConvertToTicks(num2, TimeUnit.Hours); DateAndTime startTime = SimClock.CurrentTime() + new DateAndTime(ticks); bool bHostIsLegendary = actorSim.HasTrait(TraitNames.LegendaryHost); float fMaxLTR = 0f; LTRData data = LTRData.Get(LongTermRelationshipTypes.Friend); if (data != null) { fMaxLTR = data.Liking - 1; } List <SimDescription> simList = new List <SimDescription>(); foreach (object obj2 in info.SimList) { SimDescription simDescription = obj2 as SimDescription; if ((simDescription != null) && CanSimBeInvitedToParty(simDescription, partyVenue, actorSim, fMaxLTR, bHostIsLegendary, true)) { if (!simList.Contains(simDescription)) { simList.Add(simDescription); if (simDescription.TraitManager.HasElement(TraitNames.PartyAnimal)) { Sim createdSim = simDescription.CreatedSim; if (createdSim != null) { TraitTipsManager.ShowTraitTip(13271263770231522640L, createdSim, TraitTipsManager.TraitTipCounterIndex.PartyAnimal, TraitTipsManager.kPartyAnimalCountOfParties); } } if (simDescription.IsCelebrity) { EventTracker.SendEvent(EventTypeId.kPartyInviteCeleb, parameters.mActor); } } bool bShouldMatchAge = (simDescription.Age == actorSim.SimDescription.Age) && ((simDescription.Teen) || (simDescription.Child)); if (!hasExclusiveAccess && RandomUtil.RandomChance(HouseParty.HousePartyParams.PercentageChanceOfBringingAFriend)) { SimDescription friend = SocialComponent.FindFriendNotInList(simDescription, simList, parameters.mActor.LotHome, bShouldMatchAge); if ((friend != null) && CanSimBeInvitedToParty(friend, partyVenue, null, 0f, false, false)) { simList.Add(friend); } } } } DateAndTime time = startTime; time.Ticks -= SimClock.ConvertToTicks(Sims3.Gameplay.Situations.Party.HoursToStartRentBeforePartyStart, TimeUnit.Hours); if (time.CompareTo(SimClock.CurrentTime()) < 0) { time = SimClock.Add(SimClock.CurrentTime(), TimeUnit.Minutes, 2f); } if ((partyVenue != parameters.mActor.LotHome) && !RentScheduler.Instance.RentLot(partyVenue, actorSim, time, simList, hasExclusiveAccess)) { SimpleMessageDialog.Show(string.Empty, Phone.Call.LocalizeCallString("ThrowParty", "CantRent", new object[] { parameters.mActor }), ModalDialog.PauseMode.PauseSimulator); return(OptionResult.Failure); } switch (info.ClothingType) { case PartyPickerDialog.ClothingType.kFormal: formalwear = OutfitCategories.Formalwear; break; case PartyPickerDialog.ClothingType.kCasual: formalwear = OutfitCategories.Everyday; break; case PartyPickerDialog.ClothingType.kSwimwear: formalwear = OutfitCategories.Swimwear; break; case PartyPickerDialog.ClothingType.kCostumes: formalwear = OutfitCategories.Everyday; break; default: formalwear = OutfitCategories.Everyday; break; } float infoTime = info.Time; switch (info.PartyType) { case PartyPickerDialog.PartyType.kCampaign: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:FundraiserTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:FundraiserStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new CampaignFundraiser(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewFundraiser, parameters.mActor); break; case PartyPickerDialog.PartyType.kBirthday: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:BirthdayTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:BirthdayStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new BirthdayParty(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kWedding: string messageText = string.Empty; if (GameUtils.IsInstalled(ProductVersion.EP4)) { messageText = Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:WeddingStartWithArch", new object[] { infoTime }); } else { messageText = Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:WeddingStart", new object[] { infoTime }); } SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:WeddingTitle"), messageText, ModalDialog.PauseMode.PauseSimulator); EnsureFianceeIsInvitedToWeddingParty(actorSim, simList); party = new WeddingParty(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kFuneral: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:FuneralTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:FuneralStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new Funeral(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kBachelorParty: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:BachelorPartyTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:BachelorStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new BachelorParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewBachelorParty, actorSim); actorSim.SimDescription.SetHadBachelorParty(); break; case PartyPickerDialog.PartyType.kTeenParty: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:TeenPartyTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:TeenStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new TeenParty(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kChildSlumberParty: case PartyPickerDialog.PartyType.kTeenSlumberParty: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:SlumberPartyTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:SlumberStart", new object[] { infoTime, actorSim }), ModalDialog.PauseMode.PauseSimulator); party = new SlumberParty(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kCostumeParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:CostumePartyTitle", new object[0x0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:CostumePartyStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new CostumeParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kCostumePartyScheduled, actorSim); break; case PartyPickerDialog.PartyType.kGiftGivingParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:GiftGivingPartyTitle", new object[0x0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:GiftGivingPartyStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new GiftGivingParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kGiftGivingPartyScheduled, actorSim); break; case PartyPickerDialog.PartyType.kPoolParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:PoolPartyTitle", new object[0x0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:PoolPartyStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new PoolParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kSchedulePoolParty, actorSim); break; case PartyPickerDialog.PartyType.kFeastParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:FeastPartyTitle", new object[0x0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:FeastPartyStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new FeastParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kFeastPartyScheduled, actorSim); break; case PartyPickerDialog.PartyType.kJuiceKeggerParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:JuiceKeggerPartyTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:JuiceKeggerStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new JuiceKeggerParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewJuiceKeggerParty, actorSim); break; case PartyPickerDialog.PartyType.kTailgatingParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:TailgatingPartyTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:TailgatingStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new TailgatingParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewTailgatingParty, actorSim); break; case PartyPickerDialog.PartyType.kBonfire: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:BonfireTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:BonfireStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new BonfireParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewBonfireParty, actorSim); break; case PartyPickerDialog.PartyType.kVideoGameLANParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:VideoGameLANPartyTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:VideoGameLANStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new VideoGameLANParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewVideoGameLANParty, actorSim); break; case PartyPickerDialog.PartyType.kMasqueradeBall: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:MasqueradeBallTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:MasqueradeStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new MasqueradeBall(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewMasqueradeBall, actorSim); break; case PartyPickerDialog.PartyType.kVictoryParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:VictoryPartyTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:VictoryStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new VictoryParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewVictoryParty, actorSim); break; default: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:GenericTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:HouseStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new HouseParty(partyVenue, actorSim, simList, formalwear, startTime); break; } if (party == null) { return(OptionResult.Failure); } foreach (SimDescription sim in party.GuestDescriptions) { Instantiation.EnsureInstantiate(sim, party.Lot); } EventTracker.SendEvent(new PartyEvent(EventTypeId.kThrewParty, actorSim, actorSim.SimDescription, party)); if (actorSim.HasTrait(TraitNames.PartyAnimal)) { TraitTipsManager.ShowTraitTip(13271263770231522640L, actorSim, TraitTipsManager.TraitTipCounterIndex.PartyAnimal, TraitTipsManager.kPartyAnimalCountOfParties); } return(OptionResult.SuccessClose); }
internal static bool ClearEvents(ref bool eventOccurring) { bool canClearEvent = FargoWorld.AbomClearCD <= 0; if (Main.invasionType != 0) { eventOccurring = true; if (canClearEvent) { Main.invasionType = 0; } } if (Main.pumpkinMoon) { eventOccurring = true; if (canClearEvent) { Main.pumpkinMoon = false; } } if (Main.snowMoon) { eventOccurring = true; if (canClearEvent) { Main.snowMoon = false; } } if (Main.eclipse) { eventOccurring = true; if (canClearEvent) { Main.eclipse = false; } } if (Main.bloodMoon) { eventOccurring = true; if (canClearEvent) { Main.bloodMoon = false; } } if (Main.raining) { eventOccurring = true; if (canClearEvent) { Main.raining = false; } } if (Main.slimeRain) { eventOccurring = true; if (canClearEvent) { Main.StopSlimeRain(); Main.slimeWarningDelay = 1; Main.slimeWarningTime = 1; } } if (BirthdayParty.PartyIsUp) { eventOccurring = true; if (canClearEvent) { BirthdayParty.WorldClear(); } } if (DD2Event.Ongoing) { eventOccurring = true; if (canClearEvent) { DD2Event.StopInvasion(); } } if (Sandstorm.Happening) { eventOccurring = true; if (canClearEvent) { Sandstorm.Happening = false; Sandstorm.TimeLeft = 0; } } if (NPC.LunarApocalypseIsUp || NPC.ShieldStrengthTowerNebula > 0 || NPC.ShieldStrengthTowerSolar > 0 || NPC.ShieldStrengthTowerStardust > 0 || NPC.ShieldStrengthTowerVortex > 0) { eventOccurring = true; if (canClearEvent) { NPC.LunarApocalypseIsUp = false; NPC.ShieldStrengthTowerNebula = 0; NPC.ShieldStrengthTowerSolar = 0; NPC.ShieldStrengthTowerStardust = 0; NPC.ShieldStrengthTowerVortex = 0; // Purge all towers for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && (Main.npc[i].type == NPCID.LunarTowerNebula || Main.npc[i].type == NPCID.LunarTowerSolar || Main.npc[i].type == NPCID.LunarTowerStardust || Main.npc[i].type == NPCID.LunarTowerVortex)) { Main.npc[i].dontTakeDamage = false; Main.npc[i].GetGlobalNPC <FargoGlobalNPC>().NoLoot = true; Main.npc[i].StrikeNPCNoInteraction(int.MaxValue, 0f, 0); } } } } foreach (MutantSummonInfo summon in summonTracker.EventSummons) { if ((bool)ModLoader.GetMod(summon.modSource).Call("AbominationnClearEvents", canClearEvent)) { eventOccurring = true; } } if (eventOccurring && canClearEvent) { FargoWorld.AbomClearCD = 7200; } return(eventOccurring && canClearEvent); }
static List <party> CreatePartiesWithManualInput() { List <party> parties = new List <party>(); bool stopCreatingParties = false; EParty partyKeuze; int aantal; bool isLuxe; while (!stopCreatingParties) { try { Console.WriteLine("Wilt u een dinner(1) of birthday(2) party?"); String partyInputKeuze = Console.ReadLine(); if (partyInputKeuze == null || !(partyInputKeuze == "1" || partyInputKeuze == "2")) { throw new PartyException("Je moet kiezen tussen dinner (1) of birtday (2)"); } partyKeuze = partyInputKeuze == "1" ? EParty.DINNER : EParty.BIRTHDAY; } catch (PartyException) { continue; } try { Console.WriteLine("Geef het aantal personen voor u feestje?"); String aantalPersonenKeuze = Console.ReadLine(); if (!int.TryParse(aantalPersonenKeuze, out aantal)) { throw new PartyException("Geef het aantal personen voor uw feestje!"); } } catch (PartyException) { continue; } try { Console.WriteLine("Wilt u een luxe(Y) of geen luxe(N) party?"); String luxeInputKeuze = Console.ReadLine().ToUpper(); if (luxeInputKeuze == null || !(luxeInputKeuze == "Y" || luxeInputKeuze == "N")) { throw new PartyException("U moet Y of N invullen!"); } isLuxe = luxeInputKeuze == "Y"; } catch (PartyException) { continue; } try { if (partyKeuze == EParty.DINNER) { Console.WriteLine("Wilt u een gezonde(Y) of geen gezonde(N) party?"); String gezondeInputKeuze = Console.ReadLine().ToUpper(); if (gezondeInputKeuze == null || !(gezondeInputKeuze == "Y" || gezondeInputKeuze == "N")) { throw new PartyException("U moet Y of N invullen!"); } bool isGezondeKeuze = gezondeInputKeuze == "Y"; DinnerParty dp = new DinnerParty(aantal, isGezondeKeuze, isLuxe); parties.Add(dp); } else { //If Birtday party => Boodschap?. //Maak nieuwe party aan en voeg toe aan lijst Console.WriteLine("Welk bericht wilt u op de taart?(leeg laten indien geen)"); String taartInputKeuze = Console.ReadLine(); BirthdayParty bp = new BirthdayParty(aantal, isLuxe, taartInputKeuze); parties.Add(bp); } } catch (PartyException) { continue; } try { Console.WriteLine("Wilt u een feestje toevoegen(Y) of stoppen(N)?"); String nogFeestjeInputKeuze = Console.ReadLine().ToUpper(); if (nogFeestjeInputKeuze == null || !(nogFeestjeInputKeuze == "Y" || nogFeestjeInputKeuze == "N")) { throw new PartyException("U moet Y of N invullen!"); } stopCreatingParties = nogFeestjeInputKeuze == "N"; } catch (PartyException) { continue; } } return(parties); }
public IActionResult PlanYourVisit(ShoppingCartViewModel shoppingCart) { ApplicationUser user = null; var viewModel = new ShoppingCartViewModel { Price = _context.Prices.Single(), Event = _context.Events.ToList(), User = user, OrderDetail = shoppingCart.OrderDetail }; if (User.IsInRole("user")) { user = _userManager.FindByNameAsync(User.Identity.Name).Result; } if (shoppingCart.OrderDetail != null) { _context.OrderDetails.Add(shoppingCart.OrderDetail); } if (shoppingCart.BirthDayParty != null) { BirthdayParty bp = shoppingCart.BirthDayParty; bp.IsAdminAccepted = "N/A"; _context.BirthdayParties.Add(bp); viewModel = new ShoppingCartViewModel { Event = _context.Events.ToList(), User = user, }; ViewData["birthday"] = "true"; } if (shoppingCart.SchoolTrip != null) { SchoolTrip st = shoppingCart.SchoolTrip; st.IsAdminAccepted = "N/A"; _context.SchoolTrips.Add(st); viewModel = new ShoppingCartViewModel { Event = _context.Events.ToList(), User = user, }; ViewData["schooltrip"] = "true"; } if (shoppingCart.SleepOver != null) { SleepOver so = shoppingCart.SleepOver; so.IsAdminAccepted = "N/A"; _context.SleepOvers.Add(so); viewModel = new ShoppingCartViewModel { Event = _context.Events.ToList(), User = user, }; ViewData["sleepover"] = "true"; } if (shoppingCart.OrderDetail != null) { ViewData["orderplaced"] = "true"; viewModel = new ShoppingCartViewModel { Price = _context.Prices.Single(), Event = _context.Events.ToList(), User = user, OrderDetail = shoppingCart.OrderDetail }; } _context.SaveChanges(); return(View(viewModel)); }
protected override OptionResult Run(GameHitParameters<GameObject> parameters) { //if (!UIUtils.IsOkayToStartModalDialog()) return false; bool hasExclusiveAccess; Lot partyVenue = GetVenue(parameters.mActor, out hasExclusiveAccess); float num2; OutfitCategories formalwear; Sims3.Gameplay.Situations.Party party = null; bool isPartyAtHome = (partyVenue == parameters.mActor.LotHome); if (partyVenue == null) { return OptionResult.Failure; } if (!parameters.mActor.IsSelectable) { return OptionResult.Failure; } PartyPickerDialog.PartyType partyTypes = PartyPickerDialog.PartyType.kAll; // Keep as GameUtils if (GameUtils.IsOnVacation()) { partyTypes &= ~PartyPickerDialog.PartyType.kBirthday; } if (partyVenue.LastDiedSim == null) { partyTypes &= ~PartyPickerDialog.PartyType.kFuneral; } Sim actorSim = parameters.mActor as Sim; Political job = actorSim.Occupation as Political; if ((job == null) || (!job.HasCampaignMoneyMetric())) { partyTypes &= ~PartyPickerDialog.PartyType.kCampaign; } partyTypes &= ~PartyPickerDialog.PartyType.kWedding; foreach (Sim sim in CommonSpace.Helpers.Households.AllSims(parameters.mActor.Household)) { if (sim.IsEngaged) { partyTypes |= PartyPickerDialog.PartyType.kWedding; break; } } if (!GameUtils.IsInstalled(ProductVersion.EP4)) { partyTypes &= ~PartyPickerDialog.PartyType.kBachelorParty; partyTypes &= ~PartyPickerDialog.PartyType.kChildSlumberParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenSlumberParty; } else { if (isPartyAtHome) { if (!actorSim.SimDescription.Child) { partyTypes &= ~PartyPickerDialog.PartyType.kChildSlumberParty; } if (!actorSim.SimDescription.Teen) { partyTypes &= ~PartyPickerDialog.PartyType.kTeenParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenSlumberParty; } } else { partyTypes &= ~PartyPickerDialog.PartyType.kChildSlumberParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenParty; partyTypes &= ~PartyPickerDialog.PartyType.kTeenSlumberParty; } } partyTypes &= ~PartyPickerDialog.PartyType.kPoolParty; partyTypes &= ~PartyPickerDialog.PartyType.kFeastParty; partyTypes &= ~PartyPickerDialog.PartyType.kCostumeParty; partyTypes &= ~PartyPickerDialog.PartyType.kGiftGivingParty; if (GameUtils.IsInstalled(ProductVersion.EP8) /*&& isPartyAtHome*/) { partyTypes |= PartyPickerDialog.PartyType.kFeastParty; partyTypes |= PartyPickerDialog.PartyType.kCostumeParty; partyTypes |= PartyPickerDialog.PartyType.kGiftGivingParty; //if (PoolParty.CanSimThrowPoolParty(actorSim)) if (partyVenue.GetSwimmingPoolCount() > 0) { partyTypes |= PartyPickerDialog.PartyType.kPoolParty; } } partyTypes &= ~PartyPickerDialog.PartyType.kJuiceKeggerParty; partyTypes &= ~PartyPickerDialog.PartyType.kBonfire; partyTypes &= ~PartyPickerDialog.PartyType.kTailgatingParty; partyTypes &= ~PartyPickerDialog.PartyType.kVideoGameLANParty; partyTypes &= ~PartyPickerDialog.PartyType.kMasqueradeBall; partyTypes &= ~PartyPickerDialog.PartyType.kVictoryParty; if (GameUtils.IsInstalled(ProductVersion.EP9)) { partyTypes |= PartyPickerDialog.PartyType.kTailgatingParty; partyTypes |= PartyPickerDialog.PartyType.kVideoGameLANParty; partyTypes |= PartyPickerDialog.PartyType.kMasqueradeBall; partyTypes |= PartyPickerDialog.PartyType.kVictoryParty; if (JuiceKeggerParty.CanSimThrowJuiceKeggerParty(actorSim)) { partyTypes |= PartyPickerDialog.PartyType.kJuiceKeggerParty; } if (BonfireParty.CanSimThrowBonfire(actorSim)) { partyTypes |= PartyPickerDialog.PartyType.kBonfire; } } bool criteriaCanceled; SimSelection list = SimSelection.Create(Common.Localize("Party:SelectTitle"), actorSim.SimDescription, this, GetCriteria(parameters), false, false, out criteriaCanceled); if (list.IsEmpty) { SimpleMessageDialog.Show(Common.LocalizeEAString("Gameplay/Objects/Electronics/Phone/CallThrowParty:NoSimsWT"), Common.LocalizeEAString(parameters.mActor.IsFemale, "Gameplay/Objects/Electronics/Phone/CallThrowParty:NoSims", new object[] { parameters.mActor }), ModalDialog.PauseMode.PauseSimulator); return OptionResult.Failure; } float openHour = -1f; float closingHour = -1f; PartyPickerDialog.PartyInfo info = PartyPickerDialogEx.Show(partyTypes, list.GetPickerInfo(), parameters.mActor.GetThumbnailKey(), isPartyAtHome, 25, -1, openHour, closingHour, PartyPickerDialog.ClothingType.kNone, actorSim.IsFemale); if ((info == null) || (info.PartyType == PartyPickerDialog.PartyType.kNone)) { return OptionResult.Failure; } float hoursPassedOfDay = SimClock.HoursPassedOfDay; if (hoursPassedOfDay > info.Time) { num2 = 24f - (hoursPassedOfDay - info.Time); } else { num2 = info.Time - hoursPassedOfDay; } if (num2 < 1f) { num2 += 24f; } long ticks = SimClock.ConvertToTicks(num2, TimeUnit.Hours); DateAndTime startTime = SimClock.CurrentTime() + new DateAndTime(ticks); bool bHostIsLegendary = actorSim.HasTrait(TraitNames.LegendaryHost); float fMaxLTR = 0f; LTRData data = LTRData.Get(LongTermRelationshipTypes.Friend); if (data != null) { fMaxLTR = data.Liking - 1; } List<SimDescription> simList = new List<SimDescription>(); foreach (object obj2 in info.SimList) { SimDescription simDescription = obj2 as SimDescription; if ((simDescription != null) && CanSimBeInvitedToParty(simDescription, partyVenue, actorSim, fMaxLTR, bHostIsLegendary, true)) { if (!simList.Contains(simDescription)) { simList.Add(simDescription); if (simDescription.TraitManager.HasElement(TraitNames.PartyAnimal)) { Sim createdSim = simDescription.CreatedSim; if (createdSim != null) { TraitTipsManager.ShowTraitTip(13271263770231522640L, createdSim, TraitTipsManager.TraitTipCounterIndex.PartyAnimal, TraitTipsManager.kPartyAnimalCountOfParties); } } if (simDescription.IsCelebrity) { EventTracker.SendEvent(EventTypeId.kPartyInviteCeleb, parameters.mActor); } } bool bShouldMatchAge = (simDescription.Age == actorSim.SimDescription.Age) && ((simDescription.Teen) || (simDescription.Child)); if (!hasExclusiveAccess && RandomUtil.RandomChance(HouseParty.HousePartyParams.PercentageChanceOfBringingAFriend)) { SimDescription friend = SocialComponent.FindFriendNotInList(simDescription, simList, parameters.mActor.LotHome, bShouldMatchAge); if ((friend != null) && CanSimBeInvitedToParty(friend, partyVenue, null, 0f, false, false)) { simList.Add(friend); } } } } DateAndTime time = startTime; time.Ticks -= SimClock.ConvertToTicks(Sims3.Gameplay.Situations.Party.HoursToStartRentBeforePartyStart, TimeUnit.Hours); if (time.CompareTo(SimClock.CurrentTime()) < 0) { time = SimClock.Add(SimClock.CurrentTime(), TimeUnit.Minutes, 2f); } if ((partyVenue != parameters.mActor.LotHome) && !RentScheduler.Instance.RentLot(partyVenue, actorSim, time, simList, hasExclusiveAccess)) { SimpleMessageDialog.Show(string.Empty, Phone.Call.LocalizeCallString("ThrowParty", "CantRent", new object[] { parameters.mActor }), ModalDialog.PauseMode.PauseSimulator); return OptionResult.Failure; } switch (info.ClothingType) { case PartyPickerDialog.ClothingType.kFormal: formalwear = OutfitCategories.Formalwear; break; case PartyPickerDialog.ClothingType.kCasual: formalwear = OutfitCategories.Everyday; break; case PartyPickerDialog.ClothingType.kSwimwear: formalwear = OutfitCategories.Swimwear; break; case PartyPickerDialog.ClothingType.kCostumes: formalwear = OutfitCategories.Everyday; break; default: formalwear = OutfitCategories.Everyday; break; } float infoTime = info.Time; switch (info.PartyType) { case PartyPickerDialog.PartyType.kCampaign: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:FundraiserTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:FundraiserStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new CampaignFundraiser(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewFundraiser, parameters.mActor); break; case PartyPickerDialog.PartyType.kBirthday: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:BirthdayTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:BirthdayStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new BirthdayParty(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kWedding: string messageText = string.Empty; if (GameUtils.IsInstalled(ProductVersion.EP4)) { messageText = Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:WeddingStartWithArch", new object[] { infoTime }); } else { messageText = Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:WeddingStart", new object[] { infoTime }); } SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:WeddingTitle"), messageText, ModalDialog.PauseMode.PauseSimulator); EnsureFianceeIsInvitedToWeddingParty(actorSim, simList); party = new WeddingParty(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kFuneral: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:FuneralTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:FuneralStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new Funeral(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kBachelorParty: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:BachelorPartyTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:BachelorStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new BachelorParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewBachelorParty, actorSim); actorSim.SimDescription.SetHadBachelorParty(); break; case PartyPickerDialog.PartyType.kTeenParty: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:TeenPartyTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:TeenStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new TeenParty(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kChildSlumberParty: case PartyPickerDialog.PartyType.kTeenSlumberParty: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:SlumberPartyTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:SlumberStart", new object[] { infoTime, actorSim }), ModalDialog.PauseMode.PauseSimulator); party = new SlumberParty(partyVenue, actorSim, simList, formalwear, startTime); break; case PartyPickerDialog.PartyType.kCostumeParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:CostumePartyTitle", new object[0x0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:CostumePartyStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new CostumeParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kCostumePartyScheduled, actorSim); break; case PartyPickerDialog.PartyType.kGiftGivingParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:GiftGivingPartyTitle", new object[0x0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:GiftGivingPartyStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new GiftGivingParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kGiftGivingPartyScheduled, actorSim); break; case PartyPickerDialog.PartyType.kPoolParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:PoolPartyTitle", new object[0x0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:PoolPartyStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new PoolParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kSchedulePoolParty, actorSim); break; case PartyPickerDialog.PartyType.kFeastParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:FeastPartyTitle", new object[0x0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situation/Party:FeastPartyStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new FeastParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kFeastPartyScheduled, actorSim); break; case PartyPickerDialog.PartyType.kJuiceKeggerParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:JuiceKeggerPartyTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:JuiceKeggerStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new JuiceKeggerParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewJuiceKeggerParty, actorSim); break; case PartyPickerDialog.PartyType.kTailgatingParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:TailgatingPartyTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:TailgatingStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new TailgatingParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewTailgatingParty, actorSim); break; case PartyPickerDialog.PartyType.kBonfire: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:BonfireTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:BonfireStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new BonfireParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewBonfireParty, actorSim); break; case PartyPickerDialog.PartyType.kVideoGameLANParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:VideoGameLANPartyTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:VideoGameLANStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new VideoGameLANParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewVideoGameLANParty, actorSim); break; case PartyPickerDialog.PartyType.kMasqueradeBall: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:MasqueradeBallTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:MasqueradeStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new MasqueradeBall(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewMasqueradeBall, actorSim); break; case PartyPickerDialog.PartyType.kVictoryParty: SimpleMessageDialog.Show(Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:VictoryPartyTitle", new object[0]), Localization.LocalizeString(actorSim.IsFemale, "Gameplay/Situations/Party:VictoryStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new VictoryParty(partyVenue, actorSim, simList, formalwear, startTime); EventTracker.SendEvent(EventTypeId.kThrewVictoryParty, actorSim); break; default: SimpleMessageDialog.Show(Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:GenericTitle"), Common.LocalizeEAString(actorSim.IsFemale, "Gameplay/Situations/Party:HouseStart", new object[] { infoTime }), ModalDialog.PauseMode.PauseSimulator); party = new HouseParty(partyVenue, actorSim, simList, formalwear, startTime); break; } if (party == null) return OptionResult.Failure; foreach (SimDescription sim in party.GuestDescriptions) { Instantiation.EnsureInstantiate(sim, party.Lot); } EventTracker.SendEvent(new PartyEvent(EventTypeId.kThrewParty, actorSim, actorSim.SimDescription, party)); if (actorSim.HasTrait(TraitNames.PartyAnimal)) { TraitTipsManager.ShowTraitTip(13271263770231522640L, actorSim, TraitTipsManager.TraitTipCounterIndex.PartyAnimal, TraitTipsManager.kPartyAnimalCountOfParties); } return OptionResult.SuccessClose; }