summaryrefslogtreecommitdiff
path: root/src/item.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-03-09 21:36:26 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-03-09 21:36:26 +0000
commit1438b79069821cba744a4ea4739324560be64fb6 (patch)
tree1229b2aca2937be2e838fb2d787ab31d83cd59c7 /src/item.c
parentda85e88878251f6a980fef95bd47109169a3cf7c (diff)
- pridany doomovsky adresar
- moznost ulozit nastavenie - tabulka najlepsich - zabytie protigraca minou sa rata do bodov supera git-svn-id: http://opensvn.csie.org/tuxanci_ng@13 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/item.c')
-rw-r--r--src/item.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/item.c b/src/item.c
index 23c3f52..abfe2c5 100644
--- a/src/item.c
+++ b/src/item.c
@@ -44,7 +44,7 @@ void initItem()
isItemInit = TRUE;
}
-item_t* newItem(int x, int y, int type)
+item_t* newItem(int x, int y, int type, tux_t *author)
{
item_t *new;
@@ -58,6 +58,7 @@ item_t* newItem(int x, int y, int type)
new->frame = 0;
new->count = 0;
new->img = g_item[type];
+ new->author = author;
switch( type )
{
@@ -101,7 +102,7 @@ item_t* newItem(int x, int y, int type)
return new;
}
-void addNewItem(list_t *listItem)
+void addNewItem(list_t *listItem, tux_t *author)
{
arena_t *arena;
item_t *item;
@@ -147,7 +148,7 @@ void addNewItem(list_t *listItem)
}
}while( isSettingItem(type) == FALSE );
- item = newItem(new_x, new_y, type);
+ item = newItem(new_x, new_y, type, author);
addList(listItem, item);
if( getNetTypeGame() == NET_GAME_TYPE_SERVER )
@@ -298,7 +299,7 @@ void eventConflictShotWithItem(list_t *listItem, list_t *listShot)
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) );
+ addList(listItem, newItem(x, y, ITEM_BIG_EXPLOSION, NULL) );
j--;
}
break;
@@ -359,8 +360,13 @@ void eventGiveTuxItem(tux_t *tux, list_t *listItem)
case ITEM_MINE :
if( tux->bonus != BONUS_GHOST )
{
+ if( thisItem->author != NULL )
+ {
+ thisItem->author->score++;
+ }
+
delListItem(listItem, i, destroyItem);
- addList(listItem, newItem(x, y, ITEM_EXPLOSION) );
+ addList(listItem, newItem(x, y, ITEM_EXPLOSION, NULL) );
i--;
}
break;