public void PushRoleStartingInteraction(Actors.Sim sim)
 {
     try
     {
         Role role = CurrentRole;
         if (role != null && role.IsActive)
         {
             Message.Sender.Show("PushRoleStartingInteraction to " + (sim != null ? sim.FullName : "null"));
             if (sim != null)
             {
                 if (sim.LotCurrent == null || sim.LotCurrent != this.LotCurrent)
                 {
                     Courtesan.forceSimToLot(sim);
                 }
                 else
                 {
                     LetSimIn(sim);
                 }
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 2
0
        public void PushRoleStartingInteraction(Actors.Sim sim)
        {
            try
            {
                //Message.Sender.Show("PushRoleStartingInteraction to " + (sim != null ? sim.FullName : "null"));
                if (sim != null && GetTargetLot().IsCommunityLot)
                {
                    IBarProfessional bar = findNearestBar(sim);
                    if (bar != null && bar.InUse)
                    {
                        Bartending.DrinkDescription bestDrink = Bartending.GetBestDrinkFor(sim, base.LotCurrent.GetMetaAutonomyType);
                        String bestDrinkName = null;
                        if (bestDrink != null)
                        {
                            bestDrinkName = bestDrink.GetLocalizedName();
                        }

                        if (bestDrinkName != null)
                        {
                            PushSimToDrink(sim, bar, bestDrinkName);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Message.Sender.ShowError(this, "Cannot order drink from bar ", false, ex);
            }
        }
 public void AddRoleGivingInteraction(Actors.Sim sim)
 {
     sim.AddInteraction(BuyWooHoo.Singleton);
     sim.AddInteraction(ToggleTakeMistress.Singleton);
     if (Message.Sender.IsDebugging())
     {
         Message.Sender.Debug(this, "Role interactions added to " + sim.FullName);
     }
 }
Ejemplo n.º 4
0
        private void PushSimToDrink(Actors.Sim sim, IBarProfessional bar, String bestDrinkName)
        {
            List <InteractionObjectPair> interactions       = bar.GetAllInteractionsForActor(sim);
            InteractionDefinition        drinkingDefinition = null;

            foreach (InteractionObjectPair interaction in interactions)
            {
                InteractionDefinition interactionDef = interaction.InteractionDefinition;
                string name = interactionDef.GetInteractionName(sim, bar, interaction);

                if (name != null && name.Contains(bestDrinkName))
                {
                    drinkingDefinition = interactionDef;
                    break;
                }
            }

            if (drinkingDefinition != null)
            {
                IEnumerable <InteractionInstance> actions  = sim.InteractionQueue.InteractionList;
                List <InteractionInstance>        toCancel = new List <InteractionInstance>();
                bool alreadyDrinking = false;
                foreach (InteractionInstance action in actions)
                {
                    if (!(action is BarProfessional.BarInteraction))
                    {
                        toCancel.Add(action);
                    }
                    else
                    {
                        alreadyDrinking = true;
                        break;
                    }
                }

                foreach (InteractionInstance action in toCancel)
                {
                    sim.InteractionQueue.CancelInteraction(action, false);
                }
                if (!alreadyDrinking)
                {
                    sim.InteractionQueue.AddAfterCheckingForDuplicates(drinkingDefinition.CreateInstance(bar, sim, new InteractionPriority(InteractionPriorityLevel.RequiredNPCBehavior), true, false));
                }
            }
        }
Ejemplo n.º 5
0
 public void PushRoleStartingInteraction(Actors.Sim sim)
 {
     try
     {
         if (sim != null && this.mNextShowTime <= SimClock.CurrentTicks)
         {
             if (Message.Sender.IsDebugging())
             {
                 Message.Sender.Debug(this, "It is SHOWTIME");
             }
             calculateNextShowTime();
             PushSimToPerformShow(sim);
         }
     }
     catch (Exception ex)
     {
         Message.Sender.ShowError(this, "Sim cannot play the role", false, ex);
     }
 }
Ejemplo n.º 6
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");
                    }
                }
            }
        }
Ejemplo n.º 7
0
        public void PushRoleStartingInteraction(Actors.Sim sim)
        {
            try
            {
                //Message.Sender.Show("PushRoleStartingInteraction to " + (sim != null ? sim.FullName : "null"));
                if (sim != null)
                {
                    if (sim.LotCurrent == null || sim.LotCurrent != this.LotCurrent)
                    {
                        HomeBartender.forceSimToLot(sim);
                    }
                    else
                    {
                        LetSimIn(sim);
                        List <BarProfessional> bars   = this.LotCurrent.GetObjectsInRoom <BarProfessional>(this.RoomId);
                        BarProfessional        theBar = null;

                        foreach (BarProfessional bar in bars)
                        {
                            if (!isBarManned(bar))
                            {
                                theBar = bar;
                                break;
                            }
                        }

                        if (theBar != null)
                        {
                            InteractionInstance instance = TendHomeBar.Singleton.CreateInstance(theBar, sim,
                                                                                                new InteractionPriority(InteractionPriorityLevel.CriticalNPCBehavior), false, false);
                            sim.InteractionQueue.AddAfterCheckingForDuplicates(instance);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 8
0
 public void RemoveRoleGivingInteraction(Actors.Sim sim)
 {
     base.RemoveInteractionByType(StartShowNow.Singleton.GetType());
 }
Ejemplo n.º 9
0
 private IToilet findNearestToilet(Actors.Sim sim)
 {
     return(GlobalFunctions.GetClosestObject <IToilet>(sim, true, true, new List <IToilet>(), null));
 }
Ejemplo n.º 10
0
 public void AddRoleGivingInteraction(Actors.Sim sim)
 {
     this.mShowIndex = 0;
     calculateNextShowTime();
     base.AddInteraction(StartShowNow.Singleton);
 }
 public void RemoveRoleGivingInteraction(Actors.Sim sim)
 {
     sim.RemoveInteractionByType(BuyWooHoo.Singleton.GetType());
     sim.RemoveInteractionByType(ToggleTakeMistress.Singleton.GetType());
     RestoreAllOldRelationships();
 }
Ejemplo n.º 12
0
 public void RemoveRoleGivingInteraction(Actors.Sim sim)
 {
 }
Ejemplo n.º 13
0
 private IBarProfessional findNearestBar(Actors.Sim sim)
 {
     return(GlobalFunctions.GetClosestObject <BarProfessional>(sim, false, true, new List <BarProfessional>(), null));
 }
Ejemplo n.º 14
0
        private void PushSimToDrink(Actors.Sim sim, IBarProfessional bar, String bestDrinkName)
        {
            if (Message.Sender.IsDebugging())
            {
                Message.Sender.Debug(this, "Best drink for " + sim.FullName + " is: " + bestDrinkName);
            }
            List <InteractionObjectPair> interactions       = bar.GetAllInteractionsForActor(sim);
            InteractionDefinition        drinkingDefinition = null;

            foreach (InteractionObjectPair interaction in interactions)
            {
                InteractionDefinition interactionDef = interaction.InteractionDefinition;
                string name = interactionDef.GetInteractionName(sim, bar, interaction);

                if (name != null && name.Contains(bestDrinkName))
                {
                    drinkingDefinition = interactionDef;
                    break;
                }
            }

            if (drinkingDefinition != null)
            {
                IEnumerable <InteractionInstance> actions  = sim.InteractionQueue.InteractionList;
                List <InteractionInstance>        toCancel = new List <InteractionInstance>();
                bool alreadyDrinking = false;
                foreach (InteractionInstance action in actions)
                {
                    if (!(action is BarProfessional.BarInteraction))
                    {
                        if (Message.Sender.IsDebugging())
                        {
                            Message.Sender.Debug(this, "Canceling " + action.GetInteractionName());
                        }
                        toCancel.Add(action);
                    }
                    else
                    {
                        if (Message.Sender.IsDebugging())
                        {
                            Message.Sender.Debug(this, "Sim is already drinking, no push added");
                        }
                        alreadyDrinking = true;
                        break;
                    }
                }

                foreach (InteractionInstance action in toCancel)
                {
                    sim.InteractionQueue.CancelInteraction(action, false);
                }
                if (!alreadyDrinking)
                {
                    sim.InteractionQueue.AddAfterCheckingForDuplicates(drinkingDefinition.CreateInstance(bar, sim, new InteractionPriority(InteractionPriorityLevel.RequiredNPCBehavior), true, false));
                    if (Message.Sender.IsDebugging())
                    {
                        Message.Sender.Debug(this, "Sim was pushed to drink: " + sim.FullName);
                    }
                }
            }
        }
Ejemplo n.º 15
0
 public void AddRoleGivingInteraction(Actors.Sim sim)
 {
 }
Ejemplo n.º 16
0
 public void PushRoleStartingInteraction(Actors.Sim sim)
 {
 }