def set_shoot(self, value):
if value == self.shoot:
return
current_time = reactor.seconds()
if value:
self.start = current_time
if self.current_ammo <= 0:
return
elif self.reloading and not self.slow_reload:
return
self.shoot_time = max(current_time, self.next_shot)
if self.reloading:
self.reloading = False
self.reload_call.cancel()
else:
ammo = self.current_ammo
self.current_ammo = self.get_ammo(True)
self.next_shot = self.shoot_time + self.delay * (
ammo - self.current_ammo)
self.shoot = value
评论列表
文章目录