summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-02-11 17:21:55 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-02-11 17:21:55 +0000
commit448fe8430f5f0ae81101fe86d664f98be1a92201 (patch)
tree76737e4447cca1dd24c4e9203a2d2ea674d72a1e /src/game.cpp
parent528ded235f60c349272ecbf428731b2f579ed758 (diff)
downloadmana-448fe8430f5f0ae81101fe86d664f98be1a92201.tar.gz
mana-448fe8430f5f0ae81101fe86d664f98be1a92201.tar.bz2
mana-448fe8430f5f0ae81101fe86d664f98be1a92201.tar.xz
mana-448fe8430f5f0ae81101fe86d664f98be1a92201.zip
Working on equipment
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 1191ba28..e4ec2d45 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -220,6 +220,10 @@ void do_input()
setupWindow->setVisible(true);
used = true;
}
+ else if (keysym.sym == SDLK_e) {
+ equipmentWindow->setVisible(!equipmentWindow->isVisible());
+ used = true;
+ }
}
if (event.key.keysym.sym == SDLK_ESCAPE)
@@ -408,11 +412,11 @@ void do_parse() {
}
fclose(file);
*/
-#ifdef DEBUG
+//#ifdef DEBUG
FILE *file = fopen("./docs/packet.list", "a");
fprintf(file, "%x\n", RFIFOW(0));
fclose(file);
-#endif
+//#endif
// Parse packet based on their id
switch(id) {
// Received speech
@@ -589,7 +593,14 @@ void do_parse() {
case 0x01ee:
for (int loop = 0; loop < (RFIFOW(2) - 4) / 18; loop++) {
inventoryWindow->addItem(RFIFOW(4 + loop * 18),
- RFIFOW(4 + loop * 18 + 2), RFIFOW(4 + loop * 18 + 6));
+ RFIFOW(4 + loop * 18 + 2), RFIFOW(4 + loop * 18 + 6), false);
+ }
+ break;
+ // Get the equipments
+ case 0x00a4:
+ for (int loop = 0; loop < (RFIFOW(2) - 4) / 20; loop++) {
+ inventoryWindow->addItem(RFIFOW(4 + loop * 20),
+ RFIFOW(4 + loop * 20 + 2), 1, true);
}
break;
// Can I use the item?
@@ -874,7 +885,7 @@ void do_parse() {
if (RFIFOB(22) > 0)
chatBox->chat_log("Unable to pick up item", BY_SERVER);
else
- inventoryWindow->addItem(RFIFOW(2), RFIFOW(6), RFIFOW(4));
+ inventoryWindow->addItem(RFIFOW(2), RFIFOW(6), RFIFOW(4), false);
break;
// Decrease quantity of an item in inventory
case 0x00af:
@@ -956,11 +967,17 @@ void do_parse() {
being->hair_style = RFIFOB(7);
}
break;
- case 0x00a4:
- for (int i = 0; i < (RFIFOW(2) - 4) / 20; i++)
- inventoryWindow->addItem(RFIFOW(4 + 20 * i), RFIFOW(6 + 20 * i), 1);
+ // Answer to equip items
+ case 0x00aa:
+ if (RFIFOB(6) == 0)
+ chatBox->chat_log("Unable to equip.", BY_SERVER);
+ break;
+ // Equipment related
+ case 0x01d7:
+ char content[40];
+ sprintf(content, "%i %i", RFIFOW(7), RFIFOW(9));
+ chatBox->chat_log(content, BY_SERVER);
break;
-
// Manage non implemented packets
default:
//printf("%x\n",id);