54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#include "pch.h"
|
|
#include "Rogue.h"
|
|
#include "GameInstance.h"
|
|
#include "Core/Subsystems/GameInputSystem.h"
|
|
#include "Game/Characters/Monster/Monster.h"
|
|
|
|
Rogue::Rogue(PlayerStatData&& Rvalue) :
|
|
Player(std::move(Rvalue))
|
|
{
|
|
HitCount = 5;
|
|
}
|
|
|
|
Rogue::~Rogue()
|
|
{
|
|
}
|
|
|
|
void Rogue::Initalize()
|
|
{
|
|
Player::Initalize();
|
|
|
|
PlayerData.Job = "도적";
|
|
|
|
int MaxHp = Game::InitCharacterJob::AddMaxHP;
|
|
GInput << "도적으로 전직하였습니다." << "(HP +" << MaxHp << ")" << "\n";
|
|
GInput << "더블 스탭 추가!\n";
|
|
PlayerData.Attack += MaxHp;
|
|
}
|
|
|
|
void Rogue::Release()
|
|
{
|
|
Player::Release();
|
|
}
|
|
|
|
void Rogue::Attack(class Monster* Target)
|
|
{
|
|
std::string TargetName = Target->GetName();
|
|
int TargetDefence = Target->GetDefence();
|
|
int Damage = 0;
|
|
|
|
Damage = (PlayerData.Attack - TargetDefence) < 0 ? 1 : (PlayerData.Attack - TargetDefence) / HitCount;
|
|
GInput << "더블 스탭! -> " << TargetName << "에게 " << Damage << " 데미지! (x" << HitCount << ")" << "\n";
|
|
|
|
GInput << Target->GetName() << " HP: " << Target->GetHP() << " -> ";
|
|
for (int i = 0; i < HitCount; ++i)
|
|
Target->TakeDamage(Damage);
|
|
|
|
GInput << Target->GetHP() << "\n";
|
|
system("pause");
|
|
}
|
|
|
|
void Rogue::TakeDamage(int Amount)
|
|
{
|
|
Player::TakeDamage(Amount);
|
|
} |