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

Commit 09c12f2

Browse files
GamerMan7799GamerMan7799
authored andcommitted
Merge pull request #35 from GamerMan7799/dev
Update Master to V1.4c
2 parents e0a21e4 + 085203f commit 09c12f2

File tree

6 files changed

+192
-122
lines changed

6 files changed

+192
-122
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You must go through 10 randomly generated dungeons fighting monsters along the w
2121

2222
During each battle you may 'Attack' in which case you and the monster both trade blows. You can 'Heal' for 10% of you maxmium health and the monster does less damage or exit the game.
2323

24-
On each level you are trying to get the the down stairs which is represented by "<". While the player is a "@". Doors are "$" currently they don't do anything special, but that will likely change in a furture verison.
24+
On each level you are trying to get the the down stairs which is represented by "<". While the player is a "@". Doors are "$" & "!" "$" doors are unlocked and can just be walked through. "!" howvere are locked. You can currently try to break down the door if your strength is greater than 60, pick the lock if your Luck is greater than 60. Or you can use keys which can be found after defeating some monsters.
2525

2626
Like I said there is not a lot to the game as of right now but that is partly why I'm putting the game here so I can get feedback and ideas on how to improve the game.
2727

basic.h

Lines changed: 6 additions & 4 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.3
7+
Current Revision: 2.0
88
Change Log---------------------------------------------------------------------------------------------------------------------------------------------------
99
Date Revision Changed By Changes
1010
------ --------- ------------ ---------------------------------------------------------------------------------------------------------------------
@@ -24,7 +24,9 @@ Date Revision Changed By Changes
2424
=============================================================================================================================================================
2525
2015/03/17 1.0.2 Patrick Rye -Added key amount to stat
2626
-Grammar & spelling fixes.
27-
=============================================================================================================================================================
27+
=============================================================================================================================================================
28+
2015/07/07 2.0 Patrick Rye -Changed cout to printf.
29+
=============================================================================================================================================================
2830
*/
2931

3032
/*********************************************************************************************************/
@@ -501,8 +503,8 @@ char CharConvertToUpper(char chrCheck)
501503
return converted;
502504
}
503505

504-
inline void ShowOpeningMessage() {for (unsigned char i = 0; i < 16; i++){cout<<OpeningMessage[i];}}
506+
inline void ShowOpeningMessage() {for (unsigned char i = 0; i < 16; i++){printf("%s",OpeningMessage[i].c_str());}}
505507

506-
inline void ShowWinningMessage() {for (unsigned char i = 0; i < 6; i++) {cout<<WinningMessage[i];}}
508+
inline void ShowWinningMessage() {for (unsigned char i = 0; i < 6; i++) {printf("%s",WinningMessage[i].c_str());}}
507509

508510
#endif //If header was already called load nothing

battle.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
Made By: Patrick J. Rye
55
Purpose: A header to hold all the functions related to battling, levelling up and player stats.
6-
Current Revision: 1.1.2
6+
Current Revision: 1.1.3
77
Change Log---------------------------------------------------------------------------------------------------------------------------------------------------
88
Date Revision Changed By Changes
99
------ --------- ------------ ---------------------------------------------------------------------------------------------------------------------
@@ -32,6 +32,8 @@ Date Revision Changed By Changes
3232
=============================================================================================================================================================
3333
2015/04/17 1.1.2 Patrick Rye -Added more comments
3434
-Added ability to get monster name.
35+
=============================================================================================================================================================
36+
2015/04/25 1.1.3 Patrick Rye -Fixed some small bugs.
3537
=============================================================================================================================================================
3638
*/
3739
/*********************************************************************************************************/
@@ -884,6 +886,7 @@ char PlayerInitialize()
884886
cout<<"Defence (DEF) - Effects how much damage you take."<<endl;
885887
cout<<"Luck (LUK) - The random chance things will go your way, with dodges, crits, and rare modifiers that appear on monsters."<<endl;
886888
unsigned char intSkillPointsLeft = 100;
889+
StatsGoto:
887890
cout<<"You have "<< (int)intSkillPointsLeft <<" points to spend however you desire on these five stats, however each stat must have at least 1 point."<<endl;
888891
do
889892
{
@@ -896,6 +899,11 @@ char PlayerInitialize()
896899
}
897900
intStr = floor(intStr);
898901
}while (intStr < 1);
902+
if (intStr >= intSkillPointsLeft)
903+
{
904+
cout<<"\nYou used too many points please try again!\n";
905+
goto StatsGoto;
906+
}
899907
intSkillPointsLeft -= intStr;
900908
//A check to see if they put too many points into a stat
901909
//Since each stat must have at least 1 point
@@ -916,6 +924,11 @@ char PlayerInitialize()
916924
}
917925
intCons = floor(intCons);
918926
}while (intCons <1);
927+
if (intCons >= intSkillPointsLeft)
928+
{
929+
cout<<"\nYou used too many points please try again!\n";
930+
goto StatsGoto;
931+
}
919932
intSkillPointsLeft -= intCons;
920933
if(intSkillPointsLeft < 3)
921934
{
@@ -934,6 +947,11 @@ char PlayerInitialize()
934947
}
935948
intDef = floor(intDef);
936949
}while (intDef <1);
950+
if (intDef >= intSkillPointsLeft)
951+
{
952+
cout<<"\nYou used too many points please try again!\n";
953+
goto StatsGoto;
954+
}
937955
intSkillPointsLeft -= intDef;
938956
if(intSkillPointsLeft < 2)
939957
{
@@ -952,6 +970,11 @@ char PlayerInitialize()
952970
}
953971
intDex = floor(intDex);
954972
}while (intDex < 1);
973+
if (intDex >= intSkillPointsLeft)
974+
{
975+
cout<<"\nYou used too many points please try again!\n";
976+
goto StatsGoto;
977+
}
955978
intSkillPointsLeft -= intDex;
956979
if(intSkillPointsLeft < 1)
957980
{

main.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Made By: Patrick J. Rye
33
Purpose: A game I made as an attempt to teach myself c++, just super basic, but going to try to keep improving it as my knowledge increases.
4-
Current Revision: 1.2c
4+
Current Revision: 1.4c
55
Change Log---------------------------------------------------------------------------------------------------------------------------------------------------
66
Date Revision Changed By Changes
77
------ --------- ------------ ---------------------------------------------------------------------------------------------------------------------
@@ -21,6 +21,12 @@ Date Revision Changed By Changes
2121
-Implemented mana system.
2222
=============================================================================================================================================================
2323
2015/03/18 1.2c Patrick Rye -Removed unneeded libraries.
24+
=============================================================================================================================================================
25+
2015/04/25 1.3c Patrick Rye -Attempted to correct my misunderstanding of how headers work, broke everything had to revert back.
26+
-Keeping record of attempt for future reference
27+
=============================================================================================================================================================
28+
2015/07/06 1.4c Patrick Rye -Added locked doors.
29+
-Added Keys which can be found randomly on some monsters
2430
=============================================================================================================================================================
2531
*/
2632

@@ -44,7 +50,7 @@ Dungeon d; //Define the dungeon class as 'd' so I can use functions in there any
4450
unsigned char intMainLevel = 1; //The level of the dungeon.
4551
unsigned char intLevelStart = 1; //The level that the game starts at. Will be 1 unless loading from a save.
4652
bool blDebugMode = false; //If game is in debug mode or not, effects if player has access to debug commands.
47-
const string CurrentVerison = "1.2c"; //The current version of this program, stored in a save file later on.
53+
const string CurrentVerison = "1.4c"; //The current version of this program, stored in a save file later on.
4854
/*********************************************************************************************************/
4955
//These functions have to be up here as functions in save.h use them.
5056
//These values are used to pass values to the save header so that they may be saved.

0 commit comments

Comments
 (0)