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

◆ ProjLight()

void Terraria.Projectile.ProjLight ( )
inline

Definition at line 15161 of file Projectile.cs.

15162 {
15163 //IL_0db5: Unknown result type (might be due to invalid IL or missing references)
15164 //IL_0dba: Unknown result type (might be due to invalid IL or missing references)
15165 //IL_0dbb: Unknown result type (might be due to invalid IL or missing references)
15166 //IL_0dc0: Unknown result type (might be due to invalid IL or missing references)
15167 //IL_0dc3: Unknown result type (might be due to invalid IL or missing references)
15168 //IL_0dc8: Unknown result type (might be due to invalid IL or missing references)
15169 //IL_0dcd: Unknown result type (might be due to invalid IL or missing references)
15170 //IL_0dcf: Unknown result type (might be due to invalid IL or missing references)
15171 //IL_0dd1: Unknown result type (might be due to invalid IL or missing references)
15172 //IL_0dd6: Unknown result type (might be due to invalid IL or missing references)
15173 //IL_0de5: Unknown result type (might be due to invalid IL or missing references)
15174 //IL_0dec: Unknown result type (might be due to invalid IL or missing references)
15175 //IL_0e06: Unknown result type (might be due to invalid IL or missing references)
15176 //IL_0e0b: Unknown result type (might be due to invalid IL or missing references)
15177 if (!(light > 0f))
15178 {
15179 return;
15180 }
15181 float num = light;
15182 float num2 = light;
15183 float num3 = light;
15184 switch (type)
15185 {
15186 case 987:
15187 num *= 0.6f;
15188 num2 *= 0.5f;
15189 num3 *= 0.1f;
15190 break;
15191 case 988:
15192 num *= 0.8f;
15193 num2 *= 0.35f;
15194 num3 *= 0f;
15195 break;
15196 case 989:
15197 num *= 0f;
15198 num2 *= 0.65f;
15199 num3 *= 0f;
15200 break;
15201 case 990:
15202 num *= 0f;
15203 num2 *= 0.35f;
15204 num3 *= 0.7f;
15205 break;
15206 case 991:
15207 num *= 0.9f;
15208 num2 *= 0f;
15209 num3 *= 0.5f;
15210 break;
15211 case 992:
15212 num *= 0.75f;
15213 num2 *= 0f;
15214 num3 *= 0.75f;
15215 break;
15216 case 993:
15217 num *= (float)Main.DiscoR / 255f;
15218 num2 *= (float)Main.DiscoG / 255f;
15219 num3 *= (float)Main.DiscoB / 255f;
15220 break;
15221 }
15222 if (type == 446)
15223 {
15224 num *= 0f;
15225 num3 *= 0.8f;
15226 }
15227 else if (type == 493 || type == 494)
15228 {
15229 num2 *= 0.3f;
15230 }
15231 else if (type == 876)
15232 {
15233 num *= 0.1f;
15234 num2 *= 0.7f;
15235 num3 *= 1f;
15236 }
15237 else if (type == 867)
15238 {
15239 float num4 = (float)Main.rand.Next(28, 42) * 0.005f;
15240 num4 += (float)(270 - Main.mouseTextColor) / 500f;
15241 num = 0.1f;
15242 num2 = 0.3f + num4 / 2f;
15243 num3 = 0.6f + num4;
15244 }
15245 else if (type == 1000)
15246 {
15247 float num5 = (float)Main.rand.Next(28, 42) * 0.005f;
15248 num5 += (float)(270 - Main.mouseTextColor) / 500f;
15249 num = 0.3f + num5 * 0.25f;
15250 num2 = 0.35f + num5 * 0.75f;
15251 num3 = 0.5f + num5;
15252 }
15253 else if (type == 332)
15254 {
15255 num3 *= 0.1f;
15256 num2 *= 0.6f;
15257 }
15258 else if (type == 259)
15259 {
15260 num3 *= 0.1f;
15261 if (Main.getGoodWorld)
15262 {
15263 num = 0f;
15264 num2 = 0f;
15265 num3 = 0f;
15266 }
15267 }
15268 else if (type == 329)
15269 {
15270 num3 *= 0.1f;
15271 num2 *= 0.9f;
15272 }
15273 else if (type == 2 || type == 82)
15274 {
15275 num2 *= 0.75f;
15276 num3 *= 0.55f;
15277 }
15278 else if (type == 172)
15279 {
15280 num2 *= 0.55f;
15281 num *= 0.35f;
15282 }
15283 else if (type == 308)
15284 {
15285 num2 *= 0.7f;
15286 num *= 0.1f;
15287 }
15288 else if (type == 304)
15289 {
15290 num2 *= 0.2f;
15291 num3 *= 0.1f;
15292 }
15293 else if (type == 263)
15294 {
15295 num2 *= 0.7f;
15296 num *= 0.1f;
15297 }
15298 else if (type == 274)
15299 {
15300 num2 *= 0.1f;
15301 num *= 0.7f;
15302 }
15303 else if (type == 254)
15304 {
15305 num *= 0.1f;
15306 }
15307 else if (type == 94)
15308 {
15309 num *= 0.5f;
15310 num2 *= 0f;
15311 }
15312 else if (type == 95 || type == 96 || type == 103 || type == 104)
15313 {
15314 num *= 0.35f;
15315 num2 *= 1f;
15316 num3 *= 0f;
15317 }
15318 else if (type == 4)
15319 {
15320 num2 *= 0.1f;
15321 num *= 0.5f;
15322 }
15323 else if (type == 257)
15324 {
15325 num2 *= 0.9f;
15326 num *= 0.1f;
15327 }
15328 else if (type == 9)
15329 {
15330 num2 *= 0.1f;
15331 num3 *= 0.6f;
15332 }
15333 else if (type == 488)
15334 {
15335 num = 0.3f;
15336 num3 = 0.25f;
15337 num2 = 0f;
15338 }
15339 else if (type == 92)
15340 {
15341 num2 *= 0.6f;
15342 num *= 0.8f;
15343 }
15344 else if (type == 93)
15345 {
15346 num2 *= 1f;
15347 num *= 1f;
15348 num3 *= 0.01f;
15349 }
15350 else if (type == 12 || type == 955)
15351 {
15352 num *= 0.9f;
15353 num2 *= 0.8f;
15354 num3 *= 0.1f;
15355 }
15356 else if (type == 14 || type == 110 || type == 180 || type == 242 || type == 302)
15357 {
15358 num2 *= 0.7f;
15359 num3 *= 0.1f;
15360 }
15361 else if (type == 981)
15362 {
15363 num2 *= 0.7f;
15364 num3 *= 0.7f;
15365 }
15366 else if (type == 15)
15367 {
15368 num2 *= 0.4f;
15369 num3 *= 0.1f;
15370 num = 1f;
15371 }
15372 else if (type == 16)
15373 {
15374 num *= 0.1f;
15375 num2 *= 0.4f;
15376 num3 = 1f;
15377 }
15378 else if (type == 18)
15379 {
15380 num2 *= 0.1f;
15381 num *= 0.6f;
15382 }
15383 else if (type == 19)
15384 {
15385 num2 *= 0.5f;
15386 num3 *= 0.1f;
15387 }
15388 else if (type == 20)
15389 {
15390 num *= 0.1f;
15391 num3 *= 0.3f;
15392 }
15393 else if (type == 22)
15394 {
15395 num = 0f;
15396 num2 = 0f;
15397 }
15398 else if (type == 27)
15399 {
15400 num *= 0f;
15401 num2 *= 0.3f;
15402 num3 = 1f;
15403 }
15404 else if (type == 34)
15405 {
15406 num2 *= 0.1f;
15407 num3 *= 0.1f;
15408 }
15409 else if (type == 36)
15410 {
15411 num = 0.8f;
15412 num2 *= 0.2f;
15413 num3 *= 0.6f;
15414 }
15415 else if (type == 41)
15416 {
15417 num2 *= 0.8f;
15418 num3 *= 0.6f;
15419 }
15420 else if (type == 44 || type == 45)
15421 {
15422 num3 = 1f;
15423 num *= 0.6f;
15424 num2 *= 0.1f;
15425 }
15426 else if (type == 50)
15427 {
15428 num *= 0.7f;
15429 num3 *= 0.8f;
15430 }
15431 else if (type == 515)
15432 {
15433 num2 *= 0.6f;
15434 num3 *= 0.85f;
15435 }
15436 else if (type == 870)
15437 {
15438 num *= 0.9f;
15439 num2 = 0.35f;
15440 }
15441 else if (type == 53)
15442 {
15443 num *= 0.7f;
15444 num2 *= 0.8f;
15445 }
15446 else if (type == 473)
15447 {
15448 num *= 1.05f;
15449 num2 *= 0.95f;
15450 num3 *= 0.55f;
15451 }
15452 else if (type == 72)
15453 {
15454 num *= 0.45f;
15455 num2 *= 0.75f;
15456 num3 = 1f;
15457 }
15458 else if (type == 86)
15459 {
15460 num *= 1f;
15461 num2 *= 0.45f;
15462 num3 = 0.75f;
15463 }
15464 else if (type == 87)
15465 {
15466 num *= 0.45f;
15467 num2 = 1f;
15468 num3 *= 0.75f;
15469 }
15470 else if (type == 73)
15471 {
15472 num *= 0.4f;
15473 num2 *= 0.6f;
15474 num3 *= 1f;
15475 }
15476 else if (type == 74)
15477 {
15478 num *= 1f;
15479 num2 *= 0.4f;
15480 num3 *= 0.6f;
15481 }
15482 else if (type == 284)
15483 {
15484 num *= 1f;
15485 num2 *= 0.1f;
15486 num3 *= 0.8f;
15487 }
15488 else if (type == 285)
15489 {
15490 num *= 0.1f;
15491 num2 *= 0.5f;
15492 num3 *= 1f;
15493 }
15494 else if (type == 286)
15495 {
15496 num *= 1f;
15497 num2 *= 0.5f;
15498 num3 *= 0.1f;
15499 }
15500 else if (type == 287)
15501 {
15502 num *= 0.9f;
15503 num2 *= 1f;
15504 num3 *= 0.4f;
15505 }
15506 else if (type == 283)
15507 {
15508 num *= 0.8f;
15509 num2 *= 0.1f;
15510 }
15511 else if (type == 76 || type == 77 || type == 78)
15512 {
15513 num *= 1f;
15514 num2 *= 0.3f;
15515 num3 *= 0.6f;
15516 }
15517 else if (type == 79)
15518 {
15519 num = (float)Main.DiscoR / 255f;
15520 num2 = (float)Main.DiscoG / 255f;
15521 num3 = (float)Main.DiscoB / 255f;
15522 }
15523 else if (type == 80)
15524 {
15525 num *= 0f;
15526 num2 *= 0.8f;
15527 num3 *= 1f;
15528 }
15529 else if (type == 83 || type == 88)
15530 {
15531 num *= 0.7f;
15532 num2 *= 0f;
15533 num3 *= 1f;
15534 }
15535 else if (type == 100)
15536 {
15537 num *= 1f;
15538 num2 *= 0.5f;
15539 num3 *= 0f;
15540 }
15541 else if (type == 84 || type == 389)
15542 {
15543 num *= 0.8f;
15544 num2 *= 0f;
15545 num3 *= 0.5f;
15546 }
15547 else if (type == 89 || type == 90)
15548 {
15549 num2 *= 0.2f;
15550 num3 *= 1f;
15551 num *= 0.05f;
15552 }
15553 else if (type == 106)
15554 {
15555 num *= 0f;
15556 num2 *= 0.5f;
15557 num3 *= 1f;
15558 }
15559 else if (type == 113)
15560 {
15561 num *= 0.25f;
15562 num2 *= 0.75f;
15563 num3 *= 1f;
15564 }
15565 else if (type == 114 || type == 115)
15566 {
15567 num *= 0.5f;
15568 num2 *= 0.05f;
15569 num3 *= 1f;
15570 }
15571 else if (type == 116)
15572 {
15573 num3 *= 0.25f;
15574 }
15575 else if (type == 131)
15576 {
15577 num *= 0.1f;
15578 num2 *= 0.4f;
15579 }
15580 else if (type == 132 || type == 157)
15581 {
15582 num *= 0.2f;
15583 num3 *= 0.6f;
15584 }
15585 else if (type == 156)
15586 {
15587 num *= 1f;
15588 num3 *= 0.6f;
15589 num2 = 0f;
15590 }
15591 else if (type == 173)
15592 {
15593 num *= 0.3f;
15594 num3 *= 1f;
15595 num2 = 0.4f;
15596 }
15597 else if (type == 207)
15598 {
15599 num *= 0.4f;
15600 num3 *= 0.4f;
15601 }
15602 else if (type == 253)
15603 {
15604 num = 0f;
15605 num2 *= 0.4f;
15606 }
15607 else if (type == 211)
15608 {
15609 num *= 0.5f;
15610 num2 *= 0.9f;
15611 num3 *= 1f;
15612 if (localAI[0] == 0f)
15613 {
15614 light = 1.5f;
15615 }
15616 else
15617 {
15618 light = 1f;
15619 }
15620 }
15621 else if (type == 209)
15622 {
15623 float num6 = (255f - (float)alpha) / 255f;
15624 num *= 0.3f;
15625 num2 *= 0.4f;
15626 num3 *= 1.75f;
15627 num3 *= num6;
15628 num *= num6;
15629 num2 *= num6;
15630 }
15631 else if (type == 226 || ((type == 221) | (type == 229)))
15632 {
15633 num *= 0.25f;
15634 num2 *= 1f;
15635 num3 *= 0.5f;
15636 }
15637 else if (type == 251)
15638 {
15639 num = (float)Main.DiscoR / 255f;
15640 num2 = (float)Main.DiscoG / 255f;
15641 num3 = (float)Main.DiscoB / 255f;
15642 num = (num + 1f) / 2f;
15643 num2 = (num2 + 1f) / 2f;
15644 num3 = (num3 + 1f) / 2f;
15645 num *= light;
15646 num2 *= light;
15647 num3 *= light;
15648 }
15649 else if (type == 278 || type == 279)
15650 {
15651 num *= 1f;
15652 num2 *= 1f;
15653 num3 *= 0f;
15654 }
15655 if (type == 870)
15656 {
15657 Vector3 rgb = (DelegateMethods.v3_1 = new Vector3(num, num2, num3));
15658 Point p = base.Center.ToTileCoordinates();
15659 DelegateMethods.v2_1 = p.ToVector2();
15660 DelegateMethods.f_1 = 4.5f;
15661 Utils.PlotTileArea(p.X, p.Y, DelegateMethods.SpreadLightOpen_StopForSolids);
15662 Lighting.AddLight(base.Center, rgb);
15663 }
15664 else
15665 {
15666 Lighting.AddLight((int)((position.X + (float)(width / 2)) / 16f), (int)((position.Y + (float)(height / 2)) / 16f), num, num2, num3);
15667 }
15668 }
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
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
float light
Set to a value above 0f to make this projectile emit a white light (higher number: more intensive lig...

References Terraria.Lighting.AddLight(), Terraria.Projectile.alpha, Terraria.Main.DiscoB, Terraria.Main.DiscoG, Terraria.Main.DiscoR, Terraria.Main.getGoodWorld, Terraria.Entity.height, Terraria.Projectile.light, Terraria.Projectile.localAI, Terraria.Main.mouseTextColor, Terraria.Utils.PlotTileArea(), Terraria.Entity.position, Terraria.Main.rand, Terraria.DelegateMethods.SpreadLightOpen_StopForSolids(), Terraria.Projectile.type, and Terraria.Entity.width.

Referenced by Terraria.Projectile.Update().

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