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

◆ StatusNPC()

void Terraria.Projectile.StatusNPC ( int i)
inline

Definition at line 9973 of file Projectile.cs.

9974 {
9975 NPC nPC = Main.npc[i];
9976 if ((melee || ProjectileID.Sets.IsAWhip[type]) && Main.player[owner].meleeEnchant > 0 && !noEnchantments)
9977 {
9978 byte meleeEnchant = Main.player[owner].meleeEnchant;
9979 if (meleeEnchant == 1)
9980 {
9981 nPC.AddBuff(70, 60 * Main.rand.Next(5, 10));
9982 }
9983 if (meleeEnchant == 2)
9984 {
9985 nPC.AddBuff(39, 60 * Main.rand.Next(3, 7));
9986 }
9987 if (meleeEnchant == 3)
9988 {
9989 nPC.AddBuff(24, 60 * Main.rand.Next(3, 7));
9990 }
9991 if (meleeEnchant == 5)
9992 {
9993 nPC.AddBuff(69, 60 * Main.rand.Next(10, 20));
9994 }
9995 if (meleeEnchant == 6)
9996 {
9997 nPC.AddBuff(31, 60 * Main.rand.Next(1, 4));
9998 }
9999 if (meleeEnchant == 8)
10000 {
10001 nPC.AddBuff(20, 60 * Main.rand.Next(5, 10));
10002 }
10003 if (meleeEnchant == 4)
10004 {
10005 nPC.AddBuff(72, 120);
10006 }
10007 }
10008 if (type == 195)
10009 {
10010 nPC.AddBuff(70, 60 * Main.rand.Next(5, 11));
10011 }
10012 if (type == 119)
10013 {
10014 nPC.AddBuff(324, 240);
10015 }
10016 if (type == 309)
10017 {
10018 nPC.AddBuff(324, 300);
10019 }
10020 if (type == 359)
10021 {
10022 nPC.AddBuff(324, 420);
10023 }
10024 switch (type)
10025 {
10026 case 841:
10027 nPC.AddBuff(307, 240);
10028 break;
10029 case 952:
10030 nPC.AddBuff(326, 240);
10031 break;
10032 case 847:
10033 nPC.AddBuff(309, 240);
10034 break;
10035 case 849:
10036 nPC.AddBuff(310, 240);
10037 break;
10038 case 913:
10039 if (localAI[0] == 0f)
10040 {
10041 nPC.AddBuff(313, 240);
10042 }
10043 nPC.AddBuff(323, 240);
10044 break;
10045 case 912:
10046 nPC.AddBuff(340, 240);
10047 nPC.AddBuff(324, 240);
10048 break;
10049 case 914:
10050 nPC.AddBuff(315, 240);
10051 if (Main.rand.Next(5) == 0)
10052 {
10053 nPC.AddBuff(20, 180);
10054 }
10055 break;
10056 case 848:
10057 nPC.AddBuff(319, 240);
10058 break;
10059 case 915:
10060 nPC.AddBuff(316, 240);
10061 break;
10062 }
10063 if (type == 664 && Main.rand.Next(3) == 0)
10064 {
10065 nPC.AddBuff(24, 60 * Main.rand.Next(3, 6));
10066 }
10067 if (type == 666 && Main.rand.Next(2) == 0)
10068 {
10069 nPC.AddBuff(323, 60 * Main.rand.Next(3, 9));
10070 }
10071 if (type == 668 && Main.rand.Next(3) != 0)
10072 {
10073 nPC.AddBuff(323, 60 * Main.rand.Next(6, 9));
10074 }
10075 if (type == 567 || type == 568)
10076 {
10077 nPC.AddBuff(20, 60 * Main.rand.Next(5, 11));
10078 }
10079 if (type == 598 && ai[1] == (float)i)
10080 {
10081 nPC.AddBuff(169, 900);
10082 }
10083 if (type == 636 && ai[1] == (float)i)
10084 {
10085 nPC.AddBuff(189, 300);
10086 }
10087 if (type == 971 && ai[1] == (float)i)
10088 {
10089 nPC.AddBuff(337, 540);
10090 }
10091 if (type == 975 && ai[1] == (float)i)
10092 {
10093 nPC.AddBuff(344, 540);
10094 }
10095 if (type == 611)
10096 {
10097 nPC.AddBuff(189, 300);
10098 }
10099 if (type == 612)
10100 {
10101 nPC.AddBuff(189, 300);
10102 }
10103 if (type == 978)
10104 {
10105 nPC.AddBuff(24, 180);
10106 }
10107 if (type == 953)
10108 {
10109 nPC.AddBuff(189, 300);
10110 }
10111 if (type == 711)
10112 {
10113 nPC.AddBuff(203, 600);
10114 }
10115 if (type == 706)
10116 {
10117 nPC.AddBuff(323, 480);
10118 }
10119 if (type == 614 && ai[1] == (float)i)
10120 {
10121 nPC.AddBuff(183, 900);
10122 }
10123 if (type == 585)
10124 {
10125 nPC.AddBuff(153, 60 * Main.rand.Next(5, 11));
10126 }
10127 if (type == 583)
10128 {
10129 nPC.AddBuff(20, 60 * Main.rand.Next(3, 6));
10130 }
10131 if (type == 524)
10132 {
10133 nPC.AddBuff(69, 60 * Main.rand.Next(3, 8));
10134 }
10135 if (type == 954 && Main.rand.Next(2) == 0)
10136 {
10137 int num = 24;
10138 if (Main.remixWorld)
10139 {
10140 num = 323;
10141 }
10142 if (Main.rand.Next(3) == 0)
10143 {
10144 nPC.AddBuff(num, Main.rand.Next(60, 240));
10145 }
10146 else
10147 {
10148 nPC.AddBuff(num, Main.rand.Next(60, 120));
10149 }
10150 }
10151 if (type == 504 && Main.rand.Next(2) == 0)
10152 {
10153 if (Main.rand.Next(3) == 0)
10154 {
10155 nPC.AddBuff(323, Main.rand.Next(60, 240));
10156 }
10157 else
10158 {
10159 nPC.AddBuff(323, Main.rand.Next(60, 120));
10160 }
10161 }
10162 if (type == 979 && Main.rand.Next(2) == 0)
10163 {
10164 int num2 = 44;
10165 if (Main.remixWorld)
10166 {
10167 num2 = 324;
10168 }
10169 if (Main.rand.Next(3) == 0)
10170 {
10171 nPC.AddBuff(num2, Main.rand.Next(60, 240));
10172 }
10173 else
10174 {
10175 nPC.AddBuff(num2, Main.rand.Next(60, 120));
10176 }
10177 }
10178 if ((type == 694 || type == 695 || type == 696) && Main.player[owner].setHuntressT2)
10179 {
10180 nPC.AddBuff(204, Main.rand.Next(8, 18) * 30);
10181 }
10182 if (type == 545 && Main.rand.Next(3) == 0)
10183 {
10184 nPC.AddBuff(24, Main.rand.Next(60, 240));
10185 }
10186 if (type == 553)
10187 {
10188 nPC.AddBuff(323, Main.rand.Next(180, 480));
10189 }
10190 if (type == 552 && Main.rand.Next(3) != 0)
10191 {
10192 nPC.AddBuff(324, Main.rand.Next(120, 320));
10193 }
10194 if (type == 495)
10195 {
10196 nPC.AddBuff(153, Main.rand.Next(120, 300));
10197 }
10198 if (type == 497)
10199 {
10200 nPC.AddBuff(153, Main.rand.Next(60, 180));
10201 }
10202 if (type == 496)
10203 {
10204 nPC.AddBuff(153, Main.rand.Next(240, 480));
10205 }
10206 if (type == 46)
10207 {
10208 nPC.AddBuff(153, Main.rand.Next(240, 300));
10209 }
10210 if (type == 476)
10211 {
10212 nPC.AddBuff(151, 30);
10213 }
10214 if (type == 523)
10215 {
10216 nPC.AddBuff(20, 60 * Main.rand.Next(10, 30));
10217 }
10218 if (type == 478 || type == 480)
10219 {
10220 nPC.AddBuff(39, 60 * Main.rand.Next(3, 7));
10221 }
10222 if (type == 479)
10223 {
10224 nPC.AddBuff(69, 60 * Main.rand.Next(7, 15));
10225 }
10226 if (type == 379)
10227 {
10228 nPC.AddBuff(70, 60 * Main.rand.Next(2, 5));
10229 }
10230 if (type >= 390 && type <= 392)
10231 {
10232 nPC.AddBuff(70, 60 * Main.rand.Next(2, 5));
10233 }
10234 if (type == 374)
10235 {
10236 nPC.AddBuff(20, 60 * Main.rand.Next(4, 7));
10237 }
10238 if (type == 376)
10239 {
10240 nPC.AddBuff(24, 60 * Main.rand.Next(3, 7));
10241 }
10242 if (type >= 399 && type <= 402)
10243 {
10244 nPC.AddBuff(24, 60 * Main.rand.Next(3, 7));
10245 }
10246 if (type == 295 || type == 296)
10247 {
10248 nPC.AddBuff(323, 60 * Main.rand.Next(8, 16));
10249 }
10250 if ((melee || ranged) && !npcProj && Main.player[owner].frostBurn && !noEnchantments)
10251 {
10252 nPC.AddBuff(324, 60 * Main.rand.Next(5, 15));
10253 }
10254 if (melee && Main.player[owner].magmaStone && !noEnchantments)
10255 {
10256 if (Main.rand.Next(7) == 0)
10257 {
10258 nPC.AddBuff(323, 360);
10259 }
10260 else if (Main.rand.Next(3) == 0)
10261 {
10262 nPC.AddBuff(323, 120);
10263 }
10264 else
10265 {
10266 nPC.AddBuff(323, 60);
10267 }
10268 }
10269 if (type == 287)
10270 {
10271 nPC.AddBuff(72, 120);
10272 }
10273 if (type == 285)
10274 {
10275 if (Main.rand.Next(3) == 0)
10276 {
10277 nPC.AddBuff(31, 180);
10278 }
10279 else
10280 {
10281 nPC.AddBuff(31, 60);
10282 }
10283 }
10284 if (type == 2 && Main.rand.Next(3) == 0)
10285 {
10286 nPC.AddBuff(24, 180);
10287 }
10288 if (type == 172)
10289 {
10290 if (Main.rand.Next(3) == 0)
10291 {
10292 nPC.AddBuff(44, 180);
10293 }
10294 }
10295 else if (type == 15)
10296 {
10297 int num3 = 24;
10298 if (Main.remixWorld)
10299 {
10300 num3 = 323;
10301 }
10302 if (Main.rand.Next(2) == 0)
10303 {
10304 nPC.AddBuff(num3, 300);
10305 }
10306 }
10307 else if (type == 253)
10308 {
10309 nPC.AddBuff(324, 480);
10310 }
10311 else if (type == 19)
10312 {
10313 if (Main.rand.Next(2) == 0)
10314 {
10315 nPC.AddBuff(24, 360);
10316 }
10317 }
10318 else if (type == 113)
10319 {
10320 if (Main.rand.Next(2) == 0)
10321 {
10322 nPC.AddBuff(44, 180);
10323 }
10324 }
10325 else if (type == 33)
10326 {
10327 if (Main.rand.Next(2) == 0)
10328 {
10329 nPC.AddBuff(20, 420);
10330 }
10331 }
10332 else if (type == 976)
10333 {
10334 if (Main.rand.Next(4) == 0)
10335 {
10336 nPC.AddBuff(20, 420);
10337 }
10338 }
10339 else if (type == 34)
10340 {
10341 if (Main.rand.Next(2) == 0)
10342 {
10343 nPC.AddBuff(24, Main.rand.Next(240, 480));
10344 }
10345 }
10346 else if (type == 948)
10347 {
10348 if (Main.rand.Next(6) == 0)
10349 {
10350 nPC.AddBuff(24, 60 * Main.rand.Next(2, 4));
10351 }
10352 }
10353 else if (type == 35)
10354 {
10355 if (Main.rand.Next(2) == 0)
10356 {
10357 nPC.AddBuff(24, 300);
10358 }
10359 }
10360 else if (type == 54)
10361 {
10362 if (Main.rand.Next(2) == 0)
10363 {
10364 nPC.AddBuff(20, 600);
10365 }
10366 }
10367 else if (type == 267)
10368 {
10369 if (Main.rand.Next(3) == 0)
10370 {
10371 nPC.AddBuff(20, 3600);
10372 }
10373 else
10374 {
10375 nPC.AddBuff(20, 1800);
10376 }
10377 }
10378 else if (type == 63)
10379 {
10380 if (Main.rand.Next(5) != 0)
10381 {
10382 nPC.AddBuff(31, 60 * Main.rand.Next(2, 5));
10383 }
10384 }
10385 else if (type == 85)
10386 {
10387 int num4 = ((ai[0] == 1f) ? 324 : 323);
10388 nPC.AddBuff(num4, 1200);
10389 }
10390 else if (type == 188)
10391 {
10392 nPC.AddBuff(323, 1200);
10393 }
10394 else if (type == 95 || type == 103 || type == 104 || type == 482)
10395 {
10396 nPC.AddBuff(39, 420);
10397 }
10398 else if (type == 278 || type == 279 || type == 280)
10399 {
10400 nPC.AddBuff(69, 600);
10401 }
10402 else if (type == 282 || type == 283)
10403 {
10404 nPC.AddBuff(70, 600);
10405 }
10406 if (type == 163 || type == 310 || type == 1008 || type == 1010 || type == 1011)
10407 {
10408 if (Main.rand.Next(3) == 0)
10409 {
10410 nPC.AddBuff(24, 600);
10411 }
10412 else
10413 {
10414 nPC.AddBuff(24, 300);
10415 }
10416 }
10417 if (type == 1009)
10418 {
10419 nPC.AddBuff(39, 600);
10420 }
10421 else if (type == 98)
10422 {
10423 nPC.AddBuff(20, 600);
10424 }
10425 else if (type == 184)
10426 {
10427 nPC.AddBuff(20, 900);
10428 }
10429 else if (type == 980)
10430 {
10431 nPC.AddBuff(70, 300);
10432 }
10433 else if (type == 265)
10434 {
10435 nPC.AddBuff(20, 1800);
10436 }
10437 else if (type == 355)
10438 {
10439 nPC.AddBuff(70, 1800);
10440 }
10441 }

References Terraria.Projectile.ai, Terraria.ID.ProjectileID.Sets.IsAWhip, Terraria.Projectile.localAI, Terraria.Projectile.melee, Terraria.Projectile.noEnchantments, Terraria.Main.npc, Terraria.Projectile.npcProj, Terraria.Projectile.owner, Terraria.Main.player, Terraria.Main.rand, Terraria.Projectile.ranged, Terraria.Main.remixWorld, and Terraria.Projectile.type.

Referenced by Terraria.Projectile.Damage().