Fix buff items so stat ups for zero intensity values are not applied. Add Move Spd % stat up buff to move speed multiplier calculation function. Boars now lock-on their position when they scratch the ground to prevent surprise turnarounds last second, and make them slightly easier to dodge. Fix bugged pathfinding for Thief Deadly Dash when pointing the cursor at a solid collision tile. Was just absolutely utterly stupidly broken. Fixed of course. Release Build 10183.

mac-build
sigonasr2 4 months ago
parent 8abb9e64af
commit fa5031a50b
  1. 10
      Adventures in Lestoria/Boar.cpp
  2. 1
      Adventures in Lestoria/Item.cpp
  3. 31
      Adventures in Lestoria/Player.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. BIN
      Adventures in Lestoria/assets/nico-Thief_512.png
  6. BIN
      Adventures in Lestoria/assets/nico-Trapper_512.png
  7. BIN
      x64/Release/Adventures in Lestoria.exe

@ -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<float>(m.GetPos(),game->GetPlayer()->GetPos()).rpoint(ConfigFloat("Charge Distance")/100.f*24);
float distanceToChargePoint=geom2d::line<float>(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<float>(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<float>(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());

@ -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)});
}

@ -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::set<ItemAttribute>attr){
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::set<std::string>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")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::function<void(AiL*,int)>repeatAction){
@ -1699,26 +1702,22 @@ vf2d Player::MoveUsingPathfinding(vf2d targetPos){
vf2d pointTowardsMouse={cos(pointMouseDirection),sin(pointMouseDirection)};
float dist{geom2d::line<float>{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::rect<float>collisionRect=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<float>(teleportPoint,4),collisionRect);};
#pragma endregion
while(dist>0){
vi2d tilePos=vi2d(teleportPoint/float(game->GetCurrentMapData().tilewidth))*game->GetCurrentMapData().tilewidth;
geom2d::rect<float>collisionRect=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<float>(teleportPoint,4),collisionRect);};
#pragma endregion
if(CanPathfindTo(GetPos(),teleportPoint,12)
&&(NoTileCollisionExistsHere()||NoPlayerCollisionWithTile())){
return teleportPoint;
}
dist-=4;
teleportPoint=GetPos()+pointTowardsMouse*dist;
}
return GetPos();
}

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Loading…
Cancel
Save