From ba0af7ef3fcf7a1f85e579d66e823ff25d420c26 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Apr 2018 17:37:40 +0200 Subject: Rebalance + new firing sound. --- src/game/unit_soldier.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/game/unit_soldier.cpp') diff --git a/src/game/unit_soldier.cpp b/src/game/unit_soldier.cpp index 886e09d..db206d1 100644 --- a/src/game/unit_soldier.cpp +++ b/src/game/unit_soldier.cpp @@ -56,7 +56,7 @@ unit_soldier_t::unit_soldier_t(game::state_t *game) : unit_t(game, UNIT_SOLDIER) friendly = true; controllable = true; - health = max_health = 20; + health = max_health = 28; } static v2f_t spread_aim(v2f_t x, v2f_t aim, float cof, procgen::prng_t *prng) @@ -103,6 +103,9 @@ void unit_soldier_t::fire_shotgun(v2f_t aim) world::trace_t trace; fx_flash_t *flash; + if (next_attack && game->time < next_attack) + return; + muzzle_point = x + v2f_t(0, -0.7f); trace = world->ray_v_all_p3d(x, aim, CF_SOLID|CF_BODY|CF_BODY_SMALL, -1, this); @@ -115,21 +118,21 @@ void unit_soldier_t::fire_shotgun(v2f_t aim) return; } - for (size_t i = 0; i < 5; i++) { + for (size_t i = 0; i < 7; i++) { v2f_t end; - end = spread_aim(muzzle_point, aim, 0.1f, &game->prng); - shoot(muzzle_point, end, 1); + end = spread_aim(muzzle_point, aim, 0.15f, &game->prng); + shoot(muzzle_point, end, 2); } flash = new fx_flash_t(game, muzzle_point, 5.0f, sf::Color(255, 170, 50, 80)); flash->place(&game->world); - last_attack = game->now; assets::soldier.fire.play_3d(x); - game->hivemind_alert(x, 14.0f, true, x); -} + next_attack = game->time + MSEC(1000); + last_attack = game->time; +} void unit_soldier_t::target_and_attack(void) { @@ -160,9 +163,6 @@ void unit_soldier_t::target_and_attack(void) skip_targetting: aim_marker = std::make_unique(game, aim); - if (last_attack + game->prng.next_float(1.4f, 1.6f) > game->now) - return; - fire_shotgun(aim); } @@ -249,7 +249,7 @@ void unit_soldier_t::render_to(render::state_t *render) legs = &assets::soldier.legs_idle; if (manual_firing || last_target_time + 3 > game->now) { - if (last_attack + 0.1 > game->now) + if (last_attack && last_attack + MSEC(100) > game->time) body = &assets::soldier.body_firing; else body = &assets::soldier.body_aiming; -- cgit