This commit is contained in:
ineed bots
2023-07-13 14:58:54 -06:00
parent 65ad154eb6
commit 81e65a3adb
15 changed files with 271 additions and 3210 deletions

View File

@@ -155,6 +155,11 @@ handleBots()
*/
onPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime )
{
if ( self isBot() && getDvarInt( "bots_t8_mode" ) )
{
iDamage = int( iDamage * 0.1 );
}
if ( self is_bot() )
{
self maps\bots\_bot_internal::onDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
@@ -164,6 +169,16 @@ onPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon,
self [[level.prevCallbackPlayerDamage]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
}
onActorDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, iModelIndex, iTimeOffset )
{
if ( isDefined( eAttacker ) && isPlayer( eAttacker ) && eAttacker isBot() && getDvarInt( "bots_t8_mode" ) )
{
iDamage += int( self.maxhealth * randomFloatRange( 0.25, 1.25 ) );
}
self [[level.prevCallbackActorDamage]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, iModelIndex, iTimeOffset );
}
/*
Starts the callbacks.
*/
@@ -172,6 +187,9 @@ hook_callbacks()
wait 0.05;
level.prevCallbackPlayerDamage = level.callbackPlayerDamage;
level.callbackPlayerDamage = ::onPlayerDamage;
level.prevCallbackActorDamage = level.callbackActorDamage;
level.callbackActorDamage = ::onActorDamage;
}
/*