diff options
| -rw-r--r-- | src/game/gamecore.cpp | 4 | ||||
| -rw-r--r-- | src/game/server/entities/character.cpp | 67 | ||||
| -rw-r--r-- | src/game/server/gamecontext.cpp | 4 | ||||
| -rw-r--r-- | src/game/tuning.hpp | 4 |
4 files changed, 14 insertions, 65 deletions
diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index 7818fa4b..66f0ee0a 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -397,9 +397,9 @@ void CHARACTER_CORE::tick(bool use_input) } - // release hook + // release hook (max hook time is 1.25 hook_tick++; - if(hooked_player != -1 && (hook_tick > SERVER_TICK_SPEED*2 || !world->characters[hooked_player])) + if(hooked_player != -1 && (hook_tick > SERVER_TICK_SPEED+SERVER_TICK_SPEED/5 || !world->characters[hooked_player])) { hooked_player = -1; hook_state = HOOK_RETRACTED; diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index b3005a67..dba07ee7 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -290,6 +290,7 @@ void CHARACTER::fire_weapon() game.create_sound(pos, SOUND_HAMMER_FIRE); CHARACTER *ents[64]; + int hits = 0; int num = game.world.find_entities(pos+direction*phys_size*0.75f, phys_size*0.5f, (ENTITY**)ents, 64, NETOBJTYPE_CHARACTER); for (int i = 0; i < num; i++) @@ -311,8 +312,13 @@ void CHARACTER::fire_weapon() dir = vec2(0,-1); target->core.vel += normalize(dir + vec2(0,-1.1f)) * 10.0f; + hits++; } + // if we hit anything, we have to wait for the reload + if(hits) + reload_timer = server_tickspeed()/3; + } break; case WEAPON_GUN: @@ -422,7 +428,8 @@ void CHARACTER::fire_weapon() if(weapons[active_weapon].ammo > 0) // -1 == unlimited weapons[active_weapon].ammo--; attack_tick = server_tick(); - reload_timer = data->weapons.id[active_weapon].firedelay * server_tickspeed() / 1000; + if(!reload_timer) + reload_timer = data->weapons.id[active_weapon].firedelay * server_tickspeed() / 1000; } int CHARACTER::handle_weapons() @@ -520,64 +527,6 @@ void CHARACTER::on_direct_input(NETOBJ_PLAYER_INPUT *new_input) void CHARACTER::tick() { - //input = latest_input; - - // grab latest input - /* - { - int size = 0; - int *input = server_latestinput(client_id, &size); - if(input) - { - mem_copy(&latest_previnput, &latest_input, sizeof(latest_input)); - mem_copy(&latest_input, input, sizeof(latest_input)); - } - }*/ - - // check if we have enough input - // this is to prevent initial weird clicks - /* - if(num_inputs < 2) - { - latest_previnput = latest_input; - previnput = input; - }*/ - - //game.world.core.players[player->client_id] = &core; - - // enable / disable physics - /* - if(team == -1 || dead) - { - game.world.core.players[client_id] = 0; - //game.world.remove_entity(this); - } - else - { - game.world.core.players[client_id] = &core; - //game.world._entity(this); - } - - // spectator - if(team == -1) - return; - - if(spawning) - try_respawn(); - - // TODO: rework the input to be more robust - if(dead) - { - if(server_tick()-die_tick >= server_tickspeed()/2 && count_input(latest_previnput.fire, latest_input.fire).presses) - die_tick = -1; - if(server_tick()-die_tick >= server_tickspeed()*5) // auto respawn after 3 sec - respawn(); - //if((input.fire&1) && server_tick()-die_tick >= server_tickspeed()/2) // auto respawn after 0.5 sec - //respawn(); - return; - } - * */ - if(player->force_balanced) { char buf[128]; diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 8c4b634a..89eae10d 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -79,8 +79,8 @@ void GAMECONTEXT::create_explosion(vec2 p, int owner, int weapon, bool bnodamage { // deal damage CHARACTER *ents[64]; - float radius = 128.0f; - float innerradius = 42.0f; + float radius = 135.0f; + float innerradius = 48.0f; int num = game.world.find_entities(p, radius, (ENTITY**)ents, 64, NETOBJTYPE_CHARACTER); for(int i = 0; i < num; i++) { diff --git a/src/game/tuning.hpp b/src/game/tuning.hpp index b68c6a36..210dbe96 100644 --- a/src/game/tuning.hpp +++ b/src/game/tuning.hpp @@ -23,9 +23,9 @@ MACRO_TUNING_PARAM(gun_speed, 2200.0f) MACRO_TUNING_PARAM(gun_lifetime, 2.0f) MACRO_TUNING_PARAM(shotgun_curvature, 1.25f) -MACRO_TUNING_PARAM(shotgun_speed, 2200.0f) +MACRO_TUNING_PARAM(shotgun_speed, 2750.0f) MACRO_TUNING_PARAM(shotgun_speeddiff, 0.8f) -MACRO_TUNING_PARAM(shotgun_lifetime, 0.25f) +MACRO_TUNING_PARAM(shotgun_lifetime, 0.20f) MACRO_TUNING_PARAM(grenade_curvature, 7.0f) MACRO_TUNING_PARAM(grenade_speed, 1000.0f) |