1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 07:37:45 +00:00

Add ParryPercent modifier

This commit is contained in:
Lucy 2023-03-09 00:15:55 +01:00
parent 38a0cd12ca
commit f12e7ec651
3 changed files with 9 additions and 2 deletions

View file

@ -917,7 +917,8 @@ namespace Sapphire::Common
SlashingResistancePercent = 1027, SlashingResistancePercent = 1027,
PiercingResistancePercent = 1028, PiercingResistancePercent = 1028,
BluntResistancePercent = 1029, BluntResistancePercent = 1029,
ProjectileResistancePercent = 1030 ProjectileResistancePercent = 1030,
ParryPercent = 1031
}; };
enum struct ActionAspect : uint8_t enum struct ActionAspect : uint8_t

View file

@ -116,6 +116,7 @@ std::unordered_map< std::string, Common::ParamModifier > ActionLutData::m_modifi
{ "PiercingResistancePercent", Common::ParamModifier::PiercingResistancePercent }, { "PiercingResistancePercent", Common::ParamModifier::PiercingResistancePercent },
{ "BluntResistancePercent", Common::ParamModifier::BluntResistancePercent }, { "BluntResistancePercent", Common::ParamModifier::BluntResistancePercent },
{ "ProjectileResistancePercent", Common::ParamModifier::ProjectileResistancePercent }, { "ProjectileResistancePercent", Common::ParamModifier::ProjectileResistancePercent },
{ "ParryPercent", Common::ParamModifier::ParryPercent }
}; };
bool ActionLutData::cacheActions() bool ActionLutData::cacheActions()

View file

@ -30,32 +30,37 @@ void Warrior::onAction( Entity::Player& player, Action& action )
void Warrior::handleWrath( Entity::Player& player, Action& action ) void Warrior::handleWrath( Entity::Player& player, Action& action )
{ {
auto effectToApply = Wrath; auto effectToApply = Wrath;
auto parry = 2;
auto asChara = player.getAsChara(); auto asChara = player.getAsChara();
if( player.hasStatusEffect( Wrath ) ) if( player.hasStatusEffect( Wrath ) )
{ {
player.replaceSingleStatusEffectById( Wrath ); player.replaceSingleStatusEffectById( Wrath );
effectToApply = WrathII; effectToApply = WrathII;
parry += 2;
} }
else if( player.hasStatusEffect( WrathII ) ) else if( player.hasStatusEffect( WrathII ) )
{ {
player.replaceSingleStatusEffectById( WrathII ); player.replaceSingleStatusEffectById( WrathII );
effectToApply = WrathIII; effectToApply = WrathIII;
parry += 2;
} }
else if( player.hasStatusEffect( WrathIII ) ) else if( player.hasStatusEffect( WrathIII ) )
{ {
player.replaceSingleStatusEffectById( WrathIII ); player.replaceSingleStatusEffectById( WrathIII );
effectToApply = WrathIV; effectToApply = WrathIV;
parry += 2;
} }
else if( player.hasStatusEffect( WrathIV ) ) else if( player.hasStatusEffect( WrathIV ) )
{ {
player.replaceSingleStatusEffectById( WrathIV ); player.replaceSingleStatusEffectById( WrathIV );
effectToApply = Infuriated; effectToApply = Infuriated;
parry += 2;
} }
if( !player.hasStatusEffect( Infuriated ) ) if( !player.hasStatusEffect( Infuriated ) )
{ {
action.applyStatusEffectSelf( effectToApply ); action.applyStatusEffectSelf( effectToApply );
player.addStatusEffectByIdIfNotExist( effectToApply, 30000, *asChara ); player.addStatusEffectByIdIfNotExist( effectToApply, 30000, *asChara, { StatusModifier{ Common::ParamModifier::ParryPercent, parry } } );
} }
} }