WraitheDX / realms_shattered

This is a CLI (command line interface) text RPG programmed in C++.
11 stars 6 forks source link

Adding gameplay - Combat #38

Closed WraitheDX closed 4 years ago

WraitheDX commented 4 years ago

Note: Gameplay will go through iterations, and start off very simple.

Combat should not be restricted to a combat function. GameData holds a vector of all currently loaded entities (Entity *), and if an entity is in that vector and is hostile to player, they should have the opportunity to attack after player takes a turn.

Combat will start as being player vs a single entity. Combat will take turns, player going first. Make sure to check if entity has perished before allowing their turn. For now just add a simple damage value to actor. May add defense if you like. Need a function to create an Actor (child class of Entity) directly.

Combat actions should be reported to the ActionLog. Ex: Player hits enemy, enemy hits player, X damage dealt, Enemy has been defeated, etc

Later on, entity generation will be extended to reading from files. For now, please add a random chance to spawn an enemy in a room when player enters a new room, and display enemy name/health to player. Combat log will be a separately listed issue.

WraitheDX commented 4 years ago

I am tackling this issue now.

Combat has been added, but it is very rough and going to need a lot of attention and reworking.