1
This commit is contained in:
parent
48cf9c6c2a
commit
e065184b05
@ -215,7 +215,7 @@ void AndroidAI::Shot(Human* enemy)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (((HumMaster()->room->frameno - HumMaster()->last_shot_frameno_) * (1000 / kSERVER_FRAME_RATE)) >=
|
if (((HumMaster()->room->frameno - HumMaster()->last_shot_frameno_) * (1000 / kSERVER_FRAME_RATE)) >=
|
||||||
HumMaster()->curr_weapon->meta->i->fire_rate()
|
HumMaster()->GetFireRate()
|
||||||
) {
|
) {
|
||||||
a8::Vec2 shot_dir = enemy->pos - HumMaster()->pos;
|
a8::Vec2 shot_dir = enemy->pos - HumMaster()->pos;
|
||||||
if (std::abs(shot_dir.x) > FLT_EPSILON ||
|
if (std::abs(shot_dir.x) > FLT_EPSILON ||
|
||||||
|
@ -1650,6 +1650,15 @@ float Human::BuffAttrRate(int buff_effect_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Human::GetFireRate()
|
||||||
|
{
|
||||||
|
if (curr_weapon) {
|
||||||
|
return curr_weapon->meta->i->fire_rate() + ability.fire_rate;
|
||||||
|
} else {
|
||||||
|
return ability.fire_rate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Human::_UpdateMove(int speed)
|
void Human::_UpdateMove(int speed)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < speed; ++i) {
|
for (int i = 0; i < speed; ++i) {
|
||||||
|
@ -202,6 +202,7 @@ class Human : public Entity
|
|||||||
void SendGameOver();
|
void SendGameOver();
|
||||||
float BuffAttrAbs(int buff_effect_id);
|
float BuffAttrAbs(int buff_effect_id);
|
||||||
float BuffAttrRate(int buff_effect_id);
|
float BuffAttrRate(int buff_effect_id);
|
||||||
|
float GetFireRate();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _UpdateMove(int speed);
|
void _UpdateMove(int speed);
|
||||||
|
@ -143,7 +143,7 @@ void Player::UpdateShot()
|
|||||||
if (last_shot_frameno_ == 0 ||
|
if (last_shot_frameno_ == 0 ||
|
||||||
(
|
(
|
||||||
(room->frameno - last_shot_frameno_) * (1000 / kSERVER_FRAME_RATE)) >=
|
(room->frameno - last_shot_frameno_) * (1000 / kSERVER_FRAME_RATE)) >=
|
||||||
curr_weapon->meta->i->fire_rate()
|
GetFireRate()
|
||||||
) {
|
) {
|
||||||
Shot();
|
Shot();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user