Ejemplo n.º 1
0
        // Methods
        public override bool Run()
        {
            try
            {
                Role assignedRole = base.Actor.SimDescription.AssignedRole;
                if ((assignedRole != null) && assignedRole.IsActive)
                {
                    Lot             target = null;
                    DrunkardsBottle bottle = assignedRole.RoleGivingObject as DrunkardsBottle;
                    if (bottle != null)
                    {
                        target = bottle.GetTargetLot();
                    }

                    if (target != null)
                    {
                        InteractionInstance instance = null;
                        if (target.IsCommunityLot)
                        {
                            instance = VisitCommunityLot.Singleton
                                       .CreateInstance(target, base.Actor, base.GetPriority(), false, false);
                        }
                        else
                        {
                            instance = GoToLot.Singleton
                                       .CreateInstance(target, base.Actor, base.GetPriority(), false, false);
                            // Greet to get inside, visitsituation to really do something inside

                            if (VisitSituation.FindVisitSituationInvolvingGuest(base.Actor) == null)
                            {
                                VisitSituation.Create(base.Actor, target);
                            }
                            base.Actor.GreetSimOnLot(target);
                        }

                        if (base.TryPushAsContinuation(instance))
                        {
                            assignedRole.UpdateFulfillingLot(target.LotId);
                            return(true);
                        }
                    }
                    assignedRole.UpdateFulfillingLot(0L);
                }
            }
            catch (Exception ex)
            {
                Message.Sender.ShowError(base.Actor, "Cannot take role sims to role lot", false, ex);
            }
            return(false);
        }
Ejemplo n.º 2
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");
                            }
                        }
                    }
                }
            }
        }