1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-28 15:17:46 +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,
PiercingResistancePercent = 1028,
BluntResistancePercent = 1029,
ProjectileResistancePercent = 1030
ProjectileResistancePercent = 1030,
ParryPercent = 1031
};
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 },
{ "BluntResistancePercent", Common::ParamModifier::BluntResistancePercent },
{ "ProjectileResistancePercent", Common::ParamModifier::ProjectileResistancePercent },
{ "ParryPercent", Common::ParamModifier::ParryPercent }
};
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 )
{
auto effectToApply = Wrath;
auto parry = 2;
auto asChara = player.getAsChara();
if( player.hasStatusEffect( Wrath ) )
{
player.replaceSingleStatusEffectById( Wrath );
effectToApply = WrathII;
parry += 2;
}
else if( player.hasStatusEffect( WrathII ) )
{
player.replaceSingleStatusEffectById( WrathII );
effectToApply = WrathIII;
parry += 2;
}
else if( player.hasStatusEffect( WrathIII ) )
{
player.replaceSingleStatusEffectById( WrathIII );
effectToApply = WrathIV;
parry += 2;
}
else if( player.hasStatusEffect( WrathIV ) )
{
player.replaceSingleStatusEffectById( WrathIV );
effectToApply = Infuriated;
parry += 2;
}
if( !player.hasStatusEffect( Infuriated ) )
{
action.applyStatusEffectSelf( effectToApply );
player.addStatusEffectByIdIfNotExist( effectToApply, 30000, *asChara );
player.addStatusEffectByIdIfNotExist( effectToApply, 30000, *asChara, { StatusModifier{ Common::ParamModifier::ParryPercent, parry } } );
}
}