life changes from midi

This commit is contained in:
AJ Kelly
2010-09-02 00:23:49 -05:00
parent 72048dd638
commit 283905a8cb
2 changed files with 9 additions and 2 deletions
+8 -2
View File
@@ -192,7 +192,13 @@ float LifeMeterBattery::GetLife() const
return float(m_iLivesLeft) / GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives;
}
int LifeMeterBattery::GetRemainingLives() const
{
if( !GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives )
return 1;
return m_iLivesLeft;
}
void LifeMeterBattery::Refresh()
{
// todo: make this restraint metricable + handle non-sprites -aj
@@ -239,12 +245,12 @@ class LunaLifeMeterBattery: public Luna<LifeMeterBattery>
public:
static int GetLivesLeft( T* p, lua_State *L ) { lua_pushnumber( L, p->GetLivesLeft() ); return 1; }
// is this right? wtf -q2x
//static int GetTotalLives( T* p, lua_State *L ) { lua_pushnumber( L, GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives ); return 1; }
static int GetTotalLives( T* p, lua_State *L ) { lua_pushnumber( L, GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives ); return 1; }
LunaLifeMeterBattery()
{
ADD_METHOD( GetLivesLeft );
//ADD_METHOD( GetTotalLives );
ADD_METHOD( GetTotalLives );
}
};
+1
View File
@@ -29,6 +29,7 @@ public:
virtual bool IsHot() const;
virtual bool IsFailing() const;
virtual float GetLife() const;
virtual int GetRemainingLives() const;
void Refresh();
int GetLivesLeft() { return m_iLivesLeft; }