Report "plunger in face" hits with text. Band/pick mode not done yet.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4922 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
6b95ca8ec3
commit
4a2e7d57b1
@ -331,11 +331,7 @@ void Flyable::hit(Kart *kart_hit, PhysicalObject* object)
|
||||
m_owner->getName().c_str()
|
||||
).c_str();
|
||||
break;
|
||||
case POWERUP_PLUNGER: // FIXME, this one never appears, maybe wrong place to handle
|
||||
hit_message += StringUtils::insertValues(_("%s gets a fancy mask from %s"),
|
||||
kart_hit->getName().c_str(),
|
||||
m_owner->getName().c_str()
|
||||
).c_str();
|
||||
case POWERUP_PLUNGER: // Handled by plunger.cpp Plunger::hit
|
||||
break;
|
||||
case POWERUP_BOWLING:
|
||||
hit_message += StringUtils::insertValues(_("%s will not play bowling with %s again"),
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "physics/physical_object.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
Plunger::Plunger(Kart *kart) : Flyable(kart, POWERUP_PLUNGER)
|
||||
@ -147,12 +148,20 @@ void Plunger::hit(Kart *kart, PhysicalObject *obj)
|
||||
{
|
||||
if(isOwnerImmunity(kart)) return;
|
||||
|
||||
RaceGUI* gui = World::getWorld()->getRaceGUI();
|
||||
irr::core::stringw hit_message;
|
||||
|
||||
// pulling back makes no sense in battle mode, since this mode is not a race.
|
||||
// so in battle mode, always hide view
|
||||
if( m_reverse_mode || race_manager->isBattleMode(race_manager->getMinorMode()) )
|
||||
{
|
||||
if(kart) kart->blockViewWithPlunger();
|
||||
|
||||
hit_message += StringUtils::insertValues(_("%s gets a fancy mask from %s"),
|
||||
kart->getName().c_str(),
|
||||
m_owner->getName().c_str()
|
||||
).c_str();
|
||||
|
||||
m_keep_alive = 0;
|
||||
// Make this object invisible by placing it faaar down. Not that if this
|
||||
// objects is simply removed from the scene graph, it might be auto-deleted
|
||||
@ -160,6 +169,8 @@ void Plunger::hit(Kart *kart, PhysicalObject *obj)
|
||||
Vec3 hell(0, 0, -10000);
|
||||
getNode()->setPosition(hell.toIrrVector());
|
||||
World::getWorld()->getPhysics()->removeBody(getBody());
|
||||
|
||||
gui->addMessage(hit_message, NULL, 3.0f, 40, video::SColor(255, 210, 50, 50));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user