-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathturtlewax.zss
1128 lines (915 loc) · 27.3 KB
/
turtlewax.zss
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#==|DO NOT TOUCH ANY OF THE FUNCTION LOGIC|======
[Function replayReleaseCheck(s,x,y,z,w,a,b,c,d,rs,rx,ry,rz,rw,ra,rb,rc,rd,up,down,left,right,ru,rdn,rl,rr)]
if(Map(r_dir)> 0.5)
{
#Negative Edge
Map(r_dir):= floor(Map(r_dir)*0.0625);
}
if((Map(r_dir)&$up) = 0 && (Map(h_dir)&$ru) > 0)
{
#up init
Map(r_dir):= (Map(r_dir)|$ru);
}
if((Map(r_dir)&$down) = 0 && (Map(h_dir)&$rdn) > 0)
{
#down init
Map(r_dir):= (Map(r_dir)|$rdn);
}
if((Map(r_dir)&$left) = 0 && (Map(h_dir)&$rl) > 0)
{
#back init
Map(r_dir):= (Map(r_dir)|$rl);
}
if((Map(r_dir)&$right) = 0 && (Map(h_dir)&$rr) > 0)
{
#fwd init
Map(r_dir):= (Map(r_dir)|$rr);
}
#BUTTON RELEASE:
if((Map(h_att)&$s) = 0 && (Map(h_att)&$rs) > 0 )
{
#start init
Map(r_att):= (Map(r_att)|$rs);
}
if((Map(h_att)&$d) = 0 && (Map(h_att)&$rd) > 0)
{
#d init
Map(r_att):= (Map(r_att)|$rd);
}
if((Map(h_att)&$w) = 0 && (Map(h_att)&$rw) > 0)
{
#w init
Map(r_att):= (Map(r_att)|$rw);
}
if((Map(h_att)&$c) = 0 && (Map(h_att)&$rc) > 0)
{
#hk init
Map(r_att):= (Map(r_att)|$rc);
}
if((Map(h_att)&$z) = 0 && (Map(h_att)&$rz) > 0)
{
#hp init
Map(r_att):= (Map(r_att)|$rz);
}
if((Map(h_att)&$b) = 0 && (Map(h_att)&$rb) > 0)
{
#mk init
Map(r_att):= (Map(r_att)|$rb);
}
if((Map(h_att)&$y) = 0 && (Map(h_att)&$ry) > 0)
{
#mp init
Map(r_att):= (Map(r_att)|$ry);
}
if((Map(h_att)&$a) = 0 && (Map(h_att)&$ra) > 0)
{
#lk init
Map(r_att):= (Map(r_att)|$ra);
}
if((Map(h_att)&$x) = 0 && (Map(h_att)&$rx) > 0)
{
#lp init
Map(r_att):= (Map(r_att)|$rx);
}
[Function checkBtn(r,s,x,y,z,w,a,b,c,d,rs,rx,ry,rz,rw,ra,rb,rc,rd)]
if $r
{
let r = player($r),helper(const(ih)),id;
}
else
{
let r = id;
}
let rot = playerid($r),root,id;
#Press Dec all buttons
playerid($r),Map(p_att):= floor(playerid($r),Map(p_att)/Const(Bit10));
playerid($r),Map(h_att):= floor(playerid($r),Map(h_att)/Const(Bit10));
playerid($r),Map(r_att):= floor(playerid($r),Map(r_att)/Const(Bit10));
playerid($r),Map(m_att):= floor(playerid($r),Map(m_att)/Const(Bit10));
#BUTTON HOLD:
if(command = "start" || command = "hold_start")
{
#start init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$s);
}
if(command = "d"|| command = "hold_d")
{
#d init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$d );
}
if(command = "w"|| command = "hold_w")
{
#w init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$w );
}
if(command = "c"|| command = "hold_c")
{
#hk init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$c);
}
if(command = "z"|| command = "hold_z")
{
#hp init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$z);
}
if(command = "b"||command = "hold_b")
{
#mk init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$b);
}
if(command = "y"|| command = "hold_y")
{
#mp init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$y);
}
if(command = "a"|| command = "hold_a")
{
#lk init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$a);
}
if(command = "x"|| command = "hold_x")
{
#lp init
playerid($r),Map(h_att):= (playerid($r),Map(h_att)|$x);
}
#BUTTON PRESS:
if(command = "start" )
{
#start init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$s);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$s);
}
if(command = "d")
{
#d init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$d);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$d);
}
if(command = "w")
{
#w init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$w);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$w);
}
if(command = "c")
{
#hk init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$c);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$c);
}
if(command = "z")
{
#hp init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$z);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$z);
}
if(command = "b")
{
#mk init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$b);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$b);
}
if(command = "y")
{
#mp init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$y);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$y);
}
if(command = "a")
{
#lk init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$a);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$a);
}
if(command = "x" )
{
#lp init
playerid($r),Map(p_att):= (playerid($r),Map(p_att)|$x);
playerid($r),Map(m_att):= (playerid($r),Map(m_att)|$x);
}
#BUTTON RELEASE:
if((playerid($r),Map(h_att)&$s) = 0 && (playerid($r),Map(h_att)&$rs) > 0 )
{
#start init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$rs);
}
if((playerid($r),Map(h_att)&$d) = 0 && (playerid($r),Map(h_att)&$rd) > 0)
{
#d init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$rd);
}
if((playerid($r),Map(h_att)&$w) = 0 && (playerid($r),Map(h_att)&$rw) > 0)
{
#w init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$rw);
}
if((playerid($r),Map(h_att)&$c) = 0 && (playerid($r),Map(h_att)&$rc) > 0)
{
#hk init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$rc);
}
if((playerid($r),Map(h_att)&$z) = 0 && (playerid($r),Map(h_att)&$rz) > 0)
{
#hp init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$rz);
}
if((playerid($r),Map(h_att)&$b) = 0 && (playerid($r),Map(h_att)&$rb) > 0)
{
#mk init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$rb);
}
if((playerid($r),Map(h_att)&$y) = 0 && (playerid($r),Map(h_att)&$ry) > 0)
{
#mp init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$ry);
}
if((playerid($r),Map(h_att)&$a) = 0 && (playerid($r),Map(h_att)&$ra) > 0)
{
#lk init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$ra);
}
if((playerid($r),Map(h_att)&$x) = 0 && (playerid($r),Map(h_att)&$rx) > 0)
{
#lp init
playerid($r),Map(r_att):= (playerid($r),Map(r_att)|$rx);
}
#---------------------------------[DIRECTIONS]---------------------------------#
#DIRECTIONAL:
#Map(p_dir) = PRESS
#Map(h_dir) = HOLD
#Map(r_dir) = RELEASE
#Final tick (pattern repeats going up, can store 8 ticks):
# Up = 0x01
# Down = 0x02
# Back = 0x04
# Forward = 0x08
[Function checkdir(r,up,down,left,right,ru,rd,rl,rr)]
if $r
{
let rv = 1;
let r = player($r),helper(const(ih)),id;
}
else
{
let r = id;
}
let tc = root,Map(tw_turncheck);
let rf = root,facing;
let fcond1= ( p2dist x >=0&&!$tc ||$tc &&facing=root,facing);
let fcond2=(p2dist x <0&&!$tc || $tc &&facing!=root,facing );
if $rv
{
let fcond1= !$fcond1;
let fcond2=!$fcond2;
}
if(playerid($r),Map(h_dir)> 0.5)
{#Hold Dec
playerid($r),Map(h_dir):= floor(playerid($r),Map(h_dir)*0.0625);
}
if(playerid($r),Map(p_dir)> 0.5)
{
#Press Dec
playerid($r),Map(p_dir):=floor(playerid($r),Map(p_dir)*0.0625);
}
if(playerid($r),Map(r_dir)> 0.5)
{
#Negative Edge
playerid($r),Map(r_dir):= floor(playerid($r),Map(r_dir)*0.0625);
}
#Zero out because maps are floats
if(playerid($r),Map(h_dir)< 1)
{#Hold Dec
playerid($r),Map(h_dir):= 0;
}
if(playerid($r),Map(p_dir)< 1)
{
#Press Dec
playerid($r),Map(p_dir):= 0;
}
if(playerid($r),Map(r_dir)< 1)
{
#Negative Edge
playerid($r),Map(r_dir):= 0;
}
#DIRECTION PRESS:
if(command = "up2" || command = "holdup")
{
if command = "up2"
{
#up
playerid($r),Map(p_dir):= (playerid($r),Map(p_dir)|$up);
}
#up init
playerid($r),Map(h_dir):= (playerid($r),Map(h_dir)|$up);
}
if(command = "down2" || command = "holddown")
{
if command = "down2"
{
#down
playerid($r),Map(p_dir):= (playerid($r),Map(p_dir)|$down);
}
#down init
playerid($r),Map(h_dir):= (playerid($r),Map(h_dir)|$down);
}
if ((command="back2" || command="holdback" ) && $fcond1) ||((command="fwd2" || command="holdfwd" ) && $fcond2)
{
if ((command="back2" ) && $fcond1) ||((command="fwd2" ) && $fcond2) {
#back
playerid($r),Map(p_dir):= (playerid($r),Map(p_dir)|$left);
}
playerid($r),Map(h_dir):= (playerid($r),Map(h_dir)|$left);
}
if ((command="back2" || command="holdback" ) && $fcond2) ||((command="fwd2" || command="holdfwd" ) && $fcond1)
{
if ((command="back2" ) && $fcond2) ||((command="fwd2" ) && $fcond1) {
#back
playerid($r),Map(p_dir):= (playerid($r),Map(p_dir)|$right);
}
playerid($r),Map(h_dir):= (playerid($r),Map(h_dir)|$right);
}
#DIRECTION RELEASE:
if((playerid($r),Map(r_dir)&$up) = 0 && (playerid($r),Map(h_dir)&$ru) > 0)
{
#up init
playerid($r),Map(r_dir):= (playerid($r),Map(r_dir)|$ru);
}
if((playerid($r),Map(h_dir)&$down) = 0 && (playerid($r),Map(h_dir)&$rd) > 0)
{
#down init
playerid($r),Map(r_dir):= (playerid($r),Map(r_dir)|$rd);
}
if((playerid($r),Map(h_dir)&$left) = 0 && (playerid($r),Map(h_dir)&$rl) > 0)
{
#back init
playerid($r),Map(r_dir):= (playerid($r),Map(r_dir)|$rl);
}
if((playerid($r),Map(h_dir)&$right) = 0 && (playerid($r),Map(h_dir)&$rr) > 0)
{
#fwd init
playerid($r),Map(r_dir):= (playerid($r),Map(r_dir)|$rr);
}
#---block fix
if (playerid($r),Map(p_att)>=const(bit10)|| playerid($r),Map(r_att)>0&&root,movetype=A)
{
AssertSpecial{flag:nostandguard;flag2:nocrouchguard;flag3:noairguard;redirectid:root,id}
}
#-----------------------------------
[Function setdir(up,down,left,right,ru,rd,rl,rr) ]
#printtoconsole{text:"%d %d %d %d";params:root,id,playerid($rot),id, Map(p_dir),teamside}
root,Map(p_Up):=(Map(p_dir)&$up);
root,Map(p_Dn):=(Map(p_dir)&$down);
root,Map(p_Bk):=(Map(p_dir)&$left);
root,Map(p_Fd):=(Map(p_dir)&$right);
root,Map(h_Up):=(Map(h_dir)&($up|$ru));
root,Map(h_Dn):=(Map(h_dir)&($down|$rd)) ;
root,Map(h_Bk):=(Map(h_dir)&($left|$rl));
root,Map(h_Fd):=(Map(h_dir)&($right|$rr));
root,Map(r_Up):=(Map(r_dir)&$ru);
root,Map(r_Dn):=(Map(r_dir)&$rd);
root,Map(r_Bk):=(Map(r_dir)&$rl);
root,Map(r_Fd):=(Map(r_dir)&$rr);
root,Map(u_Up):=(Map(p_dir)&$up);
root,Map(u_Dn):=(Map(p_dir)&$down);
root,Map(u_Bk):=(Map(p_dir)&$left);
root,Map(u_Fd):=(Map(p_dir)&$right);
[Function setbtn(s,x,y,z,w,a,b,c,d,rs,rx,ry,rz,rw,ra,rb,rc,rd)]
#regular inputs
root,Map(x):=(Map(p_att) &($x|$rx));
root,Map(y):=(Map(p_att) &($y|$ry));
root,Map(z):=(Map(p_att) &($z|$rz));
root,Map(s):=(Map(p_att) &($s|$rs));
root,Map(w):=(Map(p_att)&($w|$rw));
root,Map(a):=(Map(p_att) &($a|$ra));
root,Map(b):=(Map(p_att) &($b|$rb));
root,Map(c):=(Map(p_att) &($c|$rc));
root,Map(d):=(Map(p_att)&($d|$rd));
root,Map(h_x):=(Map(h_att) &($x|$rx));
root,Map(h_y):=(Map(h_att) &($y|$ry));
root,Map(h_z):=(Map(h_att) &($z|$rz));
root,Map(h_w):=(Map(h_att)&($w|$rw));
root,Map(h_s):=(Map(h_att) &($s|$rs));
root,Map(h_a):=(Map(h_att) &($a|$ra));
root,Map(h_b):=(Map(h_att) &($b|$rb));
root,Map(h_c):=(Map(h_att) &($c|$rc));
root,Map(h_d):=(Map(h_att)&($d|$rd));
root,Map(r_x):=(Map(r_att) &$rx);
root,Map(r_y):=(Map(r_att) &$ry);
root,Map(r_z):=(Map(r_att) &$rz);
root,Map(r_w):=(Map(r_att)&$rw);
root,Map(r_s):=(Map(r_att) &$rs);
root,Map(r_a):=(Map(r_att) &$ra);
root,Map(r_b):=(Map(r_att) &$rb);
root,Map(r_c):=(Map(r_att) &$rc);
root,Map(r_d):=(Map(r_att)&$rd);
root,Map(u_x):=(Map(p_att) &$x);
root,Map(u_y):=(Map(p_att) &$y);
root,Map(u_z):=(Map(p_att) &$z);
root,Map(u_w):=(Map(p_att)&$w);
root,Map(u_s):=(Map(p_att) &$s);
root,Map(u_a):=(Map(p_att) &$a);
root,Map(u_b):=(Map(p_att) &$b);
root,Map(u_c):=(Map(p_att) &$c);
root,Map(u_d):=(Map(p_att)&$d);
root,Map(m_x):=(Map(m_att) &($x|$rx));
root,Map(m_y):=(Map(m_att) &($y|$ry));
root,Map(m_z):=(Map(m_att) &($z|$rz));
root,Map(m_s):=(Map(m_att) &($s|$rs));
root,Map(m_w):=(Map(m_att)&($w|$rw));
root,Map(m_a):=(Map(m_att) &($a|$ra));
root,Map(m_b):=(Map(m_att) &($b|$rb));
root,Map(m_c):=(Map(m_att) &($c|$rc));
root,Map(m_d):=(Map(m_att)&($d|$rd));
[Function setDefault()]
#THESE ARE DEFAULT VALUES, CHANGE THEM IN YOUR CHARACTER/FILES. DO NOT CHANGE THEM HERE.
#YOU CAN SET THESE MAPS IN YOUR CHARACTER'S DEF FILE ||IN THEIR CODE. JUST DON'T DO IT
#HERE!
#How many buttons? either 1 f||yes ||-1 f||no
if root,Map(tw_btn6)=0
{
root,Map(tw_btn6):=1;
}
#How much time in frames do we have to press the next button to complete a Hundred Hand Slap Motion, only set once here, you can set it anywhere else
if root,Map(tw_MashPCt)=0
{
root,Map(tw_MashPCt):=10;
}
#How many times do we need to mash to complete the motion, only set once here, you can set it anywhere else
if root,Map(tw_MashCt)=0
{
root,Map(tw_MashCt):=5;
}
#Charge partitioning?
if root,Map(tw_charge_partition)=1{
root,Map(tw_ChargePartitionTime):=8;
}
#How much time can we wait to cancel a move?
if root,Map(tw_MoveCancelTime)=0
{
root,Map(tw_MoveCancelTime):=1;
}
if !root,Map(tw_D_ChargeTime)#Down charge ala Flash Kick
{
root,Map(tw_D_ChargeTime):=48;
}
if !root,Map(tw_D_BufferTime)#How much time a complete charge is stored
{
root,Map(tw_D_BufferTime):=9;
}
if !root,Map(tw_B_ChargeTime)#Back charge ala Sonic Boom
{
root,Map(tw_B_ChargeTime):=48;
}
if !root,Map(tw_B_BufferTime)#How much time a complete charge is stored
{
root,Map(tw_B_BufferTime):=9;
}
if !root,Map(tw_F_ChargeTime)#Back charge ala Sonic Boom
{
root,Map(tw_F_ChargeTime):=48;
}
if !root,Map(tw_F_BufferTime)#How much time a complete charge is stored
{
root,Map(tw_F_BufferTime):=9;
}
if !root,Map(tw_Dash_input1_BufferTime)#first input time f||run
{
root,Map(tw_Dash_input1_BufferTime):=9;
}
if !root,Map(tw_Dash_input2_BufferTime)#first input time f||run
{
root,Map(tw_Dash_input2_BufferTime):=6;
}
#===|Hundred Hand Slap Definition|===
[function checkHHS()]
let btn6 = root,Map(tw_btn6);
let mashpct = root,Map(tw_MashPCt);
let mashct = root,Map(tw_MashCt);
let hhs = root,Map(tw_MashPCt);
if Map(mashtimer)>0#&&root,hitpausetime=0
{
Map(mashtimer):=map(mashtimer)-1;
}
if Map(mashtimerk)>0#&&root,hitpausetime=0
{
Map(mashtimerk):=map(mashtimerk)-1;
}
#HHSP - mash p continuously, either in a piano ||constant press of the same button ending on that button
if ((root,Map(tw_bind1) <2||root,Map(tw_bind)=4) && map(m_att)&const(Bit4) =const(Bit4)||
((Map(m_att)&3)=Const(Bit1)||(Map(m_att)&3)=Const(Bit2)||(Map(m_att)&3)=Const(Bit1)+Const(Bit2))||
((Map(m_att)&7)=Const(Bit3)||(Map(m_att)&7)=Const(Bit1)+Const(Bit3)||(Map(m_att)&7)=Const(Bit3)+Const(Bit2)||(Map(m_att)&7)=Const(Bit3)+Const(Bit1)+Const(Bit2))&&$btn6=1)
{
#HHSP init
Map(hhsp):=map(hhsp)+1;
Map(mashtimer):=$mashpct;
}
if ((root,Map(tw_bind1) =2||root,Map(tw_bind1) =0||root,Map(tw_bind)=4) && map(m_att)&const(Bit8) =const(Bit8)||
((Map(m_att)&48)=Const(Bit5)||(Map(m_att)&48)=Const(Bit6)||(Map(m_att)&48)=Const(Bit5)+Const(Bit6))||
((Map(m_att)&112)=Const(Bit7)||(Map(m_att)&112)=Const(Bit5)+Const(Bit7)||(Map(m_att)&112)=Const(Bit7)+Const(Bit6)||(Map(m_att)&112)=Const(Bit5)+Const(Bit6)+Const(Bit7))&&root,Map(tw_btn6)=1)
{
#HHSK init
Map(hhsk):=map(hhsk)+1;
Map(mashtimerk):=$mashpct;
}
if Map(mashtimer)<=0
{
Map(hhsp):=0;
}
if Map(mashtimerk)<=0
{
Map(hhsk):=0;
}
root,Map(HHSP):= (Map(mashtimer) > 0 && Map(hhsp) > $mashct);
root,Map(HHSk):= (Map(mashtimerk) > 0 && Map(hhsk) > $mashct);
if gamemode!="versuscoop" && teammode=tag {
if (player(1),id)=root,id {
player(3),Map(HHSP):= (Map(mashtimer) > 0 && Map(hhsp) > $mashct);
player(5),Map(HHSP):= (Map(mashtimer) > 0 && Map(hhsp) > $mashct);
player(7),Map(HHSP):= (Map(mashtimer) > 0 && Map(hhsp) > $mashct);
player(3),Map(HHSK):= (Map(mashtimerk) > 0 && Map(hhsk) > $mashct);
player(5),Map(HHSK):= (Map(mashtimerk) > 0 && Map(hhsk) > $mashct);
player(7),Map(HHSK):= (Map(mashtimerk) > 0 && Map(hhsk) > $mashct);
} else {
player(4),Map(HHSP):= (Map(mashtimer) > 0 && Map(hhsp) > $mashct);
player(6),Map(HHSP):= (Map(mashtimer) > 0 && Map(hhsp) > $mashct);
player(8),Map(HHSP):= (Map(mashtimer) > 0 && Map(hhsp) > $mashct);
player(4),Map(HHSK):= (Map(mashtimerk) > 0 && Map(hhsk) > $mashct);
player(6),Map(HHSK):= (Map(mashtimerk) > 0 && Map(hhsk) > $mashct);
player(8),Map(HHSK):= (Map(mashtimerk) > 0 && Map(hhsk) > $mashct);
}
}
#set charge values
[function setcharge()]
let cpt = root,Map(tw_charge_partition);
#check holding left
if (map(h_dir)&64) > 0 || (map(h_dir)&4)>0 {
map(ch_valb):=map(ch_valb)+1;
if $cpt {
map(chp_tb):=root,Map(tw_ChargePartitionTime);
}
if map(ch_valb) >= root,Map(tw_B_ChargeTime) {
root,Map(tw_B_ChargeReady):=root,Map(tw_B_BufferTime);
}
}
else {
if !root,hitpausetime {
if root,Map(tw_B_ChargeReady)>0 {
root,Map(tw_B_ChargeReady):=root,Map(tw_B_ChargeReady)-1;
}
if map(chp_tb)>0 {
map(chp_tb):=map(chp_tb)-1;
}
if !$cpt || map(chp_tb)=0 {
map(ch_valb):=0;
}
}
}
#check holding down
if (map(h_dir)&32) > 0 || (map(h_dir)&2)>0 {
map(ch_vald):=map(ch_vald)+1;
if $cpt {
map(chp_td):=root,Map(tw_ChargePartitionTime);
}
if map(ch_vald) >= root,Map(tw_D_ChargeTime) {
root,Map(tw_D_ChargeReady):=root,Map(tw_D_BufferTime);
}
}
else {
if !root,hitpausetime {
if root,Map(tw_D_ChargeReady)>0 {
root,Map(tw_D_ChargeReady):=root,Map(tw_D_ChargeReady)-1;
}
if map(chp_td)>0 {
map(chp_td):=map(chp_td)-1;
}
if !$cpt || map(chp_td)=0 {
map(ch_vald):=0;
}
}
}
#check holding fwd
if (map(h_dir)&128) > 0 || (map(h_dir)&8)>0 {
map(ch_valf):=map(ch_valf)+1;
if $cpt {
map(chp_tf):=root,Map(tw_ChargePartitionTime);
}
if map(ch_valf) >= root,Map(tw_F_ChargeTime) {
root,Map(tw_F_ChargeReady):=root,Map(tw_F_BufferTime);
}
}
else {
if !root,hitpausetime {
if root,Map(tw_F_ChargeReady)>0 {
root,Map(tw_F_ChargeReady):=root,Map(tw_F_ChargeReady)-1;
}
if map(chp_tf)>0 {
map(chp_tf):=map(chp_tf)-1;
}
if !$cpt || map(chp_tf)=0 {
map(ch_valf):=0;
}
}
}
#check holding up
if (map(h_dir)&16) > 0 || (map(h_dir)&1)>0 {
map(ch_valu):=map(ch_valu)+1;
if $cpt {
map(chp_tu):=root,Map(tw_ChargePartitionTime);
}
if map(ch_valu) >= root,Map(tw_U_ChargeTime) {
root,Map(tw_U_ChargeReady):=root,Map(tw_U_BufferTime);
}
}
else {
if !root,hitpausetime {
if root,Map(tw_U_ChargeReady)>0 {
root,Map(tw_U_ChargeReady):=root,Map(tw_U_ChargeReady)-1;
}
if map(chp_tu)>0 {
map(chp_tu):=map(chp_tu)-1;
}
if !$cpt || map(chp_tu)=0 {
map(ch_valu):=0;
}
}
}
[Statedef -4]
#====|END OF THINGS YOU CAN COPY|====================
#DO NOT TOUCH ANY BELOW UNLESS YOU KNOW EXACTLY WHAT YOU'RE DOING!
if numhelper(const(ih))=0&&!ishelper&&teamside=[1,2]&&map(u_tw){
#see common.cds
Helper{
id: const(ih);
stateno: 9992999;
ownpal: 1;
name:"TurtleWax";
size.height: 0;
keyctrl:1;
pausemovetime:99999;
supermovetime:99999;
facing:cond(teamside=2,-1,1)
}
}
ignorehitpause if ishelper(const(ih)) {
if time=1{
call setDefault();
}
let up = Const(Bit5);
let down = Const(Bit6);
let left = Const(Bit7);
let right = Const(Bit8);
let release_Up = Const(Bit1);
let release_Down = Const(Bit2);
let release_Left = Const(Bit3);
let release_Right = Const(Bit4);
#tbh these aren't even used.
let hold_up = $up+$release_Up;
let hold_down = $down+$release_Down;
let hold_left = $left+$release_Left;
let hold_right = $right+$release_Right;
#declare our buttons
let x = Const(Bit10);
let y = Const(Bit11);
let z = Const(Bit12);
let w = Const(Bit13);
let s = Const(Bit14);
let a = Const(Bit15);
let b = Const(Bit16);
let c = Const(Bit17);
let d = Const(Bit18);
let release_x = Const(Bit1);
let release_y = Const(Bit2);
let release_z = Const(Bit3);
let release_w = Const(Bit4);
let release_Start = Const(Bit5);
let release_a = Const(Bit6);
let release_b = Const(Bit7);
let release_c = Const(Bit8);
let release_d = Const(Bit9);
let r_AllBits_dir = $release_Up+$release_Down+$release_Left+$release_Right;
let r_AllBits_att = $release_x+$release_y+$release_z+$release_a+$release_b+$release_c;
let r_PBits = $release_x+$release_y+$release_z;
let r_KBits = $release_a+$release_b+$release_c;
let p_AllBits_att = $x+$y+$z+$a+$b+$c;
let p_PBits_att = $x+$y+$z;
let p_KBits_att = $a+$b+$c;
let p_AllBits_dir = $up+$down+$left+$right;
#These represent how many frames you have to do the next part of an input
#F||example, if you start with D a given motion will begin their countdown based
#on the values defined below, f||"qc" that is 12 frames of time you have to input DF
#then you have 12 additional frames to input F to complete the QCF motion.
#ONLY CHANGE THESE IF YOU UNDERSTAND THIS
map(sntimer):=40;
let iLag = 0; #additional input lag (in frames)
#=======================================#
#Command Buffering File based on (Capcom VS. SNK 2) 1.8 #
#Original system f||Capcom VS. SNK: Collision Course #
#by Vans #
#Modifications by Jesuszilla f||Command interpretation #
#Adaptation by Kamekaze f||Ikemen GO, updates by Jesuszilla f||improved bit #
#usage #
#=======================================#
#Introduction:
#This is the 15-tick / 2-tick based command buffering system. Coded to be Capcom
#compliant following Capcom vs. SNK 2 as a guide.
#
#The helper is capable of providing buffering as well as PERFECT reversed
#commands in addition to negative edge checking f||command var iables.
#
#Any and all editions should be done in the BUFFER DEFINITION section.
#
#Unless you plan to modify the whole system, do not touch the mapnames, ever.
#----------------------------[BUFFER DECREASE]---------------------------------#
# The button and cardinal direction buffers are special in that they do not use
# normal integer subtraction f||each buffer. That is because it would make the
# code ugly and unreadable. Thus, it uses bitwise shifting through division due
# to I.K.E.M.E.N. GO's lack of bitwise shift operators.
#
# Think of each button and direction as an enumeration flag. When initializing
# (when a button is first pressed), it initializes the most significant bits.
# The buffer decreases by shifting the entire array down to the next size of
# bits. There are 7 buttons, so 7 bits are used. Therefore, up to 4 ticks of
# button buffering can be stored in one var in this architecture. Directions
# only require 4 bits because there are only 4 directions. Therefore, the
# direction arrays can store up to 8 ticks of buffering.
#
# In either case, however, the Capcom vs. SNK 2 buffering system used here only
# uses 2 ticks of buffering.
#
# suppose a user presses LP and LK at the same time. The basic bit array in this
# structure would look as follows:
#
# 0010001
#
# Going from least significant bit (the rightmost bit) to the most significant
# bit (the leftmost bit), the bits that are filled f||LP and LK are the 1st
# and 5th bits, respectively.
#
# so f||the buffering system defined in this file, the variable would actually
# look as follows f||the first tick. Recall that I.K.E.M.E.N. GO int variables are
# 32 bits:
#
# 00000000000000000000100010000000
#
# The next tick, this array of 7 bits would be shifted down to the next 7 bits.
# In I.K.E.M.E.N. GO, this is accomplished by dividing the number by 128. Thus, the
# bits in the variable would look as follows on the second tick:
#
# 00000000000000000000000000010001
#
# 00000000000000000100000000000000
# 00000000000000000100000000000000
#
# This algorithm is the same f||every variable used f||buffering. However,
# each variable used in this system serves a specific purpose:
#
# Map(p_att) - Used to signify button presses.
# Map(h_dir) - Used to signify button holds.
# Map(r_att) - Used to signify button releases.
# Map(p_dir) - Used to signify direction presses.
# Map(h_dir) - Used to signify direction holds.
# Map(r_dir) - Used to signify direction releases.
#
# A command f||Map(p_att) ||Map(p_dir) is like a raw button, such as x ||F. Similarly,
# Map(h_att) and Map(h_dir) can be used f||hold behavior, like /x ||/F. Finally, Map(r_att)
# and Map(r_dir) are used f||release behavior, like ~x ||~F. These are all
# necessary in order to overcome I.K.E.M.E.N. GO's limitations to provide a more solid
# command system.
#
# If you don't understand this explanation, that is OK. CNS may be your first,
# ||only, computer language, and this system is built upon years of expertise
# in computer science. You can read up on bitwise operations here. I hope these
# links survive time!
#
# English:
# http://mugenguild.com/forum/topics/bitwise-variables-demystified-137076.0.html
# https://en.wikipedia.org/wiki/Bitwise_operation
#
# 日本語:
# https://ja.wikipedia.org/wiki/%E3%83%93%E3%83%83%E3%83%88%E6%BC%94%E7%AE%97
#
#--------------------------------[BUTTONS]-------------------------------------#
#BUTTON:
#Map(p_att) = PRESS
#Map(h_dir) = HOLD
#Map(r_att) = RELEASE
#Final tick (pattern repeats going up, can store 4 ticks):
# LP = 0x01
# MP = 0x02
# HP = 0x04
# start = 0x08
# LK = 0x10
# MK = 0x20
# HK = 0x40
#--------------------------------[BUTTONS]-------------------------------------#
#BUTTON:
#Map(p_att) = PRESS
#Map(h_dir) = HOLD
#Map(r_att) = RELEASE
#Final tick (pattern repeats going up, can store 4 ticks):
# LP = 0x01
# MP = 0x02
# HP = 0x04
# start = 0x08
# LK = 0x10
# MK = 0x20
# HK = 0x40
#DIRECTIONAL:
#var(i22) = DD