TeamSurvivalXtreme / SXCollection

SXC (SurvivalXtreme map Collection) add-on for Wesnoth
GNU General Public License v2.0
5 stars 2 forks source link

SXC Use [modify_unit] for adding traits, and refactor the recruit-buffing code (fixes #54) #56

Closed stevecotton closed 5 years ago

stevecotton commented 5 years ago

This is a balance-changing bugfix. All recruited creeps were given the loyal trait, but it was added in a way that didn't set their upkeep to zero (at least in Wesnoth 1.14). So there's a huge cash-drain on the AI sides that was only noticed when testing this commit Fixing this will change the map balance, but it will probably improve the game and also make it easier, with more creeps to earn gold from.

Use the mainline macros for the fearless and loyal traits.

These two changes go together, because the [store_unit] for adding the loyal trait was also the [store_unit] for checking whether the recruit had both melee and ranged attacks.

If a creep doesn't have a melee or ranged weapon, then one is added. The old code generated a random number to choose the weapon type, even if it wouldn't be used. This probably doesn't matter, looking at a replay there seems to be just one random seed for each recruit event, so the extra random calls don't add network traffic.