I want this renaming thing to take off, so I'm gonna call them auras instead of attack boosts.I can confirm that Softcoder is correct (I had to do a double take on that description).
The relevant part of the code is:
if(boost->allowMultipleBoosts == false) {
// Check if we already have this boost from this unit type and multiples
// are not allowed
bool alreadyHasAttackBoost = this->unitHasAttackBoost(boost, source);
if(alreadyHasAttackBoost == true) {
shouldApplyAttackBoost = false;
}
}
As we can see, the only thing this variable does is prevent repeated application of the same boost to a unit. Since this check can happen many times per second, the effect quickly piles up and the current way that boosts are applied do not allow a maximum to be specified.
So it may not be a bug in the traditional sense, but I believe this is a serious design bug. As Ishmaru states, there's pretty much no reason for this behavior. I cannot think of a positive way to use this (since anyone receiving the boost will have their stats boosted to infinity). I think it should be changed to:
- Off: Users can receive a single aura from each unit of each type. For example, if the castle has an aura and a unit is near 2 castles, it should only get the boost from a single castle (doesn't matter which since the boosts are the same, but we should assume that in the future, it may be possible for the same units to have different boost; consider the possible feature of upgrades that boost auras).
- On: Users can receive an aura from each unit nearby. So if castles have an aura and a unit is near 2 castles, they should receive twice the effects of the castle's aura.
This has a clear and obvious use case: we could have healer units that heal nearby units. More healer units let you heal faster (probably shouldn't be able to heal themselves to prevent abuse). Or powerful generals that enhance their allies stats and more generals mean more stat boosts (but these units are limited enough to not be abuseable).
As an aside, a potential future feature request that may be of use would be the ability to provide maximum and minimum boosts. This would make it easier to prevent abuse of stacking attack boosts. For example, maybe a common enemy reduces enemy attack by 1%. This stacks with the number of this unit up to a minimum penalty of -10%. It makes it useful to have many of these units without allowing that ability to be abused (of course, an alternative is to just limit the range so that you can't have too many in the area of affect -- this limitation makes the above mentioned feature request very low priority).