Пример #1
0
        protected static bool PrivateKill(Sim actor, Sim target, SimDescription.DeathType deathType)
        {
            GreyedOutTooltipCallback greyedOutTooltipCallback = null;

            if (!Assassination.CanBeKilled(target, ref greyedOutTooltipCallback))
            {
                return(false);
            }

            if (deathType == SimDescription.DeathType.None)
            {
                new EraseKillTask(actor, target.SimDescription);
                return(true);
            }
            else
            {
                sStoryProgressionAboutToDie.Invoke <bool>(new object[] { target.SimDescription });

                if (deathType == SimDescription.DeathType.Burn)
                {
                    LotLocation location    = LotLocation.Invalid;
                    ulong       lotLocation = World.GetLotLocation(target.PositionOnFloor, ref location);
                    if (lotLocation != 0)
                    {
                        Fire.CreateFire(lotLocation, location);
                    }
                }
                else if (deathType == SimDescription.DeathType.Meteor)
                {
                    new MeteorControl(actor, target);
                    return(true);
                }
                else if (deathType == SimDescription.DeathType.Thirst)
                {
                    if (actor.SimDescription.IsVampire)
                    {
                        if (actor.TraitManager.HasElement(TraitNames.Vegetarian))
                        {
                            actor.BuffManager.AddElement(BuffNames.Nauseous, Origin.FromCarnivorousBehavior);
                        }
                        else
                        {
                            actor.BuffManager.AddElement(BuffNames.Sated, Origin.FromReceivingVampireNutrients);
                        }

                        actor.Motives.SetMax(CommodityKind.VampireThirst);

                        if (target.SimDescription.IsFairy)
                        {
                            actor.BuffManager.AddElement(BuffNames.DrankFromAFairy, Origin.FromReceivingVampireNutrients);
                        }

                        EventTracker.SendEvent(EventTypeId.kVampireDrankFromSim, actor, target);
                        EventTracker.SendEvent(new VampireLifetimeEvent(EventTypeId.kVampireLifetimeEvent, actor.SimDescription, false, target.SimDescription.SimDescriptionId));
                    }
                }

                return(DelayedKill(actor, target, deathType));
            }
        }
Пример #2
0
        public override bool Run()
        {
            try
            {
                Definition definition = InteractionDefinition as Definition;
                if (definition.IsMassDeath)
                {
                    List <Sim> sims = new List <Sim>(Target.LotCurrent.GetObjects <Sim>());

                    foreach (Sim sim in sims)
                    {
                        if (sim == Actor)
                        {
                            continue;
                        }

                        GreyedOutTooltipCallback greyedOutTooltipCallback = null;
                        if (!Assassination.CanBeKilled(sim, ref greyedOutTooltipCallback))
                        {
                            continue;
                        }

                        Kill instance = (new Definition(false, false, definition.DeathType)).CreateInstance(sim, Actor, new InteractionPriority(InteractionPriorityLevel.MaxDeath), false, false) as Kill;

                        Actor.InteractionQueue.Add(instance);
                    }
                }
                else
                {
                    SimDescription target = Target.SimDescription;

                    if (PrivateKill(Actor, Target, definition.DeathType))
                    {
                        Assassination skill = Assassination.EnsureSkill(Actor);
                        if (skill != null)
                        {
                            skill.AddPotentialKill(target, false);
                        }

                        if ((Autonomous) && (Assassination.Settings.mShowAutonomousNotice))
                        {
                            Common.Notify(Actor, Common.Localize("AssassinationKill:Notice", Actor.IsFemale, Target.IsFemale, new object[] { Actor, Target }));
                        }
                    }
                }

                return(true);
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Пример #3
0
            public override List <Sim> GetYouShouldTargets(Sim thisActor, Sim pushedSocialActor)
            {
                InteractionPriority priority = new InteractionPriority(InteractionPriorityLevel.UserDirected);

                SocialInteractionA.Definition pushedSocialDefinition = new SocialInteractionA.Definition(mPushedSocialActionKey, new string[0x0], null, false);
                pushedSocialDefinition.ChecksToSkip = mChecksToSkip;

                List <Sim> list = new List <Sim>();

                foreach (Sim sim in pushedSocialActor.LotCurrent.GetAllActors())
                {
                    if (sim == thisActor)
                    {
                        continue;
                    }

                    if (sim == pushedSocialActor)
                    {
                        continue;
                    }

                    GreyedOutTooltipCallback tooltipCallback = null;
                    if (!PushedSocialTest(pushedSocialActor, sim, pushedSocialDefinition, priority, tooltipCallback))
                    {
                        continue;
                    }

                    GreyedOutTooltipCallback callback = null;
                    if (!Assassination.CanBeKilled(sim, ref callback))
                    {
                        continue;
                    }

                    list.Add(sim);
                }

                return(list);
            }
Пример #4
0
        public override bool Run()
        {
            try
            {
                Definition definition = InteractionDefinition as Definition;
                if (definition.IsMassDeath)
                {
                    List <Sim> sims = new List <Sim>(Target.LotCurrent.GetObjects <Sim>());

                    foreach (Sim sim in sims)
                    {
                        if (sim == Actor)
                        {
                            continue;
                        }

                        GreyedOutTooltipCallback greyedOutTooltipCallback = null;
                        if (!Assassination.CanBeKilled(sim, ref greyedOutTooltipCallback))
                        {
                            continue;
                        }

                        Kill instance = (new Definition(false, false, definition.DeathType)).CreateInstance(sim, Actor, new InteractionPriority(InteractionPriorityLevel.MaxDeath), false, false) as Kill;

                        Actor.InteractionQueue.Add(instance);
                    }
                }
                else
                {
                    SimDescription target = Target.SimDescription;

                    if (Actor.GetDistanceToObject(Target) > 1f)
                    {
                        Actor.RequestWalkStyle(Sim.WalkStyle.Walk);
                        Actor.PlayReaction(ReactionTypes.EvilLaugh, ReactionSpeed.Immediate);

                        Route r = Actor.CreateRoute();
                        r.SetOption(Route.RouteOption.MakeDynamicObjectAdjustments, true);
                        r.PlanToPointRadialRange(Target, Target.Position, 3.5f, 5f, RouteDistancePreference.PreferFurthestFromRouteDestination, RouteOrientationPreference.TowardsObject, Target.LotCurrent.LotId, new int[] { Target.RoomId });
                        if (!r.PlanResult.Succeeded() || !Actor.DoRoute(r))
                        {
                            Actor.PlayRouteFailure();
                            return(false);
                        }
                    }

                    if (PrivateKill(Actor, Target, definition.DeathType))
                    {
                        Assassination skill = Assassination.EnsureSkill(Actor);
                        if (skill != null)
                        {
                            skill.AddPotentialKill(target, false);
                        }

                        if ((Autonomous) && (Assassination.Settings.mShowAutonomousNotice))
                        {
                            Common.Notify(Actor, Common.Localize("AssassinationKill:Notice", Actor.IsFemale, Target.IsFemale, new object[] { Actor, Target }));
                        }
                    }
                }

                return(true);
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }