@ -721,5 +721,34 @@ namespace EnchantTests
Assert : : AreEqual ( " Thief.Auto Attack.Cooldown " _F * " Thief.Ability 3.Attack Speed Increase " _F / 100.f , player - > GetAttackRecoveryRateReduction ( ) , L " Adrenaline Stim still boosts attack rate normally. " ) ;
Assert : : AreEqual ( " Thief.Auto Attack.Cooldown " _F * " Thief.Ability 3.Attack Speed Increase " _F / 100.f , player - > GetAttackRecoveryRateReduction ( ) , L " Adrenaline Stim still boosts attack rate normally. " ) ;
Assert : : AreEqual ( " Thief.Auto Attack.Range " _F + " Thief.Auto Attack.Range " _F * " Adrenaline Stim " _ENC [ " ATTACK RANGE INCREASE PCT " ] / 100.f , player - > GetAttackRange ( ) , L " Adrenaline Stim boosts attack range. " ) ;
Assert : : AreEqual ( " Thief.Auto Attack.Range " _F + " Thief.Auto Attack.Range " _F * " Adrenaline Stim " _ENC [ " ATTACK RANGE INCREASE PCT " ] / 100.f , player - > GetAttackRange ( ) , L " Adrenaline Stim boosts attack range. " ) ;
}
}
TEST_METHOD ( BloodlustCheck ) {
testKey - > bHeld = true ; //Force the key to be held down for testing purposes.
game - > ChangePlayerClass ( THIEF ) ;
player = game - > GetPlayer ( ) ;
player - > SetBaseStat ( " Attack " , 100 ) ;
player - > CheckAndPerformAbility ( player - > GetAbility3 ( ) , testKeyboardInput ) ;
MonsterData testMonsterData { " TestName " , " Test Monster " , 30 , 10 , 5 , { MonsterDropData { " Health Potion " , 100.f , 1 , 1 } } , 200.f } ;
MONSTER_DATA [ " TestName " ] = testMonsterData ;
for ( int i : std : : ranges : : iota_view ( 0 , 10 ) ) {
Monster testMonster { { } , MONSTER_DATA [ " TestName " ] } ;
testMonster . Hurt ( 1000 , testMonster . OnUpperLevel ( ) , testMonster . GetZ ( ) ) ;
}
Assert : : AreEqual ( 100 , player - > GetAttack ( ) , L " Bloodlust's bonus attack should not be applying here. " ) ;
Assert : : AreEqual ( " Thief.Ability 3.Duration " _F , player - > GetBuffs ( BuffType : : ADRENALINE_RUSH ) [ 0 ] . duration , L " Bloodlust's duration increase should not be applying here. " ) ;
player - > RestoreMana ( 100 ) ;
player - > RemoveAllBuffs ( ) ;
Thief : : ability3 . charges = 1 ;
std : : weak_ptr < Item > nullRing { Inventory : : AddItem ( " Null Ring " s ) } ;
Inventory : : EquipItem ( nullRing , EquipSlot : : RING1 ) ;
nullRing . lock ( ) - > EnchantItem ( " Bloodlust " ) ;
player - > CheckAndPerformAbility ( player - > GetAbility3 ( ) , testKeyboardInput ) ;
for ( int i : std : : ranges : : iota_view ( 0 , 30 ) ) {
Monster testMonster { { } , MONSTER_DATA [ " TestName " ] } ;
testMonster . Hurt ( 1000 , testMonster . OnUpperLevel ( ) , testMonster . GetZ ( ) ) ;
}
Assert : : AreEqual ( 110 , player - > GetAttack ( ) , L " Bloodlust's bonus attacks stack only to 10. " ) ;
Assert : : AreEqual ( " Thief.Ability 3.Duration " _F + " Bloodlust " _ENC [ " BUFF TIMER INCREASE " ] * 30 , player - > GetBuffs ( BuffType : : ADRENALINE_RUSH ) [ 0 ] . duration , L " Bloodlust's duration increases per kill. " ) ;
}
} ;
} ;
}
}