Ejemplo n.º 1
0
        public static void OnGotTips(Event e)
        {
            Sim actor = e.Actor as Sim;

            if (actor == null)
            {
                return;
            }

            if ((actor.Household == null) || (actor.Household.IsSpecialHousehold))
            {
                return;
            }

            IncrementalEvent iEvent = e as IncrementalEvent;

            if (iEvent == null)
            {
                return;
            }

            foreach (SkillNames skill in MetricMusicSkill.Skills)
            {
                SkillBasedCareerBooter.UpdateExperience(actor, skill, (int)iEvent.mIncrement);
            }
        }
Ejemplo n.º 2
0
        public static void OnStopBartending(Event e)
        {
            IncrementalEvent iE = e as IncrementalEvent;

            if (iE != null)
            {
                IActor actor = iE.Actor;
                if (actor != null && !(actor.InteractionQueue.GetCurrentInteraction() is BarAdvanced.MakeDrink))
                {
                    actor.ModifyFunds((int)iE.Increment);
                }
            }
        }
Ejemplo n.º 3
0
        public static void OnHack(Event e)
        {
            Sim actor = e.Actor as Sim;

            if (actor == null)
            {
                return;
            }

            if ((actor.Household == null) || (actor.Household.IsSpecialHousehold))
            {
                return;
            }

            IncrementalEvent iEvent = e as IncrementalEvent;

            if (iEvent != null)
            {
                SkillBasedCareerBooter.UpdateExperience(actor, SkillNames.Hacking, (int)iEvent.mIncrement);
            }
        }
Ejemplo n.º 4
0
        public static void OnPlayedInstrument(Event e)
        {
            Sim actor = e.Actor as Sim;

            if (actor == null)
            {
                return;
            }

            SkillNames instrumentSkill = SkillNames.None;

            switch (e.Id)
            {
            case EventTypeId.kPlayedDrums:
                instrumentSkill = SkillNames.Drums;
                break;

            case EventTypeId.kPlayedGuitar:
                instrumentSkill = SkillNames.Guitar;
                break;

            case EventTypeId.kPlayedBassGuitar:
                instrumentSkill = SkillNames.BassGuitar;
                break;

            case EventTypeId.kPlayedPiano:
                instrumentSkill = SkillNames.Piano;
                break;

            case EventTypeId.kPlayedLaserHarp:
                instrumentSkill = SkillNames.LaserHarp;
                break;
            }

            float opening = 0, closing = 0;

            if (!Bartending.TryGetHoursOfOperation(actor.LotCurrent, ref opening, ref closing))
            {
                return;
            }

            if (!SimClock.IsTimeBetweenTimes(opening, closing))
            {
                return;
            }

            IncrementalEvent iEvent = e as IncrementalEvent;

            float cash = GetPay(actor, instrumentSkill) * iEvent.mIncrement;

            if (cash == 0)
            {
                return;
            }

            foreach (SkillNames skill in MetricMusicSkill.Skills)
            {
                if (SkillBasedCareerBooter.GetSkillBasedCareer(actor, skill) == null)
                {
                    continue;
                }

                SkillBasedCareerBooter.UpdateExperience(actor, skill, (int)cash);
            }
        }