-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFortunePig.cpp
More file actions
17 lines (15 loc) · 897 Bytes
/
FortunePig.cpp
File metadata and controls
17 lines (15 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "FortunePig.h"
// FortunePig is a child class of ShopItem
// Default constructor
FortunePig::FortunePig() : ShopItem("Fortune Pig", 40, "Requirements to unlock this item: Purchase Fortune Cat.\nEffects: +7 Reputation Points every 10 seconds when activated.\n\n\033[3mThe Fortune Pig promises greater rewards with each snort, adding a touch of prosperity to your restaurant and boosting your reputation bit by bit.\033[0m", "fortunepig.png") {
hasFortunePigEffectApplied = false;
}
// This method applies the effect of the FortunePig item to the player
// It boosts the player's reputation by +7 points every 10 seconds when activated
void FortunePig::applyEffect(Player* player, Enemy* enemy) {
if (player && !hasFortunePigEffectApplied) {
player->setHasFortunePig(true);
hasFortunePigEffectApplied = true;
std::cout << "Fortune Pig acquired!\n";
}
}