Add break_time_increase to perPlayerDifficulty

This commit is contained in:
Flakebi 2014-08-31 12:34:27 +02:00
parent dc4a30202f
commit 8c40f279cd
3 changed files with 20 additions and 10 deletions

View File

@ -342,7 +342,7 @@
<difficulties>
<easiest>
<mass value="1.0"/>
<engine brake-factor="2.5" max-speed-reverse-ratio="1.0" power="1.5" max-speed="1.5"/>
<engine brake-factor="2.5" brake-time-increase="1.5" max-speed-reverse-ratio="1.0" power="1.5" max-speed="1.5"/>
<nitro consumption="0.7" max-speed-increase="1.3" duration="1.0" fade-out-time="1.0"/>
<bubblegum time="0.5" speed-fraction="0.5" torque="0.5" fade-in-time="1.0"/>
<rescue time="0.5"/>
@ -359,7 +359,7 @@
</easiest>
<easy>
<mass value="1.0"/>
<engine brake-factor="1.7" max-speed-reverse-ratio="1.0" power="1.2" max-speed="1.2"/>
<engine brake-factor="1.7" brake-time-increase="1.2" max-speed-reverse-ratio="1.0" power="1.2" max-speed="1.2"/>
<nitro consumption="0.9" max-speed-increase="1.1" duration="1.0" fade-out-time="1.0"/>
<bubblegum time="0.7" speed-fraction="0.7" torque="0.7" fade-in-time="1.0"/>
<rescue time="0.7"/>
@ -376,7 +376,7 @@
</easy>
<normal>
<mass value="1.0"/>
<engine brake-factor="1.0" max-speed-reverse-ratio="1.0" power="1.0" max-speed="1.0"/>
<engine brake-factor="1.0" brake-time-increase="1.0" max-speed-reverse-ratio="1.0" power="1.0" max-speed="1.0"/>
<nitro consumption="1.0" max-speed-increase="1.0" duration="1.0" fade-out-time="1.0"/>
<bubblegum time="1.0" speed-fraction="1.0" torque="1.0" fade-in-time="1.0"/>
<rescue time="1.0"/>
@ -393,7 +393,7 @@
</normal>
<hard>
<mass value="1.0"/>
<engine brake-factor="0.8" max-speed-reverse-ratio="0.8" power="0.8" max-speed="0.8"/>
<engine brake-factor="0.8" brake-time-increase="0.85" max-speed-reverse-ratio="0.8" power="0.8" max-speed="0.8"/>
<nitro consumption="1.1" max-speed-increase="0.9" duration="1.0" fade-out-time="1.0"/>
<bubblegum time="1.5" speed-fraction="1.5" torque="1.5" fade-in-time="1.0"/>
<rescue time="1.5"/>
@ -410,7 +410,7 @@
</hard>
<hardest>
<mass value="1.0"/>
<engine brake-factor="0.5" max-speed-reverse-ratio="0.6" power="0.6" max-speed="0.6"/>
<engine brake-factor="0.5" brake-time-increase="0.7" max-speed-reverse-ratio="0.6" power="0.6" max-speed="0.6"/>
<nitro consumption="1.2" max-speed-increase="0.8" duration="1.0" fade-out-time="1.0"/>
<bubblegum time="2.0" speed-fraction="2.0" torque="2.0" fade-in-time="1.0"/>
<rescue time="2.0"/>

View File

@ -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"))

View File

@ -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