Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include "playerAttack.h"
int playerAttackDamage(int weaponDamage, int hit){
if (hit=0)
{
erase();
mvprintw(LINES/2,(COLS-strlen("Your attack missed!"))/2,"%s", "Your attack missed!");
refresh();
int damageDealt = 0;
return damageDealt;
}
else if (hit=1)
{
erase();
mvprintw(LINES/2,(COLS-strlen(("Your attack hits! It did " + to_string(weaponDamage) + " damage!").c_str()))/2,"%s", ("Your attack hits! It did " + to_string(weaponDamage) + " damage!").c_str());
refresh();
int damageDealt = weaponDamage;
return damageDealt;
}
else if (hit=2){
erase();
mvprintw(LINES/2,(COLS-strlen(("Your attack hits! And it hit HARD! It did " + to_string(weaponDamage) + " damage!").c_str()))/2,"%s", ("Your attack hits! And it hit HARD! It did " + to_string(weaponDamage) + " damage!").c_str());
refresh();
int damageDealt = weaponDamage*2;
return damageDealt;
}
}