Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <vector>
- using namespace std;
- void char_create();
- void alive();
- void rest_explore();
- void battle();
- struct monster{
- int mon_health;
- int speed;
- int exp_drop;
- int mon_dmg;
- string rand_item;
- vector<string> item_drop_list;
- void rep_dmg(){
- mon_dmg = rand() % 15 + 3;
- }
- void bi_dmg(){
- mon_dmg = rand() % 7 + 1;
- }
- void hum_dmg(){
- mon_dmg = rand() % 10 + 2;
- }
- void hy_dmg(){
- mon_dmg = rand() % 20 + 10;
- }
- void mon_level(){
- mon_health += 10;
- }
- void item_drop(){
- int get_rand_item = rand() % 3 + 1;
- rand_item = item_drop_list[get_rand_item];
- }
- void reptile(){
- mon_health = 25;
- speed = 2;
- exp_drop = 35;
- item_drop_list.push_back("health potion");
- item_drop_list.push_back("battle axe");
- item_drop_list.push_back("heavy armor");
- //frequency = 30
- }
- void bird(){
- mon_health = 15;
- speed = 15;
- exp_drop = 15;
- item_drop_list.push_back("health potion");
- item_drop_list.push_back("dagger");
- item_drop_list.push_back("light armor");
- //frequency = 45
- }
- void humanoid(){
- mon_health = 20;
- speed = 10;
- exp_drop = 20;
- item_drop_list.push_back("health potion");
- item_drop_list.push_back("wooden staff");
- item_drop_list.push_back("arcane armor");
- //frequency = 20
- }
- void hybrid(){
- mon_health = 35;
- speed = 7;
- exp_drop = 55;
- item_drop_list.push_back("health potion");
- item_drop_list.push_back("health potionx2");
- item_drop_list.push_back("health potionx3");
- //frequency = 5
- }
- }mob;
- struct player{
- string class_race;
- int health;
- int max_health;
- int exp;
- int level;
- int dmg;
- void level_up(){
- health += 10;
- }
- void warrior_dmg(){
- dmg = rand() % 10 + 5;
- }
- void rouge_dmg(){
- int base = rand() % 5 + 1;
- int second_base = rand() % 5 + 1;
- int crit = 15;
- if (base == second_base){
- dmg = crit;
- }
- else{
- dmg = base;
- }
- }
- void mage_dmg(){
- dmg = rand() % 7 + 1;
- }
- void human_rouge(){
- string special_race_abil = "run if low health";
- string special_proff_abil = "avoid battles";
- health = 35;
- max_health = health;
- }
- void human_warrior(){
- string special_race_abil = "run if low health";
- string special_proff_abil = "heavy items";
- health = 55;
- max_health = health;
- }
- void human_mage(){
- string special_race_abil = "run if low health";
- string special_proff_abil = "magic";
- health = 40;
- max_health = health;
- }
- void orc_rouge(){
- string special_race_abil = "extra dmg";
- string special_proff_abil = "avoid battles";
- health = 35;
- max_health = health;
- }
- void orc_warrior(){
- string special_race_abil = "extra dmg";
- string special_proff_abil = "heavy items";
- health = 55;
- max_health = health;
- }
- void orc_mage(){
- string special_race_abil = "extra dmg";
- string special_proff_abil = "magic";
- health = 40;
- max_health = health;
- }
- void elf_rouge(){
- string extra_combo_abil = "always escape battles";
- string special_race_abil = "first attack";
- string special_proff_abil = "avoid battles";
- health = 55;
- max_health = health;
- }
- void elf_warrior(){
- string extra_combo_abil = "always escape battles";
- string special_proff_abil = "heavy items";
- health = 55;
- max_health = health;
- }
- void elf_mage(){
- string extra_combo_abil = "always escape battles";
- string special_proff_abil = "magic";
- health = 40;
- max_health = health;
- }
- }character;
- int main()
- {
- string reload;
- vector<string>::iterator i;
- srand(time(NULL));
- char_create();
- cout << "Character created successfully, work in progress." << endl;
- alive();
- cout << "You died. Reload a save?(y/n) ";
- cin >> reload;
- if (reload == "y"){
- cout << "Save not implemented yet.";
- }
- return 0;
- }
- void char_create(){
- string pick_race;
- string pick_class;
- cout << "Pick your race: ";
- cin >> pick_race;
- cout << "Pick your class: ";
- cin >> pick_class;
- string picked = pick_race+"_"+pick_class;
- if (picked == "human_rouge"){
- character.human_rouge();
- }
- else if (picked == "human_warrior"){
- character.human_warrior();
- }
- else if (picked == "human_mage"){
- character.human_mage();
- }
- else if (picked == "orc_rouge"){
- character.orc_rouge();
- }
- else if (picked == "orc_warrior"){
- character.orc_warrior();
- }
- else if (picked == "orc_mage"){
- character.orc_mage();
- }
- else if (picked == "elf_rouge"){
- character.elf_rouge();
- }
- else if (picked == "elf_warrior"){
- character.elf_warrior();
- }
- else if (picked == "elf_mage"){
- character.elf_mage();
- }
- };
- void rest_explore(){
- string action;
- int dot_count = 0;
- int dot_stop = 3;
- cout << "Type status to view some current stats about your character." << endl;
- cout << "What do you want to do? ";
- cin >> action;
- if (action == "rest"){
- for (dot_count = 0; dot_count <= dot_stop; dot_count++){
- cout << ". ";
- //time.sleep(1)
- }
- cout << "You awake feeling rested.";
- character.health += (character.max_health - character.health);
- rest_explore();
- }
- else if(action == "explore"){
- int fequ = rand() % 100 + 1;
- if(fequ < 11){
- //battle();
- cout << "Working on it." << endl;
- rest_explore();
- }
- else{
- //explore();
- cout << "Exploring not set up." << endl;
- rest_explore();
- }
- }
- else if(action == "battle"){
- //battle();
- cout << "Battle not implemented yet." << endl;
- rest_explore();
- }
- else if(action == "status"){
- cout << "Your health is " << character.health << "." << endl;
- //time.sleep(1);
- //cout << "Your inventory consists of " << character.inven << "." << endl;
- //time.sleep(1);
- cout << "You have " << character.exp << " experience points." << endl;
- cout << "You need " << 100 - character.exp << " more point(s) to level." << endl;
- //time.sleep(1)
- cout << "You are level " << character.level << "." << endl;
- //time.sleep(1);
- //cout << character.equips;
- rest_explore();
- }
- else if(action == "save"){
- //cout << "Your game is saved. Only one saved game is possible at a time." << endl;
- //save();
- cout << "Working on it." << endl;
- rest_explore();
- }
- else if(action == "equip"){
- //character.equip();
- cout << "Working on it." << endl;
- rest_explore();
- }
- else{
- cout << "Choose \'rest\', \'status\', \'explore\', \'save\', or \'battle\'." << endl;
- rest_explore();
- }
- }
- void alive(){
- rest_explore();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement