Ejemplo n.º 1
0
        public override bool Run()
        {
            try
            {
                AlarmHandle handle;
                float       kTimeToRemoveTattoos;
                if (!Target.RouteToChairControls(Actor))
                {
                    return(false);
                }
                if (!StartSync(true))
                {
                    return(false);
                }
                Actor.LoopIdle();
                Actor.SkillManager.AddElement(SkillNames.Tattooing);
                StandardEntry();

                BeginCommodityUpdates();

                Sim instanceActor = LinkedInteractionInstance.InstanceActor;
                Target.OnStartTattooing(instanceActor);
                AcquireStateMachine(Target.StateMachineName, AnimationPriority.kAPNormalPlus);
                SetActorAndEnter(Target.ActorForTattooer, Actor, "Enter");
                SetActor("tattooChair", Target);
                SetActor(Target.ActorForTattooed, instanceActor);
                SetParameter("isScared", TattooChair.ShouldPlayScaredReaction(instanceActor));
                AddPersistentScriptEventHandler(0x0, new SacsEventHandler(Target.OnSound));
                EnterState(Target.ActorForTattooed, "Enter");
                AnimateSim("Tattoo");

                kTimeToRemoveTattoos = Tattooing.GetTimeToTattoo(Actor);
                handle = Target.AddAlarm(kTimeToRemoveTattoos * TattooChair.kTimeAtWhichToPerformAction, TimeUnit.Minutes, OnDisplayCas, "Tattoo Chair - Display Cas", AlarmType.DeleteOnReset);

                bool succeeded = DoTimedLoop(kTimeToRemoveTattoos);
                if (!succeeded)
                {
                    Target.RemoveAlarm(handle);
                }

                AnimateSim("Exit");
                FinishLinkedInteraction(true);
                EndCommodityUpdates(succeeded);
                StandardExit();
                WaitForSyncComplete();
                Target.Repairable.UpdateBreakage(Actor.IsSelectable ? Actor : instanceActor);
                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Ejemplo n.º 2
0
 public override bool Run()
 {
     try
     {
         if (!Target.RouteToChairControls(Actor))
         {
             return(false);
         }
         EnterStateMachine(Target.StateMachineName, "Enter", "x");
         SetActor("tattooChair", Target);
         SetActor("y", Actor);
         AnimateSim("Tattoo Self Stand");
         AddPersistentScriptEventHandler(0x0, new SacsEventHandler(Target.OnSound));
         bool succeeded = DoTimedLoop(TattooChair.kTimeToPrepareSelfTattoo);
         AnimateSim("Exit");
         if (!succeeded || !Target.RouteToChair(Actor))
         {
             return(false);
         }
         EnterState("x", "Enter");
         EnterState("tattooChair", "Enter");
         Actor.SkillManager.AddElement(SkillNames.Tattooing);
         StandardEntry();
         BeginCommodityUpdates();
         SetParameter("isScared", TattooChair.ShouldPlayScaredReaction(Actor));
         AnimateSim("Tattoo Self");
         float       timeToTattoo = Tattooing.GetTimeToTattoo(Actor);
         AlarmHandle handle       = Target.AddAlarm(timeToTattoo * TattooChair.kTimeAtWhichToPerformAction, TimeUnit.Minutes, new AlarmTimerCallback(OnDisplayCas), "Tattoo Chair - Display Cas", AlarmType.DeleteOnReset);
         succeeded = DoTimedLoop(timeToTattoo);
         if (!succeeded)
         {
             Target.RemoveAlarm(handle);
         }
         AnimateSim("Exit");
         Target.Repairable.UpdateBreakage(Actor);
         EndCommodityUpdates(succeeded);
         StandardExit();
         return(succeeded);
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(Actor, Target, e);
         return(false);
     }
 }