online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> #define FAST_AP 6 #define FAST_BP 70 #define TAVION_AP 8 #define TAVION_BP 60 #define MEDIUM_AP 12 #define MEDIUM_BP 55 #define STRONG_AP 19 #define STRONG_BP 42 #define DESANN_AP 15 #define DESANN_BP 46 #define STAFF_AP 9 #define STAFF_BP 65 #define DUALS_AP 11 #define DUALS_BP 50 typedef enum { SS_NONE = 0, SS_FAST, SS_MEDIUM, SS_STRONG, SS_DESANN, SS_TAVION, SS_DUAL, SS_STAFF, SS_SINGLE, SS_NUM_SABER_STYLES } saber_styles_t; int main() { // Change these as you wish bool bAttackerJumping = false; bool bAttackerCrouching = false; bool bAttackerBlocking = false; bool bAttackerInSpecialMove = false; bool bDefenderJumping = false; bool bDefenderAttacking = false; bool bDefenderKnockedDown = false; bool bDefenderCrouching = false; bool bDefenderBlocking = true; bool bDefenderSlapping = false; bool bDefenderInSpecialMove = false; int nDefenderDefenseLevel = 3; bool bIsInterrupt = false; bool bIsParry = false; bool bAttackerHasBodyHit = false; // This would only be true if you keep chaining float fAttackChainBonusMultiplier = 1.0f; int nAttackingPotential; int nBlockingPotential; float nBPsNeeded; float atkACMFactor; int nAttackerSaberStyle = SS_MEDIUM; int nDefenderSaberStyle = SS_MEDIUM; float AttackerACM; float DefenderACM; switch (nAttackerSaberStyle) { case SS_STAFF: nAttackingPotential = STAFF_AP; break; case SS_FAST: nAttackingPotential = FAST_AP; break; case SS_TAVION: nAttackingPotential = TAVION_AP; break; case SS_MEDIUM: nAttackingPotential = MEDIUM_AP; break; case SS_STRONG: nAttackingPotential = STRONG_AP; break; case SS_DESANN: nAttackingPotential = DESANN_AP; break; case SS_DUAL: nAttackingPotential = DUALS_AP; break; } switch (nDefenderSaberStyle) { case SS_STAFF: nBlockingPotential = STAFF_BP; break; case SS_FAST: nBlockingPotential = FAST_BP; break; case SS_TAVION: nBlockingPotential = TAVION_BP; break; case SS_MEDIUM: nBlockingPotential = MEDIUM_BP; break; case SS_STRONG: nBlockingPotential = STRONG_BP; break; case SS_DESANN: nBlockingPotential = DESANN_BP; break; case SS_DUAL: nBlockingPotential = DUALS_BP; break; } { //Mb2 magic says don't comment this out for Windows servers double Stage1 = (double)((double)nBlockingPotential / (double)nAttackingPotential); double Stage2 = 100.0f / Stage1; nBPsNeeded = (float)Stage2; }//Mb2 magic says don't comment this out for Windows servers // The attacker has just scored a bodyhit on the defender, let him benefit from any ACM he had previously gained against him. AttackerACM = 1.0f; // Also the defender should immediately start seeing whatever ACM he had against that attacker. DefenderACM = 1.0f; // Let the attacker benefit from this ACM against that defender (before it is increased due to the fact that we just scored a bodyhit, which is handled in WP_SaberDoBodyHit). fAttackChainBonusMultiplier = AttackerACM; //Add any attack chain bonus nBPsNeeded *= fAttackChainBonusMultiplier; if (bAttackerHasBodyHit) { // Reduce BP drains depending on stuff happening in chains (and not combos) nBPsNeeded *= 0.50f; } if (bDefenderInSpecialMove && !(bAttackerInSpecialMove)) { nBPsNeeded *= 0.50f; // Attacking someone in a special does reduced damage } if(bDefenderCrouching) { nBPsNeeded *= 1.25f;//2.0 // 2.0 is excessive } if(bAttackerCrouching) { nBPsNeeded /= 1.25f;//2.0 // 2.0 is excessive } if (bDefenderJumping) { nBPsNeeded *= 1.1f;//2.0 // 2.0 is excessive } if (bAttackerJumping) { nBPsNeeded *= 1.2f;//2.0 // 2.0 is excessive } if (bDefenderKnockedDown) nBPsNeeded *= 1.0f; if (bDefenderSlapping) nBPsNeeded *= 1.2f; if (!bIsParry) { // Don't take these into account for mutual parrying // Modifiers for defender based on attacking/movement/blocking //Catching someone at the start of their swing (interrupt) does more damage if (bIsInterrupt) { nBPsNeeded *= 1.2f; } else { if (bDefenderAttacking) { if (bDefenderBlocking) nBPsNeeded *= 1.1f; else nBPsNeeded *= 1.2f; } else { if (bDefenderBlocking) nBPsNeeded *= 1.0f; else nBPsNeeded *= 1.3f; } } } // Trying this method for now for def 1 if (nDefenderDefenseLevel == 1) nBPsNeeded *= 1.2f; // Overall swing drain nBPsNeeded *= 0.8f; std::cout << "Attacker's style: "; switch (nAttackerSaberStyle) { case SS_STAFF: std::cout << "Staff"; break; case SS_FAST: std::cout << "Blue"; break; case SS_TAVION: std::cout << "Cyan"; break; case SS_MEDIUM: std::cout << "Yellow"; break; case SS_STRONG: std::cout << "Red"; break; case SS_DESANN: std::cout << "Purple"; break; case SS_DUAL: std::cout << "Duals"; break; } std::cout << std::endl; std::cout << "Defender's style: "; switch (nDefenderSaberStyle) { case SS_STAFF: std::cout << "Staff"; break; case SS_FAST: std::cout << "Blue"; break; case SS_TAVION: std::cout << "Cyan"; break; case SS_MEDIUM: std::cout << "Yellow"; break; case SS_STRONG: std::cout << "Red"; break; case SS_DESANN: std::cout << "Purple"; break; case SS_DUAL: std::cout << "Duals"; break; } std::cout << std::endl; std::cout << "BP needed to block: " << nBPsNeeded << std::endl; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue