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>
- using namespace std;
- void char_create();
- struct monster{
- int mon_health;
- int speed;
- int exp_drop;
- int mon_dmg;
- 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 reptile(){
- mon_health = 25;
- speed = 2;
- exp_drop = 35;
- //frequency = 30
- }
- void bird(){
- mon_health = 15;
- speed = 15;
- exp_drop = 15;
- //frequency = 45
- }
- void humanoid(){
- mon_health = 20;
- speed = 10;
- exp_drop = 20;
- //frequency = 20
- }
- void hybrid(){
- mon_health = 35;
- speed = 7;
- exp_drop = 55;
- //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()
- {
- srand(time(NULL));
- char_create();
- cout << "Character created successfully, work in progress.";
- return 0;
- cout << "Ben is jealous.";
- }
- 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();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement