Moved papyrus-cast logic to main.js