This commit is contained in:
Alayan
2019-10-21 21:59:01 +02:00
parent 816cd3f3bf
commit d7053ca2e5
3 changed files with 9 additions and 8 deletions

View File

@@ -106,7 +106,6 @@ void KartStatsWidget::setValues(const KartProperties* props,
// The base speed is of 25
// Here we are not fully proportional, because small differences matter more
setSkillValues(SKILL_SPEED,
(kp_computed.getCombinedCharacteristic()->getEngineMaxSpeed() - 20.0f) * 15.0f,
"speed.png", "speed", _("Maximum speed"));
@@ -114,14 +113,12 @@ void KartStatsWidget::setValues(const KartProperties* props,
// The acceleration depend on power and mass, and it changes depending on speed
// We call a function which gives us a single number to represent it
// power/mass gives numbers in the 1-10 range, so we multiply it by 10.
setSkillValues(SKILL_ACCELERATION,
kp_computed.getAccelerationEfficiency()*10.0f,
"power.png", "acceleration", _("Acceleration"));
// The base nitro consumption is 1, higher for heavier karts.
// Nitro efficiency is hence 90/nitro_consumption
setSkillValues(SKILL_NITRO_EFFICIENCY,
90.0f/kp_computed.getCombinedCharacteristic()->getNitroConsumption(),
"nitro.png", "nitro", _("Nitro efficiency"));
@@ -212,4 +209,4 @@ void KartStatsWidget::setDisplayIcons(bool display_icons)
{
m_skills[i]->setDisplayIcon(display_icons);
}
} // setDisplayText
} // setDisplayIcons

View File

@@ -1016,7 +1016,7 @@ void Kart::finishedRace(float time, bool from_server)
RaceGUIBase* m = World::getWorld()->getRaceGUI();
if (m)
{
bool won_the_race = false;
bool won_the_race = false, too_slow = false;
unsigned int win_position = 1;
if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER)
@@ -1026,8 +1026,12 @@ void Kart::finishedRace(float time, bool from_server)
World::getWorld()->getNumKarts() > win_position)
won_the_race = true;
m->addMessage((won_the_race ?
_("You won the race!") : _("You finished the race!")) ,
if (race_manager->hasTimeTarget() && m_finish_time > race_manager->getTimeTarget())
too_slow = true;
m->addMessage((too_slow ? _("You were too slow!") :
won_the_race ? _("You won the race!") :
_("You finished the race!")),
this, 2.0f, video::SColor(255, 255, 255, 255), true, true, true);
}
}

View File

@@ -394,7 +394,7 @@ void RaceGUI::drawGlobalTimer()
float elapsed_time = World::getWorld()->getTime();
if (!race_manager->hasTimeTarget() ||
race_manager ->getMinorMode()==RaceManager::MINOR_MODE_SOCCER ||
race_manager->getMinorMode() ==RaceManager::MINOR_MODE_SOCCER ||
race_manager->getMinorMode() == RaceManager::MINOR_MODE_FREE_FOR_ALL ||
race_manager->getMinorMode() == RaceManager::MINOR_MODE_CAPTURE_THE_FLAG)
{