-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextFile1.txt
More file actions
87 lines (83 loc) · 3.41 KB
/
TextFile1.txt
File metadata and controls
87 lines (83 loc) · 3.41 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
80
81
82
83
84
85
86
87
private bool stopRollingLmao(On.Player.orig_MovementUpdate orig, Player self, bool eu)
{
var isTrue2 = false;
if (ReducedTech.TryGet(self, out var reducetech))
{
if (reducetech == true)
{
isTrue2 = true;
}
}
if (isTrue2)
{
self.rollDirection = 0;
self.rollcounter = 0;
self.slideCounter = 0;
self.initSlideCounter = 0;
self.stopRollingCounter = 0;
self.longBellySlide = false;
}
orig(self, eu);
}
private bool canSwallowThis(On.Player.orig_CanBeSwallowed orig, Player self, PhysicalObject testObj)
{
var isTrue = false;
if (orig(self, testObj))
{
isTrue = true;
}
if (SwallowOnlyPearls.TryGet(self, out bool swallowporl) && swallowporl == true)
{
if (!(testObj is DataPearl))
{
isTrue = false;
}
}
return isTrue;
}
private void playerUpdateBody(ILContext il)
{
try
{
// thank you so much jacob_v_thaumiel and alphappy on discord you are so awesome
ILCursor c = new ILCursor(il);
// find the place before it's checking the x/y velocity
c.GotoNext(
MoveType.After,
x => x.MatchLdlocs(13),
x => x.MatchLdfld(typeof(Vector2).GetField(nameof(Vector2.x))),
x => x.MatchLdcR4(0.0f)
);
c.GotoPrev(MoveType.Before, x => x.MatchLdlocs(13));
// start adding stuff, like the delegate to detect if the player has reduced tech
c.MoveAfterLabels();
c.EmitDelegate<Func<Player, bool>>((Player self) =>
{
var returner = false;
if (ReducedTech.TryGet(self, out var reducedTeche)) {
returner = reducedTeche;
}
return returner;
});
// but wait, we gotta find where we want to send the code off to if the player has reduced tech
ILCursor c2 = new ILCursor(il);
c2.GotoNext(
MoveType.After,
x => x.MatchStlfd(typeof(int32).GetField(nameof(int32))),
x => x.MatchBr(out _),
x => x.MatchLdlocs(9),
);
c2.GotoPrev(MoveType.Before, x => x.MatchLdlocs(9));
// okay now we can finish by directing to where we send the code off to if player has reduced tech
c.Emit(OpCodes.Brtrue, c2.Next);
// UnityEngine.Debug.Log(il);
}
catch (Exception e) { UnityEngine.Debug.Log(e); }
}
// thank u olaycolay for this code i would've never figured it out without it
private static bool Ambulant_Jolly_Sprite(On.JollyCoop.JollyMenu.SymbolButtonTogglePupButton.orig_HasUniqueSprite orig, SymbolButtonTogglePupButton self)
{
// TODO: Make pup sprite
if (self.symbolNameOff.Contains("ambulant") && !self.isToggled) return true;
return orig(self);
}