Mercurial > hg > batmud > misc
changeset 152:330ec9a42ae0 misc
Updates.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 21 Dec 2010 23:05:26 +0000 |
parents | 4c0b50a5e7b5 |
children | fd57384798a0 |
files | materials/alloy.php |
diffstat | 1 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/materials/alloy.php Tue Dec 21 22:41:33 2010 +0000 +++ b/materials/alloy.php Tue Dec 21 23:05:26 2010 +0000 @@ -245,8 +245,23 @@ $tag = ($mat1 == $mat2) ? "th" : "td"; - if (isset($tmp) && list($a, $b) = each($tmp)) { - echo "<".$tag.addValueStyle($b)." title=\"".$b." successful alloys (".$mat1." + ".$mat2." = ".$a.")\">".matLink($a)."</".$tag.">"; + if (isset($tmp)) { + arsort($tmp); + $value = 0; + foreach ($tmp as $a => $b) + $value += $b; + + $note = count($tmp) > 1 ? " [UNSTABLE]" : ""; + + echo "<".$tag.addValueStyle($value). + (count($tmp) > 1 ? " style=\"font-style:italic;\">" : ">"); + + foreach ($tmp as $a => $b) { + echo matLink($a, $b." successful alloys (".$mat1." + ".$mat2." = ".$a.")".$note)." "; + } + + echo "</".$tag.">"; + } else echo "<".$tag." class=\"nohits\">-</".$tag.">"; }