- Joined
- Mar 5, 2007
- Messages
- 32
Hi,
I'm trying to make a Heroes III combat system. This is just plain math, so you don't have to know the game, I've explained everything I think.
In Heroes III a unit isn't a single unit, but a group of units. The unit (representing a group) has the number of units in the group beside it on the combat screen. The damage dealt has 3 factor; the Damage of the unit, the Attack and the Defence. First the difference between the attacking unit's (group's) Attack and the defending unit's Defence. Defence - Attack. If the Attack is higher than the Defence the damage is increased by 5% per Attack higher (Max 400%). If the Defence is higher the damage is decreased by 2% per Defence higher (Max 30%). When a unit is attacked I don't directly want the hit points of the attacked unit to decrease, seeing that a unit is not just a unit, but a group. I'll add a Floating Text to all the units on the Combat Screen, showing the number of units in the unit group. When an attacker then "kills" a unit, I just want that number to decrease by one or more, depending on the amount of damage dealt. If the attacker doesn't deal enough damage to kill a unit in the group, or does not deal the exact hit points of some units in the group in damage, the unit itself is damaged. (Showing that the top unit of the group has lost hit points.)
So, I'll just apply initials to the different factors:
X = number of units in unit group
A = Attack
D = Defence
HP = Hit Points of defending unit
Dmg = Damage
X*HP = total hit points
X*HP-X*Dmg*(*(A-D)*1.05 or *-1.02)) = Total remaining hit points
OK so what I want is a way to "kill" a number of units in the Floating Text depending on the damage dealt, and then damage the unit itself for the remaining damage. Please tell me if you don't understand.
I'm trying to make a Heroes III combat system. This is just plain math, so you don't have to know the game, I've explained everything I think.
In Heroes III a unit isn't a single unit, but a group of units. The unit (representing a group) has the number of units in the group beside it on the combat screen. The damage dealt has 3 factor; the Damage of the unit, the Attack and the Defence. First the difference between the attacking unit's (group's) Attack and the defending unit's Defence. Defence - Attack. If the Attack is higher than the Defence the damage is increased by 5% per Attack higher (Max 400%). If the Defence is higher the damage is decreased by 2% per Defence higher (Max 30%). When a unit is attacked I don't directly want the hit points of the attacked unit to decrease, seeing that a unit is not just a unit, but a group. I'll add a Floating Text to all the units on the Combat Screen, showing the number of units in the unit group. When an attacker then "kills" a unit, I just want that number to decrease by one or more, depending on the amount of damage dealt. If the attacker doesn't deal enough damage to kill a unit in the group, or does not deal the exact hit points of some units in the group in damage, the unit itself is damaged. (Showing that the top unit of the group has lost hit points.)
So, I'll just apply initials to the different factors:
X = number of units in unit group
A = Attack
D = Defence
HP = Hit Points of defending unit
Dmg = Damage
X*HP = total hit points
X*HP-X*Dmg*(*(A-D)*1.05 or *-1.02)) = Total remaining hit points
OK so what I want is a way to "kill" a number of units in the Floating Text depending on the damage dealt, and then damage the unit itself for the remaining damage. Please tell me if you don't understand.