Multishot Ranger ability implemented.
This commit is contained in:
parent
045441b595
commit
9585baf5c6
@ -50,6 +50,12 @@ every arrow normal autohit dmg. (can be used as shotgun against large foes for 6
|
|||||||
25 sec. cd
|
25 sec. cd
|
||||||
55 Mana
|
55 Mana
|
||||||
|
|
||||||
|
-3/16
|
||||||
|
-1/8
|
||||||
|
-1/16
|
||||||
|
1/16
|
||||||
|
1/8
|
||||||
|
3/16
|
||||||
|
|
||||||
|
|
||||||
Wizard
|
Wizard
|
||||||
|
@ -70,18 +70,31 @@ void Ranger::InitializeClassAbilities(){
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
#pragma region Ranger Ability 2 (???)
|
#pragma region Ranger Ability 2 (Charged Shot)
|
||||||
Ranger::ability2.action=
|
Ranger::ability2.action=
|
||||||
[](Player*p,vf2d pos={}){
|
[](Player*p,vf2d pos={}){
|
||||||
vf2d arrowVelocity=util::pointTo(p->GetPos(),game->GetWorldMousePos());
|
vf2d arrowVelocity=util::pointTo(p->GetPos(),game->GetWorldMousePos());
|
||||||
BULLET_LIST.push_back(std::make_unique<ChargedArrow>(p->GetPos(),arrowVelocity*600,20,p->GetAttack()*2.5,p->OnUpperLevel(),true));
|
BULLET_LIST.push_back(std::make_unique<ChargedArrow>(p->GetPos(),arrowVelocity*600,20,p->GetAttack()*2.5,p->OnUpperLevel(),true));
|
||||||
|
p->SetAnimationBasedOnTargetingDirection(atan2(arrowVelocity.y,arrowVelocity.x));
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
#pragma region Ranger Ability 3 (???)
|
#pragma region Ranger Ability 3 (Multi Shot)
|
||||||
Ranger::ability3.action=
|
Ranger::ability3.action=
|
||||||
[](Player*p,vf2d pos={}){
|
[](Player*p,vf2d pos={}){
|
||||||
return false;
|
geom2d::line pointTowardsCursor=geom2d::line(p->GetPos(),game->GetWorldMousePos());
|
||||||
|
float shootingDist=pointTowardsCursor.length();
|
||||||
|
vf2d shootingDirMiddle=pointTowardsCursor.vector();
|
||||||
|
float shootingAngle=atan2(shootingDirMiddle.y,shootingDirMiddle.x);
|
||||||
|
for(int i=0;i<7;i++){
|
||||||
|
if(i==3)continue;
|
||||||
|
float newAngle=shootingAngle-3.f/16*PI+i*1.f/16*PI;
|
||||||
|
geom2d::line pointTowardsCursor=geom2d::line(p->GetPos(),p->GetPos()+vf2d{cos(newAngle),sin(newAngle)}*shootingDist);
|
||||||
|
vf2d extendedLine=pointTowardsCursor.upoint(1.1);
|
||||||
|
BULLET_LIST.push_back(std::make_unique<Arrow>(Arrow(p->GetPos(),extendedLine,vf2d{cos(newAngle)*250,float(sin(newAngle)*250-PI/8*250)}+p->movementVelocity,12,p->GetAttack(),p->OnUpperLevel(),true)));
|
||||||
|
}
|
||||||
|
p->SetAnimationBasedOnTargetingDirection(shootingAngle);
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
}
|
}
|
@ -2,7 +2,7 @@
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 846
|
#define VERSION_BUILD 847
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user