Coin pickup in Expert Mode

From Terraria Wiki
Jump to navigation Jump to search
Desktop versionConsole versionMobile version
Desktop/Console/Mobile-Only Content: This information applies only to the Desktop, Console, and Mobile versions of Terraria.
Expert Mode.png
Expert and Master Mode-Only Content: This information applies only to Expert Mode, Master Mode, and worlds with these modes.

In Expert Mode, most enemies can pick up dropped coins. They will emit a sound () when doing so. Enemies holding dropped coins emit a sparkle effect based on the color of the best coin they are holding.

Details

When the hitbox of an enemy intersects with the hitbox of a stack of dropped coins, the enemy will try to pick up some coins from the stack. An enemy can only pick up coins if the following conditions are fulfilled:[1]

  • The total value of the coins the enemy is already holding is less than the total value of the stack of coins.
  • The sum of the value of the coins the enemy is already holding and the value of the stack of coins is less than 999000000, or 999 PC.

The amount of coins picked up by the enemy is then calculated by multiplying the stack amount and a factor, rounded down, with a minimal amount of 1 coin and a maximum amount of the full stack. The factor is a random value in [0.5, 0.75] (with an increment of 0.01), and will be increased with the following conditions:

  • If the coin type is a Copper Coin: a random value in [0, 0.5] (with an increment of 0.01) is added to the factor.
  • If the coin type is a Silver Coin: a random value in [0, 0.25] (with an increment of 0.01) is added to the factor.

For example, if a stack of 25 SC is dropped, an enemy holding 30 SC will not pick up coins from it. An enemy not holding any coins can take [math]\displaystyle{ [ 25\times(0.5+0), 25\times(0.75+0.25)] }[/math] , resulting 12–25 SC after rounding.

Invulnerable enemies will never pick up coins. See below for a list of other enemies that never pick up coins.[2]

  • Enemy saving

    Several enemies saved on the minimap.

    There is also a "revenge" mechanic, which saves the info about an enemy that holds coins and respawns it when the player gets near the location. The enemy's health percentage, location, and amount of coins they are holding when they despawn are saved. The location will be displayed on the minimap by coin icons, and hovering the cursor over the icon displays the amount of coins.

    An enemy must fulfill all the following conditions to be saved.[3]

    • The enemy picked up more than 10 SC.[4]
    • The enemy is more than 41 tiles away from the top and left world border, and more than 42 tiles away from the bottom and right world border.
      • These borders refer to the real-world border that cannot be seen in-game, so as long as the enemy is within the visible world border, it can be saved.
    • The enemy is not a boss.
    • The enemy's "rarity" is not higher than 0.[5] This makes the following enemies inapplicable.
  • Enemy respawning

    When a saved location enters a 163×115-tile rectangular area centered on a player's center, the saved enemy is respawned. The respawned enemy's health will be restored to 50% if it is lower than 50%.[6] However, there are several special circumstances in which an enemy can or cannot respawn.[7] If the player approaches the saved location while the enemy cannot respawn, the saved enemy is removed and the coins are lost forever.

  • Save removal

    Enemy saves do not exist permanently. The game will remove invalid and expired enemy saves and the coins will then be lost forever.[8]

    Certain types of saved enemies will become invalid under certain conditions:[9]

  • Goblin Army
    Frost Legion
    Pirate Invasion
    Martian Madness
    Old One's Army
    Including variants from any tier of the event
    Frost Moon
    Pumpkin Moon
    Solar Eclipse
  • Enemy saves will expire after a certain amount of time. The expiration time of a saved enemy is determined by the amount of coins picked up by it.[10] Note that coin values are converted to raw Copper values (v in the following table) in the calculation (e.g. 1 PC2 GC3 SC4 CC is converted to 1020304).

    Raw value
    (v)
    Expiration time
    (ticks[11])
    v<10000 [math]\displaystyle{ 54000+72000\times\frac{\text{Raw value}-{100}}{9900} }[/math]
    10000≤v<1000000 [math]\displaystyle{ 126000+108000\times\frac{\text{Raw value}-{100}}{9900} }[/math]
    v≥1000000 450000

    History

    • Desktop 1.4.0.1: Enemies that picked up enough coins in Expert Mode are now saved to a location when they despawn.
    • Desktop 1.3.0.4: Fixed air items being left over when enemies pick up coins in Expert Mode.

    References

    1. Information taken from the Desktop version Desktop 1.4.4.9 source code, method GetPickedUpByMonsters_Money() in Terraria.Item.cs.
    2. Information taken from the Desktop version Desktop 1.4.4.9 source code, field Sets.CantTakeLunchMoney in Terraria.ID.NPCID.cs.
    3. Information taken from the Desktop version Desktop 1.4.4.9 source code, method CacheEnemy() in Terraria.GameContent.CoinLossRevengeSystem.cs.
    4. Information taken from the Desktop version Desktop 1.4.4.9 source code, field MinimumCoinsForCaching in Terraria.GameContent.CoinLossRevengeSystem.cs.
    5. Note that this rarity stat is the one used by the Lifeform Analyzer, not the rarity stat in the Bestiary. Summarily, enemies detectable by the Lifeform Analyzer are inapplicable.
    6. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods CheckRespawns() in Terraria.GameContent.CoinLossRevengeSystem.cs and SpawnEnemy() in Terraria.GameContent.CoinLossRevengeSystem.RevengeMarker.cs and field _playerBoxSizeOuter in Terraria.GameContent.CoinLossRevengeSystem.cs.
    7. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods CheckRespawns() in Terraria.GameContent.CoinLossRevengeSystem.cs and WouldNPCBeDiscouraged() in Terraria.GameContent.CoinLossRevengeSystem.RevengeMarker.cs.
    8. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods IsInvalid() in Terraria.GameContent.CoinLossRevengeSystem.RevengeMarker.cs and IsExpired() in Terraria.GameContent.CoinLossRevengeSystem.RevengeMarker.cs.
    9. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods IsInvalid() in Terraria.GameContent.CoinLossRevengeSystem.RevengeMarker.cs and GetNPCInvasionGroup() in Terraria.NPC.cs.
    10. Information taken from the Desktop version Desktop 1.4.4.9 source code, method CalculateExpirationTime() in Terraria.GameContent.CoinLossRevengeSystem.RevengeMarker.cs.
    11. A tick is a time unit countable by the software. Most of Terraria's updating logic happens every tick. A tick has the length of 1/60th of a second, hence there are 60 ticks in a second and 3600 ticks in a minute.