Example #1
0
        public override bool InRabbitHole()
        {
            BeginCommodityUpdates();
            bool flag = DoTimedLoop(kSimMinutesForRaid);

            EndCommodityUpdates(flag);

            int samplesStolen = 0;

            if (flag)
            {
                for (int i = 0; i < mMaxSamples; i++)
                {
                    if (RandomUtil.RandomChance(mChance))
                    {
                        ScientificSample.DnaSampleSubject subject = new ScientificSample.DnaSampleSubject(RandomUtil.GetRandomObjectFromList(mDonors));
                        ScientificSample.CreateAndAddToInventory(Actor, subject);
                        samplesStolen++;
                    }
                }
            }

            mSuccessful = samplesStolen > 0;

            return(flag);
        }
Example #2
0
        public static void DonateDNA(Sim actor, Sim target)
        {
            if (!actor.IsRobot && !target.IsRobot)
            {
                Common.DebugNotify("CommonSurrogate.DonateDNA" + Common.NewLine + " - Fail: Participants are Robots");
                return;
            }

            if (actor.IsRobot && target.IsRobot)
            {
                Common.DebugNotify("CommonSurrogate.DonateDNA" + Common.NewLine + " - Fail: Participants are Humans");
                return;
            }

            if (actor.SimDescription.Gender != target.SimDescription.Gender)
            {
                Common.DebugNotify("CommonSurrogate.DonateDNA" + Common.NewLine + " - Fail: Participants are not Same Sex");
                return;
            }

            ScientificSample.DnaSampleSubject subject;

            if (!actor.IsRobot)
            {
                subject = new ScientificSample.DnaSampleSubject(actor.SimDescription);
                ScientificSample.CreateAndAddToInventory(target, subject);
            }
            else
            {
                subject = new ScientificSample.DnaSampleSubject(target.SimDescription);
                ScientificSample.CreateAndAddToInventory(actor, subject);
            }
        }