From f43f52903f29d010a72183de24ae8f56ab6702bb Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Apr 2018 16:45:40 +0200 Subject: Add the scientist. --- src/game/unit_soldier.cpp | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) (limited to 'src/game/unit_soldier.cpp') diff --git a/src/game/unit_soldier.cpp b/src/game/unit_soldier.cpp index e41278e..886e09d 100644 --- a/src/game/unit_soldier.cpp +++ b/src/game/unit_soldier.cpp @@ -29,9 +29,9 @@ static std::string soldier_name(procgen::prng_t *prng) { std::stringstream ss; static const char *names[] = { - "Kowalski", "Jackson", "Carter", "O'Neill", "Hammond", - "Mitchell", "Hitler", "Stalin", "Wyspiański", "Bush", - "Washington" + "Kowalski", "O'Neill", "Hammond", "Mitchell", "Hitler", + "Stalin", "Wyspiański", "Bush", "Washington", "Jaruzelski", + "Jackson", "Carter", }; ss << initials[prng->next() % (sizeof(initials) / sizeof(initials[0]))]; @@ -59,33 +59,6 @@ unit_soldier_t::unit_soldier_t(game::state_t *game) : unit_t(game, UNIT_SOLDIER) health = max_health = 20; } -void unit_soldier_t::check_area(void) -{ - rectf_t bounds; - - bounds[0] = x - v2f_t(10, 10); - bounds[1] = x + v2f_t(10, 10); - - for (world::entity_t *went : game->world.get_entities(bounds, -1)) { - auto ent = dynamic_cast(went); - - // WTF? - if (!ent) - continue; - - if (ent == this) - continue; - - // Wake everything around. - if (!ent->ignore_waking) { - ent->wake_time = game->now; - - if (!ent->awake) - ent->wake(); - } - } -} - static v2f_t spread_aim(v2f_t x, v2f_t aim, float cof, procgen::prng_t *prng) { float r, r_, dth; @@ -196,6 +169,7 @@ skip_targetting: void unit_soldier_t::on_think(void) { keep_moving(2.0); + game->wake_area(x); if (!move.moving) move_marker.reset(); @@ -205,7 +179,6 @@ void unit_soldier_t::on_think(void) assets::soldier.step_stone.play_3d(x); } - check_area(); target_and_attack(); } -- cgit