Ejemplo n.º 1
0
        public override void SwitchIntoOutfit()
        {
            //Message.Sender.Show("Switching into outft");
            try
            {
                Lot roleLot = (base.RoleGivingObject as DrunkardsBottle).GetTargetLot();
                if (roleLot != null)
                {
                    this.mSim.CreatedSim.InteractionQueue.CancelAllInteractions();

                    Lot.MetaAutonomyType          venueType  = roleLot.GetMetaAutonomyType;
                    SimIFace.CAS.OutfitCategories outfitType = SimIFace.CAS.OutfitCategories.Everyday;
                    if (venueType == Lot.MetaAutonomyType.CocktailLoungeAsian || venueType == Lot.MetaAutonomyType.CocktailLoungeCelebrity || venueType == Lot.MetaAutonomyType.CocktailLoungeVampire)
                    {
                        outfitType = SimIFace.CAS.OutfitCategories.Formalwear;
                    }

                    this.mSim.CreatedSim.SwitchToOutfitWithoutSpin(Sim.ClothesChangeReason.GoingToWork, outfitType);
                    if (Message.Sender.IsDebugging())
                    {
                        Message.Sender.Debug(this, "Role clothing change request for "
                                             + mSim.FullName + " " + outfitType.ToString());
                    }
                }
            }
            catch (Exception e)
            {
                Message.Sender.ShowError(this, "Cannot change tippler's clothes: ", false, e);
            }
        }
Ejemplo n.º 2
0
        public static void SetMetaAutonomyType(Lot lot, Lot.MetaAutonomyType type)
        {
            if (lot == null)
            {
                return;
            }

            lot.mMetaAutonomyType = type;
            Autonomy.AddPublicMetaObject(lot);

            MetaAutonomyTuning tuning = MetaAutonomyManager.GetTuning(lot.GetMetaAutonomyVenueType());

            if (tuning != null)
            {
                foreach (Sim sim in LotManager.Actors)
                {
                    if (sim.HasReasonToGoToVenue(tuning))
                    {
                        MetaAutonomyManager.AddSimToVenue(sim, lot);
                    }
                    else
                    {
                        MetaAutonomyManager.RemoveSimFromVenue(sim, lot);
                    }
                }
            }
        }
        public void CleanupActions(Sim s, float x)
        {
            try
            {
                CourtesansPerfume perfume = Courtesan.GetPerfume(base.Target);
                if (perfume != null)
                {
                    perfume.restoreOldRelationship(base.Actor);
                    base.Target.BuffManager.RemoveElement(BuffNames.StrideOfPride);
                    base.Target.BuffManager.RemoveElement(BuffNames.WalkOfShame);
                }
            }
            catch (Exception e)
            {
                Message.Sender.ShowError(base.Target, "Restoring original relationships failed", false, e);
            }

            try
            {
                Lot.MetaAutonomyType venueType = base.Actor.LotCurrent.GetMetaAutonomyType;
                Courtesan.SwitchToProperClothing(base.Actor, venueType);
                Courtesan.SwitchToProperClothing(base.Target, venueType);
            }
            catch (Exception e)
            {
                Message.Sender.ShowError(base.Actor, "Cannot restore clothes", false, e);
            }
        }
        private void SwitchToProperClothing(Lot.MetaAutonomyType venueType, Sim sim, bool spin)
        {
            SimIFace.CAS.OutfitCategories outfitType = SimIFace.CAS.OutfitCategories.Everyday;
            if (venueType == Lot.MetaAutonomyType.CocktailLoungeAsian || venueType == Lot.MetaAutonomyType.CocktailLoungeCelebrity || venueType == Lot.MetaAutonomyType.CocktailLoungeVampire)
            {
                outfitType = SimIFace.CAS.OutfitCategories.Formalwear;
            }

            if (spin)
            {
                sim.SwitchToOutfitWithSpin(Sim.ClothesChangeReason.GoingToWork, outfitType);
                if (Message.Sender.IsDebugging())
                {
                    Message.Sender.Debug(this, "Role clothing change request (with spin) for "
                                         + mSim.FullName + " " + outfitType.ToString());
                }
            }
            else
            {
                sim.SwitchToOutfitWithoutSpin(Sim.ClothesChangeReason.GoingToWork, outfitType);
                if (Message.Sender.IsDebugging())
                {
                    Message.Sender.Debug(this, "Role clothing change request (without spin) for "
                                         + mSim.FullName + " " + outfitType.ToString());
                }
            }
        }
Ejemplo n.º 5
0
        private int GetTipAmount(Sim actor, Sim creator, Lot.MetaAutonomyType venueType, Bartending.DrinkDescription requestedDrink)
        {
            float num = 0f;

            if (venueType != Lot.MetaAutonomyType.Residential && !actor.IsSelectable)
            {
                Bartending.BarData barData;
                if (Bartending.TryGetBarData(venueType, out barData))
                {
                    float num2 = (float)Bartending.GetCostForDrink(requestedDrink, venueType);
                    float num3 = num2 * barData.PriceCapMultiplier;

                    if (num > num3)
                    {
                        creator.ShowTNSIfSelectable(Bartending.LocalizeString(creator.IsFemale, "BartenderExpensiveIngredients", new object[0]), StyledNotification.NotificationStyle.kSimTalking, actor.ObjectId, creator.ObjectId);
                    }
                    num += num2 * Bartending.GetTipMultiplierForMood(Bartending.DrinkMood.Regular);

                    float num5 = 0f;

                    if (actor.HasTrait(TraitNames.Frugal))
                    {
                        num5 *= Bartending.kTipMultiplierTraitFrugal;
                    }
                    num += num2 * num5;
                    num  = Math.Min(num, num3);
                }
                Bartending skill = creator.SkillManager.GetSkill <Bartending>(SkillNames.Bartending);
                if (skill != null && skill.LifetimeOpportunityServedDrinksCompleted)
                {
                    num *= Bartending.kLifetimeOpportunityServedTipMultiplier;
                }
            }
            return((int)num);
        }
        public static void SwitchToProperClothing(Sim sim, Lot.MetaAutonomyType venueType)
        {
            SimIFace.CAS.OutfitCategories outfitType = SimIFace.CAS.OutfitCategories.Everyday;
            if (venueType == Lot.MetaAutonomyType.CocktailLoungeAsian || venueType == Lot.MetaAutonomyType.CocktailLoungeCelebrity || venueType == Lot.MetaAutonomyType.CocktailLoungeVampire)
            {
                outfitType = SimIFace.CAS.OutfitCategories.Formalwear;
            }

            sim.SwitchToOutfitWithoutSpin(Sim.ClothesChangeReason.GoingToWork, outfitType);
        }
Ejemplo n.º 7
0
 public void AddOrUpdateMASettings(Lot.MetaAutonomyType type, MetaAutonomySettingKey settings)
 {
     if (GetMASettings(type, false) != null)
     {
         mMetaAutonomySettings[type] = settings;
     }
     else
     {
         mMetaAutonomySettings.Add(type, settings);
     }
 }
 public override void SwitchIntoOutfit()
 {
     try
     {
         Lot.MetaAutonomyType venueType = base.RoleGivingObject.LotCurrent.GetMetaAutonomyType;
         Sim sim = this.mSim.CreatedSim;
         SwitchToProperClothing(venueType, sim, false);
     }
     catch (Exception e)
     {
         Message.Sender.ShowError(this, "Cannot change sim's clothes", false, e);
     }
 }
Ejemplo n.º 9
0
 public override bool Run()
 {
     try
     {
         Lot.MetaAutonomyType venueType = base.Actor.LotCurrent.GetMetaAutonomyType;
         Courtesan.SwitchToProperClothing(base.Actor, venueType);
     }
     catch (Exception e)
     {
         Message.Sender.ShowError(base.Actor, "Cannot restore clothes", false, e);
     }
     return(true);
 }
Ejemplo n.º 10
0
        public MetaAutonomySettingKey GetMASettings(Lot.MetaAutonomyType type, bool returnDefault)
        {
            MetaAutonomySettingKey key;

            if (mMetaAutonomySettings.TryGetValue(type, out key))
            {
                return(key);
            }

            if (returnDefault)
            {
                return(new MetaAutonomySettingKey(type).PopulateWithDefaults());
            }

            return(null);
        }
Ejemplo n.º 11
0
        public void AddNeededMotives()
        {
            Sim             sim    = this.mSim.CreatedSim;
            DrunkardsBottle bottle = this.RoleGivingObject as DrunkardsBottle;

            if (bottle != null)
            {
                if (sim != null)
                {
                    Lot targetLot = bottle.GetTargetLot();
                    if (targetLot.IsCommunityLot)
                    {
                        Lot.MetaAutonomyType venueType = targetLot.GetMetaAutonomyType;
                        if (venueType == Lot.MetaAutonomyType.CocktailLoungeAsian ||
                            venueType == Lot.MetaAutonomyType.CocktailLoungeCelebrity ||
                            venueType == Lot.MetaAutonomyType.CocktailLoungeVampire)
                        {
                            sim.Motives.CreateMotive(Autonomy.CommodityKind.BeInCocktailLounge);
                            if (Message.Sender.IsDebugging())
                            {
                                Message.Sender.Debug(this, mSim.FullName + " has motive to be in CocktailLounge");
                            }
                        }
                        else if (venueType == Lot.MetaAutonomyType.DanceClubLiveMusic ||
                                 venueType == Lot.MetaAutonomyType.DanceClubPool ||
                                 venueType == Lot.MetaAutonomyType.DanceClubRave)
                        {
                            sim.Motives.CreateMotive(Autonomy.CommodityKind.BeInDanceClub);
                            if (Message.Sender.IsDebugging())
                            {
                                Message.Sender.Debug(this, mSim.FullName + " has motive to be in DanceClub");
                            }
                        }
                        else if (venueType == Lot.MetaAutonomyType.DiveBarCriminal ||
                                 venueType == Lot.MetaAutonomyType.DiveBarIrish || venueType == Lot.MetaAutonomyType.DiveBarSports)
                        {
                            sim.Motives.CreateMotive(Autonomy.CommodityKind.BeInDiveBar);
                            if (Message.Sender.IsDebugging())
                            {
                                Message.Sender.Debug(this, mSim.FullName + " has motive to be in DiveBar");
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 12
0
        public override void SwitchIntoOutfit()
        {
            try
            {
                Lot roleLot = (base.RoleGivingObject as CourtesansPerfume).GetTargetLot();
                if (roleLot != null)
                {
                    Sim sim = this.mSim.CreatedSim;
                    this.mSim.CreatedSim.InteractionQueue.CancelAllInteractions();

                    Lot.MetaAutonomyType venueType = roleLot.GetMetaAutonomyType;
                    SwitchToProperClothing(sim, venueType);
                    if (Message.Sender.IsDebugging())
                    {
                        Message.Sender.Debug(this, "Role clothing change request made "
                                             + mSim.FullName + " " + venueType.ToString());
                    }
                }
            }
            catch (Exception e)
            {
                Message.Sender.ShowError(this, "Cannot change courtesan's clothes: ", false, e);
            }
        }
Ejemplo n.º 13
0
 public ResourceKey GetRoleUniformKey(Sim Sim, Lot.MetaAutonomyType venueType)
 {
     return(ResourceKey.kInvalidResourceKey);
 }
Ejemplo n.º 14
0
 public MetaAutonomySettingKey(uint guid)
 {
     this.mGUID = guid;
     this.mMetaAutonomyType = Lot.MetaAutonomyType.None;
 }
Ejemplo n.º 15
0
 public HourCloseOption(Lot.MetaAutonomyType type)
 {
     mType = type;
 }
Ejemplo n.º 16
0
 public MetaAutonomyTuningListingOption(Lot.MetaAutonomyType data)
     : base(Common.Localize("MetaAutonomyType:" + data))
 {
     mData = data;
 }
Ejemplo n.º 17
0
 public MetaAutonomySettingKey(uint guid)
 {
     this.mGUID             = guid;
     this.mMetaAutonomyType = Lot.MetaAutonomyType.None;
 }
Ejemplo n.º 18
0
 public MetaAutonomySettingKey(Lot.MetaAutonomyType type)
 {
     this.mMetaAutonomyType = type;
     this.mGUID             = 0;
 }
        public override bool Run()
        {
            OutfitCategories[] outfits     = base.Target.ShowOutfits;
            OutfitCategories   startOutfit = base.Target.GetFirstOutfit();

            base.Actor.SwitchToOutfitWithSpin(Sim.ClothesChangeReason.GoingToWork, startOutfit);

            List <Slot> danceOnRoutingSlots = base.Target.GetDanceOnRoutingSlots(base.Actor);

            danceOnRoutingSlots.Sort(new Comparison <Slot>(this.ClosestRoutingSlotFirstComparer));
            for (int i = 0; i < danceOnRoutingSlots.Count; i++)
            {
                Slot  slotName = danceOnRoutingSlots[i];
                Route r        = base.Actor.CreateRoute();
                r.DoRouteFail = i == (danceOnRoutingSlots.Count - 1);
                r.PlanToPoint(base.Target.GetSlotPosition(slotName));
                if (base.Actor.DoRoute(r) && base.Actor.RouteTurnToFace(base.Target.Position))
                {
                    this.mEnterSlot = slotName;
                    break;
                }
            }
            if (this.mEnterSlot == Slot.None)
            {
                return(false);
            }

            Vector3 slotPosition  = base.Target.GetSlotPosition(this.mEnterSlot);
            Vector3 forwardOfSlot = base.Target.GetForwardOfSlot(this.mEnterSlot);

            this.mReservedTile = GlobalFunctions.CreateObject("DynamicFootprintPlacement", slotPosition, 0, forwardOfSlot) as GameObject;

            base.StandardEntry();

            //base.EnterStateMachine("clubdance_solo", "Enter", "x");
            base.EnterStateMachine("misudanceonspot", "Enter", "x", "counter");
            //base.EnterStateMachine("danceOnCounterAndTable", "Enter", "x", "counter");
            int skillLevel = base.Actor.SkillManager.GetSkillLevel(SkillNames.ClubDancing);

            base.SetParameter("ClubDanceSkill", (DanceExpertise)Math.Max(0, skillLevel - 1));
            bool slotIsBackSide = false;
            bool paramValue     = base.Target.IsIslandCounter(this.mEnterSlot, ref slotIsBackSide);

            base.SetParameter("IsIslandCounter", paramValue);
            base.SetParameter("IsIslandCounterBack", slotIsBackSide);
            base.Actor.AddInteraction(WatchSimDancingOnCounterOrTable.Singleton);
            base.BeginCommodityUpdates();

            base.AddSynchronousOneShotScriptEventHandler(0x65, new SacsEventHandler(this.SnapSimToTop));
            base.Actor.LookAtManager.SetInteractionLookAtThreshold(150);

            base.AnimateSim("Dance");
            //base.AnimateSim("Club_Dance");
            float duration  = base.Target.ShowDurationMins / outfits.Length;
            bool  succeeded = this.DoTimedLoop(duration);

            for (int i = 1; i < outfits.Length; i++)
            {
                base.Actor.SwitchToOutfitWithSpin(Sim.ClothesChangeReason.GoingToWork, outfits[i]);
                succeeded = this.DoTimedLoop(duration);
            }
            if (this.mReservedTile != null)
            {
                foreach (uint num3 in this.mReservedTile.GetFootprintNameHashes())
                {
                    this.mReservedTile.PushSimsFromFootprint(num3, base.Actor, null, true);
                }
            }
            base.AddSynchronousOneShotScriptEventHandler(0x66, new SacsEventHandler(this.SnapSimToBottom));
            base.AnimateSim("ExitNeutral");
            //base.AnimateSim("Exit");

            base.Actor.RemoveInteractionByType(WatchSimDancingOnCounterOrTable.Singleton);
            this.Watchable = false;
            base.EndCommodityUpdates(true);
            base.EndCommodityUpdates(succeeded);
            base.StandardExit();

            Lot.MetaAutonomyType venueType = base.Target.LotCurrent.GetMetaAutonomyType;

            ExoticDancer dancer = base.Target.CurrentRole as ExoticDancer;

            if (dancer != null)
            {
                dancer.AfterShowTasks();
            }
            return(true);
        }
Ejemplo n.º 20
0
 public MetaAutonomySettingKey GetMASettings(Lot.MetaAutonomyType type)
 {
     return(GetMASettings(type, true));
 }
Ejemplo n.º 21
0
 public HourOpenOption(Lot.MetaAutonomyType type)
 {
     mType = type;
 }
Ejemplo n.º 22
0
 public MetaAutonomySettingKey(Lot.MetaAutonomyType type)
 {
     this.mMetaAutonomyType = type;
     this.mGUID = 0;
 }