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
|
/*
* RPGDEFINE.h
* TheAmazingJourney
*
* Created by Nicky on 5/3/13.
* Copyright 2013 SaltPepper. All rights reserved.
*
*/
//=================================
// include guard
#ifndef __RPGDEFINE_H_INCLUDED__
#define __RPGDEFINE_H_INCLUDED__
//=================================
// forward declared dependencies
//=================================
// included dependencies
//=================================
// the actual class
#define MAX_STATUS 10
#include <cstdlib>
enum race_t{ELF, DWARF, HALFLING, HUMAN, HALF_ELF};
enum condition_t {HEALTHY, POISONED, WITHER, CLUMSY};
enum magetype_t {FIRE, WATER, EARTH, AIR, DEATH, LIGHT};
enum potion_t{STRONG, FAST, POISON, INSTANTKILL, MAGICAL};
enum weapon_t {SHORT_SWORD, LONG_SWORD, DAGGER, BOW, CROSSBOW, STAFF, WAND};
enum enchantments_t{POISONS, BURN, LIGHTNING, WITHERING, ONEHITKILL, AIRCHANT, NONE};
enum status_t {MELEE, RANGED, WIZARD};
enum weight_t {FEATHER, MEDIUM, HEAVY};
using namespace std;
#include <fstream>
class Player{
public:
int MAG;
int STR;
int DEX;
race_t RACE;
potion_t POTIONEFFECTS;
condition_t STATUS;
magetype_t MAGESTATUS;
weapon_t WEAPON;
int LEVEL;
int WEAPONLEVEL;
enchantments_t ENCHANTMENTS;
status_t TYPE;
int WEAPON_INT;
int ENCHANT_INT;
static void Player::SET_DEFAULTS(Player who){
who.STR = rand()%7+1;
who.DEX = rand()%7+1;
who.MAG = rand()%7+1;
who.LEVEL = rand()%7+1;
who.WEAPONLEVEL = rand()%5+1;
who.STATUS = HEALTHY;
if(who.STR<4) who.STR++;
if(who.MAG<4) who.MAG++;
if(who.DEX<4) who.DEX++;
if(who.LEVEL<4) who.LEVEL++;
if(who.WEAPONLEVEL<4) who.WEAPONLEVEL++;
};
static void Player::SET_ELF(Player& who){
if(who.STR < MAX_STATUS&&who.STR >= 2)who.STR--;
if(who.DEX + 2 < MAX_STATUS)who.DEX+=2;
if(who.MAG + 1 < MAX_STATUS)who.MAG++;
if(who.LEVEL < MAX_STATUS)who.LEVEL--;
if(who.WEAPONLEVEL < MAX_STATUS)who.WEAPONLEVEL--;
who.WEAPON_INT = rand()%4+1;
if (who.WEAPON_INT == 1) who.WEAPON = LONG_SWORD;
else if (who.WEAPON_INT == 2 || 3) who.WEAPON = BOW;
else if (who.WEAPON_INT == 4) who.WEAPON = STAFF;
};
static void Player::SET_DWARF(Player &who){
if(who.STR < MAX_STATUS)who.STR++;
if(who.DEX < MAX_STATUS)who.DEX--;
if(who.MAG < MAX_STATUS)who.MAG-=2;
if(who.WEAPONLEVEL < MAX_STATUS)who.WEAPONLEVEL+= 2;
};
static void Player::SET_HALFLING(Player &who){
if(who.STR < MAX_STATUS)who.STR--;
if(who.DEX < MAX_STATUS)who.DEX+=2;
if(who.MAG < MAX_STATUS)who.MAG++;
if(who.LEVEL < MAX_STATUS)who.LEVEL--;
if(who.WEAPONLEVEL < MAX_STATUS)who.WEAPONLEVEL--;
};
static void Player::SET_HUMAN(Player& who){
};
static void Player::SET_HALF_ELF(Player& who){
if(who.STR < MAX_STATUS)who.STR--;
if(who.DEX < MAX_STATUS)who.DEX++;
};
};
#endif // __MYCLASS_H_INCLUDED__
|