Repository recovery 5: former r14322
Give nolok his pecial green bubblegum shield. Just like regular bubblegum, the visuals will eventually need to be redone git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14317 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
71709729b4
commit
d81c138e17
Binary file not shown.
BIN
data/models/bubblegum_shield_nolok.b3d
Normal file
BIN
data/models/bubblegum_shield_nolok.b3d
Normal file
Binary file not shown.
BIN
data/models/bubblegum_shield_nolok.png
Normal file
BIN
data/models/bubblegum_shield_nolok.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
@ -11,7 +11,8 @@
|
||||
<material name="stk_mod_nitroBottle.png" />
|
||||
<material name="stk_mod_nitroLogo.png" compositing="additive" light="N" disable-z-write="Y" />
|
||||
|
||||
<material name="bubblegum_shield.png" compositing="blend" disable-z-write="Y"/>
|
||||
<material name="bubblegum_shield.png" compositing="blend" disable-z-write="Y"/>
|
||||
<material name="bubblegum_shield_nolok.png" compositing="blend" disable-z-write="Y"/>
|
||||
<material name="parachute.png" backface-culling="n" ignore="Y"/>
|
||||
<material name="zipper.png" light="N" zipper="Y"/>
|
||||
<material name="zipper_collect.png" light="N" zipper="Y"/>
|
||||
|
@ -222,7 +222,8 @@ void Attachment::clear()
|
||||
void Attachment::hitBanana(Item *item, int new_attachment)
|
||||
{
|
||||
//Bubble gum shield effect:
|
||||
if(m_type == ATTACH_BUBBLEGUM_SHIELD)
|
||||
if(m_type == ATTACH_BUBBLEGUM_SHIELD ||
|
||||
m_type == ATTACH_NOLOK_BUBBLEGUM_SHIELD)
|
||||
{
|
||||
m_time_left = 0.0f;
|
||||
return;
|
||||
@ -387,8 +388,9 @@ void Attachment::update(float dt)
|
||||
if(m_type==ATTACH_NOTHING) return;
|
||||
m_time_left -=dt;
|
||||
|
||||
float m_wanted_node_scale = m_type==ATTACH_BUBBLEGUM_SHIELD ?
|
||||
std::max(1.0f, m_kart->getHighestPoint()*1.1f) : 1.0f;
|
||||
|
||||
bool is_shield = (m_type == ATTACH_BUBBLEGUM_SHIELD|| m_type == ATTACH_NOLOK_BUBBLEGUM_SHIELD);
|
||||
float m_wanted_node_scale = is_shield ? std::max(1.0f, m_kart->getHighestPoint()*1.1f) : 1.0f;
|
||||
|
||||
if (m_node_scale < m_wanted_node_scale)
|
||||
{
|
||||
@ -459,6 +461,7 @@ void Attachment::update(float dt)
|
||||
// Nothing to do for tinytux, this is all handled in EmergencyAnimation
|
||||
break;
|
||||
case ATTACH_BUBBLEGUM_SHIELD:
|
||||
case ATTACH_NOLOK_BUBBLEGUM_SHIELD:
|
||||
if (m_time_left < 0)
|
||||
{
|
||||
m_time_left = 0.0f;
|
||||
|
@ -60,6 +60,7 @@ public:
|
||||
ATTACH_NOLOKS_SWATTER,
|
||||
ATTACH_TINYTUX,
|
||||
ATTACH_BUBBLEGUM_SHIELD,
|
||||
ATTACH_NOLOK_BUBBLEGUM_SHIELD,
|
||||
ATTACH_MAX,
|
||||
ATTACH_NOTHING
|
||||
};
|
||||
|
@ -54,6 +54,7 @@ static const initAttachmentType iat[]=
|
||||
{Attachment::ATTACH_NOLOKS_SWATTER, "swatter_nolok.b3d", "swatter-icon.png" },
|
||||
{Attachment::ATTACH_TINYTUX, "reset-button.b3d", "reset-attach-icon.png" },
|
||||
{Attachment::ATTACH_BUBBLEGUM_SHIELD, "bubblegum_shield.b3d", "shield-icon.png" },
|
||||
{Attachment::ATTACH_NOLOK_BUBBLEGUM_SHIELD, "bubblegum_shield_nolok.b3d", "shield-icon.png" },
|
||||
{Attachment::ATTACH_MAX, "", "" },
|
||||
};
|
||||
|
||||
|
@ -302,13 +302,29 @@ void Powerup::use()
|
||||
|
||||
if(!m_owner->isShielded()) //if the previous shield had been used up.
|
||||
{
|
||||
m_owner->getAttachment()->set(Attachment::ATTACH_BUBBLEGUM_SHIELD,
|
||||
stk_config->m_bubblegum_shield_time);
|
||||
if (m_owner->getIdent() == "nolok")
|
||||
{
|
||||
m_owner->getAttachment()->set(Attachment::ATTACH_NOLOK_BUBBLEGUM_SHIELD,
|
||||
stk_config->m_bubblegum_shield_time);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_owner->getAttachment()->set(Attachment::ATTACH_BUBBLEGUM_SHIELD,
|
||||
stk_config->m_bubblegum_shield_time);
|
||||
}
|
||||
}
|
||||
else // using a bubble gum while still having a shield
|
||||
{
|
||||
m_owner->getAttachment()->set(Attachment::ATTACH_BUBBLEGUM_SHIELD,
|
||||
stk_config->m_bubblegum_shield_time + m_owner->getShieldTime());
|
||||
if (m_owner->getIdent() == "nolok")
|
||||
{
|
||||
m_owner->getAttachment()->set(Attachment::ATTACH_NOLOK_BUBBLEGUM_SHIELD,
|
||||
stk_config->m_bubblegum_shield_time + m_owner->getShieldTime());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_owner->getAttachment()->set(Attachment::ATTACH_BUBBLEGUM_SHIELD,
|
||||
stk_config->m_bubblegum_shield_time + m_owner->getShieldTime());
|
||||
}
|
||||
}
|
||||
|
||||
m_sound_use = sfx_manager->createSoundSource("inflate");//Extraordinary. Usually sounds are set in Powerup::set()
|
||||
|
@ -984,9 +984,15 @@ void Kart::setShieldTime(float t)
|
||||
bool Kart::isShielded() const
|
||||
{
|
||||
if(getAttachment() != NULL)
|
||||
return getAttachment()->getType() == Attachment::ATTACH_BUBBLEGUM_SHIELD;
|
||||
{
|
||||
Attachment::AttachmentType type = getAttachment()->getType();
|
||||
return type == Attachment::ATTACH_BUBBLEGUM_SHIELD ||
|
||||
type == Attachment::ATTACH_NOLOK_BUBBLEGUM_SHIELD;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} // isShielded
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user