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
#ifndef RUN_H
#define RUN_H
#include <iostream>
#include <ncurses.h>
#include <chrono>
#include <thread>
#include "random.h"
#include "fight.h"
using namespace std;
void run(int strength, int speed, int HP,int monsterStrength, int monsterSpeed,
int monsterHP, string monsterName, string monsterDescriptions) {
initscr();
noecho();
int y=3,x=20;
mvprintw(y,x, ("You tighten the sails and row frantically to avoid the " + monsterName + ".").c_str());
y+=1;
if(randomNum(0, monsterSpeed)>randomNum(0, speed)){
mvprintw(y,x, ("The " + monsterName + " caught up, you must fight!").c_str());
y+=1;
mvprintw(y,x, "Press c to continue!");
y+=1;
refresh();
char cont='s';
while(cont!='c' && cont!='C'){
cont=getch();
}
erase();
fight(strength,speed,HP,monsterStrength,monsterSpeed,monsterHP,
monsterName, monsterDescriptions);
}else{
mvprintw(y,x, ("You out run the " + monsterName + ". You are safe for now.").c_str());
y+=1;
refresh();
std::this_thread::sleep_for (std::chrono::seconds(3));
}
endwin();
}
#endif