From 1438b79069821cba744a4ea4739324560be64fb6 Mon Sep 17 00:00:00 2001 From: oroborus Date: Sun, 9 Mar 2008 21:36:26 +0000 Subject: - 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 --- src/item.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/item.c') 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; -- cgit v1.2.3