Setup King Slime encounter, Boss room map setup with spawn and player, made non-infinite. Implemented enemy iframes and added phase framework for the boss.
This commit is contained in:
+18
-12
@@ -332,7 +332,7 @@ void Player::Update(float fElapsedTime){
|
||||
SetX(newX);
|
||||
SetY(newY);
|
||||
}
|
||||
if(attack_cooldown_timer==0&&game->GetMouse(0).bHeld){
|
||||
if(CanAct()&&attack_cooldown_timer==0&&game->GetMouse(0).bHeld){
|
||||
AutoAttack();
|
||||
}
|
||||
|
||||
@@ -341,19 +341,21 @@ void Player::Update(float fElapsedTime){
|
||||
//If pressed is set to false, uses held instead.
|
||||
auto CheckAndPerformAbility=[&](Ability&ability,HWButton key){
|
||||
if(ability.name!="???"){
|
||||
if(ability.cooldown==0&&GetMana()>=ability.manaCost){
|
||||
if(key.bHeld||key.bReleased&&&ability==castPrepAbility&&GetState()==State::PREP_CAST){
|
||||
if(AllowedToCast(ability)&&ability.action(this,{})){
|
||||
ability.cooldown=ability.COOLDOWN_TIME;
|
||||
mana-=ability.manaCost;
|
||||
}else
|
||||
if(ability.precastInfo.precastTargetingRequired&&GetState()==State::NORMAL){
|
||||
PrepareCast(ability);
|
||||
if(CanAct()){
|
||||
if(ability.cooldown==0&&GetMana()>=ability.manaCost){
|
||||
if(key.bHeld||key.bReleased&&&ability==castPrepAbility&&GetState()==State::PREP_CAST){
|
||||
if(AllowedToCast(ability)&&ability.action(this,{})){
|
||||
ability.cooldown=ability.COOLDOWN_TIME;
|
||||
mana-=ability.manaCost;
|
||||
}else
|
||||
if(ability.precastInfo.precastTargetingRequired&&GetState()==State::NORMAL){
|
||||
PrepareCast(ability);
|
||||
}
|
||||
}
|
||||
} else
|
||||
if(ability.cooldown==0&&GetMana()<ability.manaCost&&key.bPressed){
|
||||
notEnoughManaDisplay={ability.name,1};
|
||||
}
|
||||
} else
|
||||
if(ability.cooldown==0&&GetMana()<ability.manaCost&&key.bPressed){
|
||||
notEnoughManaDisplay={ability.name,1};
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -480,6 +482,10 @@ bool Player::CanMove(){
|
||||
return state!=State::CASTING&&state!=State::ANIMATION_LOCK;
|
||||
}
|
||||
|
||||
bool Player::CanAct(){
|
||||
return state!=State::CASTING&&state!=State::ANIMATION_LOCK;
|
||||
}
|
||||
|
||||
bool Player::HasIframes(){
|
||||
return iframe_time>0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user