コード例 #1
0
ファイル: ShowerEx.cs プロジェクト: Robobeurre/NRaas
        public static void ApplyPostShowerEffects(Sim actor, IShowerable shower)
        {
            BuffManager buffManager = actor.BuffManager;
            buffManager.RemoveElement(BuffNames.Singed);
            buffManager.RemoveElement(BuffNames.SingedElectricity);
            buffManager.RemoveElement(BuffNames.GarlicBreath);
            SimDescription simDescription = actor.SimDescription;
            simDescription.RemoveFacePaint();
            if (simDescription.IsMummy)
            {
                buffManager.AddElement(BuffNames.Soaked, Origin.FromShower);
            }

            if (RandomUtil.RandomChance((float)shower.TuningShower.ChanceOfExhileratingShowerBuff))
            {
                buffManager.AddElement(BuffNames.ExhilaratingShower, Origin.FromNiceShower);
            }

            if (actor.HasTrait(TraitNames.Hydrophobic))
            {
                actor.PlayReaction(ReactionTypes.Cry, shower as GameObject, ReactionSpeed.AfterInteraction);
            }
            else if (shower.ShouldGetColdShower)
            {
                actor.BuffManager.AddElement(BuffNames.ColdShower, Origin.FromCheapShower);
                EventTracker.SendEvent(EventTypeId.kGotColdShowerBuff, actor, shower);
            }
            // Custom
            else if ((shower.Cleanable != null) && (shower.Cleanable.NeedsToBeCleaned))
            {
                actor.PlayReaction(ReactionTypes.Retch, shower as GameObject, ReactionSpeed.AfterInteraction);
            }
            actor.Motives.SetMax(CommodityKind.Hygiene);
        }
コード例 #2
0
 public override bool Test(Sim a, IShowerable target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (target.Repairable == null)
     {
         return(false);
     }
     return(base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback));
 }
コード例 #3
0
            protected override bool Satisfies(Sim actor, Sim target, IShowerable obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonPregnancy.SatisfiesTryForBaby(actor, target, "ShowerTryForBaby", isAutonomous, true, ref callback));
            }
コード例 #4
0
            protected override bool Satisfies(Sim actor, Sim target, IShowerable obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonWoohoo.SatisfiesWoohoo(actor, target, "ShowerWoohoo", isAutonomous, true, true, ref callback));
            }
コード例 #5
0
            public bool TestUse(IShowerable obj)
            {
                if (!TestRepaired(obj))
                {
                    return(false);
                }

                if (obj.Repairable == null)
                {
                    // Take Shower requires a Repairable component
                    return(false);
                }

                // Exclude Outdoor showers
                if (obj.GetType().ToString().Contains("ShowerOutdoor"))
                {
                    return(false);
                }

                return(obj.UseCount == 0 && obj.InWorld);
            }
コード例 #6
0
ファイル: ShowerEx.cs プロジェクト: yakoder/NRaas
        public static void ApplyPostShowerEffects(Sim actor, IShowerable shower)
        {
            BuffManager buffManager = actor.BuffManager;

            buffManager.RemoveElement(BuffNames.Singed);
            buffManager.RemoveElement(BuffNames.SingedElectricity);
            buffManager.RemoveElement(BuffNames.GarlicBreath);
            SimDescription simDescription = actor.SimDescription;

            simDescription.RemoveFacePaint();
            if (simDescription.IsMummy)
            {
                buffManager.AddElement(BuffNames.Soaked, Origin.FromShower);
            }

            if (RandomUtil.RandomChance((float)shower.TuningShower.ChanceOfExhileratingShowerBuff))
            {
                buffManager.AddElement(BuffNames.ExhilaratingShower, Origin.FromNiceShower);
            }

            if (actor.HasTrait(TraitNames.Hydrophobic))
            {
                actor.PlayReaction(ReactionTypes.Cry, shower as GameObject, ReactionSpeed.AfterInteraction);
            }
            else if (shower.ShouldGetColdShower)
            {
                actor.BuffManager.AddElement(BuffNames.ColdShower, Origin.FromCheapShower);
                EventTracker.SendEvent(EventTypeId.kGotColdShowerBuff, actor, shower);
            }
            // Custom
            else if ((shower.Cleanable != null) && (shower.Cleanable.NeedsToBeCleaned))
            {
                actor.PlayReaction(ReactionTypes.Retch, shower as GameObject, ReactionSpeed.AfterInteraction);
            }
            actor.Motives.SetMax(CommodityKind.Hygiene);
        }
コード例 #7
0
ファイル: TakeShowerEx.cs プロジェクト: Robobeurre/NRaas
 public override string GetInteractionName(Sim actor, IShowerable target, InteractionObjectPair iop)
 {
     return base.GetInteractionName(actor, target, new InteractionObjectPair(Shower.TakeShower.Singleton, target));
 }
コード例 #8
0
ファイル: TakeShowerOutdoorEx.cs プロジェクト: yakoder/NRaas
 public override bool Test(Sim a, IShowerable target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     return(!isAutonomous || ((a.Autonomy.Motives.GetValue(CommodityKind.Hygiene) < 100f) && !a.SimDescription.IsFrankenstein));
 }
コード例 #9
0
ファイル: TakeShowerOutdoorEx.cs プロジェクト: yakoder/NRaas
 public override string GetInteractionName(Sim actor, IShowerable target, InteractionObjectPair iop)
 {
     return(base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target)));
 }
コード例 #10
0
 public override bool Test(Sim a, IShowerable target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     return (!isAutonomous || ((a.Autonomy.Motives.GetValue(CommodityKind.Hygiene) < 100f) && !a.SimDescription.IsFrankenstein));
 }
コード例 #11
0
 public override string GetInteractionName(Sim actor, IShowerable target, InteractionObjectPair iop)
 {
     return(Common.LocalizeEAString(actor.IsFemale, "Gameplay/Excel/Socializing/Action:NRaasTryForBaby", new object[0]));
 }
コード例 #12
0
 public override string GetInteractionName(Sim actor, IShowerable target, InteractionObjectPair iop)
 {
     return(Common.LocalizeEAString(actor.IsFemale, "Gameplay/Excel/Socializing/Action:NRaasRiskyWooHoo", new object[0]) + Common.LocalizeEAString(false, "NRaas.Woohooer:RiskyChance", new object[] { Woohooer.Settings.GetRiskyBabyMadeChance(actor) }));
 }
コード例 #13
0
ファイル: TakeShowerEx.cs プロジェクト: Robobeurre/NRaas
            public override bool Test(Sim a, IShowerable target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.Repairable == null) return false;

                return base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback);
            }