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