Fix up warnings (mostly loss of data cast warnings). When an ability gets interrupted, the key is required to be depressed before another cast attempt can be made. Added collision layer tiles to a few tiles in 1-1 due to ability to walk out-of-bounds.
This commit is contained in:
+5
-5
@@ -100,7 +100,7 @@ void Wizard::OnUpdate(float fElapsedTime){
|
||||
bool Wizard::AutoAttack(){
|
||||
attack_cooldown_timer=MAGIC_ATTACK_COOLDOWN;
|
||||
float angleToCursor=atan2(game->GetWorldMousePos().y-GetPos().y,game->GetWorldMousePos().x-GetPos().x);
|
||||
BULLET_LIST.push_back(std::make_unique<EnergyBolt>(EnergyBolt(GetPos(),{cos(angleToCursor)*"Wizard.Auto Attack.Speed"_F,sin(angleToCursor)*"Wizard.Auto Attack.Speed"_F},"Wizard.Auto Attack.Radius"_F/100*12,GetAttack()*"Wizard.Auto Attack.DamageMult"_F,upperLevel,true,WHITE)));
|
||||
BULLET_LIST.push_back(std::make_unique<EnergyBolt>(EnergyBolt(GetPos(),{cos(angleToCursor)*"Wizard.Auto Attack.Speed"_F,sin(angleToCursor)*"Wizard.Auto Attack.Speed"_F},"Wizard.Auto Attack.Radius"_F/100*12,int(GetAttack()*"Wizard.Auto Attack.DamageMult"_F),upperLevel,true,WHITE)));
|
||||
return true;
|
||||
}
|
||||
void Wizard::InitializeClassAbilities(){
|
||||
@@ -112,11 +112,11 @@ void Wizard::InitializeClassAbilities(){
|
||||
float dist=std::clamp(geom2d::line<float>{p->GetPos(),game->GetWorldMousePos()}.length(),0.f,"Wizard.Right Click Ability.TeleportRange"_F/100*24);
|
||||
if(dist<"Wizard.Right Click Ability.TilesMin"_I*12)return false;
|
||||
vf2d teleportPoint=p->GetPos()+pointTowardsMouse*dist;
|
||||
while(dist>0&&game->HasTileCollision(game->GetCurrentLevel(),teleportPoint)&&p->CanPathfindTo(p->GetPos(),teleportPoint,"Wizard.Right Click Ability.TilesMax"_I)){
|
||||
while(dist>0&&game->HasTileCollision(game->GetCurrentLevel(),teleportPoint)&&p->CanPathfindTo(p->GetPos(),teleportPoint,float("Wizard.Right Click Ability.TilesMax"_I))){
|
||||
dist-=4;
|
||||
teleportPoint=p->GetPos()+pointTowardsMouse*dist;
|
||||
}
|
||||
if(dist>0&&p->CanPathfindTo(p->GetPos(),teleportPoint,"Wizard.Right Click Ability.TilesMax"_I)){
|
||||
if(dist>0&&p->CanPathfindTo(p->GetPos(),teleportPoint,float("Wizard.Right Click Ability.TilesMax"_I))){
|
||||
p->SetState(State::TELEPORT);
|
||||
p->teleportAnimationTimer="Wizard.Right Click Ability.AnimationTime"_F;
|
||||
p->teleportTarget=teleportPoint;
|
||||
@@ -136,7 +136,7 @@ void Wizard::InitializeClassAbilities(){
|
||||
Wizard::ability1.action=
|
||||
[](Player*p,vf2d pos={}){
|
||||
float angleToCursor=atan2(game->GetWorldMousePos().y-p->GetPos().y,game->GetWorldMousePos().x-p->GetPos().x);
|
||||
BULLET_LIST.push_back(std::make_unique<FireBolt>(FireBolt(p->GetPos(),{cos(angleToCursor)*"Wizard.Ability 1.BulletSpeed"_F,sin(angleToCursor)*"Wizard.Ability 1.BulletSpeed"_F},"Wizard.Ability 1.Radius"_F/100*12,p->GetAttack()*"Wizard.Ability 1.InitialDamageMult"_F,p->upperLevel,true,"Wizard.Ability 1.BulletColor"_Pixel)));
|
||||
BULLET_LIST.push_back(std::make_unique<FireBolt>(FireBolt(p->GetPos(),{cos(angleToCursor)*"Wizard.Ability 1.BulletSpeed"_F,sin(angleToCursor)*"Wizard.Ability 1.BulletSpeed"_F},"Wizard.Ability 1.Radius"_F/100*12,int(p->GetAttack()*"Wizard.Ability 1.InitialDamageMult"_F),p->upperLevel,true,"Wizard.Ability 1.BulletColor"_Pixel)));
|
||||
return true;
|
||||
};
|
||||
#pragma endregion
|
||||
@@ -144,7 +144,7 @@ void Wizard::InitializeClassAbilities(){
|
||||
Wizard::ability2.action=
|
||||
[](Player*p,vf2d pos={}){
|
||||
float angleToCursor=atan2(game->GetWorldMousePos().y-p->GetPos().y,game->GetWorldMousePos().x-p->GetPos().x);
|
||||
BULLET_LIST.push_back(std::make_unique<LightningBolt>(LightningBolt(p->GetPos(),{cos(angleToCursor)*"Wizard.Ability 2.BulletSpeed"_F,sin(angleToCursor)*"Wizard.Ability 2.BulletSpeed"_F},"Wizard.Ability 2.Radius"_F/100*12,p->GetAttack()*"Wizard.Ability 2.DamageMult"_F,p->upperLevel,true,"Wizard.Ability 2.BulletColor"_Pixel)));
|
||||
BULLET_LIST.push_back(std::make_unique<LightningBolt>(LightningBolt(p->GetPos(),{cos(angleToCursor)*"Wizard.Ability 2.BulletSpeed"_F,sin(angleToCursor)*"Wizard.Ability 2.BulletSpeed"_F},"Wizard.Ability 2.Radius"_F/100*12,int(p->GetAttack()*"Wizard.Ability 2.DamageMult"_F),p->upperLevel,true,"Wizard.Ability 2.BulletColor"_Pixel)));
|
||||
return true;
|
||||
};
|
||||
#pragma endregion
|
||||
|
||||
Reference in New Issue
Block a user