1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 06:47:45 +00:00

parse combo data in actionlut; check for nextcombo/ogcd to allow ogcd weaving in combos;

This commit is contained in:
Alice Ogeda 2022-01-20 20:14:34 -03:00
parent 00ecce8406
commit 1235ea99ac
4 changed files with 8562 additions and 8538 deletions

View file

@ -25,7 +25,8 @@ namespace fs = std::filesystem;
using namespace Sapphire;
Sapphire::Data::ExdData g_exdDataGen;
std::string datLocation( "F:\\client3.0\\game\\sqpack" );
//std::string datLocation( "F:\\client3.0\\game\\sqpack" );
std::string datLocation( "C:\\Data\\Dev\\ffxiv3.01\\game\\sqpack" );
//const std::string datLocation( "/mnt/c/Program Files (x86)/Steam/steamapps/common/FINAL FANTASY XIV Online/game/sqpack" );
struct ActionEntry
@ -39,6 +40,7 @@ struct ActionEntry
uint32_t rearPotency;
uint32_t curePotency;
uint32_t restorePercentage;
std::vector< uint32_t > nextCombo{};
};
bool invalidChar( char c )
@ -69,6 +71,19 @@ uint32_t stripNonNumerics( std::string& str )
return std::atoi( str.c_str() );
}
template< typename T >
std::string stringVec( const std::vector< T >& vec )
{
if( vec.empty() )
return "";
std::ostringstream oss;
std::copy( vec.begin(), vec.end() - 1, std::ostream_iterator< T >( oss, ", " ) );
oss << vec.back();
return oss.str();
}
int main( int argc, char* argv[] )
{
@ -91,6 +106,7 @@ int main( int argc, char* argv[] )
auto idList = g_exdDataGen.getIdList< Component::Excel::Action >();
std::map< uint32_t, ActionEntry > actions;
std::map< uint32_t, std::vector< uint32_t > > traversedCombos;
auto total = idList.size();
int cursor = 0;
@ -122,9 +138,6 @@ int main( int argc, char* argv[] )
// if( classJob->data().CraftingClassIndex > 0 )
// continue;
if( id == 75 )
int test = 1;
auto ac = static_cast< Common::ActionCategory >( actionData.Category );
if( ac != Common::ActionCategory::Ability &&
ac != Common::ActionCategory::Autoattack &&
@ -244,6 +257,8 @@ int main( int argc, char* argv[] )
}
actions[ id ] = std::move( entry );
if( actionData.ComboParent )
traversedCombos[ actionData.ComboParent ].push_back( id );
}
else
Logger::warn( "failed to get classjob {}", 1 );
@ -253,18 +268,26 @@ int main( int argc, char* argv[] )
Logger::info( "Found {} player actions", actions.size() );
std::string output;
Logger::info( std::to_string( traversedCombos.size() ) );
for( const auto& action : actions )
{
const auto& data = action.second;
auto data = action.second;
// check if we have combo data to insert
if( auto it{ traversedCombos.find( data.id ) }; it != std::end( traversedCombos ) )
data.nextCombo = traversedCombos[ data.id ];
// Logger::info( " - {:<5} {:<25} pot: {:<4} flank pot: {:<4} front pot: {:<4} rear pot: {:<4} cure pot: {:<4} restore %: {:<4}",
// action.first, data.name, data.potency, data.flankPotency, data.frontPotency, data.rearPotency,
// data.curePotency, data.restorePercentage );
auto out = fmt::format( " // {}\n {{ {}, {{ {}, {}, {}, {}, {}, {}, {} }} }},\n",
auto comboStr = stringVec( data.nextCombo );
if( !comboStr.empty() )
comboStr = " " + comboStr + " ";
auto out = fmt::format( " // {}\n {{ {}, {{ {}, {}, {}, {}, {}, {}, {}, {{{}}} }} }},\n",
data.name, action.first,
data.potency, data.comboPotency,
data.flankPotency, data.frontPotency, data.rearPotency,
data.curePotency, 0 );
data.curePotency, 0, comboStr );
output += out;
// Logger::info( out );

View file

@ -568,7 +568,7 @@ void Action::Action::buildEffects()
shouldRestoreMP = false;
}
if( isWeaponskill() && !m_actionData->data().ComboContinue ) // we need something like m_actionData->hasNextComboAction
if( !m_lutEntry.nextCombo.empty() ) // if we have a combo action followup
{
m_effectBuilder->startCombo( m_pSource, getId() ); // this is on all targets hit
}

View file

@ -14,6 +14,7 @@ namespace Sapphire::World::Action
uint16_t rearPotency;
uint16_t curePotency;
uint16_t restoreMPPercentage;
std::vector< uint32_t > nextCombo;
};
class ActionLut

File diff suppressed because it is too large Load diff