Skip to content
This repository was archived by the owner on Jun 12, 2025. It is now read-only.

Commit f963062

Browse files
GamerMan7799GamerMan7799
authored andcommitted
Merge pull request #29 from GamerMan7799/dev
Update Master to V1.1c
2 parents 5548193 + 4de5a0b commit f963062

5 files changed

Lines changed: 439 additions & 385 deletions

File tree

basic.h

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/*
55
Made By: Patrick J. Rye
66
Purpose: A header to hold functions that are pretty basic and likely won't change very often or at all.
7-
Current Revision: 1.0.1
7+
Current Revision: 1.0.2
88
Change Log---------------------------------------------------------------------------------------------------------------------------------------------------
99
Date Revision Changed By Changes
1010
------ --------- ------------ ---------------------------------------------------------------------------------------------------------------------
@@ -22,7 +22,9 @@ Date Revision Changed By Changes
2222
-Added function which returns string name of element
2323
-Added function which returns string name of status
2424
=============================================================================================================================================================
25-
25+
2015/03/17 1.0.2 Patrick Rye -Added key amount to stat
26+
-Grammar & spelling fixes.
27+
=============================================================================================================================================================
2628
*/
2729

2830
/*********************************************************************************************************/
@@ -53,7 +55,7 @@ const std::string WinningMessage[6] = {"__ __ _ _ _ _ _ \n
5355
" \\_/\\___/ \\__,_| \\/ \\/|_|_| |_(_|_)\n"};
5456

5557
/*********************************************************************************************************/
56-
enum effects
58+
enum effectsplacement
5759
{
5860
effectNone = 0,
5961
effectBlinded,
@@ -65,7 +67,7 @@ enum effects
6567
effectConfused,
6668
};
6769

68-
enum stats
70+
enum statsplacement
6971
{
7072
statStr = 0,
7173
statCons,
@@ -76,10 +78,13 @@ enum stats
7678
statMaxHealth,
7779
statStatus,
7880
statStatusCounter,
79-
statElement
81+
statKeys,
82+
statCurrMana,
83+
statMaxMana,
84+
statElement,
8085
};
8186

82-
enum elements
87+
enum elementsplacement
8388
{
8489
elementLight = 0,
8590
elementWind,
@@ -103,6 +108,16 @@ enum spelltypes
103108

104109
using namespace std;
105110

111+
unsigned int CalculateHealth(unsigned char HealthLevel, unsigned char ConsStat)
112+
{
113+
//A simple function for calculating health.
114+
//In its own function so future changes will be changed everywhere.
115+
float HealthTemp = 0;
116+
HealthTemp = (0.9722 * pow(HealthLevel, 2) )+( 0.4167 * HealthLevel) + 48.611;
117+
HealthTemp += 23.979*exp(0.01414 * ConsStat);
118+
return floor(HealthTemp);
119+
}
120+
106121
string StatusName(unsigned char effect)
107122
{
108123
switch (effect)
@@ -174,8 +189,16 @@ float ElementMulti(unsigned char AttackingElement, unsigned char DefendingElemen
174189
{
175190
/*The further away two elements are the more damage that they do to each other.
176191
For example a fire attack on an ice monster will be 125% damage, while a fire
177-
attack on fire monster will only do 75% damage. 2 Spaces away will do normal damage
178-
And None elements or physical do normal damage as well.*/
192+
attack on fire monster will only do 75% damage. 2 spaces away will do normal damage
193+
And none elements or physical do normal damage as well.*/
194+
195+
/*
196+
Light
197+
Energy Wind
198+
Fire Ice
199+
Earth Water
200+
Darkness
201+
*/
179202
if (AttackingElement == elementNone || DefendingElement == elementNone) {return 1.0;}
180203
if (AttackingElement == elementPhysical || DefendingElement == elementPhysical) {return 1.0;}
181204
switch (abs(AttackingElement - DefendingElement))
@@ -235,7 +258,7 @@ string HitName()
235258
return "hit";
236259
}
237260

238-
bool StunCheck(unsigned char intAttackerLuck, unsigned char intDefenderLuck)
261+
inline bool StunCheck(unsigned char intAttackerLuck, unsigned char intDefenderLuck)
239262
{
240263
if (intDefenderLuck < intAttackerLuck) {if(rand()% 101 < (intAttackerLuck - intDefenderLuck) / 3) {return true;}}
241264
return false;
@@ -296,7 +319,7 @@ string EndOfEffectString(std::string Target, unsigned char Effect)
296319
return "Your bleeding wounds begin to close.";
297320
break;
298321
case effectConfused :
299-
return "Your head is now clear.";
322+
return "Your head begins to clear.";
300323
break;
301324
case effectNone :
302325
default :

0 commit comments

Comments
 (0)