Thedragon005 / Archipelago-Ape-Escape

Archipelago Multi-Game Randomizer and Server
https://archipelago.gg
Other
0 stars 0 forks source link

Changing some function signatures and a lot of small changes #19

Closed Exempt-Medic closed 1 month ago

Exempt-Medic commented 1 month ago

What is this fixing or adding?

The primary thing this is changing in the signatures of create_regions, set_rules, and connect_regions to just use the world object instead of multiworld and other things like player.

This also removes some unused code/classes, unused imports, fixes some spacing, changes instances where the multiworld object was being called world to now call it multiworld, converts set_rules to just call functions instead of needing its own class, fixes some times where an option class was being used instead of the value, changes the itempool to use ApeEscapeItems instead of just regular Items and also uses a local itempool that adds to the mulitworld itempool at the very end to save some time and in case it gets used later, changes options comparisons with numbers to instead use strings, uses the helper functions such as world.get_location instead of multiworld.get_location, converts some old option-checking methods to use the new options system, and uses the _ dummy variable for loops.

This also fixes a bug in __init__ where multiple items could be added to the pool that references the same object, for example, multiple items referencing the same sling object could be added (one from the gadget option and the other from having the debug option set to key.

How was this tested?

Exclusively through unit tests and lots of generations with comparing the results before and after the changes and looking through spoiler logs. It should get more thorough testing.

jeffreybardon commented 1 month ago

I looked through the code in a call with Exempt and asked about anything that seemed weird - from that, everything but the logic files was good to go. Then the indenting in the logic files was adjusted back to something more human-readable, and everything looked fine there as well. I also played a seed on this version and everything worked as expected.

Merging.