|
|
|
@ -26,7 +26,7 @@ DFhackCExport const char * plugin_name ( void )
|
|
|
|
|
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
|
|
|
|
|
{
|
|
|
|
|
commands.clear();
|
|
|
|
|
commands.push_back(PluginCommand("kittens","Rainbow kittens. What else?",kittens));
|
|
|
|
|
commands.push_back(PluginCommand("nyan","NYAN CAT INVASION!",kittens));
|
|
|
|
|
commands.push_back(PluginCommand("ktimer","Time events...",ktimer));
|
|
|
|
|
return CR_OK;
|
|
|
|
|
}
|
|
|
|
@ -36,7 +36,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c )
|
|
|
|
|
shutdown_flag = true;
|
|
|
|
|
while(!final_flag)
|
|
|
|
|
{
|
|
|
|
|
c->con->msleep(60);
|
|
|
|
|
c->con.msleep(60);
|
|
|
|
|
}
|
|
|
|
|
return CR_OK;
|
|
|
|
|
}
|
|
|
|
@ -50,7 +50,7 @@ DFhackCExport command_result plugin_onupdate ( Core * c )
|
|
|
|
|
uint64_t time2 = GetTimeMs64();
|
|
|
|
|
uint64_t delta = time2-timeLast;
|
|
|
|
|
timeLast = time2;
|
|
|
|
|
dfout << "Time delta = " << delta << " ms" << std::endl;
|
|
|
|
|
c->con << "Time delta = " << delta << " ms" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
return CR_OK;
|
|
|
|
|
}
|
|
|
|
@ -66,7 +66,7 @@ DFhackCExport command_result ktimer (Core * c, vector <string> & parameters)
|
|
|
|
|
c->Suspend();
|
|
|
|
|
c->Resume();
|
|
|
|
|
uint64_t timeend = GetTimeMs64();
|
|
|
|
|
dfout << "Time to suspend = " << timeend - timestart << " ms" << std::endl;
|
|
|
|
|
c->con << "Time to suspend = " << timeend - timestart << " ms" << std::endl;
|
|
|
|
|
timeLast = timeend;
|
|
|
|
|
timering = true;
|
|
|
|
|
return CR_OK;
|
|
|
|
@ -75,7 +75,28 @@ DFhackCExport command_result ktimer (Core * c, vector <string> & parameters)
|
|
|
|
|
DFhackCExport command_result kittens (Core * c, vector <string> & parameters)
|
|
|
|
|
{
|
|
|
|
|
final_flag = false;
|
|
|
|
|
Console * con = c->con;
|
|
|
|
|
Console & con = c->con;
|
|
|
|
|
// http://evilzone.org/creative-arts/nyan-cat-ascii/
|
|
|
|
|
const char * nyan []=
|
|
|
|
|
{
|
|
|
|
|
"NYAN NYAN NYAN NYAN NYAN NYAN NYAN",
|
|
|
|
|
"+ o + o ",
|
|
|
|
|
" + o + +",
|
|
|
|
|
"o +",
|
|
|
|
|
" o + + +",
|
|
|
|
|
"+ o o + o",
|
|
|
|
|
"-_-_-_-_-_-_-_,------, o ",
|
|
|
|
|
"_-_-_-_-_-_-_-| /\\_/\\ ",
|
|
|
|
|
"-_-_-_-_-_-_-~|__( ^ .^) + + ",
|
|
|
|
|
"_-_-_-_-_-_-_-\"\" \"\" ",
|
|
|
|
|
"+ o o + o",
|
|
|
|
|
" + +",
|
|
|
|
|
"o o o o +",
|
|
|
|
|
" o +",
|
|
|
|
|
"+ + o o + ",
|
|
|
|
|
"NYAN NYAN NYAN NYAN NYAN NYAN NYAN",
|
|
|
|
|
0
|
|
|
|
|
};
|
|
|
|
|
const char * kittenz1 []=
|
|
|
|
|
{
|
|
|
|
|
" ____",
|
|
|
|
@ -88,32 +109,32 @@ DFhackCExport command_result kittens (Core * c, vector <string> & parameters)
|
|
|
|
|
" '.,,/'.,,mrf",
|
|
|
|
|
0
|
|
|
|
|
};
|
|
|
|
|
con->cursor(false);
|
|
|
|
|
con->clear();
|
|
|
|
|
con.cursor(false);
|
|
|
|
|
con.clear();
|
|
|
|
|
int color = 1;
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
if(shutdown_flag)
|
|
|
|
|
{
|
|
|
|
|
final_flag = true;
|
|
|
|
|
c->con->reset_color();
|
|
|
|
|
dfout << std::endl << "MEOW!" << std::endl << std::flush;
|
|
|
|
|
con.reset_color();
|
|
|
|
|
con << std::endl << "MEOW!" << std::endl << std::flush;
|
|
|
|
|
return CR_OK;
|
|
|
|
|
}
|
|
|
|
|
con->color(color);
|
|
|
|
|
con.color(color);
|
|
|
|
|
int index = 0;
|
|
|
|
|
const char * kit = kittenz1[index];
|
|
|
|
|
con->gotoxy(1,1);
|
|
|
|
|
dfout << "Your DF is now full of kittens!" << std::endl;
|
|
|
|
|
const char * kit = nyan[index];
|
|
|
|
|
con.gotoxy(1,1);
|
|
|
|
|
//con << "Your DF is now full of kittens!" << std::endl;
|
|
|
|
|
while (kit != 0)
|
|
|
|
|
{
|
|
|
|
|
con->gotoxy(5,5+index);
|
|
|
|
|
dfout << kit;
|
|
|
|
|
con.gotoxy(1,1+index);
|
|
|
|
|
con << kit;
|
|
|
|
|
index++;
|
|
|
|
|
kit = kittenz1[index];
|
|
|
|
|
kit = nyan[index];
|
|
|
|
|
}
|
|
|
|
|
dfout.flush();
|
|
|
|
|
con->msleep(60);
|
|
|
|
|
con.flush();
|
|
|
|
|
con.msleep(60);
|
|
|
|
|
color ++;
|
|
|
|
|
if(color > 15)
|
|
|
|
|
color = 1;
|
|
|
|
|