Example #1
0
 public static void MakeMapModifications_Postfix(
     CommunityCenter __instance)
 {
     if (!Game1.MasterPlayer.mailReceived.Contains("JojaMember") && !__instance.areAllAreasComplete())
     {
         foreach (int areaNumber in Bundles.CustomAreasComplete.Keys)
         {
             bool isAvailable = Bundles.ShouldNoteAppearInCustomArea(cc: __instance, areaNumber: areaNumber);
             bool isComplete  = Bundles.IsCustomAreaComplete(areaNumber);
             if (isAvailable)
             {
                 __instance.addJunimoNote(area: areaNumber);
             }
             else if (isComplete)
             {
                 __instance.loadArea(area: areaNumber, showEffects: false);
             }
         }
     }
 }
Example #2
0
        public static void DoAreaCompleteReward_Postfix(
            CommunityCenter __instance,
            int whichArea)
        {
            string areaName = CommunityCenter.getAreaNameFromNumber(whichArea);

            if (!Bundles.IsCustomArea(whichArea) || string.IsNullOrWhiteSpace(areaName))
            {
                return;
            }

            string mail = string.Format(Bundles.MailAreaCompleted, Bundles.GetAreaNameAsAssetKey(areaName));

            if (Bundles.IsCustomAreaComplete(areaNumber: whichArea) && !Game1.player.hasOrWillReceiveMail(mail))
            {
                // Add some mail flag to this bundle to indicate completion
                Log.D($"Sending mail for custom bundle completion ({mail})",
                      CustomCommunityCentre.ModEntry.Config.DebugMode);
                Game1.addMailForTomorrow(mail, noLetter: true);
            }
        }