buffer table;
int sumIt(item it)
{
return (item_amount(it) + closet_amount(it) + equipped_amount(it) + storage_amount(it));
}
string dispItem(item what)
{
int iTot = sumIt(what);
string a;
if( iTot == 0 )
a = what + " - <font color='red'>" + iTot + "</font><br>";
else
a = what + " - <font color='green'>" + iTot + "</font><br>";
return a;
}
string dcdispItem(item what)
{
int idcTot = display_amount( what );
string b;
if( idcTot == 0 )
b = "<font color='red'>" + idcTot + "</font><br>";
else
b = "<font color='green'>" + idcTot + "</font><br>";
return b;
}
string ol_scratch()
{
buffer a;
buffer b;
foreach x in $items[Ol' Scratch's ash can, Ol' Scratch's ol' britches, Ol' Scratch's stovepipe hat, Ol' Scratch's infernal pitchfork,
Ol' Scratch's manacles, Ol' Scratch's stove door]
{
a.append( dispItem( x ) );
b.append( dcdispItem( x ) );
}
string c = to_string( a ) + "</TD><TD>" + to_string( b );
return c;
}
string frosty()
{
buffer a;
buffer b;
foreach x in $items[Frosty's carrot, Frosty's nailbat, Frosty's old silk hat, Frosty's iceball, Frosty's arm, Frosty's snowball sack]
{
a.append( dispItem( x ) );
b.append( dcdispItem( x ) );
}
string c = to_string( a ) + "</TD><TD>" + to_string( b );
return c;
}
string oscus()
{
buffer a;
buffer b;
foreach x in $items[Oscus's dumpster waders, Oscus's pelt, Wand of Oscus, Oscus's flypaper pants, Oscus's garbage can lid,
Oscus's neverending soda]
{
a.append( dispItem( x ) );
b.append( dcdispItem( x ) );
}
string c = to_string( a ) + "</TD><TD>" + to_string( b );
return c;
}
string zombo()
{
buffer a;
buffer b;
foreach x in $items[Zombo's grievous greaves, Zombo's shield, Zombo's skullcap, Zombo's empty eye, Zombo's shoulder blade, Zombo's skull ring]
{
a.append( dispItem( x ) );
b.append( dcdispItem( x ) );
}
string c = to_string( a ) + "</TD><TD>" + to_string( b );
return c;
}
string chester()
{
buffer a;
buffer b;
foreach x in $items[Chester's bag of candy, Chester's cutoffs, Chester's moustache, Chester's Aquarius medallion, Chester's muscle shirt,
Chester's sunglasses]
{
a.append( dispItem( x ) );
b.append( dcdispItem( x ) );
}
string c = to_string( a ) + "</TD><TD>" + to_string( b );
return c;
}
string hodgman()
{
buffer a;
buffer b;
foreach x in $items[Hodgman's bow tie, Hodgman's porkpie hat, Hodgman's lobsterskin pants, Hodgman's almanac, Hodgman's lucky sock,
Hodgman's metal detector, Hodgman's varcolac paw, Hodgman's harmonica, Hodgman's garbage sticker, Hodgman's cane, Hodgman's whackin' stick,
Hodgman's disgusting technicolor overcoat, Hodgman's imaginary hamster]
{
a.append( dispItem( x ) );
b.append( dcdispItem( x ) );
}
string c = to_string( a ) + "</TD><TD>" + to_string( b );
return c;
}
void main()
{
table.append( "<TABLE BORDER='1' CELLPADDING='1'>" );
table.append( "<TR><TD><B>Ol' Scratch</B></TD><TD><B>DC</B></TD><TD><B>Frosty</B></TD><TD><B>DC</B></TD></TR>");
table.append( "<TR><TD>" + ol_scratch() + "</TD><TD>" + frosty() + "</TD></TR>" );
table.append( "<TR><TD><B>Oscus</B></TD><TD><B>DC</B></TD><TD><B>Zombo</B></TD><TD><B>DC</B></TD></TR>");
table.append( "<TR><TD>" + oscus() + "</TD><TD>" + zombo() + "</TD></TR>" );
table.append( "<TR><TD><B>Chester</B></TD><TD><B>DC</B></TD><TD><B>Hodgman</B></TD><TD><B>DC</B></TD></TR>");
table.append( "<TR><TD>" + chester() + "</TD><TD>" + hodgman() + "</TD></TR>" );
table.append( "</TABLE>" );
print_html( table.to_string() );
}