Implemented Enfeebled Target enchant. Tests are corrected to use the new DamageNumber methods. Release Build 11017.
This commit is contained in:
parent
6d7240c765
commit
58298839bf
@ -842,5 +842,38 @@ namespace EnchantTests
|
|||||||
player->ReduceAutoAttackTimer(INFINITE);
|
player->ReduceAutoAttackTimer(INFINITE);
|
||||||
player->AutoAttack();
|
player->AutoAttack();
|
||||||
}
|
}
|
||||||
|
TEST_METHOD(EnfeebledTargetNoEnchantCheck){
|
||||||
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
||||||
|
game->ChangePlayerClass(TRAPPER);
|
||||||
|
player=game->GetPlayer();
|
||||||
|
Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])};
|
||||||
|
game->SetElapsedTime(0.01f);
|
||||||
|
game->OnUserUpdate(0.01f);
|
||||||
|
player->_ForceCastSpell(player->GetAbility1());
|
||||||
|
game->SetElapsedTime("Trapper.Ability 1.Precast Time"_F);
|
||||||
|
game->OnUserUpdate("Trapper.Ability 1.Precast Time"_F);
|
||||||
|
game->SetElapsedTime(0.6f); //Wait for mark lock-on
|
||||||
|
game->OnUserUpdate(0.6f); //Wait for mark lock-on
|
||||||
|
Assert::AreEqual(2.f,newMonster.GetMoveSpdMult(),L"Move Spd Multiplier should not be reduced by 30%");
|
||||||
|
Assert::AreEqual(10,newMonster.GetAttack(),L"Monster Attack damage should not be reduced.");
|
||||||
|
}
|
||||||
|
TEST_METHOD(EnfeebledTargetEnchantCheck){
|
||||||
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
||||||
|
game->ChangePlayerClass(TRAPPER);
|
||||||
|
player=game->GetPlayer();
|
||||||
|
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)};
|
||||||
|
Inventory::EquipItem(nullRing,EquipSlot::RING1);
|
||||||
|
nullRing.lock()->EnchantItem("Enfeebled Target");
|
||||||
|
Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])};
|
||||||
|
game->SetElapsedTime(0.01f);
|
||||||
|
game->OnUserUpdate(0.01f);
|
||||||
|
player->_ForceCastSpell(player->GetAbility1());
|
||||||
|
game->SetElapsedTime("Trapper.Ability 1.Precast Time"_F);
|
||||||
|
game->OnUserUpdate("Trapper.Ability 1.Precast Time"_F);
|
||||||
|
game->SetElapsedTime(0.6f); //Wait for mark lock-on
|
||||||
|
game->OnUserUpdate(0.6f); //Wait for mark lock-on
|
||||||
|
Assert::AreEqual(1.4f,newMonster.GetMoveSpdMult(),L"Move Spd Multiplier should be reduced by 30%");
|
||||||
|
Assert::AreEqual(8,newMonster.GetAttack(),L"Monster Attack damage should be reduced.");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -396,7 +396,7 @@ namespace MonsterTests
|
|||||||
testMonster.Hurt(10,testMonster.OnUpperLevel(),testMonster.GetZ(),HurtFlag::DOT);
|
testMonster.Hurt(10,testMonster.OnUpperLevel(),testMonster.GetZ(),HurtFlag::DOT);
|
||||||
Assert::AreEqual(10,testMonster.GetHealth(),L"A DOT should go through all sources of iframes.");
|
Assert::AreEqual(10,testMonster.GetHealth(),L"A DOT should go through all sources of iframes.");
|
||||||
Assert::AreEqual(2,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr<DamageNumber>&damageNumber){
|
Assert::AreEqual(2,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr<DamageNumber>&damageNumber){
|
||||||
if(damageNumber->type==DamageNumberType::DOT)return count+1;
|
if(damageNumber->GetType()==DamageNumberType::DOT)return count+1;
|
||||||
else return count;
|
else return count;
|
||||||
})
|
})
|
||||||
,L"There should be 2 damage numbers of type DOT.");
|
,L"There should be 2 damage numbers of type DOT.");
|
||||||
|
@ -610,7 +610,7 @@ namespace PlayerTests
|
|||||||
player->Hurt(20,player->OnUpperLevel(),player->GetZ(),HurtFlag::DOT);
|
player->Hurt(20,player->OnUpperLevel(),player->GetZ(),HurtFlag::DOT);
|
||||||
Assert::AreEqual(80,player->GetHealth(),L"Player should take 20 damage through a DOT.");
|
Assert::AreEqual(80,player->GetHealth(),L"Player should take 20 damage through a DOT.");
|
||||||
Assert::AreEqual(1,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr<DamageNumber>&damageNumber){
|
Assert::AreEqual(1,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr<DamageNumber>&damageNumber){
|
||||||
if(damageNumber->type==DamageNumberType::DOT)return count+1;
|
if(damageNumber->GetType()==DamageNumberType::DOT)return count+1;
|
||||||
else return count;
|
else return count;
|
||||||
})
|
})
|
||||||
,L"There should be a damage number of type DOT.");
|
,L"There should be a damage number of type DOT.");
|
||||||
@ -619,7 +619,7 @@ namespace PlayerTests
|
|||||||
player->Hurt(20,player->OnUpperLevel(),player->GetZ(),HurtFlag::DOT);
|
player->Hurt(20,player->OnUpperLevel(),player->GetZ(),HurtFlag::DOT);
|
||||||
Assert::AreEqual(80,player->GetHealth(),L"Player should take 20 damage through a DOT even when iframes are on."); //HP Recovery/4s set effect has restored the health of the player to 100. So it should go back down to 80.
|
Assert::AreEqual(80,player->GetHealth(),L"Player should take 20 damage through a DOT even when iframes are on."); //HP Recovery/4s set effect has restored the health of the player to 100. So it should go back down to 80.
|
||||||
Assert::AreEqual(2,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr<DamageNumber>&damageNumber){
|
Assert::AreEqual(2,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr<DamageNumber>&damageNumber){
|
||||||
if(damageNumber->type==DamageNumberType::DOT)return count+1;
|
if(damageNumber->GetType()==DamageNumberType::DOT)return count+1;
|
||||||
else return count;
|
else return count;
|
||||||
})
|
})
|
||||||
,L"There should be 2 damage numbers of type DOT.");
|
,L"There should be 2 damage numbers of type DOT.");
|
||||||
|
@ -4421,6 +4421,10 @@ void AiL::GlobalGameUpdates(){
|
|||||||
const auto&[monster,stackCount,time]=lockOnTargets.front();
|
const auto&[monster,stackCount,time]=lockOnTargets.front();
|
||||||
if(!monster.expired()){
|
if(!monster.expired()){
|
||||||
monster.lock()->AddBuff(BuffType::TRAPPER_MARK,time,stackCount);
|
monster.lock()->AddBuff(BuffType::TRAPPER_MARK,time,stackCount);
|
||||||
|
if(game->GetPlayer()->HasEnchant("Enfeebled Target")){
|
||||||
|
monster.lock()->AddBuff(BuffType::SLOWDOWN,time,"Enfeebled Target"_ENC["SLOW PCT"]/100.f);
|
||||||
|
monster.lock()->AddBuff(BuffType::STAT_UP,time,-"Enfeebled Target"_ENC["DAMAGE REDUCTION PCT"]/100.f,{"Attack %"});
|
||||||
|
}
|
||||||
SoundEffect::PlaySFX("Lock On",monster.lock()->GetPos());
|
SoundEffect::PlaySFX("Lock On",monster.lock()->GetPos());
|
||||||
lastLockOnTargetTime=0.2f;
|
lastLockOnTargetTime=0.2f;
|
||||||
}
|
}
|
||||||
|
@ -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 11014
|
#define VERSION_BUILD 11017
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -248,7 +248,7 @@ Item Enchants
|
|||||||
Description = "Marked targets are slowed by {SLOW PCT}% and deal {DAMAGE REDUCTION PCT}% less damage."
|
Description = "Marked targets are slowed by {SLOW PCT}% and deal {DAMAGE REDUCTION PCT}% less damage."
|
||||||
Affects = Ability 1
|
Affects = Ability 1
|
||||||
|
|
||||||
SLOT PCT = 30%
|
SLOW PCT = 30%
|
||||||
DAMAGE REDUCTION PCT = 20%
|
DAMAGE REDUCTION PCT = 20%
|
||||||
|
|
||||||
# Stat, Lowest, Highest Value
|
# Stat, Lowest, Highest Value
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user