From Legacy Wiki

The Fighting dropdown menu contains links to many combative aspects of Legacy. It is the second dropdown menu from the left and is located at the top of the screen, right below the combat log. It provides links to:
Player vs Player fights and Player vs NPC fights are determined by a comparison of stats, some random numbers and some equations. When you attempt to hit your enemy the process runs something like this.
1. Stat Totals
The current value for each of your respective stats is calculated in the order shown below for both yourself and your opponent.
 Base Character Stats.
 Adjustments made based on chosen attack type. (Quick Attack, Aimed Attack, Take Cover)
 + Stats from all equipped Items.
 + Stats from trained Abilities that grant bonuses.
 + Stat bonus from any friendly Warfare Structures in your location.
 + Bonus stats granted from any staff favor you have.
  Any penalty from a staff disfavor you may have.
  Any penalty to stats from warfare fatigue.
 + Bonus from any friendly effect like Alien Artifact armor bonus.
1. Percentages Calculated
The game then takes the above information and determines your percentage chance to hit and damage. This percentage is not used further by the script it is only displayed to players so they may understand what is going on more clearly. The scripted algorithm used to determine a percentage chance to hit or damage is shown below.
a = Offensive Stat (Accuracy or Weapon Hit Skill)
d = Defensive Stat (Dodge or Defense Skill)
if (d > a) {
x = ( a + 1 )  ( d / 4 )
if ( x < 0 ) x = 0
percentage = ( ( ( x ) * ( x / 2 ) ) / ( ( ( d + 1 )  ( d / 4 ) ) * ( ( a + 1 )  ( a / 4 ) ) ) ) * 100
} else {
x = ( d + 1 )  ( a / 4 )
if ( x < 0 ) x = 0
percentage = ( ( ( ( ( d + 1 )  ( d / 4 ) ) * ( ( a + 1 )  ( a / 4 ) ) )  ( ( x ) * ( x / 2 ) ) ) / ( ( ( d + 1 )  ( d / 4 ) ) * ( ( a + 1 )  ( a / 4 ) ) ) ) * 100
}
2. Determine First Hit
This is a basic comparison of the attacker and defenders Speed stat. The player with the highest speed gets the first hit, if both speeds are equal the attacker hits first.
3. Determine Hit
To determine if a player hits or misses an opponent their Accuracy stat is compared to their opponents Dodge stat with a degree of randomness. The basic equation used for this comparison is.
a = Offensive Stat (Accuracy or Weapon Hit Skill)
d = Defensive Stat (Dodge or Defense Skill)
x = random ( ( a / 4 ), a )  random ( ( d / 4 ), d ) if ( x > 0 ) Hit Scored
In basic terms your Accuracy is turned in to a random number from 25% its value up to 100% its value and compared with the opponents Dodge which is randomized in the same way. So if you have 100 as a stat this random number could be anywhere between 25 and 100.
If a hit is scored, the same is then done for Weapon Skill vs Defense skill. This determines if you do damage or not, if successful a hit will be scored and damage calculated. Failure at this stage results in a "You hit but did no damage." message.
4. Determine Damage
If you won both the above rolls you scored a damaging hit on your opponent, the amount of Damage done is determined by your Weapon Damage compared to your opponents Armor.
The weapon damage is randomized between the minimum and maximum damage value of your current weapon. (Each attack pageconsists of 2 attacks, 1 with each weapon). The damage done is then decreased to match the amount absorbed by your opponents armor.
Armor absorbs damage equal to its value but cannot absorb more than 60% of the damage done. The scripting that determines absorbtion is shown below.
min = Current weapons mininum damage
max = Current weapons maximum damage
armor = Opponents armor value
damage = round ( random ( min, max) );
if ( ( damage* 0.6 ) < armor) absorb = floor ( damage* 0.6 )
else absorb= armor
damage = damage  absorb
The round function rounds to the nearest whole number, the floor function always rounds down. The point of this is even if your opponents armor is far superior to your weapons, a damaging hit will still do 40% of your weapons damage at least.
5. Double Hits
This whole process is done twice (once for each weapon), the total stats from all equipped items are added up apart from Armor which only comes from your current armor item and weapon damage which only comes from the attacking weapon. If both hit and damage you score a double hit. The end damage is then deducted from your opponents hit points, if they're still alive they will hit back (if they have the second attack).