1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
// Base Stats
char pointSelection;
int skillPoints;
int charisma = 0;
int strength = 0;
int carry = 20 + (strength * 4); //unused as of right now
int gold;
int itemWorth[8] = {rand()% 25 + 150, rand()% 4 + 25,rand()% 18 +10 ,rand()% 100 + 90, rand()% 50 + 20, rand()% 5 + 5,rand()% 40 + 200, rand()% 2 + 1}; // unused as of right now
int exp;
int expRequire = 6;
int sellBonus = rand() %charisma * 3; // unused as of right now
int sellPrice;
//location stats
bool town;
//Game starts
cout<<"welcome to -insert test game name here-" << endl;
cout<<"pick up stuff and then sell it!"<<endl;
skillPoints = 5;
while (skillPoints > 0){
cout<<"please allocate your " << skillPoints << " skill points now" << endl;
cout<<"s for strength, c for charisma"<<endl;
cout<< "Strength is equal to "<< strength <<" and charisma is equal to "<< charisma<<endl;
cin>>pointSelection;
if (pointSelection == 'c'){
charisma++;
skillPoints--;
pointSelection = 0;
}
else if (pointSelection == 's'){
strength++;
skillPoints--;
pointSelection = 0;
}
else{
cout<<"invalid selection, please put only 'c' or 's'..."<<endl;
}
}
//EXP related stuff
if (exp >= expRequire){
skillPoints++;
exp = 0;
expRequire = expRequire * 3 / 2;
}
if (sellPrice/(25 * (charisma + strength - 4) >= 1 )){
exp = (exp + sellPrice/(25 * (charisma + strength - 4)));
}
//Basic Commands
bool play = 0; //temp core gameplay loop maintainer
while(play = 0){
char order;
char h,t,b,p,s,i; //p, s, and i are unused as of right now
cout<<"what would you like to do at this current moment?"<<endl;
cin>>order;
if(order = 'h'){
cout<< "h for help, t for traveling, b for banking, p to pick up an item off the ground, s for your stats, i for inventory."<<endl;
}
else if(order = t){
cout<<"are you sure you want to move forth? y for yes n for no."<<endl;
cin>>order;
if(order = 'y'){
//code for generating a new area empty as of right now due to it being 4 am
}
}
else if(order == 'b' && town == 1){
int deposit;
int score;
cout<< "money in retirement is" << score << "want to deposit?"<<endl;
cin>>order;
if (order = 'y'){
cout<<"how much shall you put away?" << endl;
cin>>deposit;
if(gold-deposit < 0){
cout << "invalid amount marked for transfer" <<endl;
}
else {
score = score + deposit;
gold = gold - deposit;
}
}
}
else{
cout<<"invalid order, type h for help"<<endl;
}
}
return 0;
}
|