mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 11:07:45 +00:00
Implement heavy shot, straight shot.
This commit is contained in:
parent
fd47ffb347
commit
a31098b4bf
6 changed files with 57 additions and 11 deletions
|
@ -581,6 +581,7 @@ namespace Sapphire::Common
|
|||
None = 0, // ?
|
||||
MagicPoints = 3,
|
||||
TacticsPoints = 5,
|
||||
StatusEffect = 10,
|
||||
// WARGauge = 22,
|
||||
// DRKGauge = 25,
|
||||
// AetherflowStack = 30,
|
||||
|
|
33
src/scripts/action/brd/ActionHeavyShot97.cpp
Normal file
33
src/scripts/action/brd/ActionHeavyShot97.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include <Script/NativeScriptApi.h>
|
||||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
#include <Action/Action.h>
|
||||
#include <Math/CalcStats.h>
|
||||
|
||||
#include "StatusEffect/StatusEffect.h"
|
||||
|
||||
using namespace Sapphire;
|
||||
using namespace Sapphire::StatusEffect;
|
||||
|
||||
const uint16_t STATUS_ID_STRAIGHT_SHOT_READY = 122;
|
||||
|
||||
class ActionHeavyShot97 :
|
||||
public ScriptAPI::ActionScript
|
||||
{
|
||||
public:
|
||||
ActionHeavyShot97() :
|
||||
ScriptAPI::ActionScript( 97 )
|
||||
{
|
||||
}
|
||||
|
||||
void onExecute( Sapphire::World::Action::Action& action ) override
|
||||
{
|
||||
if( action.getSourceChara()->getLevel() >= 2 && Math::CalcStats::getRandomNumber0To99() < 20 )
|
||||
{
|
||||
auto pEffect = action.createStatusEffect( STATUS_ID_STRAIGHT_SHOT_READY, action.getSourceChara(), action.getSourceChara(), 10000, 3000 );
|
||||
action.getEffectbuilder()->applyStatusEffect( action.getSourceChara(), action.getSourceChara(), pEffect );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( ActionHeavyShot97 );
|
|
@ -24,8 +24,8 @@ public:
|
|||
{
|
||||
if( action.getSourceChara()->getLevel() >= 30 && Math::CalcStats::getRandomNumber0To99() < 15 )
|
||||
{
|
||||
auto pFreeCure = action.createStatusEffect( STATUS_ID_FREECURE, action.getSourceChara(), action.getSourceChara(), 15000, 3000 );
|
||||
action.getEffectbuilder()->applyStatusEffect( action.getSourceChara(), action.getSourceChara(), pFreeCure );
|
||||
auto pEffect = action.createStatusEffect( STATUS_ID_FREECURE, action.getSourceChara(), action.getSourceChara(), 15000, 3000 );
|
||||
action.getEffectbuilder()->applyStatusEffect( action.getSourceChara(), action.getSourceChara(), pEffect );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -22,17 +22,17 @@ public:
|
|||
|
||||
void onExecute( Sapphire::World::Action::Action& action ) override
|
||||
{
|
||||
auto freecure = action.getSourceChara()->getStatusEffectById( STATUS_ID_FREECURE );
|
||||
if( freecure.second )
|
||||
auto effectEntry = action.getSourceChara()->getStatusEffectById( STATUS_ID_FREECURE );
|
||||
if( effectEntry.second )
|
||||
{
|
||||
action.getSourceChara()->removeStatusEffect( freecure.first );
|
||||
action.getSourceChara()->removeStatusEffect( effectEntry.first );
|
||||
}
|
||||
}
|
||||
|
||||
void onStart( Sapphire::World::Action::Action& action ) override
|
||||
{
|
||||
auto freecure = action.getSourceChara()->getStatusEffectById( STATUS_ID_FREECURE );
|
||||
if( freecure.second )
|
||||
auto effectEntry = action.getSourceChara()->getStatusEffectById( STATUS_ID_FREECURE );
|
||||
if( effectEntry.second )
|
||||
{
|
||||
action.setPrimaryCost( Common::ActionPrimaryCostType::None, 0 );
|
||||
}
|
||||
|
|
|
@ -683,6 +683,19 @@ bool Action::Action::primaryCostCheck( bool subtractCosts )
|
|||
return true;
|
||||
}
|
||||
|
||||
case Common::ActionPrimaryCostType::StatusEffect:
|
||||
{
|
||||
auto statusEntry = m_pSource->getStatusEffectById( m_primaryCost );
|
||||
|
||||
if( !statusEntry.second )
|
||||
return false;
|
||||
|
||||
if( subtractCosts )
|
||||
m_pSource->removeStatusEffect( statusEntry.first );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// free casts, likely just pure ogcds
|
||||
case Common::ActionPrimaryCostType::None:
|
||||
{
|
||||
|
|
|
@ -948,8 +948,8 @@ ActionLut::Lut ActionLut::m_actionLut =
|
|||
|
||||
//Heavy Shot, ヘヴィショット
|
||||
//has damage: potency 180, combo potency 0, directional potency 0
|
||||
//applies to self: Straight Shot Ready, ストレートショット実行可, duration 10000, param 0
|
||||
{ 97, { 180, 0, 0, 0, 0, 122, 10000, 0, 0, 0, 0, 0 } },
|
||||
//comment: status removed need script
|
||||
{ 97, { 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
|
||||
|
||||
//Straight Shot, ストレートショット
|
||||
//has damage: potency 200, combo potency 0, directional potency 0
|
||||
|
@ -1417,8 +1417,7 @@ ActionLut::Lut ActionLut::m_actionLut =
|
|||
|
||||
//Energy Drain, エナジードレイン
|
||||
//has damage: potency 100, combo potency 0, directional potency 0
|
||||
//restores mp: 5%
|
||||
{ 16508, { 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5 } },
|
||||
{ 16508, { 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
|
||||
|
||||
//Bio II, バイオラ
|
||||
//applies to targets: Bio II, バイオラ, duration 30000, param 0
|
||||
|
|
Loading…
Add table
Reference in a new issue