Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stardew Valley - Prize Ticket and Mystery Box grinding requires the abilty to redeem them #3728

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions worlds/stardew_valley/logic/grind_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .book_logic import BookLogicMixin
from .has_logic import HasLogicMixin
from .received_logic import ReceivedLogicMixin
from .region_logic import RegionLogicMixin
from .time_logic import TimeLogicMixin
from ..options import Booksanity
from ..stardew_rule import StardewRule, HasProgressionPercent
Expand All @@ -13,6 +14,7 @@
from ..strings.currency_names import Currency
from ..strings.fish_names import WaterChest
from ..strings.geode_names import Geode
from ..strings.region_names import Region
from ..strings.tool_names import Tool

if TYPE_CHECKING:
Expand All @@ -31,26 +33,28 @@ def __init__(self, *args, **kwargs):
self.grind = GrindLogic(*args, **kwargs)


class GrindLogic(BaseLogic[Union[GrindLogicMixin, HasLogicMixin, ReceivedLogicMixin, BookLogicMixin, TimeLogicMixin, ToolLogicMixin]]):
class GrindLogic(BaseLogic[Union[GrindLogicMixin, HasLogicMixin, ReceivedLogicMixin, RegionLogicMixin, BookLogicMixin, TimeLogicMixin, ToolLogicMixin]]):

def can_grind_mystery_boxes(self, quantity: int) -> StardewRule:
opening_rule = self.logic.region.can_reach(Region.blacksmith)
mystery_box_rule = self.logic.has(Consumable.mystery_box)
book_of_mysteries_rule = self.logic.true_ \
if self.options.booksanity == Booksanity.option_none \
else self.logic.book.has_book_power(Book.book_of_mysteries)
# Assuming one box per day, but halved because we don't know how many months have passed before Mr. Qi's Plane Ride.
time_rule = self.logic.time.has_lived_months(quantity // 14)
return self.logic.and_(mystery_box_rule,
book_of_mysteries_rule,
time_rule)
return self.logic.and_(opening_rule, mystery_box_rule,
book_of_mysteries_rule, time_rule,)
Comment on lines +46 to +47
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason this isn't just one line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not particularly, any reason it should be?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just seems odd to me, since it's a different formatting from before and also it has the final , which none of the other lines in this file do

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous formatting was one argument per line to minimize potential git conflicts. We should stick to it or change it to the standard "all arguments on the same line". Two arguments is quite unconventional...


def can_grind_artifact_troves(self, quantity: int) -> StardewRule:
return self.logic.and_(self.logic.has(Geode.artifact_trove),
opening_rule = self.logic.region.can_reach(Region.blacksmith)
return self.logic.and_(opening_rule, self.logic.has(Geode.artifact_trove),
# Assuming one per month if the player does not grind it.
self.logic.time.has_lived_months(quantity))

def can_grind_prize_tickets(self, quantity: int) -> StardewRule:
return self.logic.and_(self.logic.has(Currency.prize_ticket),
claiming_rule = self.logic.region.can_reach(Region.mayor_house)
return self.logic.and_(claiming_rule, self.logic.has(Currency.prize_ticket),
# Assuming two per month if the player does not grind it.
self.logic.time.has_lived_months(quantity // 2))

Expand Down
Loading