Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CacheEnemy()

void Terraria.GameContent.CoinLossRevengeSystem.CacheEnemy ( NPC npc)
inline

Definition at line 348 of file CoinLossRevengeSystem.cs.

349 {
350 if (npc.boss || npc.realLife != -1 || npc.rarity > 0 || npc.extraValue < MinimumCoinsForCaching || npc.position.X < Main.leftWorld + 640f + 16f || npc.position.X + (float)npc.width > Main.rightWorld - 640f - 32f || npc.position.Y < Main.topWorld + 640f + 16f || npc.position.Y > Main.bottomWorld - 640f - 32f - (float)npc.height)
351 {
352 return;
353 }
354 int num = npc.netID;
355 if (NPCID.Sets.RespawnEnemyID.TryGetValue(num, out var value))
356 {
357 num = value;
358 }
359 if (num != 0)
360 {
361 RevengeMarker marker = new RevengeMarker(npc.Center, num, npc.GetLifePercent(), npc.type, npc.aiStyle, npc.extraValue, npc.value, npc.SpawnedFromStatue, _gameTime);
363 if (Main.netMode == 2)
364 {
365 NetMessage.SendCoinLossRevengeMarker(marker);
366 }
367 if (DisplayCaching)
368 {
369 Main.NewText("Cached " + npc.GivenOrTypeName);
370 }
371 }
372 }
static Dictionary< int, int > RespawnEnemyID
Definition NPCID.cs:4115

References Terraria.GameContent.CoinLossRevengeSystem._gameTime, Terraria.GameContent.CoinLossRevengeSystem.AddMarker(), Terraria.NPC.aiStyle, Terraria.NPC.boss, Terraria.Main.bottomWorld, Terraria.Entity.Center, Terraria.GameContent.CoinLossRevengeSystem.DisplayCaching, Terraria.NPC.extraValue, Terraria.NPC.GetLifePercent(), Terraria.NPC.GivenOrTypeName, Terraria.Entity.height, Terraria.Main.leftWorld, Terraria.GameContent.CoinLossRevengeSystem.MinimumCoinsForCaching, Terraria.NPC.netID, Terraria.Main.netMode, Terraria.Main.NewText(), Terraria.Entity.position, Terraria.NPC.rarity, Terraria.NPC.realLife, Terraria.ID.NPCID.Sets.RespawnEnemyID, Terraria.Main.rightWorld, Terraria.NetMessage.SendCoinLossRevengeMarker(), Terraria.NPC.SpawnedFromStatue, Terraria.Main.topWorld, Terraria.NPC.type, System.value, Terraria.NPC.value, Terraria.Entity.width, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.