X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/174e7f8facfa25922fe0cbc5e8dcb1e5a6f5bc07..3c13eb61b3a06c180d49c877ebe904f60bd2d390:/gameserv/gameserv.cpp diff --git a/gameserv/gameserv.cpp b/gameserv/gameserv.cpp index 7a6414a..218eefe 100644 --- a/gameserv/gameserv.cpp +++ b/gameserv/gameserv.cpp @@ -168,6 +168,8 @@ void gameserv(char *source, char *buf) if (curday != day) { refreshall(); + clearNews(todaysnews); + saveNews(newsdata, todaysnews); day = curday; save_day(); // here i come to save the day! } @@ -220,8 +222,7 @@ void gameserv(char *source, char *buf) } else if (stricmp(cmd, "LOGOUT") == 0) { do_logout(source); } else if (stricmp(cmd, "NEWS") == 0) { - addNews(todaysnews, "This is a test"); - showNews(source, todaysnews); + do_news(source); } else if (stricmp(cmd, "REGISTER") == 0) { do_register(source); } else if (stricmp(cmd, "IDENTIFY") == 0) { @@ -1356,9 +1357,20 @@ void do_use(char *u) return; } int oldhealing = user->stats->hp; + user->stats->hp += (10 * user->stats->level) + (rand() % 10) * user->stats->level; + if (user->stats->hp - user->stats->maxhp >= 100) + { + user->stats->hp = user->stats->maxhp + 100; + + if (oldhealing >= (user->stats->maxhp + 100)) + { + notice(s_GameServ, u, "You cannot hold anymore HP!"); + return; + } + } + notice(s_GameServ, u, "You hastiliy gulp down the flask of cool life-giving waters."); notice(s_GameServ, u, "Rejuvination spreads throughout your body."); - user->stats->hp += (10 * user->stats->level) + (rand() % 10) * user->stats->level; notice(s_GameServ, u, "You gain %d HP!", user->stats->hp - oldhealing); p->decHealing(); if (player_fight(user))