|
|
@ -319,7 +319,7 @@ void genBackground(){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
char * genChar(char* output){ |
|
|
|
size_t genChar(char* output, size_t maxlen){ |
|
|
|
profs = 0; |
|
|
|
profs = 0; |
|
|
|
languages = 0; |
|
|
|
languages = 0; |
|
|
|
for(int i = 0; i <= 100; i++){ |
|
|
|
for(int i = 0; i <= 100; i++){ |
|
|
@ -333,113 +333,113 @@ char * genChar(char* output){ |
|
|
|
stats[i] = dieroll(3,6); |
|
|
|
stats[i] = dieroll(3,6); |
|
|
|
mods[i] = floor((stats[i]/2)-5); |
|
|
|
mods[i] = floor((stats[i]/2)-5); |
|
|
|
} |
|
|
|
} |
|
|
|
snprintf(output, 512, "Race = %s\r\nBackground = %s\r\nClass = %s\r\nStr = %d %d\r\nDex = %d %d\r\nCon = %d %d\r\nInt = %d %d\r\nWis = %d %d\r\nCha = %d %d\r\n\r\nHP: %d\r\n", race, background, class, stats[STR], mods[STR], stats[DEX], mods[DEX], stats[CON], mods[CON], stats[INT], mods[INT], stats[WIS], mods[WIS], stats[CHA], mods[CHA], hp); |
|
|
|
snprintf(output, maxlen, "Race = %s\r\nBackground = %s\r\nClass = %s\r\nStr = %d %d\r\nDex = %d %d\r\nCon = %d %d\r\nInt = %d %d\r\nWis = %d %d\r\nCha = %d %d\r\n\r\nHP: %d\r\n", race, background, class, stats[STR], mods[STR], stats[DEX], mods[DEX], stats[CON], mods[CON], stats[INT], mods[INT], stats[WIS], mods[WIS], stats[CHA], mods[CHA], hp); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(output,"Proficiences:\r\n",512); |
|
|
|
strlcat(output,"Proficiences:\r\n",maxlen); |
|
|
|
if((ATHLETICS & profs) != 0){ |
|
|
|
if((ATHLETICS & profs) != 0){ |
|
|
|
strlcat(output,"Athletics\r\n",512); |
|
|
|
strlcat(output,"Athletics\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((ACROBATICS & profs) != 0){ |
|
|
|
if((ACROBATICS & profs) != 0){ |
|
|
|
strlcat(output,"Acrobatics\r\n",512); |
|
|
|
strlcat(output,"Acrobatics\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((SLEIGHTOFHAND & profs) != 0){ |
|
|
|
if((SLEIGHTOFHAND & profs) != 0){ |
|
|
|
strlcat(output,"Sleight of Hand\r\n",512); |
|
|
|
strlcat(output,"Sleight of Hand\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((STEALTH & profs) != 0){ |
|
|
|
if((STEALTH & profs) != 0){ |
|
|
|
strlcat(output,"Stealth\r\n",512); |
|
|
|
strlcat(output,"Stealth\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((ARCANA & profs) != 0){ |
|
|
|
if((ARCANA & profs) != 0){ |
|
|
|
strlcat(output,"Arcana\r\n",512); |
|
|
|
strlcat(output,"Arcana\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((HISTORY & profs) != 0){ |
|
|
|
if((HISTORY & profs) != 0){ |
|
|
|
strlcat(output,"History\r\n",512); |
|
|
|
strlcat(output,"History\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((INVESTIGATION & profs) != 0){ |
|
|
|
if((INVESTIGATION & profs) != 0){ |
|
|
|
strlcat(output,"Investigation\r\n",512); |
|
|
|
strlcat(output,"Investigation\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((NATURE & profs) != 0){ |
|
|
|
if((NATURE & profs) != 0){ |
|
|
|
strlcat(output,"Nature\r\n",512); |
|
|
|
strlcat(output,"Nature\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((RELIGION & profs) != 0){ |
|
|
|
if((RELIGION & profs) != 0){ |
|
|
|
strlcat(output,"Regligion\r\n",512); |
|
|
|
strlcat(output,"Regligion\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((ANIMALHANDLING & profs) != 0){ |
|
|
|
if((ANIMALHANDLING & profs) != 0){ |
|
|
|
strlcat(output,"Animal Handling\r\n",512); |
|
|
|
strlcat(output,"Animal Handling\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((INSIGHT & profs) != 0){ |
|
|
|
if((INSIGHT & profs) != 0){ |
|
|
|
strlcat(output,"Insight\r\n",512); |
|
|
|
strlcat(output,"Insight\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((MEDICINE & profs) != 0){ |
|
|
|
if((MEDICINE & profs) != 0){ |
|
|
|
strlcat(output,"Medicine\r\n",512); |
|
|
|
strlcat(output,"Medicine\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((PERCEPTION & profs) != 0){ |
|
|
|
if((PERCEPTION & profs) != 0){ |
|
|
|
strlcat(output,"Perception\r\n",512); |
|
|
|
strlcat(output,"Perception\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((SURVIVAL & profs) != 0){ |
|
|
|
if((SURVIVAL & profs) != 0){ |
|
|
|
strlcat(output,"Survival\r\n",512); |
|
|
|
strlcat(output,"Survival\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((DECEPTION & profs) != 0){ |
|
|
|
if((DECEPTION & profs) != 0){ |
|
|
|
strlcat(output,"Deception\r\n",512); |
|
|
|
strlcat(output,"Deception\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((INTIMIDATION & profs) != 0){ |
|
|
|
if((INTIMIDATION & profs) != 0){ |
|
|
|
strlcat(output,"Intimidation\r\n",512); |
|
|
|
strlcat(output,"Intimidation\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((PERFORMANCE & profs) != 0){ |
|
|
|
if((PERFORMANCE & profs) != 0){ |
|
|
|
strlcat(output,"Performance\r\n",512); |
|
|
|
strlcat(output,"Performance\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((PERSUASION & profs) != 0){ |
|
|
|
if((PERSUASION & profs) != 0){ |
|
|
|
strlcat(output,"Persuaion\r\n",512); |
|
|
|
strlcat(output,"Persuaion\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
strlcat(output,"\r\nLanguages:\r\nCommon\r\n",512); |
|
|
|
strlcat(output,"\r\nLanguages:\r\nCommon\r\n",maxlen); |
|
|
|
if((ABYSSAL & languages) != 0){ |
|
|
|
if((ABYSSAL & languages) != 0){ |
|
|
|
strlcat(output,"Abyssal\r\n",512); |
|
|
|
strlcat(output,"Abyssal\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((CELESTIAL & languages) != 0){ |
|
|
|
if((CELESTIAL & languages) != 0){ |
|
|
|
strlcat(output,"Celestial\r\n",512); |
|
|
|
strlcat(output,"Celestial\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((DRACONIC & languages) != 0){ |
|
|
|
if((DRACONIC & languages) != 0){ |
|
|
|
strlcat(output,"Draconic\r\n",512); |
|
|
|
strlcat(output,"Draconic\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((DEEPSPEECH & languages) != 0){ |
|
|
|
if((DEEPSPEECH & languages) != 0){ |
|
|
|
strlcat(output,"Deep Speech\r\n",512); |
|
|
|
strlcat(output,"Deep Speech\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((INFERNAL & languages) != 0){ |
|
|
|
if((INFERNAL & languages) != 0){ |
|
|
|
strlcat(output,"Infernal\r\n",512); |
|
|
|
strlcat(output,"Infernal\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((PRIMORDIAL & languages) != 0){ |
|
|
|
if((PRIMORDIAL & languages) != 0){ |
|
|
|
strlcat(output,"Primordial\r\n",512); |
|
|
|
strlcat(output,"Primordial\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((SYLVAN & languages) != 0){ |
|
|
|
if((SYLVAN & languages) != 0){ |
|
|
|
strlcat(output,"Sylvan\r\n",512); |
|
|
|
strlcat(output,"Sylvan\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((UNDERCOMMON & languages) != 0){ |
|
|
|
if((UNDERCOMMON & languages) != 0){ |
|
|
|
strlcat(output,"Undercommon\r\n",512); |
|
|
|
strlcat(output,"Undercommon\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((DWARVISH & languages) != 0){ |
|
|
|
if((DWARVISH & languages) != 0){ |
|
|
|
strlcat(output,"Dwarvish\r\n",512); |
|
|
|
strlcat(output,"Dwarvish\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((ELVISH & languages) != 0){ |
|
|
|
if((ELVISH & languages) != 0){ |
|
|
|
strlcat(output,"Elvish\r\n",512); |
|
|
|
strlcat(output,"Elvish\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((GIANT & languages) != 0){ |
|
|
|
if((GIANT & languages) != 0){ |
|
|
|
strlcat(output,"Giant\r\n",512); |
|
|
|
strlcat(output,"Giant\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((GNOMISH & languages) != 0){ |
|
|
|
if((GNOMISH & languages) != 0){ |
|
|
|
strlcat(output,"Gnome\r\n",512); |
|
|
|
strlcat(output,"Gnome\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((GOBLIN & languages) != 0){ |
|
|
|
if((GOBLIN & languages) != 0){ |
|
|
|
strlcat(output,"Goblin\r\n",512); |
|
|
|
strlcat(output,"Goblin\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((HALFLISH & languages) != 0){ |
|
|
|
if((HALFLISH & languages) != 0){ |
|
|
|
strlcat(output,"Halfling\r\n",512); |
|
|
|
strlcat(output,"Halfling\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
if((ORC & languages) != 0){ |
|
|
|
if((ORC & languages) != 0){ |
|
|
|
strlcat(output,"Orcish\r\n",512); |
|
|
|
strlcat(output,"Orcish\r\n",maxlen); |
|
|
|
} |
|
|
|
} |
|
|
|
strlcat(output,"\r\nOther Profs: ",512); |
|
|
|
strlcat(output,"\r\nOther Profs: ",maxlen); |
|
|
|
strlcat(output,otherprofs,512); |
|
|
|
strlcat(output,otherprofs,maxlen); |
|
|
|
strlcat(output,"\r\n",512); |
|
|
|
strlcat(output,"\r\n",maxlen); |
|
|
|
return output; |
|
|
|
return strlen(output); |
|
|
|
} |
|
|
|
} |
|
|
|