DoorNroll/src/combat/Enemy.hpp

60 lines
1.6 KiB
C++

#pragma once
#include "core/Common.hpp"
#include <string>
namespace dnr {
enum class EnemyType {
CYBER_DRONE, // Thermal / Overheat laser. Weak to EMP.
ICE_SENTINEL, // EMP shock blaster. Weak to Corrosive.
GLITCH_WRAITH, // Glitch pulse. Weak to Kinetic.
VIRUS_CONSTRUCT // Corrosive bile. Weak to Overheat.
};
class Enemy {
public:
Enemy(EnemyType type, int level = 1);
const std::string& getName() const { return m_name; }
EnemyType getType() const { return m_type; }
int getHp() const { return m_hp; }
int getMaxHp() const { return m_maxHp; }
int getShield() const { return m_shield; }
int getMaxShield() const { return m_maxShield; }
AmmoType getAttackElement() const { return m_attackElement; }
AmmoType getWeakness() const { return m_weakness; }
Color getColor() const { return m_color; }
bool isAlive() const { return m_hp > 0; }
// Combat interactions
int takeDamage(int amount, AmmoType element);
void applyStatus(StatusEffect effect, int duration, int power);
void updateTurnStart(std::vector<std::string>& combatLog);
int calculateAttackDamage() const;
bool isStunned() const;
const std::vector<ActiveStatus>& getStatuses() const { return m_statuses; }
private:
EnemyType m_type;
std::string m_name;
int m_level = 1;
int m_hp = 100;
int m_maxHp = 100;
int m_shield = 30;
int m_maxShield = 30;
int m_baseDamage = 15;
AmmoType m_attackElement = AmmoType::OVERHEAT;
AmmoType m_weakness = AmmoType::EMP;
Color m_color = RED;
std::vector<ActiveStatus> m_statuses;
};
} // namespace dnr