@@ -774,6 +774,106 @@ def __renderTimespinnerTracker(multisave: Dict[str, Any], room: Room, locations:
774
774
checks_done = checks_done , checks_in_area = checks_in_area , location_info = location_info ,
775
775
** display_data )
776
776
777
+ def __renderSuperMetroidTracker (multisave : Dict [str , Any ], room : Room , locations : Dict [int , Dict [int , Tuple [int , int ]]],
778
+ inventory : Counter , team : int , player : int , playerName : str ,
779
+ seed_checks_in_area : Dict [int , Dict [str , int ]], checks_done : Dict [str , int ]) -> str :
780
+
781
+ icons = {
782
+ "Energy Tank" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/ETank.png" ,
783
+ "Missile" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Missile.png" ,
784
+ "Super Missile" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Super.png" ,
785
+ "Power Bomb" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/PowerBomb.png" ,
786
+ "Bomb" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Bomb.png" ,
787
+ "Charge Beam" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Charge.png" ,
788
+ "Ice Beam" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Ice.png" ,
789
+ "Hi-Jump Boots" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/HiJump.png" ,
790
+ "Speed Booster" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/SpeedBooster.png" ,
791
+ "Wave Beam" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Wave.png" ,
792
+ "Spazer" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Spazer.png" ,
793
+ "Spring Ball" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/SpringBall.png" ,
794
+ "Varia Suit" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Varia.png" ,
795
+ "Plasma Beam" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Plasma.png" ,
796
+ "Grappling Beam" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Grapple.png" ,
797
+ "Morph Ball" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Morph.png" ,
798
+ "Reserve Tank" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Reserve.png" ,
799
+ "Gravity Suit" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/Gravity.png" ,
800
+ "X-Ray Scope" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/XRayScope.png" ,
801
+ "Space Jump" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/SpaceJump.png" ,
802
+ "Screw Attack" : "https://randommetroidsolver.pythonanywhere.com/solver/static/images/ScrewAttack.png" ,
803
+ "Nothing" : "" ,
804
+ "No Energy" : "" ,
805
+ "Kraid" : "" ,
806
+ "Phantoon" : "" ,
807
+ "Draygon" : "" ,
808
+ "Ridley" : "" ,
809
+ "Mother Brain" : "" ,
810
+ }
811
+
812
+ multi_items = {
813
+ "Energy Tank" : 83000 ,
814
+ "Missile" : 83001 ,
815
+ "Super Missile" : 83002 ,
816
+ "Power Bomb" : 83003 ,
817
+ "Reserve Tank" : 83020 ,
818
+ }
819
+
820
+ supermetroid_location_ids = {
821
+ 'Crateria/Blue Brinstar' : [82005 , 82007 , 82008 , 82026 , 82029 ,
822
+ 82000 , 82004 , 82006 , 82009 , 82010 ,
823
+ 82011 , 82012 , 82027 , 82028 , 82034 ,
824
+ 82036 , 82037 ],
825
+ 'Green/Pink Brinstar' : [82017 , 82023 , 82030 , 82033 , 82035 ,
826
+ 82013 , 82014 , 82015 , 82016 , 82018 ,
827
+ 82019 , 82021 , 82022 , 82024 , 82025 ,
828
+ 82031 ],
829
+ 'Red Brinstar' : [82038 , 82042 , 82039 , 82040 , 82041 ],
830
+ 'Kraid' : [82043 , 82048 , 82044 ],
831
+ 'Norfair' : [82050 , 82053 , 82061 , 82066 , 82068 ,
832
+ 82049 , 82051 , 82054 , 82055 , 82056 ,
833
+ 82062 , 82063 , 82064 , 82065 , 82067 ],
834
+ 'Lower Norfair' : [82078 , 82079 , 82080 , 82070 , 82071 ,
835
+ 82073 , 82074 , 82075 , 82076 , 82077 ],
836
+ 'Crocomire' : [82052 , 82060 , 82057 , 82058 , 82059 ],
837
+ 'Wrecked Ship' : [82129 , 82132 , 82134 , 82135 , 82001 ,
838
+ 82002 , 82003 , 82128 , 82130 , 82131 ,
839
+ 82133 ],
840
+ 'West Maridia' : [82138 , 82136 , 82137 , 82139 , 82140 ,
841
+ 82141 , 82142 ],
842
+ 'East Maridia' : [82143 , 82145 , 82150 , 82152 , 82154 ,
843
+ 82144 , 82146 , 82147 , 82148 , 82149 ,
844
+ 82151 ],
845
+ }
846
+
847
+ display_data = {}
848
+
849
+
850
+ for item_name , item_id in multi_items .items ():
851
+ base_name = item_name .split ()[0 ].lower ()
852
+ count = inventory [item_id ]
853
+ display_data [base_name + "_count" ] = inventory [item_id ]
854
+
855
+ # Victory condition
856
+ game_state = multisave .get ("client_game_state" , {}).get ((team , player ), 0 )
857
+ display_data ['game_finished' ] = game_state == 30
858
+
859
+ # Turn location IDs into advancement tab counts
860
+ checked_locations = multisave .get ("location_checks" , {}).get ((team , player ), set ())
861
+ lookup_name = lambda id : lookup_any_location_id_to_name [id ]
862
+ location_info = {tab_name : {lookup_name (id ): (id in checked_locations ) for id in tab_locations }
863
+ for tab_name , tab_locations in supermetroid_location_ids .items ()}
864
+ checks_done = {tab_name : len ([id for id in tab_locations if id in checked_locations ])
865
+ for tab_name , tab_locations in supermetroid_location_ids .items ()}
866
+ checks_done ['Total' ] = len (checked_locations )
867
+ checks_in_area = {tab_name : len (tab_locations ) for tab_name , tab_locations in supermetroid_location_ids .items ()}
868
+ checks_in_area ['Total' ] = sum (checks_in_area .values ())
869
+
870
+ return render_template ("supermetroidTracker.html" ,
871
+ inventory = inventory , icons = icons ,
872
+ acquired_items = {lookup_any_item_id_to_name [id ] for id in inventory if
873
+ id in lookup_any_item_id_to_name },
874
+ player = player , team = team , room = room , player_name = playerName ,
875
+ checks_done = checks_done , checks_in_area = checks_in_area , location_info = location_info ,
876
+ ** display_data )
777
877
778
878
def __renderGenericTracker (multisave : Dict [str , Any ], room : Room , locations : Dict [int , Dict [int , Tuple [int , int ]]],
779
879
inventory : Counter , team : int , player : int , playerName : str ,
@@ -887,5 +987,6 @@ def getTracker(tracker: UUID):
887
987
"Minecraft" : __renderMinecraftTracker ,
888
988
"Ocarina of Time" : __renderOoTTracker ,
889
989
"Timespinner" : __renderTimespinnerTracker ,
890
- "A Link to the Past" : __renderAlttpTracker
990
+ "A Link to the Past" : __renderAlttpTracker ,
991
+ "Super Metroid" : __renderSuperMetroidTracker
891
992
}
0 commit comments