Each round, combatants can choose to attack a single enemy (depending on its distance) or actively defend itself from all enemies (increasing its armor class by one for the duration of the round).
Attacks
Heroes always attack using the melee or missile weapon chosen for them by the player (via the MANAGE ITEMS button). Heroes can attack ANY close combatant with its melee weapon or any nearby combatant with its missile weapon PROVIDED the hero isn't already engaged in hand-to-hand combat with another combatant. Once an enemy attacks a particular hero, that hero must defeat that enemy before he or she can target other combatants within the encounter area.
When attacking, a combatant rolls a 1d20 and adds appropriate strength (close combat) or dexterity (ranged combat) bonuses along with any magical bonuses that may exist. The combatant's goal is to roll a score equal to or higher than its opponent's armor class; if the roll is successful, then the enemy is struck and damage is calculated (per the weapon type, strength/dexterity bonuses and other associated bonuses and circumstances). Note that a roll of a 1 is always considered a miss regardless of all associated bonuses, just as a roll of a 20 will always hit a target regardless of armor class.
Defense
Combatants naturally protect themselves as much as possible. This is primary done through the use of armor, shields, magical rings and other forms of magic. Again, all things being equal, an enemy must roll the value of a defending hero's armor class or higher on a 1d20 in order to successfully strike the hero and cause bodily damage.
However, heroes can also choose to actively defend themselves even more during combat. When the associated command is selected, the hero spends the entire round doing everything in his power to evade attacks. This results in an additional bonus to the hero's armor class and makes him slightly more difficult to hit (but it also prohibits the hero from doing anything else during the round).
Hiding in Shadows
Thieves and magic-user/thieves within the player's party can try to HIDE IN SHADOWS during their turn, attempting to blend into any natural shadows within the encounter area and basically become invisible to attacking combatants. To hide in the shadows, a thief must roll her HIDE thieving ability or lower on percentile dice. For example, a 5th level thief has a 30% chance to hide in shadows per attempt. Note that a thieving hero already engaged in hand-to-hand combat cannot try to hide in shadows--the thief must be free of all attacking combatants first.
When successful, the thief essentially becomes invisible to all combatants and will not be targeted by any of them for as long as the thief remains in the shadows. Further, the thief can then attempt to attack any combatant (with either her melee or missile weapon) and do so with a +4 bonus to hit, and if a hit is scored, the thief automatically does TRIPLE DAMAGE to the opponent. Once an attack is made, however, the thief is no longer hiding in the shadows and can become a target of combatants once again.