@ -524,5 +524,21 @@ namespace EnchantTests
}
Assert : : AreEqual ( 0.f , player - > GetAutoAttackTimer ( ) , L " The auto attack timer should have been reset at some point. " ) ;
}
TEST_METHOD ( StealthyRetreatCheck ) {
game - > ChangePlayerClass ( RANGER ) ;
player = game - > GetPlayer ( ) ;
testKey - > bHeld = true ; //Force the key to be held down for testing purposes.
player - > CheckAndPerformAbility ( player - > GetRightClickAbility ( ) , testKeyboardInput ) ;
Assert : : AreEqual ( " Ranger.Right Click Ability.RetreatTime " _F , player - > GetIframeTime ( ) , L " Ranger's retreat iframe time is normal. " ) ;
player - > _SetIframes ( 0.f ) ;
player - > GetRightClickAbility ( ) . cooldown = 0.f ;
player - > SetState ( State : : NORMAL ) ;
std : : weak_ptr < Item > nullRing { Inventory : : AddItem ( " Null Ring " s ) } ;
Inventory : : EquipItem ( nullRing , EquipSlot : : RING1 ) ;
nullRing . lock ( ) - > EnchantItem ( " Stealthy Retreat " ) ;
player - > CheckAndPerformAbility ( player - > GetRightClickAbility ( ) , testKeyboardInput ) ;
Assert : : AreEqual ( " Ranger.Right Click Ability.RetreatTime " _F + " Stealthy Retreat " _ENC [ " INVULNERABILITY INCREASE " ] , player - > GetIframeTime ( ) , L " Ranger's retreat iframe time is much greater. " ) ;
}
} ;
}