Last Reserve enchant implemented. Release Build 10798.
This commit is contained in:
parent
333acfe149
commit
859ff52ac2
@ -477,7 +477,22 @@ namespace EnchantTests
|
|||||||
Assert::AreEqual(player->GetAbility2().GetCooldownTime()-2.5f,player->GetAbility2().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
|
Assert::AreEqual(player->GetAbility2().GetCooldownTime()-2.5f,player->GetAbility2().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
|
||||||
Assert::AreEqual(player->GetAbility3().GetCooldownTime()-1.f,player->GetAbility3().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
|
Assert::AreEqual(player->GetAbility3().GetCooldownTime()-1.f,player->GetAbility3().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
|
||||||
Assert::AreEqual(player->GetAbility4().GetCooldownTime(),player->GetAbility4().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
|
Assert::AreEqual(player->GetAbility4().GetCooldownTime(),player->GetAbility4().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
|
||||||
|
}
|
||||||
|
TEST_METHOD(LastReserveCheck){
|
||||||
|
player->SetBaseStat("Attack",100.f);
|
||||||
|
Assert::AreEqual(0.0_Pct,player->GetDamageReductionPct(),L"Damage reduction starts at 0%");
|
||||||
|
Assert::AreEqual(100,player->GetAttack(),L"Attack damage starts at 100.");
|
||||||
|
Assert::AreEqual(0.0_Pct,player->GetCooldownReductionPct(),L"Cooldown reduction starts at 0%");
|
||||||
|
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)};
|
||||||
|
Inventory::EquipItem(nullRing,EquipSlot::RING1);
|
||||||
|
nullRing.lock()->EnchantItem("Last Reserve");
|
||||||
|
Assert::AreEqual(0.0_Pct,player->GetDamageReductionPct(),L"Damage reduction is still 0%");
|
||||||
|
Assert::AreEqual(100,player->GetAttack(),L"Attack damage still 100.");
|
||||||
|
Assert::AreEqual(0.0_Pct,player->GetCooldownReductionPct(),L"Cooldown reduction is still 0%");
|
||||||
|
player->Hurt(80,player->OnUpperLevel(),player->GetZ());
|
||||||
|
Assert::AreEqual(30.0_Pct,player->GetDamageReductionPct(),L"Damage reduction increased to 30%");
|
||||||
|
Assert::AreEqual(110,player->GetAttack(),L"Attack damage is now 110.");
|
||||||
|
Assert::AreEqual(10.0_Pct,player->GetCooldownReductionPct(),L"Cooldown reduction increased to 10%");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -1535,8 +1535,8 @@ void AiL::RenderWorld(float fElapsedTime){
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
if("debug_collision_boxes_snapping"_I){
|
if("debug_collision_boxes_snapping"_I){
|
||||||
if(fmod(tile->pos.x+collision.pos.x,1.f)!=0.f||fmod(tile->pos.y+collision.pos.y,1.f)!=0.f){
|
if(fmod(tile->pos.x+collision.pos.x,1.f)!=0.f||fmod(tile->pos.y+collision.pos.y,1.f)!=0.f){
|
||||||
view.DrawShadowStringPropDecal(tile->pos+collision.pos-vf2d{0,24},(tile->pos+collision.pos).str(),RED,BLACK,{0.5f,1.f},24.f);
|
view.DrawShadowStringPropDecal(tile->pos+collision.pos-vf2d{0,24},(tile->pos+collision.pos).str(),RED,BLACK,{0.5f,1.f},{0.5f,1.f},24.f);
|
||||||
view.DrawShadowStringPropDecal(tile->pos+collision.pos+vf2d{0,24},((tile->pos+collision.pos)+(collision.size)).str(),GREEN,BLACK,{0.5f,1.f},24.f);
|
view.DrawShadowStringPropDecal(tile->pos+collision.pos+vf2d{0,24},((tile->pos+collision.pos)+(collision.size)).str(),GREEN,BLACK,{0.5f,1.f},{0.5f,1.f},24.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1595,8 +1595,8 @@ void AiL::RenderWorld(float fElapsedTime){
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
if("debug_collision_boxes_snapping"_I){
|
if("debug_collision_boxes_snapping"_I){
|
||||||
if(fmod(tile->pos.x+collision.pos.x,1.f)!=0.f||fmod(tile->pos.y+collision.pos.y,1.f)!=0.f){
|
if(fmod(tile->pos.x+collision.pos.x,1.f)!=0.f||fmod(tile->pos.y+collision.pos.y,1.f)!=0.f){
|
||||||
view.DrawShadowStringPropDecal(tile->pos+collision.pos-vf2d{0,24},(tile->pos+collision.pos).str(),RED,BLACK,{0.5f,1.f},24.f);
|
view.DrawShadowStringPropDecal(tile->pos+collision.pos-vf2d{0,24},(tile->pos+collision.pos).str(),RED,BLACK,{0.5f,1.f},{0.5f,1.f},24.f);
|
||||||
view.DrawShadowStringPropDecal(tile->pos+collision.pos+vf2d{0,24},((tile->pos+collision.pos)+(collision.size)).str(),GREEN,BLACK,{0.5f,1.f},24.f);
|
view.DrawShadowStringPropDecal(tile->pos+collision.pos+vf2d{0,24},((tile->pos+collision.pos)+(collision.size)).str(),GREEN,BLACK,{0.5f,1.f},{0.5f,1.f},24.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -270,7 +270,9 @@ const int Player::GetMaxMana()const{
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int Player::GetAttack()const{
|
const int Player::GetAttack()const{
|
||||||
return int(GetModdedStatBonuses("Attack"));
|
int finalAtk{int(round(GetModdedStatBonuses("Attack")))};
|
||||||
|
finalAtk+=LastReserveEnchantConditionsMet()?round(GetBaseStat("Attack")*"Last Reserve"_ENC["ATTACK PCT"]/100.f):0;
|
||||||
|
return finalAtk;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int Player::GetDefense()const{
|
const int Player::GetDefense()const{
|
||||||
@ -1457,6 +1459,7 @@ const float Player::GetCooldownReductionPct()const{
|
|||||||
modCDRPct+=b.intensity;
|
modCDRPct+=b.intensity;
|
||||||
}
|
}
|
||||||
modCDRPct+=GetEquipStat("CDR")/100;
|
modCDRPct+=GetEquipStat("CDR")/100;
|
||||||
|
modCDRPct+=LastReserveEnchantConditionsMet()?"Last Reserve"_ENC["COOLDOWN REDUCTION PCT"]/100.f:0.f;
|
||||||
return modCDRPct;
|
return modCDRPct;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1544,7 +1547,7 @@ void Player::PerformHPRecovery(){
|
|||||||
const float Player::GetDamageReductionPct()const{
|
const float Player::GetDamageReductionPct()const{
|
||||||
float modDmgReductionPct=0;
|
float modDmgReductionPct=0;
|
||||||
modDmgReductionPct+=GetEquipStat("Damage Reduction")/100.f;
|
modDmgReductionPct+=GetEquipStat("Damage Reduction")/100.f;
|
||||||
if(HasEnchant("Last Reserve"))modDmgReductionPct+="Last Reserve"_ENC["DAMAGE REDUCTION PCT"]/100.f;
|
if(LastReserveEnchantConditionsMet())modDmgReductionPct+="Last Reserve"_ENC["DAMAGE REDUCTION PCT"]/100.f;
|
||||||
return modDmgReductionPct;
|
return modDmgReductionPct;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1943,3 +1946,7 @@ Ability&Player::GetItem2(){
|
|||||||
Ability&Player::GetItem3(){
|
Ability&Player::GetItem3(){
|
||||||
return useItem3;
|
return useItem3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool Player::LastReserveEnchantConditionsMet()const{
|
||||||
|
return HasEnchant("Last Reserve")&&GetHealthRatio()<="Last Reserve"_ENC["HP BELOW THRESHOLD"]/100.f;
|
||||||
|
}
|
@ -381,6 +381,7 @@ private:
|
|||||||
float daggerThrowWaitTimer{INFINITY};
|
float daggerThrowWaitTimer{INFINITY};
|
||||||
std::unordered_set<std::string>enchantList;
|
std::unordered_set<std::string>enchantList;
|
||||||
void OnAbilityUse(const Ability&ability); //Callback when an ability successfully is used and has gone on cooldown.
|
void OnAbilityUse(const Ability&ability); //Callback when an ability successfully is used and has gone on cooldown.
|
||||||
|
const bool LastReserveEnchantConditionsMet()const;
|
||||||
protected:
|
protected:
|
||||||
const float ATTACK_COOLDOWN="Warrior.Auto Attack.Cooldown"_F;
|
const float ATTACK_COOLDOWN="Warrior.Auto Attack.Cooldown"_F;
|
||||||
const float MAGIC_ATTACK_COOLDOWN="Wizard.Auto Attack.Cooldown"_F;
|
const float MAGIC_ATTACK_COOLDOWN="Wizard.Auto Attack.Cooldown"_F;
|
||||||
|
@ -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 10793
|
#define VERSION_BUILD 10798
|
||||||
|
|
||||||
#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