Beispiel #1
0
            protected override bool Push()
            {
                SimDescription injured = Target;
                SimDescription killer  = Sim;

                if (mFail)
                {
                    killer = null;

                    if (mParentScenario.AllowGoToJail)
                    {
                        Manager.AddAlarm(new GoToJailScenario(Sim, Bail));

                        injured = null;
                    }
                    else
                    {
                        injured = Sim;
                    }
                }

                if ((mParentScenario.AllowInjury) && (injured != null) && (injured.CreatedSim != null) && (injured.CreatedSim.LotCurrent == mVictim.LotCurrent))
                {
                    if (!ManagerSim.HasTrait(injured, TraitNames.ImmuneToFire))
                    {
                        ManagerSim.AddBuff(Manager, injured, BuffNames.Singed, Origin.FromFire);

                        Manager.AddAlarm(new GoToHospitalScenario(injured, killer, "InjuredArson", SimDescription.DeathType.Burn));
                    }
                }

                return(true);
            }
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (Target == mLoser)
            {
                ManagerSim.AddBuff(Manager, Target, BuffNames.Sore, Origin.FromLosingFight);
            }
            else
            {
                if (Target == Sim)
                {
                    ManagerSim.AddBuff(Target, BuffNames.Winner, Origin.FromWinningFight);
                }
                else
                {
                    base.PrivateUpdate(frame);
                }

                if (ManagerSim.HasTrait(Target, TraitNames.Evil))
                {
                    ManagerSim.AddBuff(Target, BuffNames.FiendishlyDelighted, Origin);
                }
            }

            return(true);
        }
Beispiel #3
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            int bail = 0;

            ManagerSim.AddBuff(this, Sim, BuffNames.Nauseous, Origin.FromJailFood);

            Pair <string, int> value;

            if (sRepository.TryGetValue(Sim.SimDescriptionId, out value))
            {
                mStoryName = value.First;
                bail       = value.Second;

                sRepository.Remove(Sim.SimDescriptionId);
            }

            if (Sim.Occupation != null)
            {
                if (AddScoring("JailDemotion", GetValue <DemoteChanceOption, int>(), ScoringLookup.OptionType.Chance, Sim) > 0)
                {
                    Sim.Occupation.DemoteSim();
                }
            }

            bail += GetValue <BailOption, int>();
            if (bail > 0)
            {
                Money.AdjustFunds(Sim, "CourtFees", -bail);
            }

            return(true);
        }
Beispiel #4
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if ((Origin == Origin.FromFire) && (ManagerSim.HasTrait(Target, TraitNames.Pyromaniac)))
            {
                ManagerSim.AddBuff(Target, BuffNames.Fascinated, Origin);
            }

            if ((Origin == Origin.FromTheft) && (ManagerSim.HasTrait(Target, TraitNames.Kleptomaniac)))
            {
                ManagerSim.AddBuff(Target, BuffNames.Fascinated, Origin);
            }

            if (ManagerSim.HasTrait(Target, TraitNames.Coward))
            {
                ManagerSim.AddBuff(Target, BuffNames.Scared, Origin);
            }

            if ((ManagerSim.HasTrait(Target, TraitNames.Evil)) ||
                (ManagerSim.HasTrait(Target, TraitNames.MeanSpirited)))
            {
                ManagerSim.AddBuff(Target, BuffNames.FiendishlyDelighted, Origin);
            }
            else
            {
                // Not performed for the main Sim on purpose
                if (Target != Sim)
                {
                    base.PrivateUpdate(frame);

                    bool fail = false;

                    Relationship relation = Relationship.Get(mEnemy, Target, false);
                    if (relation != null)
                    {
                        if (relation.LTR.Liking >= mRelationshipGate)
                        {
                            fail = true;
                        }
                    }

                    if (!fail)
                    {
                        int report = 0;
                        if (mEnemy.Partner == Target)
                        {
                            report = ReportChance;
                        }

                        Add(frame, new ExistingEnemyManualScenario(mEnemy, Target, mDelta, report, GetTitlePrefix(PrefixType.Story)), ScenarioResult.Start);
                    }
                }
            }

            return(false);
        }
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (AddScoring("CaresAboutChildren", GetValue <AlimonyChanceOption, int>(Target), ScoringLookup.OptionType.Chance, Target) <= 0)
            {
                ManagerSim.AddBuff(Target, BuffNames.Amused, Origin);
                return(true);
            }

            if (ManagerSim.HasTrait(Target, TraitNames.Kleptomaniac))
            {
                ManagerSim.AddBuff(Target, BuffNames.Fascinated, Origin);
            }

            return(base.PrivateUpdate(frame));
        }
Beispiel #6
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if ((Origin == Origin.FromFire) && (ManagerSim.HasTrait(Target, TraitNames.Pyromaniac)))
            {
                ManagerSim.AddBuff(Target, BuffNames.Fascinated, Origin);
            }

            if ((Origin == Origin.FromTheft) && (ManagerSim.HasTrait(Target, TraitNames.Kleptomaniac)))
            {
                ManagerSim.AddBuff(Target, BuffNames.Fascinated, Origin);
            }

            if ((Origin == Origin.FromWatchingSimSuffer) && (ManagerSim.HasTrait(Target, TraitNames.Evil)))
            {
                ManagerSim.AddBuff(Target, BuffNames.FiendishlyDelighted, Origin);
            }

            return(base.PrivateUpdate(frame));
        }
Beispiel #7
0
        protected override bool Push()
        {
            SimDescription injured = Target;
            SimDescription killer  = Sim;

            if (mFail)
            {
                killer = null;

                if (AllowGoToJail)
                {
                    Manager.AddAlarm(new GoToJailScenario(Sim, Bail));

                    injured = null;
                }
                else
                {
                    injured = Sim;
                }
            }

            if ((AllowInjury) && (injured != null) && (injured.CreatedSim != null) && (injured.CreatedSim.LotCurrent == mVictim.LotCurrent))
            {
                Handiness skill = injured.SkillManager.GetSkill <Handiness>(SkillNames.Handiness);
                if ((skill == null) || (RandomUtil.RandomChance01((skill.MaxSkillLevel - skill.SkillLevel) / (float)skill.MaxSkillLevel)))
                {
                    if ((mVictim is Bathtub) || (mVictim is Shower) || (mVictim is Toilet) || (mVictim is Sink))
                    {
                        ManagerSim.AddBuff(Manager, injured, BuffNames.Soaked, Origin.FromFailedRepair);

                        Manager.AddAlarm(new GoToHospitalScenario(injured, killer, mVictim, "InjuredDrown", SimDescription.DeathType.Drown));
                    }
                    else
                    {
                        ManagerSim.AddBuff(Manager, injured, BuffNames.SingedElectricity, Origin.FromFailedRepair);

                        Manager.AddAlarm(new GoToHospitalScenario(injured, killer, mVictim, "InjuredElectrocute", SimDescription.DeathType.Electrocution));
                    }
                }
            }

            return(Situations.PushVisit(this, Sim, Target.LotHome));
        }
Beispiel #8
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Relationship relationship = ManagerSim.GetRelationship(Sim, Target);

            if (relationship == null)
            {
                return(false);
            }

            LongTermRelationship LTR = relationship.LTR;

            if (LTR == null)
            {
                return(false);
            }

            if (Sim.TraitManager.HasElement(TraitNames.GreatKisser) || Target.TraitManager.HasElement(TraitNames.GreatKisser))
            {
                if (Sim.CreatedSim != null)
                {
                    ManagerSim.AddBuff(this, Sim, BuffNames.GreatKisser, Origin.FromSocialization);
                }
                if (Target.CreatedSim != null)
                {
                    ManagerSim.AddBuff(this, Target, BuffNames.GreatKisser, Origin.FromSocialization);
                }
            }

            if (SimID.Matches(Flirts.PreviousLoveLoss, Sim))
            {
                Flirts.PreviousLoveLoss = null;
            }

            if (LTR.Liking > Sims3.Gameplay.Actors.Sim.kWooHooUseLikingGate)
            {
                if (!Sim.HadFirstWooHoo)
                {
                    Sim.SetFirstWooHoo();

                    if ((Sim.CreatedSim != null) && (Target.CreatedSim != null))
                    {
                        EventTracker.SendEvent(EventTypeId.kHadFirstWoohoo, Sim.CreatedSim, Target.CreatedSim);
                    }
                }

                if (!Target.HadFirstWooHoo)
                {
                    Target.SetFirstWooHoo();

                    if ((Sim.CreatedSim != null) && (Target.CreatedSim != null))
                    {
                        EventTracker.SendEvent(EventTypeId.kHadFirstWoohoo, Target.CreatedSim, Sim.CreatedSim);
                    }
                }

                LTR.AddInteractionBit(LongTermRelationship.InteractionBits.Kissed);
                LTR.AddInteractionBit(LongTermRelationship.InteractionBits.WooHoo);

                if (Sim.IsHuman)
                {
                    Sim.SetFirstKiss(Target);
                    Target.SetFirstKiss(Sim);
                }
                else
                {
                    if ((Sim.CreatedSim != null) && (Target.CreatedSim != null))
                    {
                        EventTracker.SendEvent(EventTypeId.kPetWooHooed, Sim.CreatedSim, Target.CreatedSim);
                        EventTracker.SendEvent(EventTypeId.kPetWooHooed, Target.CreatedSim, Sim.CreatedSim);
                    }
                }

                if (mPregnancyChance != 0)
                {
                    Add(frame, new UnexpectedPregnancyScenario(Sim, Target, mPregnancyChance), ScenarioResult.Start);
                }
                else
                {
                    Romances.AddWoohooerNotches(Sim, Target, false, false);
                }
            }

            if (OnRomanceAffairScenario != null)
            {
                OnRomanceAffairScenario(this, frame);
            }

            return(false);
        }
Beispiel #9
0
        protected bool AlterRelationship()
        {
            Relationship relation = ManagerSim.GetRelationship(Sim, Target);

            if (relation == null)
            {
                IncStat("No Relation");
                return(false);
            }

            int delta = Delta;

            if (delta == 0)
            {
                IncStat("No Delta");
                return(false);
            }

            if ((delta > 0) && (delta < 10))
            {
                delta = 10;
            }
            else if ((delta > -10) && (delta < 0))
            {
                delta = -10;
            }

            AddScoring("Delta", delta);

            try
            {
                int celebrity = GetValue <HobnobCelebrityPointsOption, int>();

                if (delta > 0)
                {
                    ManagerSim.AddBuff(Manager, Sim, BuffNames.Delighted, Origin.FromSocialization);
                    ManagerSim.AddBuff(Manager, Target, BuffNames.Delighted, Origin.FromSocialization);

                    delta = RandomUtil.GetInt(delta);

                    float value = 125;
                    if (delta > 75)
                    {
                        value = 1000;

                        celebrity *= 3;
                    }
                    else if (delta > 50)
                    {
                        value = 500;

                        celebrity *= 2;
                    }
                    else if (delta > 25)
                    {
                        value = 250;
                    }

                    if (IsRomantic)
                    {
                        relation.STC.Update(Sim, Target, CommodityTypes.Amorous, value);
                    }

                    relation.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.CelebrityImpressed);

                    relation.LTR.UpdateLiking(delta);
                }
                else
                {
                    if (GetValue <ExtremeHatredOption, bool>())
                    {
                        delta *= 2;
                    }

                    ManagerSim.AddBuff(Manager, Sim, BuffNames.Upset, Origin.FromSocialization);
                    ManagerSim.AddBuff(Manager, Target, BuffNames.Upset, Origin.FromSocialization);

                    delta = -RandomUtil.GetInt(-delta);

                    float value = 125;
                    if (delta < -75)
                    {
                        value = 1000;

                        celebrity *= 3;
                    }
                    else if (delta < -50)
                    {
                        value = 500;

                        celebrity *= 2;
                    }
                    else if (delta < -25)
                    {
                        value = 250;
                    }

                    relation.STC.Update(Sim, Target, CommodityTypes.Insulting, value);

                    relation.LTR.UpdateLiking(delta);
                }

                if (Sim.CelebrityLevel > Target.CelebrityLevel)
                {
                    Friends.AccumulateCelebrity(Target, celebrity);
                }
                else if (Sim.CelebrityLevel < Target.CelebrityLevel)
                {
                    Friends.AccumulateCelebrity(Sim, celebrity);
                }
            }
            catch (Exception e)
            {
                Common.DebugException(Sim, Target, e);
            }

            AddStat("Liking", relation.LTR.Liking);
            return(true);
        }
Beispiel #10
0
 protected override bool PrivateUpdate(ScenarioFrame frame)
 {
     ManagerSim.AddBuff(Target, mBuff, mTimeoutLength, mOrigin);
     return(true);
 }