int main(void) { bool vInstall = false; char* versionNumber; char* executionString; char* executionBase = "system(/Applications/Chromium.app/Contents/MacOS/Chromium_ --ppapi-flash-path=/Library/Internet\\\\ Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin/Contents/MacOS/PepperFlashPlayer --ppapi-flash-version="; char* executionTail = "\");\n"; char* chromiumName = "/Applications/Chromium.app/Contents/MacOS/Chromium_"; if (!existingInstallation(chromiumName)) { vInstall = verifyInstallation(false); if (!vInstall) { fprintf(stderr, "Installation declined\n"); exit(1); } } versionNumber = calloc(250, sizeof(char)); requestVersion(versionNumber); executionString = calloc(250, sizeof(char)); strcat(executionString, executionBase); strcat(executionString, versionNumber); strcat(executionString, executionTail); strcat(executionString, "\0"); createFile(executionString); vInstall = verifyInstallation(true); if (!vInstall) { fprintf(stderr, "Installation cancelled\n"); exit(1); } if (!existingInstallation(chromiumName)) { createInstallation(); } enableFlash(); free(versionNumber); free(executionString); return 0; }
void CColossRagemode::close() { enableFlash(); // Delete projectiles currently on screen for(unsigned int i = 0; i < getProjectileVector().size(); i++) { getProjectileVector()[i]->setBounced(true); getProjectileVector()[i]->bounceOrDestroy(); } ci_timer_switch_key->reset(); ci_timer_check_count->reset(); m_shockwaveCollider.SetRadius(0.0f); CInterface::get()->setCurrentRageWaveProgress(m_shockwaveCollider.GetRadius()); CInterface::get()->setCurrentShieldPercentage(0.0f); // Remove 1/8th of score after ragemode int iPenalty = CInterface::get()->getCurrentScore() - (CInterface::get()->getCurrentScore() * 7/8); if(iPenalty != 0) { CInterface::get()->setCurrentScore(CInterface::get()->getCurrentScore() * 7/8); std::stringstream string_typecast; std::string temp; string_typecast << iPenalty; string_typecast >> temp; string_typecast.clear(); std::string negative_points = "Ragemode penalty: -"; negative_points += temp; text_negative_points.setString(negative_points); text_negative_points.setColor(sf::Color(0, 0, 0, 255)); text_negative_points.setOrigin(text_negative_points.getGlobalBounds().width/2, text_negative_points.getGlobalBounds().height/2); m_fFadeOutText = 255.0f; }
void CColossRagemode::start() { setImmortal(true); enableFlash(); // Delete projectiles currently on screen for(unsigned int i = 0; i < getProjectileVector().size(); i++) { getProjectileVector()[i]->setBounced(true); getProjectileVector()[i]->bounceOrDestroy(); } ci_timer_switch_key->start(); ci_timer_check_count->start(); m_bShieldKeyPressed = false; m_bShockwaveKeyPressed = false; m_iSpamCount = 0; m_iStrengthening = 0; m_fAttack = 0.0f; m_fShieldStrength = 0.0f; m_fPreviousShieldStrength = 0.0f; m_fScaleFactor = 0.0f; chooseRandomButton(); // Shockwave m_bShockwaveIconShown = false; m_ShockwaveIcon.setColor(sf::Color(255, 255, 255, 0)); m_shockwaveCollider.SetRadius(0.0f); CInterface::get()->setCurrentRageWaveProgress(m_shockwaveCollider.GetRadius()); // Button sprites for(unsigned int i = 0; i < m_vButton.size(); i++) { m_vButton[i].SetCurrentAnimation(C_ANIM_BUTTON_NORMAL); } // Button text m_vButtonText[0].setString(pwHelper::key::getKeyName(CSettings::get()->getLayerKey(0))); m_vButtonText[1].setString(pwHelper::key::getKeyName(CSettings::get()->getLayerKey(1))); m_vButtonText[2].setString(pwHelper::key::getKeyName(CSettings::get()->getLayerKey(2))); m_vButtonText[3].setString(pwHelper::key::getKeyName(CSettings::get()->getLayerKey(3))); m_vButtonText[4].setString(pwHelper::key::getKeyName(CSettings::get()->getLayerKey(4))); for(unsigned int i = 0; i < m_vButtonText.size(); i++) { m_vButtonText[i].setOrigin(m_vButtonText[i].getGlobalBounds().width/2, m_vButtonText[i].getGlobalBounds().height); } // Reset coloss animation to normal state for(unsigned int i = 0; i < getBlockVisuals().size(); i++) { getBlockVisuals()[i].hold_animation = false; } // Interface ragemode begin CInterface::get()->startRage(); // Switch to ragemode animation for(unsigned int i = 0; i < getMoveVisuals().size(); i++) { getMoveVisuals()[i].animation.setColor(sf::Color(255, 255, 255, 0)); } for(unsigned int i = 0; i < getBlockVisuals().size(); i++) { getBlockVisuals()[i].animation.SetFramesPerSecond(ci_coloss_data.getFramesPerSecond()); getBlockVisuals()[i].animation.PlayOnce(); getBlockVisuals()[i].animation.SetCurrentAnimation(C_ANIM_PULLBACK); getBlockVisuals()[i].animation.ResetCurrentAnimation(); if(i == 0) { getBlockVisuals()[i].animation.PlayOnce(false); getBlockVisuals()[i].animation.SetCurrentAnimation(C_ANIM_IDLE); } else { getBlockVisuals()[i].animation.setColor(sf::Color(255, 255, 255, 0)); } } for(unsigned int i = 0; i < getRagemodeVisuals().size(); i++) { getRagemodeVisuals()[i].animation.setColor(sf::Color(255, 255, 255, 255)); } }