Files
Grinch-AP/worlds/stardew_valley/test/TestLogicSimplification.py
agilbert1412 62657df3fb Stardew Valley: 4.x.x - The Ginger Update (#1931)
## What is this fixing or adding?
Major content update for Stardew Valley

## How was this tested?
One large-scale public Beta on the archipelago server, plus several smaller private asyncs and test runs

You can go to https://github.com/agilbert1412/StardewArchipelago/releases to grab the mod (latest 4.x.x version), the supported mods and the apworld, to test this PR

## New Features:
- Festival Checks [Easy mode or Hard Mode]
- Special Orders [Both Board and Qi]
- Willy's Boat
- Ginger Island Parrots
- TV Channels
- Trap Items [Available in various difficulty levels]
- Entrance Randomizer: Buildings and Chaos
- New Fishsanity options: Exclude Legendaries, Exclude Hard fish, Only easy fish
- Resource Pack overhaul [Resource packs are now more enjoyable and varied]
- Goal: Greatest Walnut Hunter [Find every single Golden Walnut]
- Goal: Perfection [Achieve Perfection]
- Option: Profit Margin [Multiplier over all earnings]
- Option: Friendsanity Heart Size [Reduce clutter from friendsanity hearts]
- Option: Exclude Ginger Island - will exclude many locations and items to generate a playthrough that does not go to the island
- Mod Support [Curated list of mods]

## New Contributors:
@Witchybun for the mod support

---------

Co-authored-by: Witchybun <embenham05@gmail.com>
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
2023-07-19 20:26:38 +02:00

58 lines
2.0 KiB
Python

from .. import True_
from ..logic import Received, Has, False_, And, Or, StardewLogic
from ..options import default_options, StardewOptions
def test_simplify_true_in_and():
rules = {
"Wood": True_(),
"Rock": True_(),
}
summer = Received("Summer", 0, 1)
assert (Has("Wood", rules) & summer & Has("Rock", rules)).simplify() == summer
def test_simplify_false_in_or():
rules = {
"Wood": False_(),
"Rock": False_(),
}
summer = Received("Summer", 0, 1)
assert (Has("Wood", rules) | summer | Has("Rock", rules)).simplify() == summer
def test_simplify_and_in_and():
rule = And(And(Received('Summer', 0, 1), Received('Fall', 0, 1)),
And(Received('Winter', 0, 1), Received('Spring', 0, 1)))
assert rule.simplify() == And(Received('Summer', 0, 1), Received('Fall', 0, 1), Received('Winter', 0, 1),
Received('Spring', 0, 1))
def test_simplify_duplicated_and():
rule = And(And(Received('Summer', 0, 1), Received('Fall', 0, 1)),
And(Received('Summer', 0, 1), Received('Fall', 0, 1)))
assert rule.simplify() == And(Received('Summer', 0, 1), Received('Fall', 0, 1))
def test_simplify_or_in_or():
rule = Or(Or(Received('Summer', 0, 1), Received('Fall', 0, 1)),
Or(Received('Winter', 0, 1), Received('Spring', 0, 1)))
assert rule.simplify() == Or(Received('Summer', 0, 1), Received('Fall', 0, 1), Received('Winter', 0, 1),
Received('Spring', 0, 1))
def test_simplify_duplicated_or():
rule = And(Or(Received('Summer', 0, 1), Received('Fall', 0, 1)),
Or(Received('Summer', 0, 1), Received('Fall', 0, 1)))
assert rule.simplify() == Or(Received('Summer', 0, 1), Received('Fall', 0, 1))
def test_simplify_true_in_or():
rule = Or(True_(), Received('Summer', 0, 1))
assert rule.simplify() == True_()
def test_simplify_false_in_and():
rule = And(False_(), Received('Summer', 0, 1))
assert rule.simplify() == False_()