Пример #1
0
        public override void StartRole()
        {
            if (!this.mIsActive && this.mSim.IsValidDescription)
            {
                debugger.Debug(this, "description is valid");
                this.ValidateAndSetupOutfit();
                if (this.mSim.CreatedSim == null)
                {
                    Lot lot = LotManager.SelectRandomLotForNPCMoveIn(null);
                    this.mSim.Instantiate(lot);
                }
                this.SwitchIntoOutfit();

                Sim theSim = this.mSim.CreatedSim;
                if (theSim != null)
                {
                    Bartending skill = theSim.SkillManager.GetSkill <Bartending>(Sims3.Gameplay.Skills.SkillNames.Bartending);
                    if (skill == null)
                    {
                        theSim.SkillManager.AddAutomaticSkill(SkillNames.Bartending);
                    }

                    theSim.RemoveInteractionByType(GoToALot.Singleton);
                    theSim.AddInteraction(GoToALot.Singleton);

                    foreach (CommodityKind current in this.Data.Motives)
                    {
                        this.mSim.CreatedSim.Motives.CreateMotive(current);
                    }
                    foreach (CommodityKind current2 in this.Data.MotivesToFreeze)
                    {
                        this.mSim.CreatedSim.Motives.SetMax(current2);
                        this.mSim.CreatedSim.Motives.SetDecay(current2, false);
                    }
                    this.mIsActive = true;
                    debugger.Debug(this, "Role is active");
                    if (mRoleGivingObject != null)
                    {
                        if (this.mSim.CreatedSim.LotCurrent == null || this.mSim.CreatedSim.LotCurrent != mRoleGivingObject.LotCurrent)
                        {
                            forceSimToLot(theSim);
                        }
                    }
                    if (this.IsStoryProgressionProtected)
                    {
                        this.ProtectSimFromStoryProgression();
                    }
                    if (this.RoleGivingObject != null)
                    {
                        RoleGivingObject.PushRoleStartingInteraction(this.mSim.CreatedSim);
                        debugger.Debug(this, "Role action pushed" + this.mSim.CreatedSim.InteractionQueue.ToString());
                    }
                }
            }
        }
Пример #2
0
 public override void SimulateRole(float minPassed)
 {
     debugger.Debug(this, "simulate role");
     if (base.IsActive)
     {
         Sim createdSim = this.mSim.CreatedSim;
         if (createdSim != null && base.RoleGivingObject != null)
         {
             RoleGivingObject.PushRoleStartingInteraction(createdSim);
             debugger.Debug(this, "pushed for action");
         }
     }
 }