void CTurtle::Update(float fElapsedTime) { m_vAnimations[m_nCurrAnimation].Update(fElapsedTime); if(GetExperience() >= (100 * GetLevel())) { CBattleMap::GetInstance()->PlaySFX(CAssets::GetInstance()->aBMcowabungaSnd); SetExperience(0/*GetExperience()-(100* GetLevel())*/); SetLevel(GetLevel() + 1); SetHealthMax((int)((float)GetMaxHealth() * 1.25f)); SetHealth((int)((float)GetMaxHealth())); SetBaseAP(GetBaseAP()+2); SetStrength( (int)( (float)GetStrength() * 1.2f ) ); SetDefense( (int) ( (float)GetDefense() * 1.2f ) ); SetAccuracy( (int) ( (float)GetAccuracy() * 1.2f ) ); SetSpeed( (int) ( (float)GetSpeed() * 1.2f ) ); } if( GetHealth() <= 0) { if(GetAlive() == true) { CBattleMap::GetInstance()->DecrementNumChars(); CBattleMap::GetInstance()->DecrementNumTurtles(); CBattleMap::GetInstance()->SetTurtleDead(); SetAlive(false); if(GetCurrAnimNum() != 9) SetCurrAnim(9); SetPosZ(0.9f); } } }
void CRPGPlayer::ShowChar() { IMenuStyle *style = menus->GetDefaultStyle(); IBaseMenu *menu = style->CreateMenu(&g_RPGPlugin, myself->GetIdentity()); IMenuPanel *panel = menu->CreatePanel(); menu->SetDefaultTitle(MENU_CHAR_TITLE); panel->DrawTitle(MENU_CHAR_TITLE); char text[255]; sprintf(text, "Player ID: %d", GetSQLIndex()); panel->DrawItem(ItemDrawInfo(text)); int classnum = GetCurrentClass(); if (classnum > RPG_CLASS_NONE) { int team = GetCachedTeam(); if ( team == TEAM_SURVIVORS) { sprintf(text, "Class: %s", HumanClasses[classnum]); } else if (team == TEAM_UNDEAD) { sprintf(text, "Class: %s", ZombieClasses[classnum]); } else { sprintf(text, "Class: None"); } panel->DrawItem(ItemDrawInfo(text)); // item 1 sprintf(text, "Level: %d", GetLevel()); panel->DrawItem(ItemDrawInfo(text)); // item 2 sprintf(text, "Experience: %d", GetExperience()); panel->DrawItem(ItemDrawInfo(text)); // item 3 for (int i = 0; i < MAX_SKILLS; i++) // item 4-7 { sprintf(text, "%s - (Level %d)", SkillNames[skills[i].iIndex], skills[i].iLevel); panel->DrawItem(ItemDrawInfo(text)); } } panel->SendDisplay(GetIndex(), &g_RPGPlugin, MENU_TIME_FOREVER ); }
void CRPGPlayer::AddExperience( int experience ) { SetExperience( GetExperience() + experience ); }