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

◆ DoDeathEvents()

void Terraria.NPC.DoDeathEvents ( Player closestPlayer)
inlineprivate

Definition at line 71463 of file NPC.cs.

71464 {
71467 if (Main.remixWorld && !downedSlimeKing && AnyInteractions() && Main.AnyPlayerReadyToFightKingSlime() && type == 1 && !AnyNPCs(50) && Main.rand.Next(200) == 0)
71468 {
71469 SpawnOnPlayer(closestPlayer.whoAmI, 50);
71470 }
71471 switch (type)
71472 {
71473 case 216:
71474 SpawnBoss((int)position.X, (int)position.Y, 662, target);
71475 break;
71476 case 327:
71477 if (Main.pumpkinMoon)
71478 {
71480 }
71481 break;
71482 case 325:
71483 if (Main.pumpkinMoon)
71484 {
71486 }
71487 break;
71488 case 344:
71489 if (Main.snowMoon)
71490 {
71492 }
71493 break;
71494 case 345:
71495 if (Main.snowMoon)
71496 {
71498 }
71499 break;
71500 case 346:
71501 if (Main.snowMoon)
71502 {
71504 }
71505 break;
71506 case 552:
71507 case 553:
71508 case 554:
71509 if (DD2Event.Ongoing)
71510 {
71513 {
71514 Item.NewItem(GetItemSource_Loot(), position, base.Size, 3822);
71515 }
71516 }
71517 break;
71518 case 555:
71519 case 556:
71520 case 557:
71521 case 558:
71522 case 559:
71523 case 560:
71524 case 561:
71525 case 562:
71526 case 563:
71527 case 564:
71528 case 565:
71529 case 568:
71530 case 569:
71531 case 570:
71532 case 571:
71533 case 572:
71534 case 573:
71535 case 574:
71536 case 575:
71537 case 576:
71538 case 577:
71539 case 578:
71541 {
71542 Item.NewItem(GetItemSource_Loot(), position, base.Size, 3822);
71543 }
71544 break;
71545 case 412:
71546 case 413:
71547 case 414:
71548 case 415:
71549 case 416:
71550 case 417:
71551 case 418:
71552 case 419:
71553 case 518:
71555 {
71556 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 629, 0, 0f, Main.myPlayer, FindFirstNPC(517));
71557 }
71558 break;
71559 case 425:
71560 case 426:
71561 case 427:
71562 case 429:
71564 {
71565 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 629, 0, 0f, Main.myPlayer, FindFirstNPC(422));
71566 }
71567 break;
71568 case 420:
71569 case 421:
71570 case 423:
71571 case 424:
71573 {
71574 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 629, 0, 0f, Main.myPlayer, FindFirstNPC(507));
71575 }
71576 break;
71577 case 402:
71578 case 405:
71579 case 407:
71580 case 409:
71581 case 411:
71583 {
71584 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 629, 0, 0f, Main.myPlayer, FindFirstNPC(493));
71585 }
71586 break;
71587 case 517:
71588 downedTowerSolar = true;
71589 TowerActiveSolar = false;
71590 WorldGen.UpdateLunarApocalypse();
71591 WorldGen.MessageLunarApocalypse();
71592 break;
71593 case 422:
71594 downedTowerVortex = true;
71595 TowerActiveVortex = false;
71596 WorldGen.UpdateLunarApocalypse();
71597 WorldGen.MessageLunarApocalypse();
71598 break;
71599 case 507:
71600 downedTowerNebula = true;
71601 TowerActiveNebula = false;
71602 WorldGen.UpdateLunarApocalypse();
71603 WorldGen.MessageLunarApocalypse();
71604 break;
71605 case 493:
71606 downedTowerStardust = true;
71607 TowerActiveStardust = false;
71608 WorldGen.UpdateLunarApocalypse();
71609 WorldGen.MessageLunarApocalypse();
71610 break;
71611 case 245:
71613 break;
71614 case 370:
71616 break;
71617 case 636:
71619 break;
71620 case 668:
71622 break;
71623 case 657:
71625 break;
71626 case 22:
71627 if (Collision.LavaCollision(position, width, height))
71628 {
71630 }
71631 break;
71632 case 614:
71633 {
71634 int num2 = 175;
71636 {
71637 num2 = 0;
71638 }
71639 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center.X, base.Center.Y, 0f, 0f, 281, num2, 0f, Main.myPlayer, -2f, releaseOwner + 1);
71640 break;
71641 }
71642 case 109:
71643 if (!downedClown)
71644 {
71645 downedClown = true;
71646 if (Main.netMode == 2)
71647 {
71648 NetMessage.SendData(7);
71649 }
71650 }
71651 break;
71652 case 222:
71654 if (Main.netMode == 2)
71655 {
71656 NetMessage.SendData(7);
71657 }
71658 break;
71659 case 439:
71661 WorldGen.TriggerLunarApocalypse();
71662 break;
71663 case 398:
71665 LunarApocalypseIsUp = false;
71666 break;
71667 case 50:
71668 if (Main.slimeRain)
71669 {
71670 Main.StopSlimeRain();
71672 }
71673 if (Main.netMode != 1 && !unlockedSlimeBlueSpawn)
71674 {
71677 }
71679 if (Main.netMode == 2)
71680 {
71681 NetMessage.SendData(7);
71682 }
71683 break;
71684 case 125:
71685 case 126:
71686 if (boss)
71687 {
71689 downedMechBossAny = true;
71690 }
71691 break;
71692 case 262:
71693 {
71694 bool num3 = downedPlantBoss;
71696 if (!num3)
71697 {
71698 if (Main.netMode == 0)
71699 {
71700 Main.NewText(Lang.misc[33].Value, 50, byte.MaxValue, 130);
71701 }
71702 else if (Main.netMode == 2)
71703 {
71704 ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[33].Key), new Color(50, 255, 130));
71705 }
71706 }
71707 break;
71708 }
71709 case 4:
71711 break;
71712 case 13:
71713 case 14:
71714 case 15:
71715 case 266:
71716 if (boss)
71717 {
71718 if (!downedBoss2 || Main.rand.Next(2) == 0)
71719 {
71720 WorldGen.spawnMeteor = true;
71721 }
71723 }
71724 break;
71725 case 35:
71726 if (boss)
71727 {
71729 }
71730 break;
71731 case 127:
71732 if (boss)
71733 {
71735 downedMechBossAny = true;
71736 }
71737 break;
71738 case 134:
71739 if (boss)
71740 {
71742 downedMechBossAny = true;
71743 }
71744 break;
71745 case 113:
71746 {
71747 if (Main.netMode == 1)
71748 {
71749 break;
71750 }
71752 bool eventFlag = Main.hardMode;
71753 WorldGen.StartHardmode();
71755 {
71756 if (Main.netMode == 0)
71757 {
71758 Main.NewText(Lang.misc[32].Value, 50, byte.MaxValue, 130);
71759 }
71760 else if (Main.netMode == 2)
71761 {
71762 ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, 255, 130));
71763 }
71764 }
71766 break;
71767 }
71768 case 661:
71769 if (Main.netMode != 1 && GetWereThereAnyInteractions())
71770 {
71771 int num = 636;
71772 if (!AnyNPCs(num))
71773 {
71774 Vector2 vector = base.Center + new Vector2(0f, -200f) + Main.rand.NextVector2Circular(50f, 50f);
71775 SpawnBoss((int)vector.X, (int)vector.Y, num, closestPlayer.whoAmI);
71776 }
71777 }
71778 break;
71779 }
71780 if (boss)
71781 {
71784 if (Main.netMode == 2)
71785 {
71786 NetMessage.SendData(7);
71787 }
71788 }
71789 }
static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer=-1)
Definition ChatHelper.cs:46
Vector2 position
Definition Entity.cs:14
static void AnnounceGoblinDeath(NPC n)
Definition DD2Event.cs:678
static NetworkText FromKey(string key, params object[] substitutions)
bool boss
Definition NPC.cs:515
static bool downedChristmasSantank
Definition NPC.cs:379
static bool downedTowerSolar
Definition NPC.cs:385
static bool downedTowerVortex
Definition NPC.cs:387
static bool downedMechBoss2
Definition NPC.cs:425
static bool downedFishron
Definition NPC.cs:369
static int ShieldStrengthTowerNebula
Definition NPC.cs:403
static void SpawnBoss(int spawnPositionX, int spawnPositionY, int Type, int targetPlayerIndex)
Definition NPC.cs:77584
static bool downedBoss2
Definition NPC.cs:347
static int ShieldStrengthTowerSolar
Definition NPC.cs:399
static bool TowerActiveStardust
Definition NPC.cs:417
static int FindFirstNPC(int Type)
Definition NPC.cs:86701
static bool unlockedSlimeBlueSpawn
Definition NPC.cs:307
static bool downedMechBossAny
Definition NPC.cs:421
static bool downedEmpressOfLight
Definition NPC.cs:393
static void SpawnWOF(Vector2 pos)
Definition NPC.cs:77086
static bool downedHalloweenKing
Definition NPC.cs:373
void DoDeathEvents_AdvanceSlimeRain(Player closestPlayer)
Definition NPC.cs:71346
static bool downedBoss1
Definition NPC.cs:345
static bool downedSlimeKing
Definition NPC.cs:353
bool SpawnedFromStatue
Definition NPC.cs:85
static bool TowerActiveVortex
Definition NPC.cs:413
void CreateBrickBoxForWallOfFlesh()
Definition NPC.cs:71302
static bool downedTowerStardust
Definition NPC.cs:391
void DoDeathEvents_SummonDungeonSpirit(Player closestPlayer)
Definition NPC.cs:71330
static bool downedMechBoss3
Definition NPC.cs:427
static int ShieldStrengthTowerStardust
Definition NPC.cs:405
static int ShieldStrengthTowerVortex
Definition NPC.cs:401
static bool downedMoonlord
Definition NPC.cs:383
bool GetWereThereAnyInteractions()
Definition NPC.cs:72060
static bool TowerActiveSolar
Definition NPC.cs:411
static bool AnyNPCs(int Type)
Definition NPC.cs:86689
int type
Definition NPC.cs:445
static bool downedQueenBee
Definition NPC.cs:351
static bool downedHalloweenTree
Definition NPC.cs:371
bool AnyInteractions()
Definition NPC.cs:71041
static bool downedChristmasTree
Definition NPC.cs:377
void DoDeathEvents_CelebrateBossDeath()
Definition NPC.cs:71268
static bool downedClown
Definition NPC.cs:361
static void SpawnOnPlayer(int plr, int Type)
Definition NPC.cs:77311
IEntitySource GetItemSource_Loot()
Definition NPC.cs:87551
static void SetEventFlagCleared(ref bool eventFlag, int gameEventId)
Definition NPC.cs:71077
static bool downedGolemBoss
Definition NPC.cs:365
static bool LunarApocalypseIsUp
Definition NPC.cs:419
static bool downedChristmasIceQueen
Definition NPC.cs:375
static bool downedAncientCultist
Definition NPC.cs:381
static bool downedBoss3
Definition NPC.cs:349
void DoDeathEvents_DropBossPotionsAndHearts()
Definition NPC.cs:71195
short releaseOwner
Definition NPC.cs:107
IEntitySource GetSpawnSource_ForProjectile()
Definition NPC.cs:87526
static bool downedPlantBoss
Definition NPC.cs:363
static bool TowerActiveNebula
Definition NPC.cs:415
static bool downedMechBoss1
Definition NPC.cs:423
static bool downedDeerclops
Definition NPC.cs:397
int target
Definition NPC.cs:459
void ViolentlySpawnNerdySlime()
Definition NPC.cs:71791
static bool downedTowerNebula
Definition NPC.cs:389
static bool downedQueenSlime
Definition NPC.cs:395

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.unlockedSlimeBlueSpawn, Terraria.WorldGen.UpdateLunarApocalypse(), Microsoft.Xna.Framework.Graphics.Vector2, Terraria.NPC.ViolentlySpawnNerdySlime(), Terraria.Entity.width, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.

Referenced by Terraria.NPC.NPCLoot().