Exemplo n.º 1
0
        public void PushSimToPerformShow(Actors.Sim sim)
        {
            if (sim != null)
            {
                ExoticDancer currentRole = this.CurrentRole as ExoticDancer;
                if (currentRole != null)
                {
                    currentRole.FreezeMotivesWhilePlaying();
                    //pushSimToPeeBeforeShow(sim);

                    InteractionInstance instance = PerformShow.Singleton.CreateInstance(this, sim,
                                                                                        new InteractionPriority(InteractionPriorityLevel.RequiredNPCBehavior), false, false);
                    sim.InteractionQueue.AddAfterCheckingForDuplicates(instance);
                    if (Message.Sender.IsDebugging())
                    {
                        Message.Sender.Debug(this, sim.FullName + " pushed to dance");
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void EndRoleAndReplaceWithNew(Role value)
 {
     if (value != null)
     {
         try
         {
             SimDescription currentActor = value.mSim;
             value.RemoveSimFromRole();
             ExoticDancer aRole = ExoticDancer.clone(value, currentActor);
             this.mCurrentRole = aRole;
             RoleManager.sRoleManager.AddRole(aRole);
             if (Message.Sender.IsDebugging())
             {
                 Message.Sender.Debug(this, "Role cloning succeeded: " + currentActor.FullName);
             }
         }
         catch (Exception ex)
         {
             Message.Sender.ShowError(this, "Cannot create custom role", true, ex);
             this.mCurrentRole = value;
         }
     }
 }
        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);
        }