TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
UnicornMountJump.cs
Go to the documentation of this file.
1using System;
2using Microsoft.Xna.Framework;
4
5namespace Terraria.ModLoader;
6
7public sealed class UnicornMountJump : VanillaExtraJump
8{
9 public override float GetDurationMultiplier(Player player)
10 {
11 return 2f;
12 }
13
14 public override void OnStarted(Player player, ref bool playSound)
15 {
16 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
17 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
18 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
19 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
20 //IL_0072: Unknown result type (might be due to invalid IL or missing references)
21 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
22 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
23 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
24 //IL_009f: Unknown result type (might be due to invalid IL or missing references)
25 //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
26 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
27 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
28 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
29 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
30 //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
31 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
32 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
33 //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
34 //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
35 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
36 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
37 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
38 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
39 Vector2 center = player.Center;
40 Vector2 vector2 = default(Vector2);
41 ((Vector2)(ref vector2))._002Ector(50f, 20f);
42 float num10 = (float)Math.PI * 2f * Main.rand.NextFloat();
43 for (int i = 0; i < 5; i++)
44 {
45 for (float num11 = 0f; num11 < 14f; num11 += 1f)
46 {
47 Dust obj = Main.dust[Dust.NewDust(center, 0, 0, Utils.SelectRandom<int>(Main.rand, 176, 177, 179))];
48 Vector2 vector3 = Vector2.UnitY.RotatedBy(num11 * ((float)Math.PI * 2f) / 14f + num10);
49 vector3 *= 0.2f * (float)i;
50 obj.position = center + vector3 * vector2;
51 obj.velocity = vector3 + new Vector2(0f, player.gravDir * 4f);
52 obj.noGravity = true;
53 obj.scale = 1f + Main.rand.NextFloat() * 0.8f;
54 obj.fadeIn = Main.rand.NextFloat() * 2f;
55 obj.shader = GameShaders.Armor.GetSecondaryShader(player.cMount, player);
56 }
57 }
58 }
59
60 public override void ShowVisuals(Player player)
61 {
62 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
63 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
64 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
65 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
66 //IL_0057: Unknown result type (might be due to invalid IL or missing references)
67 Dust obj = Main.dust[Dust.NewDust(player.position, player.width, player.height, Utils.SelectRandom<int>(Main.rand, 176, 177, 179))];
68 obj.velocity = Vector2.Zero;
69 obj.noGravity = true;
70 obj.scale = 0.5f + Main.rand.NextFloat() * 0.8f;
71 obj.fadeIn = 1f + Main.rand.NextFloat() * 2f;
72 obj.shader = GameShaders.Armor.GetSecondaryShader(player.cMount, player);
73 }
74
75 public override void UpdateHorizontalSpeeds(Player player)
76 {
77 player.runAcceleration *= 3f;
78 player.maxRunSpeed *= 1.5f;
79 }
80}
static int NewDust(Vector2 Position, int Width, int Height, int Type, float SpeedX=0f, float SpeedY=0f, int Alpha=0, Color newColor=default(Color), float Scale=1f)
Attempts to spawn a single Dust into the game world. The Position, Width, and Height parameters dicta...
Definition Dust.cs:173
Dust are particles effects used to add visual elements to weapons and other effects....
Definition Dust.cs:18
Vector2 Center
Definition Entity.cs:70
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
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7
static UnifiedRandom rand
Definition Main.cs:2758
static Dust[] dust
Definition Main.cs:1822
override float GetDurationMultiplier(Player player)
override void ShowVisuals(Player player)
Spawn effects that should appear while the player is performing this jump here. Only runs while the ...
override void UpdateHorizontalSpeeds(Player player)
Modify the player's horizontal movement while performing this jump here. Only runs while the jump is...
override void OnStarted(Player player, ref bool playSound)
This hook runs when the player uses this jump via pressing the jump key Effects that should appear w...
int cMount
The armor shader ID applied to the Mount equipment slot by a dye item (F:Terraria....
Definition Player.cs:3072