private int DetermineAtksNotShotFromMisfire(IGunStatus gun, int numExpectedAttacks, int attackNum) { int ret = 0; if (usedMfReactionThisTurn || !gun.CanFire()) { if (attackNum == numExpectedAttacks) { /* If attackNum is our max, but we can't fire, then it misfired/broke on the last shot */ ret = 1; } else { /* we do numAttacks-1 because we always increment at the end of the first loop; * i.e. if we misfire on first attack, numAttacks == 1, but that should count * for a loss. */ ret = numExpectedAttacks - (attackNum - 1); } } usedMfReactionThisTurn = false; return(ret); }