Use MaxSpeed to slow down spare tire karts

This commit is contained in:
Benau 2016-10-06 00:35:52 +08:00
parent a0b02659f7
commit b66e6ef06d
4 changed files with 5 additions and 4 deletions

View File

@ -343,8 +343,7 @@ void ArenaAI::configSpeed()
else
{
// Otherwise accelerate
m_controls->setAccel(stk_config->m_ai_acceleration * handicap *
getSpeedCap());
m_controls->setAccel(stk_config->m_ai_acceleration * handicap);
}
} // configSpeed

View File

@ -128,7 +128,6 @@ private:
virtual bool isWaiting() const = 0;
virtual bool isKartOnRoad() const = 0;
virtual void resetAfterStop() {};
virtual float getSpeedCap() const { return 1.0f; }
public:
ArenaAI(AbstractKart *kart);
virtual ~ArenaAI() {};

View File

@ -20,6 +20,7 @@
#include "karts/abstract_kart.hpp"
#include "karts/kart_gfx.hpp"
#include "karts/max_speed.hpp"
#include "modes/three_strikes_battle.hpp"
#include "tracks/arena_graph.hpp"
#include "tracks/arena_node.hpp"
@ -51,6 +52,9 @@ void SpareTireAI::reset()
void SpareTireAI::update(float dt)
{
assert(!m_fixed_target_nodes.empty());
m_kart->setSlowdown(MaxSpeed::MS_DECREASE_AI, 0.5f, /*fade_in_time*/0.0f);
BattleAI::update(dt);
m_timer -= dt;
if (m_timer < 0.0f)

View File

@ -35,7 +35,6 @@ private:
virtual void findClosestKart(bool use_difficulty) OVERRIDE {}
virtual void findTarget() OVERRIDE;
virtual float getSpeedCap() const OVERRIDE { return 0.7f; }
void findDefaultPath();
public:
SpareTireAI(AbstractKart *kart);