11591 {
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11865 {
11867 }
11869 {
11871 }
11873 {
11874 return;
11875 }
11878 {
11880 return;
11881 }
11883 {
11886 {
11888 }
11889 }
11890 if (
owner == Main.myPlayer)
11891 {
11894 {
11896 }
11898 {
11900 }
11902 {
11904 }
11906 {
11908 }
11910 {
11912 }
11914 {
11915 num = 0.1f + ((Vector2)(
ref Main.player[
owner].velocity)).Length() / 7
f * 0.9f;
11916 }
11918 {
11920 switch ((
int)
ai[1])
11921 {
11922 case 0:
11924 break;
11925 case 1:
11927 break;
11928 case 2:
11930 break;
11931 case 3:
11933 break;
11934 case 4:
11936 break;
11937 case 5:
11939 break;
11940 case 6:
11942 break;
11943 case 7:
11945 break;
11946 case 8:
11948 break;
11949 case 9:
11951 break;
11952 case 10:
11954 break;
11955 case 11:
11957 break;
11958 case 12:
11960 break;
11961 case 13:
11963 break;
11964 case 14:
11966 break;
11967 case 15:
11969 break;
11970 case 16:
11972 break;
11973 case 17:
11975 break;
11976 case 18:
11978 break;
11979 case 19:
11981 break;
11982 case 20:
11984 break;
11985 case 21:
11987 break;
11988 case 22:
11990 break;
11991 case 23:
11993 break;
11994 }
11995 }
11997 {
11999 }
12004 {
12007 {
12009 if (projectile != null)
12010 {
12011 array = projectile.localNPCImmunity;
12012 }
12013 }
12015 Vector2
vector3 =
default(Vector2);
12016 for (
int i = 0; i < 200 &&
flag23; i++)
12017 {
12018 if (!Main.npc[i].active)
12019 {
12020 continue;
12021 }
12023 if (
flag12 && !Main.player[
owner].CanHitNPCWithMeleeHit(i))
12024 {
12026 }
12027 if (!((!Main.npc[i].dontTakeDamage ||
NPCID.
Sets.
ZappingJellyfish[Main.npc[i].type]) &&
flag24) || (Main.npc[i].aiStyle == 112 && Main.npc[i].ai[2] > 1
f))
12028 {
12029 continue;
12030 }
12034 {
12035 if (!
flag29.GetValueOrDefault())
12036 {
12037 continue;
12038 }
12040 }
12042 obj.position += Main.npc[i].netOffset;
12043 bool flag25 = !Main.npc[i].friendly;
12045 flag25 |= Main.npc[i].type == 22 &&
owner < 255 && Main.player[
owner].killGuide;
12046 flag25 |= Main.npc[i].type == 54 &&
owner < 255 && Main.player[
owner].killClothier;
12047 if (
owner < 255 && !Main.player[
owner].CanNPCBeHitByPlayerOrPlayerProjectile(Main.npc[i],
this))
12048 {
12050 }
12051 bool flag26 = Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles;
12053 {
12056 {
12058 }
12060 {
12062 if (
type == 11 && (Main.npc[i].type == 47 || Main.npc[i].type == 57))
12063 {
12065 }
12066 else if (
type == 31 && Main.npc[i].type == 69)
12067 {
12069 }
12070 else if (Main.npc[i].trapImmune &&
trap)
12071 {
12073 }
12074 else if (Main.npc[i].immortal &&
npcProj)
12075 {
12077 }
12079 {
12081 }
12083 {
12084 bool flag2 =
false;
12085 if (Main.npc[i].type == 414)
12086 {
12087 Rectangle
rect = Main.npc[i].getRect();
12091 rect.Width +=
num11 * 2;
12092 rect.Height +=
num11 * 2;
12094 }
12095 else
12096 {
12098 }
12100 {
12103 {
12105 {
12106 Main.player[
owner].TakeDamageFromJellyfish(i);
12107 }
12109 {
12110 continue;
12111 }
12112 }
12114 {
12116 if (Main.rand.Next(20) == 0)
12117 {
12119 position.X += Main.rand.Next(-256, 257);
12120 }
12121 if (Main.rand.Next(20) == 0)
12122 {
12124 position.Y += Main.rand.Next(-256, 257);
12125 }
12126 if (Main.rand.Next(2) == 0)
12127 {
12129 }
12130 if (Main.rand.Next(3) != 0)
12131 {
12135 {
12139 {
12141 }
12142 }
12143 }
12145 if (Main.rand.Next(7) == 0)
12146 {
12147 velocity.X += (float)Main.rand.Next(30, 31) * 0.01f;
12148 }
12149 if (Main.rand.Next(7) == 0)
12150 {
12151 velocity.Y += (float)Main.rand.Next(30, 31) * 0.01f;
12152 }
12155 if (Main.rand.Next(20) == 0)
12156 {
12158 }
12159 if (Main.rand.Next(50) == 0)
12160 {
12162 }
12163 if (Main.rand.Next(7) == 0)
12164 {
12166 position.X += Main.rand.Next(-64, 65);
12168 {
12170 }
12171 }
12172 if (Main.rand.Next(7) == 0)
12173 {
12175 position.Y += Main.rand.Next(-64, 65);
12177 {
12179 }
12180 }
12181 if (Main.rand.Next(14) == 0)
12182 {
12184 }
12185 if (Main.rand.Next(14) == 0)
12186 {
12188 }
12189 if (Main.rand.Next(10) == 0)
12190 {
12191 velocity *= (float)Main.rand.Next(1, 201) * 0.0005f;
12192 }
12194 {
12196 }
12197 else
12198 {
12200 }
12202 }
12203 bool flag3 =
nPC.reflectsProjectiles;
12205 {
12207 }
12209 {
12210 nPC.ReflectProjectile(
this);
12212 obj2.position -= Main.npc[i].netOffset;
12213 return;
12214 }
12216 {
12218 }
12223 bool flag4 =
false;
12224 int num32 = (int)Main.player[
owner].armorPenetration;
12226 bool flag5 =
false;
12228 {
12229 case 442:
12231 break;
12232 case 410:
12233 if (Main.remixWorld)
12234 {
12236 }
12237 break;
12238 case 864:
12240 break;
12241 case 916:
12243 break;
12244 case 917:
12246 break;
12247 case 595:
12249 break;
12250 case 493:
12251 case 494:
12253 break;
12254 case 150:
12255 case 151:
12256 case 152:
12258 break;
12259 case 189:
12261 if (
flag && Main.player[
owner].strongBees)
12262 {
12263 modifiers.ArmorPenetration += 5
f;
12264 }
12265 break;
12266 case 723:
12267 case 724:
12268 case 725:
12269 case 726:
12271 break;
12272 case 532:
12274 break;
12275 case 964:
12277 break;
12278 case 969:
12280 break;
12281 case 85:
12283 break;
12284 case 877:
12285 case 878:
12286 case 879:
12287 num21 *= ((Vector2)(
ref Main.player[
owner].velocity)).Length() / 7
f;
12288 break;
12289 case 963:
12291 break;
12292 case 976:
12294 break;
12295 case 974:
12297 break;
12298 case 977:
12300 break;
12301 }
12303 {
12305 return;
12306 }
12307 modifiers.SourceDamage *=
num;
12311 {
12312 float value = (
scale - 1
f) * 100
f;
12313 value = Utils.Clamp(value, 0
f, 50
f);
12315 }
12317 {
12318 int num47 =
Math.Max(0, Main.player[
owner].ownedProjectileCounts[831] - 1);
12320 }
12322 {
12323 int num48 =
Math.Max(0, Main.player[
owner].ownedProjectileCounts[831] - 1);
12325 }
12327 {
12328 int num49 =
Math.Max(0, Main.player[
owner].ownedProjectileCounts[970] - 1);
12331 {
12332 return;
12333 }
12334 float num3 = 0.55f;
12335 if (Main.hardMode)
12336 {
12338 }
12340 }
12342 {
12343 modifiers.SourceDamage.Base += 5
f;
12344 }
12346 {
12348 {
12350 }
12351 if ((uint)(
type - 688) <= 2
u)
12352 {
12353 if (Main.player[
owner].setMonkT3)
12354 {
12355 if (Main.rand.Next(4) == 0)
12356 {
12358 }
12359 }
12360 else if (Main.player[
owner].setMonkT2 && Main.rand.Next(6) == 0)
12361 {
12363 }
12364 }
12365 }
12366 modifiers.SourceDamage *=
num43 / 1000
f;
12370 {
12371 bool flag6 =
false;
12372 bool flag7 =
false;
12373 bool flag8 =
false;
12374 bool flag9 =
false;
12380 for (
int j = 0;
j <
NPC.maxBuffs;
j++)
12381 {
12382 if (
nPC.buffTime[
j] >= 1)
12383 {
12384 switch (
nPC.buffType[
j])
12385 {
12386 case 307:
12388 break;
12389 case 309:
12391 break;
12392 case 313:
12394 break;
12395 case 310:
12397 break;
12398 case 315:
12400 break;
12401 case 326:
12403 break;
12404 case 319:
12406 break;
12407 case 316:
12409 break;
12410 case 340:
12412 break;
12413 }
12414 }
12415 }
12417 {
12419 }
12421 {
12423 }
12425 {
12427 }
12429 {
12431 }
12433 {
12435 }
12437 {
12439 if (Main.rand.Next(100) < 12)
12440 {
12442 }
12443 }
12445 {
12449 Main.projectile[
num6].localNPCImmunity[i] = -1;
12451 }
12453 {
12456 if (Main.rand.Next(10) == 0)
12457 {
12459 }
12461 {
12462 PositionInWorld = base.Center
12463 });
12464 }
12466 {
12467 nPC.RequestBuffRemoval(313);
12470 Main.projectile[
num9].localNPCImmunity[i] = -1;
12471 modifiers.ScalingBonusDamage += 1.75f *
num4;
12472 }
12473 }
12475 modifiers.FlatBonusDamage += (float)
num46;
12477 {
12478 _ = Main.player[
owner].luck;
12479 }
12482 {
12484 }
12486 {
12488 }
12489 if (
type == 482 && (
nPC.aiStyle == 6 ||
nPC.aiStyle == 37))
12490 {
12492 }
12494 {
12500 {
12501 case 972:
12503 break;
12504 case 973:
12506 break;
12507 case 984:
12508 case 985:
12509 settings.MovementVector =
velocity;
12511 break;
12512 case 982:
12514 break;
12515 case 983:
12517 break;
12518 }
12519 }
12521 {
12524 }
12525 if ((
type == 400 ||
type == 401 ||
type == 402) &&
nPC.type >= 13 &&
nPC.type <= 15)
12526 {
12529 {
12531 }
12532 }
12534 {
12536 }
12538 {
12541 }
12543 {
12545 {
12547 {
12549 }
12553 }
12555 }
12556 else if (
type == 951)
12557 {
12558 Vector2
vector2 = (nPC.Center -
base.Center).SafeNormalize(Vector2.Zero);
12559 vector2.X += (-0.5f + Main.rand.NextFloat()) * 13
f;
12564 }
12565 else if (
type == 582 ||
type == 902)
12566 {
12568 {
12570 }
12571 }
12573 {
12575 }
12576 else if (
type == 624)
12577 {
12579 if (
nPC.knockBackResist > 0
f)
12580 {
12582 }
12585 if (
nPC.Center.X <
base.Center.X)
12586 {
12588 }
12589 else
12590 {
12592 }
12593 }
12595 {
12597 {
12599 }
12600 if (
nPC.position.X + (
float)(nPC.width / 2) <
position.X + (
float)(
width / 2))
12601 {
12603 }
12604 else
12605 {
12607 }
12608 }
12610 {
12612 {
12614 }
12615 if (
nPC.position.X + (
float)(nPC.width / 2) <
position.X + (
float)(
width / 2))
12616 {
12618 }
12619 else
12620 {
12622 }
12623 }
12625 {
12626 if (
nPC.position.X + (
float)(nPC.width / 2) <
position.X + (
float)(
width / 2))
12627 {
12629 }
12630 else
12631 {
12633 }
12634 }
12635 else if (
type == 908)
12636 {
12637 if (
nPC.position.X + (
float)(nPC.width / 2) <
position.X + (
float)(
width / 2))
12638 {
12640 }
12641 else
12642 {
12644 }
12645 }
12647 {
12648 int num14 = Main.rand.Next(2, 6);
12650 {
12651 ((Vector2)(
ref vector3)).
_002Ector((
float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
12654 vector3 *= (float)Main.rand.Next(35, 81) * 0.1f;
12657 }
12658 }
12660 {
12661 float x = Main.player[
owner].Center.X;
12662 if (
nPC.Center.X < x)
12663 {
12665 }
12666 else
12667 {
12669 }
12670 }
12672 {
12677 }
12679 {
12682 }
12684 {
12686 }
12688 {
12691 }
12692 if ((
type == 688 ||
type == 689 ||
type == 690) && nPC.type != 68 && nPC.defense < 999)
12693 {
12695 }
12697 {
12699 {
12702 }
12704 {
12706 }
12707 else
12708 {
12710 }
12711 }
12713 {
12715 }
12717 {
12719 if (
nPC.Center.X < Main.player[
owner].Center.X)
12720 {
12722 }
12723 else
12724 {
12726 }
12728 {
12737 {
12740 }
12741 }
12742 }
12744 {
12746 }
12748 {
12750 {
12752 int num17 = -i - 1;
12755 }
12756 num10 = ((
ai[0] != 2
f) ? ((
int)((double)
num10 * 0.15)) : ((int)((double)
num10 * 1.35)));
12757 }
12759 {
12760 int num18 = Item.NPCtoBanner(
nPC.BannerID());
12762 {
12763 Main.player[Main.myPlayer].lastCreatureHit =
num18;
12764 }
12765 }
12766 if (Main.netMode != 2 &&
flag)
12767 {
12769 }
12770 if (Main.expertMode)
12771 {
12773 {
12775 }
12776 if (
type == 280 && ((
nPC.type >= 134 &&
nPC.type <= 136) ||
nPC.type == 139))
12777 {
12779 }
12780 }
12782 {
12784 }
12786 {
12794 }
12795 if (
type == 323 && (
nPC.type == 159 ||
nPC.type == 158))
12796 {
12798 }
12799 if (
type == 981 &&
nPC.type == 104)
12800 {
12802 }
12804 {
12805 modifiers.SourceDamage /= 2
f;
12807 }
12809 {
12810 modifiers.ScalingBonusDamage += 4
f;
12811 Main.player[
owner].parryDamageBuff =
false;
12812 Main.player[
owner].ClearBuff(198);
12813 }
12816 {
12817 case 697:
12818 case 699:
12819 case 707:
12820 case 708:
12821 case 759:
12822 num26 = ((Main.player[
owner].Center.X <
nPC.Center.X) ? 1 : (-1));
12823 break;
12824 }
12826 {
12827 num26 = ((Main.player[
owner].Center.X <
nPC.Center.X) ? 1 : (-1));
12828 }
12830 {
12831 num26 = ((Main.player[
owner].Center.X <
nPC.Center.X) ? 1 : (-1));
12833 {
12835 }
12837 {
12839 }
12840 }
12843 modifiers.TargetDamageMultiplier *=
num10 / 1000
f;
12844 if (
num26.HasValue)
12845 {
12846 modifiers.HitDirectionOverride =
num26;
12847 }
12851 {
12853 }
12855 {
12857 }
12859 {
12861 }
12863 {
12865 }
12867 {
12869 }
12871 {
12873 }
12875 {
12877 }
12879 {
12881 }
12883 {
12885 }
12887 {
12889 }
12891 {
12893 }
12895 {
12897 }
12899 {
12901 }
12903 {
12905 }
12907 {
12909 }
12911 {
12913 }
12915 {
12917 }
12919 {
12921 }
12923 {
12925 }
12927 {
12929 }
12931 {
12933 }
12935 {
12937 }
12939 {
12941 }
12943 {
12945 }
12947 {
12949 }
12951 {
12953 }
12955 {
12956 int[]
array2 =
new int[10];
12960 for (
int l = 0;
l < 200;
l++)
12961 {
12962 if (
l == i || !Main.npc[
l].CanBeChasedBy(
this))
12963 {
12964 continue;
12965 }
12966 Vector2
val = base.Center - Main.npc[
l].Center;
12969 {
12973 {
12974 break;
12975 }
12976 }
12977 }
12979 {
12986 }
12987 }
12990 {
12992 }
12994 {
12996 }
12998 {
13001 }
13005 {
13007 }
13008 if (
flag && Main.player[
owner].accDreamCatcher && !
nPC.HideStrikeDamage)
13009 {
13011 }
13016 {
13017 nPC.ReflectProjectile(
this);
13019 }
13021 {
13023 {
13025 }
13027 {
13031 }
13032 if ((
flag18 ||
nPC.value > 0
f) && Main.player[
owner].hasLuckyCoin && Main.rand.Next(5) == 0)
13033 {
13035 if (Main.rand.Next(10) == 0)
13036 {
13038 }
13039 if (Main.rand.Next(100) == 0)
13040 {
13042 }
13044 Main.item[
num29].stack = Main.rand.Next(1, 11);
13045 Main.item[
num29].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
13046 Main.item[
num29].velocity.X = (float)Main.rand.Next(10, 31) * 0.2f * (float)
num26.Value;
13047 Main.item[
num29].timeLeftInWhichTheItemCannotBeTakenByEnemies = 60;
13048 if (Main.netMode == 1)
13049 {
13050 NetMessage.SendData(148, -1, -1,
null,
num29);
13051 }
13052 }
13053 if (
type == 999 &&
owner == Main.myPlayer && Main.rand.Next(3) == 0)
13054 {
13056 Vector2
vector7 = (base.Center -
nPC.Center).SafeNormalize(Vector2.Zero) * 0.25f;
13060 Main.projectile[
num30].melee =
true;
13061 }
13063 {
13064 if (
type == 304 && !Main.player[
owner].moonLeech)
13065 {
13067 }
13069 {
13070 if (Main.player[
owner].ghostHeal && !Main.player[
owner].moonLeech)
13071 {
13073 }
13074 if (Main.player[
owner].ghostHurt)
13075 {
13077 }
13078 if (
magic && Main.player[
owner].setNebula && Main.player[
owner].nebulaCD == 0 && Main.rand.Next(3) == 0)
13079 {
13080 Main.player[
owner].nebulaCD = 30;
13081 int num31 = Utils.SelectRandom<
int>(Main.rand, 3453, 3454, 3455);
13083 Main.item[
num33].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
13084 Main.item[
num33].velocity.X = (float)Main.rand.Next(10, 31) * 0.2f * (float)
num26.Value;
13085 if (Main.netMode == 1)
13086 {
13087 NetMessage.SendData(21, -1, -1,
null,
num33);
13088 }
13089 }
13090 }
13092 {
13093 if (Main.player[
owner].beetleOrbs == 0)
13094 {
13095 Main.player[
owner].beetleCounter +=
num27 * 3;
13096 }
13097 else if (Main.player[
owner].beetleOrbs == 1)
13098 {
13099 Main.player[
owner].beetleCounter +=
num27 * 2;
13100 }
13101 else
13102 {
13104 }
13105 Main.player[
owner].beetleCountdown = 0;
13106 }
13107 if (
arrow &&
type != 631 && Main.player[
owner].phantasmTime > 0)
13108 {
13109 Vector2 source = Main.player[
owner].position + Main.player[
owner].Size * Utils.RandomVector2(Main.rand, 0
f, 1
f);
13110 Vector2
vector8 =
nPC.DirectionFrom(source) * 6
f;
13113 NewProjectile(
GetProjectileSource_FromThis(), source.X, source.Y,
vector8.X,
vector8.Y, 631,
num34, 0
f,
owner, i, 15
f);
13114 NewProjectile(
GetProjectileSource_FromThis(), source.X, source.Y,
vector8.X,
vector8.Y, 631,
num34, 0
f,
owner, i, 30
f);
13115 }
13118 {
13119 case 914:
13121 break;
13122 case 847:
13124 break;
13125 case 849:
13127 break;
13128 case 912:
13129 {
13132 {
13134 player2.coolWhipBuff = true;
13135 }
13137 break;
13138 }
13139 }
13140 }
13141 }
13143 {
13145 }
13147 {
13149 }
13150 if (Main.netMode != 0)
13151 {
13153 }
13155 {
13157 }
13159 {
13161 }
13163 {
13165 {
13168 }
13169 }
13170 else if (
type == 434)
13171 {
13173 }
13175 {
13178 {
13180 }
13182 {
13184 }
13186 }
13187 else if (
type == 632)
13188 {
13190 }
13191 else if (
type == 514)
13192 {
13194 }
13195 else if (
type == 611)
13196 {
13198 {
13199 NewProjectile(
GetProjectileSource_FromThis(),
nPC.Center.X,
nPC.Center.Y, 0
f, 0
f, 612,
damage, 10
f,
owner, 0
f, 0.85f + Main.rand.NextFloat() * 1.15f);
13200 }
13202 }
13203 else if (
type == 595 ||
type == 735)
13204 {
13206 }
13207 else if (
type == 927)
13208 {
13210 }
13211 else if (
type == 286)
13212 {
13214 }
13215 else if (
type == 443)
13216 {
13218 }
13219 else if (
type >= 424 &&
type <= 426)
13220 {
13222 }
13223 else if (
type == 634 ||
type == 635)
13224 {
13226 }
13227 else if (
type == 659)
13228 {
13230 }
13231 else if (
type == 246)
13232 {
13234 }
13235 else if (
type == 249)
13236 {
13238 }
13239 else if (
type == 16)
13240 {
13242 }
13243 else if (
type == 409)
13244 {
13246 }
13247 else if (
type == 311)
13248 {
13250 }
13251 else if (
type == 582 ||
type == 902)
13252 {
13255 {
13258 }
13259 }
13260 else
13261 {
13263 {
13265 {
13267 }
13268 else
13269 {
13271 }
13275 obj3.position -= Main.npc[i].netOffset;
13276 break;
13277 }
13279 {
13280 array[i] = 10;
13283 {
13287 }
13288 }
13289 else if (
type == 661 ||
type == 856)
13290 {
13291 array[i] = 8;
13293 }
13294 else if (
type == 866)
13295 {
13296 array[i] = -1;
13300 {
13306 obj4.position -= Main.npc[i].netOffset;
13307 break;
13308 }
13309 if (
owner == Main.myPlayer)
13310 {
13315 {
13317 }
13319 {
13321 }
13322 }
13323 }
13325 {
13328 }
13330 {
13332 }
13333 }
13335 {
13337 }
13340 {
13342 {
13344 }
13347 {
13349 obj5.position -= Main.npc[i].netOffset;
13351 {
13354 }
13356 }
13357 }
13359 {
13363 }
13365 {
13368 }
13370 {
13373 }
13374 else if (
type == 607)
13375 {
13379 }
13381 {
13382 array[i] = -1;
13385 }
13386 else if (
type == 617)
13387 {
13388 array[i] = 8;
13390 }
13391 else if (
type == 656)
13392 {
13393 array[i] = 8;
13396 }
13397 else if (
type == 618)
13398 {
13399 array[i] = 20;
13401 }
13402 else if (
type == 642)
13403 {
13404 array[i] = 10;
13406 }
13407 else if (
type == 857)
13408 {
13409 array[i] = 10;
13411 }
13412 else if (
type == 611 ||
type == 612)
13413 {
13414 array[i] = 6;
13416 }
13417 else if (
type == 645)
13418 {
13419 array[i] = -1;
13422 {
13426 }
13427 }
13430 {
13432 {
13434 }
13435 }
13436 else if (
type == 699)
13437 {
13439 }
13440 else if (
type == 706)
13441 {
13443 }
13444 else if (
type == 728)
13445 {
13447 }
13448 else if (
type == 34)
13449 {
13451 {
13454 }
13455 }
13456 else if (
type == 79)
13457 {
13459 {
13462 }
13464 {
13465 PositionInWorld =
nPC.Center,
13467 });
13468 }
13469 else if (
type == 931)
13470 {
13473 {
13476 }
13477 }
13479 {
13481 {
13482 Main.player[
owner].MinionAttackTargetNPC = i;
13483 }
13484 }
13485 else if (
type == 623)
13486 {
13488 {
13489 PositionInWorld = Vector2.Lerp(
base.Center,
nPC.Hitbox.ClosestPointInRect(
base.Center), 0.5f) +
new Vector2(0
f, Main.rand.NextFloatDirection() * 10
f),
13490 MovementVector =
new Vector2((
float)
direction, Main.rand.NextFloatDirection() * 0.5f) * (3
f + 3
f * Main.rand.NextFloat())
13491 });
13492 }
13494 {
13495 Main.player[
owner].SetMeleeHitCooldown(i, Main.player[
owner].itemAnimation);
13496 }
13497 }
13498 }
13499 }
13500 }
13502 obj6.position -= Main.npc[i].netOffset;
13503 }
13504 }
13505 if (
flag22 && Main.player[Main.myPlayer].hostile)
13506 {
13507 for (
int m = 0;
m < 255;
m++)
13508 {
13510 {
13511 continue;
13512 }
13515 {
13516 continue;
13517 }
13520 {
13522 }
13524 {
13525 continue;
13526 }
13528 {
13530 {
13534 }
13536 }
13538 {
13540 {
13542 }
13544 {
13546 }
13547 else
13548 {
13550 }
13551 }
13553 {
13555 {
13557 }
13559 {
13561 }
13562 else
13563 {
13565 }
13566 }
13569 {
13571 }
13574 {
13576 }
13581 {
13583 }
13587 {
13589 }
13591 {
13593 }
13595 {
13597 }
13598 if (Main.netMode != 0)
13599 {
13601 }
13604 {
13607 {
13608 break;
13609 }
13610 }
13612 {
13616 }
13618 {
13621 }
13623 {
13626 }
13627 }
13628 }
13629 }
13630 if (
type == 10 && Main.netMode != 1)
13631 {
13632 for (
int n = 0;
n < 200;
n++)
13633 {
13636 {
13637 continue;
13638 }
13639 if (
nPC2.type == 534)
13640 {
13642 {
13643 nPC2.Transform(441);
13644 }
13645 }
13646 else
13647 {
13649 {
13650 continue;
13651 }
13652 nPC2.Transform(683);
13653 Vector2
vector9 = nPC2.Center -
new Vector2(20
f);
13655 if (Main.netMode == 2)
13656 {
13657 NetMessage.SendData(106, -1, -1,
null, (
int)
vector9.X,
vector9.Y);
13658 }
13659 if (!
NPC.unlockedSlimeYellowSpawn)
13660 {
13661 NPC.unlockedSlimeYellowSpawn = true;
13662 if (Main.netMode == 2)
13663 {
13664 NetMessage.SendData(7);
13665 }
13666 }
13667 }
13668 }
13669 }
13670 if ((
type == 11 ||
type == 463) && Main.netMode != 1)
13671 {
13672 bool crimson =
type == 463;
13673 Rectangle
value2 =
default(Rectangle);
13675 {
13676 if (Main.npc[
num41].active)
13677 {
13680 {
13681 Main.npc[
num41].AttemptToConvertNPCToEvil(crimson);
13682 }
13683 }
13684 }
13685 }
13686 if (Main.netMode == 2 || !
hostile || Main.myPlayer >= 255 ||
damage <= 0)
13687 {
13688 return;
13689 }
13692 {
13693 case 452:
13694 case 454:
13695 case 455:
13696 case 462:
13698 break;
13699 case 871:
13700 case 872:
13701 case 873:
13702 case 874:
13703 case 919:
13704 case 923:
13705 case 924:
13707 break;
13708 }
13709 int myPlayer = Main.myPlayer;
13710 bool flag21 = Main.player[myPlayer].active && !Main.player[myPlayer].dead && (!Main.player[myPlayer].immune ||
num42 != -1);
13712 {
13713 flag21 =
ai[1] - 1
f == (float)myPlayer;
13714 }
13715 if (Main.getGoodWorld &&
type == 281)
13716 {
13718 }
13720 {
13722 }
13724 {
13725 return;
13726 }
13728 num44 = ((!(Main.player[myPlayer].position.X + (float)(Main.player[myPlayer].width / 2) < position.X + (float)(
width / 2))) ? 1 : (-1));
13729 if (!Main.player[myPlayer].CanParryAgainst(Main.player[myPlayer].Hitbox,
base.Hitbox,
velocity))
13730 {
13733 {
13735 {
13738 }
13739 else
13740 {
13742 }
13743 }
13747 {
13749 }
13751 {
13753 }
13755 {
13756 Main.player[myPlayer].trapDebuffSource = true;
13757 if (Main.player[myPlayer].dead)
13758 {
13760 }
13761 }
13762 }
13764 {
13766 }
13768 {
13770 }
13772 {
13774 }
13776 {
13778 }
13779 }
static PlayerDeathReason ByProjectile(int playerIndex, int projectileIndex)
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Vector2 position
The position of this Entity in world coordinates.
int width
The width of this Entity's hitbox, in pixels.
Vector2 DirectionTo(Vector2 Destination)
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
int height
The height of this Entity's hitbox, in pixels.
static void HandleSpecialEvent(Player player, int eventID)
static void RequestParticleSpawn(bool clientOnly, ParticleOrchestraType type, ParticleOrchestraSettings settings, int? overrideInvokingPlayerIndex=null)
static bool[] CountsAsCritter
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is counted as a critter....
static bool[] ReflectStarShotsInForTheWorthy
If true for a given NPC type (F:Terraria.NPC.type), then that NPC will reflect F:Terraria....
static bool[] BelongsToInvasionOldOnesArmy
If true for a given NPC type (F:Terraria.NPC.type), then that NPC belongs to the Old One's Army event...
static bool[] ZappingJellyfish
If true for a given NPC type (F:Terraria.NPC.type), then that NPC, if currently F:Terraria....
static bool[] ImmediatelyUpdatesNPCBuffFlags
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile will immediate...
static bool[] MinionShot
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile is shot by som...
static bool[] CultistIsResistantTo
Indicates that the Lunatic Cultist takes 75% damage from this projectile. All projectiles in this set...
static bool[] AllowsContactDamageFromJellyfish
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile will zap the p...
static bool[] DontApplyParryDamageBuff
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile won't receive ...
static bool[] IsARocketThatDealsDoubleDamageToPrimaryEnemy
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile will deal doub...
static bool[] IsAMineThatDealsTripleDamageWhenStationary
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile will deal trip...
static float[] SummonTagDamageMultiplier
Used to scale down summon tag damage for fast hitting minions and sentries.
static bool[] StardustDragon
static bool[] IsAWhip
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile will use whip ...
static bool[] IsAGravestone
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile handles player...
static bool[] SentryShot
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile is shot by som...
static readonly short Count
static void ModifyHitNPCWithProj(Projectile projectile, NPC nPC, ref NPC.HitModifiers modifiers)
static bool CanBeHitByProjectile(Player player, Projectile projectile)
static void OnHitNPCWithProj(Projectile projectile, NPC nPC, in NPC.HitInfo hit, int damageDone)
static bool CanHitPvpWithProj(Projectile projectile, Player target)
static ? bool CanHitNPCWithProj(Projectile proj, NPC npc)
virtual bool UseStandardCritCalcs
This lets you decide whether or not your damage class will use standard crit chance calculations....
int CooldownSlot
Determines which (T:Terraria.ID.ImmunityCooldownID) to use when this projectile damages a player....
This class serves as a place for you to place all your properties and hooks for each projectile....
static bool MinionContactDamage(Projectile projectile)
static ? bool CanDamage(Projectile projectile)
This serves as the central class from which projectile-related functions are carried out....
bool sentry
Indicates that this projectile is a sentry Defaults to false. All sentries should set F:Terraria....
bool minion
Indicates that this projectile is a minion Defaults to false.
Projectile FindStardustDragonHeadOfOwner()
int maxPenetrate
How many npc can this projectile hit before dying. (Or tile bounces) Automatically set at the end o...
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
static void KillOldestJavelin(int protectedProjectileIndex, int projectileType, int targetNPCIndex, Point[] bufferForScan)
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla projectile AI styles are enumerated in t...
int damage
This will always be set in Projectile.NewProjectile based on the weapons damage and player stat modif...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
void ghostHeal(int dmg, Vector2 Position, Entity victim)
static Conditions.NotNull _cachedConditions_notNull
int penetrate
The remaining number of npc can this projectile hit before dying. (Or tile bounces)....
int ArmorPenetration
The number of defense points that this projectile can ignore on its own. Cannot be set to negative va...
IEntitySource GetItemSource_OnHit(Entity victim, int itemSourceId)
IEntitySource GetProjectileSource_FromThis()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
bool stopsDealingDamageAfterPenetrateHits
int CountEnemiesWhoAreImmuneToMeRightNow(int cap)
int FindTargetWithLineOfSight(float maxRange=800f)
Finds the closest NPC to this projectile which can be targeted and which it has line of sight to.
static Point[] _javelinsMax8
void BombsHurtPlayers(Rectangle projRectangle, int j)
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
float knockBack
This will always be set in Projectile.NewProjectile based on the weapons knockback and player stat mo...
bool friendly
If True, this projectile will hurt enemies (!F:Terraria.NPC.friendly) Defaults to false.
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
void SummonSuperStarSlash(Vector2 target)
void vampireHeal(int dmg, Vector2 Position, Entity victim)
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...
void TryDoingOnHitEffects(Entity entity)
bool ownerHitCheck
If true, then this projectile will only deal damage if its owner has line of sight to the hit....
bool usesIDStaticNPCImmunity
If true, all projectiles of this type share an immunity cooldown for each npc. Use this rather than ...
static Conditions.IsSolid _cachedConditions_solid
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
void BetsySharpnel(int npcIndex)
static Point[] _javelinsMax6
bool appliesImmunityTimeOnSingleHits
If true, this projectile will apply immunity to an npc despite having a F:Terraria....
static void EmitBlackLightningParticles(NPC targetNPC)
int idStaticNPCHitCooldown
When used in conjunction with F:Terraria.Projectile.usesIDStaticNPCImmunity, determines how many tick...
void ghostHurt(int dmg, Vector2 Position, Entity victim)
bool hostile
If True, this projectile will hurt players and friendly NPCs (F:Terraria.NPC.friendly) Defaults to ...
bool trap
If true, this projectile was spawned by a trap tile.
static Point[] _javelinsMax10
bool npcProj
If true, this projectile was spawned by a friendly Town NPC.
bool CanHitWithMeleeWeapon(Entity ent)
bool usesLocalNPCImmunity
If true, this projectile manages it's own immunity timers for each npc. Use this rather than F:Terra...
static bool IsNPCIndexImmuneToProjectileType(int projectileType, int npcIndex)
int CritChance
The critical strike chance modifier of this projectile. Cannot be set to negative values....
bool Colliding(Rectangle myRect, Rectangle targetRect)
int localNPCHitCooldown
When used in conjunction with F:Terraria.Projectile.usesLocalNPCImmunity, determines how many ticks m...
void LightDisc_Bounce(Vector2 hitPoint, Vector2 normal)
static uint[][] perIDStaticNPCImmunity
float scale
Scales how large the projectile will be drawn. Will also affect the hitbox (F:Terraria....
Rectangle Damage_GetHitbox()
DamageClass DamageType
The damage type assigned to this projectile, represented as a DamageClass. Leave blank or use DamageC...
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
This particular overload uses a Vector2 instead of X and Y to determine the actual spawn position and...
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
static bool Find(Point origin, GenSearch search, out Point result)