TheCOSCGameProject  1.0
Functions
combat.h File Reference

Declares combat-related functions for the Valeris game. More...

#include "../lib/dependencies.h"
#include <string>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <chrono>
Include dependency graph for combat.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void printHealth (int playerHealth, int enemyHealth, const std::string &name)
 Prints the health status of the player and the enemy. More...
 
bool combatV1 (int *playerHealth, int enemyHealth, int difficulty, const std::string &name, int playerDamage, int enemyDamage, int resistance)
 Handles combat mechanics for version 1. More...
 
void combatV2 (int playerHealth, int enemyHealth)
 Handles combat mechanics for version 2. More...
 

Detailed Description

Declares combat-related functions for the Valeris game.

This file contains the declarations of functions used to manage and execute combat scenarios in the game, including printing health statuses and handling different versions of combat mechanics.

Function Documentation

◆ combatV1()

bool combatV1 ( int *  playerHealth,
int  enemyHealth,
int  difficulty,
const std::string &  name,
int  playerDamage,
int  enemyDamage,
int  resistance 
)

Handles combat mechanics for version 1.

Parameters
playerHealthThe initial health of the player.
enemyHealthThe initial health of the enemy.
difficultyThe difficulty level of the combat (e.g., easy, medium, hard).
nameThe name of the enemy.
Returns
True if the player wins the combat, otherwise false.

This function simulates a combat scenario between the player and an enemy, taking into account the difficulty level. The outcome of the combat is determined based on the player's and enemy's health.

Handles combat mechanics for version 1.

Parameters
playerHealthThe initial health of the player.
enemyHealthThe initial health of the enemy.
difficultyThe difficulty level of the combat, influencing the response time allowed.
nameThe name of the enemy G.
Returns
True if the player wins, false if the player loses.

This combat system involves the player quickly matching directional inputs to attack the enemy. The enemy's attacks decrease the player's health if the player fails to respond correctly or quickly enough.

◆ combatV2()

void combatV2 ( int  playerHealth,
int  enemyHealth 
)

Handles combat mechanics for version 2.

Parameters
playerHealthThe initial health of the player.
enemyHealthThe initial health of the enemy.

This function provides an alternative combat system with potentially different rules or mechanics compared to combatV1.

Handles combat mechanics for version 2.

Parameters
playerHealthThe initial health of the player.
enemyHealthThe initial health of the enemy.

This version of the combat system is intended to be more strategic, allowing the player to choose different combat styles (Offensive, Sneaky, Defensive). The implementation details are yet to be completed.

◆ printHealth()

void printHealth ( int  playerHealth,
int  enemyHealth,
const std::string &  name 
)

Prints the health status of the player and the enemy.

Parameters
playerHealthThe current health of the player.
enemyHealthThe current health of the enemy.
nameThe name of the enemy.

This function displays the current health points of both the player and the enemy, providing an overview of the combat situation.

Prints the health status of the player and the enemy.

Parameters
playerHealthThe current health of the player.
enemyHealthThe current health of the enemy.
nameThe name of the enemy.

This function prints the player's and enemy's health in a formatted health bar.