添加射击时速度减速

This commit is contained in:
aozhiwei 2019-06-03 14:13:04 +08:00
parent bea8882743
commit 131eff7f83
4 changed files with 14 additions and 5 deletions

View File

@ -66,6 +66,14 @@ float Human::GetSpeed()
} if (downed) {
return meta->i->move_speed3() + buff.speed;
} else {
if (shot_hold) {
if (curr_weapon->weapon_idx == GUN_SLOT1 ||
curr_weapon->weapon_idx == GUN_SLOT2) {
if (action_type != AT_Reload) {
return meta->i->shot_speed();
}
}
}
return meta->i->move_speed() + buff.speed;
}
}

View File

@ -96,6 +96,11 @@ class Human : public Entity
std::set<Human*>* team_members = nullptr;
std::set<Human*> kill_humans;
bool shot_start = false;
bool shot_hold = false;
int series_shot_frames = 0;
float fly_distance = 0.0f;
long long jump_frameno = 0;
long long send_msg_times = 0;

View File

@ -30,11 +30,6 @@ class Player : public Human
bool moving = false;
int moved_frames = 0;
bool shot_start = false;
bool shot_hold = false;
int series_shot_frames = 0;
float fly_distance = 0.0f;
bool select_weapon = false;
int selected_weapon_idx = 0;

View File

@ -98,6 +98,7 @@ message Player
optional int32 move_speed = 4; //
optional int32 jump_speed = 5; //
optional int32 move_speed3 = 6;
optional int32 shot_speed = 7;
optional int32 move_speed4 = 10; //4
optional float def = 11; //
optional string volume = 12; //