50361 {
50362
50363
50364
50365
50366
50367
50368
50369
50370
50371
50372
50373
50374
50375
50376
50377
50378
50379
50380
50381
50382
50383
50384
50385
50386
50387
50388
50389
50390
50391
50392
50393
50394
50395
50396
50397
50398
50399
50400
50401
50402
50403
50404
50405
50406
50407
50408
50409
50410
50411
50412
50413
50414
50415
50416
50417
50418
50419
50420
50421
50422
50423
50424
50425
50426
50427
50428
50429
50430
50431
50432
50433
50436 {
50437 velocity.X *= 0.95f;
50439 {
50441 }
50442 velocity.Y *= 0.95f;
50444 {
50446 }
50447 }
50448 else
50449 {
50452 {
50454 for (
int j = 0;
j < 400;
j++)
50455 {
50456 if (i ==
j || !Main.item[
j].active || !Main.item[
j].shimmered)
50457 {
50458 continue;
50459 }
50461 {
50462 break;
50463 }
50464 float num9 = (
width + Main.item[
j].width) / 2;
50465 if (!(
Math.Abs(
base.Center.X - Main.item[
j].Center.X) <=
num9) || !(
Math.Abs(
base.Center.Y - Main.item[
j].Center.Y) <=
num9))
50466 {
50467 continue;
50468 }
50470 float num10 = Vector2.Distance(
base.Center, Main.item[
j].Center);
50473 {
50475 }
50476 if (
base.Center.X < Main.item[
j].Center.X)
50477 {
50479 {
50480 velocity.X -= 0.1f *
num9;
50481 }
50482 if (Main.item[
j].velocity.X < 3
f)
50483 {
50484 Main.item[
j].velocity.X += 0.1f *
num9;
50485 }
50486 }
50487 else if (
base.Center.X > Main.item[
j].Center.X)
50488 {
50490 {
50491 velocity.X += 0.1f *
num9;
50492 }
50493 if (Main.item[
j].velocity.X > -3
f)
50494 {
50495 Main.item[
j].velocity.X -= 0.1f *
num9;
50496 }
50497 }
50499 {
50501 {
50502 velocity.X -= 0.1f *
num9;
50503 }
50504 if (Main.item[
j].velocity.X < 3
f *
num9)
50505 {
50506 Main.item[
j].velocity.X += 0.1f *
num9;
50507 }
50508 }
50509 }
50510 }
50511 velocity.Y += gravity;
50513 {
50514 velocity.Y = maxFallSpeed;
50515 }
50516 velocity.X *= 0.95f;
50517 if ((
double)velocity.X < 0.1 && (double)
velocity.X > -0.1)
50518 {
50520 }
50522 {
50523 velocity.X *= 0.8f;
50524 }
50525 }
50528 {
50530 }
50532 if (Collision.honey)
50533 {
50535 }
50536 if (Collision.shimmer)
50537 {
50539 }
50541 {
50543 {
50545 {
50548 {
50550 {
50551 for (
int k = 0;
k < 10;
k++)
50552 {
50554 Main.dust[
num11].velocity.Y -= 4
f;
50555 Main.dust[
num11].velocity.X *= 2.5f;
50556 Main.dust[
num11].scale = 0.8f;
50557 Main.dust[
num11].noGravity =
true;
50558 switch (Main.rand.Next(6))
50559 {
50560 case 0:
50561 Main.dust[
num11].color =
new Color(255, 255, 210);
50562 break;
50563 case 1:
50564 Main.dust[
num11].color =
new Color(190, 245, 255);
50565 break;
50566 case 2:
50567 Main.dust[
num11].color =
new Color(255, 150, 255);
50568 break;
50569 default:
50570 Main.dust[
num11].color =
new Color(190, 175, 255);
50571 break;
50572 }
50573 }
50575 }
50577 {
50578 for (
int l = 0;
l < 5;
l++)
50579 {
50581 Main.dust[
num12].velocity.Y -= 1
f;
50582 Main.dust[
num12].velocity.X *= 2.5f;
50583 Main.dust[
num12].scale = 1.3f;
50584 Main.dust[
num12].alpha = 100;
50585 Main.dust[
num12].noGravity =
true;
50586 }
50588 }
50589 else
50590 {
50591 for (
int m = 0;
m < 10;
m++)
50592 {
50594 Main.dust[
num13].velocity.Y -= 4
f;
50595 Main.dust[
num13].velocity.X *= 2.5f;
50596 Main.dust[
num13].scale *= 0.8f;
50597 Main.dust[
num13].alpha = 100;
50598 Main.dust[
num13].noGravity =
true;
50599 }
50601 }
50602 }
50603 else
50604 {
50605 for (
int n = 0;
n < 5;
n++)
50606 {
50608 Main.dust[
num14].velocity.Y -= 1.5f;
50609 Main.dust[
num14].velocity.X *= 2.5f;
50610 Main.dust[
num14].scale = 1.3f;
50611 Main.dust[
num14].alpha = 100;
50612 Main.dust[
num14].noGravity =
true;
50613 }
50615 }
50616 }
50618 }
50619 }
50621 {
50624 {
50627 {
50629 {
50631 {
50633 Main.dust[
num2].velocity.Y -= 4
f;
50634 Main.dust[
num2].velocity.X *= 2.5f;
50635 Main.dust[
num2].scale = 0.8f;
50636 Main.dust[
num2].noGravity =
true;
50637 switch (Main.rand.Next(6))
50638 {
50639 case 0:
50640 Main.dust[
num2].color =
new Color(255, 255, 210);
50641 break;
50642 case 1:
50643 Main.dust[
num2].color =
new Color(190, 245, 255);
50644 break;
50645 case 2:
50646 Main.dust[
num2].color =
new Color(255, 150, 255);
50647 break;
50648 default:
50649 Main.dust[
num2].color =
new Color(190, 175, 255);
50650 break;
50651 }
50652 }
50654 }
50656 {
50658 {
50660 Main.dust[
num4].velocity.Y -= 1
f;
50661 Main.dust[
num4].velocity.X *= 2.5f;
50662 Main.dust[
num4].scale = 1.3f;
50663 Main.dust[
num4].alpha = 100;
50664 Main.dust[
num4].noGravity =
true;
50665 }
50667 }
50668 else
50669 {
50671 {
50673 Main.dust[
num6].velocity.Y -= 4
f;
50674 Main.dust[
num6].velocity.X *= 2.5f;
50675 Main.dust[
num6].scale *= 0.8f;
50676 Main.dust[
num6].alpha = 100;
50677 Main.dust[
num6].noGravity =
true;
50678 }
50680 }
50681 }
50682 else
50683 {
50685 {
50687 Main.dust[
num8].velocity.Y -= 1.5f;
50688 Main.dust[
num8].velocity.X *= 2.5f;
50689 Main.dust[
num8].scale = 1.3f;
50690 Main.dust[
num8].alpha = 100;
50691 Main.dust[
num8].noGravity =
true;
50692 }
50694 }
50695 }
50696 }
50698 {
50702 }
50704 {
50706 }
50708 {
50710 {
50714 {
50716 }
50718 {
50720 }
50721 }
50722 }
50723 else
50724 {
50726 }
50732 Collision.StepConveyorBelt(
this, 1
f);
50733 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
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.
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 bool[] ItemNoGravity
If true for a given item type (F:Terraria.Item.type), then that item will float in place instead of f...
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
static void Update(Item item, ref float gravity, ref float maxFallSpeed)
Calls ModItem.Update, then all GlobalItem.Update hooks.
This serves as the central class from which item-related functions are carried out....