Example #1
0
        private static List <Lot> GetValidLots(bool forAbduction = false)
        {
            List <Lot> list = new List <Lot>();

            foreach (Lot lot in LotManager.AllLots)
            {
                if (!lot.IsWorldLot && lot.LotType != LotType.Tutorial && !lot.IsCommunityLotOfType(CommercialLotSubType.kMisc_NoVisitors) &&
                    !lot.IsCommunityLotOfType(CommercialLotSubType.kEP10_Diving) && !UnchartedIslandMarker.IsUnchartedIsland(lot))
                {
                    if (lot.IsPlayerHomeLot)
                    {
                        continue;
                    }

                    if (lot.IsResidentialLot && lot.Household == null)
                    {
                        continue;
                    }

                    if (AlienUtils.IsHouseboatAndNotDocked(lot))
                    {
                        continue;
                    }

                    if (forAbduction && lot.GetAllActorsCount() <= 0)
                    {
                        continue;
                    }

                    list.Add(lot);
                }
            }

            if (list.Count == 0)
            {
                return(null);
            }
            else
            {
                return(list);
            }
        }
Example #2
0
        static List <Sim> GetAbductees(Household household)
        {
            if (household != null && household.NumMembers > 0)
            {
                List <Sim> list = new List <Sim>();

                foreach (Sim current in household.mMembers.ActorList)
                {
                    if (current.IsHuman && current.SimDescription.TeenOrAbove && current.LotCurrent != null &&
                        !AlienUtils.IsHouseboatAndNotDocked(current.LotCurrent))
                    {
                        list.Add(current);
                    }
                }

                return((list.Count > 0) ? list : null);
            }

            return(null);
        }
Example #3
0
        static bool CanASimBeAbducted(Household household)
        {
            if (AlienUtils.sAlienAbductionHelper == null)
            {
                return(false);
            }

            int num = 0;

            foreach (Sim current in household.mMembers.ActorList)
            {
                if (current.IsHuman && current.SimDescription.TeenOrAbove &&
                    !AlienUtils.IsHouseboatAndNotDocked(current.LotCurrent) &&
                    CanASimBeAbducted(current.LotCurrent))
                {
                    num++;
                }
            }

            return(num > 0);
        }
Example #4
0
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!Aliens.Settings.Debugging)
                {
                    return(false);
                }

                if (Household.AlienHousehold == null)
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("Alien household is null.");
                    return(false);
                }

                if (AlienUtils.IsHouseboatAndNotDocked(target.LotCurrent))
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("Target is on an undocked houseboat.");
                    return(false);
                }

                if (AlienUtilsEx.GetValidAliens() == null)
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("No valid aliens.");
                    return(false);
                }

                if (!target.SimDescription.IsHuman)
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("Target is not human.");
                    return(false);
                }

                if (target.SimDescription.ChildOrBelow)
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("Target is not teen or older.");
                    return(false);
                }

                return(true);
            }
Example #5
0
        private void btnParse_Click(object sender, System.EventArgs e)
        {
            try
            {
                if ((msTags != null) && (msTags.Length > 0))
                {
                    this.Cursor = Cursors.WaitCursor;
                    TagInfo[] aTags;
                    TagInfo   tag;
                    try
                    {
                        int cnt = AlienUtils.ParseTagList(msTags, out aTags);
                        tag = aTags[0];
                        if (cnt > 0)
                        {
                            //MessageBox.Show (tag.TagID.ToString ());
                            malTags = new ArrayList(aTags);



                            dataGrid1.DataSource = malTags;
                        }
                        else
                        {
                            textReaderTalk.AppendText(msTags + "\r\n");
                        }
                        this.Cursor = Cursors.Default;
                    }
                    catch (Exception ex)
                    {
                        textReaderTalk.AppendText(ex.Message + "\r\n");
                    }
                }
            }
            catch {
                MessageBox.Show("分析出错");
            }
        }
Example #6
0
        public static List <Lot> GetValidLots()
        {
            List <Lot> list = new List <Lot>();

            foreach (Lot current in LotManager.AllLotsWithoutCommonExceptions)
            {
                if (current.LotType != LotType.Tutorial && current != Household.ActiveHousehold.LotHome)
                {
                    if (!AlienUtils.IsHouseboatAndNotDocked(current))
                    {
                        list.Add(current);
                    }
                }
            }

            if (list.Count == 0)
            {
                return(null);
            }
            else
            {
                return(list);
            }
        }
Example #7
0
        public static List <Sim> GetValidAbductees(Lot lot)
        {
            List <Sim> list = new List <Sim>();

            foreach (Sim current in lot.GetSims())
            {
                if (current.IsHuman && current.SimDescription.TeenOrAbove && !current.Household.IsTouristHousehold)
                {
                    if (!AlienUtils.IsHouseboatAndNotDocked(current.LotCurrent))
                    {
                        list.Add(current);
                    }
                }
            }

            if (list.Count == 0)
            {
                return(null);
            }
            else
            {
                return(list);
            }
        }
Example #8
0
        public static List <Sim> GetValidAbductees(Household household)
        {
            List <Sim> list = new List <Sim>();

            foreach (Sim current in household.mMembers.ActorList)
            {
                if (current.IsHuman && current.SimDescription.TeenOrAbove)
                {
                    if (!AlienUtils.IsHouseboatAndNotDocked(current.LotCurrent))
                    {
                        list.Add(current);
                    }
                }
            }

            if (list.Count == 0)
            {
                return(null);
            }
            else
            {
                return(list);
            }
        }
Example #9
0
        public override void GetNewBorns()
        {
            mNewborns = new List <Sim>();
            Sims3.Gameplay.Gameflow.Singleton.DisableSave(this, "Gameplay/ActorSystems/Pregnancy:DisableSave");
            bool keepBaby = false;

            //if (Actor.Household.NumActorMembersCountingPregnancy < 0x8)
            {
                // Custom
                if (SimTypes.IsSelectable(Actor))
                {
                    keepBaby = TwoButtonDialog.Show(AlienUtils.LocalizeString("MalePregnancyConfirmationDialog", new object[] { Actor }), AlienUtils.LocalizeString("MalePregnancyConfirmationDialogAccept", new object[0x0]), AlienUtils.LocalizeString("MalePregnancyConfirmationDialogReject", new object[0x0]));
                }
                else
                {
                    keepBaby = true;
                }
            }

            /*else
             * {
             *  Actor.ShowTNSIfSelectable(AlienUtils.LocalizeString("MalePregnancyHouseholdFullTNS", new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, Actor.ObjectId);
             * }*/

            CASAgeGenderFlags gender       = RandomUtil.CoinFlip() ? CASAgeGenderFlags.Male : CASAgeGenderFlags.Female;
            SimDescription    description2 = SimDescription.Find(this.AlienParentID);
            SimDescription    newSim       = Genetics.MakeAlien(CASAgeGenderFlags.Baby, gender, GameUtils.GetCurrentWorld(), 1f, false);

            newSim.LastName = Actor.LastName;
            if ((keepBaby) && (SimTypes.IsSelectable(Actor)))
            {
                newSim.FirstName = string.Empty;
            }

            Genetics.AssignTraits(newSim, null, Actor.SimDescription, (keepBaby) && (SimTypes.IsSelectable(Actor)), (float)Actor.MoodManager.MoodValue, new Random());
            Actor.Genealogy.AddChild(newSim.Genealogy);
            if (description2 != null)
            {
                description2.Genealogy.AddChild(newSim.Genealogy);
            }

            if (keepBaby)
            {
                Actor.Household.Add(newSim);
            }
            else
            {
                Household.AlienHousehold.Add(newSim);
            }

            Sim babyToHide = newSim.Instantiate(Vector3.Empty);

            babyToHide.GreetSimOnLot(Actor.LotCurrent);
            babyToHide.SetPosition(Actor.Position);
            Pregnancy.TotallyHideBaby(babyToHide);
            mNewborns.Add(babyToHide);
        }
Example #10
0
        private void displayText(String data)
        {
            try
            {
                if (this.InvokeRequired)
                {
                    object[] temp = { data };
                    this.Invoke(new displayMessageDlgt(displayText), temp);
                    return;
                }
                else
                {
                    NotifyInfo ni = null;
                    AlienUtils.ParseNotification(data, out ni);
                    if (ni != null)
                    {
                        ITagInfo[] tags = ni.TagList;
                        foreach (TagInfo tag in tags)
                        {
                            if (!tagsCollection.Exists(item => item == tag.TagID))
                            {
                                tagsCollection.Add(tag.TagID);

                                DateTime d;
                                DateTime.TryParse(tag.DiscoveryTime, out d);
                                double timestamp = Helper.ConvertToUnixTimestamp(d);

                                Finisher finisher = new Finisher();
                                Racer    racer    = racers.findByEpc1(tag.TagID);
                                if (racer == null)
                                {
                                    racer = racers.findByEpc2(tag.TagID);
                                }

                                if (racer != null)
                                {
                                    finisher.racerNo = racer.racerNo;
                                    finisher.epc     = tag.TagID;
                                    finisher.time    = d.ToString("yyyy-MM-dd HH:mm:ss.ffff");
                                    int result = 0;
                                    if (finisher.racerNo > 0)
                                    {
                                        result = finishers.create(finisher);
                                    }

                                    if (result > 0)
                                    {
                                        txtNotifications.Text += "FINISHER: " + racer.racerName + " : " + tag.TagID + " " + tag.DiscoveryTime + "\r\n";
                                    }
                                    else
                                    {
                                        txtNotifications.Text += tag.TagID + " " + tag.DiscoveryTime + "\r\n";
                                    }
                                }

                                MessageBox.Show(d.ToString("yyyy-MM-dd HH:mm:ss.ffff"));
                            }
                        }
                    }

                    //txtNotifications.Text += data.Replace("\0", "") + "\r\n";

                    /*
                     * NotifyInfo ni = null;
                     * AlienUtils.ParseNotification(data, out ni);
                     * if (ni != null)
                     * {
                     *  lblReaderName.Text = ni.ReaderName;
                     * }*/
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception in the DiscplayText(): " + ex.Message);
            }
        }