Pseudocode for combat