Пример #1
0
 public Frame(uint seed, FrameType type, RNG rng, LeadRequired lead)
 {
     Seed      = seed;
     Lead      = lead;
     FrameType = type;
     RNG       = rng;
 }
Пример #2
0
        public static int GetLevel(EncounterSlot slot, LeadRequired lead, uint lvlrand)
        {
            if (lead == LeadRequired.PressureHustleSpirit)
            {
                return(slot.LevelMax);
            }
            if (slot.LevelMin == slot.LevelMax)
            {
                return(slot.LevelMin);
            }
            int delta  = slot.LevelMax - slot.LevelMin + 1;
            var adjust = (int)(lvlrand % delta);

            return(slot.LevelMin + adjust);
        }
Пример #3
0
        private static bool GetCanEncounter(EncounterSlot slot, FrameType frameType, int rand, LeadRequired lead)
        {
            int proc = frameType == FrameType.MethodJ ? rand / 656 : rand % 100;

            if ((slot.Type & SlotType.Rock_Smash) != 0)
            {
                return(proc < 60);
            }
            if (frameType == FrameType.MethodH)
            {
                return(true); // fishing encounters are disjointed by the hooked message.
            }
            // fishing
            if ((slot.Type & SlotType.Old_Rod) != 0)
            {
                if (proc < 25)
                {
                    return(true);
                }
                if (proc < 50)
                {
                    return(lead == LeadRequired.None);
                }
            }
            else if ((slot.Type & SlotType.Good_Rod) != 0)
            {
                if (proc < 50)
                {
                    return(true);
                }
                if (proc < 75 && lead == LeadRequired.None)
                {
                    return(lead == LeadRequired.None);
                }
            }
            else if ((slot.Type & SlotType.Super_Rod) != 0)
            {
                if (proc < 75)
                {
                    return(true);
                }
                return(lead == LeadRequired.None); // < 100 always true
            }
            return(false);                         // shouldn't hit here
        }
Пример #4
0
 public static bool GetIsEncounterable(EncounterSlot slot, FrameType frameType, int rand, LeadRequired lead)
 {
     if (slot.Type.IsSweetScentType())
     {
         return(true);
     }
     return(true); // todo
     //return GetCanEncounter(slot, frameType, rand, lead);
 }
Пример #5
0
 internal static bool IsLevelOrSlotModified(this LeadRequired Lead) => Lead.RemoveFlags() > LeadRequired.Synchronize;
Пример #6
0
 internal static LeadRequired RemoveFlags(this LeadRequired Lead) => Lead & ~LeadRequired.AllFlags;
Пример #7
0
 public Frame GetFrame(uint seed, LeadRequired lead) => new Frame(seed, FrameType, RNG, lead);
Пример #8
0
 public Frame GetFrame(uint seed, LeadRequired lead, uint esv) => new Frame(seed, FrameType, RNG, lead)
 {
     ESV = esv
 };
Пример #9
0
 public Frame(uint seed, FrameType type, LeadRequired lead)
 {
     Seed      = seed;
     Lead      = lead;
     FrameType = type;
 }
Пример #10
0
 public Frame GetFrame(uint seed, LeadRequired lead, uint esv, uint lvl, uint origin) => new Frame(seed, FrameType, RNG, lead)
 {
     RandESV    = esv,
     RandLevel  = lvl,
     OriginSeed = origin,
 };
Пример #11
0
 public Frame GetFrame(uint seed, LeadRequired lead, uint esv, uint origin) => GetFrame(seed, lead, esv, esv, origin);
Пример #12
0
 internal static bool NeedsLevelCall(this LeadRequired lead) => (lead & LeadRequired.UsesLevelCall) != 0;
 internal static LeadRequired RemoveFlags(this LeadRequired Lead) => Lead & LeadRequired.NoFlags;