Well, Nintendo games have been using pretty much primitive AI. In the 3D systems, it was much easier, for there was no elevation changes or advanced AI to use. All it was composed was of the following "unit ENEMY: if USER on Plane (If a specific ray that starts from the enemy's to the end of the screen hits Link), unit ENEMY goto USER. if contact USER, then subtract DAMAGE (Take the life points away from Link)".
Now, in the 3D world of gaming, we need a more complex and realistic system. For this one, I'll use enemies that use both a sword and shield, such as Stalfos from Ocarina of Time. The code is not even similar to the above code. The coding styles is more of a random generator, in which the AI randomises if it wants to attack, take down it's shield for a second, or just stand in a shielding position. "ENEMY STALFO *GENERATE UNIT*. if UNIT=1, then ORBIT USER. if UNIT=2, then STOP ORBIT. if UNIT=3, then REMOVE SHIELD. if UNIT=4, then ACTIVATE SHIELD. if UNIT=5, then ATTACK." Units five and up are various attacks. However, the Dark Link battle is much different. Dark Link is always a second behind. That is why it is easy to kill Dark Link by holding your shield, then quickly doing a jump attack. Dark Link would take down his shield to try to counter it, but it would be too late, thus causing either a compliment in programming or a missed bug. Now, adding weapons and such would only add on as to how many UNIT attacks there would be, thus randomising the game much more. However, there is now newer AI, as found in Twilight Princess, in which if harm to a comrade happens, they see you, or if they "hear" you, they would try to attack you. Then, the AI would think either faster or slower, sort of like Super Smash Bros, in which the AI was not simply difficulty, but delaying the thinking process of the console. I honestly don't know about these, but I do know that this is quite similar.