|
|
|
@ -106,10 +106,26 @@ void Thief::InitializeClassAbilities(){ |
|
|
|
|
return false; |
|
|
|
|
}; |
|
|
|
|
#pragma endregion |
|
|
|
|
#pragma region Thief Ability 1 (???) |
|
|
|
|
#pragma region Thief Ability 1 (Hidden Dagger) |
|
|
|
|
Thief::ability1.action= |
|
|
|
|
[](Player*p,vf2d pos={}){ |
|
|
|
|
return false; |
|
|
|
|
geom2d::line mouseDir{p->GetWorldAimingLocation(Player::USE_WALK_DIR),p->GetPos()}; |
|
|
|
|
float velocity=(0.5f*-p->friction*"Thief.Ability 1.RetreatTime"_F*"Thief.Ability 1.RetreatTime"_F-24.f*"Thief.Ability 1.RetreatDistance"_F/100)/-"Thief.Ability 1.RetreatTime"_F; //Derived from kinetic motion formula.
|
|
|
|
|
p->SetVelocity(mouseDir.vector().norm()*velocity); |
|
|
|
|
p->retreatTimer="Thief.Ability 1.RetreatTime"_F; |
|
|
|
|
p->ApplyIframes("Thief.Ability 1.RetreatTime"_F); |
|
|
|
|
p->ghostPositions.push_back(p->GetPos()+vf2d{0,-p->GetZ()}); |
|
|
|
|
p->ghostFrameTimer=p->RETREAT_GHOST_FRAME_DELAY; |
|
|
|
|
p->ghostRemoveTimer=p->RETREAT_GHOST_FRAMES*p->RETREAT_GHOST_FRAME_DELAY; |
|
|
|
|
float angleToCursor=atan2(p->GetWorldAimingLocation(Player::USE_WALK_DIR).y-p->GetPos().y,p->GetWorldAimingLocation(Player::USE_WALK_DIR).x-p->GetPos().x); |
|
|
|
|
|
|
|
|
|
const float daggerLifetime{"Thief.Ability 1.Dagger Range"_F/"Thief.Ability 1.Dagger Speed"_F}; |
|
|
|
|
|
|
|
|
|
CreateBullet(Bullet)(p->GetPos(),vf2d{"Thief.Ability 1.Dagger Speed"_F,angleToCursor}.cart(),"Thief.Ability 1.Dagger Radius"_F,p->GetAttack()*"Thief.Ability 1.Damage"_I,"dagger.png",p->OnUpperLevel(),false,daggerLifetime,true,true)EndBullet; |
|
|
|
|
p->SetAnimationBasedOnTargetingDirection(angleToCursor); |
|
|
|
|
p->SetState(State::RETREAT); |
|
|
|
|
SoundEffect::PlaySFX("Thief.Ability 1.Sound"_S,SoundEffect::CENTERED); |
|
|
|
|
return true; |
|
|
|
|
}; |
|
|
|
|
#pragma endregion |
|
|
|
|
#pragma region Thief Ability 2 (???) |
|
|
|
|