-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMKJOY.C
More file actions
2644 lines (1977 loc) · 64.6 KB
/
MKJOY.C
File metadata and controls
2644 lines (1977 loc) · 64.6 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
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
/******************************************************************************
File: mkjoy.c
Date: August 1994
(C) Williams Entertainment
Mortal Kombat III Joystick routines
******************************************************************************/
/* INCLUDES */
#include "system.h"
#ifdef SONY_PSX
#include "mksony.h"
#endif /* SONY_PSX */
#include "mkbkgd.h"
#include "mkobj.h"
#include "mkos.h"
#include "mkgame.h"
#include "mkguys.h"
#include "mkutil.h"
#include "mkani.h"
#include "mkjoy.h"
#include "mkinit.h"
#include "mkstat.h"
#include "mkdrone.h"
#include "mkcombo.h"
#include "mkreact.h"
#include "mkfx.h"
#include "moves.h"
#include "mkscore.h"
#include "mkcanned.h"
#include "mksound.h"
#include "mkfile.h"
WORD bt_null[] =
{
JI_JOY_IGNORE, // 0
JI_JOY_IGNORE, // 1
JI_JOY_IGNORE, // 2
JI_JOY_IGNORE, // 3
JI_JOY_IGNORE, // 4
JI_JOY_IGNORE, // 5
JI_JOY_IGNORE, // 6
JI_JOY_IGNORE, // 7
JI_JOY_IGNORE, // 8
JI_JOY_IGNORE // 9
};
WORD bt_angle_jump[] =
{
JI_JOY_FLIP_PUNCH, // 0
JI_JOY_FLIP_PUNCH, // 1
JI_JOY_IGNORE, // 2
JI_JOY_FLIP_KICK, // 3
JI_JOY_FLIP_KICK, // 4
JI_JOY_IGNORE, // 5
JI_JOY_IGNORE, // 6
JI_JOY_IGNORE, // 7
JI_JOY_IGNORE, // 8
JI_JOY_IGNORE // 9
};
WORD bt_duck[] =
{
JI_JOY_UPPERCUT, // 0
JI_JOY_DUCK_PUNCH, // 1
JI_JOY_DUCK_BLOCK, // 2
JI_JOY_DUCK_KICKH, // 3
JI_JOY_DUCK_KICKL, // 4
JI_JOY_IGNORE, // 5
JI_JOY_IGNORE, // 6
JI_JOY_IGNORE, // 7
JI_JOY_IGNORE, // 8
JI_JOY_IGNORE // 9
};
WORD bt_stance[] =
{
JI_JOY_HI_PUNCH, // 0
JI_JOY_LO_PUNCH, // 1
JI_JOY_BLOCK, // 2
JI_JOY_HI_KICK, // 3
JI_JOY_LO_KICK, // 4
JI_JOY_IGNORE, // 5
JI_JOY_IGNORE, // 6
JI_JOY_IGNORE, // 7
JI_JOY_IGNORE, // 8
JI_JOY_IGNORE // 9
};
WORD bt_jump[] =
{
JI_JUMPUP_PUNCH, // 0
JI_JUMPUP_PUNCH, // 1
JI_JOY_IGNORE, // 2
JI_JUMPUP_KICK, // 3
JI_JUMPUP_KICK, // 4
JI_JOY_IGNORE, // 5
JI_JOY_IGNORE, // 6
JI_JOY_IGNORE, // 7
JI_JOY_IGNORE, // 8
JI_JOY_IGNORE // 9
};
void do_body_slam(void);
/******************************************************************************
Function: void joy_begin(void)
By: David Schwartz
Date: May 1995
Parameters: None
Returns: None
Description: startup for a joystick process
******************************************************************************/
void joy_begin(void)
{
current_proc->pdata.p_flags|=PM_JOY; // need this here for smoke
ochar_begin_calls();
current_proc->joyindex=JI_JOY_IGNORE;
stack_jump(joy_proc);
}
/******************************************************************************
Function: void endurance_wake(void)
By: David Schwartz
Date: May 1995
Parameters: None
Returns: None
Description: startup for a endurance rounds
******************************************************************************/
void endurance_wake(void)
{
back_to_normal();
disable_all_buttons;
/* endw0 */
do
{
/* endw0 */
stance_setup(); // get stance ani
do
{
/* endw */
process_sleep(1);
if (am_i_facing_him()==SYSTEM_CARRY_SET)
{
turn_around(); // face the chump
break; // exit inner loop, so go back to endw0
}
/* endx */
next_anirate();
if (f_start)
{
/* start fighting */
current_proc->joyindex=JI_JOY_IGNORE;
stack_jump(joy_proc);
}
}
while(1);
}
while(1);
}
/******************************************************************************
Function: void switcheroo_wake(void)
By: David Schwartz
Date: May 1995
Parameters: None
Returns: None
Description: startup for a switcheroo
******************************************************************************/
void switcheroo_wake(void)
{
PROCESS *ptemp;
#if 0
WORD new_char;
/* switch to other guy */
while ((new_char=randu(21)-1)==(current_proc->pa8)->ochar); // dont pick same dude
if (p1_obj==current_proc->pa8)
(current_proc->pa8)->ochar=p1_char=p1_name_char=new_char;
else (current_proc->pa8)->ochar=p2_char=p2_name_char=new_char;
#endif
/* switch to other guy */
if ((current_proc->pa8)->ochar==p1_heap_char)
{
/* switch to p2 heap and character */
(current_proc->pa8)->ochar=p2_heap_char;
(current_proc->pa8)->oheap=p2_heap;
if ( current_proc->pa8==p1_obj )
p1_char=p1_name_char=p2_heap_char;
else p2_char=p2_name_char=p2_heap_char;
}
else
{
/* switch to p1 heap and character */
(current_proc->pa8)->ochar=p1_heap_char;
(current_proc->pa8)->oheap=p1_heap;
if ( current_proc->pa8==p1_obj )
p1_char=p1_name_char=p1_heap_char;
else p2_char=p2_name_char=p1_heap_char;
}
/* deal with other dude changing to smoke */
if ((current_proc->pa8)->ochar==FT_SMOKE)
{
ptemp=active_head;
while ( ptemp!=NULL )
{
if ( ptemp->procid==PID_SMOKER && current_proc->pa8==ptemp->pa8)
break;
ptemp=ptemp->plink;
if ( ptemp==NULL )
create_fx(FX_SMOKE);
}
}
/* update status */
refresh_score();
/* update clocks */
update_clock_ones(entry_12,clk_ones); // fix arcade bug on clocks being dispalyed screwy
update_clock_tens(entry_11,clk_tens);
//triple_sound(0x28+(current_proc->pa8)->ochar); // announce switch
clear_inviso(current_proc->pa8);
current_proc->pdata.p_flags|=PM_ALT_PAL;
player_normpal();
pose_a9(0,0);
ground_ochar();
current_proc->pdata.p_ganiy=(current_proc->pa8)->oypos.u.intpos;
current_proc->joyindex=JI_JOY_IGNORE;
stack_jump(joy_proc);
}
/******************************************************************************
Function: void joy_proc(void)
By: David Schwartz
Date: Sept 1994
Parameters: None
Returns: None
Description: Joystick control routine for players
This routine was translated from the TMS code. This code has multiple reentrant points
and assumes the abilty to reset the stack pointer at any time. This cannot be done in C
without using a lot of extended GNU-C extensions. Therefore the routine was designed to
emulate the assembly as closly as possible. That is why the code breaks all of C's rules!
******************************************************************************/
void joy_proc(void)
{
WORD results;
long joytemp;
OBJECT *obj=current_proc->pa8;
static void *jumptbl[] =
{
&&JOY_PROC,
&&JOY_ENTRY,
&&JOY_FLIP_PUNCH,
&&JOY_FLIP_KICK,
&&JOY_UPPERCUT,
&&JOY_DUCK_PUNCH,
&&JOY_DUCK_BLOCK,
&&JOY_DUCK_KICKH,
&&JOY_DUCK_KICKL,
&&JOY_HI_PUNCH,
&&JOY_LO_PUNCH,
&&JOY_BLOCK,
&&JOY_HI_KICK,
&&JOY_LO_KICK,
&&JUMPUP_PUNCH,
&&JUMPUP_KICK,
&&JOY_UP,
&&JOY_DOWN,
&&JOY_GETUP_ENTRY,
&&JOY_BACK_UP,
&&JOY_DUCK_BLOCK_LOOP,
&&JOY_BLOCK_LOOP
};
WORD jumpindex;
jumpindex=current_proc->joyindex;
current_proc->joyindex=0;
goto *jumptbl[jumpindex];
JOY_PROC:
stuff_buttons(obj,bt_stance);
current_proc->pdata.p_flags |=PM_JOY; // flag: i am a joystick dude
process_sleep(1);
JOYB4:
wait_for_start(); // stance until fight begins
JOY_ENTRY:
enable_all_buttons; // allow all buttons to be valid
if ((JOYSTICK_IN_A0(current_proc) & MASK_JDOWN)==0)
goto JOYE4;
if (get_my_height()<=SCY(0x60)) // fighter is not standing
goto JOY_DUCK_ENTRY;
else goto JOY_DOWN; // fighter is standing
JOYE4:
current_proc->pdata.p_downcount=0; // not down anymore
stance_setup();
/************************************
* STANCE JOYSTICK *
************************************/
JOY_STANCE_LOOP:
while (TRUE)
{
if (am_i_facing_him()==SYSTEM_CARRY_CLR)
{
turn_around(); // face the chump
goto LOCAL_REACTION_EXIT;
}
JOYE5:
check_winner_status(); // still fighting?
if (f_start==0)
goto JOYB4;
process_sleep(1);
if (check_block_bit()==SYSTEM_CARRY_SET) // block?
goto JOY_BLOCK;
if (JOYSTICK_IN_A0(current_proc) & MASK_JRIGHT) // right?
goto JOY_RIGHT;
if (JOYSTICK_IN_A0(current_proc) & MASK_JLEFT) // left?
goto JOY_LEFT;
if (JOYSTICK_IN_A0(current_proc) & MASK_JUP) // up?
goto JOY_UP;
if (JOYSTICK_IN_A0(current_proc) & MASK_JDOWN) // down?
goto JOY_DOWN;
back_to_shang_check();
next_anirate();
}
/************************************
* LEFT/RIGHT JOYSTICK *
************************************/
JOY_LEFT:
current_proc->pdata.p_store4=MASK_JLEFT; // store joystick mask
current_proc->a4=M_FLIPH ^ (M_FLIPH & obj->oflags);
goto JOYR2;
JOY_RIGHT:
current_proc->pdata.p_store4=MASK_JRIGHT; // store joystick mask
current_proc->a4=(M_FLIPH & obj->oflags);
JOYR2:
current_proc->pdata.p_action=0; // no more stance
(LONG)current_proc->pa9=ANIM_WALKF;
if (current_proc->a4!=0) // get walk info
(LONG)current_proc->pa9=get_walk_info_b();
else
{
if (is_run_pressed(obj)==SYSTEM_CARRY_SET)
goto JOY_RUN;
else (LONG)current_proc->pa9=get_walk_info_f();
}
/* JOYR4 */
init_anirate(current_proc->a0);
set_x_vel(obj,current_proc->a1);
current_proc->pdata.p_store1=(LONG)current_proc->pa9; // store walk ani offset here
current_proc->pdata.p_anitab=(ADDRESS *)get_char_ani(ANIM_TABLE1,(LONG)current_proc->pa9);
JOYR6:
do
{
process_sleep(1);
WALKWAKE:
check_winner_status();
if ((LONG)current_proc->pdata.p_store1==ANIM_WALKF && is_run_pressed(obj)==SYSTEM_CARRY_SET)
goto JOY_RUN;
JOYR8:
/* check for jump angles */
switch (angle_scan())
{
case ANG_JUP_RIGHT:
goto JOY_UPRIGHT;
break;
case ANG_JUP_LEFT:
goto JOY_UPLEFT;
break;
};
/* walk flip check */
if (am_i_facing_him()==SYSTEM_CARRY_CLR)
{
turn_around();
goto LOCAL_REACTION_EXIT;
}
next_anirate();
}
while(MASK_JOYSTICK(current_proc)); // still pressed --> walk again
/* joystick was released */
(long)current_proc->a0=abs((long)(current_proc->pdata.p_anitab-(ADDRESS *)current_proc->pa9));
if ((long)current_proc->a0<3) // walk frame # on, skip or stop
{
// /* skip */
// (LONG)current_proc->pa9=(LONG)current_proc->pdata.p_store1+1;
// get_char_ani(ANIM_TABLE1,(LONG)current_proc->pa9); // skip animation offset
// (ADDRESS *)current_proc->pa9=(ADDRESS *)current_proc->pa9+current_proc->a0; // spot to finish off skip ani
//
// animate_a0_frames(6,2); // slower skip now!! & finish skip ani
}
JOYR7:
stop_me(obj);
goto LOCAL_REACTION_EXIT;
/************************************
* RUN JOYSTICK *
************************************/
JOY_RUN:
run_setup();
JRUN3:
process_sleep(1);
/* angle_scan routine */
switch (angle_scan())
{
case ANG_JUP_RIGHT:
goto JOY_UPRIGHT;
break;
case ANG_JUP_LEFT:
goto JOY_UPLEFT;
break;
};
next_anirate();
check_winner_status();
if (reduce_turbo_bar()==SYSTEM_ZERO_SET)
goto JOYR7;
(long)current_proc->a5=-SCX(0x80000);
if (JOYSTICK_IN_A0(current_proc) & MASK_JRIGHT) // right
goto JRUN5;
if (JOYSTICK_IN_A0(current_proc) & MASK_JLEFT) // left
{
(long)current_proc->a5=-(long)current_proc->a5;
goto JRUN5;
}
else goto JOYR7; // neither = abort
JRUN5:
if (obj->oxvel.pos==(long)current_proc->a5) // we are heading in wrong direction, exit
goto JOYR7;
if (MASK_JOYSTICK(current_proc))
goto JRUN3;
else goto JOYR7;
/************************************
* UP JOYSTICK *
************************************/
JOY_UP:
face_opponent(obj);
disable_all_buttons;
/* check for jump angles */
switch (angle_scan())
{
case ANG_JUP_RIGHT:
goto JOY_UPRIGHT;
break;
case ANG_JUP_LEFT:
goto JOY_UPLEFT;
break;
};
stuff_buttons(obj,bt_jump);
current_proc->a10=(long)distance_from_ground(obj);
do_jump_up(NULL);
reaction_exit(obj);
/************************************
* DUCK DOWN JOYSTICK *
************************************/
JOY_DUCK_ENTRY:
get_char_ani(ANIM_TABLE1,ANIM_DUCK);
/* set to duck frame */
(LONG *)current_proc->pa9=((LONG *)current_proc->pa9)+2;
do_next_a9_frame(obj);
goto JOYD3;
/************************************
* DOWN JOYSTICK *
************************************/
JOY_DOWN:
disable_all_buttons;
do_duck();
/************************************
* GETUPJOYSTICK *
************************************/
JOY_GETUP_ENTRY:
JOYD3:
stuff_buttons(obj,bt_duck);
JOYD4:
current_proc->pdata.p_action=ACT_DUCK; // reset action !!
process_sleep(1);
/* facing him check */
if (am_i_facing_him()==SYSTEM_CARRY_CLR)
{
duck_turnaround(); // no, so turnaround
goto JOYD3;
}
JOYD5:
inc_downcount(current_proc); // count duck time
if (check_block_bit()==SYSTEM_CARRY_SET) // block?
goto JOY_DUCK_BLOCK;
check_winner_status(); // scan for "end of round" while ducking
if (JOYSTICK_IN_A0(current_proc) & MASK_JDOWN) // stay down while stick==DOWN
goto JOYD4;
JOY_BACK_UP:
disable_all_buttons;
face_opponent(obj);
do_backup();
goto LOCAL_REACTION_EXIT; // return to normal
/************************************
* DUCK BLOCK JOYSTICK *
************************************/
JOY_DUCK_BLOCK:
disable_all_buttons;
JDBLK2:
do_duck_block();
JOY_DUCK_BLOCK_LOOP:
process_sleep(1);
if (am_i_facing_him()==SYSTEM_CARRY_CLR)
{
duck_turnaround();
goto JDBLK2;
}
JDBLK5:
if ((JOYSTICK_IN_A0(current_proc) & MASK_JDOWN)==0) // stay down while stick==DOWN
goto JOY_BACK_UP;
inc_downcount(current_proc); // count duck time
check_winner_status(); // scan for "end of round" while ducking
current_proc->pdata.p_action=ACT_BLOCKLO; // reset action
if (check_block_bit()==SYSTEM_CARRY_SET) // still holding block?
goto JOY_DUCK_BLOCK_LOOP; // yes, loop
/* joy un - duck block */
current_proc->pdata.p_action=ACT_DUCK;
backwards_ani(3,ANIM_DUCKBLOCK);
find_ani_last_frame(ANIM_DUCK);
do_next_a9_frame(obj);
goto JOYD3;
/************************************
* UP LEFT JOYSTICK *
************************************/
JOY_UPLEFT:
angle_abuse_check();
do_flip(ANIM_FFLIP,ANIM_BFLIP,-SCX(0x40000),-SCX(0x70000));
goto LOCAL_REACTION_EXIT;
/************************************
* UP RIGHT JOYSTICK *
************************************/
JOY_UPRIGHT:
angle_abuse_check();
do_flip(ANIM_BFLIP,ANIM_FFLIP,SCX(0x40000),SCX(0x70000));
goto LOCAL_REACTION_EXIT;
/************************************
* BLOCK JOYSTICK *
************************************/
JOY_BLOCK:
disable_all_buttons;
face_opponent(obj);
do_block_hi();
JOY_BLOCK_LOOP:
process_sleep(1);
if (JOYSTICK_IN_A0(current_proc) & MASK_JDOWN)
goto JOY_DOWN;
if (am_i_facing_him()==SYSTEM_CARRY_CLR)
{
turn_around(); // face your rival
goto LOCAL_REACTION_EXIT;
}
if (check_block_bit()==SYSTEM_CARRY_SET)
goto JOY_BLOCK_LOOP;
do_unblock_hi();
goto LOCAL_REACTION_EXIT;
/************************************
* HI PUNCH JOYSTICK *
************************************/
JOY_HI_PUNCH:
disable_all_buttons;
me_in_front();
if (elbow_check()==SYSTEM_CARRY_SET)
goto JOY_ELBOW;
stop_me(obj);
get_char_ani(ANIM_TABLE1,ANIM_HIPUNCH);
JHP4:
(LONG)current_proc->pdata.p_store3=get_last_button();
current_proc->pdata.p_stk=2;
group_sound(0); // group speech: quick attack
rsnd_whoosh();
/* act_mframew */
act_mframew(ACT_HIPUNCH,3);
if (f_thatsall!=0)
goto JOY_UN_HI_PUNCH1; // round is over --> exit
/* strike collision detection */
current_proc->a10=0; // flag: hi punch
joytemp=punch_strike_check(2);
JHP2:
if ((joytemp=punch_sleep(5,joytemp))==SYSTEM_CARRY_CLR)
goto JOY_UN_HI_PUNCH1;
if ((((LONG)(current_proc->a0))>>16)==SW_LO_PUNCH)
{
/* JOY_PUNCH_HTM1 */ // interupted by med punch!!
find_ani_part2(ANIM_HIPUNCH); // pa9 --> part 2
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
goto JMP5;
}
if ((((LONG)(current_proc->a0))>>16)!=SW_HI_PUNCH)
goto JOY_UN_HI_PUNCH1; // non-hi-punch ---> finish punch
JHP5:
(LONG)current_proc->pdata.p_store3=get_last_button();
group_sound(0); // group speech: quick attack
rsnd_whoosh();
current_proc->pdata.p_stk=2;
/* act_mframew */
act_mframew(ACT_HIPUNCH,3);
if (f_thatsall!=0)
goto JOY_UN_HI_PUNCH2; // round is over --> exit
/* strike collision detection */
if (strike_check_a0(obj,2)==SYSTEM_CARRY_CLR) // strike: hipunch #1
joytemp=2;
else joytemp=-1; // collision = dont check for more
JHP6:
if ((joytemp=punch_sleep(5,joytemp))==SYSTEM_CARRY_CLR)
goto JOY_UN_HI_PUNCH2;
if ((((LONG)(current_proc->a0))>>16)==SW_LO_PUNCH)
{
/* JOY_PUNCH_HTM2 */ // interupted by med punch!!
find_ani_part2(ANIM_HIPUNCH); // pa9 --> part 2
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
goto JMP4;
}
if ((((LONG)(current_proc->a0))>>16)==SW_HI_PUNCH)
goto JHP4; // non-hi-punch --> finish punch
JOY_UN_HI_PUNCH2:
find_ani_part2(ANIM_HIPUNCH); // pa9 --> part 2
find_part2(); // pa9 --> part 3
goto UNHIP1;
JOY_UN_HI_PUNCH1:
find_ani_part2(ANIM_HIPUNCH); // pa9 --> part 2
UNHIP1:
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> un_hipunch
mframew(3-1);
goto LOCAL_REACTION_EXIT; // return to normal
/************************************
* ELBOW ATTACK *
************************************/
JOY_ELBOW:
do_elbow();
goto LOCAL_REACTION_EXIT;
/************************************
* JOY LOW PUNCH *
************************************/
JOY_LO_PUNCH:
stop_me(obj);
disable_all_buttons;
if (toss_check(obj,SCX(0x040))==SYSTEM_CARRY_SET)
{
stack_jump(joy_toss);
}
me_in_front();
get_char_ani(ANIM_TABLE1,ANIM_LOPUNCH);
JMP4:
(LONG)current_proc->pdata.p_store3=get_last_button();
current_proc->pdata.p_stk=3;
group_sound(0); // group speech: quick attack
rsnd_whoosh();
/* act_mframew */
act_mframew(ACT_LOPUNCH,3); // lo punch
if (f_thatsall)
goto JOY_UN_LO_PUNCH1; // round is over --> exit
current_proc->a10=1; // flag: med punch
if (strike_check_a0(obj,3)==SYSTEM_CARRY_CLR) // strike: med punch strike #1
joytemp=3;
else joytemp=-1; // collision = dont check for more
JMP2:
if ((joytemp=punch_sleep(5,joytemp))==SYSTEM_CARRY_CLR)
goto JOY_UN_LO_PUNCH1;
if ((((LONG)(current_proc->a0))>>16)==SW_HI_PUNCH)
{
/* JOY_PUNCH_MTH1 */ // interupted by hi punch!!
find_ani_part2(ANIM_LOPUNCH); // pa9 --> part 2
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
goto JHP5;
}
if ((((LONG)(current_proc->a0))>>16)!=SW_LO_PUNCH)
goto JOY_UN_LO_PUNCH1; // non-med-punch ---> finish punch
JMP5:
(LONG)current_proc->pdata.p_store3=get_last_button();
current_proc->pdata.p_stk=3;
group_sound(0); // group speech: quick attack
rsnd_whoosh();
/* act_mframew */
act_mframew(ACT_LOPUNCH,3);
if (f_thatsall!=0)
goto JOY_UN_LO_PUNCH2; // round is over --> exit
/* strike collision detection */
if (strike_check_a0(obj,2)==SYSTEM_CARRY_CLR) // strike: med punch #2
joytemp=2;
else joytemp=-1; // collision = dont check for more
JMP6:
if ((joytemp=punch_sleep(5,joytemp))==SYSTEM_CARRY_CLR)
goto JOY_UN_LO_PUNCH2;
if ((((LONG)(current_proc->a0))>>16)==SW_HI_PUNCH)
{
/* JOY_PUNCH_MTH2 */ // interupted by hi punch!!
find_ani_part2(ANIM_LOPUNCH); // pa9 --> part 2
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
find_part2(); // pa9 --> part 3
goto JHP4;
}
if ((((LONG)(current_proc->a0))>>16)==SW_LO_PUNCH)
goto JMP4; // non-med-punch --> finish punch
JOY_UN_LO_PUNCH2:
find_ani_part2(ANIM_LOPUNCH); // pa9 --> part 2
find_part2(); // pa9 --> part 3
goto UNHIP1;
JOY_UN_LO_PUNCH1:
find_ani_part2(ANIM_LOPUNCH); // pa9 --> part 2
goto UNHIP1;
/************************************
* JOY UPPERCUT *
************************************/
JOY_UPPERCUT:
disable_all_buttons;
do_uppercut();
goto LOCAL_REACTION_EXIT;
/************************************
* JOY DUCK PUNCH *
************************************/
JOY_DUCK_PUNCH:
disable_all_buttons;
do_duck_punch();
if (JOYSTICK_IN_A0(current_proc) & MASK_JDOWN)
goto JOYD3; // stay down while stick = down
else goto JOY_BACK_UP;
/************************************
* JOY HI KICK *
************************************/
JOY_HI_KICK:
disable_all_buttons;
if (is_stick_away(current_proc)==SYSTEM_CARRY_SET)
{
/* JOY_ROUNDHOUSE */
do_roundhouse();
}
else
{
if (knee_check()==SYSTEM_CARRY_SET)
goto JOY_KNEE;
do_hi_kick();
}
goto LOCAL_REACTION_EXIT; // return to normal control
/************************************
* JOY LO KICK *
************************************/
JOY_LO_KICK:
disable_all_buttons;
if (knee_check()==SYSTEM_CARRY_SET)
goto JOY_KNEE;
if (is_stick_away(current_proc)==SYSTEM_CARRY_SET)
do_sweep_kick();
else do_lo_kick();
goto LOCAL_REACTION_EXIT;
/************************************
* JOY KNEE *
************************************/
JOY_KNEE:
do_knee();
goto LOCAL_REACTION_EXIT;
/************************************
* JOY DUCK KICKH *
************************************/
JOY_DUCK_KICKH:
do_duck_kickh();
results=current_proc->a0;
current_proc->pdata.p_action=ACT_RET_KICK;
if (results==SYSTEM_CARRY_SET)
process_sleep(16); // connect sleep time
else process_sleep(8); // no connect sleep time
retract_strike(4);
current_proc->pdata.p_downcount+=0x26; // count kick time as "down time"
/* POST_JOY_DUCK_KICK */
if (JOYSTICK_IN_A0(current_proc) & MASK_JDOWN)
goto JOYD3; // stay down while stick = down
else goto JOY_BACK_UP;
/************************************
* JOY DUCK KICKL *
************************************/
JOY_DUCK_KICKL:
do_duck_kickl();
current_proc->pdata.p_action=ACT_RET_KICK;
if (is_he_joy()==SYSTEM_CARRY_SET)
process_sleep(6);
else process_sleep(10);
retract_strike(2);
current_proc->pdata.p_downcount+=0x8; // count kick time as "down time"
/* POST_JOY_DUCK_KICK */
if (JOYSTICK_IN_A0(current_proc) & MASK_JDOWN)
goto JOYD3; // stay down while stick = down
else goto JOY_BACK_UP;
/************************************
* JOY FLIP PUNCH *
************************************/