-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAxolotl.cpp
More file actions
16 lines (14 loc) · 822 Bytes
/
Axolotl.cpp
File metadata and controls
16 lines (14 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "Axolotl.h"
// Axolotl is a child class of ShopItem
// Default constructor
Axolotl::Axolotl() : ShopItem("Axolotl", 40, "Requirements to unlock this item: Purchase Butter.\nEffects: -0.02 of the Enemy’s Speed when activated .\n\n\033[3mThe enemy can't resist the charm of this cute little critter. Equip it to distract and slow them down with sheer adorableness!\033[0m", "axolotl.png") {
hasAxolotlEffectApplied = false;
}
// Method that applies the axolotl effect to the enemy, reducing their speed by 0.02
void Axolotl::applyEffect(Player* player, Enemy* enemy) {
if (enemy && !hasAxolotlEffectApplied) {
enemy->setEnemySpeed(enemy->getEnemySpeed() - 0.02f);
hasAxolotlEffectApplied = true;
std::cout << "Enemy Speed decreased to: " << enemy->getEnemySpeed() << "\n";
}
}