Redundant collision tile error handling. And allow a flag for abilities to cancel casts (Wizard Teleport)

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
2023-09-15 17:07:14 +00:00
parent ac0fbbb174
commit dbc68b8c4b
14 changed files with 67 additions and 8 deletions
-1
View File
@@ -74,7 +74,6 @@ void Wizard::InitializeClassAbilities(){
#pragma region Wizard Right-click Ability (Teleport)
Wizard::rightClickAbility.action=
[](Player*p,vf2d pos={}){
if(p->GetState()==State::CASTING)return false;
float pointMouseDirection=atan2(game->GetWorldMousePos().y-p->GetPos().y,game->GetWorldMousePos().x-p->GetPos().x);
vf2d pointTowardsMouse={cos(pointMouseDirection),sin(pointMouseDirection)};
float dist=std::clamp(geom2d::line<float>{p->GetPos(),game->GetWorldMousePos()}.length(),0.f,"Wizard.Right Click Ability.TeleportRange"_F/100*24);