1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 19:17:45 +00:00

Implement heavy shot, straight shot.

This commit is contained in:
collett 2020-01-23 18:23:15 +09:00
parent fd47ffb347
commit a31098b4bf
6 changed files with 57 additions and 11 deletions

View file

@ -581,6 +581,7 @@ namespace Sapphire::Common
None = 0, // ? None = 0, // ?
MagicPoints = 3, MagicPoints = 3,
TacticsPoints = 5, TacticsPoints = 5,
StatusEffect = 10,
// WARGauge = 22, // WARGauge = 22,
// DRKGauge = 25, // DRKGauge = 25,
// AetherflowStack = 30, // AetherflowStack = 30,

View 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 );

View file

@ -24,8 +24,8 @@ public:
{ {
if( action.getSourceChara()->getLevel() >= 30 && Math::CalcStats::getRandomNumber0To99() < 15 ) if( action.getSourceChara()->getLevel() >= 30 && Math::CalcStats::getRandomNumber0To99() < 15 )
{ {
auto pFreeCure = action.createStatusEffect( STATUS_ID_FREECURE, action.getSourceChara(), action.getSourceChara(), 15000, 3000 ); auto pEffect = action.createStatusEffect( STATUS_ID_FREECURE, action.getSourceChara(), action.getSourceChara(), 15000, 3000 );
action.getEffectbuilder()->applyStatusEffect( action.getSourceChara(), action.getSourceChara(), pFreeCure ); action.getEffectbuilder()->applyStatusEffect( action.getSourceChara(), action.getSourceChara(), pEffect );
} }
} }
}; };

View file

@ -22,17 +22,17 @@ public:
void onExecute( Sapphire::World::Action::Action& action ) override void onExecute( Sapphire::World::Action::Action& action ) override
{ {
auto freecure = action.getSourceChara()->getStatusEffectById( STATUS_ID_FREECURE ); auto effectEntry = action.getSourceChara()->getStatusEffectById( STATUS_ID_FREECURE );
if( freecure.second ) if( effectEntry.second )
{ {
action.getSourceChara()->removeStatusEffect( freecure.first ); action.getSourceChara()->removeStatusEffect( effectEntry.first );
} }
} }
void onStart( Sapphire::World::Action::Action& action ) override void onStart( Sapphire::World::Action::Action& action ) override
{ {
auto freecure = action.getSourceChara()->getStatusEffectById( STATUS_ID_FREECURE ); auto effectEntry = action.getSourceChara()->getStatusEffectById( STATUS_ID_FREECURE );
if( freecure.second ) if( effectEntry.second )
{ {
action.setPrimaryCost( Common::ActionPrimaryCostType::None, 0 ); action.setPrimaryCost( Common::ActionPrimaryCostType::None, 0 );
} }

View file

@ -683,6 +683,19 @@ bool Action::Action::primaryCostCheck( bool subtractCosts )
return true; 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 // free casts, likely just pure ogcds
case Common::ActionPrimaryCostType::None: case Common::ActionPrimaryCostType::None:
{ {

View file

@ -948,8 +948,8 @@ ActionLut::Lut ActionLut::m_actionLut =
//Heavy Shot, ヘヴィショット //Heavy Shot, ヘヴィショット
//has damage: potency 180, combo potency 0, directional potency 0 //has damage: potency 180, combo potency 0, directional potency 0
//applies to self: Straight Shot Ready, ストレートショット実行可, duration 10000, param 0 //comment: status removed need script
{ 97, { 180, 0, 0, 0, 0, 122, 10000, 0, 0, 0, 0, 0 } }, { 97, { 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
//Straight Shot, ストレートショット //Straight Shot, ストレートショット
//has damage: potency 200, combo potency 0, directional potency 0 //has damage: potency 200, combo potency 0, directional potency 0
@ -1417,8 +1417,7 @@ ActionLut::Lut ActionLut::m_actionLut =
//Energy Drain, エナジードレイン //Energy Drain, エナジードレイン
//has damage: potency 100, combo potency 0, directional potency 0 //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, 0 } },
{ 16508, { 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5 } },
//Bio II, バイオラ //Bio II, バイオラ
//applies to targets: Bio II, バイオラ, duration 30000, param 0 //applies to targets: Bio II, バイオラ, duration 30000, param 0