diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-19 13:54:02 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-19 13:54:02 +0100 |
commit | c1f1b86e51308bf73c528eafc89a7e6e65dbd95b (patch) | |
tree | b9443c5dbeebf32177bb3990ae75dd07cd625c6b /src | |
parent | 5bd1548eff90f6734963cdcd47d9ea2642dfec0f (diff) |
Improve fear mechanics.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/units.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp index 9a098a8..92e865b 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -328,12 +328,12 @@ void unit_soldier_t::check_area(void) continue; if (unit->friendly) - willpower_bonus += 3; + willpower_bonus += 6; else { if (unit->type == UNIT_NEST) - fear_dc += 4; + fear_dc += 6; else - fear_dc += 2; + fear_dc += 3; } } } @@ -374,6 +374,13 @@ void unit_soldier_t::on_think(void) { check_area(); + if (panic && game->now > panic_end) { + move.moving = false; + move.path.clear(); + panic = false; + controllable = true; + } + if (!panic && fear_dc > 1 && game->now > next_fear_test) { size_t roll; bool success; @@ -404,21 +411,13 @@ void unit_soldier_t::on_think(void) next_fear_test = game->now + 3; } - if (panic && game->now > panic_end) { - move.moving = false; - move.path.clear(); - panic = false; - controllable = true; - } - if (!panic) { target_and_attack(); if (!keep_moving(4.0)) say(text::get(text::SAY_BLOCKED)); } else { - if (!keep_moving(4.0)) - panic_turn = -INFINITY; + keep_moving(6.0); if (game->now >= panic_turn) { v2f_t t; @@ -427,7 +426,7 @@ void unit_soldier_t::on_think(void) move.path.clear(); move.path.push_back(x + t * 10); - panic_turn = game->now + 0.5; + panic_turn = game->now + 0.3; } } } |