Rewrite of playerLogic