Version 0.0.3 Commit
This commit is contained in:
@@ -5,19 +5,21 @@ A silly game inspired by [Hunt The Wumpus](https://en.wikipedia.org/wiki/Hunt_th
|
||||
## Gameplay Mechanics
|
||||
* The cave system is a [dodecahedron](https://en.wikipedia.org/wiki/File:Hunt_the_Wumpus_map.svg) as in Hunt The Wumpus.
|
||||
* Every 3 turns, The Muppet randomly moves to a cave nearby.
|
||||
* You have 5 arrows that only fire into bordering caves.
|
||||
* You have a 50% chance of dying when you encounter The Muppet.
|
||||
* Every move depletes 1 supply out of the starting 20 supplies.
|
||||
* You can camp and consume 1 supply rather than shooting or moving.
|
||||
* There is 2 Maltego and 2 Ankle Bitter hazards.
|
||||
* There is 2 Maltego and 2 Ankle Biter hazards.
|
||||
* The Maltego hazard randomly teleports the player to a location that doesn't have a Muppet. It is possible to be teleported to another Maltego hazard...
|
||||
* The Ankle Bitter hazard steals between 1 to 5 of your supplies.
|
||||
* The Ankle Biter hazard steals between 1 to 5 of your supplies.
|
||||
* The Muppet is immune to hazards.
|
||||
* There is 2 caves that have a cache of supplies between 1 to 5
|
||||
|
||||
## Build Info
|
||||
This is fully coded and compiled using [Open Watcom 1.9 C++ Compiler](www.openwatcom.org/). Output build is a 16-bit MSDOS COM Executable. Game is designed to be run on [DosBox](https://dosbox.com) or any DOS compatible setup. I used [DosBox-X](https://dosbox-x.com) for development and highly recommend it.
|
||||
|
||||
## TODO
|
||||
* Add Neural Network to The Muppet so it actively hunts and learns from player.
|
||||
* ~~Add Neural Network to The Muppet so it actively hunts and learns from player.~~ UPDATE: This would make the game too easy, as all you would have to do is back up to the previous cave, and fire an arrow to win the game. The randomness of the current AI with remembering the last cave so it does not go backwards, appears to be the most optimal.
|
||||
* DosBox Launcher
|
||||
|
||||
## License
|
||||
|
||||
+2
-15
@@ -11,8 +11,6 @@
|
||||
#include <time.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
//#define DEBUG
|
||||
|
||||
class RC4 {
|
||||
public:
|
||||
RC4(char *seed, int len);
|
||||
@@ -56,16 +54,13 @@ class Room {
|
||||
public:
|
||||
int ID;
|
||||
Room *rooms[3];
|
||||
bool hasAnkleBitters;
|
||||
bool hasAnkleBiters;
|
||||
bool hasMaltego;
|
||||
bool hasSupplies;
|
||||
|
||||
|
||||
Room(int id);
|
||||
void setRooms(Room *r1, Room *r2, Room *r3);
|
||||
~Room();
|
||||
#ifdef DEBUG
|
||||
void debug();
|
||||
#endif
|
||||
};
|
||||
|
||||
class Player {
|
||||
@@ -76,11 +71,7 @@ class Player {
|
||||
int supplies;
|
||||
|
||||
Player(Room *location);
|
||||
~Player();
|
||||
void doActions();
|
||||
#ifdef DEBUG
|
||||
void debug();
|
||||
#endif
|
||||
};
|
||||
|
||||
class Muppet {
|
||||
@@ -92,10 +83,6 @@ class Muppet {
|
||||
Muppet(Room *location, RC4 *Rand);
|
||||
void doActions();
|
||||
void runAway();
|
||||
~Muppet();
|
||||
#ifdef DEBUG
|
||||
void debug();
|
||||
#endif
|
||||
private:
|
||||
RC4 *Rand;
|
||||
int prev_loc;
|
||||
|
||||
@@ -44,12 +44,3 @@ rr: randRoom = (this->Rand->rand()%3);
|
||||
this->prev_loc = this->location->ID;
|
||||
this->location = this->location->rooms[randRoom];
|
||||
}
|
||||
|
||||
Muppet::~Muppet() {
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void Muppet::debug() {
|
||||
printf("Muppet Location #%d moveCounter %d hasDied %d\n", this->location->ID, this->moveCounter, this->hasDied);
|
||||
}
|
||||
#endif
|
||||
|
||||
+21
-7
@@ -68,8 +68,8 @@ bool startGame(VGA256Term *Term, RC4 *Rand) {
|
||||
x=2;
|
||||
while(x > 0) {
|
||||
randint = getRandomRoom(Rand);
|
||||
if(!rooms[randint]->hasAnkleBitters && !rooms[randint]->hasMaltego) {
|
||||
rooms[randint]->hasAnkleBitters = true;
|
||||
if(!rooms[randint]->hasAnkleBiters && !rooms[randint]->hasMaltego) {
|
||||
rooms[randint]->hasAnkleBiters = true;
|
||||
x -= 1;
|
||||
}
|
||||
}
|
||||
@@ -78,11 +78,21 @@ bool startGame(VGA256Term *Term, RC4 *Rand) {
|
||||
x=2;
|
||||
while(x > 0) {
|
||||
randint = getRandomRoom(Rand);
|
||||
if(!rooms[randint]->hasAnkleBitters && !rooms[randint]->hasMaltego) {
|
||||
if(!rooms[randint]->hasAnkleBiters && !rooms[randint]->hasMaltego) {
|
||||
rooms[randint]->hasMaltego = true;
|
||||
x -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Add Supplies
|
||||
x=2;
|
||||
while(x > 0) {
|
||||
randint = getRandomRoom(Rand);
|
||||
if(!rooms[randint]->hasSupplies && !rooms[randint]->hasSupplies) {
|
||||
rooms[randint]->hasSupplies = true;
|
||||
x -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
Player *Neal = new Player(rooms[0]);
|
||||
|
||||
@@ -92,9 +102,9 @@ bool startGame(VGA256Term *Term, RC4 *Rand) {
|
||||
Term->printf_term("You hear the Squeal of a Muppet!\n");
|
||||
if(Neal->location->rooms[0]->hasMaltego || Neal->location->rooms[1]->hasMaltego || Neal->location->rooms[2]->hasMaltego)
|
||||
Term->printf_term("You are blinded by rainbow orbs!\n");
|
||||
if(Neal->location->rooms[0]->hasAnkleBitters || Neal->location->rooms[1]->hasAnkleBitters || Neal->location->rooms[2]->hasAnkleBitters)
|
||||
if(Neal->location->rooms[0]->hasAnkleBiters || Neal->location->rooms[1]->hasAnkleBiters || Neal->location->rooms[2]->hasAnkleBiters)
|
||||
Term->printf_term("You clutch your supplies nervously...\n");
|
||||
Term->printf_term("Muppet Location #%\n", Cody->location->ID);
|
||||
//Term->printf_term("Muppet Location #%\n", Cody->location->ID);
|
||||
Term->printf_term("[M]ove [W]ait [S]hoot?\n");
|
||||
|
||||
top: c = getch();
|
||||
@@ -148,8 +158,8 @@ invalid2: Term->printf_term("Fire arrow to? :> "); x = Term->get_int();
|
||||
}
|
||||
|
||||
if(Neal->hasDied == false) {
|
||||
if(Neal->location->hasAnkleBitters == true) {
|
||||
Term->printf_term("Ankle Bitters have stolen from you!\n");
|
||||
if(Neal->location->hasAnkleBiters == true) {
|
||||
Term->printf_term("Ankle Biters have stolen from you!\n");
|
||||
Neal->supplies -= (Rand->rand()%4)+1; // 1-5 supplies get stolen
|
||||
} else if(Neal->location->hasMaltego == true) {
|
||||
Term->printf_term("You stare at Maltego and get disoriented...\n");
|
||||
@@ -157,6 +167,10 @@ randagain: randint = Rand->rand()%20;
|
||||
if(Cody->location->ID != rooms[randint]->ID)
|
||||
Neal->location = rooms[randint];
|
||||
else goto randagain;
|
||||
} else if(Neal->location->hasSupplies) {
|
||||
Term->printf_term("You found some Supplies!\n");
|
||||
Neal->supplies =+ (Rand->rand()%4)+1; // 1-5 supplies found
|
||||
Neal->location->hasSupplies = false; // Supplies shouldn't respawn
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+37
-19
@@ -78,7 +78,7 @@ WVList
|
||||
0
|
||||
19
|
||||
WPickList
|
||||
10
|
||||
11
|
||||
20
|
||||
MItem
|
||||
5
|
||||
@@ -373,8 +373,8 @@ WVList
|
||||
0
|
||||
91
|
||||
MItem
|
||||
8
|
||||
room.cpp
|
||||
7
|
||||
rc4.cpp
|
||||
92
|
||||
WString
|
||||
6
|
||||
@@ -391,8 +391,8 @@ WVList
|
||||
0
|
||||
95
|
||||
MItem
|
||||
14
|
||||
VGA256Term.cpp
|
||||
8
|
||||
room.cpp
|
||||
96
|
||||
WString
|
||||
6
|
||||
@@ -409,26 +409,26 @@ WVList
|
||||
0
|
||||
99
|
||||
MItem
|
||||
3
|
||||
*.h
|
||||
14
|
||||
VGA256Term.cpp
|
||||
100
|
||||
WString
|
||||
3
|
||||
NIL
|
||||
6
|
||||
CPPOBJ
|
||||
101
|
||||
WVList
|
||||
0
|
||||
102
|
||||
WVList
|
||||
0
|
||||
-1
|
||||
20
|
||||
1
|
||||
1
|
||||
0
|
||||
103
|
||||
MItem
|
||||
15
|
||||
font8x8_basic.h
|
||||
3
|
||||
*.h
|
||||
104
|
||||
WString
|
||||
3
|
||||
@@ -439,14 +439,14 @@ WVList
|
||||
106
|
||||
WVList
|
||||
0
|
||||
99
|
||||
-1
|
||||
1
|
||||
1
|
||||
0
|
||||
107
|
||||
MItem
|
||||
5
|
||||
*.hpp
|
||||
15
|
||||
font8x8_basic.h
|
||||
108
|
||||
WString
|
||||
3
|
||||
@@ -457,14 +457,14 @@ WVList
|
||||
110
|
||||
WVList
|
||||
0
|
||||
-1
|
||||
103
|
||||
1
|
||||
1
|
||||
0
|
||||
111
|
||||
MItem
|
||||
11
|
||||
headers.hpp
|
||||
5
|
||||
*.hpp
|
||||
112
|
||||
WString
|
||||
3
|
||||
@@ -475,7 +475,25 @@ WVList
|
||||
114
|
||||
WVList
|
||||
0
|
||||
107
|
||||
-1
|
||||
1
|
||||
1
|
||||
0
|
||||
115
|
||||
MItem
|
||||
11
|
||||
headers.hpp
|
||||
116
|
||||
WString
|
||||
3
|
||||
NIL
|
||||
117
|
||||
WVList
|
||||
0
|
||||
118
|
||||
WVList
|
||||
0
|
||||
111
|
||||
1
|
||||
1
|
||||
0
|
||||
|
||||
+5
-5
@@ -4,8 +4,8 @@ projectIdent
|
||||
VpeMain
|
||||
1
|
||||
WRect
|
||||
1408
|
||||
132
|
||||
176
|
||||
199
|
||||
7680
|
||||
9216
|
||||
2
|
||||
@@ -28,8 +28,8 @@ WVList
|
||||
VComponent
|
||||
8
|
||||
WRect
|
||||
0
|
||||
0
|
||||
890
|
||||
75
|
||||
5712
|
||||
4352
|
||||
0
|
||||
@@ -39,5 +39,5 @@ WFileName
|
||||
10
|
||||
muppet.tgt
|
||||
0
|
||||
9
|
||||
6
|
||||
7
|
||||
|
||||
@@ -35,12 +35,3 @@ void Player::doActions() {
|
||||
} else
|
||||
this->supplies -= 1;
|
||||
}
|
||||
|
||||
Player::~Player() {
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void Player::debug() {
|
||||
printf("PLAYER LOCATION #%i Arrows %d Died %d\n", this->location->ID, this->arrows, this->hasDied);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
|
||||
Room::Room(int id) {
|
||||
this->ID = id;
|
||||
this->hasAnkleBitters = false;
|
||||
this->hasAnkleBiters = false;
|
||||
this->hasMaltego = false;
|
||||
this->hasSupplies = false;
|
||||
}
|
||||
|
||||
void Room::setRooms(Room *r1, Room *r2, Room *r3) {
|
||||
@@ -32,12 +33,3 @@ void Room::setRooms(Room *r1, Room *r2, Room *r3) {
|
||||
this->rooms[1] = r2;
|
||||
this->rooms[2] = r3;
|
||||
}
|
||||
|
||||
Room::~Room() {
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void Room::debug() {
|
||||
printf("ROOM ID #%d Borders [%d %d %d]\n", this->ID, this->rooms[0]->ID, this->rooms[1]->ID, this->rooms[2]->ID);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user