Resource icon

Survival Promotion (XML+Python) 2016-10-05

I've been busy and haven't released anything in a while so these are just a few things I threw together either based on old requests or code that's floating around inside Thomas' War.

Anyway, these promotions are basically UU abilities from my next version of Thomas' War. I figured I'd put them up as promotions here so anyone who wants can use the code (mainly because throwing together a promotion modcomp takes all of 2 minutes if the code is already written).



It works like a defensive withdrawal chance, so if you lose a battle (and a unit is killed) there's a 10% chance that unit will 'survive'. They survive with only 10% health you can edit that in the python.

You can edit the percentage chance by changing this line:

self.iResistance = self.getRandomNumber( 9 )

Note, 9 is a 1 in 10 chance as the game counts 0 when finding a random number.

This really isn't meant to be used stand-alone but for modders who want to include new promotions outside the traditional XML bonuses.

All the python is labeled and searching for 'Survival' should find the changes. Note, the code is in two sections with additional code at the very end of the file.

I recommend downloading and using Winmerge to combine python.

Thread


Edit: There was an error in the code (mainly because I copied it directly from Thomas' War) where it had a pre-req promotion that doesn't exist in the standard game but does in my mod. It now needs the March promotion.
  • fixedsurvival_RwQ.jpg
    fixedsurvival_RwQ.jpg
    78.3 KB · Views: 117
Author
tsentom1
Downloads
483
Views
483
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from tsentom1

Top Bottom