From 4dd7ac29fe0132b9f5896a84ccfe8d05363dfa74 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Fri, 15 Dec 2017 18:07:16 +0100 Subject: Add the blood effect (not yet finished). --- src/game/units.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/game/units.cpp') diff --git a/src/game/units.cpp b/src/game/units.cpp index c50a3fb..65f0a2c 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -182,6 +182,11 @@ bool unit_t::start_moving(v2f_t dst, world::cflags_t cflags) void unit_t::damage(int points, unit_t *attacker) { + fx_blood_t *blood; + + blood = new fx_blood_t(game, x, type == UNIT_ALIEN); + game->add_effect(blood); + health -= points; if (health < 0) { game->interface->print(name + " " + text::get(text::UNIT_DEATH) + "."); @@ -294,16 +299,16 @@ void human_t::think(void) if (last_attack + 1.5 < game->now) { world::trace_t trace; + fx_tracer_t *tracer; + + tracer = new fx_tracer_t(game, x, target->x); + game->add_effect(tracer); + std::cout << tracer->cmodel.bounds << std::endl; trace = world->trace(x, target->x, CF_SOLID); if (!trace.hit) { - fx_tracer_t *tracer; - last_attack = game->now; try_attack(target); - - tracer = new fx_tracer_t(game, x, target->x); - game->add_effect(tracer); } } -- cgit