Exemple #1
0
        public override void Init(ref InteractionInstanceParameters parameters)
        {
            try
            {
                base.Init(ref parameters);

                Sim  target   = null;
                bool mGetting = false;
                if (Autonomous)
                {
                    mMassInfo = MassageTable.MassageInfos[RandomUtil.GetInt(0x4)];

                    bool romantic = ((mMassInfo.mType == MassageTable.MassageType.Romantic) || (mMassInfo.mType == MassageTable.MassageType.AmazingRomantic));

                    List <Sim> validMassageSims = GetValidMassageSims(Target, Actor, romantic, parameters.Autonomous);
                    if (validMassageSims.Count == 0x0)
                    {
                        return;
                    }

                    target = validMassageSims[RandomUtil.GetInt(validMassageSims.Count - 0x1)];
                }
                else
                {
                    target = GetSelectedObject() as Sim;
                    Definition interactionDefinition = InteractionDefinition as Definition;
                    mMassInfo = interactionDefinition.mMassInfo;
                    mGetting  = interactionDefinition.mGetting;
                }

                if (target != null)
                {
                    if (mGetting)
                    {
                        mMasseuse = target;
                        mMassagee = Actor;
                    }
                    else
                    {
                        mMasseuse = Actor;
                        mMassagee = target;
                    }

                    bool cancelled = false;
                    Sim  masseuse  = null;
                    Sim  massagee  = null;
                    if (mMasseuse.IsSelectable)
                    {
                        masseuse = mMasseuse;
                        massagee = mMassagee;
                    }
                    else
                    {
                        masseuse = mMassagee;
                        massagee = mMasseuse;
                    }

                    bool allowAge = false;

                    string reason;
                    GreyedOutTooltipCallback callback = null;
                    if (CommonSocials.CanGetRomantic(Actor, target, Autonomous, false, true, ref callback, out reason))
                    {
                        allowAge = true;
                    }

                    if (((mMassInfo.mType == MassageTable.MassageType.Romantic) || (mMassInfo.mType == MassageTable.MassageType.AmazingRomantic)) && !allowAge)
                    {
                        if (!Autonomous)
                        {
                            masseuse.ShowTNSIfSelectable(MassageTable.LocalizeString("InvalidRomanticMassage", new object[] { massagee }), StyledNotification.NotificationStyle.kGameMessageNegative);
                        }
                        cancelled = true;
                    }

                    if (target.GetRelationship(Actor, true).AreEnemies())
                    {
                        if (!Autonomous)
                        {
                            masseuse.ShowTNSIfSelectable(MassageTable.LocalizeString("NoMassageForEnemy", new object[] { massagee }), StyledNotification.NotificationStyle.kGameMessageNegative);
                        }
                        cancelled = true;
                    }

                    if (cancelled)
                    {
                        Cancelled = true;
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(parameters.Actor, parameters.Target, e);
            }
        }
Exemple #2
0
 public Definition(bool getting, MassageTable.MassageInfo massInfo, string[] menuPath)
     : base(getting, massInfo, menuPath)
 {
 }