2017-08-08 13:53:47 +02:00
|
|
|
#include "Action.h"
|
|
|
|
|
2019-02-08 22:09:48 +11:00
|
|
|
#include <Exd/ExdDataGenerated.h>
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Util/Util.h>
|
2019-02-08 22:09:48 +11:00
|
|
|
#include "Framework.h"
|
|
|
|
#include "Script/ScriptMgr.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2019-03-23 11:48:49 +11:00
|
|
|
#include <Math/CalcStats.h>
|
|
|
|
|
2019-02-08 22:09:48 +11:00
|
|
|
#include "Actor/Player.h"
|
2019-02-11 10:36:17 +11:00
|
|
|
#include "Actor/BNpc.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2019-02-11 11:47:04 +11:00
|
|
|
#include "Territory/Zone.h"
|
|
|
|
|
2019-02-08 22:09:48 +11:00
|
|
|
#include <Network/CommonActorControl.h>
|
|
|
|
#include "Network/PacketWrappers/ActorControlPacket142.h"
|
|
|
|
#include "Network/PacketWrappers/ActorControlPacket143.h"
|
|
|
|
#include "Network/PacketWrappers/ActorControlPacket144.h"
|
2019-02-11 00:11:29 +11:00
|
|
|
#include <Network/PacketWrappers/EffectPacket.h>
|
2019-02-08 22:09:48 +11:00
|
|
|
|
|
|
|
using namespace Sapphire::Common;
|
|
|
|
using namespace Sapphire::Network;
|
|
|
|
using namespace Sapphire::Network::Packets;
|
|
|
|
using namespace Sapphire::Network::Packets::Server;
|
|
|
|
using namespace Sapphire::Network::ActorControl;
|
|
|
|
|
|
|
|
|
|
|
|
Sapphire::Action::Action::Action() = default;
|
|
|
|
Sapphire::Action::Action::~Action() = default;
|
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
Sapphire::Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId, FrameworkPtr fw ) :
|
|
|
|
Action( std::move( caster ), actionId, nullptr, std::move( fw ) )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-02-09 15:39:05 +11:00
|
|
|
Sapphire::Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId,
|
2019-03-07 20:27:45 +11:00
|
|
|
Data::ActionPtr actionData, FrameworkPtr fw ) :
|
2019-02-08 22:09:48 +11:00
|
|
|
m_pSource( std::move( caster ) ),
|
|
|
|
m_pFw( std::move( fw ) ),
|
2019-03-07 21:58:12 +11:00
|
|
|
m_actionData( std::move( actionData ) ),
|
2019-02-08 22:09:48 +11:00
|
|
|
m_id( actionId ),
|
2019-03-07 21:58:12 +11:00
|
|
|
m_targetId( 0 ),
|
2019-02-09 18:32:10 +11:00
|
|
|
m_startTime( 0 ),
|
2019-03-07 21:58:12 +11:00
|
|
|
m_interruptType( Common::ActionInterruptType::None )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t Sapphire::Action::Action::getId() const
|
|
|
|
{
|
|
|
|
return m_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Sapphire::Action::Action::init()
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2019-03-07 21:58:12 +11:00
|
|
|
if( !m_actionData )
|
|
|
|
{
|
|
|
|
// need to get actionData
|
|
|
|
auto exdData = m_pFw->get< Data::ExdDataGenerated >();
|
|
|
|
assert( exdData );
|
|
|
|
|
|
|
|
auto actionData = exdData->get< Data::Action >( m_id );
|
|
|
|
assert( actionData );
|
|
|
|
|
|
|
|
m_actionData = actionData;
|
|
|
|
}
|
2019-03-07 20:27:45 +11:00
|
|
|
|
2019-03-08 00:26:41 +11:00
|
|
|
m_castTimeMs = static_cast< uint32_t >( m_actionData->cast100ms * 100 );
|
|
|
|
m_recastTimeMs = static_cast< uint32_t >( m_actionData->recast100ms * 100 );
|
2019-03-07 21:58:12 +11:00
|
|
|
m_cooldownGroup = m_actionData->cooldownGroup;
|
|
|
|
m_range = m_actionData->range;
|
|
|
|
m_effectRange = m_actionData->effectRange;
|
|
|
|
m_aspect = static_cast< Common::ActionAspect >( m_actionData->aspect );
|
2019-02-11 01:50:41 +11:00
|
|
|
|
|
|
|
// a default range is set by the game for the class/job
|
|
|
|
if( m_range == -1 )
|
|
|
|
{
|
2019-03-07 21:58:12 +11:00
|
|
|
switch( static_cast< Common::ClassJob >( m_actionData->classJob ) )
|
2019-02-11 01:50:41 +11:00
|
|
|
{
|
|
|
|
case Common::ClassJob::Bard:
|
|
|
|
case Common::ClassJob::Archer:
|
|
|
|
m_range = 25;
|
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
// anything that isnt ranged
|
2019-02-11 01:50:41 +11:00
|
|
|
default:
|
|
|
|
m_range = 3;
|
|
|
|
}
|
|
|
|
}
|
2019-02-09 18:01:39 +11:00
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
m_primaryCostType = static_cast< Common::ActionPrimaryCostType >( m_actionData->costType );
|
|
|
|
m_primaryCost = m_actionData->cost;
|
2019-02-09 20:49:22 +11:00
|
|
|
|
2019-03-07 20:27:45 +11:00
|
|
|
// todo: add missing rows for secondaryCostType/secondaryCostType and rename the current rows to primaryCostX
|
2019-02-09 23:14:30 +11:00
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
return true;
|
2019-02-09 15:39:05 +11:00
|
|
|
}
|
2019-02-08 22:09:48 +11:00
|
|
|
|
2019-02-09 18:32:10 +11:00
|
|
|
void Sapphire::Action::Action::setPos( Sapphire::Common::FFXIVARR_POSITION3 pos )
|
|
|
|
{
|
|
|
|
m_pos = pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
Sapphire::Common::FFXIVARR_POSITION3 Sapphire::Action::Action::getPos() const
|
|
|
|
{
|
|
|
|
return m_pos;
|
|
|
|
}
|
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
void Sapphire::Action::Action::setTargetId( uint64_t targetId )
|
2019-02-10 22:13:47 +11:00
|
|
|
{
|
|
|
|
m_targetId = targetId;
|
|
|
|
}
|
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
uint64_t Sapphire::Action::Action::getTargetId() const
|
2019-02-10 22:13:47 +11:00
|
|
|
{
|
2019-03-07 21:58:12 +11:00
|
|
|
return m_targetId;
|
2019-02-10 22:13:47 +11:00
|
|
|
}
|
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
bool Sapphire::Action::Action::hasClientsideTarget() const
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2019-03-07 21:58:12 +11:00
|
|
|
return m_targetId > 0xFFFFFFFF;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
bool Sapphire::Action::Action::isInterrupted() const
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2019-02-10 21:21:34 +11:00
|
|
|
return m_interruptType != Common::ActionInterruptType::None;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
2019-02-10 21:21:34 +11:00
|
|
|
void Sapphire::Action::Action::setInterrupted( Common::ActionInterruptType type )
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2019-02-10 21:12:22 +11:00
|
|
|
m_interruptType = type;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
uint32_t Sapphire::Action::Action::getCastTime() const
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2019-03-08 00:26:41 +11:00
|
|
|
return m_castTimeMs;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
void Sapphire::Action::Action::setCastTime( uint32_t castTime )
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2019-03-08 00:26:41 +11:00
|
|
|
m_castTimeMs = castTime;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
2019-02-11 00:40:00 +11:00
|
|
|
bool Sapphire::Action::Action::hasCastTime() const
|
2019-02-08 22:09:48 +11:00
|
|
|
{
|
2019-03-08 00:26:41 +11:00
|
|
|
return m_castTimeMs > 0;
|
2019-02-08 22:09:48 +11:00
|
|
|
}
|
|
|
|
|
2019-02-11 10:14:14 +11:00
|
|
|
Sapphire::Entity::CharaPtr Sapphire::Action::Action::getSourceChara() const
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2018-08-29 21:40:59 +02:00
|
|
|
return m_pSource;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
bool Sapphire::Action::Action::update()
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2018-08-29 21:40:59 +02:00
|
|
|
// action has not been started yet
|
|
|
|
if( m_startTime == 0 )
|
|
|
|
return false;
|
|
|
|
|
2019-02-10 21:12:22 +11:00
|
|
|
if( isInterrupted() )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2019-03-07 20:33:14 +11:00
|
|
|
interrupt();
|
2018-08-29 21:40:59 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
if( !hasClientsideTarget() )
|
2019-02-10 22:13:47 +11:00
|
|
|
{
|
|
|
|
// todo: check if the target is still in range
|
|
|
|
}
|
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
uint64_t currTime = Util::getTimeMs();
|
|
|
|
|
2019-03-08 00:26:41 +11:00
|
|
|
if( !hasCastTime() || std::difftime( currTime, m_startTime ) > m_castTimeMs )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2019-03-07 20:33:14 +11:00
|
|
|
execute();
|
2018-08-29 21:40:59 +02:00
|
|
|
return true;
|
|
|
|
}
|
2019-02-10 21:01:04 +11:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
return false;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
2019-02-08 22:09:48 +11:00
|
|
|
|
2019-03-07 20:33:14 +11:00
|
|
|
void Sapphire::Action::Action::start()
|
2019-02-08 22:09:48 +11:00
|
|
|
{
|
|
|
|
assert( m_pSource );
|
|
|
|
|
2019-02-11 00:40:00 +11:00
|
|
|
m_startTime = Util::getTimeMs();
|
|
|
|
|
2019-02-10 22:13:47 +11:00
|
|
|
auto player = m_pSource->getAsPlayer();
|
|
|
|
|
2019-02-11 00:40:00 +11:00
|
|
|
if( hasCastTime() )
|
2019-02-08 22:09:48 +11:00
|
|
|
{
|
2019-02-09 15:45:02 +11:00
|
|
|
auto castPacket = makeZonePacket< Server::FFXIVIpcActorCast >( getId() );
|
2019-02-08 22:09:48 +11:00
|
|
|
|
2019-02-10 21:18:03 +11:00
|
|
|
castPacket->data().action_id = static_cast< uint16_t >( m_id );
|
2019-02-08 22:09:48 +11:00
|
|
|
castPacket->data().skillType = Common::SkillType::Normal;
|
|
|
|
castPacket->data().unknown_1 = m_id;
|
|
|
|
// This is used for the cast bar above the target bar of the caster.
|
2019-03-08 00:26:41 +11:00
|
|
|
castPacket->data().cast_time = m_castTimeMs / 1000.f;
|
2019-02-10 21:18:03 +11:00
|
|
|
castPacket->data().target_id = static_cast< uint32_t >( m_targetId );
|
2019-02-08 22:09:48 +11:00
|
|
|
|
|
|
|
m_pSource->sendToInRangeSet( castPacket, true );
|
2019-02-10 21:18:03 +11:00
|
|
|
|
2019-02-10 22:13:47 +11:00
|
|
|
if( player )
|
2019-02-10 21:18:03 +11:00
|
|
|
{
|
|
|
|
player->setStateFlag( PlayerStateFlag::Casting );
|
|
|
|
}
|
2019-02-08 22:09:48 +11:00
|
|
|
}
|
2019-02-10 23:34:05 +11:00
|
|
|
|
2019-03-08 00:26:41 +11:00
|
|
|
// todo: m_recastTimeMs needs to be adjusted for player sks/sps
|
|
|
|
auto actionStartPkt = makeActorControl143( m_pSource->getId(), ActorControlType::ActionStart, 1, getId(), m_recastTimeMs / 10 );
|
|
|
|
player->queuePacket( actionStartPkt );
|
|
|
|
|
2019-02-10 23:34:05 +11:00
|
|
|
auto pScriptMgr = m_pFw->get< Scripting::ScriptMgr >();
|
2019-03-07 20:27:45 +11:00
|
|
|
if( !pScriptMgr->onStart( *this ) )
|
2019-02-11 00:40:00 +11:00
|
|
|
{
|
|
|
|
// script not implemented
|
2019-03-07 20:33:14 +11:00
|
|
|
interrupt();
|
2019-02-11 00:40:00 +11:00
|
|
|
|
|
|
|
if( player )
|
|
|
|
{
|
2019-03-07 20:27:45 +11:00
|
|
|
player->sendUrgent( "Action not implemented, missing script for action#{0}", getId() );
|
2019-02-11 00:40:00 +11:00
|
|
|
player->setCurrentAction( nullptr );
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// instantly finish cast if there's no cast time
|
|
|
|
if( !hasCastTime() )
|
2019-03-07 20:33:14 +11:00
|
|
|
execute();
|
2019-02-08 22:09:48 +11:00
|
|
|
}
|
|
|
|
|
2019-03-07 20:33:14 +11:00
|
|
|
void Sapphire::Action::Action::interrupt()
|
2019-02-08 22:09:48 +11:00
|
|
|
{
|
|
|
|
assert( m_pSource );
|
|
|
|
|
2019-02-10 21:01:04 +11:00
|
|
|
// things that aren't players don't care about cooldowns and state flags
|
|
|
|
if( m_pSource->isPlayer() )
|
2019-02-08 22:09:48 +11:00
|
|
|
{
|
2019-02-10 21:01:04 +11:00
|
|
|
auto player = m_pSource->getAsPlayer();
|
|
|
|
|
|
|
|
// todo: reset cooldown for actual player
|
|
|
|
|
|
|
|
// reset state flag
|
2019-02-10 21:18:03 +11:00
|
|
|
//player->unsetStateFlag( PlayerStateFlag::Occupied1 );
|
2019-02-10 21:01:04 +11:00
|
|
|
player->unsetStateFlag( PlayerStateFlag::Casting );
|
|
|
|
}
|
|
|
|
|
2019-02-11 00:40:00 +11:00
|
|
|
if( hasCastTime() )
|
2019-02-10 21:01:04 +11:00
|
|
|
{
|
2019-02-10 21:12:22 +11:00
|
|
|
uint8_t interruptEffect = 0;
|
|
|
|
if( m_interruptType == ActionInterruptType::DamageInterrupt )
|
|
|
|
interruptEffect = 1;
|
|
|
|
|
|
|
|
// Note: When cast interrupt from taking too much damage, set the last value to 1.
|
|
|
|
// This enables the cast interrupt effect.
|
|
|
|
auto control = makeActorControl142( m_pSource->getId(), ActorControlType::CastInterrupt,
|
|
|
|
0x219, 1, m_id, interruptEffect );
|
2019-02-08 22:09:48 +11:00
|
|
|
|
|
|
|
m_pSource->sendToInRangeSet( control, true );
|
|
|
|
}
|
2019-02-10 23:34:05 +11:00
|
|
|
|
|
|
|
auto pScriptMgr = m_pFw->get< Scripting::ScriptMgr >();
|
2019-03-07 20:27:45 +11:00
|
|
|
pScriptMgr->onInterrupt( *this );
|
2019-02-08 22:09:48 +11:00
|
|
|
}
|
|
|
|
|
2019-03-07 20:33:14 +11:00
|
|
|
void Sapphire::Action::Action::execute()
|
2019-02-08 22:09:48 +11:00
|
|
|
{
|
|
|
|
assert( m_pSource );
|
|
|
|
|
|
|
|
auto pScriptMgr = m_pFw->get< Scripting::ScriptMgr >();
|
|
|
|
|
2019-02-11 00:40:00 +11:00
|
|
|
if( hasCastTime() )
|
2019-02-08 22:09:48 +11:00
|
|
|
{
|
2019-03-07 20:27:45 +11:00
|
|
|
// todo: what's this?
|
2019-02-08 22:09:48 +11:00
|
|
|
/*auto control = ActorControlPacket143( m_pTarget->getId(), ActorControlType::Unk7,
|
|
|
|
0x219, m_id, m_id, m_id, m_id );
|
|
|
|
m_pSource->sendToInRangeSet( control, true );*/
|
|
|
|
|
2019-03-07 22:41:05 +11:00
|
|
|
if( auto player = m_pSource->getAsPlayer() )
|
|
|
|
{
|
|
|
|
player->unsetStateFlag( PlayerStateFlag::Casting );
|
|
|
|
}
|
2019-02-10 22:13:47 +11:00
|
|
|
}
|
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
if( !hasClientsideTarget() )
|
2019-02-10 22:13:47 +11:00
|
|
|
{
|
2019-03-07 20:27:45 +11:00
|
|
|
pScriptMgr->onExecute( *this );
|
2019-02-08 22:09:48 +11:00
|
|
|
}
|
2019-02-11 14:51:56 +11:00
|
|
|
else if( auto player = m_pSource->getAsPlayer() )
|
2019-02-10 22:13:47 +11:00
|
|
|
{
|
2019-03-19 00:01:34 +11:00
|
|
|
pScriptMgr->onEObjHit( *player, m_targetId, getId() );
|
2019-02-10 23:28:15 +11:00
|
|
|
return;
|
2019-02-10 22:13:47 +11:00
|
|
|
}
|
2019-02-08 22:09:48 +11:00
|
|
|
}
|
2019-02-09 17:36:44 +11:00
|
|
|
|
2019-03-07 20:27:45 +11:00
|
|
|
void Sapphire::Action::Action::calculateActionCost()
|
2019-02-09 17:36:44 +11:00
|
|
|
{
|
2019-03-07 20:27:45 +11:00
|
|
|
// todo: just a test handler for now to get MP output for each cast, not sure where we should put this
|
|
|
|
// check primary cost
|
|
|
|
switch( m_primaryCostType )
|
2019-02-09 17:36:44 +11:00
|
|
|
{
|
2019-03-07 21:58:12 +11:00
|
|
|
case ActionPrimaryCostType::None:
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2019-03-07 20:27:45 +11:00
|
|
|
case ActionPrimaryCostType::MagicPoints:
|
2019-02-11 00:11:29 +11:00
|
|
|
{
|
2019-03-23 11:48:49 +11:00
|
|
|
// todo: not sure if we should store the final value like this?
|
|
|
|
m_primaryCost = Math::CalcStats::calculateMpCost( *m_pSource, m_primaryCost );
|
2019-03-07 20:27:45 +11:00
|
|
|
break;
|
2019-02-11 00:11:29 +11:00
|
|
|
}
|
2019-03-07 20:27:45 +11:00
|
|
|
case ActionPrimaryCostType::TacticsPoints:
|
2019-02-11 00:11:29 +11:00
|
|
|
{
|
2019-03-07 20:27:45 +11:00
|
|
|
break;
|
2019-02-11 00:11:29 +11:00
|
|
|
}
|
2019-02-09 17:36:44 +11:00
|
|
|
|
2019-03-07 20:27:45 +11:00
|
|
|
default:
|
2019-02-11 10:36:17 +11:00
|
|
|
{
|
2019-03-07 20:27:45 +11:00
|
|
|
if( auto player = m_pSource->getAsPlayer() )
|
2019-02-11 10:36:17 +11:00
|
|
|
{
|
2019-03-07 20:27:45 +11:00
|
|
|
player->sendDebug( "action#{0} is missing a handler for cost type: {1}",
|
|
|
|
m_id, static_cast< uint8_t >( m_primaryCostType ) );
|
2019-02-11 10:36:17 +11:00
|
|
|
}
|
2019-02-10 23:53:44 +11:00
|
|
|
|
2019-03-07 20:27:45 +11:00
|
|
|
break;
|
|
|
|
}
|
2019-02-09 17:36:44 +11:00
|
|
|
}
|
|
|
|
|
2019-03-07 20:27:45 +11:00
|
|
|
// todo: secondary cost type needs to be handled
|
2019-02-09 23:14:30 +11:00
|
|
|
}
|
|
|
|
|
2019-03-07 20:27:45 +11:00
|
|
|
bool Sapphire::Action::Action::precheck()
|
|
|
|
{
|
|
|
|
if( auto player = m_pSource->getAsPlayer() )
|
|
|
|
{
|
|
|
|
if( !playerPrecheck( *player ) )
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Sapphire::Action::Action::playerPrecheck( Entity::Player& player )
|
|
|
|
{
|
|
|
|
// lol
|
|
|
|
if( !player.isAlive() )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// npc actions/non player actions
|
|
|
|
if( m_actionData->classJob == -1 )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if( player.getLevel() < m_actionData->classJobLevel )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
auto currentClass = player.getClass();
|
|
|
|
auto actionClass = static_cast< Common::ClassJob >( m_actionData->classJob );
|
|
|
|
|
|
|
|
if( actionClass != Common::ClassJob::Adventurer && currentClass != actionClass )
|
|
|
|
{
|
|
|
|
// check if not a base class action
|
|
|
|
auto exdData = m_pFw->get< Data::ExdDataGenerated >();
|
|
|
|
assert( exdData );
|
|
|
|
|
|
|
|
auto classJob = exdData->get< Data::ClassJob >( static_cast< uint8_t >( currentClass ) );
|
|
|
|
if( !classJob )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if( classJob->classJobParent != m_actionData->classJob )
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// reset target on actions that can only be casted on yourself while having a target set
|
|
|
|
// todo: check what actions send when targeting an enemy
|
2019-03-07 21:58:12 +11:00
|
|
|
// if( m_actionData->canTargetSelf &&
|
|
|
|
// !m_actionData->canTargetFriendly &&
|
|
|
|
// !m_actionData->canTargetHostile &&
|
|
|
|
// !m_actionData->canTargetParty )
|
|
|
|
// {
|
|
|
|
// setTargetId( getSourceChara() );
|
|
|
|
// }
|
2019-03-07 20:27:45 +11:00
|
|
|
|
|
|
|
// todo: party/enemy validation
|
|
|
|
|
|
|
|
// validate range
|
|
|
|
|
|
|
|
|
|
|
|
// todo: validate costs/conditionals here
|
|
|
|
|
2019-03-07 21:58:12 +11:00
|
|
|
calculateActionCost();
|
|
|
|
|
2019-03-07 20:27:45 +11:00
|
|
|
return true;
|
2019-03-07 21:58:12 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t Sapphire::Action::Action::getAdditionalData() const
|
|
|
|
{
|
|
|
|
return m_additionalData;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Sapphire::Action::Action::setAdditionalData( uint32_t data )
|
|
|
|
{
|
|
|
|
m_additionalData = data;
|
2019-02-09 23:14:30 +11:00
|
|
|
}
|