|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: player.c,v 1.75 2004/02/01 01:15:04 stpohle Exp $
|
|
|
|
/* $Id: player.c,v 1.76 2004/02/01 17:29:35 stpohle Exp $
|
|
|
|
* player.c - everything what have to do with the player */
|
|
|
|
* player.c - everything what have to do with the player */
|
|
|
|
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
#include <SDL.h>
|
|
|
@ -59,7 +59,7 @@ draw_player (_player * player)
|
|
|
|
else if (PS_IS_respawn (player->state)) {
|
|
|
|
else if (PS_IS_respawn (player->state)) {
|
|
|
|
/* player is respawning
|
|
|
|
/* player is respawning
|
|
|
|
* first: draw the star */
|
|
|
|
* first: draw the star */
|
|
|
|
|
|
|
|
|
|
|
|
dest.w = src.w = gfx.respawn.image->w;
|
|
|
|
dest.w = src.w = gfx.respawn.image->w;
|
|
|
|
dest.h = src.h = player->gfx->ani.h;
|
|
|
|
dest.h = src.h = player->gfx->ani.h;
|
|
|
|
|
|
|
|
|
|
|
@ -67,11 +67,14 @@ draw_player (_player * player)
|
|
|
|
dest.y = gfx.offset.y + ((player->pos.y - 1.0f) * gfx.block.y);
|
|
|
|
dest.y = gfx.offset.y + ((player->pos.y - 1.0f) * gfx.block.y);
|
|
|
|
|
|
|
|
|
|
|
|
src.x = 0;
|
|
|
|
src.x = 0;
|
|
|
|
src.y = (2 * gfx.block.y) * (int)player->frame;
|
|
|
|
if ((int)player->frame < gfx.respawn.frames)
|
|
|
|
|
|
|
|
src.y = (2 * gfx.block.y) * (int)player->frame;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
src.y = (2 * gfx.block.y) * (int)(gfx.respawn.frames - (((int)player->frame) - gfx.respawn.frames - 1));
|
|
|
|
|
|
|
|
|
|
|
|
gfx_blit (gfx.respawn.image, &src, gfx.screen, &dest, 0xFFFF);
|
|
|
|
gfx_blit (gfx.respawn.image, &src, gfx.screen, &dest, 0xFFFF);
|
|
|
|
|
|
|
|
|
|
|
|
if (player->frame > (player->gfx->ani.frames/2)) {
|
|
|
|
if (player->frame > gfx.respawn.frames) {
|
|
|
|
/* second: draw the player behind the star */
|
|
|
|
/* second: draw the player behind the star */
|
|
|
|
dest.x =
|
|
|
|
dest.x =
|
|
|
|
gfx.offset.x + player->gfx->offset.x + player->pos.x * gfx.block.x;
|
|
|
|
gfx.offset.x + player->gfx->offset.x + player->pos.x * gfx.block.x;
|
|
|
@ -588,7 +591,7 @@ player_animation (_player * player)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (PS_IS_respawn (player->state)) {
|
|
|
|
if (PS_IS_respawn (player->state)) {
|
|
|
|
if ((int)player->frame < gfx.respawn.frames)
|
|
|
|
if ((int)player->frame < 2*gfx.respawn.frames)
|
|
|
|
player->frame += (timefactor * ANI_PLAYERTIMEOUT);
|
|
|
|
player->frame += (timefactor * ANI_PLAYERTIMEOUT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -889,7 +892,7 @@ void player_checkdeath (int pnr) {
|
|
|
|
|
|
|
|
|
|
|
|
/* check for respawn finish */
|
|
|
|
/* check for respawn finish */
|
|
|
|
if (map.state == MS_normal && bman.gametype == GT_deathmatch
|
|
|
|
if (map.state == MS_normal && bman.gametype == GT_deathmatch
|
|
|
|
&& PS_IS_respawn (player->state) && player->frame >= gfx.respawn.frames) {
|
|
|
|
&& PS_IS_respawn (player->state) && player->frame >= 2*gfx.respawn.frames) {
|
|
|
|
d_printf ("Respawn completed for player %s\n", player->name);
|
|
|
|
d_printf ("Respawn completed for player %s\n", player->name);
|
|
|
|
player->frame = 0;
|
|
|
|
player->frame = 0;
|
|
|
|
player->state &= (0xFF - PSF_respawn);
|
|
|
|
player->state &= (0xFF - PSF_respawn);
|
|
|
|