- attackUnits = std::min(20, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2)
- + 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount<Max15>(undefended))
- + 2 * (ei.pinnedPieces[Us] != 0)
- - mg_value(score) / 32
- - !pos.count<QUEEN>(Them) * 15;
+ attackUnits = std::min(77, ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them])
+ + 10 * ei.kingAdjacentZoneAttacksCount[Them]
+ + 19 * popcount<Max15>(undefended)
+ + 9 * (ei.pinnedPieces[Us] != 0)
+ - mg_value(score) * 63 / 512
+ - !pos.count<QUEEN>(Them) * 60;