From 8c40f279cdbec461a49ea73ab84d10d5a90a22c3 Mon Sep 17 00:00:00 2001 From: Flakebi Date: Sun, 31 Aug 2014 12:34:27 +0200 Subject: [PATCH] Add break_time_increase to perPlayerDifficulty --- data/stk_config.xml | 10 +++++----- src/karts/player_difficulty.cpp | 11 ++++++----- src/karts/player_difficulty.hpp | 9 +++++++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/data/stk_config.xml b/data/stk_config.xml index f7d5e6e00..67f29f32b 100644 --- a/data/stk_config.xml +++ b/data/stk_config.xml @@ -342,7 +342,7 @@ - + @@ -359,7 +359,7 @@ - + @@ -376,7 +376,7 @@ - + @@ -393,7 +393,7 @@ - + @@ -410,7 +410,7 @@ - + diff --git a/src/karts/player_difficulty.cpp b/src/karts/player_difficulty.cpp index 3cd19a311..33a5a8894 100644 --- a/src/karts/player_difficulty.cpp +++ b/src/karts/player_difficulty.cpp @@ -32,8 +32,8 @@ PlayerDifficulty::PlayerDifficulty(const std::string &filename) { // Set all other values to undefined, so that it can later be tested // if everything is defined properly. - m_mass = m_brake_factor = m_rescue_time = m_explosion_time = - m_explosion_invulnerability_time = m_zipper_time = + m_mass = m_brake_factor = m_brake_time_increase = m_rescue_time = + m_explosion_time = m_explosion_invulnerability_time = m_zipper_time = m_zipper_fade_out_time = m_zipper_force = m_zipper_speed_gain = m_zipper_max_speed_increase = m_rubber_band_max_length = m_rubber_band_force = m_rubber_band_duration = @@ -102,10 +102,11 @@ void PlayerDifficulty::getAllData(const XMLNode * root) if(const XMLNode *engine_node = root->getNode("engine")) { - engine_node->get("brake-factor", &m_brake_factor); + engine_node->get("brake-factor", &m_brake_factor); + engine_node->get("brake-time-increase", &m_brake_time_increase); engine_node->get("max-speed-reverse-ratio", &m_max_speed_reverse_ratio); - engine_node->get("power", &m_engine_power); - engine_node->get("max-speed", &m_max_speed); + engine_node->get("power", &m_engine_power); + engine_node->get("max-speed", &m_max_speed); } if(const XMLNode *nitro_node = root->getNode("nitro")) diff --git a/src/karts/player_difficulty.hpp b/src/karts/player_difficulty.hpp index 6a43f9993..84468fd04 100644 --- a/src/karts/player_difficulty.hpp +++ b/src/karts/player_difficulty.hpp @@ -52,6 +52,10 @@ private: /** Braking factor * engine_power braking force. */ float m_brake_factor; + /** Brake_time * m_brake_time_increase will increase the break time + * over time. */ + float m_brake_time_increase; + /** Time a kart is moved upwards after when it is rescued. */ float m_rescue_time; @@ -166,10 +170,15 @@ public: // ------------------------------------------------------------------------ /** Returns the maximum engine power depending on difficulty. */ float getMaxPower () const {return m_engine_power; } + // ------------------------------------------------------------------------ /** Get braking information. */ float getBrakeFactor () const {return m_brake_factor; } + // ------------------------------------------------------------------------ + /** Returns the additional brake factor which depends on time. */ + float getBrakeTimeIncrease() const { return m_brake_time_increase; } + // ------------------------------------------------------------------------ /** Get maximum reverse speed ratio. */ float getMaxSpeedReverseRatio () const