diff --git a/Adventures in Lestoria/Boar.cpp b/Adventures in Lestoria/Boar.cpp index 23161b9f..8bb3ee32 100644 --- a/Adventures in Lestoria/Boar.cpp +++ b/Adventures in Lestoria/Boar.cpp @@ -76,6 +76,11 @@ void Monster::STRATEGY::BOAR(Monster&m,float fElapsedTime,std::string strategy){ m.PerformAnimation("SCRATCH"); m.F(A::CASTING_TIMER)=ConfigInt("Ground Scratch Count")*m.GetCurrentAnimation().GetTotalAnimationDuration(); m.phase=PhaseName::SCRATCH; + + vf2d chargeTargetPoint=geom2d::line(m.GetPos(),game->GetPlayer()->GetPos()).rpoint(ConfigFloat("Charge Distance")/100.f*24); + float distanceToChargePoint=geom2d::line(m.GetPos(),chargeTargetPoint).length(); + m.F(A::TARGET_TIMER)=distanceToChargePoint/(100.f*m.GetMoveSpdMult()); //This should be how long a charge takes. + m.target=chargeTargetPoint; } }break; case PhaseName::SCRATCH:{ @@ -85,13 +90,8 @@ void Monster::STRATEGY::BOAR(Monster&m,float fElapsedTime,std::string strategy){ m.PerformShootAnimation(); m.phase=PhaseName::CHARGE; - vf2d chargeTargetPoint=geom2d::line(m.GetPos(),game->GetPlayer()->GetPos()).rpoint(ConfigFloat("Charge Distance")/100.f*24); - - m.target=chargeTargetPoint; m.AddBuff(BuffType::SPEEDBOOST,INFINITE,ConfigFloat("Charge Movespeed")/100.f-1); - float distanceToChargePoint=geom2d::line(m.GetPos(),chargeTargetPoint).length(); - m.F(A::TARGET_TIMER)=distanceToChargePoint/(100.f*m.GetMoveSpdMult()); //This should be how long a charge takes. m.AddBuff(BuffType::COLLISION_KNOCKBACK_STRENGTH,15,ConfigFloat("Charge Knockback Amount")); } m.UpdateFacingDirection(game->GetPlayer()->GetPos()); diff --git a/Adventures in Lestoria/Item.cpp b/Adventures in Lestoria/Item.cpp index 6abe4fc0..a7238cfc 100644 --- a/Adventures in Lestoria/Item.cpp +++ b/Adventures in Lestoria/Item.cpp @@ -419,6 +419,7 @@ void ItemInfo::InitializeScripts(){ ITEM_SCRIPTS["Buff"]=[](AiL*game,ItemProps props){ for(auto&[key,value]:ItemAttribute::attributes){ float intensity=props.GetFloatProp(key,0); + if(intensity==0.f)continue; if(ItemAttribute::Get(key).DisplayAsPercent())intensity/=100; game->GetPlayer()->AddBuff(BuffType::STAT_UP,props.GetFloatProp(key,1),intensity,{ItemAttribute::Get(key)}); } diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index e1f3c2fe..bc6fa354 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -289,6 +289,9 @@ float Player::GetMoveSpdMult(){ for(const Buff&b:GetBuffs(SPEEDBOOST)){ mod_moveSpd+=moveSpdPct*b.intensity; } + for(const Buff&b:GetStatBuffs({"Move Spd %"})){ + mod_moveSpd+=moveSpdPct*b.intensity; + } for(const Buff&b:GetBuffs(BuffType::ADRENALINE_RUSH)){ mod_moveSpd+=moveSpdPct*"Thief.Ability 3.Movement Speed Increase"_F/100.f; } @@ -986,11 +989,11 @@ void Player::AddBuff(BuffType type,float duration,float intensity){ buffList.push_back(Buff{type,duration,intensity}); } void Player::AddBuff(BuffType type,float duration,float intensity,std::setattr){ - if(type==STAT_UP)std::for_each(attr.begin(),attr.end(),[](const ItemAttribute&attr){if(attr.ActualName()!="Health"&&attr.ActualName()!="Health %"&&attr.ActualName()!="Attack"&&attr.ActualName()!="Attack %"&&attr.ActualName()!="Defense"&&attr.ActualName()!="Defense %"&&attr.ActualName()!="CDR")ERR(std::format("WARNING! Stat Up Attribute type {} is NOT IMPLEMENTED!",attr.ActualName()));}); + if(type==STAT_UP)std::for_each(attr.begin(),attr.end(),[](const ItemAttribute&attr){if(attr.ActualName()!="Health"&&attr.ActualName()!="Health %"&&attr.ActualName()!="Attack"&&attr.ActualName()!="Attack %"&&attr.ActualName()!="Defense"&&attr.ActualName()!="Defense %"&&attr.ActualName()!="CDR"&&attr.ActualName()!="Move Spd %")ERR(std::format("WARNING! Stat Up Attribute type {} is NOT IMPLEMENTED!",attr.ActualName()));}); buffList.push_back(Buff{type,duration,intensity,attr}); } void Player::AddBuff(BuffType type,float duration,float intensity,std::setattr){ - if(type==STAT_UP)std::for_each(attr.begin(),attr.end(),[](const std::string&attr){if(attr!="Health"&&attr!="Health %"&&attr!="Attack"&&attr!="Attack %"&&attr!="Defense"&&attr!="Defense %"&&attr!="CDR")ERR(std::format("WARNING! Stat Up Attribute type {} is NOT IMPLEMENTED!",attr));}); + if(type==STAT_UP)std::for_each(attr.begin(),attr.end(),[](const std::string&attr){if(attr!="Health"&&attr!="Health %"&&attr!="Attack"&&attr!="Attack %"&&attr!="Defense"&&attr!="Defense %"&&attr!="CDR"&&attr!="Move Spd %")ERR(std::format("WARNING! Stat Up Attribute type {} is NOT IMPLEMENTED!",attr));}); buffList.push_back(Buff{type,duration,intensity,attr}); } void Player::AddBuff(BuffType type,float duration,float intensity,float timeBetweenTicks,std::functionrepeatAction){ @@ -1699,26 +1702,22 @@ vf2d Player::MoveUsingPathfinding(vf2d targetPos){ vf2d pointTowardsMouse={cos(pointMouseDirection),sin(pointMouseDirection)}; float dist{geom2d::line{GetPos(),targetPos}.length()}; vf2d teleportPoint=GetPos()+pointTowardsMouse*dist; - while(dist>0&&game->HasTileCollision(game->GetCurrentLevel(),teleportPoint)&&CanPathfindTo(GetPos(),teleportPoint,12)){ - dist-=4; - teleportPoint=GetPos()+pointTowardsMouse*dist; - } - vi2d tilePos=vi2d(teleportPoint/float(game->GetCurrentMapData().tilewidth))*game->GetCurrentMapData().tilewidth; - geom2d::rectcollisionRect=game->GetTileCollision(game->GetCurrentLevel(),teleportPoint,OnUpperLevel()); - #pragma region lambdas - auto NoTileCollisionExistsHere=[&](){return collisionRect==game->NO_COLLISION;}; - #pragma endregion - collisionRect.pos+=tilePos; - #pragma region lambdas - auto NoPlayerCollisionWithTile=[&](){return !geom2d::overlaps(geom2d::circle(teleportPoint,4),collisionRect);}; - #pragma endregion - while(dist>0){ + vi2d tilePos=vi2d(teleportPoint/float(game->GetCurrentMapData().tilewidth))*game->GetCurrentMapData().tilewidth; + geom2d::rectcollisionRect=game->GetTileCollision(game->GetCurrentLevel(),teleportPoint,OnUpperLevel()); + collisionRect.pos+=tilePos; + #pragma region lambdas + auto NoTileCollisionExistsHere=[&](){return collisionRect==game->NO_COLLISION;}; + #pragma endregion + #pragma region lambdas + auto NoPlayerCollisionWithTile=[&](){return !geom2d::overlaps(geom2d::circle(teleportPoint,4),collisionRect);}; + #pragma endregion if(CanPathfindTo(GetPos(),teleportPoint,12) &&(NoTileCollisionExistsHere()||NoPlayerCollisionWithTile())){ return teleportPoint; } dist-=4; + teleportPoint=GetPos()+pointTowardsMouse*dist; } return GetPos(); } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index b196c7fb..80d3ad14 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 3 -#define VERSION_BUILD 10176 +#define VERSION_BUILD 10183 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/nico-Thief_512.png b/Adventures in Lestoria/assets/nico-Thief_512.png index 1d336f83..6efbf6fe 100644 Binary files a/Adventures in Lestoria/assets/nico-Thief_512.png and b/Adventures in Lestoria/assets/nico-Thief_512.png differ diff --git a/Adventures in Lestoria/assets/nico-Trapper_512.png b/Adventures in Lestoria/assets/nico-Trapper_512.png index fd5ea273..379dc036 100644 Binary files a/Adventures in Lestoria/assets/nico-Trapper_512.png and b/Adventures in Lestoria/assets/nico-Trapper_512.png differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 6a55c4b2..200cc534 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ