1# package Maci;
2
3# UPi's images are scaled by a factor of 0.8
4
5require 'DataHelper.pl';
6use strict;
7
8sub LoadMaci
9{
10	my ( @Frames, %FrameLookup, %Frames, %States, %Shorthands,
11		$Doodad, $Con, $Con2,
12		@States1,
13		$framedesc, $key, $value, $framename, $nextst, $st, $lastchar, $nextchar, $codename );
14
15$codename = 'Macy';
16
17@Frames = LoadFrames( "$codename.dat.txt", 316, 90 );
18%FrameLookup = CreateFrameLookup( scalar @Frames -1,
19"start",		23,		"stand",		5,		"walk",			14,
20"turn",			9,		"falling",		12,		"laying",		1,
21"getup",		18,		"hurt",			13,		"swept",		8,
22"won",			17,		"block",		5,		"kneeling",		4,
23"onknees",		4,		"kneelingpunch",5,		"kneelingkick",	6,
24"fun",			9,		"threat",		8,
25"highpunch",	5,		"lowpunch",		6,		"highkick",		7,
26"lowkick",		6,		"sweep",		8,		"groinkick",	10,
27"kneekick",		7,		"elbow",		6,		"spin",			11,
28"grenade",		10,		"uppercut",		8,		"throw",		15,
29"highpunched",	8,		"lowpunched",	6,		"groinkicked",	14,
30"kneelingpunched",8,	"kneelingkicked", 6,	"thrown",		12,
31"scissorkick",	15
32);
33
34
35$Doodad =
36	{	'T'		=> 1,
37		'W'		=> 64,
38		'H'		=> 64,
39		'SX'	=> 15,
40		'SY'	=> 0,
41		'FRAMES'=> 6,
42		'SA'	=> 1/25,
43	};
44
45
46$Con = {
47'forw'=>'Walk',
48'back'=>'Back',
49'jump'=>'Jump',
50'jumpfw'=>'JumpFW',
51'jumpbw'=>'JumpBW',
52'block'=>'Block',
53'down'=>'Kneeling',
54
55'hpunch'=>'HighPunch',
56'lpunch'=>'LowPunch',
57'hkick'=>'HighKick',
58'lkick'=>'LowKick',
59'lkickBF'=>'GroinKick',
60'lkickF'=>'KneeKick',
61'hpunchD'=>'Uppercut',
62'hpunchF'=>'Elbow',
63'hkickB'=>'Spin',
64'lkickB'=>'Sweep',
65
66'hkickFF'=>'ScissorKick',
67'lpunchBD'=>'Grenade',
68
69};
70
71
72$Con2 = {
73'lkick'=>'KneelingKick',
74'hkick'=>'KneelingKick',
75'hpunch'=>'KneelingUppercut',
76'lpunch'=>'KneelingPunch',
77};
78
79
80
81@States1 = (
82# 1. BASIC MOVES
83
84{ 'N'=>'Start',			'DEL'=>5,	'S'=>'+start' },
85{ 'N'=>'Stand',			'DEL'=>7,	'S'=>'+stand,_stand', 'CON'=>$Con, 'SITU'=>'Ready' },
86{ 'N'=>'Turn',			'DEL'=>5,	'S'=>'+turn',	'TURNN'=>1, },
87{ 'N'=>'Hurt',			'DEL'=>8,	'S'=>'+hurt, hurt 2-1' },
88{ 'N'=>'Won',			'DEL'=>8,	'S'=>'+won',	'NEXTSTN'=> 'Won2' },
89{ 'N'=>'Won2',			'DEL'=>1000,'S'=>'won n',	'NEXTST'=>'Won2', },
90{ 'N'=>'Fun',			'DEL'=>7,	'S'=>'+fun,-fun', 'CON'=>$Con, 'SITU'=>'Ready' },
91{ 'N'=>'Threat',		'DEL'=>7,	'S'=>'threat 2-n, threat n-2', 'CON'=>$Con, 'SITU'=>'Ready' },
92WalkingFrames( \%FrameLookup, \@Frames, 1, 106, $Con ),
93BlockStates( FindLastFrame( \%FrameLookup, 'block' ), 5 ),
94KneelingStates( FindLastFrame( \%FrameLookup, 'kneeling' ),
95	FindLastFrame( \%FrameLookup, 'onknees' ), 7, $Con2 ),
96JumpStates( \%FrameLookup,
97	{'lkick'=>'JumpKick', 'hkick'=>'JumpKick',
98	'lpunch'=>'JumpPunch', 'hpunch'=>'JumpPunch'} ),
99
100# 2. OFFENSIVE MOVES
101
102{ 'N'=>'KneelingPunch',	'DEL'=>5,	'S'=>'+kneelingpunch,-kneelingpunch', 'SITU'=>'Crouch',
103	'HIT'=>'Hit', 'NEXTSTN'=>'Onknees' },
104{ 'N'=>'KneelingKick',	'DEL'=>5,	'S'=>'+kneelingkick,-kneelingkick', 'SITU'=>'Crouch',
105	'HIT'=>'Hit', 'NEXTSTN'=>'Onknees' },
106{ 'N'=>'KneelingUppercut','DEL'=>5,	'S'=>'kneeling 4-3,uppercut 6-n,-uppercut',
107	'HIT'=>'Uppercut' },
108{ 'N'=>'HighPunch',		'DEL'=>5,	'S'=>'+highpunch,-highpunch',
109	'HIT'=>'Highhit' },
110{ 'N'=>'LowPunch',		'DEL'=>5,	'S'=>'+lowpunch,-lowpunch',
111	'HIT'=>'Hit' },
112{ 'N'=>'HighKick',		'DEL'=>5,	'S'=>'+highkick,-highkick',
113	'HIT'=>'Hit' },
114{ 'N'=>'LowKick',		'DEL'=>5,	'S'=>'+lowkick,-lowkick',
115	'HIT'=>'Leghit' },
116{ 'N'=>'GroinKick',		'DEL'=>5,	'S'=>'groinkick 1-7,groinkick 7-1, groinkick 8-10, groinkick 10-8',
117	'HIT'=>'Groinhit', 'DEL15'=>8, 'DEL16'=>8, 'DEL17'=>8, 'DEL18'=>8, 'DEL19'=>8, 'DEL20'=>8,  },
118{ 'N'=>'KneeKick',		'DEL'=>5,	'S'=>'+kneekick,-kneekick',
119	'HIT'=>'Hit' },
120{ 'N'=>'Elbow',			'DEL'=>5,	'S'=>'+elbow,-elbow',
121	'HIT'=>'Highhit' },
122{ 'N'=>'Spin',			'DEL'=>7,	'S'=>'+spin',
123	'HIT'=>'Hit' },
124{ 'N'=>'Sweep',			'DEL'=>7,	'S'=>'+sweep,-sweep',
125	'HIT'=>'Hit' },
126{ 'N'=>'Grenade',		'DEL'=>5,	'S'=>'+grenade, grenade 1',
127	'DEL7'=>15, 'DOODAD'=>'ZoliShot' },
128{ 'N'=>'Uppercut',		'DEL'=>5,	'S'=>'+uppercut,-uppercut',
129	'HIT'=>'Uppercut' },
130{ 'N'=>'Throw',			'DEL'=>8,	'S'=>'+throw' },
131
132{ 'N'=>'ScissorKick',	'DEL'=>5,	'S'=>'+scissorkick',
133	'HIT'=>'Uppercut',
134	'MOVE5'=>3, 'MOVE6'=>4, 'MOVE7'=>4, 'MOVE8'=>4, 'MOVE9'=>4, 'MOVE10'=>4, 'MOVE11'=>3},
135
136# 3. HURT MOVES
137
138{ 'N'=>'Falling',		'DEL'=>5,	'S'=>'+falling, laying 1',
139	'DELN'=>500, 'NEXTN'=>'Laying', 'SITU'=>'Falling', },
140{ 'N'=>'Laying',		'DEL'=>1000,'S'=>'+laying',
141	'SITU'=>'Falling' },
142{ 'N'=>'Getup',			'DEL'=>5,	'S'=>'+getup',
143	'SITU'=>'Falling',
144	'CON9'=>{'down'=>'Onknees'},
145	'CON10'=>{'down'=>'Onknees'},
146},
147{ 'N'=>'Dead',			'DEL'=>10000, 'S'=>'laying 1',
148	'SITU'=>'Falling', 'NEXTST'=>'Dead' },
149
150{ 'N'=>'Swept',			'DEL'=>5,	'S'=>'+swept,-swept' },
151
152{ 'N'=>'KneelingPunched', 'DEL'=>5,	'S'=>'+kneelingpunched',
153	'SITU'=>'Crouch', 'NEXTSTN'=>'Onknees' },
154{ 'N'=>'KneelingKicked', 'DEL'=>5,	'S'=>'+kneelingkicked, -kneelingkicked',
155	'SITU'=>'Crouch', 'NEXTSTN'=>'Onknees' },
156
157{ 'N'=>'HighPunched',	'DEL'=>8,	'S'=>'+highpunched' },
158{ 'N'=>'LowPunched',	'DEL'=>5,	'S'=>'+lowpunched,-lowpunched' },
159{ 'N'=>'GroinKicked',	'DEL'=>7,	'S'=>'+groinkicked' },
160{ 'N'=>'Thrown',		'DEL'=>5,	'S'=>'+thrown' },
161
162);
163
164
165
166# 2. CREATE STATES
167
168foreach $framedesc (@States1)
169{
170	AddStates( \%States, \%FrameLookup, $framedesc );
171}
172
173
174
175# Automatically add NEXTST for states which don't have one.
176
177FixStates( \%FrameLookup, \%States );
178
179TravelingStates( \%FrameLookup, \@Frames, \%States, "falling", 1, 13 );
180TravelingStates( \%FrameLookup, \@Frames, \%States, "getup", 0, 0 );
181TravelingStates( \%FrameLookup, \@Frames, \%States, "spin", 0, 0 );
182
183%States = ( FindShorthands( \%States ), %States );
184
185# %::MaciStates = %States;
186# @::MaciFrames = @Frames;
187
188::RegisterFighter( {
189	'ID'			=> 6,
190	'GENDER'		=> 2,
191	'DATAVERSION'	=> 1,
192	'STARTCODE'		=> sub {},
193	'FRAMES'		=> \@Frames,
194	'STATES'		=> \%States,
195	'CODENAME'		=> $codename,
196	'DATASIZE'		=> 5151824,
197} );
198
199}
200
201LoadMaci();
202
203return 1;
204
205