예제 #1
0
파일: Busker.cs 프로젝트: yakoder/NRaas
        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);
            }
        }
예제 #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);
                }
            }
        }
예제 #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);
            }
        }
예제 #4
0
파일: Busker.cs 프로젝트: yakoder/NRaas
        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);
            }
        }