summaryrefslogtreecommitdiff
path: root/src/game/units.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-03-26 13:33:49 +0200
committerPaweł Redman <pawel.redman@gmail.com>2018-03-26 13:33:49 +0200
commit2ae4b0ff77a2b2be2c485ac3ba6c1ef3facb874c (patch)
treee810997d58165e41eb4225a522d9d8886849331c /src/game/units.cpp
parent680ce5519c24dd0fa87ae85dd824000e915974b0 (diff)
Basic audio system + firing sound.
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r--src/game/units.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp
index d072f20..edb41ec 100644
--- a/src/game/units.cpp
+++ b/src/game/units.cpp
@@ -221,6 +221,9 @@ void unit_t::try_attack(unit_t *target)
size_t hit_roll;
size_t dmg_roll;
+ if (sounds.attack)
+ sounds.attack->play();
+
ss << name << " " << text::get(text::UNIT_ATTACK) << " " << target->name << ": ";
hit_roll = game->roll(die_t(20));
@@ -300,6 +303,8 @@ unit_soldier_t::unit_soldier_t(game::state_t *game) : unit_t(game, UNIT_SOLDIER)
health = max_health = 20;
cs.armor_class = 10;
cs.hit_die = die_t(8);
+
+ sounds.attack = &assets::soldier.fire;
}
void unit_soldier_t::check_area(void)