-<: exit :>
-<h2>Magic</h2>
-
-<ul class="maps"><:
-for (@$units) {
- print '<li>', $_->{name};
- print '<br>';
-# my $units = {qw/protoss W zerg B terran R/}->{$_->{race}} x int($_->{unit} + .5);
-# my $cost = int(($_->{min} + $_->{gas}) / 50 - $_->{unit}) || '';
- my $units = {qw/protoss W zerg B terran R/}->{$_->{race}} x int($_->{gas} / 50) || '';
- my $cost = int($_->{min} / 50) || 0;
- my @desc;
- push @desc, "Flying" if $_->{flying};
- push @desc, "Cloaking" if $_->{cloak};
- push @desc, "First Strike" if $_->{range} and $_->{range} >= 4;
- my $att = $_->{attack}->{ground};
- push @desc, "Trample" if $att and $att->{splash};
- $att = $att->{damage} if $att;
- $att = $att->[0] if ref $att eq "ARRAY";
- $att = int($att / 5);
- my $def = int($_->{hp} / 45);
- printf "%s<br>%s<br>%s/%s", $cost . $units, join(",", @desc), $att, $def;
-}
-:></ul>