I've fixed couple of features and it's as awful as I assumed. Yesterday I was able to partially rewrite a new lighting routine for static lights (that don't move). The light falloff is linear which can be fixed later, but the main routine for lights is ok I guess.
Sometimes fixing a feature will introduce new features to fix which
in this case is a peculiar problem related to facing of walls. The
lighting routine can lit the wall from the "wrong" direction (depending
on where the player is), making it lit without visible evidence of a
light source. This is somewhat common problem in tile-based games with
more sophisticated lighting scheme and I have to find some kind of
solution for it.
The plan is to stay with technical features and when they are done everything that is left is the RPG system.