Looks like a bad case of bumble foot. A small puncture, tear or cut can let in bacteria, causing the foot to become infected. It's very common in chickens. Do a search for bumble foot and you will find out all you need to know about it. It will be up to you if you want to treat it or cull the bird. If the bird cannot walk and the foot is badly infected a trip to the vet might be in order, or cull the bird to end it's suffering. This looks like it's been brewing for a while, it does not get this bad over night. Make sure to observe your birds frequently so you can help a bird before it gets this bad.