Ponyboy is indeed affected by all three deaths in the novel, and although he is very close to Johnny, there are relationships which exist with the other characters which causes him to feel pain at the loss of each of them.
Bob is the first to die. He is a rival and a bully, but he is also a misguided teenager like Ponyboy. Ponyboy has an understanding with Cherry Valance, Bob’s girlfriend, and comes to understand that Bob had good qualities too, which is why she grieves for him. Bob’s death comes as a shock to both the Soc’s and the Greasers. It is the point where some of them at least begin to realise that they are not invincible.
Johnny’s death affects Ponyboy the most as he is his closest friend. Death is a release for Johnny, however, and Ponyboy learns that he should enjoy being young and not try to grow up too quickly: as Johnny says: 'Stay gold'
Dally was proud of him. That was all Johnny had ever wanted.
Dallas’ death is really a suicide, and shows that the hoodlum lifestyle becomes futile. Ponyboy learns to appreciate the value of his family as he sees Dallas destroyed by loneliness and frustration.
It has a big impact on the story because Ponyboy is close to them, except for Bob.