Aggro/yue

仇恨，係一個用嚟定義Enemies/yue幾遠開始會攻擊玩家嘅隱藏數值. Terraria/yue入面有幾樣物品裝備咗可以改變到呢個嘅數值.

所有敵怪鎖定玩家嘅行為都係基於佢哋嘅AI/yue所定下嘅標準. 佢哋通常會恆常咁尋找目標攻擊，但係有啲嘅怪就只會攻擊係Water/yue入面嘅玩家. 而家Stardust Guardian/yue嘅功用就係可以分散敵怪嘅注意力. 當佢出現喺敵怪200個像素範圍之內嘅時候會覆蓋咗玩家喺敵怪視覺嘅存在，從而分散敵怪對玩家嘅注意力. 如果唔係嘅話敵怪會鎖定玩家或者守護者，鎖定邊個要睇下邊個近啲. 所以最好嘅做法係將星塵守護者喺一堆密集嘅敵怪入面，避免被分散去開嘅敵怪鎖定到. 喺，星塵守護者會鎖定最近嘅的敵怪而唔會比玩家影響度.

Armor and other items that "increase/decrease enemy targeting" cause enemies to consider a player to be closer or farther away than they actually are. Therefore, having a Stardust Guardian close to an enemy but also having aggro-increasing accessories equipped, the player could be considered "closer" than the Stardust Guardian is, potentially resulting in temporarily being targeted instead of the Guardian.

If the is present, the Old One's Army will target it by default, only targeting the player or Guardian if they get "in the way".

Decrease
The following items reduce the player's aggro statistic, meaning that enemies will have to get closer to target the player.


 * Aggro reductions of −750 (or more) nearly guarantee the player will not be targeted.
 * Vortex armor provides the largest aggro reduction available in the game.

Increase
These items increase the player's aggro statistic, meaning that enemies can be farther from the player and still target them.

Formula
Most enemies will only attack the target they are closest to. They will determine the player's distance first, then the Stardust Guardian's (if applicable) and finally the distance to the (if applicable). The distance for the player formula is abs(targetPlayer.x + 10 − enemy.x + (enemy.width / 2)) + abs(targetPlayer.y + 21 − enemy.y + (enemy.height / 2)) − targetPlayer.aggro The result from that formula is then compared to the guardians formula result: abs(guardian.x + 25 − enemy.x + (enemy.width / 2)) + abs(guardian.y + 40 − enemy.y + (enemy.height / 2)) − 200 Whichever results in the higher value is targeted.

Old One's Army formula
Enemies in the Old One's Army follow a separate formula due to having to attack the player, as well as the crystal. An enemy will first determine the distance between the Eternia Crystal and it with a simple distance formula. Then, barring the chance the enemy is currently "ghosted", the enemy determines the "distance" to the player with the following formula. distance(enemy.position, targetPlayer.position) − targetPlayer.aggro Even though this formula does account for aggro, a player will be ignored if they are not within 200 pixels of the specified enemy. Like with regular enemies, if the Guardian is closer to an enemy than the player is, and is within 400 pixels of it, then the Guardian is targeted instead of the player.

History
Aggro 仇恨