forked from GabeHasWon/spritersguildwip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStarlightPlayer.cs
More file actions
79 lines (71 loc) · 1.88 KB
/
StarlightPlayer.cs
File metadata and controls
79 lines (71 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System.IO;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.World.Generation;
using Microsoft.Xna.Framework;
using Terraria.GameContent.Generation;
using Terraria.ModLoader.IO;
using Terraria.DataStructures;
using Microsoft.Xna.Framework.Graphics;
using System;
using StarlightRiver.GUI;
using StarlightRiver.Abilities;
using StarlightRiver.Items.CursedAccessories;
namespace StarlightRiver
{
public class StarlightPlayer : ModPlayer
{
public bool DarkSlow = false;
public bool VitricSet = false;
public int InvertGrav = 0;
public override void PreUpdateBuffs()
{
if (InvertGrav > 0)
{
//Main.NewText("Invert: true");
player.gravControl = true;
player.gravDir = -1f;
}
else
{
//Main.NewText("Invert: false");
}
}
public override void PreUpdate()
{
Stamina.visible = false;
for (int k = 0; k < player.GetModPlayer<AbilityHandler>().unlock.Length; k++)
{
if (player.GetModPlayer<AbilityHandler>().unlock[k] == 1)
{
Stamina.visible = true;
}
}
if (DarkSlow)
{
player.velocity.X *= 0.8f;
}
DarkSlow = false;
}
public override void ResetEffects()
{
//InvertGrav = false;
}
public override void PostUpdate()
{
//Main.NewText(player.velocity);
if (InvertGrav > 0)
{
if (InvertGrav == 1 && player.velocity.Y < 5 && player.velocity.Y > -5)
{
player.velocity.Y = 0;
}
--InvertGrav;
}
}
}
}