The TFD template in Figure D.8 is an enhancement of the diagram from the walkthrough in Chapter 11. A state and flows have been added for handling the case where the weapon has maximum ammo. You can also apply this TFD structure to game elements that have a similar relationship, such as cars and fuel or spells and mana. Just replace "Gun" and "Ammo" with the corresponding elements.