Added level complete window upon completing a stage.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user