Use MaxSpeed to slow down spare tire karts
This commit is contained in:
parent
a0b02659f7
commit
b66e6ef06d
@ -343,8 +343,7 @@ void ArenaAI::configSpeed()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Otherwise accelerate
|
// Otherwise accelerate
|
||||||
m_controls->setAccel(stk_config->m_ai_acceleration * handicap *
|
m_controls->setAccel(stk_config->m_ai_acceleration * handicap);
|
||||||
getSpeedCap());
|
|
||||||
}
|
}
|
||||||
} // configSpeed
|
} // configSpeed
|
||||||
|
|
||||||
|
@ -128,7 +128,6 @@ private:
|
|||||||
virtual bool isWaiting() const = 0;
|
virtual bool isWaiting() const = 0;
|
||||||
virtual bool isKartOnRoad() const = 0;
|
virtual bool isKartOnRoad() const = 0;
|
||||||
virtual void resetAfterStop() {};
|
virtual void resetAfterStop() {};
|
||||||
virtual float getSpeedCap() const { return 1.0f; }
|
|
||||||
public:
|
public:
|
||||||
ArenaAI(AbstractKart *kart);
|
ArenaAI(AbstractKart *kart);
|
||||||
virtual ~ArenaAI() {};
|
virtual ~ArenaAI() {};
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
#include "karts/kart_gfx.hpp"
|
#include "karts/kart_gfx.hpp"
|
||||||
|
#include "karts/max_speed.hpp"
|
||||||
#include "modes/three_strikes_battle.hpp"
|
#include "modes/three_strikes_battle.hpp"
|
||||||
#include "tracks/arena_graph.hpp"
|
#include "tracks/arena_graph.hpp"
|
||||||
#include "tracks/arena_node.hpp"
|
#include "tracks/arena_node.hpp"
|
||||||
@ -51,6 +52,9 @@ void SpareTireAI::reset()
|
|||||||
void SpareTireAI::update(float dt)
|
void SpareTireAI::update(float dt)
|
||||||
{
|
{
|
||||||
assert(!m_fixed_target_nodes.empty());
|
assert(!m_fixed_target_nodes.empty());
|
||||||
|
|
||||||
|
m_kart->setSlowdown(MaxSpeed::MS_DECREASE_AI, 0.5f, /*fade_in_time*/0.0f);
|
||||||
|
|
||||||
BattleAI::update(dt);
|
BattleAI::update(dt);
|
||||||
m_timer -= dt;
|
m_timer -= dt;
|
||||||
if (m_timer < 0.0f)
|
if (m_timer < 0.0f)
|
||||||
|
@ -35,7 +35,6 @@ private:
|
|||||||
|
|
||||||
virtual void findClosestKart(bool use_difficulty) OVERRIDE {}
|
virtual void findClosestKart(bool use_difficulty) OVERRIDE {}
|
||||||
virtual void findTarget() OVERRIDE;
|
virtual void findTarget() OVERRIDE;
|
||||||
virtual float getSpeedCap() const OVERRIDE { return 0.7f; }
|
|
||||||
void findDefaultPath();
|
void findDefaultPath();
|
||||||
public:
|
public:
|
||||||
SpareTireAI(AbstractKart *kart);
|
SpareTireAI(AbstractKart *kart);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user