124 lines
2.6 KiB
C++
124 lines
2.6 KiB
C++
#include "pch.h"
|
|
#include "CharacterStatScene.h"
|
|
|
|
#include "GameInstance.h"
|
|
#include "CharacterJobScene.h"
|
|
#include "Core/Subsystems/GameInputSystem.h"
|
|
#include "Core/Subsystems/GameDataManager.h"
|
|
#include "Core/Subsystems/SceneManager.h"
|
|
#include "Data/Literals/Literals.h"
|
|
#include "Game/Characters/Player/Player.h"
|
|
|
|
CharacterStatScene::CharacterStatScene(GameSceneManager* InOwner) :
|
|
CoreScene(InOwner)
|
|
{
|
|
bEnableTick = false;
|
|
}
|
|
|
|
CharacterStatScene::~CharacterStatScene()
|
|
{
|
|
}
|
|
|
|
void CharacterStatScene::Enter()
|
|
{
|
|
int InitHP = 5;
|
|
int InitMP = 5;
|
|
int SelectNum = 0;
|
|
bool IsGameStart = true;
|
|
|
|
GInput << "* HP 포션 5개, MP 포션 5개가 기본 지급되었습니다." << "\n";
|
|
|
|
PlayerStatData* PlayerData = GInst->GetGameDataManager()->GetPlayerData();
|
|
|
|
while (IsGameStart)
|
|
{
|
|
GInput << "============================================" << "\n";
|
|
GInput << "< 캐릭터 강화 >" << "\n";
|
|
GInput << "1. HP UP 2. MP UP 3. 공격력 2배" << "\n";
|
|
GInput << "4. 방어력 2배 5. 현재 능력치 0. 게임 시작" << "\n";
|
|
GInput << "============================================" << "\n";
|
|
GInput << "번호를 선택해주세요: ";
|
|
|
|
if (!(GInput >> SelectNum))
|
|
{
|
|
GInput.Reset();
|
|
continue;
|
|
}
|
|
|
|
switch (SelectNum)
|
|
{
|
|
case 0:
|
|
{
|
|
GInput << "게임을 시작합니다! \n";
|
|
IsGameStart = false;
|
|
break;
|
|
}
|
|
case 1:
|
|
{
|
|
if (InitHP <= 0)
|
|
GInput << "HP 포션이 부족합니다. \n";
|
|
|
|
else
|
|
{
|
|
PlayerData->HP += 20;
|
|
--InitHP;
|
|
|
|
GInput << "* HP가 20 증가했습니다. (HP 포션 차감: 남은 포션 " << InitHP << "개)" << "\n";
|
|
}
|
|
break;
|
|
}
|
|
case 2:
|
|
{
|
|
if (InitMP <= 0)
|
|
GInput << "MP 포션이 부족합니다. \n";
|
|
else
|
|
{
|
|
PlayerData->MP += 20;
|
|
--InitMP;
|
|
GInput << "* MP가 20 증가했습니다. (MP 포션 차감: 남은 포션 " << InitMP << "개)" << "\n";
|
|
}
|
|
break;
|
|
}
|
|
case 3:
|
|
{
|
|
PlayerData->Attack *= 2;
|
|
GInput << "공격력이 현재 공격력에서 2배로 증가했습니다. (현재 공격력: " << PlayerData->Attack << ")" << "\n";
|
|
break;
|
|
}
|
|
case 4:
|
|
{
|
|
PlayerData->Defence *= 2;
|
|
GInput << "방어력이 현재 방어력에서 2배로 증가했습니다. (현재 방어력: " << PlayerData->Defence << ")" << "\n";
|
|
break;
|
|
}
|
|
case 5:
|
|
{
|
|
GInput << *PlayerData;
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
GInput << Game::Common::ErrorInput << "\n";
|
|
continue;
|
|
}
|
|
}
|
|
system("pause");
|
|
system("cls");
|
|
}
|
|
|
|
Exit();
|
|
}
|
|
|
|
void CharacterStatScene::Update()
|
|
{
|
|
}
|
|
|
|
void CharacterStatScene::Exit()
|
|
{
|
|
Owner->TransitionTo<CharacterJobScene>();
|
|
}
|
|
|
|
void CharacterStatScene::Release()
|
|
{
|
|
}
|