I think you misunderstood what drewisfat was saying--he was saying that with drill 3 a unit has 25% chance of having four first strikes in a battle--not that each first strike has a 25% chance of not doing damage.
Seems that @drewisfat is correct.
Yes, I was mistaken that the number of first strikes is fixed.Once the number of first strikes is determined, the battle goes as you describe
Count of first strikes is a combination of 2 things:
Code:
setCombatFirstStrikes((pCombatUnit->immuneToFirstStrikes()) ? 0 : (firstStrikes() + GC.getGameINLINE().getSorenRandNum(chanceFirstStrikes() + 1, "First Strike")));
one fixed and one random in a range from 1 to some N.
I tried to follow logic in code and it was hard to make definite conclusion, so I just bring reasonable explanation without pretending of its 100% correctness.
CIV4UnitInfos.xml:
Code:
<UnitInfo>
<Class>UNITCLASS_CROSSBOWMAN</Class>
<Type>UNIT_CHINA_CHOKONU</Type>
<bFirstStrikeImmune>0</bFirstStrikeImmune>
<iFirstStrikes>2</iFirstStrikes>
<iChanceFirstStrikes>0</iChanceFirstStrikes>
<UnitInfo>
<Class>UNITCLASS_MARINE</Class>
<Type>UNIT_AMERICAN_NAVY_SEAL</Type>
<bFirstStrikeImmune>0</bFirstStrikeImmune>
<iFirstStrikes>1</iFirstStrikes>
<iChanceFirstStrikes>1</iChanceFirstStrikes>
<UnitInfo>
<Class>UNITCLASS_CHARIOT</Class>
<Type>UNIT_EGYPT_WARCHARIOT</Type>
<bFirstStrikeImmune>1</bFirstStrikeImmune>
<iFirstStrikes>0</iFirstStrikes>
<iChanceFirstStrikes>0</iChanceFirstStrikes>
CIV4PromotionInfos.xml:
Code:
<PromotionInfo>
<Type>PROMOTION_DRILL1</Type>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iFirstStrikesChange>0</iFirstStrikesChange>
<iChanceFirstStrikesChange>1</iChanceFirstStrikesChange>
<PromotionInfo>
<Type>PROMOTION_DRILL2</Type>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iFirstStrikesChange>1</iFirstStrikesChange>
<iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
<PromotionInfo>
<Type>PROMOTION_DRILL3</Type>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iFirstStrikesChange>0</iFirstStrikesChange>
<iChanceFirstStrikesChange>2</iChanceFirstStrikesChange>
<PromotionInfo>
<Type>PROMOTION_DRILL4</Type>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iFirstStrikesChange>2</iFirstStrikesChange>
<iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
So there is a fixed component and a variable component. getSorenRandNum(N+1) gives numbers 0, 1, ..., N with probability 1/(N+1).
Drill 1 + 2 + 3 gives:
fixed = 1
variable = 1 + 2 = 3
So distribution is 1 / 2 / 3 /4 (with equal probability of 25%).
Drill 1+2+3+4 gives:
fixed = 1+2 = 3
variable = 1 + 2 = 3
So distribution is 3 / 4 / 5 / 6 (with equal probability of 25%).