-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathFFXIV_RingFit_Two.gpc
147 lines (108 loc) · 2.28 KB
/
FFXIV_RingFit_Two.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
#pragma METAINFO("FFXIV_RingFit_v2", 1, 0, "SuperLouis64")
#include <keyboard.gph>
/* redesigning the Ring fit for FFXIV
Controller support for FFXIV!
Squat activates D-PAD
RT = R button on joycon
LT = ZR button on joycon
this version is run = run forward
*/
int runCheck;
int isRunning;
int canRun;
init
{
keymapping(); // Disable default keyboard mappings
remapper_swap(BUTTON_8, BUTTON_4); // swap LT and R button
runCheck = 0;
canRun = 1;
}
main
{
// turn off D-Pad
// set_val(BUTTON_10, 0.0);
// set_val(BUTTON_11, 0.0);
// set_val(BUTTON_12, 0.0);
// set_val(BUTTON_13, 0.0);
set_val(BUTTON_7, 0.0);
// this program deals with checking runs, explained after main()
nowRunning();
JoyConDrift(); // pay $80 to fix your joycon drift
if(runCheck > 60)
{
if(canRun == 1)
{
set_val(STICK_2_Y, -100.0); // Run to move forwad
}
}
// Let's make squat do d-pad down
// We need to check both ACCEL Z and Y
if(get_val(BUTTON_5) == 100.0) // press ZR
{
// change the -22.00 to a value that works for squatting
if(get_val(ACCEL_1_Z) < -22.00) // check squat is happening and press Down D-pad
{
{
set_val(BUTTON_11, 100.0);
}
}
else
{
set_val(BUTTON_11, 0.0);
}
}
if(get_val(BUTTON_8) == 100.0) // press R (which is LT now)
{
if(get_val(ACCEL_1_Z) < -22.00) // check squat is happening and press Down D-pad
{
{
set_val(BUTTON_11, 100.0);
}
}
else
{
set_val(BUTTON_11, 0.0);
}
}
///// disable running when attempting to use actions /////
if(get_val(BUTTON_5) > 0.0 || get_val(BUTTON_8) > 0.0)
{
canRun = 0;
}
if(get_val(BUTTON_5) < 100.0)
{
if(get_val(BUTTON_8) < 100.0)
{
canRun = 1;
}
}
//debug();
}
// slap together code to determine when user is 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 JoyConDrift()
{
if(get_val(STICK_2_X) < 20.0 && get_val(STICK_2_X) > - 20.0)
{
set_val(STICK_2_X, 0.0);
}
if(get_val(STICK_2_Y) < 20.0 && get_val(STICK_2_Y) > - 20.0)
{
set_val(STICK_2_Y, 0.0);
}
}
// debug check for my runCheck
void debug()
{
printf("%d", isRunning);
}