diff --git a/LookupAnything/Framework/Lookups/Items/ItemSubject.cs b/LookupAnything/Framework/Lookups/Items/ItemSubject.cs index 29bc04f3d..317c0df80 100644 --- a/LookupAnything/Framework/Lookups/Items/ItemSubject.cs +++ b/LookupAnything/Framework/Lookups/Items/ItemSubject.cs @@ -168,7 +168,7 @@ public override IEnumerable GetData() } // crop fields - foreach (ICustomField field in this.GetCropFields(this.FromDirt, this.FromCrop ?? this.SeedForCrop, isSeed)) + foreach (ICustomField field in this.GetCropFields(this.FromDirt, this.FromCrop ?? this.SeedForCrop, obj, isSeed)) yield return field; // indoor pot crop @@ -508,8 +508,9 @@ private string GetTypeValue(Item item) /// Get the custom fields for a crop. /// The dirt the crop is planted in, if applicable. /// The crop to represent. + /// The object that will be produced by this crop. /// Whether the crop being displayed is for an unplanted seed. - private IEnumerable GetCropFields(HoeDirt? dirt, Crop? crop, bool isSeed) + private IEnumerable GetCropFields(HoeDirt? dirt, Crop? crop, SObject? producedItem, bool isSeed) { var data = new CropDataParser(crop, isPlanted: !isSeed); if (data.CropData is null || crop is null) @@ -568,6 +569,16 @@ private IEnumerable GetCropFields(HoeDirt? dirt, Crop? crop, bool else summary.Add(I18n.Crop_Summary_DropsX(count: 1)); + // harvest XP + // based on Crop.harvest + if (crop.forageCrop.Value) + summary.Add(I18n.Crop_Summary_ForagingXp(amount: 3)); + else + { + int price = producedItem?.Price ?? 0; + int experience = (int)Math.Round((float)(16 * Math.Log(.018 * price + 1, Math.E))); + summary.Add(I18n.Crop_Summary_FarmingXp(amount: experience)); + } // crop sale price Item drop = data.GetSampleDrop(); diff --git a/LookupAnything/docs/release-notes.md b/LookupAnything/docs/release-notes.md index 1cb2c6d39..89a969910 100644 --- a/LookupAnything/docs/release-notes.md +++ b/LookupAnything/docs/release-notes.md @@ -2,6 +2,7 @@ # Release notes ## Upcoming release +* Added experience gained from harvesting crops to their lookup. * Added integration with [Iconic Framework](https://www.nexusmods.com/stardewvalley/mods/11026) to look up what's in front of the player or open the search UI. * Internal changes to Generic Mod Config Menu integration. * Improved translations. Thanks to BlackRosePetals (updated Chinese)! diff --git a/LookupAnything/i18n/de.json b/LookupAnything/i18n/de.json index 90cdb5421..a7fc75464 100644 --- a/LookupAnything/i18n/de.json +++ b/LookupAnything/i18n/de.json @@ -310,6 +310,8 @@ "crop.summary.drops-X-to-Y": "Gibt {{min}} bis {{max}} her. ({{percent}}% Chance auf extra Saat)", "crop.summary.harvest-once": "Ernte nach {{daysToFirstHarvest}} Tagen.", "crop.summary.harvest-multi": "Ernte nach {{daysToFirstHarvest}} Tagen, danach alle {{daysToNextHarvests}} Tage.", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "Wächst im {{seasons}}.", "crop.summary.sells-for": "Lässt sich für {{price}} verkaufen.", "crop.harvest.too-late": "Zu spät in der Jahrezeit für eine weitere Ernte (wäre am {{date}}).", diff --git a/LookupAnything/i18n/default.json b/LookupAnything/i18n/default.json index 10a843a93..c6654e372 100644 --- a/LookupAnything/i18n/default.json +++ b/LookupAnything/i18n/default.json @@ -309,6 +309,8 @@ "crop.summary.drops-X-to-Y": "drops {{min}} to {{max}} ({{percent}}% chance of extra crops)", "crop.summary.harvest-once": "harvest after {{daysToFirstHarvest}} days", "crop.summary.harvest-multi": "harvest after {{daysToFirstHarvest}} days, then every {{daysToNextHarvests}} days", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", "crop.summary.seasons": "grows in {{seasons}}", "crop.summary.sells-for": "sells for {{price}}", "crop.harvest.too-late": "too late in the season for the next harvest (would be on {{date}})", diff --git a/LookupAnything/i18n/es.json b/LookupAnything/i18n/es.json index 9d07f6005..641451c88 100644 --- a/LookupAnything/i18n/es.json +++ b/LookupAnything/i18n/es.json @@ -311,6 +311,8 @@ "crop.summary.drops-X-to-Y": "Suelta de {{min}} a {{max}} ({{percent}}% de probabilidad de cultivos extra)", "crop.summary.harvest-once": "Crece en {{daysToFirstHarvest}} días", "crop.summary.harvest-multi": "Crece en {{daysToFirstHarvest}} días, después cada {{daysToNextHarvests}} días", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "Crece en {{seasons}}", "crop.summary.sells-for": "Se vende por {{price}}", "crop.harvest.too-late": "Demasiado tarde para cosecharlo esta temporada (sería en {{date}})", diff --git a/LookupAnything/i18n/fr.json b/LookupAnything/i18n/fr.json index fdc4dc668..108a05d97 100644 --- a/LookupAnything/i18n/fr.json +++ b/LookupAnything/i18n/fr.json @@ -313,6 +313,8 @@ "crop.summary.drops-X-to-Y": "donne de {{min}} à {{max}} ({{percent}}% chance de culture supplémentaire)", "crop.summary.harvest-once": "récolté après {{daysToFirstHarvest}} jours", "crop.summary.harvest-multi": "récolté après {{daysToFirstHarvest}} jours, puis tout les {{daysToNextHarvests}} jours", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "pousse en {{seasons}}", "crop.summary.sells-for": "vendu pour {{price}}", "crop.harvest.too-late": "trop tard dans la saison pour la prochaine récolte (sera le {{date}})", diff --git a/LookupAnything/i18n/hu.json b/LookupAnything/i18n/hu.json index e15aeb8f8..8531733d4 100644 --- a/LookupAnything/i18n/hu.json +++ b/LookupAnything/i18n/hu.json @@ -311,6 +311,8 @@ "crop.summary.drops-X-to-Y": "{{min}} és {{max}} darab között termel ({{percent}}% esély van extrára)", "crop.summary.harvest-once": "begyűjthető {{daysToFirstHarvest}} nap múlva", "crop.summary.harvest-multi": "begyűjthető {{daysToFirstHarvest}} nap múlva, és utána pedig {{daysToNextHarvests}} naponként újra terem", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "a következő évszakban nő: {{seasons}}", "crop.summary.sells-for": "ára: {{price}}", "crop.harvest.too-late": "ebben az évszakban már nincs ideje teremni (a következő termőnap ekkor lenne: {{date}})", diff --git a/LookupAnything/i18n/it.json b/LookupAnything/i18n/it.json index 0abf76bf1..c9c8cf7fe 100644 --- a/LookupAnything/i18n/it.json +++ b/LookupAnything/i18n/it.json @@ -309,6 +309,8 @@ "crop.summary.drops-X-to-Y": "ne facadere da {{min}} a {{max}} ({{percent}}% di probabilità in più di raccolto extra)", "crop.summary.harvest-once": "raccogli dopo {{daysToFirstHarvest}} giorni", "crop.summary.harvest-multi": "raccogli dopo {{daysToFirstHarvest}} giorni, e successivamente ogni {{daysToNextHarvests}} giorni", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "cresce in {{seasons}}", "crop.summary.sells-for": "vendibile a {{price}}", "crop.harvest.too-late": "sei troppo avanti nella stagione attuale per la prossima raccolta (finirebbe il {{date}})", diff --git a/LookupAnything/i18n/ja.json b/LookupAnything/i18n/ja.json index c7e96f10b..a6d243a16 100644 --- a/LookupAnything/i18n/ja.json +++ b/LookupAnything/i18n/ja.json @@ -310,6 +310,8 @@ "crop.summary.drops-X-to-Y": " {{min}}-{{max}}個収穫可能({{percent}}%の確率で追加の収穫)", "crop.summary.harvest-once": " 植えてから{{daysToFirstHarvest}}日後に収穫可能", "crop.summary.harvest-multi": " 植えてから{{daysToFirstHarvest}}日後に収穫可能。また{{daysToNextHarvests}}日毎に再収穫可能", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": " {{seasons}}に成長する", "crop.summary.sells-for": " {{price}}で売れる", "crop.harvest.too-late": "次の収穫には間に合わない({{date}}で収穫可能になるため)", diff --git a/LookupAnything/i18n/ko.json b/LookupAnything/i18n/ko.json index 5b618fb6f..58c31df1f 100644 --- a/LookupAnything/i18n/ko.json +++ b/LookupAnything/i18n/ko.json @@ -310,6 +310,8 @@ "crop.summary.drops-X-to-Y": "{{min}} ~ {{max}}개의 추가 작물을 ({{percent}}%의 확률로 획득 가능)", "crop.summary.harvest-once": "{{daysToFirstHarvest}}일 후에 수확 가능", "crop.summary.harvest-multi": "{{daysToFirstHarvest}}일 후에 수확 가능, 그 후 매 {{daysToNextHarvests}}일마다 주기적 수확 가능.", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "{{seasons}}에 자람", "crop.summary.sells-for": "판매 가격: {{price}}", "crop.harvest.too-late": "작물을 수확하기엔 너무 늦은 계절이다 (다음 수확까지 {{date}}일 걸림)", diff --git a/LookupAnything/i18n/pl.json b/LookupAnything/i18n/pl.json index 528fcd2d7..6a94fa329 100644 --- a/LookupAnything/i18n/pl.json +++ b/LookupAnything/i18n/pl.json @@ -310,6 +310,8 @@ "crop.summary.drops-X-to-Y": "można zebrać od {{min}} do {{max}} ({{percent}}% szans na dodatkowe plony)", "crop.summary.harvest-once": "zbiory po {{daysToFirstHarvest}} dniach", "crop.summary.harvest-multi": "zbiory po {{daysToFirstHarvest}} dniach, następnie co {{daysToNextHarvests}} dni", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "rośnie w {{seasons}}", "crop.summary.sells-for": "sprzedaż za {{price}}", "crop.harvest.too-late": "za późno w sezonie na następne zbiory (byłyby na {{date}})", diff --git a/LookupAnything/i18n/pt.json b/LookupAnything/i18n/pt.json index 8e27c5a42..befd60d1f 100644 --- a/LookupAnything/i18n/pt.json +++ b/LookupAnything/i18n/pt.json @@ -311,6 +311,8 @@ "crop.summary.drops-X-to-Y": "Solta de {{min}} pra no máximo {{max}} unidades({{percent}}% chance de colher unidades a mais)", "crop.summary.harvest-once": "Colher após {{daysToFirstHarvest}} dias", "crop.summary.harvest-multi": "Colhe depois de {{daysToFirstHarvest}} dias, depois a cada {{daysToNextHarvests}} dias", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "Cresce no(a) {{seasons}}", "crop.summary.sells-for": "Vende por {{price}}", "crop.harvest.too-late": "Muito tarde para colher nessa estação (deveria ser no {{date}})", diff --git a/LookupAnything/i18n/ru.json b/LookupAnything/i18n/ru.json index fe6c80f48..700adb211 100644 --- a/LookupAnything/i18n/ru.json +++ b/LookupAnything/i18n/ru.json @@ -310,6 +310,8 @@ "crop.summary.drops-X-to-Y": "Сбор от {{min}} до {{max}} ({{percent}}% шанс на дополнительный сбор)", "crop.summary.harvest-once": "урожай через {{daysToFirstHarvest}} дн.", "crop.summary.harvest-multi": "урожай через {{daysToFirstHarvest}} дн., затем каждые {{daysToNextHarvests}} дн.", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "сезон роста - {{seasons}}", "crop.summary.sells-for": "продаётся за {{price}}", "crop.harvest.too-late": "слишком поздно в этом сезоне для следующего сбора (урожай {{date}})", diff --git a/LookupAnything/i18n/th.json b/LookupAnything/i18n/th.json index 87bea9732..38229248b 100644 --- a/LookupAnything/i18n/th.json +++ b/LookupAnything/i18n/th.json @@ -311,6 +311,8 @@ "crop.summary.drops-X-to-Y": "ได้รับ {{min}}-{{max}} ({{percent}}% โอกาสของพืชผลพิเศษ)", "crop.summary.harvest-once": "เก็บเกี่ยวได้หลังผ่านไป {{daysToFirstHarvest}} วัน", "crop.summary.harvest-multi": "เก็บเกี่ยวได้หลังผ่านไป {{daysToFirstHarvest}} วัน, แล้วก็ทุก {{daysToNextHarvests}} วัน", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "เติบโตใน{{seasons}}", "crop.summary.sells-for": "ขายได้ {{price}}", "crop.harvest.too-late": "สายเกินไปสำหรับฤดูเก็บเกี่ยวครั้งถัดไป (จะอยู่ถึงวันที่ {{date}})", diff --git a/LookupAnything/i18n/tr.json b/LookupAnything/i18n/tr.json index 058fd55f5..1aa30f404 100644 --- a/LookupAnything/i18n/tr.json +++ b/LookupAnything/i18n/tr.json @@ -309,6 +309,8 @@ "crop.summary.drops-X-to-Y": "{{min}}'den {{max}} taneye kadar düşer ({{percent}}% ekstra mahsul şansı)", "crop.summary.harvest-once": "{{daysToFirstHarvest}} gün sonra hasat edilir", "crop.summary.harvest-multi": "{{daysToFirstHarvest}} günün ardından her {{daysToNextHarvests}} günde bir hasat edilir", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "{{seasons}} mevsiminde büyür", "crop.summary.sells-for": "{{price}} satılır", "crop.harvest.too-late": "sonraki hasat için sezon çok geç (muhtemelen {{date}})", diff --git a/LookupAnything/i18n/uk.json b/LookupAnything/i18n/uk.json index 5839aa391..45a7749b4 100644 --- a/LookupAnything/i18n/uk.json +++ b/LookupAnything/i18n/uk.json @@ -311,6 +311,8 @@ "crop.summary.drops-X-to-Y": "Збір з {{min}} до {{max}} ({{percent}}% на додатковий збір)", "crop.summary.harvest-once": "Врожай через {{daysToFirstHarvest}} дн.", "crop.summary.harvest-multi": "Врожай через {{daysToFirstHarvest}} дн., потім кожні {{daysToNextHarvests}} дн.", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "Сезон росту : {{seasons}}", "crop.summary.sells-for": "Продається за {{price}}", "crop.harvest.too-late": "Занадто пізно цього сезону для наступного збору (врожай {{date}})", diff --git a/LookupAnything/i18n/vi.json b/LookupAnything/i18n/vi.json index cd0b1317b..acc9b2c6f 100644 --- a/LookupAnything/i18n/vi.json +++ b/LookupAnything/i18n/vi.json @@ -310,6 +310,8 @@ "crop.summary.drops-X-to-Y": "rơi ra từ {{min}} đến {{max}} ({{percent}}% cơ hội có thêm vụ mùa)", "crop.summary.harvest-once": "thu hoạch sau {{daysToFirstHarvest}} ngày", "crop.summary.harvest-multi": "thu hoạch sau {{daysToFirstHarvest}} ngày, sau đó mỗi {{daysToNextHarvests}} ngày", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "phát triển trong {{seasons}}", "crop.summary.sells-for": "bán được {{price}}", "crop.harvest.too-late": "quá muộn thu hoạch trong mùa này (thu hoạch sẽ vào {{date}})", diff --git a/LookupAnything/i18n/zh.json b/LookupAnything/i18n/zh.json index 493baf92c..ff4d18f5a 100644 --- a/LookupAnything/i18n/zh.json +++ b/LookupAnything/i18n/zh.json @@ -309,6 +309,8 @@ "crop.summary.drops-X-to-Y": "收获{{min}}至{{max}}份({{percent}}%几率收获额外作物)", "crop.summary.harvest-once": "{{daysToFirstHarvest}}天后收获", "crop.summary.harvest-multi": "{{daysToFirstHarvest}}天后收获,之后每隔{{daysToNextHarvests}}天收获一次", + "crop.summary.farming-xp": "gives +{{amount}} farming XP per harvest", // TODO + "crop.summary.foraging-xp": "gives +{{amount}} foraging XP per harvest", // TODO "crop.summary.seasons": "在{{seasons}}生长", "crop.summary.sells-for": "以{{price}}出售", "crop.harvest.too-late": "下次收获超出本季(下次收获将在{{date}})",