summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-08 16:35:02 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-08 16:35:02 +0000
commit7386e93e32575bae21006d0300cbff4cf7a40926 (patch)
tree5cec5aeddc3263880caf0a09f679ccd68586d4db /src/base
parent776577985a056407645a448f8332d6ce69d645a3 (diff)
- oprava chyby v configFile.h
- chat sa zapina/vypina ENTERom - prepisany readKey() - widget_textfiled obsahuje filter na znaky :) - lasser je netrhany ale prestreluje pen v arene "na dobru noc", ked sa uplne priblizite git-svn-id: http://opensvn.csie.org/tuxanci_ng@124 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/base')
-rw-r--r--src/base/arena.c4
-rw-r--r--src/base/gun.c27
-rw-r--r--src/base/gun.h2
-rw-r--r--src/base/item.c35
-rw-r--r--src/base/item.h1
-rw-r--r--src/base/main.h1
6 files changed, 20 insertions, 50 deletions
diff --git a/src/base/arena.c b/src/base/arena.c
index 7358e41..2fe18b7 100644
--- a/src/base/arena.c
+++ b/src/base/arena.c
@@ -204,10 +204,12 @@ void eventArena(arena_t *arena)
for( i = 0 ; i < 8 ; i++)
{
checkShotIsInTuxScreen(arena);
- eventMoveListShot(arena);
+
eventConflictShotWithItem(arena);
eventConflictTuxWithShot(arena);
eventModule();
+
+ eventMoveListShot(arena);
}
eventListItem(arena->spaceItem);
diff --git a/src/base/gun.c b/src/base/gun.c
index f905efd..aeb2478 100644
--- a/src/base/gun.c
+++ b/src/base/gun.c
@@ -85,31 +85,13 @@ static void addShotTrivial(tux_t *tux, int x, int y, int px, int py, int gun)
shot = newShot(tux->x + dest_x, tux->y + dest_y, dest_px, dest_py, gun, tux->id);
-/*
- if( isFreeSpace( getCurrentArena(), shot->x, shot->y, shot->w, shot->h ) == 0 )
+ if(1)// isFreeSpace(getCurrentArena(), shot->x, shot->y, shot->w, shot->h) )
{
- destroyShot(shot);
+ addObjectToSpace(getCurrentArena()->spaceShot, shot);
return;
}
-*/
- //addList( getCurrentArena()->listShot, shot );
- addObjectToSpace(getCurrentArena()->spaceShot, shot);
-/*
- if( getNetTypeGame() == NET_GAME_TYPE_SERVER )
- {
- client_t *thisClient;
-
- thisClient = getClientFromTux(tux);
-
- if( thisClient != NULL )
- {
- proto_send_shot_server(PROTO_SEND_ONE, thisClient, shot);
- }
-
- proto_send_shot_server(PROTO_SEND_ALL_SEES_TUX, thisClient, shot);
- }
-*/
+ destroyShot(shot);
}
static void addShot(tux_t *tux,int x, int y, int px, int py)
@@ -232,7 +214,10 @@ static void timer_addLaserTimer(void *p)
gun = tux->gun;
tux->gun = GUN_LASSER;
+
addShot(tux, 0, 0, +10, 0);
+ addShot(tux, +40, 0, +10, 0);
+ //addShot(tux, +40, 0, +10, 0);
tux->gun = gun;
}
diff --git a/src/base/gun.h b/src/base/gun.h
index 4986660..835c2c8 100644
--- a/src/base/gun.h
+++ b/src/base/gun.h
@@ -8,7 +8,7 @@
#define GUN_SHOT_WIDTH 5
#define GUN_SHOT_HEIGHT 5
-#define GUN_LASSER_HORIZONTAL 50
+#define GUN_LASSER_HORIZONTAL 40
#define GUN_SHOT_VERTICAL 5
#define GUN_BOMBBALL_WIDTH 20
diff --git a/src/base/item.c b/src/base/item.c
index 7f12ce7..842da13 100644
--- a/src/base/item.c
+++ b/src/base/item.c
@@ -133,29 +133,6 @@ item_t* newItem(int x, int y, int type, int author_id)
return new;
}
-/*
-item_t* getItemID(list_t *listItem, int id)
-{
- item_t *thisItem;
- int i;
-
- assert( listItem != NULL );
-
- for( i = 0 ; i < listItem->count ; i++ )
- {
- thisItem = (item_t *)listItem->list[i];
- assert( thisItem != NULL );
-
- if( thisItem->id == id )
- {
- return thisItem;
- }
- }
-
- return NULL;
-}
-*/
-
void getStatusItem(void *p, int *id, int *x, int *y ,int *w, int *h)
{
item_t *item;
@@ -353,7 +330,7 @@ void eventListItem(space_t *spaceItem)
}
}
-void mineExplosion(space_t *spaceItem, item_t *item)
+static void mineExplosion(space_t *spaceItem, item_t *item)
{
if( getNetTypeGame() != NET_GAME_TYPE_CLIENT )
{
@@ -378,7 +355,10 @@ void mineExplosion(space_t *spaceItem, item_t *item)
proto_send_del_server(PROTO_SEND_ALL, NULL, item->id);
}
- delObjectFromSpaceWithObject(spaceItem, item, destroyItem);
+ if( getNetTypeGame() != NET_GAME_TYPE_CLIENT )
+ {
+ delObjectFromSpaceWithObject(spaceItem, item, destroyItem);
+ }
}
void eventConflictShotWithItem(arena_t *arena)
@@ -547,7 +527,10 @@ void eventGiveTuxItem(tux_t *tux, item_t *item, space_t *spaceItem)
case ITEM_EXPLOSION :
case ITEM_BIG_EXPLOSION :
- eventTuxIsDeadWithItem(tux, item);
+ if( tux->bonus != BONUS_GHOST )
+ {
+ eventTuxIsDeadWithItem(tux, item);
+ }
break;
case BONUS_SPEED :
diff --git a/src/base/item.h b/src/base/item.h
index c23e7d7..110c044 100644
--- a/src/base/item.h
+++ b/src/base/item.h
@@ -68,7 +68,6 @@ extern void addNewItem(space_t *spaceItem, int author_id);
extern void drawListItem(list_t *listItem);
#endif
extern void eventListItem(space_t *listSpace);
-extern void mineExplosion(space_t *spaceItem, item_t *item);
extern void eventConflictShotWithItem(arena_t *arena);
extern void eventGiveTuxItem(tux_t *tux, item_t *item, space_t *spaceItem);
extern void eventGiveTuxListItem(tux_t *tux, space_t *spaceItem);
diff --git a/src/base/main.h b/src/base/main.h
index b8f988b..d0b11e6 100644
--- a/src/base/main.h
+++ b/src/base/main.h
@@ -23,5 +23,6 @@ extern bool_t isParamFlag(char *s);
extern char *getString(int n);
extern int* newInt(int x);
extern void accessExistFile(const char *s);
+extern int tryExistFile (const char *s);
#endif