mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-04 17:57:47 +00:00
add rudimentary action comboing, doesn't highlight actions on the hotbar
This commit is contained in:
parent
5802c813fe
commit
789b5dfd9e
8 changed files with 131 additions and 0 deletions
22
src/scripts/action/darkknight/ActionHardSlash3617.cpp
Normal file
22
src/scripts/action/darkknight/ActionHardSlash3617.cpp
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include <Action/Action.h>
|
||||||
|
|
||||||
|
class ActionHardSlash3617 :
|
||||||
|
public Sapphire::ScriptAPI::ActionScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ActionHardSlash3617() :
|
||||||
|
Sapphire::ScriptAPI::ActionScript( 3617 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void onExecute( Sapphire::Action::Action& action ) override
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
EXPOSE_SCRIPT( ActionHardSlash3617 );
|
22
src/scripts/action/darkknight/ActionPowerSlash3627.cpp
Normal file
22
src/scripts/action/darkknight/ActionPowerSlash3627.cpp
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include <Action/Action.h>
|
||||||
|
|
||||||
|
class ActionPowerSlash3627 :
|
||||||
|
public Sapphire::ScriptAPI::ActionScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ActionPowerSlash3627() :
|
||||||
|
Sapphire::ScriptAPI::ActionScript( 3627 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void onExecute( Sapphire::Action::Action& action ) override
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
EXPOSE_SCRIPT( ActionPowerSlash3627 );
|
22
src/scripts/action/darkknight/ActionSpinningSlash3619.cpp
Normal file
22
src/scripts/action/darkknight/ActionSpinningSlash3619.cpp
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include <Action/Action.h>
|
||||||
|
|
||||||
|
class ActionSpinningSlash3619 :
|
||||||
|
public Sapphire::ScriptAPI::ActionScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ActionSpinningSlash3619() :
|
||||||
|
Sapphire::ScriptAPI::ActionScript( 3619 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void onExecute( Sapphire::Action::Action& action ) override
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
EXPOSE_SCRIPT( ActionSpinningSlash3619 );
|
22
src/scripts/action/darkknight/ActionSyphonStrike3623.cpp
Normal file
22
src/scripts/action/darkknight/ActionSyphonStrike3623.cpp
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include <Action/Action.h>
|
||||||
|
|
||||||
|
class ActionSyphonStrike3623 :
|
||||||
|
public Sapphire::ScriptAPI::ActionScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ActionSyphonStrike3623() :
|
||||||
|
Sapphire::ScriptAPI::ActionScript( 3623 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void onExecute( Sapphire::Action::Action& action ) override
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
EXPOSE_SCRIPT( ActionSyphonStrike3623 );
|
|
@ -281,6 +281,13 @@ void Sapphire::Action::Action::execute()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( isComboAction() )
|
||||||
|
{
|
||||||
|
auto player = m_pSource->getAsPlayer();
|
||||||
|
|
||||||
|
player->sendDebug( "action combo success from action#{0}", player->getLastComboActionId() );
|
||||||
|
}
|
||||||
|
|
||||||
if( !hasClientsideTarget() )
|
if( !hasClientsideTarget() )
|
||||||
{
|
{
|
||||||
pScriptMgr->onExecute( *this );
|
pScriptMgr->onExecute( *this );
|
||||||
|
@ -290,6 +297,13 @@ void Sapphire::Action::Action::execute()
|
||||||
pScriptMgr->onEObjHit( *player, m_targetId, getId() );
|
pScriptMgr->onEObjHit( *player, m_targetId, getId() );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set currently casted action as the combo action if it interrupts a combo
|
||||||
|
// ignore it otherwise (ogcds, etc.)
|
||||||
|
if( !m_actionData->preservesCombo )
|
||||||
|
{
|
||||||
|
m_pSource->setLastComboActionId( getId() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sapphire::Action::Action::calculateActionCost()
|
void Sapphire::Action::Action::calculateActionCost()
|
||||||
|
@ -399,4 +413,16 @@ uint32_t Sapphire::Action::Action::getAdditionalData() const
|
||||||
void Sapphire::Action::Action::setAdditionalData( uint32_t data )
|
void Sapphire::Action::Action::setAdditionalData( uint32_t data )
|
||||||
{
|
{
|
||||||
m_additionalData = data;
|
m_additionalData = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Sapphire::Action::Action::isComboAction() const
|
||||||
|
{
|
||||||
|
auto lastActionId = m_pSource->getLastComboActionId();
|
||||||
|
|
||||||
|
if( lastActionId == 0 )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_actionData->actionCombo == lastActionId;
|
||||||
}
|
}
|
|
@ -45,6 +45,8 @@ namespace Sapphire::Action
|
||||||
uint32_t getAdditionalData() const;
|
uint32_t getAdditionalData() const;
|
||||||
void setAdditionalData( uint32_t data );
|
void setAdditionalData( uint32_t data );
|
||||||
|
|
||||||
|
bool isComboAction() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Checks if the action *may* target a resident instead of an actor
|
* @brief Checks if the action *may* target a resident instead of an actor
|
||||||
* @return true if the target *may* be a resident and not an actor, otherwise false.
|
* @return true if the target *may* be a resident and not an actor, otherwise false.
|
||||||
|
|
|
@ -658,3 +658,13 @@ int64_t Sapphire::Entity::Chara::getLastUpdateTime() const
|
||||||
{
|
{
|
||||||
return m_lastUpdate;
|
return m_lastUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sapphire::Entity::Chara::setLastComboActionId( uint32_t actionId )
|
||||||
|
{
|
||||||
|
m_lastComboActionId = actionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t Sapphire::Entity::Chara::getLastComboActionId() const
|
||||||
|
{
|
||||||
|
return m_lastComboActionId;
|
||||||
|
}
|
||||||
|
|
|
@ -102,6 +102,8 @@ namespace Sapphire::Entity
|
||||||
uint64_t m_targetId;
|
uint64_t m_targetId;
|
||||||
/*! Ptr to a queued action */
|
/*! Ptr to a queued action */
|
||||||
Action::ActionPtr m_pCurrentAction;
|
Action::ActionPtr m_pCurrentAction;
|
||||||
|
/*! the id of the last combo action used (IgnoresCombo) */
|
||||||
|
uint32_t m_lastComboActionId;
|
||||||
/*! Invincibility type */
|
/*! Invincibility type */
|
||||||
Common::InvincibilityType m_invincibilityType;
|
Common::InvincibilityType m_invincibilityType;
|
||||||
|
|
||||||
|
@ -243,6 +245,9 @@ namespace Sapphire::Entity
|
||||||
|
|
||||||
void setCurrentAction( Action::ActionPtr pAction );
|
void setCurrentAction( Action::ActionPtr pAction );
|
||||||
|
|
||||||
|
uint32_t getLastComboActionId() const;
|
||||||
|
void setLastComboActionId( uint32_t actionId );
|
||||||
|
|
||||||
uint32_t getBonusStat( Common::BaseParam bonus ) const;
|
uint32_t getBonusStat( Common::BaseParam bonus ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue