-
Notifications
You must be signed in to change notification settings - Fork 10
/
RingFit_BotW.gpc
174 lines (131 loc) · 2.8 KB
/
RingFit_BotW.gpc
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#pragma METAINFO("NoRingBotW", 1, 0, "Super_Louis64")
/*
Ring Fit mod for BotW
Made by Super Louis 64
(@SuperLouis_64 on twitter)
*/
bool controllerON;
bool isRunning;
bool isSquat;
int runCheck;
init
{
controllerON = FALSE;
isRunning = FALSE;
isSquat = FALSE;
// remap sticks so you can use the right joycon to move
remapper_swap(STICK_2_X, STICK_1_X);
remapper_swap(STICK_2_Y, STICK_1_Y);
runCheck = 0;
}
main
{
nowRunning();
// swing to attake(noringcon)
if(get_val(GYRO_1_Z) < -80.0)
{
set_val(BUTTON_17, 100.0);
//set_val(BUTTON_15, 0.0);
}
// swing with ringcon
if(get_val(GYRO_1_X) > 50.0)
{
set_val(BUTTON_17, 100.0);
}
// lockon with ZR
if(get_val(BUTTON_5) > 0.0)
{
set_val(BUTTON_8, 100.0);
set_val(BUTTON_5, 0.0);
}
// Turn R into bow ZR
if(get_val(BUTTON_4) > 0.0)
{
set_val(BUTTON_5, 100.0);
set_val(BUTTON_4, 0.0);
}
if(get_val(BUTTON_16) > 0.0)
{
set_val(BUTTON_16, 0.0);
set_val(BUTTON_14, 100.0);
}
// run with left STICK button press
if(get_val(BUTTON_6) > 0.0)
{
set_val(BUTTON_6, 0.0);
set_val(BUTTON_16, 100.0);
}
// hand over head
// if(get_val(ACCEL_2_Z) > 18.0 && get_val(GYRO_1_Z) < 5.0 && get_val(GYRO_1_Y) < 5.0 && get_val(BUTTON_5) < 100.0)
if(get_val(BUTTON_1) > 0.0)
{
set_val(BUTTON_1, 0.0);
if(check_release(BUTTON_19, 600))
{
set_val(BUTTON_7, 100);
}
}
/*turn off buttons if i'm not running
70 is a magic number that sets a pace for the user to be running at for
the controller's joystick to be activated
increase if you want to run harder, decrease if you want to run less
*/
if(runCheck < 70)
{
set_val(STICK_2_X, 0.0);
set_val(STICK_2_Y, 0.0);
}
// ACCEL_1_Z = -25.00 = squats + Plus = start menu
if(get_val(ACCEL_1_Z) < -16.00 && get_val(BUTTON_3) == 100.0)
{
set_val(BUTTON_3, 100.0);
//set_val(BUTTON_8, 100.0);
isSquat = TRUE;
}
else
{
if(check_release(BUTTON_3, 600))
{
isSquat = FALSE;
}
if(isSquat == FALSE)
{
set_val(BUTTON_3, 0.0);
}
}
/* turn off R so you can squat
if(get_val(BUTTON_4) > 0.0 && get_val(ACCEL_1_Z) != -25.00)
{
set_val(BUTTON_4, 0.0);
}
*/
// ACCEL_1_Y > -20.00 = squats + HOME = Press Button 7
if(get_val(ACCEL_1_Y) > -20.00 && get_val(BUTTON_1) == 100.0)
{
set_val(BUTTON_1, 0.0);
set_val(BUTTON_7, 100.0);
}
// resets variable if it goes under 0
if(runCheck <0)
{
runCheck = 0;
}
//debug();
}
// the command to let me do things only if I'm running
// This function checks if the joycons are shaking in your legstrap due to running
void nowRunning()
{
if(get_val(ACCEL_1_Y) < -30.6)
{
runCheck = 100;
}
if(get_val(ACCEL_1_Y) < -23.8 && get_val(ACCEL_1_Y) > -24.6)
{
runCheck--;
}
}
void debug()
{
printf("%d", runCheck);
}