Beispiel #1
0
        public static void OnAccepted(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                int funds = RandomUtil.GetInt(NRaas.Careers.Settings.mMaxShakedown / 2, NRaas.Careers.Settings.mMaxShakedown);

                if (funds > target.FamilyFunds)
                {
                    funds = target.FamilyFunds;
                }

                if (funds <= 0)
                {
                    return;
                }

                target.ModifyFunds(-funds);

                actor.ModifyFunds(funds);

                if (actor.IsSelectable)
                {
                    Common.Notify(actor, Common.Localize("Shakedown:Notice", actor.IsFemale, target.IsFemale, new object[] { actor, target, funds }));
                }

                Relationship relation = Relationship.Get(actor, target, true);
                if (relation != null)
                {
                    relation.LTR.UpdateLiking(NRaas.Careers.Settings.mShakedownRelationChange);
                }

                OmniCareer actorCareer = actor.Occupation as OmniCareer;
                if (actorCareer != null)
                {
                    actorCareer.AddShakedownFunds(funds);
                }
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }