Added level complete window upon completing a stage.

This commit is contained in:
2023-11-19 15:57:18 -06:00
parent 5b28478596
commit 5652741ec0
11 changed files with 68 additions and 10 deletions
+22
View File
@@ -224,6 +224,9 @@ void Player::Update(float fElapsedTime){
blockTimer=std::max(0.f,blockTimer-fElapsedTime);
lastCombatTime=lastCombatTime+fElapsedTime;
manaTickTimer-=fElapsedTime;
CheckEndZoneCollision();
if(castInfo.castTimer>0){
castInfo.castTimer-=fElapsedTime;
if(castInfo.castTimer<=0){
@@ -759,4 +762,23 @@ void Player::ResetLastCombatTime(){
bool Player::IsOutOfCombat(){
return lastCombatTime>="Player.Out of Combat Time"_F;
}
float Player::GetEndZoneStandTime(){
return endZoneStandTime;
}
void Player::CheckEndZoneCollision(){
if(IsOutOfCombat()){
for(ZoneData&zone:game->MAP_DATA[game->GetCurrentLevel()].ZoneData.at("EndZone")){
if(zone.isUpper==upperLevel&&geom2d::overlaps(GetPos(),zone.zone)){
endZoneStandTime+=game->GetElapsedTime();
if(endZoneStandTime>="Player.End Zone Wait Time"_F){
Menu::OpenMenu(LEVEL_COMPLETE);
}
return;
}
}
}
endZoneStandTime=0;
}