Oh, to continue about the complexities of combat, here's the pseudo-code I have to translate into assembly language in order to determine what happens when one unit attacks another:

Attack
Check if Defender is Invulernable
If so, attack fails, return Invulnerable code
Determine attacker and defender base fatigue
1 standard, 0 if empowered, 2 if weakened
Determine attacker and defender power bonuses/penalties
Determine if attacker is exalted/cursed
If exalted, +2 to attacker power. If cursed -2 to attacker power
Determine if defender is exalted/cursed
If exalted, +2 to defender power. If cursed -2 to defender power
Determine if defender is guarding
If so, +1 to all defenses, +2 to defender power
Goto appropriate attack type
Attack Melee
Adjust base fatigue
If attacker has 2H weapon, +1 fatigue
Determine if attacker is enraged
If so, add +4 to attacker power
Determine if defender is armored
If so, add +4 to defender power
Determine if defender is enraged
If so, subtract -4 to defender power
Attack:
Determine if attack misses
If defender is blurred, miss chance is 50% (0 on a RND of 2)
If attack fails, return Miss code
Determine if critical hit (0 out of 16)
If critical hit, defender cannot avoid attack
Set attacker power to 150%
Set attacker fatigue to 0
Goto Damage
Defense:
Determine if defender can parry (Any melee except bare hands and dagger)
If so, defender parries, takes fatigue, return parry code
Determine if defender can block (Has shield)
If so, defender blocks, takes fatigue, return block code
Determine if defender can dodge (Open space available to move into, not immobilized)
If so, defender dodges, change position, takes fatigue+1, return dodge code
Damage:
Determine damage (Attacker power + bonus/penalty - defender power + bonus/penalty, minimum of 1)
Defender takes {damage} wounds, attacker takes fatigue
Return hit code
Attack Ranged
Adjust base fatigue
If attacker has arbalest, -1 fatigue
Determine if defender is shielded
If so, add +4 to defender power
Attack:
Determine if attack misses
If defender is deflecting, miss chance is 50% (0 on a RND of 2)
If attack fails, return Miss code
Determine if critical hit (0 out of 16)
If critical hit, defender cannot avoid attack
Set attacker power to 150%
Set attacker fatigue to 0
Goto Damage
Defense:
Determine if defender can block (Has shield and attacker not using a firearm)
If so, defender blocks, takes fatigue, return block code
Damage:
Determine damage (Attacker power + bonus/penalty - defender power + bonus/penalty, minimum of 1)
Defender takes {damage} wounds, attacker takes fatigue
Return hit code
Attack Sorcery (target)
Adjust base fatigue
If attacker using affinity spell, -1 fatigue, +2 bonus power
If defender targeted by affinity spell, -1 fatigue, +2 bonus power
Determine if defender is protected
If so, add +4 to defender power
Attack:
Determine if attack misses
If defender is warded, miss chance is 50% (0 on a RND of 2)
If attack fails, return Miss code
Determine if critical hit (0 out of 16)
If critical hit, defender cannot avoid attack
Set attacker power to 150%
Set attacker fatigue to 0
Goto Effect
Defense:
Determine if defender can block (Has foci)
If so, defender blocks, takes fatigue, return block code
Effect:
Determine damage (Attacker power + bonus/penalty - defender power + bonus/penalty, minimum of 1)
Defender takes {damage} wounds or {damage} duration effect, attacker takes fatigue
Return hit code
Attack Sorcery (area)
Adjust base fatigue
If attacker using affinity spell, -1 fatigue, +2 bonus power
If defender targeted by affinity spell, -1 fatigue, +2 bonus power
Determine if defender is protected
If so, add +4 to defender power
Defense:
If defender is warded, miss chance is 50% (0 on a RND of 2)
If attack fails, return Miss code
Determine if defender can block (Has shield or foci)
If so, defender blocks, takes fatigue, return block code
Effect:
Determine damage (Attacker power + bonus/penalty - defender power + bonus/penalty, minimum of 1)
Defender takes {damage} wounds or {damage} duration effect, attacker takes fatigue
Return hit code

I also need to determine how this translates into direct screen action... I don't want to build a "cinematic event" array and post-process everything, so I'll probably just have to return codes to indicate what units are doing and go from there.

Adamantyr

**Edited by adamantyr, Wed Mar 3, 2010 6:21 PM.**