feat: added more settings to rifle
This commit is contained in:
parent
58e90780d5
commit
f02dbf44ac
2 changed files with 27 additions and 7 deletions
|
|
@ -1,10 +1,16 @@
|
|||
#include "rifle.h"
|
||||
#include "scene/animation/animation_player.h"
|
||||
#include "wave_survival/hitscan_muzzle.h"
|
||||
#include "wave_survival/macros.h"
|
||||
#include "wave_survival/player_body.h"
|
||||
#include "wave_survival/player_input.h"
|
||||
|
||||
void Rifle::_bind_methods() {}
|
||||
void Rifle::_bind_methods() {
|
||||
BIND_PROPERTY(Variant::FLOAT, ads_factor);
|
||||
BIND_PROPERTY(Variant::FLOAT, run_factor);
|
||||
BIND_PROPERTY(Variant::FLOAT, recoil_force);
|
||||
BIND_PROPERTY(Variant::FLOAT, recoil_time);
|
||||
}
|
||||
|
||||
void Rifle::queue_start_aim() {
|
||||
get_anim()->queue("hip_to_aim");
|
||||
|
|
@ -71,10 +77,6 @@ void Rifle::on_animation_changed(String new_animation) {
|
|||
} else if (new_animation == "run") {
|
||||
get_camera()->set_fov_factor(this->run_factor);
|
||||
}
|
||||
|
||||
print_line(vformat("playing %s", new_animation));
|
||||
Vector<String> queue{ get_anim()->get_queue() };
|
||||
print_line(queue);
|
||||
}
|
||||
|
||||
void Rifle::ready() {
|
||||
|
|
@ -169,3 +171,19 @@ void Rifle::set_run_factor(float value) {
|
|||
float Rifle::get_run_factor() const {
|
||||
return this->run_factor;
|
||||
}
|
||||
|
||||
void Rifle::set_recoil_force(float value) {
|
||||
this->recoil_force = value;
|
||||
}
|
||||
|
||||
float Rifle::get_recoil_force() const {
|
||||
return this->recoil_force;
|
||||
}
|
||||
|
||||
void Rifle::set_recoil_time(float value) {
|
||||
this->recoil_time = value;
|
||||
}
|
||||
|
||||
float Rifle::get_recoil_time() const {
|
||||
return this->recoil_time;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue