예제 #1
0
 internal void Resolver(StardewValley.Farmer who, string answer)
 {
     if (answer == "n")
     {
         return;
     }
     if ((this.Conditional.Item == -1 && who.money >= this.Conditional.Amount) || who.hasItemInInventory(this.Conditional.Item, this.Conditional.Amount))
     {
         if (this.Conditional.Item == -1)
         {
             who.money -= this.Conditional.Amount;
         }
         else
         {
             who.removeItemsFromInventory(this.Conditional.Item, this.Conditional.Amount);
         }
         who.mailReceived.Add("ALLCondition_" + this.Conditional.Name);
         AdvancedLocationLoaderMod.Logger.Log("Conditional completed: " + this.Conditional.Name, StardewModdingAPI.LogLevel.Trace);
         AdvancedLocationLoaderMod.UpdateConditionalEdits();
     }
     else
     {
         Game1.drawObjectDialogue(AdvancedLocationLoaderMod.Localizer.Get("notEnough", new { itemName = this.GetItemName() }));
     }
 }
예제 #2
0
        internal static void TimeEvents_AfterDayStarted(object s, EventArgs e)
        {
            // on new day
            if (Configs.Compound.DynamicTiles.Any() || Configs.Compound.DynamicProperties.Any() || Configs.Compound.DynamicWarps.Any())
            {
                AdvancedLocationLoaderMod.UpdateConditionalEdits();
            }

            // on new season
            if (Game1.dayOfMonth == 1 && Configs.Compound.SeasonalTilesheets.Any())
            {
                AdvancedLocationLoaderMod.UpdateTilesheets();
            }
        }
예제 #3
0
 internal static void LocationEvents_CurrentLocationChanged(object s, EventArgs e)
 {
     LocationEvents.CurrentLocationChanged -= LocationEvents_CurrentLocationChanged;
     AdvancedLocationLoaderMod.UpdateConditionalEdits();
 }