@ -1012,9 +1012,9 @@ namespace EnchantTests
Assert : : AreEqual ( size_t ( 0 ) , BULLET_LIST . size ( ) , L " Explosive Trap detonates later. " ) ;
}
TEST_METHOD ( SwordEnchantmentNoEnchantCheck ) {
Assert : : AreEqual ( 1.5 f , player - > GetAttackRange ( ) , L " Attack range of Warrior is normal " ) ;
Assert : : AreEqual ( 150 .f , player - > GetAttackRange ( ) , L " Attack range of Warrior is normal " ) ;
player - > CheckAndPerformAbility ( player - > GetAbility3 ( ) , testKeyboardInput ) ;
Assert : : AreEqual ( 1.5 f , player - > GetAttackRange ( ) , L " Attack range of Warrior remains the untouched. " ) ;
Assert : : AreEqual ( 150 .f , player - > GetAttackRange ( ) , L " Attack range of Warrior remains the untouched. " ) ;
}
TEST_METHOD ( SwordEnchantmentEnchantCheck ) {
testKey - > bHeld = true ; //Force the key to be held down for testing purposes.
@ -1022,10 +1022,10 @@ namespace EnchantTests
Inventory : : EquipItem ( nullRing , EquipSlot : : RING1 ) ;
nullRing . lock ( ) - > EnchantItem ( " Sword Enchantment " ) ;
player - > CheckAndPerformAbility ( player - > GetAbility3 ( ) , testKeyboardInput ) ;
Assert : : AreEqual ( 3.f , player - > GetAttackRange ( ) , L " Attack range of Warrior doubled. " ) ;
Assert : : AreEqual ( 300 .f , player - > GetAttackRange ( ) , L " Attack range of Warrior doubled. " ) ;
game - > SetElapsedTime ( 8.f ) ;
game - > OnUserUpdate ( 8.f ) ;
Assert : : AreEqual ( 1.5 f , player - > GetAttackRange ( ) , L " Attack range of Warrior is normal again. " ) ;
Assert : : AreEqual ( 150 .f , player - > GetAttackRange ( ) , L " Attack range of Warrior is normal again. " ) ;
}
TEST_METHOD ( ImprovedGroundSlamNoEnchantCheck ) {
testKey - > bHeld = true ; //Force the key to be held down for testing purposes.
@ -1089,5 +1089,20 @@ namespace EnchantTests
game - > OnUserUpdate ( 9.f ) ;
Assert : : AreEqual ( 0U , player - > GetShield ( ) , L " The Advance Shield enchant shield lasts 9 seconds. It should have worn off after that time. " ) ;
}
TEST_METHOD ( BattleShoutNoEnchantCheck ) {
testKey - > bHeld = true ; //Force the key to be held down for testing purposes.
Monster & newMonster { game - > SpawnMonster ( { } , MONSTER_DATA [ " TestName " ] ) } ;
player - > CheckAndPerformAbility ( player - > GetAbility1 ( ) , testKeyboardInput ) ;
Assert : : AreEqual ( newMonster . GetHealth ( ) , newMonster . GetMaxHealth ( ) , L " Monster does not take damage from Battlecry normally. " ) ;
}
TEST_METHOD ( BattleShoutEnchantCheck ) {
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 ( " Battle Shout " ) ;
Monster & newMonster { game - > SpawnMonster ( { } , MONSTER_DATA [ " TestName " ] ) } ;
player - > CheckAndPerformAbility ( player - > GetAbility1 ( ) , testKeyboardInput ) ;
Assert : : AreEqual ( newMonster . GetHealth ( ) - player - > GetDefense ( ) , newMonster . GetMaxHealth ( ) , L " Monster takes damage from Battlecry with the Battle Shout enchant equal to 100% of the player's Defense. " ) ;
}
} ;
}