forked from HibaMallak/ex2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutilities.cpp
More file actions
71 lines (60 loc) · 1.86 KB
/
utilities.cpp
File metadata and controls
71 lines (60 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// Created by Daniel_Meents on 12/04/2022.
//
#include "utilities.h"
#include <iostream>
using std::cout;
using std::endl;
const char* LINE_DIVIDER = "------------------------";
void printBattleCardInfo(const CardStats& card)
{
cout << "Card drawn:" << endl;
cout << "Type: Battle" << endl;
cout << "Force: " << card.force << endl;
cout << "Profit (on win): " << card.loot << endl;
cout << "Damage taken (on loss): " << card.hpLossOnDefeat << endl;
cout << LINE_DIVIDER << endl;
}
void printBattleResult(bool win)
{
if (win){
cout << "The player defeated the monster and won the loot! Hooray!" << endl;
cout << LINE_DIVIDER << endl;
} else{
cout << "After a long battle, the player has fled wounded and failed." << endl;
cout << LINE_DIVIDER << endl;
}
}
void printBuffCardInfo(const CardStats& card)
{
cout << "Card drawn:" << endl;
cout << "Type: Buff" << endl;
cout << "Buff points: " << card.buff << endl;
cout << "Cost: " << card.cost << endl;
cout << LINE_DIVIDER << endl;
}
void printHealCardInfo(const CardStats& card)
{
cout << "Card drawn:" << endl;
cout << "Type: Heal" << endl;
cout << "Heal points: " << card.heal << endl;
cout << "Cost: " << card.cost << endl;
cout << LINE_DIVIDER << endl;
}
void printTreasureCardInfo(const CardStats& card)
{
cout << "Card drawn:" << endl;
cout << "Type: Treasure" << endl;
cout << "Coins: " << card.loot << endl;
cout << LINE_DIVIDER << endl;
}
void printPlayerInfo(const char* name, const int level, const int force, const int hp, const int coins)
{
cout << "Player Details:" << endl;
cout << "Name: " << name << endl;
cout << "Level: " << level << endl;
cout << "Force: " << force << endl;
cout << "HP: " << hp << endl;
cout << "Coins: " << coins << endl;
cout << LINE_DIVIDER << endl;
}