fixed bug when rich+ dudes attack player
translated whole codebase to my own conventions