Ranger configuration file implemented. Added per-step bullet collisions. Fix Release Desktop project setup.

This commit is contained in:
2023-08-06 15:07:53 -05:00
parent 017a72b8cc
commit b2d363cdef
10 changed files with 107 additions and 38 deletions
+14 -7
View File
@@ -63,7 +63,9 @@ void Ranger::InitializeClassAbilities(){
[](Player*p,vf2d pos={}){
p->remainingRapidFireShots=p->RAPID_FIRE_SHOOT_AMOUNT;
p->rapidFireTimer=p->RAPID_FIRE_SHOOT_DELAY;
p->SetState(State::ANIMATION_LOCK);
if("Ranger.Ability 1.IsAnimationLocked"_I){
p->SetState(State::ANIMATION_LOCK);
}
return true;
};
#pragma endregion
@@ -71,9 +73,10 @@ void Ranger::InitializeClassAbilities(){
Ranger::ability2.action=
[](Player*p,vf2d pos={}){
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*"Ranger.Ability 2.Speed"_F,12*"Ranger.Ability 2.Radius"_F/100,p->GetAttack()*"Ranger.Ability 2.DamageMult"_F,p->OnUpperLevel(),true));
p->SetAnimationBasedOnTargetingDirection(atan2(arrowVelocity.y,arrowVelocity.x));
game->SetupWorldShake(0.3);
game->SetupWorldShake("Ranger.Ability 2.WorldShakeTime"_F);
p->Knockback(-1.f*arrowVelocity.norm()*"Ranger.Ability 2.Knockback"_F);
return true;
};
#pragma endregion
@@ -84,12 +87,16 @@ void Ranger::InitializeClassAbilities(){
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;
int arrowCount="Ranger.Ability 3.ArrowCount"_I%2==0?"Ranger.Ability 3.ArrowCount"_I+1:"Ranger.Ability 3.ArrowCount"_I;
for(int i=0;i<arrowCount;i++){
if("Ranger.Ability 3.ArrowCount"_I%2==0&&i=="Ranger.Ability 3.ArrowCount"_I/2)continue;
const float halfAngle="Ranger.Ability 3.MultiShotSpread"_F*PI/180;
const float leftAngle=-halfAngle;
const float increment=halfAngle/"Ranger.Ability 3.ArrowCount"_I;
const float newAngle=shootingAngle+leftAngle/2+i*increment;
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)));
BULLET_LIST.push_back(std::make_unique<Arrow>(Arrow(p->GetPos(),extendedLine,vf2d{cos(newAngle)*"Ranger.Ability 3.ArrowSpd"_F,float(sin(newAngle)*"Ranger.Ability 3.ArrowSpd"_F-PI/8*"Ranger.Ability 3.ArrowSpd"_F)}+p->movementVelocity,12*"Ranger.Ability 3.ArrowRadius"_F/100,p->GetAttack()*"Ranger.Ability 3.DamageMult"_F,p->OnUpperLevel(),true)));
}
p->SetAnimationBasedOnTargetingDirection(shootingAngle);
return true;