Exemple #1
0
        public static void AreaNumberFromName_Postfix(
            // Static
            ref int __result,
            string name)
        {
            int id = Bundles.GetCustomAreaNumberFromName(areaName: name);

            if (Bundles.IsAbandonedJojaMartBundleAvailableOrComplete() || id < 0)
            {
                return;
            }

            __result = id;
        }
Exemple #2
0
        public static void AreaNumberFromLocation_Postfix(
            CommunityCenter __instance,
            ref int __result,
            Vector2 tileLocation)
        {
            CustomCommunityCentre.Data.BundleMetadata bundleMetadata = Bundles.GetAllCustomBundleMetadataEntries()
                                                                       .FirstOrDefault(bmd => bmd.AreaBounds.Contains(Utility.Vector2ToPoint(tileLocation)));
            int areaNumber = bundleMetadata != null
                                ? Bundles.GetCustomAreaNumberFromName(bundleMetadata.AreaName)
                                : -1;

            if (Bundles.IsAbandonedJojaMartBundleAvailableOrComplete() || areaNumber < 0)
            {
                return;
            }

            __result = areaNumber;
        }
Exemple #3
0
        public static void Junimo_ctor_Postfix(
            Junimo __instance,
            Vector2 position,
            int whichArea)
        {
            if (whichArea >= Bundles.CustomAreaInitialIndex &&
                !Bundles.IsAbandonedJojaMartBundleAvailableOrComplete())
            {
                CustomCommunityCentre.Data.BundleMetadata bundleMetadata = Bundles.GetAllCustomBundleMetadataEntries()
                                                                           .First(bmd => Bundles.GetCustomAreaNumberFromName(bmd.AreaName) == whichArea);

                __instance.friendly.Value = Bundles.IsAreaComplete(cc: Bundles.CC, areaNumber: whichArea);

                int restoreAreaPhase = Reflection.GetField
                                       <int>
                                           (obj: Bundles.CC, name: "restoreAreaPhase")
                                       .GetValue();
                if (restoreAreaPhase != CommunityCenter.PHASE_junimoAppear)
                {
                    Reflection.GetField
                    <Netcode.NetColor>
                        (obj: __instance, name: "color")
                    .GetValue()
                    .Set(bundleMetadata.Colour);
                }
            }
        }