예제 #1
0
        public string FindChineseZodiac(int year)
        {
            var modY = year % 12;

            AsianZodiac.AsianZodiacSigns Zodiac;
            switch (modY)
            {
            case 0: Zodiac = AsianZodiac.AsianZodiacSigns.Monkey; break;

            case 1: Zodiac = AsianZodiac.AsianZodiacSigns.Rooster; break;

            case 2: Zodiac = AsianZodiac.AsianZodiacSigns.Dog; break;

            case 3: Zodiac = AsianZodiac.AsianZodiacSigns.Pig; break;

            case 4: Zodiac = AsianZodiac.AsianZodiacSigns.Rat; break;

            case 5: Zodiac = AsianZodiac.AsianZodiacSigns.Ox; break;

            case 6: Zodiac = AsianZodiac.AsianZodiacSigns.Tiger; break;

            case 7: Zodiac = AsianZodiac.AsianZodiacSigns.Rabbit; break;

            case 8: Zodiac = AsianZodiac.AsianZodiacSigns.Dragon; break;

            case 9: Zodiac = AsianZodiac.AsianZodiacSigns.Snake; break;

            case 10: Zodiac = AsianZodiac.AsianZodiacSigns.Horse; break;

            case 11: Zodiac = AsianZodiac.AsianZodiacSigns.Ram; break;

            default: return("Error!");
            }
            return(Zodiac.ToString());
        }
예제 #2
0
        public string FindWestZodiac(DateTime date)
        {
            var day   = date.Day;
            var month = date.Month;

            WestZodiac.WestZodiacSigns Zodiac;
            if ((month == 3 && day >= 21) || (month == 4 && day <= 20))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Aries;
            }
            else if ((month == 4 && day >= 21) || (month == 5 && day <= 20))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Taurus;
            }
            else if ((month == 5 && day >= 21) || (month == 6 && day <= 21))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Gemini;
            }
            else if ((month == 6 && day >= 22) || (month == 7 && day <= 22))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Cancer;
            }
            else if ((month == 7 && day >= 23) || (month == 8 && day <= 23))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Leo;
            }
            else if ((month == 8 && day >= 24) || (month == 9 && day <= 23))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Virgo;
            }
            else if ((month == 9 && day >= 24) || (month == 10 && day <= 22))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Libra;
            }
            else if ((month == 10 && day >= 23) || (month == 11 && day <= 22))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Scorpio;
            }
            else if ((month == 11 && day >= 23) || (month == 12 && day <= 21))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Sagittarius;
            }
            else if ((month == 12 && day >= 22) || (month == 1 && day <= 20))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Capricorn;
            }
            else if ((month == 1 && day >= 21) || (month == 2 && day <= 19))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Aquarius;
            }
            else if ((month == 2 && day >= 20) || (month == 3 && day <= 20))
            {
                Zodiac = WestZodiac.WestZodiacSigns.Pisces;
            }
            else
            {
                return("Error!");
            }
            return(Zodiac.ToString());
        }
예제 #3
0
        //show my horoscope everyday morning at 10am
        public bool Execute(Dictionary <string, object> arguments)
        {
            int hoursPast10am = DateTime.Now.Hour - 10;

            if (hoursPast10am > 0 && hoursPast10am <= 3) //if time is past 10am
            {
                string zodiacString   = ((string)arguments["Zodiac"]).ToUpper();
                Zodiac zodiac         = (Zodiac)Enum.Parse(typeof(Zodiac), zodiacString);
                string predictionText = HoroscopeHelper.GetTodayPrediction(zodiac);

                string alertText = "Hey " + zodiac.ToString() + "! " + predictionText;
                new NotifyActivity().Execute(new Dictionary <string, object>()
                {
                    { "HeaderText", "YtoX Alert!" }, { "AlertText", alertText }, { "Persistent", true }
                });
                return(true);
            }

            return(false);
        }
예제 #4
0
        private void CreatInfoArray()
        {
            infos            = new string[QQGlobal.QQ_COUNT_GET_USER_INFO_FIELD];
            infos[QQ_NUM]    = QQ.ToString();
            infos[NICK]      = Nick;
            infos[COUNTRY]   = Country;
            infos[PROVINCE]  = Province;
            infos[ZIPCODE]   = ZipCode;
            infos[ADDRESS]   = Address;
            infos[TELEPHONE] = Telephone;
            infos[AGE]       = Age.ToString();
            infos[GENDER]    = Gender;

            // 10. 姓名
            infos[NAME] = Name;
            // 11. Email
            infos[EMAIL] = Email;
            // 12. 寻呼机sn,(sn是什么玩意,我也不知道)
            infos[PAGER_SN] = "";
            // 13. 寻呼机号
            infos[PAGER] = "";
            // 14. 寻呼机服务提供商
            infos[PAGER_SP] = "";
            // 15. 寻呼机base num(也不清楚这是什么)
            infos[PAGER_BASE_NUM] = "";
            // 16. 寻呼机类型
            infos[PAGER_TYPE] = "";
            // 17. 职业
            infos[OCCUPATION] = Occupation;
            // 18. 主页
            infos[HOMEPAGE] = HomePage;
            // 19. 认证类型(应该是被人加自己为好友的时候的认证类型把)
            infos[AUTH_TYPE] = ((int)AuthType).ToString();
            // 20. unknown 1
            infos[UNKNOWN_1] = "";
            // 21. unknown 2
            infos[UNKNOWN_2] = "";
            // 22. 头像,头像是用一个数代表的,比如27, 因为QQ目录下的头像是从1开始编号的,
            //     但是这个头像的数字却是从0开始计数的。并且注意,QQ的目录下面每种头像都
            //     有3个bmp,所以按数字这么一排,27应该是10-1.bmp
            infos[HEAD] = Head.ToString();
            // 23. 手机号
            infos[MOBILE] = Mobile;
            // 24. 手机类型
            infos[MOBILE_TYPE] = "";
            // 25. 介绍
            infos[INTRO] = Intro;
            // 26. 城市
            infos[CITY] = City;
            // 27. unknown 3
            infos[UNKNOWN_3] = "";
            // 28. unknown 4
            infos[UNKNOWN_4] = "";
            // 29. unknown 5
            infos[UNKNOWN_5] = "";
            // 30. is_open_hp
            infos[OPEN_HP] = "";
            // 31. is_open_contact(通讯方式是否对其他人可见)
            infos[OPEN_CONTACT] = ((int)OpenContact).ToString();
            // 32. 学校
            infos[COLLEGE] = College;
            // 33. 星座
            infos[HOROSCOPE] = Horoscope.ToString();
            // 34. 生肖
            infos[ZODIAC] = Zodiac.ToString();
            // 35. 血型
            infos[BLOOD] = Blood.ToString();
            // 36. UserFlag
            infos[USER_FLAG] = UserFlag.ToString();
            // 37. unknown 6,总是0x2D
            infos[UNKNOWN_6] = "";
        }
예제 #5
0
 override public string ToString()
 {
     return("Card: " + rank.ToString() + " of " + suit.ToString() + ", Zodiac: " + zodiac.ToString());
 }
예제 #6
0
파일: HudModelEx.cs 프로젝트: yakoder/NRaas
        public static List <KnownInfo> GetKnownInfoList(HudModel ths, SimDescription otherSimDesc, InformationLearnedAboutSim learnedInfo)
        {
            List <KnownInfo> list = new List <KnownInfo>();

            Common.StringBuilder msg = new Common.StringBuilder("GetKnownInfoList" + Common.NewLine);

            try
            {
                if (otherSimDesc != null)
                {
                    bool   isHuman = otherSimDesc.IsHuman;
                    bool   isTeen  = (otherSimDesc.Age & CASAgeGenderFlags.Teen) != CASAgeGenderFlags.None;
                    bool   isChild = (otherSimDesc.Age & CASAgeGenderFlags.Child) != CASAgeGenderFlags.None;
                    string str     = Localization.LocalizeString("Ui/Caption/HUD/RelationshipsPanel:UnknownTrait", new object[0x0]);

                    msg += "A";

                    foreach (Trait trait in otherSimDesc.TraitManager.List)
                    {
                        if (!trait.IsVisible || !Localization.HasLocalizationString(trait.TraitNameInfo))
                        {
                            continue;
                        }
                        bool flag4 = false;
                        foreach (TraitNames names in learnedInfo.Traits)
                        {
                            if (trait.Guid == names)
                            {
                                list.Add(new KnownInfo(trait.TraitName(otherSimDesc.IsFemale), trait.IconKey, KnownInfoType.Trait));
                                flag4 = true;
                                break;
                            }
                        }
                        if (!flag4)
                        {
                            list.Add(new KnownInfo(str, ResourceKey.CreatePNGKey("trait_unknown", 0x0), KnownInfoType.TraitUnknown));
                        }
                    }

                    msg += "B";

                    if ((isHuman && learnedInfo.CareerKnown) && !isChild)
                    {
                        bool      flag5        = false;
                        WorldName currentWorld = GameUtils.GetCurrentWorld();
                        if ((otherSimDesc.HomeWorld != currentWorld) && (GameUtils.GetWorldType(currentWorld) == WorldType.Vacation))
                        {
                            MiniSimDescription description = MiniSimDescription.Find(otherSimDesc.SimDescriptionId);
                            if (description != null)
                            {
                                ResourceKey iconKey = string.IsNullOrEmpty(description.JobIcon) ? ResourceKey.kInvalidResourceKey : ResourceKey.CreatePNGKey(description.JobIcon, 0x0);
                                list.Add(new KnownInfo(Localization.LocalizeString(description.IsFemale, description.JobOrServiceName, new object[0x0]), iconKey, KnownInfoType.Career));
                                flag5 = true;
                            }
                        }

                        msg += "C";

                        if (!flag5)
                        {
                            CareerManager careerManager = otherSimDesc.CareerManager;
                            if ((careerManager != null) && (careerManager.Occupation != null))
                            {
                                msg += "C1";

                                Occupation    occupation = careerManager.Occupation;
                                string        careerIcon = occupation.CareerIcon;
                                ResourceKey   key2       = string.IsNullOrEmpty(careerIcon) ? ResourceKey.kInvalidResourceKey : ResourceKey.CreatePNGKey(careerIcon, 0x0);
                                KnownInfoType type       = occupation.IsAcademicCareer ? KnownInfoType.AcademicCareer : KnownInfoType.Career;
                                list.Add(new KnownInfo(occupation.CurLevelJobTitle, key2, type));
                            }
                            else if ((otherSimDesc.CreatedByService != null) && Sims3.Gameplay.Services.Services.IsSimDescriptionInAnyServicePool(otherSimDesc))
                            {
                                string str4 = Localization.LocalizeString(otherSimDesc.IsFemale, "Gameplay/Services/Title:" + otherSimDesc.CreatedByService.ServiceType.ToString(), new object[0x0]);
                                list.Add(new KnownInfo(str4, ResourceKey.kInvalidResourceKey, KnownInfoType.Career));
                            }
                            else if ((otherSimDesc.AssignedRole != null) && !string.IsNullOrEmpty(otherSimDesc.AssignedRole.CareerTitleKey))
                            {
                                list.Add(new KnownInfo(Localization.LocalizeString(otherSimDesc.IsFemale, otherSimDesc.AssignedRole.CareerTitleKey, new object[0x0]), ResourceKey.kInvalidResourceKey, KnownInfoType.Career));
                            }
                            else if (((careerManager != null) && (careerManager.Occupation == null)) && (careerManager.RetiredCareer != null))
                            {
                                list.Add(new KnownInfo(Localization.LocalizeString("Ui/Caption/HUD/Career:Retired", new object[0x0]), ResourceKey.CreatePNGKey(careerManager.RetiredCareer.CareerIcon, 0x0), KnownInfoType.Career));
                            }
                            else
                            {
                                list.Add(new KnownInfo(Localization.LocalizeString(otherSimDesc.IsFemale, "Ui/Caption/HUD/KnownInfoDialog:Unemployed", new object[0x0]), ResourceKey.kInvalidResourceKey, KnownInfoType.Career));
                            }
                        }
                    }

                    msg += "D";

                    if (learnedInfo.PartnerKnown)
                    {
                        string      firstName            = null;
                        ResourceKey relationshipImageKey = ResourceKey.kInvalidResourceKey;
                        if (otherSimDesc.Partner != null)
                        {
                            msg += "D1";

                            firstName = otherSimDesc.Partner.FirstName;

                            // Custom : false -> true
                            Relationship relationship = otherSimDesc.GetRelationship(otherSimDesc.Partner, true);
                            if (relationship != null)
                            {
                                relationshipImageKey = RelationshipFunctions.GetLTRRelationshipImageKey(relationship.LTR.CurrentLTR, relationship.IsPetToPetRelationship);
                            }
                        }
                        else
                        {
                            msg += "D2";

                            if (otherSimDesc.HomeWorld != GameUtils.GetCurrentWorld())
                            {
                                MiniSimDescription description2 = MiniSimDescription.Find(otherSimDesc.SimDescriptionId);
                                if ((description2 != null) && (description2.PartnerId != 0x0L))
                                {
                                    MiniSimDescription otherSim = MiniSimDescription.Find(description2.PartnerId);
                                    if (otherSim != null)
                                    {
                                        firstName = otherSim.FirstName;
                                        MiniRelationship miniRelationship = description2.GetMiniRelationship(otherSim) as MiniRelationship;
                                        if (miniRelationship != null)
                                        {
                                            relationshipImageKey = RelationshipFunctions.GetLTRRelationshipImageKey(miniRelationship.CurrentLTR, miniRelationship.IsPetToPetRelationship);
                                        }
                                    }
                                }
                            }

                            if (string.IsNullOrEmpty(firstName))
                            {
                                firstName = Localization.LocalizeString("Ui/Caption/HUD/KnownInfoDialog:None", new object[0x0]);
                            }
                        }
                        list.Add(new KnownInfo(firstName, relationshipImageKey, KnownInfoType.Partner));
                    }

                    msg += "E";

                    if ((isHuman && (isTeen || isChild)) && ((otherSimDesc.CareerManager != null) && (otherSimDesc.CareerManager.School != null)))
                    {
                        list.Add(new KnownInfo(otherSimDesc.CareerManager.School.Name, ResourceKey.CreatePNGKey(otherSimDesc.CareerManager.School.CareerIcon, 0x0), KnownInfoType.School));
                    }

                    if (learnedInfo.IsRichAndKnownToBeRich)
                    {
                        list.Add(new KnownInfo(Localization.LocalizeString(otherSimDesc.IsFemale, "Ui/Caption/HUD/KnownInfoDialog:IsRich", new object[0x0]), ResourceKey.CreatePNGKey("w_simoleon_32", 0x0), KnownInfoType.Rich));
                    }

                    if (isHuman && learnedInfo.SignKnown)
                    {
                        Zodiac zodiac = otherSimDesc.Zodiac;
                        list.Add(new KnownInfo(Localization.LocalizeString(otherSimDesc.IsFemale, "Ui/Caption/HUD/KnownInfoDialog:" + zodiac.ToString(), new object[0x0]), ResourceKey.CreatePNGKey("sign_" + zodiac.ToString() + "_sm", 0x0), KnownInfoType.Zodiac));
                    }

                    if (isHuman && learnedInfo.AlmaMaterKnown)
                    {
                        if (otherSimDesc.AlmaMater != AlmaMater.None)
                        {
                            list.Add(new KnownInfo(otherSimDesc.AlmaMaterName, ResourceKey.CreatePNGKey("w_simple_school_career_s", 0), KnownInfoType.AlmaMater));
                        }
                        if (((otherSimDesc.CareerManager != null) && (otherSimDesc.CareerManager.DegreeManager != null)) && (otherSimDesc.CareerManager.DegreeManager.GetDegreeEntries().Count > 0))
                        {
                            list.Add(new KnownInfo(Localization.LocalizeString("Ui/Caption/HUD/KnownInfoTooltip:UniversityAlmaMater", new object[0]), ResourceKey.CreatePNGKey("moodlet_just_graduated", ResourceUtils.ProductVersionToGroupId(ProductVersion.EP9)), KnownInfoType.AlmaMater));
                        }
                    }

                    msg += "G";

                    uint celebrityLevel = otherSimDesc.CelebrityLevel;
                    if (celebrityLevel > 0x0)
                    {
                        KnownInfo item = new KnownInfo(otherSimDesc.CelebrityManager.LevelName, ResourceKey.CreatePNGKey("hud_i_celebrity_page", 0x0), KnownInfoType.CelebrityLevel);
                        item.mCelebrityLevel = celebrityLevel;
                        list.Add(item);
                    }

                    msg += "H";

                    if (learnedInfo.IsSocialGroupsKnown)
                    {
                        TraitManager traitManager = otherSimDesc.TraitManager;
                        SkillManager skillManager = otherSimDesc.SkillManager;
                        if ((traitManager != null) && (skillManager != null))
                        {
                            if (traitManager.HasElement(TraitNames.InfluenceNerd))
                            {
                                InfluenceSkill skill = skillManager.GetSkill <InfluenceSkill>(SkillNames.InfluenceNerd);
                                if ((skill != null) && (skill.SkillLevel > 0))
                                {
                                    list.Add(new KnownInfo(string.Concat(new object[] { Localization.LocalizeString("Ui/Tooltips/SocialGroup:Nerd", new object[0]), "(", skill.SkillLevel, ")" }), ResourceKey.CreatePNGKey("trait_SocialGroup01_s", ResourceUtils.ProductVersionToGroupId(ProductVersion.EP9)), KnownInfoType.SocialGroup));
                                }
                            }
                            if (traitManager.HasElement(TraitNames.InfluenceSocialite))
                            {
                                InfluenceSkill skill2 = skillManager.GetSkill <InfluenceSkill>(SkillNames.InfluenceSocialite);
                                if ((skill2 != null) && (skill2.SkillLevel > 0))
                                {
                                    list.Add(new KnownInfo(string.Concat(new object[] { Localization.LocalizeString("Ui/Tooltips/SocialGroup:Jock", new object[0]), "(", skill2.SkillLevel, ")" }), ResourceKey.CreatePNGKey("trait_SocialGroup03_s", ResourceUtils.ProductVersionToGroupId(ProductVersion.EP9)), KnownInfoType.SocialGroup));
                                }
                            }
                            if (traitManager.HasElement(TraitNames.InfluenceRebel))
                            {
                                InfluenceSkill skill3 = skillManager.GetSkill <InfluenceSkill>(SkillNames.InfluenceRebel);
                                if ((skill3 != null) && (skill3.SkillLevel > 0))
                                {
                                    list.Add(new KnownInfo(string.Concat(new object[] { Localization.LocalizeString("Ui/Tooltips/SocialGroup:Rebel", new object[0]), "(", skill3.SkillLevel, ")" }), ResourceKey.CreatePNGKey("trait_SocialGroup02_s", ResourceUtils.ProductVersionToGroupId(ProductVersion.EP9)), KnownInfoType.SocialGroup));
                                }
                            }
                        }
                    }

                    msg += "I";

                    if (learnedInfo.NumDegreesKnown() > 0)
                    {
                        KnownInfo info2 = new KnownInfo("", ResourceKey.kInvalidResourceKey, KnownInfoType.Degree);
                        otherSimDesc.CareerManager.DegreeManager.GetCompletedDegreeEntries();
                        foreach (AcademicDegreeNames names2 in learnedInfo.Degrees)
                        {
                            AcademicDegree element = otherSimDesc.CareerManager.DegreeManager.GetElement(names2);
                            if ((element != null) && element.IsDegreeCompleted)
                            {
                                if (info2.mDegreeIcons.Count == 5)
                                {
                                    list.Add(info2);
                                    info2 = new KnownInfo("", ResourceKey.kInvalidResourceKey, KnownInfoType.Degree);
                                }
                                ResourceKey key4 = ResourceKey.CreatePNGKey(element.DegreeIcon, 0);
                                info2.mDegreeIcons.Add(key4);
                                info2.mIconKey = key4;
                                info2.mInfo    = element.DegreeName;
                            }
                        }
                        list.Add(info2);
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception(otherSimDesc, null, msg, e);
            }

            return(list);
        }