I thought it was about time I posted what I've been so busy doing. I had started 0.9.7.3 intending to just work down the list of spells and unit skills that didn't yet work and get perhaps not all of them finished, but quite a few. That in itself was taking longer to do each spell than I expected, since every one required coding in some new unique effect.
Then I came to Weapon Immunity and started trying to list and test all the things than can punch through it (summoned creatures, units built with alchemy, spells such as Holy Weapon or Flame Blade, etc) and then started to think, what about the Invulnerability spell - that grants Weapon Immunity as one of its effects. So I posted on the MoM Wiki about it
here and confirmed what I suspected, that an attacker with say Flame Blade cast on it will punch through the Weapon Immunity portion of Invulerability, but not the -2 damage reduction portion. And my skill model just couldn't cope with that.
In fact the whole way unit stats were calculated was like a massive spider web. Lets say you want to know what a unit's attack strength is, there's a piece of code that worked that out. But to know that, you had to first know its experience level, since experience grants a +attack bonus. To know its experience level, you first have to look up the value of its experience skill, but also chest the owning wizard's retorts (for Warlord) and spells (for Crusade). Every unit stat method called every other one and, it made it pretty difficult to follow precisely what was happening and where things like Invulerability's Weapon Immunity effect should be added in. Not to mention how wasteful it was - in the process of resolving one attack from a unit, it would probably calculate their experience level 20+ times, every time their attack or defence stat was referenced.
So I realised what would be much cleaner to follow, maintain and test would be to throw away all the individual unit calculation methods calling each other in a web, and have one huge piece of code that calculated every possible piece of information about a given unit. Then it could do so in a sequential manner (like, apply all spell effects, then apply all skills that grant secondary effects, then apply bonuses from experience, and so on). That alone wasn't too difficult, and it works very nicely indeed. Then I was a while testing it and proving that it coped with all the complicated situations that the old code struggled with. Hurray :)
Then came the real problem. I had to retrofit the new unit calculation super method back into every single place in the game that did anything at all to do with units, which is pretty much the entire game. I had several attempts initially at how to even approach the size of this task before I found a workable way to do it gradually rather than one massive rewrite, but still, it has taken me literally months to do. I've just now finished this.
So, that's as much as I plan to do on 0.9.7.3. I didn't get all the spells and skills working that I wanted, but I did get this mammoth unit calculation rewrite completed and that's of far greater significance. Its all done now, but I need to spend some time retesting as much as I possibly can. Since this has touched practically every piece of code in the game, the entire thing needs retesting - every skill, every spell, every immunity to see what is working and what isn't. I'll try to get at that over the next few weeks so I can release it.
After that I need a bit of a break from it (and to get some breathing space so I can fix bugs people will inevitably find), and after that I'm going to work on the AI. That's the biggest most important missing piece right now and is more important than finishing off missing skills and spells.