diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-08-05 08:59:38 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-08-05 08:59:38 +0000 |
| commit | 421300ffb893ff406f9334482d9867d38ec67c00 (patch) | |
| tree | dfc07c9971d0f1322979455fbcca33066ea5b7ad /src/game | |
| parent | c1509e5cd4ca1efcc1b737d8759059c1724f4ecf (diff) | |
| download | zcatch-421300ffb893ff406f9334482d9867d38ec67c00.tar.gz zcatch-421300ffb893ff406f9334482d9867d38ec67c00.zip | |
many small changes everywhere
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/client/game_client.cpp | 17 | ||||
| -rw-r--r-- | src/game/server/game_server.cpp | 13 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index 64ab18f0..8b813968 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -1665,8 +1665,16 @@ void render_game() draw_round_rect(x-10.f, y-10.f, w, h, 40.0f); gfx_quads_end(); - float tw = gfx_pretty_text_width( 64, "Score Board"); - gfx_pretty_text(x+w/2-tw/2, y, 64, "Score Board"); + if(gameobj->game_over) + { + float tw = gfx_pretty_text_width( 64, "Game Over"); + gfx_pretty_text(x+w/2-tw/2, y, 64, "Game Over"); + } + else + { + float tw = gfx_pretty_text_width( 64, "Score Board"); + gfx_pretty_text(x+w/2-tw/2, y, 64, "Score Board"); + } y += 64.0f; // find players @@ -1890,6 +1898,11 @@ void modc_message(int msg) const char *message = msg_unpack_string(); dbg_msg("message", "chat cid=%d msg='%s'", cid, message); chat_add_line(cid, message); + + if(cid >= 0) + snd_play(data->sounds[SOUND_CHAT_CLIENT].sounds[0].id, SND_PLAY_ONCE, 1.0f, 0.0f); + else + snd_play(data->sounds[SOUND_CHAT_SERVER].sounds[0].id, SND_PLAY_ONCE, 1.0f, 0.0f); } else if(msg == MSG_SETNAME) { diff --git a/src/game/server/game_server.cpp b/src/game/server/game_server.cpp index d77c637d..819215cb 100644 --- a/src/game/server/game_server.cpp +++ b/src/game/server/game_server.cpp @@ -11,7 +11,7 @@ data_container *data = 0x0; using namespace baselib; // --------- DEBUG STUFF --------- -const int debug_bots = 0; +const int debug_bots = 7; // --------- PHYSICS TWEAK! -------- const float ground_control_speed = 7.0f; @@ -618,8 +618,6 @@ void projectile::tick() else if (targetplayer) { targetplayer->take_damage(normalize(vel) * max(0.001f, force), damage, owner, weapon); - - create_targetted_sound(pos, SOUND_HIT, owner); } world.destroy_entity(this); @@ -916,7 +914,7 @@ int player::handle_ninja() create_sound(ents[i]->pos, SOUND_NINJA_HIT); // set his velocity to fast upward (for now) hitobjects[numobjectshit++] = ents[i]; - ents[i]->take_damage(vec2(0,10.0f), data->weapons[WEAPON_NINJA].meleedamage, client_id,-1); + ents[i]->take_damage(vec2(0,10.0f), data->weapons[WEAPON_NINJA].meleedamage, client_id,WEAPON_NINJA); } } return MODIFIER_RETURNFLAGS_OVERRIDEVELOCITY | MODIFIER_RETURNFLAGS_OVERRIDEPOSITION | MODIFIER_RETURNFLAGS_OVERRIDEGRAVITY; @@ -976,7 +974,7 @@ int player::handle_weapons() break; case WEAPON_ROCKET: { - projectile *p = new projectile(projectile::WEAPON_PROJECTILETYPE_ROCKET, + new projectile(projectile::WEAPON_PROJECTILETYPE_ROCKET, client_id, pos+vec2(0,0), direction*15.0f, @@ -1386,6 +1384,10 @@ bool player::take_damage(vec2 force, int dmg, int from, int weapon) damage_taken_tick = server_tick()+50; + // do damage hit sound + if(from >= 0) + create_targetted_sound(pos, SOUND_HIT, from); + // check for death if(health <= 0) { @@ -1410,6 +1412,7 @@ bool player::take_damage(vec2 force, int dmg, int from, int weapon) else create_sound(pos, SOUND_PLAYER_PAIN_SHORT); + // spawn blood? return true; } |