@ -380,6 +380,30 @@ namespace EnchantTests
break ;
}
if ( ! foundSoul ) Assert : : Fail ( L " A soul was not generated from a kill with the Reaper of Souls enchant. " ) ;
testGame - > SetElapsedTime ( 3.5f ) ;
testGame - > OnUserUpdate ( 3.5f ) ;
player - > Hurt ( 5 , player - > OnUpperLevel ( ) , player - > GetZ ( ) ) ;
player - > ConsumeMana ( 10 ) ;
player - > GetRightClickAbility ( ) . cooldown = player - > GetAbility1 ( ) . cooldown = player - > GetAbility2 ( ) . cooldown = player - > GetAbility3 ( ) . cooldown = player - > GetAbility4 ( ) . cooldown = 0.4f ;
for ( int i : std : : ranges : : iota_view ( 0 , 2 ) ) {
testGame - > SetElapsedTime ( 0.001f ) ;
testGame - > OnUserUpdate ( 0.001f ) ;
}
Assert : : AreEqual ( 98 , player - > GetHealth ( ) , L " Player should have healed for 3 health from contacting the soul. " ) ;
Assert : : AreEqual ( 92 , player - > GetMana ( ) , L " Player should have gained 2 mana from contacting the soul. " ) ;
Assert : : AreEqual ( 0.f , player - > GetRightClickAbility ( ) . cooldown , L " Player's ability cooldowns should reduce from contacting the soul. " ) ;
Assert : : AreEqual ( 0.f , player - > GetAbility1 ( ) . cooldown , L " Player's ability cooldowns should reduce from contacting the soul. " ) ;
Assert : : AreEqual ( 0.f , player - > GetAbility2 ( ) . cooldown , L " Player's ability cooldowns should reduce from contacting the soul. " ) ;
Assert : : AreEqual ( 0.f , player - > GetAbility3 ( ) . cooldown , L " Player's ability cooldowns should reduce from contacting the soul. " ) ;
Assert : : AreEqual ( 0.f , player - > GetAbility4 ( ) . cooldown , L " Player's ability cooldowns should reduce from contacting the soul. " ) ;
//This should be the moment the wisp is fading out.
testGame - > SetElapsedTime ( 0.5f ) ;
testGame - > OnUserUpdate ( 0.5f ) ;
for ( Effect * eff : game - > GetAllEffects ( ) | std : : views : : filter ( [ ] ( Effect * eff ) { return eff - > GetType ( ) = = EffectType : : MONSTER_SOUL ; } ) ) {
Assert : : Fail ( L " A Monster Soul has not disappeared after colliding with a player. " ) ;
}
}
} ;
}