protected override GatherResult TargetGather(List <Scenario> list, ref bool random) { if (Target == null) { if (Lot == null) { if (RandomUtil.RandomChance(ChanceOfHomeLot)) { Lot = Sim.LotHome; } if (Lot == null) { Lot = Lots.GetCommunityLot(Sim.CreatedSim, null, false); if (Lot == null) { return(GatherResult.Failure); } } } } GatherResult result = base.TargetGather(list, ref random); if (result == GatherResult.Success) { RandomUtil.RandomizeListOfObjects(list); int count = 0; foreach (Scenario choice in list) { GatheringScenario guest = choice as GatheringScenario; if (guest == null) { continue; } count++; mGuests.Add(guest.Target); if (count >= TargetMaximum) { break; } } list.Clear(); return(GatherResult.Update); } return(result); }
protected override bool Push() { Lot lot = Lots.GetCommunityLot(Sim.CreatedSim, null, true); if (lot == null) { return(false); } Sim.CreatedSim.InteractionQueue.CancelAutonomousInteractions(); return(Situations.PushVisit(this, Sim, lot)); }
protected override bool Push() { List <OccultTypes> occults = OccultTypeHelper.CreateList(Sim); if (occults.Count == 0) { return(false); } OccultTypes occult = RandomUtil.GetRandomObjectFromList(occults); List <CommercialLotSubType> types = new List <CommercialLotSubType>(); switch (occult) { case OccultTypes.Vampire: types.Add(CommercialLotSubType.kEP3_CocktailLoungeVampire); types.Add(CommercialLotSubType.kGraveyard); types.Add(CommercialLotSubType.kEP7_Mausoleum); break; case OccultTypes.Werewolf: types.Add(CommercialLotSubType.kEP7_WerewolfBar); types.Add(CommercialLotSubType.kBigPark); types.Add(CommercialLotSubType.kSmallPark); break; case OccultTypes.Witch: types.Add(CommercialLotSubType.kEP7_PotionShopConsignmentStore); types.Add(CommercialLotSubType.kEP7_VaultOfAntiquity); break; case OccultTypes.Fairy: types.Add(CommercialLotSubType.kEP7_Arboretum); types.Add(CommercialLotSubType.kBigPark); types.Add(CommercialLotSubType.kSmallPark); break; case OccultTypes.Mummy: types.Add(CommercialLotSubType.kEP1_ChineseGarden); types.Add(CommercialLotSubType.kEP1_LandmarkTomb); types.Add(CommercialLotSubType.kEP1_HiddenTomb); break; case OccultTypes.ImaginaryFriend: types.Add(CommercialLotSubType.kHangout); types.Add(CommercialLotSubType.kBigPark); types.Add(CommercialLotSubType.kSmallPark); break; } if (types.Count == 0) { return(false); } Lot lot = Lots.GetCommunityLot(Sim.CreatedSim, types, false); if (lot == null) { return(false); } return(Situations.PushVisit(this, Sim, lot)); }
protected override bool Push() { return(Situations.PushVisit(this, Target, Lots.GetCommunityLot(Target.CreatedSim, null, false))); }
protected override bool Push() { Situations.PushVisit(this, Sim, Lots.GetCommunityLot(Sim.CreatedSim, null, false)); return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { base.PrivateUpdate(frame); if (sSkills == null) { sSkills = new Dictionary <Sims3.Gameplay.Skills.SkillNames, InteractionDefinition>(); sSkills.Add(Sims3.Gameplay.Skills.SkillNames.Guitar, GuitarPlayForTips.Singleton); sSkills.Add(Sims3.Gameplay.Skills.SkillNames.BassGuitar, BassGuitarPlayForTips.Singleton); sSkills.Add(Sims3.Gameplay.Skills.SkillNames.Piano, PianoPlayForTips.Singleton); sSkills.Add(Sims3.Gameplay.Skills.SkillNames.Drums, DrumsPlayForTips.Singleton); sSkills.Add(Sims3.Gameplay.Skills.SkillNames.LaserHarp, LaserHarpPlayForTips.Singleton); } List <Sims3.Gameplay.Skills.SkillNames> choices = new List <Sims3.Gameplay.Skills.SkillNames>(); SimData data = Options.GetSim(Sim); foreach (Sims3.Gameplay.Skills.SkillNames skill in sSkills.Keys) { if (!Skills.AllowSkill(this, Sim, data, skill)) { continue; } choices.Add(skill); } if (choices.Count == 0) { IncStat("No Choices"); return(false); } BandInstrument instrument = null; InteractionDefinition definition = null; RandomUtil.RandomizeListOfObjects(choices); foreach (Sims3.Gameplay.Skills.SkillNames skill in choices) { switch (skill) { case Sims3.Gameplay.Skills.SkillNames.Guitar: instrument = Inventories.InventoryFind <Guitar>(Sim); if (instrument == null) { instrument = ManagedBuyProduct <Guitar> .Purchase(Sim, 0, this, UnlocalizedName, null, BuildBuyProduct.eBuyCategory.kBuyCategoryElectronics, BuildBuyProduct.eBuySubCategory.kBuySubCategoryHobbiesAndSkills); } break; case Sims3.Gameplay.Skills.SkillNames.BassGuitar: instrument = Inventories.InventoryFind <BassGuitar>(Sim); if (instrument == null) { instrument = ManagedBuyProduct <BassGuitar> .Purchase(Sim, 0, this, UnlocalizedName, null, BuildBuyProduct.eBuyCategory.kBuyCategoryElectronics, BuildBuyProduct.eBuySubCategory.kBuySubCategoryHobbiesAndSkills); } break; case Sims3.Gameplay.Skills.SkillNames.Piano: instrument = Inventories.InventoryFind <Piano>(Sim); if (instrument == null) { instrument = ManagedBuyProduct <Piano> .Purchase(Sim, 0, this, UnlocalizedName, null, BuildBuyProduct.eBuyCategory.kBuyCategoryElectronics, BuildBuyProduct.eBuySubCategory.kBuySubCategoryHobbiesAndSkills); } break; case Sims3.Gameplay.Skills.SkillNames.Drums: instrument = Inventories.InventoryFind <Drums>(Sim); if (instrument == null) { instrument = ManagedBuyProduct <Drums> .Purchase(Sim, 0, this, UnlocalizedName, null, BuildBuyProduct.eBuyCategory.kBuyCategoryElectronics, BuildBuyProduct.eBuySubCategory.kBuySubCategoryHobbiesAndSkills); } break; case Sims3.Gameplay.Skills.SkillNames.LaserHarp: instrument = Inventories.InventoryFind <LaserHarp>(Sim); if (instrument == null) { instrument = ManagedBuyProduct <LaserHarp> .Purchase(Sim, 0, this, UnlocalizedName, null, BuildBuyProduct.eBuyCategory.kBuyCategoryElectronics, BuildBuyProduct.eBuySubCategory.kBuySubCategoryHobbiesAndSkills); } break; } if (instrument != null) { definition = sSkills[skill]; break; } } if (instrument == null) { IncStat("No Instrument"); return(false); } Lot lot = Sim.CreatedSim.LotCurrent; if ((Sim.LotHome == lot) || (lot.IsWorldLot) || (lot.IsResidentialLot)) { if (!Situations.PushVisit(this, Sim, Lots.GetCommunityLot(Sim.CreatedSim, null, true))) { IncStat("Push Lot Fail"); return(false); } } return(Situations.PushInteraction(this, Sim, instrument, definition)); }