]> jfr.im git - irc/gameservirc.git/commitdiff
Changed USE HEALTH to USE HEALING
authorkainazzzo <redacted>
Wed, 12 May 2004 20:22:52 +0000 (20:22 +0000)
committerkainazzzo <redacted>
Wed, 12 May 2004 20:22:52 +0000 (20:22 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@214 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/gameserv.cpp

index fbe8ded0ad05bed0f1798580d369fb22f9aaf822..3a9771d11ec0c40b1dc88c39418c905444d32ff6 100644 (file)
@@ -404,6 +404,20 @@ void showstats(const char *u, const char *nick)
         space = spaces(strlen(buf), " ");
         notice(s_GameServ, sender->getNick(), "%s%sPlayer Fights: %d", buf, space, ni->stats->player_fights);
         delete [] space;
+       Pouch *inv = &ni->stats->inventory;
+
+       notice(s_GameServ, u, "Potions");
+       sprintf(buf, "Healing: %d", inv->Healing());
+       space = spaces(strlen(buf), " ");
+       notice(s_GameServ, sender->getNick(), "%s%sHP: %d", buf, 
+               space, inv->HP());
+       delete [] space;
+
+       sprintf(buf, "Strength: %d", inv->Strength());
+       space = spaces(strlen(buf), " ");
+       notice(s_GameServ, sender->getNick(), "%s%sDefense: %d", buf, 
+               space, inv->Defense());
+       delete [] space;
     }
     else
     {
@@ -1337,19 +1351,24 @@ void do_use(char *u)
 
     p = &user->stats->inventory;
 
-    if (stricmp(item, "HEALTH") == 0)
+    if (stricmp(item, "HEALING") == 0)
     {
        if (p->Healing() <= 0)
        {
-           notice(s_GameServ, u, "You are out of Health Potions!");
+           notice(s_GameServ, u, "You are out of Healing Potions!");
            return;
        }
-       int oldhealth = user->stats->hp;
+       int oldhealing = user->stats->hp;
        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 - oldhealth);
+       notice(s_GameServ, u, "You gain %d HP!", user->stats->hp - oldhealing);
        p->decHealing();
+       if (player_fight(user))
+       {
+           notice(s_GameServ, user->stats->battle->getNick(),
+               "%s has used a healing potion!");
+       }
     }
     else if (stricmp(item, "STRENGTH") == 0)
     {
@@ -1364,6 +1383,11 @@ void do_use(char *u)
        user->stats->strength += 1 + (rand() % 10 >= 8 ? 1 : 0); // 1-2
        notice(s_GameServ, u, "You gain %d Strength points!", user->stats->strength - oldstrength);
        p->decStrength();
+       if (player_fight(user))
+       {
+           notice(s_GameServ, user->stats->battle->getNick(),
+               "%s has used a strength potion!");
+       }
     }
     else if (stricmp(item, "DEFENSE") == 0)
     {
@@ -1378,6 +1402,11 @@ void do_use(char *u)
        user->stats->defense += 1 + (rand() % 10 >= 8 ? 1 : 0); // 1-2
        notice(s_GameServ, u, "You gain %d Defense points!", user->stats->defense - olddefense);
        p->decDefense();
+       if (player_fight(user))
+       {
+           notice(s_GameServ, user->stats->battle->getNick(),
+               "%s has used a defense potion!");
+       }
     }
     else if (stricmp(item, "HP") == 0)
     {
@@ -1393,10 +1422,15 @@ void do_use(char *u)
 
        notice(s_GameServ, u, "You gain %d Maximum hit points!", user->stats->maxhp - oldHP);
        p->decHP();
+       if (player_fight(user))
+       {
+           notice(s_GameServ, user->stats->battle->getNick(),
+               "%s has used a HP potion!");
+       }
     }
     else
     {
-       notice(s_GameServ, u, "SYNTAX: /msg %S USE {HEALTH | STRENGTH | DEFENSE}");
+       notice(s_GameServ, u, "SYNTAX: /msg %S USE {HEALING | STRENGTH | DEFENSE | HP}");
        return;
     }