Implemented Second Wind unique enchant. Added unit test. Release Build 10646.
This commit is contained in:
parent
f84787971d
commit
94bd702ee8
@ -229,5 +229,16 @@ namespace EnchantTests
|
|||||||
Assert::AreEqual(0.0875f,player->GetAttackRecoveryRateReduction(),L"Lethal Tempo buff should cap at 5 stacks.");
|
Assert::AreEqual(0.0875f,player->GetAttackRecoveryRateReduction(),L"Lethal Tempo buff should cap at 5 stacks.");
|
||||||
Assert::AreEqual(size_t(1),player->GetBuffs(BuffType::LETHAL_TEMPO).size(),L"Lethal Tempo buff is active.");
|
Assert::AreEqual(size_t(1),player->GetBuffs(BuffType::LETHAL_TEMPO).size(),L"Lethal Tempo buff is active.");
|
||||||
}
|
}
|
||||||
|
TEST_METHOD(SecondWindCheck){
|
||||||
|
Assert::AreEqual(0.0_Pct,player->GetHPRecoveryPct(),L"HP Recovery Pct is 0% at the start.");
|
||||||
|
player->Hurt(90,player->OnUpperLevel(),player->GetZ());
|
||||||
|
Assert::AreEqual(0.0_Pct,player->GetHPRecoveryPct(),L"HP Recovery Pct is still 0% without Second Wind.");
|
||||||
|
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)};
|
||||||
|
Inventory::EquipItem(nullRing,EquipSlot::RING1);
|
||||||
|
nullRing.lock()->EnchantItem("Second Wind");
|
||||||
|
Assert::AreEqual(1.0_Pct,player->GetHPRecoveryPct(),L"HP Recovery Pct is now 1% with low health with Second Wind.");
|
||||||
|
player->Heal(11);
|
||||||
|
Assert::AreEqual(0.0_Pct,player->GetHPRecoveryPct(),L"HP Recovery Pct is now 0% since Second Wind should no longer activate above 20% health.");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -43,8 +43,8 @@ Global
|
|||||||
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x64.Build.0 = Release Desktop|x64
|
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x64.Build.0 = Release Desktop|x64
|
||||||
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x86.ActiveCfg = Release Desktop|Win32
|
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x86.ActiveCfg = Release Desktop|Win32
|
||||||
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x86.Build.0 = Release Desktop|Win32
|
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x86.Build.0 = Release Desktop|Win32
|
||||||
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x64.ActiveCfg = Unit Testing|x64
|
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x64.ActiveCfg = Release Desktop|x64
|
||||||
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x64.Build.0 = Unit Testing|x64
|
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x64.Build.0 = Release Desktop|x64
|
||||||
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x86.ActiveCfg = Unit Testing|Win32
|
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x86.ActiveCfg = Unit Testing|Win32
|
||||||
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x86.Build.0 = Unit Testing|Win32
|
{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x86.Build.0 = Unit Testing|Win32
|
||||||
{11969B7B-3D50-4825-9584-AF01D15B88E0}.Debug|x64.ActiveCfg = Unit Testing|x64
|
{11969B7B-3D50-4825-9584-AF01D15B88E0}.Debug|x64.ActiveCfg = Unit Testing|x64
|
||||||
|
@ -1460,6 +1460,7 @@ const float Player::GetCritDmgPct()const{
|
|||||||
const float Player::GetHPRecoveryPct()const{
|
const float Player::GetHPRecoveryPct()const{
|
||||||
float modHPRecoveryPct=0;
|
float modHPRecoveryPct=0;
|
||||||
modHPRecoveryPct+=GetEquipStat("HP Recovery %")/100;
|
modHPRecoveryPct+=GetEquipStat("HP Recovery %")/100;
|
||||||
|
if(HasEnchant("Second Wind")&&GetHealthRatio()<="Second Wind"_ENC["HP BELOW THRESHOLD"]/100.f)modHPRecoveryPct+="Second Wind"_ENC["HP RECOVERY PCT"]/100.f;
|
||||||
return modHPRecoveryPct;
|
return modHPRecoveryPct;
|
||||||
}
|
}
|
||||||
const float Player::GetHP6RecoveryPct()const{
|
const float Player::GetHP6RecoveryPct()const{
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 3
|
#define VERSION_PATCH 3
|
||||||
#define VERSION_BUILD 10635
|
#define VERSION_BUILD 10646
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user