From 858f01dedbb681c8e62c9dae4d7c3174991844bf Mon Sep 17 00:00:00 2001 From: oroborus Date: Fri, 7 Mar 2008 21:12:57 +0000 Subject: -podpora teleportov -podpora rur git-svn-id: http://opensvn.csie.org/tuxanci_ng@9 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/tux.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/tux.c') diff --git a/src/tux.c b/src/tux.c index 31964b6..8180094 100644 --- a/src/tux.c +++ b/src/tux.c @@ -13,6 +13,8 @@ #include "shot.h" #include "gun.h" #include "wall.h" +#include "teleport.h" +#include "pipe.h" #include "item.h" #include "arena.h" #include "myTimer.h" @@ -385,7 +387,7 @@ void tuxTeleport(tux_t *tux) } } -void eventConflictShotWithTux(list_t *listTux, list_t *listShot) +void eventConflictTuxWithShot(list_t *listTux, list_t *listShot) { shot_t *thisShot; tux_t *thisTux; @@ -428,6 +430,29 @@ void eventConflictShotWithTux(list_t *listTux, list_t *listShot) } } +void eventConflictTuxWithTeleport(list_t *listTux, list_t *listTeleport) +{ + teleport_t *thisTeleport; + tux_t *thisTux; + + int i; + + assert( listTux != NULL ); + assert( listTeleport != NULL ); + + for( i = 0 ; i < listTeleport->count ; i++ ) + { + thisTeleport = (teleport_t *)listTeleport->list[i]; + assert( thisTeleport != NULL ); + + if( ( thisTux = isConflictWithListTux(listTux, thisTeleport->x, thisTeleport->y, + thisTeleport->w, thisTeleport->h) ) != NULL ) + { + eventTeleportTux(listTeleport, thisTeleport, thisTux); + } + } +} + void moveTux(tux_t *tux, int n) { int px, py; @@ -480,9 +505,11 @@ void moveTux(tux_t *tux, int n) getTuxProportion(tux, &x, &y, &w, &h); + if( tux->bonus != BONUS_GHOST && ( isConflictTuxWithListTux(tux, arena->listTux) || - isConflictWithListWall(arena->listWall, x, y, w, h) ) ) + isConflictWithListWall(arena->listWall, x, y, w, h) || + isConflictWithListPipe(arena->listPipe, x, y, w, h) ) ) { tux->x = zal_x; tux->y = zal_y; -- cgit v1.2.3