Minimalistic game tool
There are a few rules to using it:
- You can re-roll when you lose, change the map or if you roll the exact same build as on the previous map.
- You stick with what you get, no re-rolls unless one of the conditions above are fulfilled.
- On maps that spawn a ton of flying enemies, 1 person from your party can swap 1 tower for anti-air.
The base functionality was incredibly easy to implement. There's a database storing all of the character builds and all the page has to do, is grab one by random and display it.
I wanted the page to display all the icons of the items each build uses, for the game displays it's character select screen in images and the name of the item is only displayed when you actually click on it. This would make it incredibly tedious to find the correct tower/perk in-game were Sancroll to only display text.
Sancroll loads images from a local cache, but manually stocking it with images each time a new build is added, is for doodoo-heads. If the page can't find the correct file locally, it'll download the image from the great Sanctum 2 wiki and supplement the cache with those.
The wiki doesn't exactly have an API for this, but it does have a very nice search engine ripe for abuse. The first result is usually exactly what I want (low dataset and consistent naming schemes make it very reliable), so Sancroll just parses that and yoinks the relevant image with some basic HTML parsing (again very reliable, thanks to the wiki having a set HTML template for every single page).