sc: hover creep boost on speed values
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 30 Jun 2015 18:55:16 +0000 (20:55 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 1 Jul 2015 17:32:34 +0000 (19:32 +0200)
sc-units-hots.inc.pl
sc.plp

index 1809d09..524ed12 100644 (file)
@@ -2158,7 +2158,6 @@ use strict;
                flying => 1,
        },
        speed => 0.586,
-       creep => 0,
        sight => 11,
        special => [
                {
@@ -2208,7 +2207,6 @@ use strict;
                flying => 1,
        },
        speed => 1.875,
-       creep => 0,
        sight => 11,
        detect => 1,
        energy => 50,
diff --git a/sc.plp b/sc.plp
index d8e89de..450d1cb 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -313,11 +313,20 @@ sub showrangeint {
                                $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
                                showrangeint($_->{sight}, $_->{upgraded}->{sight})
                        ),
-                       '<td class="val unit-speed">' .
+                       sprintf('<td class="val unit-speed"%2$s>%s',
                                showrange(
                                        map { $_ && sprintf '%.1f', $_ }
                                        $_->{speed}, $_->{upgraded}->{speed}
                                ),
+                               defined $_->{creep} && sprintf(' title="%s on creep"',
+                                       $_->{creep} == 1 ? 'same' : showrange(
+                                               map { $_ && sprintf '%.1f', $_ }
+                                               $_->{speed} * $_->{creep},
+                                               $_->{upgraded}->{speed} && $_->{upgraded}->{speed} *
+                                                       ($_->{upgraded}->{creep} // $_->{creep}),
+                                       ),
+                               ),
+                       ),
                        $_->{attr}->{jump}
                                && qq'<span class="unit unit-jump" title="$_->{attr}->{jump}">↕</span>',
                        '<td class="unit-magic">' . showmagic($_),