forked from ArchipelagoMW/Archipelago
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bumper Stickers: add location rules (ArchipelagoMW#2254)
* bumpstik: treasure/booster location rules * bumpstik: oop missed a bit * bumpstik: apply access rule to Hazards check * bumpstik: move completion cond. to set_rules * bumpstik: tests? I have literally never written these before so 🤷 * bumpstik: oops * bumpstik: how about this? * bumpstik: fix some logic * bumpstik: this almost works but not quite * bumpstik: accurate region boundaries for BBs since we're using rules now * bumpstik: holy heck it works now
- Loading branch information
1 parent
be959c0
commit e5ca83b
Showing
4 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from . import BumpStikTestBase | ||
|
||
|
||
class TestRuleLogic(BumpStikTestBase): | ||
def testLogic(self): | ||
for x in range(1, 33): | ||
if x == 32: | ||
self.assertFalse(self.can_reach_location("Level 5 - Cleared all Hazards")) | ||
|
||
self.collect(self.get_item_by_name("Treasure Bumper")) | ||
if x % 8 == 0: | ||
bb_count = round(x / 8) | ||
|
||
if bb_count < 4: | ||
self.assertFalse(self.can_reach_location(f"Treasure Bumper {x + 1}")) | ||
elif bb_count == 4: | ||
bb_count += 1 | ||
|
||
for y in range(self.count("Booster Bumper"), bb_count): | ||
self.assertTrue(self.can_reach_location(f"Bonus Booster {y + 1}"), | ||
f"BB {y + 1} check not reachable with {self.count('Booster Bumper')} BBs") | ||
if y < 4: | ||
self.assertFalse(self.can_reach_location(f"Bonus Booster {y + 2}"), | ||
f"BB {y + 2} check reachable with {self.count('Treasure Bumper')} TBs") | ||
self.collect(self.get_item_by_name("Booster Bumper")) | ||
|
||
if x < 31: | ||
self.assertFalse(self.can_reach_location(f"Treasure Bumper {x + 2}")) | ||
elif x == 31: | ||
self.assertFalse(self.can_reach_location("Level 5 - 50,000+ Total Points")) | ||
|
||
if x < 32: | ||
self.assertTrue(self.can_reach_location(f"Treasure Bumper {x + 1}"), | ||
f"TB {x + 1} check not reachable with {self.count('Treasure Bumper')} TBs") | ||
elif x == 32: | ||
self.assertTrue(self.can_reach_location("Level 5 - 50,000+ Total Points")) | ||
self.assertFalse(self.can_reach_location("Level 5 - Cleared all Hazards")) | ||
self.collect(self.get_items_by_name("Hazard Bumper")) | ||
self.assertTrue(self.can_reach_location("Level 5 - Cleared all Hazards")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from test.TestBase import WorldTestBase | ||
|
||
|
||
class BumpStikTestBase(WorldTestBase): | ||
game = "Bumper Stickers" |