It's not that simple. Even using it as a base gets you into a legal gray area. Learning from a work and incorporating elements into your own work is legal, but copying someone else's legwork like this is legally murky even if you don't take the actual code.