]> jfr.im git - irc/gameservirc.git/commitdiff
fixed the potion finding and changed it to 1% chance because of the more powerful...
authorkainazzzo <redacted>
Fri, 16 Sep 2005 02:55:19 +0000 (02:55 +0000)
committerkainazzzo <redacted>
Fri, 16 Sep 2005 02:55:19 +0000 (02:55 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@370 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/.depend
gameserv/c_forest.cpp
gameserv/extern.h

index 557d4bd57d5489fbe904e39e2aa3396a900b5c2e..9ed420739eecfcfb67f7775c859622b8876e4143 100644 (file)
@@ -1,21 +1,21 @@
 # 1 "/home/gameserv/gameserv//"
 aClient.o: aClient.cpp aClient.h options.h player.h extern.h level.h \
-  list.h listnode.h config.h
+  list.h listnode.h config.h item.h
 # 1 "/home/gameserv/gameserv//"
 config.o: config.cpp extern.h player.h level.h list.h listnode.h \
-  aClient.h options.h config.h flags.h
+  aClient.h options.h config.h item.h flags.h
 # 1 "/home/gameserv/gameserv//"
 c_forest.o: c_forest.cpp sockhelp.h aClient.h options.h player.h list.h \
-  listnode.h extern.h level.h config.h flags.h
+  listnode.h extern.h level.h config.h item.h flags.h
 # 1 "/home/gameserv/gameserv//"
 do_attack.o: do_attack.cpp aClient.h options.h player.h extern.h level.h \
-  list.h listnode.h config.h flags.h item.h
+  list.h listnode.h config.h item.h flags.h
 # 1 "/home/gameserv/gameserv//"
 gameserv.o: gameserv.cpp aClient.h options.h player.h config.h extern.h \
-  level.h list.h listnode.h pouch.h flags.h sockhelp.h item.h
+  level.h list.h listnode.h item.h pouch.h flags.h sockhelp.h
 # 1 "/home/gameserv/gameserv//"
 hash.o: hash.cpp extern.h player.h level.h list.h listnode.h aClient.h \
-  options.h config.h
+  options.h config.h item.h
 # 1 "/home/gameserv/gameserv//"
 item.o: item.cpp item.h level.h list.h listnode.h aClient.h options.h \
   player.h extern.h config.h
@@ -24,22 +24,22 @@ level.o: level.cpp item.h level.h list.h listnode.h aClient.h options.h \
   player.h extern.h config.h
 # 1 "/home/gameserv/gameserv//"
 log.o: log.cpp extern.h player.h level.h list.h listnode.h aClient.h \
-  options.h config.h
+  options.h config.h item.h
 # 1 "/home/gameserv/gameserv//"
 news.o: news.cpp extern.h player.h level.h list.h listnode.h aClient.h \
-  options.h config.h
+  options.h config.h item.h
 # 1 "/home/gameserv/gameserv//"
 pouch.o: pouch.cpp extern.h player.h level.h list.h listnode.h aClient.h \
-  options.h config.h pouch.h item.h
+  options.h config.h item.h pouch.h
 # 1 "/home/gameserv/gameserv//"
 player.o: player.cpp item.h level.h list.h listnode.h aClient.h options.h \
   player.h pouch.h extern.h config.h flags.h
 # 1 "/home/gameserv/gameserv//"
 sockhelp.o: sockhelp.cpp sockhelp.h extern.h player.h level.h list.h \
-  listnode.h aClient.h options.h config.h
+  listnode.h aClient.h options.h config.h item.h
 # 1 "/home/gameserv/gameserv//"
 tcpclient.o: tcpclient.cpp sockhelp.h options.h list.h listnode.h \
-  aClient.h player.h extern.h level.h config.h flags.h
+  aClient.h player.h extern.h level.h config.h item.h flags.h
 # 1 "/home/gameserv/gameserv//"
 devel.o: devel.cpp options.h list.h listnode.h aClient.h player.h \
-  extern.h level.h config.h flags.h item.h pouch.h
+  extern.h level.h config.h item.h flags.h pouch.h
index 762d1e7710fce19fe736b743f3a022e85689b373..cd6dbecc53278f0b5325101edfaf38db58883b1a 100644 (file)
@@ -1,9 +1,11 @@
-#include "sockhelp.h"
 #include "aClient.h"
-#include "list.h"
+#include <cctype>
 #include "extern.h"
 #include "flags.h"
-#include <cctype>
+#include "item.h"
+#include "list.h"
+#include "pouch.h"
+#include "sockhelp.h"
 
 void do_forest(char *u);
 Monster *getNewMonster(Monster *m);
@@ -69,8 +71,8 @@ void do_forest(char *u)
 
            notice(s_GameServ, u, "You search the forest for something to kill...");
 
-           // 88% of forest searching turns up a monster
-           if (eventnum >= 12)
+           // 89% of forest searching turns up a monster
+           if (eventnum >= 11)
            {
                p->fight = new Monster(levels[p->level - 1].randomMonster());
                notice(s_GameServ, u, "You have found \ 2%s\ 2!", p->fight->name.c_str());
@@ -81,37 +83,21 @@ void do_forest(char *u)
                p->master = NULL; // Just to make sure
                display_monster(u);
            }
-           /*
-           else if (eventnum < 12 && eventnum >= 10) // 2% for finding potions
+           else if (eventnum < 11 && eventnum >= 10) // 1% for finding potions
            {
+             list<tavernItem>::iterator temp_tavernitem;
+
                notice(s_GameServ, u, "Fortune smiles upon thee!");
 
-               eventnum = 1 + rand() % 4;
-               switch(eventnum)
-               {
-                   case 1:
-                       notice(s_GameServ, u,
-                       "You have found an HP Potion!");
-                       p->inventory.incHP();
-                       break;
-                   case 2:
-                       notice(s_GameServ, u,
-                       "You have found a Strength Potion!");
-                       p->inventory.incStrength();
-                       break;
-                   case 3:
-                       notice(s_GameServ, u,
-                       "You have found a Defense Potion!");
-                       p->inventory.incDefense();
-                       break;
-                   case 4:
-                       notice(s_GameServ, u,
-                       "You have found a Healing Potion!");
-                       p->inventory.incHealing();
-                       break;
-               }
+               eventnum = rand() % tavern.size();
+               temp_tavernitem = tavern.begin();
+               for (int x = 0;x < eventnum;x++)
+                 {
+                   temp_tavernitem++;
+                 }
+               notice(s_GameServ, u, "You have found a %s", (*temp_tavernitem).getItem()->getName().c_str());
+               p->inventory->addItem((*temp_tavernitem).getItem());
            }
-           */
            else if (eventnum < 10 && eventnum >= 5) // 5% for the fountain
            {
                if (p->hp < p->maxhp)
index 5b80ed9f752604735121c878076ca5fbb31bec99..7d07bc9c6e3ac93d90cf6dee1e917b8c59230433 100644 (file)
@@ -15,6 +15,7 @@
 #include "list.h"
 #include "config.h"
 #include "options.h"
+#include "item.h"
 
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
@@ -127,17 +128,14 @@ E void saveNews(char *filename, List<string> &news);
 E void showNews(char *nick, List<string> &news);
 
 /** gameserv.cpp **/
-E char *weapons[WNA];
-E char *armors[WNA];
-E int prices[WNA - 1];
+
 E int hpbonus[LEVELS - 1];
 E int strbonus[LEVELS - 1];
 E int defbonus[LEVELS - 1];
-E int webonus[WNA];
-E int arbonus[WNA];
 E void gameserv(char *source, char *buf);
 E Level levels[LEVELS];
 E list<item*> Items;
+E list<tavernItem> tavern;
 
 /** forest.cpp **/
 E void forest(char *source, char *buf);