|
King's Bounty Famous series of Fantasy Real-time RPG with turn-based battles. |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
King's Bounty Attack Description / Code Bug
I'm not even sure where to post this since it has gone unnoticed for the entire King's Bounty Lineage (i.e. TL, AP, and CW), but thought that I'd post it here to make everyone aware of this issue.
Here is what the attack tip states: "Determines the effectiveness of the hero's attack. If the attack exceeds the target's defense, the target suffers more damage. At maximum, the damage increases to 300%." Here is the code snippet present from ARENA.LUA (similar code is in all 3 KB releases, although the "local k" line may be different due to different bonuses, but in the end it is always at least attack - defense): Code:
local k = ( attacker_attack * total_attack_bonus + holy_rage_bonus ) - receiver_defense . . . if k >= 0 and k < 60 then sdmg = sdmg * ( 1 + k * 0.0333 ) end if k >= 60 then sdmg = sdmg * 3 end if k < 0 and k >= -60 then sdmg = sdmg / ( 1 - k * 0.0333 ) end if k < -60 then sdmg = sdmg / 3 end This is always a confusing aspect of math and sometimes people get it wrong. A 100% increase in a value is a 2 times increase. A 200% increase in a value is a 3 times increase. And a 300% increase in a value is a 4 times increase. So, the description should state: "Determines the effectiveness of the hero's attack. If the attack exceeds the target's defense, the target suffers more damage. At maximum, the damage increases to 200%." Or the code should be changed to: Code:
local k = ( attacker_attack * total_attack_bonus + holy_rage_bonus ) - receiver_defense if k >= 0 and k < 90 then sdmg = sdmg * ( 1 + k * 0.0333 ) end if k >= 90 then sdmg = sdmg * 4 end if k < 0 and k >= -60 then sdmg = sdmg / ( 1 - k * 0.0333 ) end if k < -60 then sdmg = sdmg / 3 end So, anyway, I just wanted to point out that either the description is wrong or the code is wrong. I'm guessing at this point, but since with the original code limits the damage to between 3 times and 1/3 that the code is correct and the description is simply wrong. /C\/C\ |
#2
|
|||
|
|||
Quote:
Technically it states "increases to 300%" which is 1*3 The thing you suggest is "increased by 300%" which would be 1+1*3 i.e. 1*4 So the statement is correct. |
#3
|
|||
|
|||
Maybe you're right...
You know, when you word it that way, it sounds right - so maybe it's okay the way it is...
|
|
|