I made some educated guesses as to how this should work. If I need to tweak it, I can.
First off, there's no range checking on Monster/FriendlyHealth, but I've made it so you can't make an actor's starting health go below 1 (which would make them invincible) -- they'll always have a default of 1 health to start. I've made the change directly in AActor:StaticSpawn so enemies placed in the map, spawned by scripts, or summoned from the console should all be affected. I've also done some hackery so that enemies spawned using summonfoe or summonfriend will adapt to their new role -- If you summon a friendly monster, he'll use FriendlyHealth to determine his start health, not MonsterHealth, and vice versa. Same if you override a friendly monster to an enemy using summonfoe.
I also made it so for all intents and purposes an enemy's max health is based on the adjusted value. So GetActorProperty(APROP_MaxHealth) will return the adjusted value, not the original. I figured the only negative side-effect are scripts not behaving properly because their values are hard-coded, and the fact is there's nothing I can do about that in any case -- mods going forward will have to be aware that the skill levels could adjust max enemy health, and using these settings on old mods is not guaranteed to work.
Also, certain Raven boss enemies base their actions off their percentage of health, and they will be... funky... when the max health is adjusted really low. Mostly they will just refuse to use some of their abilities or might use them at the wrong times. This shouldn't be a problem if you're using reasonble values. (But what fun is that?! )
Without further ado, the patch:
[edit] Look down. [/edit]
Here are a couple (ridiculous) sample skill definitions to test with:
Code: Select all
// Enemies are one-shot kill, friendlies are godly
skill "Paper thin"
{
name="Paper Thin"
monsterhealth=0.001
friendlyhealth=10
spawnfilter=4
}
// Enemies are godly, friendlies are one-shot kill, nobody feels pain
skill "Strong Enemies"
{
name="Strong Enemies"
monsterhealth=10
friendlyhealth=0.001
spawnfilter=4
nopain
}