Implement Heavy Guard enchant.
This commit is contained in:
parent
ea752c14c6
commit
f866a4598d
@ -1053,5 +1053,26 @@ namespace EnchantTests
|
|||||||
game->OnUserUpdate(0.f);
|
game->OnUserUpdate(0.f);
|
||||||
Assert::AreEqual(973,newMonster.GetHealth(),L"Monsters take extra damage from defense from Improved Ground Slam.");
|
Assert::AreEqual(973,newMonster.GetHealth(),L"Monsters take extra damage from defense from Improved Ground Slam.");
|
||||||
}
|
}
|
||||||
|
TEST_METHOD(HeavyGuardNoEnchantCheck){
|
||||||
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
||||||
|
player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput);
|
||||||
|
player->Hurt(5,player->OnUpperLevel(),player->GetZ());
|
||||||
|
Assert::AreEqual(100,player->GetHealth(),L"Player does not take damage while blocking.");
|
||||||
|
game->SetElapsedTime(4.f);
|
||||||
|
game->OnUserUpdate(4.f);
|
||||||
|
player->Hurt(5,player->OnUpperLevel(),player->GetZ());
|
||||||
|
Assert::AreEqual(95,player->GetHealth(),L"Player takes normal damage once block expires.");
|
||||||
|
}
|
||||||
|
TEST_METHOD(HeavyGuardEnchantCheck){
|
||||||
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
||||||
|
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)};
|
||||||
|
Inventory::EquipItem(nullRing,EquipSlot::RING1);
|
||||||
|
nullRing.lock()->EnchantItem("Heavy Guard");
|
||||||
|
player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput);
|
||||||
|
game->SetElapsedTime(5.f);
|
||||||
|
game->OnUserUpdate(5.f);
|
||||||
|
player->Hurt(5,player->OnUpperLevel(),player->GetZ());
|
||||||
|
Assert::AreEqual(100,player->GetHealth(),L"Player should still be blocking at this time with Heavy Guard.");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -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 11050
|
#define VERSION_BUILD 11051
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -109,7 +109,8 @@ void Warrior::InitializeClassAbilities(){
|
|||||||
rightClickAbility.cooldown=rightClickAbility.COOLDOWN_TIME;
|
rightClickAbility.cooldown=rightClickAbility.COOLDOWN_TIME;
|
||||||
p->SetState(State::BLOCK);
|
p->SetState(State::BLOCK);
|
||||||
p->blockTimer="Warrior.Right Click Ability.Duration"_F;
|
p->blockTimer="Warrior.Right Click Ability.Duration"_F;
|
||||||
p->AddBuff(BuffType::BLOCK_SLOWDOWN,"Warrior.Right Click Ability.Duration"_F,"Warrior.Right Click Ability.SlowAmt"_F);
|
if(p->HasEnchant("Heavy Guard"))p->blockTimer*="Heavy Guard"_ENC["BLOCK DURATION MULT"];
|
||||||
|
p->AddBuff(BuffType::BLOCK_SLOWDOWN,p->blockTimer,"Warrior.Right Click Ability.SlowAmt"_F);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user