@@ -444,3 +444,63 @@ def collect_all_except(multiworld, item_to_not_collect: str):
444
444
for item in multiworld .get_items ():
445
445
if item .name != item_to_not_collect :
446
446
multiworld .state .collect (item )
447
+
448
+
449
+ class TestFriendsanityDatingRules (SVTestBase ):
450
+ options = {
451
+ options .SeasonRandomization .internal_name : options .SeasonRandomization .option_randomized_not_winter ,
452
+ options .Friendsanity .internal_name : options .Friendsanity .option_all_with_marriage ,
453
+ options .FriendsanityHeartSize .internal_name : 3
454
+ }
455
+
456
+ def test_earning_dating_heart_requires_dating (self ):
457
+ month_name = "Month End"
458
+ for i in range (12 ):
459
+ month_item = self .world .create_item (month_name )
460
+ self .multiworld .state .collect (month_item , event = True )
461
+ self .multiworld .state .collect (self .world .create_item ("Beach Bridge" ), event = False )
462
+ self .multiworld .state .collect (self .world .create_item ("Progressive House" ), event = False )
463
+ self .multiworld .state .collect (self .world .create_item ("Adventurer's Guild" ), event = False )
464
+ self .multiworld .state .collect (self .world .create_item ("Galaxy Hammer" ), event = False )
465
+ for i in range (3 ):
466
+ self .multiworld .state .collect (self .world .create_item ("Progressive Pickaxe" ), event = False )
467
+ self .multiworld .state .collect (self .world .create_item ("Progressive Axe" ), event = False )
468
+ self .multiworld .state .collect (self .world .create_item ("Progressive Barn" ), event = False )
469
+ for i in range (10 ):
470
+ self .multiworld .state .collect (self .world .create_item ("Foraging Level" ), event = False )
471
+ self .multiworld .state .collect (self .world .create_item ("Farming Level" ), event = False )
472
+ self .multiworld .state .collect (self .world .create_item ("Mining Level" ), event = False )
473
+ self .multiworld .state .collect (self .world .create_item ("Combat Level" ), event = False )
474
+ self .multiworld .state .collect (self .world .create_item ("Progressive Mine Elevator" ), event = False )
475
+ self .multiworld .state .collect (self .world .create_item ("Progressive Mine Elevator" ), event = False )
476
+
477
+ npc = "Abigail"
478
+ heart_name = f"{ npc } <3"
479
+ step = 3
480
+
481
+ self .assert_can_reach_heart_up_to (npc , 3 , step )
482
+ self .multiworld .state .collect (self .world .create_item (heart_name ), event = False )
483
+ self .assert_can_reach_heart_up_to (npc , 6 , step )
484
+ self .multiworld .state .collect (self .world .create_item (heart_name ), event = False )
485
+ self .assert_can_reach_heart_up_to (npc , 8 , step )
486
+ self .multiworld .state .collect (self .world .create_item (heart_name ), event = False )
487
+ self .assert_can_reach_heart_up_to (npc , 10 , step )
488
+ self .multiworld .state .collect (self .world .create_item (heart_name ), event = False )
489
+ self .assert_can_reach_heart_up_to (npc , 14 , step )
490
+
491
+ def assert_can_reach_heart_up_to (self , npc : str , max_reachable : int , step : int ):
492
+ prefix = "Friendsanity: "
493
+ suffix = " <3"
494
+ for i in range (1 , max_reachable + 1 ):
495
+ if i % step != 0 and i != 14 :
496
+ continue
497
+ location = f"{ prefix } { npc } { i } { suffix } "
498
+ can_reach = self .world .logic .can_reach_location (location )(self .multiworld .state )
499
+ self .assertTrue (can_reach , f"Should be able to earn relationship up to { i } hearts" )
500
+ for i in range (max_reachable + 1 , 14 + 1 ):
501
+ if i % step != 0 and i != 14 :
502
+ continue
503
+ location = f"{ prefix } { npc } { i } { suffix } "
504
+ can_reach = self .world .logic .can_reach_location (location )(self .multiworld .state )
505
+ self .assertFalse (can_reach , f"Should not be able to earn relationship up to { i } hearts" )
506
+
0 commit comments