コード例 #1
0
        public override bool Run()
        {
            Vector3         mPoint          = Hit.mPoint;
            FishingData     fishingData     = FishingSpot.GetFishingData(mPoint, Hit.mType);
            FishingSpotData fishingSpotData = fishingData as FishingSpotData;
            string          str             = (fishingSpotData == null) ? Localization.LocalizeString("Gameplay/Objects/Fishing:EmptyWater")
                                : ((!fishingSpotData.IsActive) ? Localization.LocalizeString("Gameplay/Objects/Fishing:InactiveWater")
                                : Localization.LocalizeString("Gameplay/Objects/Fishing:ActiveWater"));

            str += "\n";
            List <FishType>   fish    = fishingData.GetFish();
            List <int>        chances = fishingData.GetChances();
            EWCatFishingSkill skill   = Actor.SkillManager.GetSkill <EWCatFishingSkill>(EWCatFishingSkill.SkillNameID);

            for (int i = 0; i < chances.Count; i++)
            {
                if (chances[i] > 0)
                {
                    FishType fishType = fish[i];
                    if (fishType != FishType.None && fishType != FishType.Box)
                    {
                        // Only fish appropriate to skill or that sim "knows about" (has already caught) will be
                        // displayed. This should be just like human fishing.
                        str = str + "\n" + GetFishName(fish[i], skill);
                        //str = str + "\n" + fish[i].ToString();
                    }
                }
            }
            Show(new Format(str, NotificationStyle.kGameMessagePositive));
            return(true);
        }
コード例 #2
0
ファイル: EWCatFishHere.cs プロジェクト: Echoweaver/Sims3Game
        public static void GetSpawnerChances(Sim Actor, FishingData fishingData, out List <FishType> fish, out float[] chances)
        {
            fish = fishingData.GetFish();
            int        skillLevel = Actor.SkillManager.GetSkillLevel(EWCatFishingSkill.SkillNameID);
            List <int> chances2   = fishingData.GetChances();

            chances = new float[chances2.Count];
            int num = 0;

            foreach (FishType item in fish)
            {
                if (item != FishType.None)
                {
                    Fish.sFishData.TryGetValue(item, out FishData value);
                    if (value != null && skillLevel >= value.Level)
                    {
                        chances[num] = (float)chances2[num];
                    }
                    else
                    {
                        chances[num] = 0f;
                    }
                }
                num++;
            }
        }