added maintenance costs and starvation, attack function still has some bugs