diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-15 18:07:16 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-15 18:07:16 +0100 |
commit | 4dd7ac29fe0132b9f5896a84ccfe8d05363dfa74 (patch) | |
tree | 4abbd9e3aa4403020d7ece46dc4736f67730e2eb /src/game/units.cpp | |
parent | cd9b7052f07291e3975bad5dcfe9ad0338c17e74 (diff) |
Add the blood effect (not yet finished).
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r-- | src/game/units.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
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); } } |