|
|
|
@ -434,6 +434,7 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
Menu::OpenMenu(MenuType::PAUSE);
|
|
|
|
|
}
|
|
|
|
|
float animationSpd=0.f;
|
|
|
|
|
player->movementVelocity={};
|
|
|
|
|
if(player->GetVelocity().mag()<"Player.Move Allowed Velocity Lower Limit"_F&&player->CanMove()){
|
|
|
|
|
auto GetPlayerStaircaseDirection=[&](){
|
|
|
|
|
for(LayerTag&layer:MAP_DATA[GetCurrentLevel()].LayerData){
|
|
|
|
@ -460,14 +461,14 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
moveAmt*=controllerAmt;
|
|
|
|
|
}else animationSpd=1.f;
|
|
|
|
|
player->SetX(player->GetX()+fElapsedTime*moveAmt*player->GetMoveSpdMult());
|
|
|
|
|
player->movementVelocity.x=moveAmt*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
player->movementVelocity.x+=moveAmt*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
if(staircaseDirection=="RIGHT"){
|
|
|
|
|
player->SetY(player->GetY()-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult());
|
|
|
|
|
player->movementVelocity.y=-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
player->movementVelocity.y+=-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
} else
|
|
|
|
|
if(staircaseDirection=="LEFT"){
|
|
|
|
|
player->SetY(player->GetY()+"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult());
|
|
|
|
|
player->movementVelocity.y="Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
player->movementVelocity.y+="Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
}
|
|
|
|
|
player->SetFacingDirection(RIGHT);
|
|
|
|
|
|
|
|
|
@ -488,14 +489,14 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
moveAmt*=controllerAmt;
|
|
|
|
|
}else animationSpd=1.f;
|
|
|
|
|
player->SetX(player->GetX()-fElapsedTime*moveAmt*player->GetMoveSpdMult());
|
|
|
|
|
player->movementVelocity.x=-moveAmt*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
player->movementVelocity.x+=-moveAmt*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
if(staircaseDirection=="RIGHT"){
|
|
|
|
|
player->SetY(player->GetY()+"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult());
|
|
|
|
|
player->movementVelocity.y="Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
player->movementVelocity.y+="Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
} else
|
|
|
|
|
if(staircaseDirection=="LEFT"){
|
|
|
|
|
player->SetY(player->GetY()-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult());
|
|
|
|
|
player->movementVelocity.y=-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
player->movementVelocity.y+=-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
newAimingAngle-=vf2d{1,0};
|
|
|
|
@ -515,7 +516,7 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
moveAmt*=controllerAmt;
|
|
|
|
|
}else animationSpd=1.f;
|
|
|
|
|
player->SetY(player->GetY()-fElapsedTime*moveAmt*player->GetMoveSpdMult());
|
|
|
|
|
player->movementVelocity.y=-moveAmt*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
player->movementVelocity.y+=-moveAmt*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
|
|
|
|
|
newAimingAngle-=vf2d{0,1};
|
|
|
|
|
|
|
|
|
@ -534,7 +535,7 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
moveAmt*=controllerAmt;
|
|
|
|
|
}else animationSpd=1.f;
|
|
|
|
|
player->SetY(player->GetY()+fElapsedTime*moveAmt*player->GetMoveSpdMult());
|
|
|
|
|
player->movementVelocity.y=moveAmt*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
player->movementVelocity.y+=moveAmt*fElapsedTime*player->GetMoveSpdMult();
|
|
|
|
|
|
|
|
|
|
newAimingAngle+=vf2d{0,1};
|
|
|
|
|
|
|
|
|
@ -564,7 +565,6 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
}
|
|
|
|
|
if(UpReleased()){
|
|
|
|
|
player->SetLastReleasedMovementKey(UP);
|
|
|
|
|
player->movementVelocity.y=0;
|
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){
|
|
|
|
|
if(RightHeld()){
|
|
|
|
|
player->UpdateWalkingAnimation(RIGHT);
|
|
|
|
@ -579,7 +579,6 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
}
|
|
|
|
|
if(RightReleased()){
|
|
|
|
|
player->SetLastReleasedMovementKey(RIGHT);
|
|
|
|
|
player->movementVelocity.x=0;
|
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){
|
|
|
|
|
if(UpHeld()){
|
|
|
|
|
player->UpdateWalkingAnimation(UP);
|
|
|
|
@ -594,7 +593,6 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
}
|
|
|
|
|
if(LeftReleased()){
|
|
|
|
|
player->SetLastReleasedMovementKey(LEFT);
|
|
|
|
|
player->movementVelocity.x=0;
|
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){
|
|
|
|
|
if(RightHeld()){
|
|
|
|
|
player->UpdateWalkingAnimation(RIGHT);
|
|
|
|
@ -609,7 +607,6 @@ void AiL::HandleUserInput(float fElapsedTime){
|
|
|
|
|
}
|
|
|
|
|
if(DownReleased()){
|
|
|
|
|
player->SetLastReleasedMovementKey(DOWN);
|
|
|
|
|
player->movementVelocity.y=0;
|
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){
|
|
|
|
|
if(RightHeld()){
|
|
|
|
|
player->UpdateWalkingAnimation(RIGHT);
|
|
|
|
@ -3914,7 +3911,7 @@ void AiL::ShowDamageVignetteOverlay(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AiL::GlobalGameUpdates(){
|
|
|
|
|
levelTime+=fElapsedTime;
|
|
|
|
|
levelTime+=GetElapsedTime();
|
|
|
|
|
SteamAPI_RunCallbacks();
|
|
|
|
|
STEAMINPUT(
|
|
|
|
|
ActivateActionSetForAllControllers(Input::ingameControlsHandle);
|
|
|
|
@ -3925,15 +3922,15 @@ void AiL::GlobalGameUpdates(){
|
|
|
|
|
for(std::vector<std::shared_ptr<DamageNumber>>::iterator it=DAMAGENUMBER_LIST.begin();it!=DAMAGENUMBER_LIST.end();++it){
|
|
|
|
|
DamageNumber*dn=(*it).get();
|
|
|
|
|
if(dn->pauseTime>0){
|
|
|
|
|
dn->pauseTime-=fElapsedTime;
|
|
|
|
|
dn->pauseTime-=GetElapsedTime();
|
|
|
|
|
} else{
|
|
|
|
|
dn->lifeTime+=fElapsedTime;
|
|
|
|
|
dn->lifeTime+=GetElapsedTime();
|
|
|
|
|
if(dn->lifeTime<=1){
|
|
|
|
|
if(dn->lifeTime<DamageNumber::MOVE_UP_TIME){
|
|
|
|
|
if(dn->invertedDirection){
|
|
|
|
|
dn->pos.y+=dn->riseSpd*fElapsedTime;
|
|
|
|
|
dn->pos.y+=dn->riseSpd*GetElapsedTime();
|
|
|
|
|
}else{
|
|
|
|
|
dn->pos.y-=dn->riseSpd*fElapsedTime;
|
|
|
|
|
dn->pos.y-=dn->riseSpd*GetElapsedTime();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -3944,9 +3941,9 @@ void AiL::GlobalGameUpdates(){
|
|
|
|
|
if(GetMousePos()!=lastMousePos){
|
|
|
|
|
lastMouseMovement=0.f;
|
|
|
|
|
lastMousePos=GetMousePos();
|
|
|
|
|
}else lastMouseMovement+=fElapsedTime;
|
|
|
|
|
}else lastMouseMovement+=GetElapsedTime();
|
|
|
|
|
|
|
|
|
|
vignetteDisplayTime=std::max(0.f,vignetteDisplayTime-fElapsedTime);
|
|
|
|
|
vignetteDisplayTime=std::max(0.f,vignetteDisplayTime-GetElapsedTime());
|
|
|
|
|
|
|
|
|
|
if(Audio::Engine().IsPlaying(GetPlayer()->cooldownSoundInstance)){
|
|
|
|
|
Audio::Engine().SetVolume(GetPlayer()->cooldownSoundInstance,Audio::GetCalculatedSFXVolume("Audio.Casting Sound Volume"_F/100.f));
|
|
|
|
|