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

◆ OnStarted()

override void Terraria.ModLoader.SantankMountJump.OnStarted ( Player player,
ref bool playSound )
inlinevirtual

This hook runs when the player uses this jump via pressing the jump key
Effects that should appear when the jump starts can be spawned here.
For example, the Cloud in a Bottle's initial puff of smoke is spawned here.

To make the jump re-usable, set P:Terraria.DataStructures.ExtraJumpState.Available to true

Parameters
playerThe player performing the jump
playSoundWhether the poof sound should play. Set this parameter to false if you want to play a different sound.

Reimplemented from Terraria.ModLoader.ExtraJump.

Definition at line 12 of file SantankMountJump.cs.

13 {
14 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
15 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
16 //IL_0140: Unknown result type (might be due to invalid IL or missing references)
17 //IL_0176: Unknown result type (might be due to invalid IL or missing references)
18 //IL_017c: Unknown result type (might be due to invalid IL or missing references)
19 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
20 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
21 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
22 //IL_020a: Unknown result type (might be due to invalid IL or missing references)
23 //IL_0240: Unknown result type (might be due to invalid IL or missing references)
24 //IL_0256: Unknown result type (might be due to invalid IL or missing references)
25 //IL_027a: Unknown result type (might be due to invalid IL or missing references)
26 //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
27 //IL_02ac: Unknown result type (might be due to invalid IL or missing references)
28 //IL_02b1: Unknown result type (might be due to invalid IL or missing references)
29 //IL_030d: Unknown result type (might be due to invalid IL or missing references)
30 //IL_0321: Unknown result type (might be due to invalid IL or missing references)
31 //IL_032b: Unknown result type (might be due to invalid IL or missing references)
32 //IL_0330: Unknown result type (might be due to invalid IL or missing references)
33 //IL_0335: Unknown result type (might be due to invalid IL or missing references)
34 int num17 = player.height;
35 if (player.gravDir == -1f)
36 {
37 num17 = 0;
38 }
39 for (int num18 = 0; num18 < 15; num18++)
40 {
41 int num19 = Dust.NewDust(new Vector2(player.position.X - 34f, player.position.Y + (float)num17 - 16f), 102, 32, 4, (0f - player.velocity.X) * 0.5f, player.velocity.Y * 0.5f, 100, new Color(250, 230, 230, 150), 1.5f);
42 Main.dust[num19].velocity.X = Main.dust[num19].velocity.X * 0.5f - player.velocity.X * 0.1f;
43 Main.dust[num19].velocity.Y = Main.dust[num19].velocity.Y * 0.5f - player.velocity.Y * 0.3f;
44 Main.dust[num19].noGravity = true;
45 num19 = Dust.NewDust(new Vector2(player.position.X - 34f, player.position.Y + (float)num17 - 16f), 102, 32, 6, (0f - player.velocity.X) * 0.5f, player.velocity.Y * 0.5f, 20, default(Color), 1.5f);
46 Main.dust[num19].velocity.Y -= 1f;
47 if (num18 % 2 == 0)
48 {
49 Main.dust[num19].fadeIn = Main.rand.NextFloat() * 2f;
50 }
51 }
52 float y = player.Bottom.Y - 22f;
53 for (int num20 = 0; num20 < 3; num20++)
54 {
55 Vector2 vector8 = player.Center;
56 switch (num20)
57 {
58 case 0:
59 ((Vector2)(ref vector8))._002Ector(player.Center.X - 16f, y);
60 break;
61 case 1:
62 ((Vector2)(ref vector8))._002Ector(player.position.X - 36f, y);
63 break;
64 case 2:
65 ((Vector2)(ref vector8))._002Ector(player.Right.X + 4f, y);
66 break;
67 }
68 int num21 = Gore.NewGore(vector8, new Vector2(0f - player.velocity.X, 0f - player.velocity.Y), Main.rand.Next(61, 63));
69 Gore obj = Main.gore[num21];
70 obj.velocity *= 0.1f;
71 Main.gore[num21].velocity.X -= player.velocity.X * 0.1f;
72 Main.gore[num21].velocity.Y -= player.velocity.Y * 0.05f;
73 Gore obj2 = Main.gore[num21];
74 obj2.velocity += Main.rand.NextVector2Circular(1f, 1f) * 0.5f;
75 }
76 }

References Terraria.Entity.Center, Terraria.Main.dust, Terraria.Main.gore, Terraria.Player.gravDir, Terraria.Entity.height, Terraria.Dust.NewDust(), Terraria.Gore.NewGore(), Terraria.Entity.position, Terraria.Main.rand, Terraria.Entity.Right, and Terraria.Entity.velocity.

+ Here is the call graph for this function: