2024-03-15 15:05:14 +03:00
|
|
|
from typing import Optional
|
|
|
|
|
Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024
This includes randomization for pretty much all of the new content, including but not limited to
- Raccoon Bundles
- Booksanity
- Skill Masteries
- New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests
This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit.
In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update
- Walnutsanity
- Player Buffs
- More customizability in settings, such as shorter special orders, ER without farmhouse
- New Remixed Bundles
2024-07-07 16:04:25 +03:00
|
|
|
from BaseClasses import ItemClassification
|
2024-03-15 15:05:14 +03:00
|
|
|
from .base_logic import BaseLogic, BaseLogicMixin
|
|
|
|
from .has_logic import HasLogicMixin
|
Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024
This includes randomization for pretty much all of the new content, including but not limited to
- Raccoon Bundles
- Booksanity
- Skill Masteries
- New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests
This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit.
In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update
- Walnutsanity
- Player Buffs
- More customizability in settings, such as shorter special orders, ER without farmhouse
- New Remixed Bundles
2024-07-07 16:04:25 +03:00
|
|
|
from .logic_event import all_events
|
|
|
|
from ..items import item_table
|
|
|
|
from ..stardew_rule import StardewRule, Received, TotalReceived
|
2024-03-15 15:05:14 +03:00
|
|
|
|
|
|
|
|
2025-04-23 11:31:08 -04:00
|
|
|
class ReceivedLogicMixin(BaseLogic, BaseLogicMixin):
|
2024-03-15 15:05:14 +03:00
|
|
|
def received(self, item: str, count: Optional[int] = 1) -> StardewRule:
|
|
|
|
assert count >= 0, "Can't receive a negative amount of item."
|
|
|
|
|
Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024
This includes randomization for pretty much all of the new content, including but not limited to
- Raccoon Bundles
- Booksanity
- Skill Masteries
- New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests
This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit.
In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update
- Walnutsanity
- Player Buffs
- More customizability in settings, such as shorter special orders, ER without farmhouse
- New Remixed Bundles
2024-07-07 16:04:25 +03:00
|
|
|
if item in all_events:
|
|
|
|
return Received(item, self.player, count, event=True)
|
|
|
|
|
|
|
|
assert item_table[item].classification & ItemClassification.progression, f"Item [{item_table[item].name}] has to be progression to be used in logic"
|
2024-03-15 15:05:14 +03:00
|
|
|
return Received(item, self.player, count)
|
|
|
|
|
|
|
|
def received_all(self, *items: str):
|
|
|
|
assert items, "Can't receive all of no items."
|
|
|
|
|
Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024
This includes randomization for pretty much all of the new content, including but not limited to
- Raccoon Bundles
- Booksanity
- Skill Masteries
- New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests
This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit.
In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update
- Walnutsanity
- Player Buffs
- More customizability in settings, such as shorter special orders, ER without farmhouse
- New Remixed Bundles
2024-07-07 16:04:25 +03:00
|
|
|
return self.logic.and_(*(self.received(item) for item in items))
|
2024-03-15 15:05:14 +03:00
|
|
|
|
|
|
|
def received_any(self, *items: str):
|
|
|
|
assert items, "Can't receive any of no items."
|
|
|
|
|
Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024
This includes randomization for pretty much all of the new content, including but not limited to
- Raccoon Bundles
- Booksanity
- Skill Masteries
- New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests
This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit.
In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update
- Walnutsanity
- Player Buffs
- More customizability in settings, such as shorter special orders, ER without farmhouse
- New Remixed Bundles
2024-07-07 16:04:25 +03:00
|
|
|
return self.logic.or_(*(self.received(item) for item in items))
|
2024-03-15 15:05:14 +03:00
|
|
|
|
|
|
|
def received_once(self, *items: str, count: int):
|
|
|
|
assert items, "Can't receive once of no items."
|
|
|
|
assert count >= 0, "Can't receive a negative amount of item."
|
|
|
|
|
|
|
|
return self.logic.count(count, *(self.received(item) for item in items))
|
|
|
|
|
|
|
|
def received_n(self, *items: str, count: int):
|
|
|
|
assert items, "Can't receive n of no items."
|
|
|
|
assert count >= 0, "Can't receive a negative amount of item."
|
|
|
|
|
Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024
This includes randomization for pretty much all of the new content, including but not limited to
- Raccoon Bundles
- Booksanity
- Skill Masteries
- New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests
This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit.
In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update
- Walnutsanity
- Player Buffs
- More customizability in settings, such as shorter special orders, ER without farmhouse
- New Remixed Bundles
2024-07-07 16:04:25 +03:00
|
|
|
for item in items:
|
|
|
|
assert item_table[item].classification & ItemClassification.progression, f"Item [{item_table[item].name}] has to be progression to be used in logic"
|
|
|
|
|
2024-03-15 15:05:14 +03:00
|
|
|
return TotalReceived(count, items, self.player)
|