|
|
|
@ -60,6 +60,28 @@ Warrior::Warrior(std::string name,Class cl,Ability rightClickAbility,Ability abi |
|
|
|
|
{} |
|
|
|
|
|
|
|
|
|
void Warrior::Update(float fElapsedTime){ |
|
|
|
|
ACCESS_PLAYER |
|
|
|
|
if(p.GetState()==State::SWING_SWORD){ |
|
|
|
|
switch(p.GetFacingDirection()){ |
|
|
|
|
case UP:{ |
|
|
|
|
p.UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_N); |
|
|
|
|
}break; |
|
|
|
|
case DOWN:{ |
|
|
|
|
p.UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_S); |
|
|
|
|
}break; |
|
|
|
|
case LEFT:{ |
|
|
|
|
p.UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_W); |
|
|
|
|
}break; |
|
|
|
|
case RIGHT:{ |
|
|
|
|
p.UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_E); |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
p.SetSwordSwingTimer(p.GetSwordSwingTimer()-fElapsedTime); |
|
|
|
|
if(p.GetSwordSwingTimer()<=0){ |
|
|
|
|
p.SetSwordSwingTimer(0); |
|
|
|
|
p.SetState(State::NORMAL);
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Warrior::AutoAttack(){ |
|
|
|
@ -277,6 +299,22 @@ void Wizard::Update(float fElapsedTime){ |
|
|
|
|
CLASS_DATA[cl]->walk_s=AnimationState::WIZARD_WALK_S; |
|
|
|
|
CLASS_DATA[cl]->walk_w=AnimationState::WIZARD_WALK_W; |
|
|
|
|
} |
|
|
|
|
if(p.GetState()==State::CASTING){ |
|
|
|
|
switch(p.GetFacingDirection()){ |
|
|
|
|
case UP:{ |
|
|
|
|
p.UpdateAnimation(AnimationState::WIZARD_CAST_N); |
|
|
|
|
}break; |
|
|
|
|
case DOWN:{ |
|
|
|
|
p.UpdateAnimation(AnimationState::WIZARD_CAST_S); |
|
|
|
|
}break; |
|
|
|
|
case LEFT:{ |
|
|
|
|
p.UpdateAnimation(AnimationState::WIZARD_CAST_W); |
|
|
|
|
}break; |
|
|
|
|
case RIGHT:{ |
|
|
|
|
p.UpdateAnimation(AnimationState::WIZARD_CAST_E); |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Wizard::AutoAttack(){ |
|
|
|
|