Пример #1
0
        internal static CustomRing CreateCustomRing(Ring ring)
        {
            CustomRing customRing = null;

            switch (GetRingTypeFromName(ring.Name))
            {
            case RingType.PetalRing:
                customRing = new PetalRing(ring);
                break;

            case RingType.ButterflyRing:
                customRing = new ButterflyRing(ring);
                break;

            case RingType.FairyRing:
                customRing = new FairyRing(ring);
                break;

            case RingType.RaindropRing:
                customRing = new RaindropRing(ring);
                break;

            case RingType.BunnyRing:
                customRing = new BunnyRing(ring);
                break;

            case RingType.JunimoRing:
                customRing = new JunimoRing(ring);
                break;

            case RingType.SlimeRing:
                customRing = new SlimeRing(ring);
                break;

            case RingType.FireflyRing:
                customRing = new FireflyRing(ring);
                break;

            case RingType.FrogRing:
                customRing = new FrogRing(ring);
                break;

            case RingType.DustRing:
                customRing = new DustRing(ring);
                break;

            case RingType.BatRing:
                customRing = new BatRing(ring);
                break;

            default:
                // Do nothing, though we should never reach here as Unknown isn't handled
                break;
            }

            return(customRing);
        }
Пример #2
0
        internal static void HandleLeaveLocation(Farmer who, GameLocation location, Ring ring)
        {
            CustomRing customRing = wornCustomRings.FirstOrDefault(r => r.RingObject == ring);

            if (customRing != null)
            {
                customRing.HandleLeaveLocation(who, location);
            }
        }
Пример #3
0
        internal static void HandleNewLocation(Farmer who, GameLocation location, Ring ring)
        {
            // This will handle save loading
            CustomRing customRing = wornCustomRings.FirstOrDefault(r => r.RingObject == ring);

            if (customRing != null)
            {
                customRing.HandleNewLocation(who, location);
            }
        }
Пример #4
0
        internal static void HandleEquip(Farmer who, GameLocation location, Ring ring)
        {
            CustomRing customRing = CreateCustomRing(ring);

            if (customRing != null)
            {
                customRing.HandleEquip(who, location);
                wornCustomRings.Add(customRing);
            }
        }