summaryrefslogtreecommitdiff
path: root/src/item.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-03-21 14:03:35 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-03-21 14:03:35 +0000
commit114131bf71d7d4ec48c92a7bde8183442995940f (patch)
tree84a3e5ba788d3a6bf76f5067b861fbce8b2f239b /src/item.c
parent1e1d106a545a9cadc517de1a0ad931f1a8fcc2fa (diff)
- vypisovanie sprav do hry
- oprava chyby odhlaelenj pomocou valgrindu - zena rychlosti zbrani - drobne upravy git-svn-id: http://opensvn.csie.org/tuxanci_ng@31 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/item.c')
-rw-r--r--src/item.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/item.c b/src/item.c
index bcde2b1..ae9ab71 100644
--- a/src/item.c
+++ b/src/item.c
@@ -17,6 +17,7 @@
#include "layer.h"
#include "screen_world.h"
#include "screen_setting.h"
+#include "term.h"
#endif
#ifdef BUBLIC_SERVER
@@ -122,6 +123,9 @@ item_t* newItem(int x, int y, int type, tux_t *author)
void addNewItem(list_t *listItem, tux_t *author)
{
+#ifndef BUBLIC_SERVER
+ char msg[STR_SIZE];
+#endif
arena_t *arena;
item_t *item;
int new_x, new_y;
@@ -178,6 +182,12 @@ void addNewItem(list_t *listItem, tux_t *author)
{
proto_send_additem_server(PROTO_SEND_ALL, NULL, item);
}
+
+#ifndef BUBLIC_SERVER
+ sprintf(msg, "in arena is new item\n");
+ appendTextInTerm(msg);
+#endif
+
}
#ifndef BUBLIC_SERVER
@@ -321,12 +331,11 @@ void eventConflictShotWithItem(list_t *listItem, list_t *listShot)
{
int x, y;
- delListItem(listItem, j, destroyItem);
-
x = ( thisItem->x + thisItem->w/2 ) - ITEM_BIG_EXPLOSION_WIDTH/2;
y = ( thisItem->y + thisItem->h/2 ) - ITEM_BIG_EXPLOSION_HEIGHT/2;
-
- addList(listItem, newItem(x, y, ITEM_BIG_EXPLOSION, NULL) );
+ addList(listItem, newItem(x, y, ITEM_BIG_EXPLOSION, NULL) );
+
+ delListItem(listItem, j, destroyItem);
j--;
}
break;
@@ -348,6 +357,9 @@ void eventConflictShotWithItem(list_t *listItem, list_t *listShot)
void eventGiveTuxItem(tux_t *tux, list_t *listItem)
{
+#ifndef BUBLIC_SERVER
+ char msg[STR_SIZE];
+#endif
item_t *thisItem;
int x, y, w, h;
int i;
@@ -384,6 +396,11 @@ void eventGiveTuxItem(tux_t *tux, list_t *listItem)
tux->gun = thisItem->type;
delListItem(listItem, i, destroyItem);
i--;
+
+#ifndef BUBLIC_SERVER
+ sprintf(msg, "tux with id %d has new gun\n", tux->id);
+ appendTextInTerm(msg);
+#endif
break;
case ITEM_MINE :
@@ -425,6 +442,11 @@ void eventGiveTuxItem(tux_t *tux, list_t *listItem)
tux->bonus_time = TUX_MAX_BONUS;
delListItem(listItem, i, destroyItem);
i--;
+
+#ifndef BUBLIC_SERVER
+ sprintf(msg, "tux with id %d bonus enabled\n", tux->id);
+ appendTextInTerm(msg);
+#endif
break;
}