Bowling balls will now bump off karts that have the star effect shown,

and not explode anymore.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7478 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-01-17 21:21:47 +00:00
parent e7edf7875c
commit af641ae196
4 changed files with 13 additions and 0 deletions

View File

@ -53,6 +53,8 @@ private:
void showFor(float time);
void reset();
void update (float delta_t);
/** Returns true if the stars are currently shown. */
bool isEnabled() const { return m_enabled; }
};
#endif

View File

@ -158,6 +158,9 @@ public:
void setHasHit () { m_has_hit_something = true; }
void reset () { Moveable::reset(); }
bool isOwnerImmunity(const Kart *kart_hit) const;
/** Returns the type of flyable. */
PowerupManager::PowerupType
getType() const {return m_type;}
virtual const char* getExplosionSound() const { return "explosion"; }
/** Indicates if an explosion needs to be added if this flyable
* is removed. */

View File

@ -96,6 +96,8 @@ public:
const float getAnimationTimer() const {return m_timer;}
/** Returns true if the kart is eliminated. */
bool isEliminated () const {return m_eliminated;}
/** Returns a pointer to the stars effect. */
const Stars *getStarEffect () const {return m_stars_effect; }
void eliminate ();
}; // EmergencyAnimation

View File

@ -21,6 +21,7 @@
#include "config/user_config.hpp"
#include "network/race_state.hpp"
#include "graphics/stars.hpp"
#include "physics/btKart.hpp"
#include "physics/btUprightConstraint.hpp"
#include "physics/irr_debug_drawer.hpp"
@ -135,6 +136,11 @@ void Physics::update(float dt)
}
else if(p->b->is(UserPointer::UP_KART)) // projectile hit kart
{
// Only explode a bowling ball if the target does not
// the stars shown
if(p->a->getPointerFlyable()->getType()
!=PowerupManager::POWERUP_BOWLING ||
!p->b->getPointerKart()->getStarEffect()->isEnabled() )
p->a->getPointerFlyable()->hit(p->b->getPointerKart());
}
else // projectile hits projectile