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

◆ DoDeathEvents()

void Terraria.NPC.DoDeathEvents ( Player closestPlayer)
inlineprivate

Definition at line 84838 of file NPC.cs.

84839 {
84840 //IL_0469: Unknown result type (might be due to invalid IL or missing references)
84841 //IL_046f: Unknown result type (might be due to invalid IL or missing references)
84842 //IL_06cd: Unknown result type (might be due to invalid IL or missing references)
84843 //IL_0438: Unknown result type (might be due to invalid IL or missing references)
84844 //IL_043e: Unknown result type (might be due to invalid IL or missing references)
84845 //IL_070f: Unknown result type (might be due to invalid IL or missing references)
84846 //IL_071a: Unknown result type (might be due to invalid IL or missing references)
84847 //IL_049b: Unknown result type (might be due to invalid IL or missing references)
84848 //IL_04a6: Unknown result type (might be due to invalid IL or missing references)
84849 //IL_05be: Unknown result type (might be due to invalid IL or missing references)
84850 //IL_05c9: Unknown result type (might be due to invalid IL or missing references)
84851 //IL_055d: Unknown result type (might be due to invalid IL or missing references)
84852 //IL_0568: Unknown result type (might be due to invalid IL or missing references)
84853 //IL_04fc: Unknown result type (might be due to invalid IL or missing references)
84854 //IL_0507: Unknown result type (might be due to invalid IL or missing references)
84855 //IL_06e9: Unknown result type (might be due to invalid IL or missing references)
84856 //IL_0a65: Unknown result type (might be due to invalid IL or missing references)
84857 //IL_0a74: Unknown result type (might be due to invalid IL or missing references)
84858 //IL_0a79: Unknown result type (might be due to invalid IL or missing references)
84859 //IL_0a8d: Unknown result type (might be due to invalid IL or missing references)
84860 //IL_0a92: Unknown result type (might be due to invalid IL or missing references)
84861 //IL_0a97: Unknown result type (might be due to invalid IL or missing references)
84862 //IL_0a99: Unknown result type (might be due to invalid IL or missing references)
84863 //IL_0aa1: Unknown result type (might be due to invalid IL or missing references)
84864 //IL_08f3: Unknown result type (might be due to invalid IL or missing references)
84865 //IL_0a30: Unknown result type (might be due to invalid IL or missing references)
84868 if (Main.remixWorld && !downedSlimeKing && AnyInteractions() && Main.AnyPlayerReadyToFightKingSlime() && type == 1 && !AnyNPCs(50) && Main.rand.Next(200) == 0)
84869 {
84870 SpawnOnPlayer(closestPlayer.whoAmI, 50);
84871 }
84872 switch (type)
84873 {
84874 case 216:
84875 SpawnBoss((int)position.X, (int)position.Y, 662, target);
84876 break;
84877 case 327:
84878 if (Main.pumpkinMoon)
84879 {
84881 }
84882 break;
84883 case 325:
84884 if (Main.pumpkinMoon)
84885 {
84887 }
84888 break;
84889 case 344:
84890 if (Main.snowMoon)
84891 {
84893 }
84894 break;
84895 case 345:
84896 if (Main.snowMoon)
84897 {
84899 }
84900 break;
84901 case 346:
84902 if (Main.snowMoon)
84903 {
84905 }
84906 break;
84907 case 552:
84908 case 553:
84909 case 554:
84910 if (DD2Event.Ongoing)
84911 {
84914 {
84915 Item.NewItem(GetItemSource_Loot(), position, base.Size, 3822);
84916 }
84917 }
84918 break;
84919 case 555:
84920 case 556:
84921 case 557:
84922 case 558:
84923 case 559:
84924 case 560:
84925 case 561:
84926 case 562:
84927 case 563:
84928 case 564:
84929 case 565:
84930 case 568:
84931 case 569:
84932 case 570:
84933 case 571:
84934 case 572:
84935 case 573:
84936 case 574:
84937 case 575:
84938 case 576:
84939 case 577:
84940 case 578:
84942 {
84943 Item.NewItem(GetItemSource_Loot(), position, base.Size, 3822);
84944 }
84945 break;
84946 case 412:
84947 case 413:
84948 case 414:
84949 case 415:
84950 case 416:
84951 case 417:
84952 case 418:
84953 case 419:
84954 case 518:
84956 {
84957 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 629, 0, 0f, Main.myPlayer, FindFirstNPC(517));
84958 }
84959 break;
84960 case 425:
84961 case 426:
84962 case 427:
84963 case 429:
84965 {
84966 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 629, 0, 0f, Main.myPlayer, FindFirstNPC(422));
84967 }
84968 break;
84969 case 420:
84970 case 421:
84971 case 423:
84972 case 424:
84974 {
84975 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 629, 0, 0f, Main.myPlayer, FindFirstNPC(507));
84976 }
84977 break;
84978 case 402:
84979 case 405:
84980 case 407:
84981 case 409:
84982 case 411:
84984 {
84985 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 629, 0, 0f, Main.myPlayer, FindFirstNPC(493));
84986 }
84987 break;
84988 case 517:
84989 downedTowerSolar = true;
84990 TowerActiveSolar = false;
84991 WorldGen.UpdateLunarApocalypse();
84992 WorldGen.MessageLunarApocalypse();
84993 break;
84994 case 422:
84995 downedTowerVortex = true;
84996 TowerActiveVortex = false;
84997 WorldGen.UpdateLunarApocalypse();
84998 WorldGen.MessageLunarApocalypse();
84999 break;
85000 case 507:
85001 downedTowerNebula = true;
85002 TowerActiveNebula = false;
85003 WorldGen.UpdateLunarApocalypse();
85004 WorldGen.MessageLunarApocalypse();
85005 break;
85006 case 493:
85007 downedTowerStardust = true;
85008 TowerActiveStardust = false;
85009 WorldGen.UpdateLunarApocalypse();
85010 WorldGen.MessageLunarApocalypse();
85011 break;
85012 case 245:
85014 break;
85015 case 370:
85017 break;
85018 case 636:
85020 break;
85021 case 668:
85023 break;
85024 case 657:
85026 break;
85027 case 22:
85028 if (Collision.LavaCollision(position, width, height))
85029 {
85031 }
85032 break;
85033 case 614:
85034 {
85035 int num2 = 175;
85037 {
85038 num2 = 0;
85039 }
85040 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 281, num2, 0f, Main.myPlayer, -2f, releaseOwner + 1);
85041 break;
85042 }
85043 case 109:
85044 if (!downedClown)
85045 {
85046 downedClown = true;
85047 if (Main.netMode == 2)
85048 {
85049 NetMessage.SendData(7);
85050 }
85051 }
85052 break;
85053 case 222:
85055 if (Main.netMode == 2)
85056 {
85057 NetMessage.SendData(7);
85058 }
85059 break;
85060 case 439:
85062 WorldGen.TriggerLunarApocalypse();
85063 break;
85064 case 398:
85066 LunarApocalypseIsUp = false;
85067 break;
85068 case 50:
85069 if (Main.slimeRain)
85070 {
85071 Main.StopSlimeRain();
85073 }
85074 if (Main.netMode != 1 && !unlockedSlimeBlueSpawn)
85075 {
85078 }
85080 if (Main.netMode == 2)
85081 {
85082 NetMessage.SendData(7);
85083 }
85084 break;
85085 case 125:
85086 case 126:
85087 if (boss)
85088 {
85090 downedMechBossAny = true;
85091 }
85092 break;
85093 case 262:
85094 {
85095 bool num3 = downedPlantBoss;
85097 if (!num3)
85098 {
85099 if (Main.netMode == 0)
85100 {
85101 Main.NewText(Lang.misc[33].Value, 50, byte.MaxValue, 130);
85102 }
85103 else if (Main.netMode == 2)
85104 {
85105 ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[33].Key), new Color(50, 255, 130));
85106 }
85107 }
85108 break;
85109 }
85110 case 4:
85112 break;
85113 case 13:
85114 case 14:
85115 case 15:
85116 case 266:
85117 if (boss)
85118 {
85119 if (!downedBoss2 || Main.rand.Next(2) == 0)
85120 {
85121 WorldGen.spawnMeteor = true;
85122 }
85124 }
85125 break;
85126 case 35:
85127 if (boss)
85128 {
85130 }
85131 break;
85132 case 127:
85133 if (boss)
85134 {
85136 downedMechBossAny = true;
85137 }
85138 break;
85139 case 134:
85140 if (boss)
85141 {
85143 downedMechBossAny = true;
85144 }
85145 break;
85146 case 113:
85147 {
85148 if (Main.netMode == 1)
85149 {
85150 break;
85151 }
85153 bool eventFlag = Main.hardMode;
85154 WorldGen.StartHardmode();
85156 {
85157 if (Main.netMode == 0)
85158 {
85159 Main.NewText(Lang.misc[32].Value, 50, byte.MaxValue, 130);
85160 }
85161 else if (Main.netMode == 2)
85162 {
85163 ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, 255, 130));
85164 }
85165 }
85167 break;
85168 }
85169 case 661:
85170 if (Main.netMode != 1 && GetWereThereAnyInteractions())
85171 {
85172 int num = 636;
85173 if (!AnyNPCs(num))
85174 {
85175 Vector2 vector = base.Center + new Vector2(0f, -200f) + Main.rand.NextVector2Circular(50f, 50f);
85176 SpawnBoss((int)vector.X, (int)vector.Y, num, closestPlayer.whoAmI);
85177 }
85178 }
85179 break;
85180 }
85181 if (boss)
85182 {
85183 string typeName = TypeName;
85186 if (Main.netMode == 2)
85187 {
85188 NetMessage.SendData(7);
85189 }
85190 }
85191 }
static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer=-1)
Definition ChatHelper.cs:51
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static void AnnounceGoblinDeath(NPC n)
Definition DD2Event.cs:693
static NetworkText FromKey(string key, params object[] substitutions)
Creates a NetworkText object from a localization key and optional substitutions. The receiving client...
Represents text that will be sent over the network in multiplayer and displayed to the receiving user...
bool boss
Set to true if the NPC is a boss. Prevents off-screen despawn. Bosses also need [AutoloadBossHead] an...
Definition NPC.cs:1141
static bool downedChristmasSantank
Denotes whether or not at least one Santa-NK1 has been defeated in the current world.
Definition NPC.cs:877
static bool downedTowerSolar
Denotes whether or not the Solar Pillar has been defeated at least once in the current world.
Definition NPC.cs:892
void DoDeathEvents_DropBossPotionsAndHearts(ref string typeName)
Definition NPC.cs:84553
static bool downedTowerVortex
Denotes whether or not the Vortex Pillar has been defeated at least once in the current world.
Definition NPC.cs:897
static bool downedMechBoss2
Denotes whether or not the Twins have been defeated at least once in the current world.
Definition NPC.cs:959
static bool downedFishron
Denotes whether or not Duke Fishron has been defeated at least once in the current world.
Definition NPC.cs:852
static int ShieldStrengthTowerNebula
Definition NPC.cs:928
static void SpawnBoss(int spawnPositionX, int spawnPositionY, int Type, int targetPlayerIndex)
Definition NPC.cs:91149
static bool downedBoss2
Denotes whether or not the Eater of Worlds OR the Brain of Cthulhu have been defeated at least once i...
Definition NPC.cs:796
static int ShieldStrengthTowerSolar
Definition NPC.cs:924
static bool TowerActiveStardust
Definition NPC.cs:942
string TypeName
The TYPE name of this NPC. Type names are the base titles given to any NPC, and are typically shared...
Definition NPC.cs:1421
static int FindFirstNPC(int Type)
Returns the index within F:Terraria.Main.npc of the the first active NPC in the world of the given NP...
Definition NPC.cs:106632
static bool unlockedSlimeBlueSpawn
Definition NPC.cs:746
static bool downedMechBossAny
Denotes whether or not ANY Mechanical Boss has been defeated at least once in the current world.
Definition NPC.cs:949
static bool downedEmpressOfLight
Denotes whether or not the Empress of Light has been defeated at least once in the current world.
Definition NPC.cs:912
static void SpawnWOF(Vector2 pos)
Definition NPC.cs:90565
static bool downedHalloweenKing
Denotes whether or not at least one Pumpking has been defeated in the current world.
Definition NPC.cs:862
void DoDeathEvents_AdvanceSlimeRain(Player closestPlayer)
Definition NPC.cs:84721
static bool downedBoss1
Denotes whether or not the Eye of Cthulhu has been defeated at least once in the current world.
Definition NPC.cs:790
static bool downedSlimeKing
Denotes whether or not King Slime has been defeated at least once in the current world.
Definition NPC.cs:811
bool SpawnedFromStatue
Definition NPC.cs:484
static bool TowerActiveVortex
Definition NPC.cs:938
void CreateBrickBoxForWallOfFlesh()
Definition NPC.cs:84664
static bool downedTowerStardust
Denotes whether or not the Stardust Pillar has been defeated at least once in the current world.
Definition NPC.cs:907
void DoDeathEvents_SummonDungeonSpirit(Player closestPlayer)
Definition NPC.cs:84701
static bool downedMechBoss3
Denotes whether or not Skeletron Prime has been defeated at least once in the current world.
Definition NPC.cs:964
static int ShieldStrengthTowerStardust
Definition NPC.cs:930
static int ShieldStrengthTowerVortex
Definition NPC.cs:926
static bool downedMoonlord
Denotes whether or not the Moon Lord has been defeated at least once in the current world.
Definition NPC.cs:887
bool GetWereThereAnyInteractions()
Returns true if any player has damaged this NPC. Individual player participation can be determined by...
Definition NPC.cs:85444
static bool TowerActiveSolar
Definition NPC.cs:936
static bool AnyNPCs(int Type)
Returns true if there are any active NPC in the world of the given NPC type (F:Terraria....
Definition NPC.cs:106615
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
static bool downedQueenBee
Denotes whether or not at least one Queen Bee has been defeated in the current world.
Definition NPC.cs:806
static bool downedHalloweenTree
Denotes whether or not at least one Mourning Wood has been defeated in the current world.
Definition NPC.cs:857
bool AnyInteractions()
Returns true if any player has damaged this NPC. Individual player participation can be determined by...
Definition NPC.cs:84401
static bool downedChristmasTree
Denotes whether or not at least one Everscream has been defeated in the current world.
Definition NPC.cs:872
static bool downedClown
Denotes whether or not at least one Clown has been killed in the current world. Only used to make th...
Definition NPC.cs:832
static void SpawnOnPlayer(int plr, int Type)
Definition NPC.cs:90808
IEntitySource GetItemSource_Loot()
Definition NPC.cs:107573
static void SetEventFlagCleared(ref bool eventFlag, int gameEventId)
Definition NPC.cs:84437
static bool downedGolemBoss
Denotes whether or not Golem has been defeated at least once in the current world.
Definition NPC.cs:842
static bool LunarApocalypseIsUp
Definition NPC.cs:944
static bool downedChristmasIceQueen
Denotes whether or not at least one Ice Queen has been defeated in the current world.
Definition NPC.cs:867
static bool downedAncientCultist
Denotes whether or not the Lunatic Cultist has been defeated at least once in the current world.
Definition NPC.cs:882
static bool downedBoss3
Denotes whether or not Skeletron has been defeated at least once in the current world.
Definition NPC.cs:801
short releaseOwner
Identifies the player who released this NPC into the world. Used mainly for released critters....
Definition NPC.cs:514
void DoDeathEvents_CelebrateBossDeath(string typeName)
Definition NPC.cs:84627
IEntitySource GetSpawnSource_ForProjectile()
Definition NPC.cs:107558
static bool downedPlantBoss
Denotes whether or not Plantera has been defeated at least once in the current world.
Definition NPC.cs:837
static bool TowerActiveNebula
Definition NPC.cs:940
static bool downedMechBoss1
Denotes whether or not the Destroyer has been defeated at least once in the current world.
Definition NPC.cs:954
static bool downedDeerclops
Denotes whether or not the Deerclops has been defeated at least once in the current world.
Definition NPC.cs:922
int target
Definition NPC.cs:1019
void ViolentlySpawnNerdySlime()
Definition NPC.cs:85193
static bool downedTowerNebula
Denotes whether or not the Nebula Pillar has been defeated at least once in the current world.
Definition NPC.cs:902
static bool downedQueenSlime
Denotes whether or not Queen Slime has been defeated at least once in the current world.
Definition NPC.cs:917

References Terraria.GameContent.Events.DD2Event.AnnounceGoblinDeath(), Terraria.NPC.AnyInteractions(), Terraria.NPC.AnyNPCs(), Terraria.Main.AnyPlayerReadyToFightKingSlime(), Terraria.NPC.boss, Terraria.Chat.ChatHelper.BroadcastChatMessage(), Terraria.NPC.CreateBrickBoxForWallOfFlesh(), Terraria.NPC.DoDeathEvents_AdvanceSlimeRain(), Terraria.NPC.DoDeathEvents_CelebrateBossDeath(), Terraria.NPC.DoDeathEvents_DropBossPotionsAndHearts(), Terraria.NPC.DoDeathEvents_SummonDungeonSpirit(), Terraria.NPC.downedAncientCultist, Terraria.NPC.downedBoss1, Terraria.NPC.downedBoss2, Terraria.NPC.downedBoss3, Terraria.NPC.downedChristmasIceQueen, Terraria.NPC.downedChristmasSantank, Terraria.NPC.downedChristmasTree, Terraria.NPC.downedClown, Terraria.NPC.downedDeerclops, Terraria.NPC.downedEmpressOfLight, Terraria.NPC.downedFishron, Terraria.NPC.downedGolemBoss, Terraria.NPC.downedHalloweenKing, Terraria.NPC.downedHalloweenTree, Terraria.NPC.downedMechBoss1, Terraria.NPC.downedMechBoss2, Terraria.NPC.downedMechBoss3, Terraria.NPC.downedMechBossAny, Terraria.NPC.downedMoonlord, Terraria.NPC.downedPlantBoss, Terraria.NPC.downedQueenBee, Terraria.NPC.downedQueenSlime, Terraria.NPC.downedSlimeKing, Terraria.NPC.downedTowerNebula, Terraria.NPC.downedTowerSolar, Terraria.NPC.downedTowerStardust, Terraria.NPC.downedTowerVortex, Terraria.NPC.FindFirstNPC(), Terraria.Localization.NetworkText.FromKey(), Terraria.NPC.GetItemSource_Loot(), Terraria.NPC.GetSpawnSource_ForProjectile(), Terraria.NPC.GetWereThereAnyInteractions(), Terraria.Main.hardMode, Terraria.Entity.height, Terraria.Collision.LavaCollision(), Terraria.NPC.LunarApocalypseIsUp, Terraria.WorldGen.MessageLunarApocalypse(), Terraria.Lang.misc, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Projectile.NewProjectile(), Terraria.Main.NewText(), Terraria.GameContent.Achievements.AchievementsHelper.NotifyProgressionEvent(), Terraria.GameContent.Events.DD2Event.Ongoing, Terraria.Entity.position, Terraria.Main.pumpkinMoon, Terraria.Main.rand, Terraria.NPC.releaseOwner, Terraria.Main.remixWorld, Terraria.NetMessage.SendData(), Terraria.NPC.SetEventFlagCleared(), Terraria.NPC.ShieldStrengthTowerNebula, Terraria.NPC.ShieldStrengthTowerSolar, Terraria.NPC.ShieldStrengthTowerStardust, Terraria.NPC.ShieldStrengthTowerVortex, Terraria.GameContent.Events.DD2Event.ShouldDropCrystals(), Terraria.Main.slimeRain, Terraria.Main.snowMoon, Terraria.NPC.SpawnBoss(), Terraria.NPC.SpawnedFromStatue, Terraria.NPC.SpawnOnPlayer(), Terraria.NPC.SpawnWOF(), Terraria.WorldGen.StartHardmode(), Terraria.Main.StopSlimeRain(), Terraria.NPC.target, Terraria.NPC.TowerActiveNebula, Terraria.NPC.TowerActiveSolar, Terraria.NPC.TowerActiveStardust, Terraria.NPC.TowerActiveVortex, Terraria.WorldGen.TriggerLunarApocalypse(), Terraria.NPC.type, Terraria.NPC.TypeName, Terraria.NPC.unlockedSlimeBlueSpawn, Terraria.WorldGen.UpdateLunarApocalypse(), Terraria.NPC.ViolentlySpawnNerdySlime(), and Terraria.Entity.width.

Referenced by Terraria.NPC.NPCLoot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: