76267 {
76268
76269
76270
76271
76272
76273
76274
76275
76276
76277
76278
76279
76280
76281
76282
76283
76284
76285
76286
76287
76288
76289
76290
76291
76292
76293
76294
76295
76296
76297
76298
76299
76300
76301
76302
76303
76304
76305
76306
76307
76308
76309
76310
76311
76312
76313
76314
76315
76316
76317
76318
76319
76320
76321
76322
76323
76324
76325
76326
76327
76328
76329
76330
76331
76332
76333
76334
76335
76336
76337
76338
76339
76340
76341
76342
76343
76344
76345
76346
76347
76348
76349
76350
76351
76352
76353
76354
76355
76356
76357
76358
76359
76360
76361
76362
76363
76364
76365
76366
76367
76368
76369
76370
76371
76372
76373
76374
76375
76376
76377
76378
76379
76380
76381
76382
76383
76384
76385
76386
76387
76388
76389
76390
76391
76392
76393
76394
76395
76396
76397
76398
76399
76400
76406 Vector2
vector = player.RotatedRelativePoint(player.MountedCenter);
76407 Vector2
vector2 = Vector2.Zero;
76408 if (player.dead)
76409 {
76411 return;
76412 }
76414 {
76419 {
76422 {
76424 }
76425 }
76428 {
76430 }
76435 bool flag =
ai[0] == (float)(
int)(
num / 2
f);
76436 if (
ai[0] >=
num || (
flag && !player.controlUseItem))
76437 {
76439 player.reuseDelay = 10;
76440 }
76442 {
76446 {
76447 player.ChangeDir(
num15);
76451 }
76452 }
76455 Vector2
vector3 = base.Center + (
num2 + ((
num13 == -1) ? ((
float)
Math.PI) : 0
f)).ToRotationVector2() * 30
f;
76456 if (Main.rand.Next(2) == 0)
76457 {
76458 Dust dust = Dust.NewDustDirect(
vector3 -
new Vector2(5
f), 10, 10, 31, player.velocity.X, player.velocity.Y, 150);
76459 dust.velocity =
DirectionTo(dust.position) * 0.1f + dust.velocity * 0.1f;
76460 }
76462 {
76463 Dust
dust2 = Dust.NewDustDirect(
vector3 -
new Vector2(5
f), 10, 10, 55, player.velocity.X, player.velocity.Y, 50);
76464 dust2.velocity =
DirectionTo(
dust2.position) * 0.1f + dust2.velocity * 0.1f;
76465 dust2.noGravity = true;
76466 dust2.color = new Color(20, 255, 100, 160);
76467 }
76469 {
76470 for (int i = 0; i < 5; i++)
76471 {
76472 Dust
dust5 = Dust.NewDustDirect(
vector3 -
new Vector2(5
f), 10, 10, 55, player.velocity.X, player.velocity.Y, 50);
76473 dust5.velocity *= 1.2f;
76474 dust5.noGravity = true;
76475 dust5.scale += 0.1f;
76476 dust5.color = new Color(20, 255, 100, 160);
76477 }
76478 }
76480 {
76482 {
76485 }
76486 else
76487 {
76489 }
76490 }
76491 }
76493 {
76494 Lighting.AddLight(player.Center, 0.75f, 0.9f, 1.15f);
76498 {
76501 {
76503 }
76504 }
76507 {
76509 }
76515 if (
ai[0] >=
num || (
flag2 && !player.controlUseItem))
76516 {
76518 player.reuseDelay = 2;
76519 }
76521 {
76525 {
76526 player.ChangeDir(
num5);
76530 }
76531 }
76533 {
76536 }
76539 Vector2
vector4 = base.Center + (
num6 + ((
num3 == -1) ? ((
float)
Math.PI) : 0
f)).ToRotationVector2() * 30
f;
76542 if (Main.rand.Next(2) == 0)
76543 {
76544 Dust
dust3 = Dust.NewDustDirect(
vector4 -
new Vector2(5
f), 10, 10, 31, player.velocity.X, player.velocity.Y, 150);
76545 dust3.velocity =
DirectionTo(
dust3.position) * 0.1f + dust3.velocity * 0.1f;
76546 }
76547 for (
int j = 0;
j < 4;
j++)
76548 {
76552 {
76553 case 1:
76555 break;
76556 case 2:
76559 break;
76560 case 3:
76563 break;
76564 }
76565 if (Main.rand.Next(6) != 0)
76566 {
76568 dust4.position = base.Center +
vector5 * (60
f + Main.rand.NextFloat() * 20
f) *
num8;
76570 dust4.noGravity = true;
76571 dust4.noLight = true;
76572 dust4.scale = 0.5f;
76573 dust4.customData = this;
76574 if (Main.rand.Next(4) == 0)
76575 {
76576 dust4.noGravity = false;
76577 }
76578 }
76579 }
76580 }
76586 player.heldProj =
whoAmI;
76587 player.SetDummyItemTime(2);
76589 }
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
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.
Vector2 DirectionTo(Vector2 Destination)
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
static readonly SoundStyle DD2_MonkStaffGroundImpact
static readonly SoundStyle DD2_MonkStaffGroundMiss
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
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...
static Conditions.NotNull _cachedConditions_notNull
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
IEntitySource GetProjectileSource_FromThis()
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...
static Conditions.IsSolid _cachedConditions_solid
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
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)