diff options
| author | Olle Rosenquist <phobos99@gmail.com> | 2007-07-22 13:46:40 +0000 |
|---|---|---|
| committer | Olle Rosenquist <phobos99@gmail.com> | 2007-07-22 13:46:40 +0000 |
| commit | ee8998207524a714d9fdae87cfe649f94b556c13 (patch) | |
| tree | 8e6e5878c38f1f27002aae1cc12c9d8a11b889cd /src/game | |
| parent | 8780116a02d31d49e239bc2c04b791454dc53864 (diff) | |
| download | zcatch-ee8998207524a714d9fdae87cfe649f94b556c13.tar.gz zcatch-ee8998207524a714d9fdae87cfe649f94b556c13.zip | |
Ninja fixes
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/client/game_client.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index 7f751f51..0d265b1c 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -908,6 +908,29 @@ static void render_player(obj_player *prev, obj_player *player) gfx_quads_setrotation(-pi/2+state.attach.angle*pi*2); } draw_sprite(p.x, p.y, data->weapons[iw].visual_size); + + // HADOKEN + if ((client_tick()-player->attacktick) <= (SERVER_TICK_SPEED / 6) && data->weapons[iw].nummuzzlesprites) + { + int itex = rand() % data->weapons[iw].nummuzzlesprites; + float alpha = 1.0f; + if (alpha > 0.0f && data->weapons[iw].sprite_muzzle[itex].psprite) + { + vec2 dir = vec2(player->x,player->y) - vec2(prev->x, prev->y); + dir = normalize(dir); + float hadokenangle = atan(dir.y/dir.x); + if (dir.x < 0.0f) + hadokenangle += pi; + gfx_quads_setrotation(hadokenangle); + float offsety = -data->weapons[iw].muzzleoffsety; + select_sprite(data->weapons[iw].sprite_muzzle[itex].psprite, 0); + vec2 diry(-dir.y,dir.x); + p = position; + float offsetx = data->weapons[iw].muzzleoffsetx; + p -= dir * offsetx; + draw_sprite(p.x, p.y, 160.0f); + } + } } else { @@ -1588,7 +1611,7 @@ void modc_render() sprintf(buf, "%4d", player->latency); float tw = gfx_pretty_text_width(48.0f, buf); - gfx_pretty_text(offsetx + x + 240, y, 48, buf); + gfx_pretty_text(offsetx + x + 240, offsets[player->team], 48, buf); offsets[player->team] += 58.0f; } |