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

This commit is contained in:
agilbert1412 2024-08-31 21:57:43 +03:00 committed by GitHub
parent 7e0219c214
commit 8a809be67a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 6 deletions

View File

@ -5,6 +5,7 @@ from .base_logic import BaseLogic, BaseLogicMixin
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
@ -13,6 +14,7 @@ from ..strings.craftable_names import Consumable
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:
@ -31,26 +33,28 @@ class GrindLogicMixin(BaseLogicMixin):
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,)
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))