More casts to make gcc happy. Change 2nd chapter bonus boss mob counter from using std::reduce to std::accumulate (Apparently gcc is ambiguous about argument order?? wtf)

removeExposedPackKey
sigonasr2 5 months ago
parent c6c3e5cf72
commit c83aff8962
  1. 4
      Adventures in Lestoria/MajorHawk.cpp
  2. 4
      Adventures in Lestoria/Zephy.cpp

@ -49,8 +49,8 @@ using A=Attribute;
void Monster::STRATEGY::MAJOR_HAWK(Monster&m,float fElapsedTime,std::string strategy){
//Runs the Hawk strategy and has an aggressive mode when the amount of this monster falls below an amount.
const int majorHawkCount=std::reduce(MONSTER_LIST.begin(),MONSTER_LIST.end(),0,[&](const int&acc,const std::unique_ptr<Monster>&monster){return std::move(acc)+((monster->IsAlive()&&monster->GetName()==ConfigString("Aggressive Name Check"))?1:0);});
const int majorHawkCount=std::accumulate(MONSTER_LIST.begin(),MONSTER_LIST.end(),0,[&](const int&acc,const std::unique_ptr<Monster>&monster){return std::move(acc)+((monster->IsAlive()&&monster->GetName()==ConfigString("Aggressive Name Check"))?1:0);});
if(majorHawkCount<=ConfigInt("Aggressive Hawk Count"))HAWK(m,fElapsedTime,"Major Hawk");
else HAWK(m,fElapsedTime,"Hawk"); //Use normal hawk behaviors when there are too many Major Hawks.
}
}

@ -80,7 +80,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
#pragma region Flying Hover Effect
if(m.F(A::TARGET_FLYING_HEIGHT)==0.f)m.SetZ(std::max(m.F(A::FLYING_HEIGHT),0.f));
else m.SetZ(std::max(m.F(A::FLYING_HEIGHT)+ConfigFloat("Flight Oscillation Amount")*sin((PI*m.TimeSpentAlive())/1.5f),0.f));
else m.SetZ(std::max(float(m.F(A::FLYING_HEIGHT)+ConfigFloat("Flight Oscillation Amount")*sin((PI*m.TimeSpentAlive())/1.5f)),0.f));
#pragma endregion
if(m.F(A::FLYING_HEIGHT)<m.F(A::TARGET_FLYING_HEIGHT))m.F(A::FLYING_HEIGHT)=std::min(m.F(A::TARGET_FLYING_HEIGHT),m.F(A::FLYING_HEIGHT)+ConfigPixels("Fly Rise/Fall Speed")*fElapsedTime);
else if(m.F(A::FLYING_HEIGHT)>-ConfigFloat("Flight Oscillation Amount"))m.F(A::FLYING_HEIGHT)=std::max(-ConfigFloat("Flight Oscillation Amount"),m.F(A::FLYING_HEIGHT)-ConfigPixels("Fly Rise/Fall Speed")*fElapsedTime);
@ -380,4 +380,4 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
}
}break;
}
}
}

Loading…
Cancel
Save