Page MenuHomePhabricator (Chris)

No OneTemporary

Size
112 KB
Referenced Files
None
Subscribers
None
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/data/script/Backend.pl b/data/script/Backend.pl
index 58832a3..5ad1f7a 100644
--- a/data/script/Backend.pl
+++ b/data/script/Backend.pl
@@ -1,610 +1,601 @@
#!/usr/bin/perl -w
# PERL backend for the game
=comment
This is the main perl backend for Mortal Szombat. It loads the other files,
compiles characters, creates shared variables.
1. FIGHTER ACTIONS
1.1. BASIC MOVEMENT 1.2. OFFENSIVE MOVES 1.3. HURT MOVES
Start KneelingPunch Falling
Stand KneelingKick Laying
Walk KneelingUppercut Getup
Back HighPunch HighPunched
Turn LowPunch LowPunched
Hurt HighKick GroinKicked
Block LowKick KneelingPunched
Kneeling Sweep KneelingKicked
Onknees GroinKick Thrown
Jump KneeKick Dead
JumpFW Elbow
JumpBW Grenade
Fun Uppercut
Threat Throw
[fighter-specific stuff]
=cut
=comment
MAIN CONSTANTS
=cut
$GAMEBITS = 3; # Number of oversampling bits in coordinates
$GAMEBITS2 = 1 << $GAMEBITS; # 2^(oversampling)
$SCRWIDTH = 640; # The physical horizontal screen resolution
$SCRHEIGHT = 480; # The physical vertical screen resolution
$SCRWIDTH2 = ($SCRWIDTH << $GAMEBITS); # The logical horizontal screen resolution
$SCRHEIGHT2 = ($SCRHEIGHT << $GAMEBITS); # The logical vertical screen resolution
-$MOVEMARGIN2= 50 << $GAMEBITS; # The logical border for figthers.
+$MOVEMARGIN2= 50 << $GAMEBITS; # The logical border for fighters.
$BGWIDTH2 = 1920 << $GAMEBITS; # The logical background width
$BGHEIGHT2 = 480 << $GAMEBITS; # The logical background height
$GROUND2 = 160 << $GAMEBITS; # The logical ground level.
$DELMULTIPLIER = 1; # DEL values in states are multiplied by this.
$MAXCOMBO = 5; # Maximum combo count.
$BgMax = $BGWIDTH2 - $SCRWIDTH2; # The logical maximum camera position
$BgSpeed = 0; # The current speed of the background movement
$BgPosition = $BgMax >> 1; # The logical camera position
$BgScrollEnabled = 1; # Can the background scroll?
$HitPointScale = 10; # Scale the hit points by this.
$NextDoodad = 0; # The next doodad to process
$Debug = 0;
require 'PlayerInput.pl';
require 'Fighter.pl';
require 'FighterStats.pl';
require 'Doodad.pl';
require 'Keys.pl';
require 'State.pl';
+require 'Translate.pl';
=comment
MAIN OBJECTS
=cut
$Fighter1 = Fighter->new();
$Fighter2 = Fighter->new();
$Fighter1->{NUMBER} = 0;
$Fighter1->{OTHER} = $Fighter2;
$Fighter2->{NUMBER} = 1;
$Fighter2->{OTHER} = $Fighter1;
@Fighters = ( $Fighter1, $Fighter2 );
=comment
VARIABLES FOR DRAWING THE SCENE
=cut
$p1x = 10; # Player 1 X position
$p1y = 100; # Player 1 Y position
$p1f = 10; # Player 1 frame
$p1h = 100; # Player 1 HP
$p2x = 400; # Player 2 X position
$p2y = 100; # Player 2 Y position
$p2f = -40; # Player 2 frame. Negative means flipped.
$p2h = 100; # Player 2 HP
$bgx = 0; # Background X position
$bgy = 0; # Background Y position
$time = 0; # Current game time
$over = 0; # Is the game over?
$ko = 0; # Is one fighter knocked down?
$doodad_x = -1; # Doodad X position
$doodad_y = -1; # Doodad Y position
$doodad_t = -1; # Doodad type
$doodad_f = -1; # Doodad frame number
$doodad_dir = 0; # The direction of the doodad; 1: normal; -1: flipped
$doodad_gfxowner = -1; # 0: first player; 1: second player; 2: Global doodad
$doodad_text = ''; # The text of type 0 doodads.
=comment
JUDGEMENT METHODS
=cut
sub JudgementStart
{
$bgx = 0;
$bgy = ( $SCRHEIGHT2 - $BGHEIGHT2 ) >> 1;
$BgSpeed = 0;
$BgPosition = 0;
$BgScrollEnabled = 0;
$OverTimer = 0;
$JudgementMode = 1;
$Debug = 0;
($JudgementWinner) = @_;
ResetEarthquake();
$time = 0;
$over = 0;
$Fighter1->Reset();
$Fighter1->{X} = ($JudgementWinner ? 150 : 520 ) * $GAMEBITS2;
$Fighter1->{DIR} = ($JudgementWinner ? 1 : -1 );
$Fighter1->{NEXTST} = 'Stand';
$Fighter1->Update();
$Fighter2->Reset();
$Fighter2->{X} = ($JudgementWinner ? 520 : 150 ) * $GAMEBITS2;
$Fighter2->{DIR} = ($JudgementWinner ? -1 : 1 );
$Fighter2->{NEXTST} = 'Stand';
$Fighter2->Update();
$Input1->Reset();
$Input2->Reset();
}
=comment
PLAYER SELECTION METHODS
=cut
sub SelectStart
{
$bgx = 0;
$bgy = ( $SCRHEIGHT2 - $BGHEIGHT2 ) >> 1;
$BgSpeed = 0;
$BgPosition = 0;
$BgScrollEnabled = 0;
$OverTimer = 0;
$JudgementMode = 0;
$Debug = 0;
ResetEarthquake();
$time = 0;
$over = 0;
-
- $Fighter1->Reset();
- $Fighter1->{X} = 80 * $GAMEBITS2;
- $Fighter1->{NEXTST} = 'Stand';
- $Fighter1->Update();
-
- $Fighter2->Reset();
- $Fighter2->{X} = 560 * $GAMEBITS2;
- $Fighter2->{NEXTST} = 'Stand';
- $Fighter2->Update();
+
+ if ( $Fighter1->{OK} )
+ {
+ $Fighter1->Reset();
+ $Fighter1->{X} = 80 * $GAMEBITS2;
+ $Fighter1->{NEXTST} = 'Stand';
+ $Fighter1->Update();
+ }
+ if ( $Fighter2->{OK} )
+ {
+ $Fighter2->Reset();
+ $Fighter2->{X} = 560 * $GAMEBITS2;
+ $Fighter2->{NEXTST} = 'Stand';
+ $Fighter2->Update();
+ }
$Input1->Reset();
$Input2->Reset();
}
sub SetPlayerNumber
{
my ($player, $fighterenum) = @_;
my ($f);
DeleteDoodadsOf( $player );
$f = $player ? $Fighter2 : $Fighter1;
-=comment
- if ( $fighterenum eq 1 ) { $f->Reset('Ulmar', \@UlmarFrames,\%UlmarStates); }
- elsif ( $fighterenum eq 2 ) { $f->Reset('UPi', \@UPiFrames,\%UPiStates); }
- elsif ( $fighterenum eq 3 ) { $f->Reset('Zoli', \@ZoliFrames,\%ZoliStates); }
- elsif ( $fighterenum eq 4 ) { $f->Reset('Cumi', \@CumiFrames,\%CumiStates); }
- elsif ( $fighterenum eq 5 ) { $f->Reset('Sirpi', \@SirpiFrames,\%SirpiStates); }
- elsif ( $fighterenum eq 6 ) { $f->Reset('Maci', \@MaciFrames,\%MaciStates); }
- elsif ( $fighterenum eq 7 ) { $f->Reset('Bence', \@BenceFrames,\%BenceStates); }
- elsif ( $fighterenum eq 9 ) { $f->Reset('Descant', \@DescantFrames,\%DescantStates); }
- elsif ( $fighterenum eq 8 ) { $f->Reset('Grizli', \@GrizliFrames,\%GrizliStates); }
- else {
- # Fallback
- $f->Reset('Zoli', \@ZoliFrames,\%ZoliStates);
- }
-=cut
$f->Reset($fighterenum);
$f->{NEXTST} = 'Stand';
$f->Update();
$::PlayerName = $::FighterStats[$fighterenum]->{NAME};
}
sub PlayerSelected
{
my ($number) = @_;
my ($f) = $number ? $Fighter2 : $Fighter1;
$f->Event( 'Won' );
$f->Update();
}
=comment
EARTHQUAKE RELATED METHODS
=cut
@QUAKEOFFSET = ( 0, 6, 11, 15,
16, 15, 11, 6,
0, -6,-11,-15,
-16,-15,-11, -6, 0, 6 );
sub ResetEarthquake
{
$QuakeAmplitude = 0;
$QuakeOffset = 0;
$QuakeX = 0;
$QuakeY = 0;
}
sub AddEarthquake
{
my ($amplitude) = @_;
$QuakeAmplitude += $amplitude;
$QuakeAmplitude = 20 if ( $QuakeAmplitude > 20 );
}
sub AdvanceEarthquake
{
if ( $QuakeAmplitude <= 0.2 )
{
$QuakeAmplitude = $QuakeX = $QuakeY = 0;
return;
}
$QuakeAmplitude -= $QuakeAmplitude / 30 + 0.1;
$QuakeOffset = ( $QuakeOffset + 1 ) % 16;
$QuakeX = $QUAKEOFFSET[$QuakeOffset] * $QuakeAmplitude / 16;
- $QuakeY = $QUAKEOFFSET[$QuakeOffset + 1] * $QuakeAmplitude / 16;
+ $QuakeY = $QUAKEOFFSET[$QuakeOffset + 1] * $QuakeAmplitude / 16; # 1/1
$bgx -= $QuakeX;
$bgy -= $QuakeY;
$p1x += $QuakeX;
$p1y += $QuakeY;
$p2x += $QuakeX;
$p2y += $QuakeY;
# Do not quake doodads for now.
}
=comment
GAME BACKEND METHODS
=cut
sub GameStart
{
my ( $MaxHP, $debug ) = @_;
@Doodads = ();
@Sounds = ();
$bgx = ( $SCRWIDTH2 - $BGWIDTH2) >> 1;
$bgy = ( $SCRHEIGHT2 - $BGHEIGHT2 ) >> 1;
$BgSpeed = 0;
$BgPosition = $BgMax >> 1;
$BgScrollEnabled = 1;
- $HitPointScale = 1000 / $MaxHP;
+ $HitPointScale = 1000 / $MaxHP; # 1/1
$Debug = $debug;
ResetEarthquake();
$time = 0;
$Fighter1->Reset();
$Fighter1->{HP} = $MaxHP;
$Input1->Reset();
$Fighter2->Reset();
$Fighter2->{HP} = $MaxHP;
$Input2->Reset();
$over = 0;
$ko = 0;
$OverTimer = 0;
$JudgementMode = 0;
$p1h = $p2h = 0;
}
sub GetFighterData
{
my ($fighter) = @_;
my ($x, $y, $fnum, $f, $hp);
$fnum = $fighter->{FR};
$f = $fighter->{FRAMES}->[$fnum];
$x = $fighter->{X} / $GAMEBITS2 + $f->{'x'};
$y = $fighter->{Y} / $GAMEBITS2 + $f->{'y'};
if ($fighter->{DIR}<0)
{
$fnum = -$fnum;
$x -= $f->{x}*2 + $f->{w};
}
return ($x, $y, $fnum);
}
sub GetNextDoodadData
{
if ( $NextDoodad >= scalar @Doodads )
{
$doodad_x = $doodad_y = $doodad_t = $doodad_f = $doodad_dir = $doodad_gfxowner = -1;
$doodad_text = '';
return;
}
my ($doodad) = $Doodads[$NextDoodad];
$doodad_x = $doodad->{POS}->[0] / $GAMEBITS2 - $bgx;
$doodad_y = $doodad->{POS}->[1] / $GAMEBITS2 - $bgy;
$doodad_t = $doodad->{T};
$doodad_f = $doodad->{F};
$doodad_dir = $doodad->{DIR};
$doodad_gfxowner = $doodad->{GFXOWNER};
$doodad_text = $doodad->{TEXT};
if ($doodad_gfxowner < 2 )
{
$doodad_x += $Fighters[$doodad_gfxowner]->{FRAMES}->[$doodad_f]->{'x'} * $doodad_dir;
$doodad_y += $Fighters[$doodad_gfxowner]->{FRAMES}->[$doodad_f]->{'y'};
}
++$NextDoodad;
}
sub UpdateDoodads
{
my ($i, $j, $doodad);
for ($i=0; $i<scalar @Doodads; ++$i)
{
$doodad = $Doodads[$i];
$j = Doodad::UpdateDoodad( $doodad );
if ( $j )
{
# Remove this Doodad
splice @Doodads, $i, 1;
--$i;
}
}
}
sub DeleteDoodadsOf($)
{
my ($owner) = @_;
my ($i, $doodad);
for ($i=0; $i<scalar @Doodads; ++$i)
{
$doodad = $Doodads[$i];
if ( $doodad->{OWNER} == $owner )
{
# Remove this Doodad
splice @Doodads, $i, 1;
--$i;
}
}
}
sub GetNextSoundData()
{
# print "GetSoundData: ", scalar @Sounds, join ' ,', @Sounds, "\n";
$sound = pop @Sounds;
$sound = '' unless defined $sound;
}
sub DoFighterEvents
{
my ($fighter, $hit) = @_;
if ( $JudgementMode )
{
if ( $fighter->{NUMBER} == $JudgementWinner )
{
$fighter->Event("Won");
}
else
{
$fighter->Event("Hurt");
}
return;
}
if ( $hit )
{
$fighter->HitEvent( $fighter->{OTHER}->GetCurrentState()->{HIT}, $hit );
return;
}
#if ( ($fighter->{X} - $fighter->{OTHER}->{X}) * ($fighter->{DIR}) > 0 )
if ( $fighter->IsBackTurned )
{
$fighter->Event("Turn");
}
if ( $fighter->{OTHER}->{ST} eq 'Dead' )
{
$fighter->Event("Won");
}
if ( ($fighter->{IDLE} > 150) and (rand(350) < 1) )
{
$fighter->Event("Fun");
}
if ( ($fighter->{IDLE} > 150) and (rand(350) < 1) )
{
$fighter->Event("Threat");
}
}
sub GameAdvance
{
# $::adv += 1;
# return if ( $::adv % 3 );
my ($hit1, $hit2);
$time += 4/1000;
$NextDoodad = 0;
$NextSound = 0;
# 1. ADVANCE THE PLAYERS
$Input1->Advance();
$Input2->Advance();
- $Fighter1->Advance( $Input1 );
- $Fighter2->Advance( $Input2 );
- $hit2 = $Fighter1->CheckHit();
- $hit1 = $Fighter2->CheckHit();
+ $Fighter1->Advance( $Input1 ) if $Fighter1->{OK};
+ $Fighter2->Advance( $Input2 ) if $Fighter2->{OK};
+ $hit2 = $Fighter1->CheckHit() if $Fighter1->{OK};
+ $hit1 = $Fighter2->CheckHit() if $Fighter2->{OK};
# 2. Events come here
- DoFighterEvents( $Fighter1, $hit1 );
- DoFighterEvents( $Fighter2, $hit2 );
+ DoFighterEvents( $Fighter1, $hit1 ) if $Fighter1->{OK};
+ DoFighterEvents( $Fighter2, $hit2 ) if $Fighter2->{OK};
UpdateDoodads();
- $Fighter1->Update();
- $Fighter2->Update();
+ $Fighter1->Update() if $Fighter1->{OK};
+ $Fighter2->Update() if $Fighter2->{OK};
if ( $OverTimer == 0 and
($Fighter1->{ST} eq 'Dead' or $Fighter1->{ST} eq 'Won2') and
($Fighter2->{ST} eq 'Dead' or $Fighter2->{ST} eq 'Won2') )
{
$OverTimer = 1;
}
elsif ( $OverTimer > 0 )
{
$OverTimer++;
$over = 1 if ( $OverTimer > 200 )
}
# 3. DO THE BACKGROUND SCROLLING THING
if ( $BgScrollEnabled )
{
$BgOpt = ($Fighter1->{X} + $Fighter2->{X}) / 2; # 1/1 Stupid kdevelop syntax hightlight.
if ( ($BgOpt - $BgSpeed*50 - $BgPosition) > (320 << $GAMEBITS)) { $BgSpeed++; }
if ( ($BgOpt - $BgSpeed*50 - $BgPosition) < (320 << $GAMEBITS)) { $BgSpeed--; }
$BgPosition+=$BgSpeed;
if ($BgPosition<0) { $BgPosition = $BgSpeed = 0; }
if ($BgPosition>$BgMax) { $BgPosition = $BgMax; $BgSpeed = 0; }
# print "Pos:$BgPosition\tOpt:$BgOpt\tSpd:$BgSpeed\t";
}
# 4. SET GLOBAL VARIABLES FOR THE C++ DRAWING TO READ
($p1x, $p1y, $p1f) = GetFighterData( $Fighter1 );
($p2x, $p2y, $p2f) = GetFighterData( $Fighter2 );
$phTarget = $Fighter1->{HP}*$HitPointScale;
if ( $p1h < $phTarget ) { $p1h += 5; }
if ( $p1h > $phTarget ) { $p1h -= 3; }
$p1h = $phTarget if abs($p1h - $phTarget) < 3;
$p1h = 0 if $p1h < 0;
$phTarget = $Fighter2->{HP}*$HitPointScale;
if ( $p2h < $phTarget ) { $p2h += 5; }
if ( $p2h > $phTarget ) { $p2h -= 3; }
$p2h = $phTarget if abs($p2h - $phTarget) < 3;
$p2h = 0 if $p2h < 0;
$bgx = $BgPosition >> $GAMEBITS;
$p1x -= $bgx;
$p2x -= $bgx;
$bgy = 0;
AdvanceEarthquake();
# 5. DEBUG POLYGONS
return unless $Debug;
$fr1 = $Fighter1->{FRAMES}->[ $Fighter1->{FR} ];
@p1head = @{ $fr1->{head} };
MirrorPolygon( \@p1head ) if $Fighter1->{DIR} < 0;
OffsetPolygon( \@p1head, $Fighter1->{X} / $GAMEBITS2 - $bgx, $Fighter1->{Y} / $GAMEBITS2 - $bgy );
@p1body = @{ $fr1->{body} };
MirrorPolygon( \@p1body ) if $Fighter1->{DIR} < 0;
OffsetPolygon( \@p1body, $Fighter1->{X} / $GAMEBITS2 - $bgx, $Fighter1->{Y} / $GAMEBITS2 - $bgy );
@p1legs = @{ $fr1->{legs} };
MirrorPolygon( \@p1legs) if $Fighter1->{DIR} < 0;
OffsetPolygon( \@p1legs, $Fighter1->{X} / $GAMEBITS2 - $bgx, $Fighter1->{Y} / $GAMEBITS2 - $bgy );
if ( defined $fr1->{hit} )
{
@p1hit = @{ $fr1->{hit} };
MirrorPolygon( \@p1hit ) if $Fighter1->{DIR} < 0;
OffsetPolygon( \@p1hit, $Fighter1->{X} / $GAMEBITS2 - $bgx, $Fighter1->{Y} / $GAMEBITS2 - $bgy );
}
else
{
undef @p1hit;
}
$fr2 = $Fighter2->{FRAMES}->[ $Fighter2->{FR} ];
@p2head = @{ $fr2->{head} };
MirrorPolygon( \@p2head ) if $Fighter2->{DIR} < 0;
OffsetPolygon( \@p2head, $Fighter2->{X} / $GAMEBITS2 - $bgx, $Fighter2->{Y} / $GAMEBITS2 - $bgy );
@p2body = @{ $fr2->{body} };
MirrorPolygon( \@p2body ) if $Fighter2->{DIR} < 0;
OffsetPolygon( \@p2body, $Fighter2->{X} / $GAMEBITS2 - $bgx, $Fighter2->{Y} / $GAMEBITS2 - $bgy );
@p2legs = @{ $fr2->{legs} };
MirrorPolygon( \@p2legs) if $Fighter2->{DIR} < 0;
OffsetPolygon( \@p2legs, $Fighter2->{X} / $GAMEBITS2 - $bgx, $Fighter2->{Y} / $GAMEBITS2 - $bgy );
if ( defined $fr2->{hit} )
{
@p2hit = @{ $fr2->{hit} };
MirrorPolygon( \@p2hit ) if $Fighter2->{DIR} < 0;
OffsetPolygon( \@p2hit, $Fighter2->{X} / $GAMEBITS2 - $bgx, $Fighter2->{Y} / $GAMEBITS2 - $bgy );
}
else
{
undef @p2hit;
}
}
diff --git a/data/script/Collision.pl b/data/script/Collision.pl
index e4a9014..e95a973 100644
--- a/data/script/Collision.pl
+++ b/data/script/Collision.pl
@@ -1,177 +1,187 @@
#!/usr/bin/perl -w
use strict;
sub ccw # (three points) return -1, 0, or 1
{
my(@points) = @_;
my($rv) = 0;
my($dx1, $dx2, $dy1, $dy2, $p0x, $p0y, $p1x, $p1y, $p2x, $p2y);
#($p0x, $p0y) = split(",", $points[0]);
#($p1x, $p1y) = split(",", $points[1]);
#($p2x, $p2y) = split(",", $points[2]);
($p0x, $p0y, $p1x, $p1y, $p2x, $p2y) = @points;
$dx1 = $p1x - $p0x;
$dy1 = $p1y - $p0y;
$dx2 = $p2x - $p0x;
$dy2 = $p2y - $p0y;
switch:
{
$rv = 1, last if $dx1 * $dy2 > $dy1 * $dx2;
$rv = -1, last if $dx1 * $dy2 < $dy1 * $dx2;
$rv = -1, last if ($dx1 * $dx2 < 0.0) || ($dy1 * $dy2 < 0.0);
$rv = 1, last if ($dx1 * $dx1 + $dy1 * $dy1) < ($dx2 * $dx2 + $dy2 * $dy2);
}
$rv;
}
sub intersect
{
my (@lines) = @_;
# @lines is l1_b, l1_e, l2_b, l2_e
&ccw( $lines[0], $lines[1], $lines[2], $lines[3], $lines[4], $lines[5] ) *
&ccw( $lines[0], $lines[1], $lines[2], $lines[3], $lines[6], $lines[7] ) <=0 and
&ccw( $lines[4], $lines[5], $lines[6], $lines[7], $lines[0], $lines[1] ) *
&ccw( $lines[4], $lines[5], $lines[6], $lines[7], $lines[2], $lines[3] ) <=0;
}
sub inside
{
my ($px, $py, $poly) = @_;
my ($n) = scalar @{$poly}; # # of coordinates
my ($intersections, $i, $j, $x1, $y1, $x2, $y2, $dx, $dy, $m);
$intersections = 0;
$py += 0.5;
$px += 0.5;
for($i = 0; $i < $n; $i+=2)
{
$j = $i+2; # $i is the index of the startpoint, $j is the endpoint
$j = 0 if $i>=($n-2);
$x1 = $poly->[$i ] - $px;
$y1 = $poly->[$i+1] - $py;
$x2 = $poly->[$j ] - $px;
$y2 = $poly->[$j+1] - $py;
# Line is completely to the right of the Y axis
next if( ($x1>0) && ($x2>0) );
# Line doesn't intersect the X axis at all
next if( (($y1<=>0)==($y2<=>0)) && (($y1!=0)&&($y2!=0)) );
# Special case, if the Y on the bottom=0 ignore this
# intersection (otherwise line endpt counts as 2 hits, not 1)
if ($y2>$y1) {
next if $y2==0;
} elsif ($y1>$y2) {
next if $y1==0;
} else {
# Horizontal span overlaying the X axis. Consider it an
# intersection iff it extends to the left side of X axis
$intersections++ if ( ($x1 < 0) || ($x2 < 0) ) and ($y1==0);
next;
}
# We know line must intersect the X axis, so see where
$dx = $x2 - $x1;
# Special case.. if a vertical line, it intersects
unless ($dx){
$intersections++ if ( $y1 < 0 ) and ( $y2 > 0 );
$intersections++ if ( $y2 < 0 ) and ( $y1 > 0 );
next;
}
$dy = $y2 - $y1;
$m = $dy / $dx;
$b = $y2 - $m * $x2;
next if ( ( (0 - $b) / $m ) > 0 );
$intersections++;
}
# If there are an odd # of intersections to the left of the origin
# (the clicked-on point) then it is within the polygon
#print "inside ($px, $py), (", join(',',@{$poly}), ") = $intersections\n";
return $intersections % 2;
}
-
sub Collisions
{
my ($polyref1, $polyref2) = @_;
my ($len1, $len2, $i, $j);
$len1 = scalar( @{$polyref1} ) ;
$len2 = scalar( @{$polyref2} ) ;
# print "Collisions: (", join(',',@{$polyref1}),") <=> (", join(',',@{$polyref2}), ")\n";
# Check inside
return 1 if inside( $polyref1->[0], $polyref1->[1], $polyref2 );
return 1 if inside( $polyref2->[0], $polyref2->[1], $polyref1 );
# Check intersect
for ( $i=0; $i<$len1; $i+=2 )
{
for ( $j=0; $j<$len2; $j+=2 )
{
return 1 if intersect(
$polyref1->[$i], $polyref1->[$i+1], $polyref1->[($i+2) % $len1], $polyref1->[($i+3) % $len1],
$polyref2->[$j], $polyref2->[$j+1], $polyref2->[($j+2) % $len2], $polyref2->[($j+3) % $len2] );
}
}
return 0;
}
+=comment
+require DynaLoader;
+use MszCollision;
+
+sub Collisions
+{
+ my ($polyref1, $polyref2) = @_;
+ return MszCollision::CheckCollision($polyref1, $polyref2);
+}
+=cut
+
return 1;
=comment
My 400MHz PII runs
3000 Collisions in 7.16s
This is ~ 419 Collision per second.
Borderline usefulness.
The testcode is:
my ($poly1, $poly2, $poly3);
$poly1 = [356,188, 378,188, 378,232, 356,233,];
$poly2 = [333,233, 388,233, 388,360, 333,360,];
$poly3 = [333,350, 338,350, 383,350, 388,350,411,478,323,478,];
for ( my $i=0; $i<1000; ++$i )
{
Collisions( $poly1, $poly2 );
Collisions( $poly1, $poly3 );
Collisions( $poly2, $poly3 );
}
print "Collisions( 1, 2): ", Collisions( $poly1, $poly2 ), "\n";
print "Collisions( 1, 3): ", Collisions( $poly1, $poly3 ), "\n";
print "Collisions( 2, 3): ", Collisions( $poly2, $poly3 ), "\n";
=cut
diff --git a/data/script/DataHelper.pl b/data/script/DataHelper.pl
index d70e46e..cbf92d4 100644
--- a/data/script/DataHelper.pl
+++ b/data/script/DataHelper.pl
@@ -1,625 +1,649 @@
# DataHelper contains subroutines useful for loading a character's
# frames, and creating his states.
use strict;
require 'FighterStats.pl';
=comment
SITUATIONS ARE:
Ready, Stand, Crouch, (Midair = any + character is flying), Falling
SITUATION DEPENDENT EVENTS ARE:
Highhit, Uppercut, Hit, Groinhit, Leghit, Fall
STANDBY EVENTS ARE:
Won, Hurt, Threat, Fun, Turn
________|___Ready___________Block___Stand___________Crouch______________Midair______Falling
Highhit | HighPunched - HighPunched KneelingPunched (...) (...)
Uppercut| Falling - Falling KneelingPunched (...) (...)
Hit | LowPunched - LowPunched KneelingKicked
Groinhit| GroinKicked - GroinKicked KneelingKicked
Leghit | Swept - Swept KneelingKicked
Fall | Falling - Falling KneelingPunched
FRAME MEMBER DESCRIPTION IS:
x int X coordinate offset of the image relative to the character's anchor.
y int Y coordinate offset of the image relative to the character's anchor.
w int The width of the image.
h int The height of the image.
head array The coordinates of a polygon marking the head within the image, relative to the anchor.
body array The coordinates of a polygon marking the body within the image, relative to the anchor.
legs array The coordinates of a polygon marking the legs within the image, relative to the anchor.
hit array The coordinates of a polygon marking the hit within the image, relative to the anchor.
STATE MEMBER DESCRIPTION IS:
F int The number of the visible frame.
SITU string The situation associated with this state (Ready, Stand, Crouch, Falling)
DEL int The delay before moving to the next state.
NEXTST string The name of the state which follows this state, if none of the CONs is used.
CON hash Connections from this state. The keys are either events or keyboard input.
HIT ? The hit delivered at the beginning of this state.
BLOCK int If true, the character is blocking in his current state.
MOVE int The character's anchor should continously move this much during this state.
DELTAX int The character's anchor should immediately change by this much after this state.
PUSHX int The character is pushed, with this much momentum upon entering this state.
TURN int If true, the character's facing direction changes after this state.
JUMP int The character leaps into the air, with this much initial momentum upon entering this state.
DOODAD string A doodad is created at the beginning of this state. The string contains the doodad's type and speed.
SOUND string The sound effect associated with this state (if any);
HITSND string The sound effect if the HIT is successful.
MISSSND string The sound effect if the HIT fails.
CODE string This code will be evaled at the beginning of this state.
=cut
# Loads the frame data (x, y, w, h) from the given datafile.
# The path to the datafile is inserted automatically. The frame data will
# be shifted by (-PivotX,-PivotY).
#
# Returns an array of frame data. The first element in the array is
# a dummy entry, the second is the first real entry. This is because
# the first thing in the datafile is a PAL entry.
#
# Example: LoadFrames( "ZOLIDATA.DAT.txt" );
sub LoadFrames ($$$)
{
my ($DataName, $PivotX, $PivotY) = @_;
my (@Frames, $data, $frame);
open DATAFILE, "../characters/$DataName" || die ("Couldn't open ../characters/$DataName");
$data = '';
while ( read DATAFILE, $data, 16384, length($data) )
{
}
close DATAFILE;
print "$DataName file is ", length($data), " bytes long.\n";
# Insert a dummy first row for the palette entry
eval ("\@Frames = ( {}, $data);");
die $@ if $@;
foreach $frame (@Frames)
{
OffsetFrame( $frame, -$PivotX, -$PivotY );
}
print "$DataName loaded, ", scalar @Frames, " frames.\n";
return @Frames;
}
# Creates a frame lookup from a descriptor array.
# The first parameter is the expected number of frames.
# The descriptor array should have frame base names in even positions,
# and lengths at odd. positions. For example:
# ("start", 6, "stand", 4, ... )
#
# The routine will return a lookup which will contain the frame's logical
# name as a key, and its physical index as a value. The logical names are
# simply the basename plus a number. The example above would return:
# ("start1"=>1, "start2"=>2, ..., "start6"=>6, "stand1"=>6, "stand2"=>7, ...)
sub CreateFrameLookup
{
my ($ExpectedCount, @FrameDesc) = @_;
my ($FrameName, $NumFrames);
my ($i, $j);
my (%FrameLookup);
for ( $i=0; $i<scalar @FrameDesc; $i +=2 )
{
$FrameName = $FrameDesc[$i];
$NumFrames = $FrameDesc[$i+1];
for ( $j = 1; $j<=$NumFrames; ++$j )
{
# print "Frame ", (scalar keys %FrameLookup) + 1, " is now called $FrameName$j\n";
$FrameLookup{ "$FrameName$j" } = (scalar keys %FrameLookup) + 1;
}
}
if ( $ExpectedCount != scalar keys( %FrameLookup ) )
{
die( "Expected number of frames ($ExpectedCount) doesn't equal the actual number of frames: ".
scalar keys(%FrameLookup) );
}
return %FrameLookup;
}
# Helper function. Finds the last frame with a given name in a frame
# lookup structure. Return the index of the last frame (1-based), or
# 0 if none with the given name were found.
#
# Example: If there are 6 "highpunch" frames (highpunch1 to highpunch6),
# FindLastFrame(\%FrameLookup, "highpunch") returns 6.
sub FindLastFrame($$) {
my ($FrameLookup, $FrameName) = @_;
my ($i) = (1);
while ( exists ${$FrameLookup}{"$FrameName$i"} ) { $i++; }
return $i-1;
}
sub OffsetPolygon($$$)
{
my ($poly, $dx, $dy) = @_;
my ($i, $n);
$n = scalar @{$poly};
for ( $i=0; $i < $n; $i+=2 )
{
$poly->[$i] += $dx;
$poly->[$i+1] += $dy;
}
}
sub MirrorPolygon($)
{
my ($poly) = @_;
my ($i, $n);
$n = scalar @{$poly};
for ( $i=0; $i < $n; $i+=2 )
{
$poly->[$i] = - $poly->[$i];
}
}
sub OffsetFrame($$$) {
my ($frame, $dx, $dy) = @_;
$frame->{'x'} += $dx;
$frame->{'y'} += $dy;
OffsetPolygon( $frame->{head}, $dx, $dy ) if defined ($frame->{head});
OffsetPolygon( $frame->{body}, $dx, $dy ) if defined ($frame->{body});
OffsetPolygon( $frame->{legs}, $dx, $dy ) if defined ($frame->{legs});
OffsetPolygon( $frame->{hit}, $dx, $dy ) if defined ($frame->{hit});
}
# FindLastState returns the last index of a given state.
# For example, if Punch4 is the last in Punch, FindLastState("Punch") is 4.
sub FindLastState($$) {
my ( $States, $StateName ) = @_;
my ( $i ) = ( 1 );
while ( exists ${$States}{ "$StateName $i" } ) { $i++; }
return $i-1;
}
# Translates an abbreviated sequence to a full sequence.
# "-punch" is every punch frame backwards.
# "_punch" is every punch frame except the last one backwards.
# "+punch" is every punch frame forwards.
sub TranslateSequence($$) {
my ($FrameLookup, $Sequence) = @_;
my ($pre, $frame) = $Sequence =~ /^([+-_]{0,1})(\w+)/;
my ($LastFrame) = (FindLastFrame( $FrameLookup, $frame ) );
#$LastFrame = (FindLastFrame( $FrameLookup, "$pre$frame" ) ) if $LastFrame == 0;
#print "Last frame of $frame is $LastFrame.\n";
return "$frame 1-$LastFrame" if ( $pre eq '+' );
return "$frame $LastFrame-1" if ( $pre eq '-' );
return "$frame " . ($LastFrame-1) . "-1" if ( $pre eq '_' );
$Sequence =~ s/\sn(-{0,1})/ $LastFrame$1/; # Replace n- with last frame
$Sequence =~ s/-n/-$LastFrame/; # Replace -n with last frame
return $Sequence;
}
sub SetStateData($$$)
{
my ($state, $FrameDesc, $suffix) = @_;
$state->{DEL} = $FrameDesc->{"DEL$suffix"} if defined $FrameDesc->{"DEL$suffix"};
$state->{HIT} = $FrameDesc->{"HIT$suffix"} if defined $FrameDesc->{"HIT$suffix"};
$state->{CON} = $FrameDesc->{"CON$suffix"} if defined $FrameDesc->{"CON$suffix"};
$state->{BLOCK} = $FrameDesc->{"BLOCK$suffix"} if defined $FrameDesc->{"BLOCK$suffix"};
$state->{NEXTST} = $FrameDesc->{"NEXTST$suffix"} if defined $FrameDesc->{"NEXTST$suffix"};
$state->{MOVE} = $FrameDesc->{"MOVE$suffix"} if defined $FrameDesc->{"MOVE$suffix"};
$state->{DELTAX} = $FrameDesc->{"DELTAX$suffix"} if defined $FrameDesc->{"DELTAX$suffix"};
$state->{PUSHX} = $FrameDesc->{"PUSHX$suffix"} if defined $FrameDesc->{"PUSHX$suffix"};
$state->{TURN} = $FrameDesc->{"TURN$suffix"} if defined $FrameDesc->{"TURN$suffix"};
$state->{JUMP} = $FrameDesc->{"JUMP$suffix"} if defined $FrameDesc->{"JUMP$suffix"};
$state->{SITU} = $FrameDesc->{"SITU$suffix"} if defined $FrameDesc->{"SITU$suffix"};
$state->{DOODAD} = $FrameDesc->{"DOODAD$suffix"} if defined $FrameDesc->{"DOODAD$suffix"};
$state->{SOUND} = $FrameDesc->{"SOUND$suffix"} if defined $FrameDesc->{"SOUND$suffix"};
$state->{CODE} = $FrameDesc->{"CODE$suffix"} if defined $FrameDesc->{"CODE$suffix"};
}
# Adds a sequence to the end of a state
# Sequences are: e.g. "throw 10-14, throw 16, throw 14-10"
# Each piece of the sequence will have $Delay delay.
sub AddStates($$$) {
my ( $States, $Frames, $FrameDesc ) = @_;
my ( $StateName, $SequenceString, $LastState, $i, $sloop, $s, @Sequences );
my ( $from, $to, $frame, $state );
$StateName = $FrameDesc->{'N'};
$SequenceString = $FrameDesc->{'S'};
$FrameDesc->{SITU} = 'Stand' unless defined $FrameDesc->{SITU};
$LastState = FindLastState($States,$StateName)+1;
@Sequences = split ( /\s*,\s*/, $SequenceString );
for ( $sloop = 0; $sloop < scalar @Sequences; ++$sloop )
{
$s = TranslateSequence( $Frames, $Sequences[$sloop] );
#print "Sequence is $s\n";
if ( $s =~ /^\s*(\w+)\s+(\d+)-(\d+)\s*$/ )
{
# Sequence is '<frame> <from>-<to>'
$frame = $1;
$from = $2;
$to = $3;
}
elsif ( $s =~ /^\s*(\w+)\s+(\d+)\s*$/ )
{
# Sequence is '<frame> <number>'
$frame = $1;
$from = $to = $2;
}
else
{
die "Sequence '$s' incorrect.\n";
}
$i = $from;
while (1)
{
die "Error: Frame $frame$i doesn't exist.\n"
unless defined ${$Frames}{"$frame$i"};
$state = { 'F'=>"$frame$i" };
SetStateData( $state, $FrameDesc, '' );
SetStateData( $state, $FrameDesc, $LastState );
if ( ( $sloop == scalar @Sequences -1 ) and ( $i == $to ) )
{
SetStateData( $state, $FrameDesc, 'N' );
}
$States->{"$StateName $LastState"} = $state;
# print "Added state '$StateName $LastState' as frame '$frame$i', delay $Delay\n";
$LastState++;
if ( $from < $to )
{
$i++;
last if $i > $to;
}
else
{
$i--;
last if $i < $to;
}
}
}
}
sub BlockStates($$)
{
my ( $frames, $del) = @_;
my ( $retval, $i );
$retval = { 'N'=>'Block', 'DEL'=>$del, 'S'=>'+block', "BLOCK$frames"=>1 };
for ($i = 1; $i <= $frames; ++$i )
{
$retval->{"NEXTST$i"} = "Block " . ($i-1);
$retval->{"CON$i"} = { 'block'=> "Block " . ($i+1) };
}
$retval->{'NEXTST1'} = 'Stand';
$retval->{"CON$frames"} = { 'block'=> "Block " . $frames };
return $retval;
}
sub KneelingStates($$$$)
{
my ( $frames, $frames2, $del, $con ) = @_;
my ( $retval, $retval2, $i, $j );
$retval = { 'N'=>'Kneeling', 'DEL'=> $del, 'S' => '+kneeling', 'SITU'=>'Crouch' };
for ( $i = 1; $i <= $frames; ++$i )
{
$retval->{"NEXTST$i"} = "Kneeling " . ($i-1);
$retval->{"CON$i"} = { 'down' => "Kneeling " . ($i+1) };
}
$retval->{'NEXTST1'} = 'Stand';
$retval->{"CON$frames"} = { 'down' => "Onknees" };
$retval2 = { 'N'=>'Onknees', 'DEL'=>$del, 'S' => '+onknees,-onknees', 'SITU'=>'Crouch',
'NEXTST' => "Kneeling $frames" };
$frames2 *= 2;
for ( $i = 1; $i <= $frames2; ++$i )
{
$j = ($i % $frames2) + 1;
$retval2->{"CON$i"} = { %{$con}, 'down'=>"Onknees $j", 'forw'=>"Onknees $j", 'back'=>"Onknees $j" };
}
return ($retval, $retval2);
}
sub JumpStates($$)
{
my ( $frames, $con ) = @_;
my ( $kneelingframes, $onkneesframes,
$kickframes, $punchframes ) = (
FindLastFrame( $frames, 'kneeling' ),
FindLastFrame( $frames, 'onknees' ),
FindLastFrame( $frames, 'kneelingkick' ),
FindLastFrame( $frames, 'kneelingpunch' ) );
my ( $jump ) = 120;
my ( $i, $j, $statestotal, $statesdown, $statesknees, $deldown,
$jumpfw, $jumpbw, $flying, $flyingsequence, $jumpkick, $jumppunch );
# The jump's first part is going down on knees, second part is
# on knees, third part is getting up.
if ( $::DELMULTIPLIER )
{
$statestotal = $jump * 2 / 3 / $::DELMULTIPLIER; # 1/1
}
else
{
$statestotal = $jump * 2 / 3;
}
$statesdown = $statestotal / 4;
$deldown = int($statesdown / $kneelingframes + 0.1); # 1/1
$statesdown = $deldown * $kneelingframes;
$statesknees = $statestotal - $statesdown * 2;
$jump = { 'N'=>'Jump', 'DEL'=> $deldown, 'S'=>'kneeling 1-2, kneeling 1',
'JUMPN'=>$jump, NEXTSTN=>'JumpFly', 'SOUND1'=>'slip4.voc', };
$jumpfw = { %{$jump}, 'N'=>'JumpFW', 'PUSHX3'=>18*16 };
$jumpbw = { %{$jump}, 'N'=>'JumpBW', 'PUSHX3'=>-9*16 };
$flyingsequence = '';
$flying = {};
for ( $i = 0; $i < $statesknees / $deldown; ++$i ) #1/1
{
$j = $i + $statesdown / $deldown; #1/1
$flyingsequence .= 'onknees 1,';
$flying->{"CON$j"} = $con;
# $flying->{"DEL$j"} = 1;
}
$flyingsequence = "+kneeling, $flyingsequence -kneeling";
$flying = { %{$flying}, 'N'=>'JumpFly', 'DEL'=> $deldown, 'S'=>$flyingsequence,
'DELN'=>100 };
print join( ',', %{$flying}), "\n";
$jumpkick = { 'N'=>'JumpKick', 'HIT'=>'Fall',
'DEL'=> int( $statestotal * 2 / 3 / ( $kickframes + $kneelingframes*2 + 3 ) ), # 1/1
'S'=> '+kneelingkick,kneelingkick n, kneelingkick n, kneelingkick n,-kneelingkick,-kneeling',
'HIT'=>'Fall', 'DELN'=>100 };
$jumppunch = { 'N'=>'JumpPunch', 'HIT'=>'Highhit',
'DEL'=> int( $statestotal * 2 / 3 / ( $punchframes + $kneelingframes*2 + 3 ) ), # 1/1
'S'=> '+kneelingpunch,kneelingpunch n, kneelingpunch n, kneelingpunch n,-kneelingpunch,-kneeling',
'HIT'=>'Fall', 'DELN'=>100 };
return ($jump, $jumpfw, $jumpbw, $flying, $jumpkick, $jumppunch);
}
sub WalkingFrames($$$$$)
{
my ( $frameLookup, $frameArray, $preFrames, $distance, $con ) = @_;
my ( $walkFrames, $totalFrames, $seq, $seq2, $distPerFrame,
$walk, $back, $walkNextst, $backNextst,
$i, $j, );
$totalFrames = FindLastFrame( $frameLookup, 'walk' );
$walkFrames = $totalFrames - $preFrames;
if ( $preFrames > 0 ) {
$seq = "+walk, walk $preFrames-1";
$seq2 = "walk 1-$preFrames, -walk";
} else {
$seq = "+walk";
$seq2 = "-walk";
}
$walk = { 'N'=>'Walk', 'S'=>$seq, 'DEL'=>5, 'CON'=>$con };
$back = { 'N'=>'Back', 'S'=>$seq2, 'DEL'=>5, };
# Add attributes for the 'pre' states.
for ( $i=1; $i <= $preFrames; ++$i )
{
$j = $i + 1;
$walk->{"CON$i"} = { %{$con}, 'forw' => "Walk $j" };
$walk->{"NEXTST$i"} = 'Stand';
$back->{"CON$i"} = { %{$con}, 'back' => "Back $j" };
$back->{"NEXTST$i"} = 'Stand';
}
# Add attributes for the 'walk' states.
$walkNextst = $preFrames ? 'Walk ' . ($totalFrames+1) : 'Stand';
$backNextst = $preFrames ? 'Back ' . ($totalFrames+1) : 'Stand';
$distPerFrame = $distance / $walkFrames; # 1/1
print "*** $preFrames $walkFrames $totalFrames $walkNextst $backNextst\n";
for ( $i=$preFrames+1; $i <= $totalFrames; ++$i )
{
$j = ($i == $totalFrames) ? $preFrames+1 : $i+1;
$walk->{"MOVE$i"} = 4;
$walk->{"NEXTST$i"} = $walkNextst;
$walk->{"CON$i"} = { %{$con}, 'forw' => "Walk $j" };
$back->{"MOVE$i"} = -4;
$back->{"NEXTST$i"} = $backNextst;
$back->{"CON$i"} = { %{$con}, 'back' => "Back $j" };
OffsetFrame( $frameArray->[$frameLookup->{"walk$i"}],
- ($i-$preFrames-1) * $distPerFrame, 0 );
}
return ( $walk, $back );
}
sub TravelingStates( $$$$$$ )
{
my ( $frameLookup, $frameArray, $states, $frameName, $from, $to ) = @_;
$from = 1 unless $from;
- $to = FindLastFrame( $frameLookup, $frameName ) unless $to;
+ unless ( $to )
+ {
+ $to = FindLastFrame( $frameLookup, $frameName );
+ $to += 1 if $frameName eq 'falling';
+ }
my ( $fromIndex, $toIndex, $fromFrame, $toFrame, $fromOffset, $toOffset,
$deltax, $i, $state, $nextst );
# 1. Calculate the 'deltax' and 'fromOffset'.
$fromIndex = $frameLookup->{"$frameName$from"};
die "couldn't find frame $frameName$from" unless defined $fromIndex;
$toIndex = $fromIndex - $from + $to;
$fromFrame = $frameArray-> [ $fromIndex ];
$toFrame = $frameArray-> [ $toIndex ];
$fromOffset = $fromFrame->{x} + ($fromFrame->{w} >> 1);
$toOffset = $toFrame->{x} + ($toFrame->{w} >> 1);
$deltax = ( $toOffset - $fromOffset ) / ( $to - $from ); #1/1
# print "Offsets: $fromOffset $toOffset $deltax\n";
# 2. Offset every relevant frame.
for ( $i=$fromIndex; $i<=$toIndex; ++$i )
{
# print "Offsetting frame $i by ", - $fromOffset - $deltax * ($i-$fromIndex), "\n";
OffsetFrame( $frameArray->[$i],
- $fromOffset - $deltax * ($i-$fromIndex), 0 );
}
# 3. Apply deltax to every relevant state.
while ( ($i, $state) = each %{$states} )
{
if ( $state->{F} >= $fromIndex and $state->{F} <= $toIndex )
{
$nextst = $states->{$state->{NEXTST}};
if ( $nextst->{F} >= $fromIndex and $nextst->{F} <= $toIndex )
{
$state->{DELTAX} = $deltax * ($nextst->{F} - $state->{F});
# print "Fixing state $i : deltax = ", $state->{DELTAX}, "\n";
}
}
}
}
sub FixStates($$)
{
my ( $frameLookup, $states ) = @_;
my ( $framename, $st, $lastchar, $key, $value, $nextchar, $nextst );
while (($key, $value) = each %{$states})
{
$framename = $value->{'F'};
unless ( $framename =~/^\d+$/ )
{
# Convert non-numeric frames to their numeric counterparts.
die "Can't find image $framename in frame $key" unless defined $frameLookup->{ $framename };
$value->{'F'} = $frameLookup->{ $framename };
}
($st,$lastchar) = $key =~ /(\w+)\s+(\d+)/;
unless ( defined $value->{'NEXTST'} )
{
$nextchar = $lastchar + 1;
$nextst = "$st $nextchar";
unless ( defined $states->{$nextst} ) {
# print "Go to Standby after $key\n";
$nextst = 'Stand';
}
$value->{'NEXTST'} = $nextst;
}
}
}
sub FindShorthands($)
{
my ( $states ) = @_;
my ( $key, $value, $st, $lastchar, %Shorthands );
while (($key, $value) = each %{$states})
{
($st,$lastchar) = $key =~ /(\w+)\s+(\d+)/;
print "$key has no lastchar" unless defined $lastchar;
if ( $lastchar == 1 )
{
$Shorthands{$st} = $states->{$key};
}
}
return %Shorthands;
}
+sub CheckStates($$)
+{
+ my ( $fightername, $states ) = @_;
+ my ( $key,$state, $con );
+ my ( $seq,$nextst );
+
+ while (($key, $state) = each %{$states})
+ {
+ die "Bad connection in fighter $fightername to '$state->{NEXTST} from $key!'" unless exists $states->{ $state->{NEXTST} };
+ next unless $state->{CON};
+ $con = $state->{CON};
+
+ while (($seq, $nextst) = each %{$con})
+ {
+ die "Bad connection in fighter $fightername to '$nextst' from $key!" unless exists $states->{$nextst};
+ }
+ }
+}
+
+
return 1;
diff --git a/data/script/Doodad.pl b/data/script/Doodad.pl
index 12ff8c2..c50be61 100644
--- a/data/script/Doodad.pl
+++ b/data/script/Doodad.pl
@@ -1,309 +1,315 @@
=comment
Doodad members are:
T int The Doodad's type. 0 means text.
OWNER int The Doodad's owner (0 for player 1, 1 for player 2, other means no owner)
HOSTILE int 1 if the doodad can collision with players and damage them.
LIFETIME int The amount of time before this doodad dies. -1 means infinite.
POS (int,int) The Doodad's logical position.
SIZE (int,int) The Doodad's physical size.
SPEED (int,int) The Doodad's logical speed.
ACCEL (int,int) The Doodad's logical acceleration.
DIR int 1: heading right; -1: heading left (implies flipped state)
GFXOWNER int The Doodad's graphics owner (0 for player 1, 1 for player 2, other means global)
FIRSTFRAME int The first frame of the doodad (only meaningful if GFXOWNER is a player).
FRAMES int The number of frames.
SA int Animation speed
F int The Doodad's frame.
TEXT string The text displayed in a text doodad.
UPDATECODE sub This will be ran instead of MoveDoodad if defined.
Doodad types are:
0 Text
1 Zoli's shot
2 UPi's shot
3 UPi's explosion
4 UPi's familiar
=cut
use strict;
require 'Collision.pl';
package Doodad;
%Doodad::DoodadDefinitions = (
'ZoliShot' => {
'T' => 1, 'HOSTILE' => 1, 'LIFETIME' => -1,
'SIZE' => [ 64, 64 ], 'SPEED' => [ 48, -25 ], 'ACCEL' => [ 0, 2 ],
'GFXOWNER' => 2, 'FIRSTFRAME' => 0, 'FRAMES' => 6,
- 'SA' => 1/25
+ 'SA' => 1/10,
},
'UPiShot' => {
'T' => 2, 'HOSTILE' => 1, 'LIFETIME' => -1,
'SIZE' => [170, 22], 'SPEED' => [ 48, 0 ], 'ACCEL' => [ 0, 0 ],
'GFXOWNER' => 0, 'FIRSTFRAME' => 340, 'FRAMES' => 5,
'SA' => 1/5,
},
'UPiExplosion' => {
'T' => 3, 'HOSTILE' => 0, 'LIFETIME' => 30,
'SIZE' => [ 58, 80], 'SPEED' => [ 0, 0 ], 'ACCEL' => [ 0, 0 ],
'GFXOWNER' => 0, 'FIRSTFRAME' => 345, 'FRAMES' => 15,
'SA' => 1/2,
},
'UPiFamiliar' => {
'T' => 3, 'HOSTILE' => 0, 'LIFETIME' => -1,
'SIZE' => [ 20, 20], 'SPEED' => [ 0, 0 ], 'ACCEL' => [ 0, 0 ],
'GFXOWNER' => 0, 'FIRSTFRAME' => 360, 'FRAMES' => 3,
'SA' => 1/10,
'ANGLE' => 0,
'UPDATECODE' => sub {
my ($self) = @_;
my ($fighter, $frame, $head, $targetposx, $targetposy);
$fighter = $self->{OWNER} ? $::Fighter2 : $::Fighter1;
$frame = $fighter->{FRAMES}->[$fighter->{FR}];
$head = $frame->{head};
$self->{ANGLE} += 0.05 * $self->{DIR};
$targetposx = $fighter->{X} + $head->[0] * $::GAMEBITS2 * $fighter->{DIR} + sin( $self->{ANGLE} ) * 300;
$targetposy = $fighter->{Y} + $head->[1] * $::GAMEBITS2 + cos( $self->{ANGLE} ) * 300;
if ( $fighter->{HP} > 0 )
{
$self->{ACCEL}->[0] = ($targetposx - $self->{POS}->[0] ) / 200;
$self->{ACCEL}->[1] = ($targetposy - $self->{POS}->[1] ) / 200;
$self->{SPEED}->[0] += $self->{ACCEL}->[0];
$self->{SPEED}->[1] += $self->{ACCEL}->[1];
$self->{SPEED}->[0] *= 0.95;
$self->{SPEED}->[1] *= 0.95;
}
#$self->{SPEED}->[0] = ($targetposx - $self->{POS}->[0]) / 30;
#$self->{SPEED}->[1] = ($targetposy - $self->{POS}->[1]) / 30;
$self->{POS}->[0] += $self->{SPEED}->[0];
$self->{POS}->[1] += $self->{SPEED}->[1];
$self->{F} += $self->{SA};
$self->{F} -= $self->{FRAMES} if $self->{F} > ($self->{FRAMES} + $self->{FIRSTFRAME});
return 0;
},
},
);
=comment
CreateDoodad creates a new doodad, and appends it to the global doodad list,
@Doodads. The parameters are:
x int The logical horizontal position of the center of the doodad
y int The logical vertical position of the center of the doodad
t string The type of the doodad (doodad types are described above)
dir int 1 or -1
owner int The number of the player who 'owns' the doodad (0 or 1, anything else means no owner)
=cut
sub CreateDoodad
{
my ($x, $y, $t, $dir, $owner) = @_;
my ($doodad, $doodaddef, $w, $h);
$doodaddef = $Doodad::DoodadDefinitions{$t};
if ( ( not defined $doodaddef ) and $t != 0 )
{
print "CreateDoodad: Doodad $doodaddef doesn't exist!\n";
return
}
if ( defined $doodaddef )
{
$w = $doodaddef->{SIZE}->[0];
$h = $doodaddef->{SIZE}->[1];
$t = $doodaddef->{T};
}
else
{
$w = $h = $t = 0;
$doodaddef = {};
}
$doodad = {
'T' => $t,
'OWNER' => $owner,
'HOSTILE' => 0,
'LIFETIME' => -1,
'POS' => [ $x - $w * $::GAMEBITS2 / 2, $y - $h * $::GAMEBITS2 / 2 ],
'SIZE' => [ $w, $h ],
'SPEED' => [ 0, 0 ],
'ACCEL' => [ 0, 0 ],
'DIR' => $dir,
'GFXOWNER' => $owner,
'FIRSTFRAME'=> 0,
'FRAMES' => 1,
'SA' => 0,
'F' => 0,
'TEXT' => '',
%{$doodaddef},
};
$doodad->{SIZE} = [@{$doodaddef->{SIZE}} ] if defined $doodaddef->{SIZE};
$doodad->{SPEED} = [@{$doodaddef->{SPEED}}] if defined $doodaddef->{SPEED};
$doodad->{ACCEL} = [@{$doodaddef->{ACCEL}}] if defined $doodaddef->{ACCEL};
$doodad->{F} = $doodad->{FIRSTFRAME};
$doodad->{SPEED}->[0] *= $doodad->{DIR};
$doodad->{ACCEL}->[0] *= $doodad->{DIR};
$doodad->{GFXOWNER} = $owner if $doodad->{GFXOWNER} < 2;
push @::Doodads, ($doodad);
return $doodad;
}
sub CreateTextDoodad
{
my ($x, $y, $owner, $text) = @_;
my ($self);
$self = CreateDoodad($x, $y, 0, 0, $owner);
$self->{'TEXT'} = $text;
$self->{'GFXOWNER'} = 2;
return $self;
}
=comment
UpdateDoodad is called once every game tick.
It should return 0 if the doodad is still active.
If UpdateDoodad returns nonzero, it will be removed in this tick and
deleted.
=cut
sub UpdateDoodad
{
my ($doodad) = @_;
if ( exists $doodad->{UPDATECODE} )
{
# Call the updatecode.
return &{$doodad->{UPDATECODE}}( $doodad );
}
else
{
return MoveDoodad( $doodad );
}
}
sub MoveDoodad
{
my ($doodad) = @_;
if ( $doodad->{LIFETIME} >= 0 )
{
$doodad->{LIFETIME} -= 1;
if ( $doodad->{LIFETIME} < 0 )
{
# Doodad dies.
return 1;
}
}
$doodad->{SPEED}->[0] += $doodad->{ACCEL}->[0];
$doodad->{SPEED}->[1] += $doodad->{ACCEL}->[1];
$doodad->{POS} ->[0] += $doodad->{SPEED}->[0];
$doodad->{POS} ->[1] += $doodad->{SPEED}->[1];
$doodad->{F} += $doodad->{SA};
$doodad->{F} -= $doodad->{FRAMES} if $doodad->{F} > ($doodad->{FRAMES} + $doodad->{FIRSTFRAME});
if ( $doodad->{POS}->[0] > $::BGWIDTH2 ) { return 1; }
if ( $doodad->{POS}->[0] < $doodad->{SIZE}->[0] * $::GAMEBITS2 ) { return 1; }
if ( $doodad->{POS}->[1] > $::SCRHEIGHT2 ) { return 1; }
if ( $doodad->{POS}->[1] < $doodad->{SIZE}->[1] * $::GAMEBITS2 ) { return 1; }
if ( $doodad->{HOSTILE} )
{
CheckDoodadHit($doodad);
}
- print "Doodad: POS=", join(',', @{$doodad->{POS}}),
- "; SPEED=", join(',', @{$doodad->{SPEED}}),
- "; ACCEL=", join(',', @{$doodad->{ACCEL}}), "\n";
+# print "Doodad: POS=", join(',', @{$doodad->{POS}}),
+# "; SPEED=", join(',', @{$doodad->{SPEED}}),
+# "; ACCEL=", join(',', @{$doodad->{ACCEL}}), "\n";
return 0;
}
sub CheckDoodadHit($)
{
my ( $self ) = @_;
my ( @poly, $x, $y, $w, $h );
$x = $self->{POS}->[0] / $::GAMEBITS2;
$y = $self->{POS}->[1] / $::GAMEBITS2;
$w = $self->{SIZE}->[0];
$h = $self->{SIZE}->[1];
@poly = (
$x, $y,
$x+$w, $y,
$x+$w, $y+$h,
$x, $y+$h );
if ( $self->{OWNER} != 0 )
{
if ( $::Fighter1->IsHitAt( \@poly ) )
{
DoHitPlayer($self, $::Fighter1);
}
}
+ @poly = (
+ $x, $y,
+ $x+$w, $y,
+ $x+$w, $y+$h,
+ $x, $y+$h );
+
if ( $self->{OWNER} != 1 )
{
if ( $::Fighter2->IsHitAt( \@poly ) )
{
DoHitPlayer($self, $::Fighter2);
}
}
}
sub DoHitPlayer($$)
{
my ($self,$player) = @_;
$self->{HOSTILE} = 0;
$player->HitEvent( 'Hit', $self->{T} );
}
=cut
return 1;
diff --git a/data/script/Fighter.pl b/data/script/Fighter.pl
index 8c0fe0b..89974dd 100644
--- a/data/script/Fighter.pl
+++ b/data/script/Fighter.pl
@@ -1,797 +1,805 @@
require 'Collision.pl';
require 'DataHelper.pl';
require 'Damage.pl';
package Fighter;
use strict;
=comment
Fighter's members are:
ID int The ID of the fighter
STATS hash Reference to the fighter's stats (includes GENDER)
NAME string The name of the character, e.g. "Ulmar".
FRAMES array The character's frame description.
STATES hash The character's state description.
NUMBER int Player number (either 0 or 1)
X int The fighter's current anchor, horizontal coordinate.
Y int The fighter's current anchor, vertical coordinate.
ST string The name of the fighter's current state.
FR int The number of the fighter's current frame (same as STATES->{ST}->{F}).
DEL int The amount of time before the character moves to the next state.
NEXTST string The name of the next state after this one (calculated by Advance and Event, user by Update).
DIR int -1: the character is facing left; 1: if the character is facing right.
PUSHY int The character's vertical momentum, from jumping/hits.
PUSHX int The character's horizontal momentum, from hits.
HP int Hit points, from 100 down to 0.
IDLE int The amount of game time since the player is ready.
CHECKEHIT int 1 if the hit needs to be checked soon.
DELIVERED int 1 if a hit was delivered in this state.
COMBO int The number of consecutive hits delivered to this fighter.
COMBOHP int The amount of HP delivered in the last combo.
OTHER hash A reference to the other Fighter
new
Reset
Advance
CheckHit
IsHitAt
Event
Update
Needs to be subclassed: Reset, NextState
=cut
sub new {
my ($class) = @_;
my $self = {
'NUMBER'=> 0,
'ST' => 'Start',
'FR' => 0,
'DEL' => 0,
'DIR' => 1,
'PUSHY' => 0,
'PUSHX' => 0,
};
bless $self, $class;
return $self;
}
sub Reset {
my ($self, $fighterenum) = @_;
die "Insufficient parameters." unless defined $self;# and defined $frames and defined $states;
$fighterenum = $self->{ID} unless defined $fighterenum;
my ($number, $stats);
$number = $self->{NUMBER};
$stats = ::GetFighterStats($fighterenum);
die "Couldn't load stats of fighter $fighterenum\n" unless defined $stats;
- die "The fighter $fighterenum is not yet usable.\n" unless defined $stats->{STATES};
+
+ unless (defined $stats->{STATES})
+ {
+ print "ERROR: The fighter $fighterenum is not yet usable.\n";
+ $self->{OK} = 0;
+ return;
+ }
print STDERR "Resetting fighter $number to character $fighterenum\n";
$self->{ID} = $fighterenum;
$self->{STATS} = $stats;
$self->{NAME} = $stats->{NAME};
$self->{FRAMES} = $stats->{FRAMES};
$self->{STATES} = $stats->{STATES};
$self->{X} = (( $number ? 540 : 100 ) << $::GAMEBITS) + $::BgPosition;
$self->{Y} = $::GROUND2;
$self->{ST} = 'Start';
$self->{FR} = $self->GetCurrentState()->{F};
$self->{DEL} = 0;
$self->{DIR} = ($number ? -1 : 1);
$self->{PUSHY} = 0;
$self->{PUSHX} = 0;
$self->{HP} = 100;
$self->{IDLE} = 0;
$self->{CHECKHIT} = 0;
$self->{DELIVERED} = 0;
$self->{COMBO} = 0;
$self->{COMBOHP}= 0;
+ $self->{OK} = 1;
&{$self->{STATS}->{STARTCODE}}($self);
}
=comment
Advance should be called once every game tick. It advances the fighter,
preparing his variables for drawing him in the next tick. Advance also
processes the input if it is appropriate to do so in the current state.
Advance prepares the NEXTST attribute of the player. It does not modify
the current ST yet, because that may depend on hits, event, etc. Advance
should be followed by CheckHit and Event calls, and finally Update.
=cut
sub Advance {
my ($self, $in) = @_;
my ($stname, # The name of the current state.
$st, # The descriptor of the current state.
$move, # The move associated with the current state.
$i, $j, # temp var.
@body ); # collision detection
$self->{NEXTST} = '';
$stname = $self->{ST};
$st = $self->{'STATES'}->{$stname};
# 1. DECREMENT 'DEL' PROPERTY
$self->{'DEL'}--;
if ( $st->{SITU} eq 'Ready' )
{
$self->{IDLE} = $self->{IDLE} + 1;
}
else
{
$self->{IDLE} = 0;
}
# 2. UPDATE THE HORIZONTAL POSITION
# 2.1. 'MOVE' PLAYER IF NECESSARY
if ( defined $st->{'MOVE'} )
{
$move = $st->{'MOVE'}*$self->{'DIR'} * 6;
$self->{'X'} += $move;
}
# 2.2. 'PUSH' PLAYER IF NECESSARY
if ( $self->{PUSHX} )
{
$i = ($self->{PUSHX}+7) / 8; # 1/1; syntax highlight..
$self->{X} += $i;
$self->{PUSHX} -= $i if $self->{PUSHY} == 0;
}
# 2.3. MAKE SURE THE TWO FIGHTERS DON'T "WALK" INTO EACH OTHER
if ( $self->{Y} >= $::GROUND2 and
$self->{OTHER}->{Y} >= $::GROUND2 )
{
my ( $centerX, $centerOtherX, $pushDir );
$centerX = $self->GetCenterX;
$centerOtherX = $self->{OTHER}->GetCenterX;
if ( abs($centerX - $centerOtherX) < 60 )
{
$pushDir = ($centerX > $centerOtherX) ? 1 : -1;
$self->{X} += 10 * $pushDir;
$self->{OTHER}->{X} -= 10 * $pushDir;
}
}
# 2.4. HORIZONTAL BOUNDS CHECKING
$self->{X} = $::BgPosition + $::MOVEMARGIN2
if $self->{X} < $::BgPosition + $::MOVEMARGIN2;
$self->{X} = $::BgPosition + $::SCRWIDTH2 - $::MOVEMARGIN2
if $self->{X} > $::BgPosition + $::SCRWIDTH2 - $::MOVEMARGIN2;
# 3. FLYING OR FALLING
if ( $self->{Y} < $::GROUND2 )
{
$self->{PUSHY} += 3;
$self->{Y} += $self->{PUSHY};
if ($self->{Y} >= $::GROUND2)
{
# LANDING
if ( $st->{SITU} eq 'Falling')
{
::AddEarthquake( $self->{PUSHY} / 20 );
push @::Sounds, ('splat.wav') if $self->{PUSHY} > 40;
# print "PUSHY = ", $self->{PUSHY}, "; ";
if ( $self->{PUSHY} > 30 )
{
# Bouncing after a fall
$self->{PUSHY} = - $self->{PUSHY} / 2; # 1/1
$self->{Y} = $::GROUND2 - 1;
}
else
{
# Getting up after a fall.
$self->{PUSHY} = 0;
$self->{Y} = $::GROUND2;
$self->{DEL} = 0;
$self->{NEXTST} = 'Getup';
$self->{NEXTST} = 'Dead' if $self->{HP} <= 0;
}
return;
}
else
{
push @::Sounds, ('thump.wav');
$self->{PUSHY} = 0;
$self->{Y} = $::GROUND2;
if ( substr($self->{ST},0,4) eq 'Jump' )
{
# Landing after a jump
$self->{DEL} = 0;
$self->{NEXTST} = 'Stand';
}
else
{
print "Landed; state: ", $self->{ST}, "\n";
}
return;
}
}
}
return if $self->{'DEL'} > 0;
# 4. DELAYING OVER. MAKE END-OF-STATE CHANGES.
# 4.1. 'DELTAX' displacement if so specified
if ($st->{DELTAX})
{
$self->{X} += $st->{DELTAX} * $self->{DIR} * $::GAMEBITS2;
}
# 4.2. 'TURN' if so specified
if ($st->{TURN})
{
$self->{DIR} = - $self->{DIR};
# Swap input keys..
$i = $in->{Keys}->[2];
$in->{Keys}->[2] = $in->{Keys}->[3];
$in->{Keys}->[3] = $i;
}
# 5. CALCULATE THE NEXT STATE
my ($nextst, $con, $input, $mod, $action, $dist);
$nextst = $st->{NEXTST};
$con = $st->{CON};
$dist = ($self->{OTHER}->{X} - $self->{X}) * $self->{DIR};
undef $con if $::ko;
if ( defined $con )
{
$self->ComboEnds();
# 5.1. The current state has connections!
($input,$mod) = $in->GetAction();
$mod = '' unless defined $mod;
$action = $input;
# Try to find the best matching connection.
for ( $i = length($mod); $i>=0; --$i )
{
$action = $input . substr( $mod, 0, $i );
last if defined $con->{$action};
}
if ( defined $con->{$action} )
{
# print "dist = $dist. ";
if ( ($action eq 'hpunch' or $action eq 'lpunch') and ($dist>=0) and ($dist<800) )
{
$action = 'hpunchF' if defined $con->{'hpunchF'};
}
elsif ( ($action eq 'hkick' or $action eq 'lkick') and ($dist>=0) and ($dist<900) )
{
$action = 'lkickF' if defined $con->{'lkickF'};
}
$nextst = $con->{$action};
$in->ActionAccepted;
}
}
$self->{'NEXTST'} = $nextst;
}
sub CheckHit
{
my ($self) = @_;
return 0 unless $self->{CHECKHIT};
$self->{CHECKHIT} = 0;
my ($st, # A reference to the next state.
$nextst, # The name of the next state.
@hit, # The hit array
$i,
);
$st = $self->{STATES}->{$self->{ST}};
return 0 unless $st->{HIT};
return 0 unless defined $self->{FRAMES}->[$st->{F}]->{hit};
@hit = @{$self->{FRAMES}->[$st->{F}]->{hit}};
if ( $self->{DIR}<0 )
{
::MirrorPolygon( \@hit );
}
::OffsetPolygon( \@hit,
$self->{X} / $::GAMEBITS2,
$self->{Y} / $::GAMEBITS2 );
$i = $self->{OTHER}->IsHitAt( \@hit );
$self->{DELIVERED} = 1 if $i;
print "Collision = $i; ";
if ( $i == 0 )
{
# Make the 'Woosh' sound - maybe.
$nextst = $st->{NEXTST};
print "NEXTST = $nextst";
$nextst = $self->{STATES}->{$nextst};
print "NEXTST->HIT = ", $nextst->{HIT}, "\n";
push @::Sounds, ('woosh.wav') unless $nextst->{HIT} and defined $self->{FRAMES}->[$nextst->{F}]->{hit};
}
return $i;
}
sub IsHitAt
{
my ($self, $poly) = @_;
my ($frame, @a);
$frame = $self->{FRAMES}->[$self->{FR}];
::OffsetPolygon( $poly, -$self->{X} / $::GAMEBITS2, -$self->{Y} / $::GAMEBITS2 );
if ( $self->{DIR}<0 )
{
::MirrorPolygon( $poly );
}
-# print "IsHitAt (", join(',',@{$poly}),")\n (",
-# join(',',@{$frame->{head}}),")\n (",
-# join(',',@{$frame->{body}}),")\n (",
-# join(',',@{$frame->{legs}}),")\n";
+ #print "IsHitAt (", join(',',@{$poly}),")\n (",
+ # join(',',@{$frame->{head}}),")\n (",
+ # join(',',@{$frame->{body}}),")\n (",
+ # join(',',@{$frame->{legs}}),")\n";
return 1 if ::Collisions( $poly, $frame->{head} );
return 2 if ::Collisions( $poly, $frame->{body} );
return 3 if ::Collisions( $poly, $frame->{legs} );
return 0;
}
=comment
Event($self, $event, $eventpar): Handles the following events:
'Won', 'Hurt', 'Thread', 'Fun', 'Turn'
=cut
sub Event($$$)
{
my ($self, $event, $eventpar) = @_;
my ($st);
$st = $self->GetCurrentState();
if ( ($st->{SITU} eq 'Ready' or $st->{SITU} eq 'Stand') and $event eq 'Won' )
{
$self->{NEXTST} = 'Won' unless substr($self->{ST}, 0, 3) eq 'Won' ;
return;
}
if ( $st->{SITU} eq 'Ready' and $self->{NEXTST} eq '' )
{
+ $self->{IDLE} = 0;
if ( $event =~ /Hurt|Threat|Fun|Turn/ )
{
if ( $event eq 'Fun' and defined $self->{STATES}->{'Funb'} and rand() < 0.5 )
{
$event = 'Funb';
}
$self->{NEXTST} = $event;
}
}
}
=comment
Event($self, $event, $eventpar): Handles the following events:
'Highhit', 'Uppercut', 'Hit', 'Groinhit', 'Leghit', 'Fall'
=cut
sub HitEvent($$$)
{
my ($self, $event, $eventpar) = @_;
my ($st, $blocked, $damage);
$st = $self->GetCurrentState();
# Do events: Highhit, Uppercut, Hit, Groinhit, Leghit, Fall
$eventpar = '' unless defined $eventpar; # Supress useless warning
if ( $eventpar eq 'Maxcombo' ) { $damage = 0; }
else { $damage = ::GetDamage( $self->{OTHER}->{NAME}, $self->{OTHER}->{ST} ); }
$blocked = $st->{BLOCK};
$blocked = 0 if ( $self->IsBackTurned() );
print "Event '$event', '$eventpar'\n";
print "Blocked.\n" if ( $blocked );
# Hit point adjustment here.
$self->{HP} -= $blocked ? $damage >> 3 : $damage;
# Turn if we must.
$self->{DIR} = ( $self->{X} > $self->{OTHER}->{X} ) ? -1 : 1;
# Handle the unfortunate event of the player "dying".
if ( $self->{HP} <= 0 )
{
push @::Sounds, ('bowling.voc');
$self->{NEXTST} = 'Falling';
$self->{PUSHX} = -20 * 3 * $self->{DIR};
$self->{PUSHY} = -80;
$self->{Y} -= 10;
$self->{COMBO} += 1;
$self->{COMBOHP} += $damage;
$self->ComboEnds();
$::ko = 1;
return;
}
# Handle blocked attacks.
if ( $blocked )
{
push @::Sounds, ('thump.wav');
$self->HitPush( - $damage * 20 * $self->{DIR} );
# $self->{PUSHX} = - $damage * 5 * $self->{DIR};
return;
}
# Handle the rest of the events.
if ( $event eq 'Uppercut' )
{
push @::Sounds, ('evil_laughter.voc');
::AddEarthquake( 20 );
}
elsif ($event eq 'Groinhit') { push @::Sounds, ('woman_screams.voc'); }
{ push @::Sounds, ('thump3.voc'); }
$self->{COMBO} += 1;
$self->{COMBOHP} += $damage;
$damage *= $self->{COMBO}; # Only for the purpose of pushing
if ( $self->{COMBO} >= $::MAXCOMBO )
{
$self->ComboEnds();
$event = 'Uppercut';
$self->{OTHER}->HitEvent( 'Fall', 'Maxcombo' );
}
if ( $st->{SITU} eq 'Crouch' )
{
if ( $event eq 'Uppercut' or $event eq 'Fall' )
{
$self->{NEXTST} = 'Falling';
$self->{PUSHX} = -48 * 3 * $self->{DIR};
$self->{PUSHY} = -100;
$self->{Y} -= 10;
}
else
{
if ($eventpar == 1) {
$self->{NEXTST} = 'KneelingPunched';
} else {
$self->{NEXTST} = 'KneelingKicked';
}
$self->HitPush( - $damage * 20 * $self->{DIR} );
# $self->{PUSHX} = - $damage * 20 * $self->{DIR};
}
return;
}
if ( $st->{SITU} eq 'Falling' )
{
$self->{PUSHY} -= 50;
$self->{PUSHY} = -80 if $self->{PUSHY} > -80;
$self->{Y} -= 10;
return;
}
if ( $self->{Y} < $::GROUND2 )
{
$self->{NEXTST} = 'Falling';
$self->{PUSHY} -= 50;
$self->{PUSHX} = -48 * 3 * $self->{DIR};
return;
}
if ( $event eq 'Highhit' )
{
$self->{NEXTST} = 'HighPunched';
$self->HitPush( - $damage * 20 * $self->{DIR} );
# $self->{PUSHX} = - $damage * 20 * $self->{DIR};
}
elsif ( $event eq 'Hit' )
{
if ($eventpar == 1) {
$self->{NEXTST} = 'HighPunched';
} elsif ($eventpar == 2) {
$self->{NEXTST} = 'LowPunched';
} else {
$self->{NEXTST} = 'Swept';
}
$self->HitPush( - $damage * 20 * $self->{DIR} );
# $self->{PUSHX} = - $damage * 20 * $self->{DIR};
}
elsif ( $event eq 'Groinhit' )
{
$self->{NEXTST} = 'GroinKicked';
$self->HitPush( - $damage * 20 * $self->{DIR} );
# $self->{PUSHX} = - $damage * 20 * $self->{DIR};
}
elsif ( $event eq 'Leghit' )
{
$self->{NEXTST} = 'Swept';
$self->HitPush( - $damage * 20 * $self->{DIR} );
# $self->{PUSHX} = - $damage * 20 * $self->{DIR};
}
elsif ( $event eq 'Uppercut' or $event eq 'Fall' )
{
$self->{NEXTST} = 'Falling';
$self->{PUSHX} = -48 * 3 * $self->{DIR};
$self->{PUSHY} = -100;
$self->{Y} -= 10;
}
else
{
die "Unknown event: $event, $eventpar";
}
}
sub GetCurrentState
{
my ($self, $statename) = @_;
my ($stateref);
die unless defined $self;
$statename = $self->{ST} unless defined $statename;
$stateref = $self->{STATES}->{$statename};
return $stateref;
}
sub ComboEnds
{
my ($self) = @_;
my ($combo, $ismaxcombo);
$combo = $self->{COMBO};
$ismaxcombo = $combo >= $::MAXCOMBO;
return unless $combo;
if ( $self->{COMBO} > 1 )
{
my ( $head, $doodad, $x, $y, $combotext );
$combotext = $ismaxcombo ? "MAX COMBO!!!" : ($self->{COMBO} . "-hit combo!");
$head = $self->{FRAMES}->[$self->{FR}]->{head};
$x = $self->{X} + $head->[0] * $::GAMEBITS2 * $self->{DIR};
$y = $self->{Y} + $head->[1] * $::GAMEBITS2;
$doodad = Doodad::CreateTextDoodad( $x, $y - 30 * $::GAMEBITS2,
$self->{NUMBER},
$combotext );
$doodad->{LIFETIME} = $ismaxcombo ? 120 : 80;
$doodad->{SPEED} = [-3,-3];
$doodad = Doodad::CreateTextDoodad( $x, $y - 10 * $::GAMEBITS2,
$self->{NUMBER},
int($self->{COMBOHP}*$::HitPointScale/10) . "% damage" );
$doodad->{LIFETIME} = 80;
$doodad->{SPEED} = [+3,-3];
print $self->{COMBO}, "-hit combo for ", $self->{COMBOHP}, " damage.\n";
push @::Sounds, ( $ismaxcombo ? 'crashhh.voc' : 'ba_gooock.voc');
}
$self->{COMBO} = 0;
$self->{COMBOHP} = 0;
}
=comment
Update moves the fighter to his next state, if there is a NEXTST set.
NEXTST should be calculated before calling this method. No further
branching or CON checking is done.
If the next state has JUMP, the character is set aflying.
=cut
sub Update
{
my ($self) = @_;
my ($nextst, # The name of the next state
$st); # The descriptor of the next state.
# Is there a next state defined?
$nextst = $self->{'NEXTST'};
# If there isn't, no updating is necessary.
return unless $nextst;
# ADMINISTER THE MOVING TO THE NEXT STATE
$st = $self->GetCurrentState( $nextst );
$self->{'ST'} = $nextst;
$self->{'FR'} = $st->{'F'};
die "ERROR IN STATE $nextst" unless defined $st->{DEL};
$self->{'DEL'} = $st->{'DEL'} * $::DELMULTIPLIER;
# HANDLE THE JUMP and PUSH ATTRIBUTE
if ( defined ($st->{'JUMP'}) )
{
$self->{'PUSHY'} = -($st->{'JUMP'});
$self->{'Y'} += $self->{'PUSHY'};
}
if ( defined ($st->{'PUSHX'}) )
{
$self->{'PUSHX'} += $st->{'PUSHX'} * $self->{DIR};
}
# HANDLE THE HIT ATTRIBUTE
if ( defined ($st->{HIT}) )
{
$self->{CHECKHIT} = 1 unless $self->{DELIVERED};
}
else
{
$self->{DELIVERED} = 0;
}
# HANDLE THE SOUND ATTRIBUTE
if ( defined $st->{SOUND} )
{
push @::Sounds, ($st->{SOUND});
}
# HANDLE THE CODE ATTRIBUTE
if ( defined ($st->{CODE}) )
{
eval ($st->{CODE}); print $@ if $@;
}
# HANDLE DOODADS
if ( defined ($st->{DOODAD}) )
{
# Create a doodad (probably a shot)
my ($frame, $hit, $doodad, $doodadname);
$frame = $self->{FRAMES}->[$self->{FR}];
$hit = $frame->{hit};
if ( defined $hit )
{
$doodadname = $st->{DOODAD};
$doodad = Doodad::CreateDoodad(
$self->{X} + $hit->[0] * $::GAMEBITS2 * $self->{DIR},
$self->{Y} + $hit->[1] * $::GAMEBITS2,
$doodadname,
$self->{DIR},
$self->{NUMBER} );
}
}
}
=comment
Pushes the fighter back due to being hit. If the fighter is cornered,
the other fighter will be pushed back instead.
=cut
sub HitPush
{
my ($self, $pushforce) = @_;
if ( $self->IsCornered )
{
$self->{OTHER}->{PUSHX} -= $pushforce;
}
else
{
$self->{PUSHX} += $pushforce;
}
}
=comment
Returns the characters 'centerline' in physical coordinates.
=cut
sub GetCenterX
{
my ($self) = @_;
my ($body, $x);
$body = $self->{FRAMES}->[$self->{FR}]->{body};
$x = $body->[0] + $body->[2] + $body->[4] + $body->[6];
return $self->{X} / $::GAMEBITS2 + $x / 4 * $self->{DIR};
}
=comment
Is my back turned to my opponent? Returns true if it is.
=cut
sub IsBackTurned
{
my ($self) = @_;
return ( ($self->{X} - $self->{OTHER}->{X}) * ($self->{DIR}) > 0 );
}
=comment
Returns true if the character is at either end of the arena.
=cut
sub IsCornered
{
my ($self) = @_;
return (($self->{X} <= $::MOVEMARGIN2 + 16)
or ($self->{X} >= $::BGWIDTH2 - $::MOVEMARGIN2 - 16));
}
return 1;
diff --git a/data/script/FighterStats.pl b/data/script/FighterStats.pl
index 7cab8b1..eff3013 100644
--- a/data/script/FighterStats.pl
+++ b/data/script/FighterStats.pl
@@ -1,360 +1,625 @@
use strict;
=comment
FIGHTER STATS ARE:
ID int All fighters have an integer ID...
NAME string Name of the fighter displayed to the user
GENDER int 1=male 2=female
VERSION int Version of the fighter's code
DATAVERSION int Version of the data file
DATAFILE string Filename of the .DAT file.
STARTCODE sub Executed when Reset() is called on the fighter
TEAM string
STYLE string
AGE string
WEIGHT string
HEIGHT string
SHOE string
STORY string
=cut
=comment
We store "official" characters in the @FighterStats array. Non-syndicated
characters will have a unique ID and stored in a has.
=cut
@::FighterStats = (
{}, # Dummy UNKNOWN fighter entry..
{ 'ID' => 1,
'NAME' =>'Watasiwa baka janajo',
'TEAM' =>'Evil',
'STYLE' =>'Clown-fu',
'AGE' =>'15',
'WEIGHT'=>'50kg',
'HEIGHT'=>'168cm',
'SHOE' =>'51',
'STORY' =>
'After Wastasiwa baka janajo took possession of his time\'s most advanced
technogadget (read: by accident he was punched so hard that he flew fight into
a high-tech lab, and got tangled with the WrISt(tm)),
he used all his knowledge to travel to the past (read: he started mashing the buttons, and
this is how it ended).
Then he knew immediately that he had to destroy
Saturday! (Read: He has absolutely no idea where he is, or what he is doing...)',
'KEYS' =>
'Back HPunch - Spinning headbutt
Down Back LPunch - WrISt shot
Forward Back Forward LPunch - WrISt mash',
+
+ 'TEAM-hu' =>'Gonosz',
+ 'STYLE-hu' =>'Bohóc-fu',
+ 'WEIGHT-hu' =>'50kg + vaságy',
+ 'HEIGHT-hu' =>'168cm',
+ 'SHOE-hu' =>'51',
+ 'STORY-hu' =>
+'Miután Wasaiwa baka janaijo elszajrézta a kora legfejletebb tudományos cuccosát
+(véletlenül úgy behúztak neki, hogy berepült a laboratoriumba és rátekeredett a CsUKlo(tm)),
+
+azután minden tudását latba vetve vissza utazott a múltba (elkezdte nyomkodni a gombokat a
+CsUKlo(tm)-en és ez lett belõle).
+
+Ezekután már rögtön tudta, hogy itt el kell pusztitania a Szombatot! (õ sem tudja, hogy hol
+is van éppen illetve mit is csinál...)',
},
+
+
+
+
{ 'ID' => 2,
'NAME' =>'Dark Black Evil Mage',
'TEAM' =>'Evil leader',
'STYLE' =>'Piro-fu',
'AGE' =>'30',
'WEIGHT'=>'70kg',
'HEIGHT'=>'180cm',
'SHOE' =>'42',
'STORY' =>
'Member of the Evil Killer Black Antipathic Dim (witted) Fire Mages Leage.
He was sent to destroy Saturday now and forever! Or maybe he has a secret
agenda that noone knows about..? Nah...',
'KEYS' =>
'Back HKick - Spinkick
Forward Forward HKick - Crane kick
Down Back LPunch - Fireball
(also works while crouching)
Back Up HPunch - Burning Hands',
+
+ 'NAME-hu' =>'Sötét Fekete Gonosz Mágus',
+ 'TEAM-hu' =>'Gonosz vezér',
+ 'STYLE-hu' =>'Piro-fu',
+ 'AGE-hu' =>'30',
+ 'WEIGHT-hu' =>'70kg',
+ 'HEIGHT-hu' =>'180cm',
+ 'SHOE-hu' =>'42',
+ 'STORY-hu' =>
+'A Gonosz Gyilkos Fekete Ellenszenves Sötét (elméjü) tüzvarázslók ligájának
+tagja, kit azzal bíztak meg, hogy elpusztítsa a szombatot egyszer, s
+mindörökre. Talán van valami hátsó szándéka, amirõl senki sem tud? Nincs!',
},
+
+
+
{ 'ID' => 3,
'NAME' =>'Boxer',
'TEAM' =>'Evil',
'STYLE' =>'Kickbox-fu',
'AGE' =>'16',
'WEIGHT'=>'80kg',
'HEIGHT'=>'180cm',
'SHOE' =>'43',
'STORY' =>
'Boxer joined the Mortal Szombat team for the sole purpose to punch as
many people as hard as he possibly can. He has no other purpose
whatsoever, but at least this keeps him entertained for the time being.',
'KEYS' =>
'Back HPunch - Spinning punch
Down Back LPunch - Weight toss
Forward Forward HPunch - Leaping punch',
+
+ 'NAME-hu' =>'Boxer',
+ 'TEAM-hu' =>'Gonosz',
+ 'STYLE-hu' =>'Kickbox-fu',
+ 'AGE-hu' =>'16',
+ 'WEIGHT-hu' =>'80kg',
+ 'HEIGHT-hu' =>'180cm',
+ 'SHOE-hu' =>'43',
+ 'STORY-hu' =>
+'Boxer azért csatlakozott a Mortál Szombat csapathoz, hogy minél több
+embernek besomhasson, minél többször, és minél nagyobbat. Más célja ezen
+kívül nincs, de ez is remekül elszórakoztatja középtávon',
},
+
+
+
{ 'ID' => 4,
'NAME' =>'Cumi',
'TEAM' =>'Good Leader',
'STYLE' =>'N/A',
'AGE' =>'15',
'WEIGHT'=>'55kg',
'HEIGHT'=>'170cm',
'SHOE' =>'41.5',
'STORY' =>
'His life ambition was to drive a car. Now that this was accomplished,
he has turned to his second greatest ambition: to be a great martial
artist superhero. As a start, he has watched the TV series "Kung fu"
from beginning to end, in one session. His current training consists
of but this.',
'KEYS' =>
'Down Back LPunch - Finger Shot
Forward Forward HPunch - Spit
Back Down Forward - Baseball',
+
+ 'NAME-hu' =>'Cumi',
+ 'TEAM-hu' =>'Jó vezér',
+ 'STYLE-hu' =>'N/A',
+ 'AGE-hu' =>'15',
+ 'WEIGHT-hu'=>'55',
+ 'HEIGHT-hu'=>'170',
+ 'SHOE-hu' =>'41.5',
+ 'STORY-hu' =>
+'Elete fo ambicioja volt, hogy autot vezessen. Most hogy ezt teljesitette, masodik fo
+amibicioja fele fordult: hogy nagy harcmuvessze valjon. Kezdetben ehhez megnezte
+a Kung fu sorozatot elejetol vegeig egyulteben. Kepzettsege jelenleg ebbol all.',
},
+
+
+
{ 'ID' => 5,
'NAME' =>'Sirpi',
'TEAM' =>'Good',
'STYLE' =>'Don\'tHurtMe-FU',
'AGE' =>'24',
'WEIGHT'=>'76kg',
'HEIGHT'=>'170cm',
'SHOE' =>'41',
'STORY' =>
'After being a "hardcore" gamer for several years and consuming a
great amount of food, his electricity was turned off. This has caused
him to make a very stupid face which lasts till this day, and will
last until he has defeated his archenemy. This is why he resolved to
join the good team... also he is frightened alone.',
'KEYS' =>
'Down Forward LPunch - Surprise
Forward Forward HPunch - Applause',
+
+
+ 'STYLE-hu' => 'Nebánts-FU',
+ 'STORY-hu' =>
+'Sok évnyi hardcore gamerkedés után, miközben el is hízott jól,
+kikapcsolták nála a villanyt.
+
+Erre nagyon hülye pofát vágott, és ez igy is
+marad mindaddig, amíg le nem számol õsellenségével (vagy még utána is).
+Ezért csatlakozott a jók kicsiny csapatához... Meg amúgy is fél egyedül.',
},
+
+
+
+
{ 'ID' => 6,
'NAME' =>'Macy',
'TEAM' =>'Good',
'STYLE' =>'Macy-fu',
'AGE' =>'17',
'WEIGHT'=>'41kg',
'HEIGHT'=>'175cm',
'SHOE' =>'37',
'STORY' =>
'A few years ago (perhaps a little earlier, or maybe later) she was
found among the clouds in a cradle (falling, of course). She learned
martial art from brave Son Goku, so she landed on her feet and didn\'t
die. She\'s been immortal ever since. Who knows for how long? Maybe
it won\'t be until the next fight agains Evil...',
'KEYS' =>
'Down Back LPunch - Toss
Forward Forward HKick - Scissor Kick',
+
+ 'STORY-hu' =>
+'kb. néhány évvel ezelõtt, (vagy talán egy kicsit korábban, esetleg
+késõbb) a felhõk között egy pólyában találtak rá (zuhanás közben).
+
+A bátor
+Songokutól elleste a harcmûvészet mesteri fortélyait, igy talpra esett és
+nem halt meg. Azóta is halhatatlan. Ki tudja, még meddig? Talán a
+következõ harcig a gonosz ellen...',
},
+
+
+
{ 'ID' => 7,
'NAME' =>'Jan Ito',
'TEAM' =>'Evil',
'STYLE' =>'Kururin-do',
'AGE' =>'20',
'WEIGHT'=>'85kg',
'HEIGHT'=>'172cm',
'SHOE' =>'39',
'STORY' =>
'The "Japanese giant" is a sworn enemy of Descant... after he left
muddy boot marks all over the freshly mopped porch of the pub, er,
dojo which has belonged to his ancestors for 16 generations. Since
he has turned to the dark side of the janitor. His knowledge of
the "way of the concierge" matches his deep hatred towards army
boots.',
'KEYS' =>
'Down Back LPunch - Soap Throw
Back Fw Back Fw LPunch - Stick Spin
Back Forward HPunc - Pierce',
+
+ 'NAME-hu' =>'Taka Ito',
+ 'TEAM-hu' =>'Gonosz',
+ 'STYLE-hu' =>'Kururin-do',
+ 'AGE-hu' =>'20',
+ 'WEIGHT-hu' =>'85',
+ 'HEIGHT-hu' =>'172',
+ 'SHOE-hu' =>'39',
+ 'STORY-hu' =>
+'A japán óriás Descant esküdt ellensége, mióta összejárta az általa frissen felmosott
+verandát a 16 generáció óta családja által birtokolt foga-do-ban. Tudását a sötét
+oldal szolgálatába állította. Tudását a "gondnok útján" csak mélységes megvetése a
+vasaltorrú bakancsok iránt szárnyalja túl.',
},
+
+
+
{ 'ID' => 8,
'NAME' =>'Grizzly',
'TEAM' =>'Good',
'STYLE' =>'Bear dance',
'AGE' =>'21',
'WEIGHT'=>'Several tons',
'HEIGHT'=>'170cm',
'SHOE' =>'49',
'STORY' =>
'Grizzly has been long famous for his laziness. He has made laziness a
form of art. In the past 5 years he has been to lazy to watch TV. Every
Saturday he trains in his own special fighting style, one not unlike
that of Bud Spencer, whom he holds as his honorary master. Though,
since he found out that Bud WORKS on Saturdays, he has revoked his
title, and keeps it for himself. He has joined the Good team to fight
to protect the Saturday.',
'KEYS' =>
'Down Back LPunch - Bear Shot
Forward Forward HPunch - Poke
Down Down LKick - Earthquake
Back Forward Back HPunch - Nunchaku',
+
+ 'NAME-hu' =>'Grizli',
+ 'TEAM-hu' =>'Jó',
+ 'STYLE-hu' =>'Gyakás ala Medve',
+ 'AGE-hu' =>'21',
+ 'WEIGHT-hu' =>'50000000',
+ 'HEIGHT-hu' =>'170',
+ 'SHOE-hu' =>'49',
+ 'STORY-hu' =>
+'Grili a lustaságáról volt hires mindig. Olyannyira, hogy amilyen szinten
+azt csinálja, az már mûvészet. Az utóbbi 5 évben már a TV
+nézéshez is lusta lett.
+
+Minden Szobaton tart edzést a Különbenmegintdühbejövünk do
+stilusból, amit még kezdõ korában a TV-bõl sajátított el. A stilus
+tiszteletbeli nagymestere maga Bád Szpencer, de sajnos miután Bád-ról
+kiderült, hogy szombatonként dolgozik, Grizli elvette tõle a cimet, s
+azóta magának tartogatja.
+
+Grizli a szombat ellenesek ádáz gyûlölõje, a jó csapat oszlopos tagja.',
},
+
+
+
{ 'ID' => 9,
'NAME' =>'Descant',
'TEAM' =>'Good',
'STYLE' =>'Murderization',
'AGE' =>'58',
'WEIGHT'=>'89kg',
'HEIGHT'=>'180cm',
'SHOE' =>'44',
'STORY' =>
'He was trained in \'Nam in every known weapon and martial art form.
He fought there on the side of the Americans and the Russians...
whoever paid more at the moment. Then he used the money to hybernate
himself until the next great war.. or until the Saturday is in
trouble. He joined the side with the more CASH...',
'KEYS' =>
'Down Back LPunch - Aimed Shot
Back Back LPunch - Hip Shot
Forward Down HPunch - Knife Throw
Forward Forward HPunch - Gun Hit',
+
+ 'NAME-hu' =>'Descant',
+ 'TEAM-hu' =>'Jó',
+ 'STYLE-hu' =>'+halol',
+ 'AGE-hu' =>'58',
+ 'WEIGHT-hu'=>'89',
+ 'HEIGHT-hu'=>'180',
+ 'SHOE-hu' =>'44',
+ 'STORY-hu' =>
+'A Vietnámi háború során képezték ki minden ismert fegyverre és harcm~uvészetre. Már ott
+is az Oroszok és az Amerikaik oldalán harcolt, már aki éppen többet fizetett. Ezután a pénzb"ol
+hibernáltatta magát és csak háborúk esetén olvasztatja föl magát, vagy most mikor a szombat
+bajba kerül most is azon az oldalon van, ahol vastagabb a BUKSZA, most épp a...',
},
+
+
+
+
{ 'ID' => 10,
'NAME' =>'Rising-san',
'TEAM' =>'Evil',
'STYLE' =>'Flick-fu',
'AGE' =>'500',
'WEIGHT'=>'N/A',
'HEIGHT'=>'50',
'SHOE' =>'N/A',
'STORY' =>
'Mistically disappeared Aeons ago.. on a Saturday! Now he is back, and
brought back his destructive techique, unmatched on Earth. Noone knows
why he joined the Dark Evil Mage...',
+
+ 'NAME-hu' =>'Rising-san',
+ 'TEAM-hu' =>'Gonosz',
+ 'STYLE-hu' =>'Pöcc-fu',
+ 'AGE-hu' =>'500',
+ 'WEIGHT-hu' =>'N/A',
+ 'HEIGHT-hu' =>'50',
+ 'SHOE-hu' =>'Nem visel',
+ 'STORY-hu' =>
+'Sok-sok évvel ezel"ott eltûnt misztikus körülmények között... egy szombati napon!
+És most visszatért. Senki sem tudja honnan jött, de magával hozta pusztító technikáját
+melynek nincs párja a földön. Senki sem érti miért fogadta el a gonosz varázsl
+megbízását...',
},
+
+
+
+
{ 'ID' => 11,
'NAME' =>'Mad Sawman',
'TEAM' =>'Evil',
'STYLE' =>'Sawing',
'AGE' =>'35',
'WEIGHT'=>'110',
'HEIGHT'=>'120',
'SHOE' =>'49',
'STORY' =>
'His cradle was found on a tree. Later he chopped up the family that
took him and fed them to the bears. He has been roaming the Canadian
forests, chopping trees and heads alike. On hot summer nights his
maniac laughter echoes far.',
+ 'KEYS' =>
+'Down Back LPunch - Axe Toss
+Back Forward HKick - Chop Chop
+Forward Forward LKick - Bonesaw',
+
+ 'NAME-hu' =>'Fûrészes Õrült',
+ 'TEAM-hu' =>'Gonosz',
+ 'STYLE-hu' =>'Fanyûvõ',
+ 'AGE-hu' =>'35',
+ 'WEIGHT-hu' =>'110',
+ 'HEIGHT-hu' =>'120',
+ 'SHOE-hu' =>'49',
+ 'STORY-hu' =>
+'Bölcsõjét egy fán találták meg. Késõbb felaprította az egész befogadó családját, és
+megetette a medvékkel. Azóta a kanadai erdõkben bolyongva vágja a fákat és az
+emberfejeket. Forró nyári éjszakákon mindig hallatszik õrült kacaja.',
},
+
+
+
{ 'ID' => 12,
'NAME' =>'Imperfect Soldier',
'TEAM' =>'Good',
'STYLE' =>'Pub Fight',
'AGE' =>'50',
'WEIGHT'=>'100',
'HEIGHT'=>'180',
'SHOE' =>'44',
'STORY' =>
'His childhood was determined by Drezda\'s bombing. This trauma has
caused him to join the army. For the last 30 years he is corporal
without the slightest hope for advancement. He annoys his
subordinates with a constant flow of stories of pub fights, until
they ask for relocation.',
+ 'KEYS' =>
+'Down Back LPunch - Hat
+Forward Forward HPunch - Ramming Attack
+Back Down Back LPunch - Stab
+Back Forward LKick - Poke',
+
+ 'NAME-hu' =>'Tökéletlen Katona',
+ 'TEAM-hu' =>'Jó',
+ 'STYLE-hu' =>'Kocsmabunyó',
+ 'AGE-hu' =>'50',
+ 'WEIGHT-hu' =>'100',
+ 'HEIGHT-hu' =>'180',
+ 'SHOE-hu' =>'44',
+ 'STORY-hu' =>
+'Gyermekkorát meghatározta Drezda lebombázása. E trauma hatására katonai
+pályára állt. Immáron 30 éve a Bundeswehr kötelékében tizedes az
+elõléptetés bárminem~u esélye nélkül.
+
+Alantasait folytonosan kocsmai bunyóinak történeteivel traktálja, amíg azok
+áthelyezésüket nem kérik.',
},
+
+
+
+
{ 'ID' => 13,
'NAME' =>'Aisha',
'TEAM' =>'Good',
'STYLE' =>'Death Dance',
'AGE' =>'21',
'WEIGHT'=>'43.5',
'HEIGHT'=>'155',
'SHOE' =>'35',
'STORY' =>
'Her trials started right in the womb.. her life hung on a single
umbilical cord! But she was finally born, and got the name
Aisha ("survives everything"). Since her childhood she survived
natural disasters and terrorist attacks, and got frankly fed up.
So one time she said:
"If I survive this, I swear, I\'ll join those stupid Mortal guys!"',
- 'STORYHU'=>
+
+ 'STORY-hu'=>
'A megprobaltatasok akkor kezdodtek, amikor anyukaja a szive alatt hordta.
Egyetlen koldokzsinoron fuggott az elete! De megszuletett vegul, ezert
kapta az Aisha ("mindent tulelo") nevet. Aztan gyermekkoratol fogva sok
termeszeti katasztrofat, terrortamadast atveszelt, es mar kezdett elege
-le\
-nni az egeszbol, igy hat az egyik alkalommal kijelentette, hogy ha ezt
+lenni az egeszbol, igy hat az egyik alkalommal kijelentette, hogy ha ezt
tulelem, csatlakozom azokhoz a hulye Mortalosokhoz!',
-},
+}, #'
+
+
+
+
{ 'ID' => 14,
- 'NAME' =>'Misi (?)',
+ 'NAME' =>'Papatsuka Mamatsuba',
'TEAM' =>'Evil',
- 'STYLE' =>'',
- 'AGE' =>'',
- 'WEIGHT'=>'',
- 'HEIGHT'=>'',
- 'SHOE' =>'',
- 'STORY' =>'...',
+ 'STYLE' =>'Gloom',
+ 'AGE' =>'Feudal Middle',
+ 'WEIGHT'=>'Dead',
+ 'HEIGHT'=>'178 cm',
+ 'SHOE' =>'43,12748252',
+ 'STORY' =>
+'Papastuka has been raised strictly in the way of the samurai since age 4.
+His father was the most famous warrior of the past 20 years. After he
+learned all the jutsu from dad, he skalped him, and put the skalp on his head
+to scare his enemies.
+
+On weekdays he is seen chasing women, saturdays he
+drinks a lot. Then he decided, that enjoying saturday should belong to him
+alone...',
+
+ 'NAME-hu' =>'Apatsuka Anyatsuba',
+ 'TEAM-hu' =>'Gonosz',
+ 'STYLE-hu' =>'Komor',
+ 'AGE-hu' =>'Feudális közép...',
+ 'WEIGHT-hu' =>'Nagyon súlyos!',
+ 'STORY-hu' =>
+'Apatsukát 4 éves kora óta nevelték szülei a szamuráj életmódra, szigor
+keretek között. Apja az elmúlt 20 év leghíresebb harcosa volt. Amint
+minden harci fogást elsajátított apjától, megskalpolta és a skalpját
+fejére illesztette, ezzel megfélemlítve ellenségeit.
+
+Hétközben nõket
+hajszolt, szombaton szívott és berugott. Aztán úgy döntött, hogy ezen a
+szombaton csak õ érezheti jól magát...',
+
+
},
+
);
sub RegisterFighter($)
{
my ($reginfo) = @_;
# reginfo must contain: ID, GENDER, DATAVERSION, DATASIZE, STARTCODE, FRAMES, STATES, DATAFILE
foreach my $attr (qw(ID GENDER DATAVERSION DATASIZE STARTCODE FRAMES STATES DATAFILE))
{
die "RegisterFighter: Attribute $attr not found" unless defined $reginfo->{$attr};
}
+ # CheckStates( $reginfo->{ID}, $reginfo->{STATES} );
my ($fighterenum, $fighterstats);
$fighterenum = $reginfo->{ID};
- $fighterstats = GetFighterStats($fighterenum);
- die "RegisterFighter: Unable to locate fighter $fighterenum\n" unless defined $fighterstats;
+
+ $fighterstats = $::FighterStats[$fighterenum];
+ if ( not defined $fighterstats )
+ {
+ print "RegisterFighter: Fighter $fighterenum not found, non-syndicated?\n";
+ $fighterstats = {
+ 'ID' => $fighterenum,
+ 'NAME' =>'Unknown (non-syndicated)',
+ 'TEAM' =>'Unknown',
+ 'STYLE' =>'Unknown',
+ 'AGE' =>'Unknown',
+ 'WEIGHT'=>'Unknown',
+ 'HEIGHT'=>'Unknown',
+ 'SHOE' =>'Unknown',
+ 'STORY' =>'...',
+ 'DATAFILE'=>'ZOLIDATA.DAT',
+ %{$reginfo}
+ };
+ $::FighterStats[$fighterenum] = $fighterstats;
+ return;
+ }
# Add the reginfo to the fighter stats:
%{$fighterstats} = ( %{$fighterstats}, %{$reginfo} );
-# $::FighterStat
+}
+
+
+
+sub GetStatsTranslated($$)
+{
+ my ($source, $stat) = @_;
+ return $source->{"${stat}-$::LanguageCode"} if defined $source->{"${stat}-$::LanguageCode"};
+ return $source->{$stat};
}
sub GetFighterStats($)
{
my ($fighterenum) = @_;
my ($source) = $::FighterStats[$fighterenum];
- $::Name = $source->{NAME};
- $::Team = $source->{TEAM};
- $::Style = $source->{STYLE};
- $::Age = $source->{AGE};
- $::Weight = $source->{WEIGHT};
- $::Height = $source->{HEIGHT};
- $::Shoe = $source->{SHOE};
- $::Story = $source->{STORY};
- $::Keys = $source->{KEYS};
- $::Datafile = $source->{DATAFILE};
+ $::Name = GetStatsTranslated( $source, 'NAME' );
+ $::Team = GetStatsTranslated( $source, 'TEAM' );
+ $::Style = GetStatsTranslated( $source, 'STYLE' );
+ $::Age = GetStatsTranslated( $source, 'AGE' );
+ $::Weight = GetStatsTranslated( $source, 'WEIGHT' );
+ $::Height = GetStatsTranslated( $source, 'HEIGHT' );
+ $::Shoe = GetStatsTranslated( $source, 'SHOE' );
+ $::Story = GetStatsTranslated( $source, 'STORY' );
+ $::Keys = GetStatsTranslated( $source, 'KEYS' );
+ $::Datafile = GetStatsTranslated( $source, 'DATAFILE' );
$::Story =~ s/([^\n])\n([^\n])/$1 $2/gms;
@::StatTags = ( 'Name: ', 'Team: ', 'Style: ', 'Age: ', 'Weight: ', 'Height: ', 'Shoe size: ' );
- #@::StatTags = ( "Név: ", "Csapat: ", "Stílus: ", "Kor: ", "Súly: ", "Magasság: ", "Cipõméret: " );
+
+ #print "The data file of $fighterenum is '$::Datafile'\n";
return $source;
}
#GetFighterStats(1);
#print "$::Name $::Team $::Style $::Age $::Weight $::Height $::Shoe\n$::Story\n";
return 1;
diff --git a/data/script/Makefile.am b/data/script/Makefile.am
index be04e96..10ebab6 100644
--- a/data/script/Makefile.am
+++ b/data/script/Makefile.am
@@ -1,11 +1,8 @@
## Process this file with automake to produce Makefile.in
scriptdatadir = $(pkgdatadir)/script
scriptdata_DATA = \
-Backend.pl Damage.pl Fighter.pl Ulmar.pl \
-Bence.pl DataHelper.pl FighterStats.pl PlayerInput.pl UPi.pl \
-Collision.pl Descant.pl Kolos.pl QuickSave.pl \
-Cumi.pl Doodad.pl Maci.pl Sirpi.pl Zoli.pl \
-Keys.pl State.pl Grizli.pl
+Backend.pl Damage.pl Doodad.pl FighterStats.hu Keys.pl State.pl \
+Collision.pl DataHelper.pl Fighter.pl FighterStats.pl PlayerInput.pl Translate.pl
EXTRA_DIST = $(scriptdata_DATA)
diff --git a/data/script/Makefile.in b/data/script/Makefile.in
index 1f0f323..4a2a6a0 100644
--- a/data/script/Makefile.in
+++ b/data/script/Makefile.in
@@ -1,209 +1,214 @@
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_alias = @build_alias@
build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
AUTODIRS = @AUTODIRS@
CXX = @CXX@
FT2_CFLAGS = @FT2_CFLAGS@
FT2_CONFIG = @FT2_CONFIG@
FT2_LIBS = @FT2_LIBS@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
PERL = @PERL@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
VERSION = @VERSION@
perl_embed_ccflags = @perl_embed_ccflags@
perl_embed_ldflags = @perl_embed_ldflags@
scriptdatadir = $(pkgdatadir)/script
-scriptdata_DATA = Backend.pl Damage.pl Fighter.pl Ulmar.pl Bence.pl DataHelper.pl FighterStats.pl PlayerInput.pl UPi.pl Collision.pl Descant.pl Kolos.pl QuickSave.pl Cumi.pl Doodad.pl Maci.pl Sirpi.pl Zoli.pl Keys.pl State.pl Grizli.pl
+scriptdata_DATA = Backend.pl Damage.pl Doodad.pl FighterStats.hu Keys.pl State.pl Collision.pl DataHelper.pl Fighter.pl FighterStats.pl PlayerInput.pl Translate.pl
EXTRA_DIST = $(scriptdata_DATA)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
DATA = $(scriptdata_DATA)
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps data/script/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu data/script/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
install-scriptdataDATA: $(scriptdata_DATA)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(scriptdatadir)
@list='$(scriptdata_DATA)'; for p in $$list; do \
if test -f $(srcdir)/$$p; then \
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(scriptdatadir)/$$p"; \
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(scriptdatadir)/$$p; \
else if test -f $$p; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(scriptdatadir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(scriptdatadir)/$$p; \
fi; fi; \
done
uninstall-scriptdataDATA:
@$(NORMAL_UNINSTALL)
list='$(scriptdata_DATA)'; for p in $$list; do \
rm -f $(DESTDIR)$(scriptdatadir)/$$p; \
done
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = data/script
distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu data/script/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am: install-scriptdataDATA
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-scriptdataDATA
uninstall: uninstall-am
all-am: Makefile $(DATA)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(scriptdatadir)
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: uninstall-scriptdataDATA install-scriptdataDATA tags distdir \
info-am info dvi-am dvi check check-am installcheck-am installcheck \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/data/script/State.pl b/data/script/State.pl
index 295bcc1..b34594b 100644
--- a/data/script/State.pl
+++ b/data/script/State.pl
@@ -1,20 +1,25 @@
use strict;
sub ParseConfig($)
{
my ($filename) = @_;
+ my ($escaped1, $escaped2);
open CONFFILE, "$filename" or return;
while (<CONFFILE>)
{
- if ($_ =~ /(\w+)\s*=\s*(\w+)/)
+ if ($_ =~ /(\w+)\s*=\s*(.*\S)\s*/)
{
- eval( "\$::$1 = '$2';" );
+ $escaped1 = $1;
+ $escaped1 =~ s/'/\\'/g;
+ $escaped2 = $2;
+ $escaped2 =~ s/'/\\'/g;
+ eval( "\$::$escaped1 = '$escaped2';" );
}
}
close CONFFILE;
}
return 1;
diff --git a/data/script/Translate.pl b/data/script/Translate.pl
new file mode 100644
index 0000000..5f4d81d
--- /dev/null
+++ b/data/script/Translate.pl
@@ -0,0 +1,825 @@
+use strict;
+
+=comment
+
+Translate.pl attempts to load all of the translations into one file. A
+translation is simply a hash from English to the other language.
+
+=cut
+
+
+
+
+
+$::English = { 'LanguageCode' => 0,
+
+# In-game text
+
+ 'MAX COMBO!!!' => undef,
+ '%d-hit combo!' => undef, # e.g. 3-hit combo!
+ '%d%% damage' => undef, # e.g. 30% damage
+ 'Round %d' => undef,
+ 'REW' => undef,
+ 'REPLAY' => undef,
+ 'DEMO' => undef,
+ 'Press F1 to skip...'=> undef,
+ 'HURRY UP!' => undef,
+ 'TIME IS UP!' => undef,
+
+ 'Final Judgement' => undef,
+ 'Continue?' => undef,
+ 'SPLAT!' => undef,
+ 'Choose A Fighter Dammit' => undef,
+
+# Menu items
+
+ "Main Menu" => undef,
+ "~SINGLE PLAYER GAME"=> undef,
+ "~MULTI PLAYER GAME"=> undef,
+ "~SURRENDER GAME" => undef,
+ "~OPTIONS" => undef,
+ "~INFO" => undef,
+ "QUIT" => undef,
+ "~OK" => undef,
+ "~LANGUAGE: " => undef,
+
+ "Options" => undef,
+ "~FULLSCREEN ON" => undef,
+ "~FULLSCREEN OFF" => undef,
+ "GAME SPEED: " => undef,
+ "GAME TIME: " => undef,
+ "STAMINA: " => undef,
+ "~SOUND" => undef,
+ "~RIGHT PLAYER KEYS"=> undef,
+ "~LEFT PLAYER KEYS" => undef,
+
+ "Sound" => undef,
+ "CHANNELS: " => undef, # Mono / Stereo
+ "SOUND QUALITY: " => undef, # KHz of playback rate
+ "SOUND FIDELITY: " => undef, # 8 bit or 16 bit
+ "MUSIC VOLUME: " => undef, # OFF or numeric
+ "EFFECTS VOLUME: " => undef, # OFF or numeric
+
+
+# Menu options
+
+ "BABY" => undef,
+ "VERY LOW" => undef,
+ "LOW" => undef,
+ "NORMAL" => undef,
+ "HIGH" => undef,
+ "VERY HIGH" => undef,
+ "NEAR IMMORTAL" => undef,
+
+ "SNAIL RACE" => undef,
+ "SLOW" => undef,
+ "NORMAL" => undef,
+ "TURBO" => undef,
+ "KUNG-FU MOVIE" => undef,
+
+ # Sound / Channels
+ "MONO" => undef,
+ "STEREO" => undef,
+
+ # Sound / Mixing rate settings
+ "LOW" => undef,
+ "MEDIUM" => undef,
+ "HIGH" => undef,
+
+ # Sound volume
+ "OFF" => undef,
+
+# Key configuration
+
+ '%s player-\'%s\'?' => undef, # The first %s becomes Left or Right. The second %s is up/down/high punch/...
+ 'Left' => undef,
+ 'Right' => undef,
+ "up", => undef,
+ "down", => undef,
+ "left", => undef,
+ "right", => undef,
+ "block", => undef,
+ "low punch", => undef,
+ "high punch", => undef,
+ "low kick", => undef,
+ "high kick" => undef,
+ 'Thanks!' => undef,
+
+# Demo screens,
+
+ 'Fighter Stats' => undef,
+ 'Unfortunately this fighter is not yet playable.' => undef,
+ 'Name: ' => undef,
+ 'Team: ' => undef,
+ 'Style: ' => undef,
+ 'Age: ' => undef,
+ 'Weight: ' => undef,
+ 'Height: ' => undef,
+ 'Shoe size: ' => undef,
+
+ "Credits" => undef,
+ "CreditsText1" =>
+"OPENMORTAL CREDITS
+
+
+-- THE OPENMORTAL TEAM ARE --
+
+
+CODING - UPi
+MUSIC - Oedipus
+GRAPHICS - UPi
+German translation - ??
+French translation - ??
+Spanish translation - ??
+
+-- CAST --
+
+Boxer - Zoli
+Cumi - As himself
+Descant - As himself
+Fureszes Orult - Ambrus
+Grizli - As himself
+Kinga - As herself
+Macy - As herself
+Misi - As himself
+Rising-san - Surba
+Sirpi - As himself
+Taka Ito - Bence
+Tokeletlen Katona - Dani
+Watasiwa Baka Janajo - Ulmar
+Black Dark Evil Mage - UPi
+
+-- HOSTING --
+
+sourceforge.net
+apocalypse.rulez.org
+freshmeat.net
+
+OpenMortal is Copyright 2003 of the OpenMortal Team
+Distributed under the GNU General Public Licence Version 2\n\n",
+
+ 'CreditsText2' =>
+'Thanks to Midway for not harrassing us with legal stuff so far, even though '.
+'we must surely violate at least 50 of their patents, international copyrights and registered trademarks.
+
+
+OpenMortal needs your help! If you can contribute music, graphics, improved code, '.
+'additional characters, cash, beer, pizza or any other consumable, please mail us '.
+'at upi@apocalypse.rulez.org! The same address is currently accepting comments and '.
+"fanmail too (hint, hint!).\n\n",
+
+ 'CreditsText3' =>
+"Be sure to check out other stuff from
+Apocalypse Production
+and
+Degec Entertainment\n\n",
+
+ 'Story1Text' =>
+"We, the Gods of the Evil Killer Black Antipathic Dim (witted) Fire Mages no longer tolerate the lack of evildoing.
+
+We send them out on a mission so diabolical, so evil that the world will never be the same again!
+
+We order our unworthy followers to
+DESTROY THE SATURDAY
+and plunge humanity into a dark age of 5 working days and 1 holiday per week... FOREVER!\n\n\n\n\n\n\n\n\n",
+
+ 'Story2Text', =>
+"Whenever EVIL looms on the horizon, the good guys are there to save the day. Son Goku, the protector of Earth and Humanity went to the rescue...
+
+Only to become ROADKILL on his way to the Mortal Szombat tournament! It was Cumi's first time behind the wheel, after all...\n\n\n\n\n\n\n\n\n",
+};
+
+
+
+
+
+
+
+
+
+$::Hungarian = { 'LanguageCode' => 3,
+
+# In-game text
+
+ 'MAX COMBO!!!' => "MAX KOMBÓ!!!",
+ '%d-hit combo!' => '%dX kombó',
+ '%d%% damage' => '%d%% sebzés',
+ 'Round %d' => '%d. menet',
+ 'REW' => 'VISSZA',
+ 'REPLAY' => undef,
+ 'DEMO' => 'DEMÓ',
+ 'Press F1 to skip...'=> 'F1 gomb: tovább',
+ 'HURRY UP!' => 'GYERÜNK MÁR!',
+ 'TIME IS UP!' => 'NA ENNYI!',
+
+ 'Final Judgement' => 'Végsõ Ítélet',
+ 'Continue?' => 'Tovább?',
+ 'SPLAT!' => 'FRÖCCS!',
+ 'Choose A Fighter Dammit' => 'Válassz Játékost, Baszki',
+
+# Menu items
+
+ "Main Menu" => 'FÕMENÜ',
+ "~SINGLE PLAYER GAME"=> '~EGYSZEMÉLYES JÁTÉK',
+ "~MULTI PLAYER GAME"=> '~KÉTSZEMÉLYES JÁTÉK',
+ "~SURRENDER GAME" => '~JÁTÉK FELADÁSA',
+ "~OPTIONS" => '~BEÁLLÍTÁSOK',
+ "~INFO" => '~INFORMÁCIÓK',
+ "QUIT" => 'QUIT',
+ "~OK" => '~OKÉ',
+ "~LANGUAGE: " => '~NYELV: ',
+
+ "Options" => 'Beállítások',
+ "~FULLSCREEN ON" => 'Teljes képernyõ',
+ "~FULLSCREEN OFF" => 'Ablakos megjelenítés',
+ "GAME SPEED: " => 'Játék sebesség: ',
+ "GAME TIME: " => 'Játékidõ: ',
+ "STAMINA: " => 'Állóképesség: ',
+ "~SOUND" => '~HANG',
+ "~RIGHT PLAYER KEYS"=> '~Jobb játékos gombjai',
+ "~LEFT PLAYER KEYS" => '~Bal játékos gombjai',
+
+ "Sound" => 'Hangok',
+ "CHANNELS: " => 'Csatornák: ',
+ "SOUND QUALITY: " => 'Hangminõség: ',
+ "SOUND FIDELITY: " => 'Hangpontosság: ',
+ "MUSIC VOLUME: " => 'Zene hangereje: ',
+ "EFFECTS VOLUME: " => 'Zajok hangereje: ',
+
+
+# Menu options
+
+ "BABY" => 'CSECSEMÕ',
+ "VERY LOW" => 'NAGYON GYÉR',
+ "LOW" => 'GYÉR',
+ "NORMAL" => 'NORMÁLIS',
+ "HIGH" => 'KEMÉNY',
+ "VERY HIGH" => 'NAGYON KEMÉNY',
+ "NEAR IMMORTAL" => 'TERMINÁTOR',
+
+ "SNAIL RACE" => 'CSIGAVERSENY',
+ "SLOW" => 'LASSÚ',
+ "NORMAL" => 'NORMÁL',
+ "TURBO" => 'TURBÓ',
+ "KUNG-FU MOVIE" => 'KUNG-FU FILM',
+
+ "MONO" => 'MONÓ',
+ "STEREO" => 'SZTEREÓ',
+
+ "LOW" => 'ALACSONY',
+ "MEDIUM" => 'KÖZEPES',
+ "HIGH" => 'MAGAS',
+
+ "OFF" => 'NINCS',
+
+# Key configuration
+
+ '%s player-\'%s\'?' => '%s játékos - \'%s\?',
+ 'Left' => 'Bal',
+ 'Right' => 'Jobb',
+ "up", => 'fel',
+ "down", => 'le',
+ "left", => 'balra',
+ "right", => 'jobbra',
+ "block", => 'védés',
+ "low punch", => 'alsó ütés',
+ "high punch", => 'felsõ ütés',
+ "low kick", => 'alsó rúgás',
+ "high kick" => 'felsõ rúgás',
+ 'Thanks!' => 'Köszi!',
+
+# Demo screens,
+
+ 'Fighter Stats' => 'Harcos Adatai',
+ 'Unfortunately this fighter is not yet playable.' => 'Sajnos õ még nem játszható.',
+ 'KEYS' => 'GOMBOK',
+ 'Name: ' => 'Név: ',
+ 'Team: ' => 'Csapat: ',
+ 'Style: ' => 'Stílus: ',
+ 'Age: ' => 'Kor: ',
+ 'Weight: ' => 'Súly: ',
+ 'Height: ' => 'Magasság: ',
+ 'Shoe size: ' => 'Cipõméret: ',
+
+ "Credits" => 'Készítették',
+ "CreditsText1" =>
+"
+. .   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½
+¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý
+Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+
+
+
+A Mortál Szombat Elkövetõi
+
+
+-- A MORTÁL SZOMBAT CSAPAT --
+
+
+PROGRAM - UPi
+ZENE - Oedipus
+GRAFIKA - UPi
+Német fordítás - ??
+Francia fordítás - ??
+Spanyol fordítás - ??
+
+-- SZEREPLÕK --
+
+Boxer - Zoli
+Cumi - Mint önmaga
+Descant - Mint önmaga
+Fûrészes Õrült - Ambrus
+Grizli - Mint önmaga
+Kinga - Mint önmaga
+Macy - Mint önmaga
+Misi - Mint önmaga
+Rising-san - Surba
+Sirpi - Mint önmaga
+Taka Ito - Bence
+Tökéletlen Katona - Dani
+Watasiwa Baka Janajo - Ulmar
+Black Dark Evil Mage - UPi
+
+-- SZERVEREINK --
+
+sourceforge.net
+apocalypse.rulez.org
+freshmeat.net
+
+A Mortál Szombat Copyright 2003, A Mortál Szombat Csapat
+Distributed under the GNU General Public Licence Version 2\n\n",
+
+ 'CreditsText2' =>
+'Thanks to Midway for not harrassing us with legal stuff so far, even though '.
+'we must surely violate at least 50 of their patents, international copyrights and registered trademarks.
+
+
+OpenMortal needs your help! If you can contribute music, graphics, improved code, '.
+'additional characters, cash, beer, pizza or any other consumable, please mail us '.
+'at upi@apocalypse.rulez.org! The same address is currently accepting comments and '.
+"fanmail too (hint, hint!).\n\n",
+
+ 'CreditsText3' =>
+"Be sure to check out other stuff from
+Apocalypse Production
+and
+Degec Entertainment\n\n",
+
+ 'Story1Text' =>
+"Mi, a Gonosz Gyilkos Fekete Ellenszenves Sötét(elméjû) Tûzmágusok istenei nem tûrhetjük tovább a gonosztevés hiányát.
+
+Egy küldetést adunk nekik amelyik olyan ördögien gonosz, amilyet a világ még sosem látott!
+
+Méltatlan alattvalóink parancsa:
+ELPUSZTÍTANI
+A SZOMBATOT
+hogy az emberiség az 5 munkanap és egy szünnapos hét sötét korába süllyedjen... ÖRÖKRE!\n\n\n\n\n\n\n\n\n",
+
+ 'Story2Text', =>
+"Whenever EVIL looms on the horizon, the good guys are there to save the day. Son Goku, the protector of Earth and Humanity went to the rescue...
+
+Only to become ROADKILL on his way to the Mortal Szombat tournament! It was Cumi's first time behind the wheel, after all...\n\n\n\n\n\n\n\n\n",
+};
+
+
+
+
+
+
+
+$::French = { 'LanguageCode' => 2,
+
+# In-game text
+
+ 'MAX COMBO!!!' => 'MAX COMBO!!!',
+ '%d-hit combo!' => '%d-coups combo!', # e.g. 3-hit combo!
+ '%d%% damage' => '%d%% degats', # e.g. 30% damage
+ 'Round %d' => 'Round %d',
+ 'REW' => 'REMB',
+ 'REPLAY' => 'RALENTI',
+ 'DEMO' => 'DEMO',
+ 'Press F1 to skip...'=> 'Appuyez sur F1 pour annuler',
+ 'HURRY UP!' => 'DEPECHEZ-VOUS !',
+ 'TIME IS UP!' => 'LE TEMPS EST ECOULE',
+
+ 'Final Judgement' => 'Jugement Final',
+ 'Continue?' => 'Continuer ?',
+ 'SPLAT!' => 'SPLAT',
+ 'Choose A Fighter Dammit' => 'Choisis un combattant Mildiou !',
+
+# Menu items
+
+ "Main Menu" => "Menu Principal",
+ "~SINGLE PLAYER GAME"=> "JEU SOLO",
+ "~MULTI PLAYER GAME"=> "JEU MULTI",
+ "~SURRENDER GAME" => "Jeu JeMeRends",
+ "~OPTIONS" => "OPTIONS",
+ "~INFO" => "INFO",
+ "QUIT" => "QUITTER",
+ "~OK" => "OK",
+ "~LANGUAGE: " => "LANGUE: ",
+
+ "Options" => "Options",
+ "~FULLSCREEN ON" => "Plein écran ON",
+ "~FULLSCREEN OFF" => "Plein écran OFF",
+ "GAME SPEED: " => "Vitesse de jeu: ",
+ "GAME TIME: " => "Temps de jeu: ",
+ "STAMINA: " => "Vitalité: ",
+ "~SOUND" => "SON",
+ "~RIGHT PLAYER KEYS"=> "Touches joueur droite",
+ "~LEFT PLAYER KEYS" => "Touches joueur gauche",
+
+ "Sound" => 'Son',
+ "CHANNELS: " => "CANAUX: ", # Mono / Stereo
+ "SOUND QUALITY: " => "Echantillonage: ", # KHz of playback rate
+ "SOUND FIDELITY: " => "Qualité sonore: ", # 8 bit or 16 bit
+ "MUSIC VOLUME: " => "Volume musical: ", # OFF or numeric
+ "EFFECTS VOLUME: " => "Volume effets : ", # OFF or numeric
+
+
+# Menu options
+
+ "BABY" => "BEBE",
+ "VERY LOW" => "TRES BAS",
+ "LOW" => "BAS",
+ "NORMAL" => "NORMAL",
+ "HIGH" => "ELEVE",
+ "VERY HIGH" => "TRES ELEVE",
+ "NEAR IMMORTAL" => "PRESQUE IMMORTEL",
+
+ "SNAIL RACE" => "COURSE D'ESCARGOT",
+ "SLOW" => "LENT",
+ "NORMAL" => "NORMAL",
+ "TURBO" => "TURBO",
+ "KUNG-FU MOVIE" => "FILM DE KUNG-FU",
+
+ # Sound / Channels
+ "MONO" => "MONO",
+ "STEREO" => "STEREO",
+
+ # Sound / Mixing rate settings
+ "LOW" => "BAS",
+ "MEDIUM" => "MOYEN",
+ "HIGH" => "HAUT",
+
+ # Sound volume
+ "OFF" => "OFF",
+
+# Key configuration
+
+ '%s player-\'%s\'?' => '%s joueur-\'%s\'?', # The first %s becomes Left or Right. The second %s is up/down/high punch/...
+ 'Left' => 'Gauche',
+ 'Right' => 'Droite',
+ "up", => "haut",
+ "down", => "bas",
+ "left", => "gauche",
+ "right", => "droite",
+ "block", => "bloquer",
+ "low punch", => "poing bas",
+ "high punch", => "poing haut",
+ "low kick", => "Coup de pied bas",
+ "high kick" => "Coup de pied haut",
+ 'Thanks!' => "Merci !",
+
+# Demo screens,
+
+ 'Fighter Stats' => 'Statistiques Combattant',
+ 'Unfortunately this fighter is not yet playable.' => 'Malheureusement ce combattant n\'est pas encore jouable',
+ 'Name: ' => 'Nom: ',
+ 'Team: ' => 'Equipe: ',
+ 'Style: ' => 'Style: ',
+ 'Age: ' => 'Age: ',
+ 'Weight: ' => 'Poids: ',
+ 'Height: ' => 'Taille: ',
+ 'Shoe size: ' => 'Pointure: ',
+
+ "Credits" => "Crédits",
+ "CreditsText1" =>
+"OPENMORTAL CREDITS
+
+
+-- L'EQUIPE D'OPENMORTAL EST --
+
+
+Programmation - UPi
+Musique - Oedipus
+Graphiques - UPi
+German translation - ??
+French translation - Vampyre
+Spanish translation - ??
+
+-- Acteurs --
+
+Boxer - Zoli
+Cumi - Dans son rôle
+Descant - Dans son rôle
+Fureszes Orult - Ambrus
+Grizli - Dans son rôle
+Kinga - Dans son rôle
+Macy - Dans son rôle
+Misi - Dans son rôle
+Rising-san - Surba
+Sirpi - Dans son rôle
+Taka Ito - Bence
+Tokeletlen Katona - Dani
+Watasiwa Baka Janajo - Ulmar
+Black Dark Evil Mage - UPi
+
+-- HEBERGEMENT --
+
+sourceforge.net
+apocalypse.rulez.org
+freshmeat.net
+
+OpenMortal est un Copyright 2003 de l'Equipe OpenMortal \
+Distribué sous Licence GNU General Public Licence Version 2\n\n",
+
+ 'CreditsText2' =>
+'Merci à Midway de ne pas nous harceler avec des trucs légaux (jusqu\'ici), bien que '.
+'nous avons sûrement violé au moins 50 de leurs brevets, copyrights internationaux, et marques déposées.
+
+
+OpenMortal a besoin de votre aide ! Si vous pouvez contribuer à la musique, graphiques, programmation améliorée, '.
+'personnages supplémentaires, du fric, de la bière, des pizzas, ou toute autre forme de nourriture, SVP, envoyez-nous un email '.
+'à upi@apocalypse.rulez.org! La même adresse accepte actuellement les commentaires et '.
+"les emails de fans aussi (astuce, astuce !).\n\n",
+
+ 'CreditsText3' =>
+"Soyez certains de vérifier les autres programmes de
+Apocalypse Production
+et
+Degec Entertainment\n\n",
+
+ 'Story1Text' =>
+"Nous, les Dieux des Diaboliques Tueurs Noirs Antipathiques Faibles (humour) Mages de Feu, ne tolérons plus longtemps le manque de faiseurs de mal.
+
+Nous les avons une fois de plus envoyés dans un mission si diabolique, si Luciferatique que le monde ne sera plus jamais le même!
+
+Nous ordonnons à nos disciples indignes de
+DETRUIRE LE SAMEDI
+et de plonger l'humanité dans un Moyen-Age de 5 jours de travail et 1 jour de vacances par semaine... A TOUT JAMAIS!\n\n\n\n\n\n\n\n\n",
+
+ 'Story2Text', =>
+"Bien que le Mal lorgne l'horizon, les gentils doivent sauver le jour ! Son Goku, le protecteur de la Terre et de l'Humanité viennent à la rescousse...
+
+Seulement afin de devenir le TUEUR IMPITOYABLE sur le long chemin du tournoi Mortal Szombat ! C'était la première apparition de Cumi, après tout...\n\n\n\n\n\n\n\n\n",
+};
+
+
+
+
+
+
+
+
+
+
+$::Spanish = { 'LanguageCode' => 2,
+
+# In-game text
+
+ 'MAX COMBO!!!' => 'MAX COMBO!!!',
+ '%d-hit combo!' => '%d-hit combo!', # e.g. 3-hit combo!
+ '%d%% damage' => '%d%% daño', # e.g. 30% damage
+ 'Round %d' => 'Round %d',
+ 'REW' => 'RETROCEDER',
+ 'REPLAY' => 'REPRODUCIR',
+ 'DEMO' => 'DEMO',
+ 'Press F1 to skip...'=>'Presiona F1 para saltar...',
+ 'HURRY UP!' => 'APURATE!',
+ 'TIME IS UP!' => 'SE ACABO EL TIEMPO!',
+
+ 'Final Judgement' => 'Juicio Final',
+ 'Continue?' => 'Continuar?',
+ 'SPLAT!' => 'SPLAT!',
+ 'Choose A Fighter Dammit' => 'Escoge un Peleador',
+
+# Menu items
+
+ "Main Menu" => "Menu Principal",
+ "~SINGLE PLAYER GAME"=>"~1 SOLO JUGADOR ",
+ "~MULTI PLAYER GAME"=> "~MULTIJUGADOR ",
+ "~SURRENDER GAME" => "~ENTREGA ",
+ "~OPTIONS" => "~OPCIONES",
+ "~INFO" => "~INFO",
+ "QUIT" => "SALIR",
+ "~OK" => "~OK",
+ "~LANGUAGE: " => "~LENGUAJE: ",
+
+ "Options" => "Opciones",
+ "~FULLSCREEN ON" => "~PANTALLA COMPLETA ON",
+ "~FULLSCREEN OFF" => "~PANTALLA COMPLETA OFF",
+ "GAME SPEED: " => "VELOCIDAD DEL JUEGO: ",
+ "GAME TIME: " => "TIEMPO DEL JUEGO: ",
+ "STAMINA: " => "STAMINA: ",
+ "~SOUND" => "~SONIDO",
+ "~RIGHT PLAYER KEYS"=> "~TECLAS JUGADOR DERECHO",
+ "~LEFT PLAYER KEYS" => "~TECLAS JUGADOR IZQUIERDO",
+
+ "Sound" => "Sonido",
+ "CHANNELS: " => "CANALES: ", # Mono / Stereo
+ "SOUND QUALITY: " => "CALIDAD DEL SONIDO: ", # KHz of playback rate
+ "SOUND FIDELITY: " => "FIDELIDAD DEL SONIDO: ", # 8 bit or 16 bit
+ "MUSIC VOLUME: " => "VOLUMEN DE LA MUSICA: ", # OFF or numeric
+ "EFFECTS VOLUME: " => "VOLUMEN DE LOS EFECTOS: ", # OFF or numeric
+
+
+# Menu options
+
+ "BABY" => "BEBE",
+ "VERY LOW" => "MUY LENTO",
+ "LOW" => "LENTO",
+ "NORMAL" => "NORMAL",
+ "HIGH" => "ALTO",
+ "VERY HIGH" => "MUY ALTO",
+ "NEAR IMMORTAL" => "CERCA DE LA INMORTALIDAD",
+
+ "SNAIL RACE" => "CARRERA DE CARACOL",
+ "SLOW" => "LENTO",
+ "NORMAL" => "NORMAL",
+ "TURBO" => "TURBO",
+ "KUNG-FU MOVIE" => "PELICULA DE KUNG-FU",
+
+ # Sound / Channels
+ "MONO" => "MONO",
+ "STEREO" => "STEREO",
+
+ # Sound / Mixing rate settings
+ "LOW" => "BAJO",
+ "MEDIUM" => "MEDIO",
+ "HIGH" => "ALTO",
+
+ # Sound volume
+ "OFF" => "OFF",
+
+# Key configuration
+
+ '%s player-\'%s\'?' => '%s jugador-\'%s\'?', # The first %s becomes Left or Right. The second %s is up/down/high punch/...
+ 'Left' => 'Izquierda',
+ 'Right' => 'Derecha',
+ "up", => "arriba",
+ "down", => "abajo",
+ "left", => "izquierda",
+ "right", => "derecha",
+ "block", => "bloquear",
+ "low punch", => "puño bajo",
+ "high punch", => "puño alto",
+ "low kick", => "patada baja",
+ "high kick" => "patada alta",
+ 'Thanks!' => 'Gracias!',
+
+# Demo screens,
+
+ 'Fighter Stats' => 'Estadísticas del Peleador',
+ 'Unfortunately this fighter is not yet playable.' => 'Desafortunadamente este jugador no esta habilitado.',
+ 'Name: ' => 'Nombre: ',
+ 'Team: ' => 'Equipo: ',
+ 'Style: ' => 'Estilo: ',
+ 'Age: ' => 'Edad: ',
+ 'Weight: ' => 'Peso: ',
+ 'Height: ' => 'Altura: ',
+ 'Shoe size: ' => 'Tamaño de zapato: ',
+
+ "Credits" => "Creditos",
+ "CreditsText1" =>
+"CREDITOS
+
+
+-- EL EQUIPO DE OPENMORTAL ES --
+
+
+CODING - UPi
+MUSIC - Oedipus
+GRAPHICS - UPi
+German translation - ??
+French translation - ??
+Spanish translation - EdsipeR
+
+-- CAST --
+
+Boxer - Zoli
+Cumi - como el mismo
+Descant - como el mismo
+Fureszes Orult - Ambrus
+Grizli - como el mismo
+Kinga - como ella misma
+Macy - como ella misma
+Misi - como el mismo
+Rising-san - Surba
+Sirpi - como el mismo
+Taka Ito - Bence
+Tokeletlen Katona - Dani
+Watasiwa Baka Janajo - Ulmar
+Black Dark Evil Mage - UPi
+
+-- HOSTING --
+
+sourceforge.net
+apocalypse.rulez.org
+freshmeat.net
+
+OpenMortal es Marca registrada 2003 de OpenMortal Team\
+Distribuido bajo la GNU General Public Licence Version 2\n\n",
+
+ 'CreditsText2' =>
+'Gracias a Midway por no aplastarnos con su equipo legal'.
+'Seguramente nosotros violamos al menos 50 de sus patentes, marcas registradas internacionales y trademarks registradas .
+
+OpenMortal necesita de tu ayuda! Si tu puedes contribuir con musica, imagenes, improvisación de codigo, '.
+'caracteres adicionales, dinero, cerveza, pizza o cualquier otra cosa consumible, por favor escribenos '.
+'a upi@apocalypse.rulez.org! La misma dirección esta actualmente aceptando comentarios y '.
+"tambien emails de fans (hint, hint!).\n\n",
+
+ 'CreditsText3' =>
+"Estate atento para verificar otro stuff desde
+Apocalypse Production
+y
+Degec Entertainment\n\n",
+
+ 'Story1Text' =>
+"Nosotros, los Dioses del Endemoniado Negro Antipatico Asesino Dim no tolero mas lo endemoniado.
+
+Enviamos a ellos en una misión tan diabólica, tan endemoniada que el mundo nunca será el mismo de nuevo!
+
+Ordenamos a nuestros indignos seguidores a
+
+DESTRUIR EL SABADO
+y plagar la humanidad en una epoca oscura de 5 dias de trabajo y uno de descanso por semana.... POR SIEMPRE!\n\n\n\n\n\n\n\n\n",
+
+ 'Story2Text', =>
+"Whenever EVIL looms on the horizon, the good guys are there to save the day. Son Goku, the protector of Earth and Humanity went to the rescue...
+
+Only to become ROADKILL on his way to the Mortal Szombat tournament! It was Cumi's first time behind the wheel, after all...\n\n\n\n\n\n\n\n\n",
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+%::LanguageCodes =
+(
+ 'en' => $::English,
+ 'hu' => $::Hungarian,
+ 'fr' => $::French,
+ 'es' => $::Spanish,
+);
+
+=comment
+SetLanguage sets the two-character language code.
+=cut
+
+$::Language = $::English;
+$::Language = $::Hungarian;
+$::Language = $::French;
+$::Language = $::Spanish;
+
+sub SetLanguage($)
+{
+ my ($NewLanguageCode) = @_;
+ $::LanguageCode = $NewLanguageCode;
+
+ if ( defined $::LanguageCodes{$::LanguageCode} )
+ {
+ $::Language = $::LanguageCodes{$::LanguageCode};
+ }
+ else
+ {
+ print "Language $::LanguageCode is not available. Reverting to English.\n";
+ $::Language = $::English;
+ $::LanguageCode = 'en';
+ }
+ $::LanguageNumber = $::Language->{'LanguageCode'};
+}
+
+
+
+sub Translate($)
+{
+ my $text = shift;
+ print "The translation of '$text' is ";
+
+ $text = $::Language->{$text} if defined $::Language->{$text};
+
+ print "'$text'.\n";
+
+ $::Translated = $text;
+}
+
+
+1;
+
+
+# "Connect to game", "Create game"
+# "Network mode: ", "Connect to: ", "Start Network Play!", "Cancel"
+# "Connection closed."
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Expires
Wed, Feb 4, 2:11 PM (5 h, 16 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
55628
Default Alt Text
(112 KB)

Event Timeline