feat: implementations of initial weapon inventory interface

This commit is contained in:
Sara 2025-07-15 23:01:28 +02:00
parent 6cdb2cbd4f
commit 6fa9d11af5
12 changed files with 126 additions and 11 deletions

View file

@ -39,6 +39,8 @@ void Rifle::ready() {
get_anim()->animation_set_next("fire_aim", "aim");
get_anim()->animation_set_next("aim_to_hip", "RESET");
get_anim()->animation_set_next("fire_hip", "RESET");
get_anim()->animation_set_next("equip", "RESET");
get_anim()->play("equip");
}
void Rifle::process(double delta) {
@ -74,3 +76,12 @@ void Rifle::_notification(int what) {
return;
}
}
bool Rifle::allows_running() const {
String const animation{ get_anim()->get_current_animation() };
return animation.is_empty();
}
void Rifle::notify_selected() {
get_anim()->play("equip");
}

View file

@ -17,6 +17,9 @@ class Rifle : public WeaponBase {
public:
void _notification(int what);
virtual bool allows_running() const override;
virtual void notify_selected() override;
private:
float ads_factor{ 0.5f };
bool request_alt_mode{ false };