I found a way to implement any value of caster for units. Basically, instead of storing the value in the unit data, we'll use the possibility to flag a unit "caster 20" and "caster 40" at the same time to indicate the unit is nonstandard, and in this case, look up the correct amount from a hardcoded small table. This shouldn't use more than 2 bytes of space in code per unit (the unit type and mana amount), plus the procedure itself which probably fits into 20-25, and as units having 20 or 40 caster don't need to be listed, the list of units will be small as well.
This gives us the opportunity to review existing Caster units and rethink how much they need, and also possibly adjust spell costs that were influenced by it. Do note that we might also want to adjust the unit stats if the caster ability is significantly raised or lowered. Also note adding new units won't be considered until I am playing the race we are adding the unit to in test games, but this definitely opens up the possibility to have such units.
(Note that I haven't thought about actually changing anything yet, I'm merely stating what is possible.)
The units :
Efreet - currently caster 40. If reduced, Doom Bolt can cost 40 against instead of the silly looking 41, but doing so means the Efreet gets to cast fewer spells. While nothing casts exactly 40 on its own, a Warp Lighting+Fire Bolt, or 2 Fireballs and a Firebolt, etc do. Most chaos spells have a cost that is divisible by 5.
Angel - currently caster 20. We can freely raise this if desired, without risking to run into Prayer and Raise Dead (both 40), but 30 does hit invulnerability. I'm not a fan of 20 on this unit as Healing costs 15 and the last 5 cannot be spent in any meaningful way most of the time.
Archangel - Don't think we have a need to keep it exactly 40 - no Life spells are unlocked by having a higher amount as long as it stays below 60, which allows Holy Word. We definitely don't want it at 70 though which enables High Prayer and Supreme Light and Call To Arms. Archangels are quite powerful already, though.
Magicians - We can now let specific races have more, or less MP, albeit this will allow that magician to cast certain spells it currently can't so it's a potentially very influential change that might be better avoided (Flight, Crack's Call comes to mind first)
Djinn - 50 unlocks Haste, Creature Binding and Air Elemental which we probably don't want? All of those are exactly the same cost, so raising/lowering by 1 can regulate which the Djinn can cast without having a big impact on the spells themselves. If we don't want to unlock any, we can still consider amounts between 35 and 49 freely as no Sorcery spell has a cost in that range.
Behemoth - Regeneration costs 32, Entangle is 50. If we don't care about losing Regeneration (which it wasn't able to cast back when it was more expensive anyway), then anywhere from 25-49 is safe.
Demon - We don't have any room for change here - we want it to be able to cast Wrack for 40 but not itself for 41.
This gives us the opportunity to review existing Caster units and rethink how much they need, and also possibly adjust spell costs that were influenced by it. Do note that we might also want to adjust the unit stats if the caster ability is significantly raised or lowered. Also note adding new units won't be considered until I am playing the race we are adding the unit to in test games, but this definitely opens up the possibility to have such units.
(Note that I haven't thought about actually changing anything yet, I'm merely stating what is possible.)
The units :
Efreet - currently caster 40. If reduced, Doom Bolt can cost 40 against instead of the silly looking 41, but doing so means the Efreet gets to cast fewer spells. While nothing casts exactly 40 on its own, a Warp Lighting+Fire Bolt, or 2 Fireballs and a Firebolt, etc do. Most chaos spells have a cost that is divisible by 5.
Angel - currently caster 20. We can freely raise this if desired, without risking to run into Prayer and Raise Dead (both 40), but 30 does hit invulnerability. I'm not a fan of 20 on this unit as Healing costs 15 and the last 5 cannot be spent in any meaningful way most of the time.
Archangel - Don't think we have a need to keep it exactly 40 - no Life spells are unlocked by having a higher amount as long as it stays below 60, which allows Holy Word. We definitely don't want it at 70 though which enables High Prayer and Supreme Light and Call To Arms. Archangels are quite powerful already, though.
Magicians - We can now let specific races have more, or less MP, albeit this will allow that magician to cast certain spells it currently can't so it's a potentially very influential change that might be better avoided (Flight, Crack's Call comes to mind first)
Djinn - 50 unlocks Haste, Creature Binding and Air Elemental which we probably don't want? All of those are exactly the same cost, so raising/lowering by 1 can regulate which the Djinn can cast without having a big impact on the spells themselves. If we don't want to unlock any, we can still consider amounts between 35 and 49 freely as no Sorcery spell has a cost in that range.
Behemoth - Regeneration costs 32, Entangle is 50. If we don't care about losing Regeneration (which it wasn't able to cast back when it was more expensive anyway), then anywhere from 25-49 is safe.
Demon - We don't have any room for change here - we want it to be able to cast Wrack for 40 but not itself for 41.