Commit a6081b3a authored by Kevin Balz's avatar Kevin Balz

Merge branch 'feature/33-get-beats-for-killing' into 'develop'

Resolve "Get Beats for Killing"

Closes #33

See merge request !23
parents fbaeac21 2f69327c
Pipeline #3364 passed with stage
in 3 minutes and 10 seconds
......@@ -67,7 +67,7 @@ namespace phase_shifter::audio {
if(effect != _sound_effects.end()) {
auto ctx = _audio.generate_context(effect->second.get_random(_random_gen));
ctx.get_object()->set_loops(0);
ctx.get_object()->set_volume(_effect_volume * 100);
ctx.get_object()->set_volume(static_cast<int>(_effect_volume * 100));
ctx.play();
}
}
......
......@@ -80,6 +80,11 @@ namespace phase_shifter::gameplay {
}
}
void Beat_system::increase_beats_left(int count) {
_beat_offset += count;
_state.beats_left += count;
}
const std::vector<float>& Beat_system::time_stamps() const { return _time_stamps; }
int Beat_system::beat_index() const { return _beat_index; }
......
......@@ -27,6 +27,8 @@ namespace phase_shifter::gameplay {
void decrease_beats_left(int count);
void increase_beats_left(int count);
auto graphic_time_scale() const -> float;
const std::vector<float>& time_stamps() const ;
......
......@@ -16,6 +16,7 @@ namespace phase_shifter::gameplay {
namespace {
constexpr auto damage_beat_penalty = 10;
constexpr auto kill_beat_gain = 5;
}
Combat_system::Combat_system(mirrage::util::Message_bus& bus,
......@@ -39,6 +40,9 @@ namespace phase_shifter::gameplay {
_ecs.erase(entity);
});
});
_mailbox.subscribe_to([&](Enemy_killed_msg& e) {
_beat_system.increase_beats_left(kill_beat_gain);
});
}
void Combat_system::update(mirrage::util::Time)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment