Switched Doom 3 weapons to native.

This commit is contained in:
Justin Marshall
2026-05-19 08:28:43 -07:00
parent b841fcb33b
commit b97127f038
82 changed files with 20023 additions and 1371 deletions
@@ -0,0 +1,50 @@
// BotAI_Battle_Attacked.cpp
//
#pragma hdrstop
#include "precompiled.h"
#include "../Game_local.h"
/*
==================
rvmBot::state_Attacked
==================
*/
stateResult_t rvmBot::state_Attacked(stateParms_t* parms) {
// respawn if dead.
if (BotIsDead(&bs))
{
stateThread.SetState("state_Respawn");
return SRESULT_DONE_FRAME;
}
if (gameLocal.SysScriptTime() > bs.aggressiveAttackTime || bs.weaponnum == 0) {
stateThread.SetState("state_Retreat");
return SRESULT_DONE;
}
// Ensure the target is a player.
idPlayer *entinfo = gameLocal.entities[bs.enemy]->Cast<idPlayer>();
if (!entinfo)
{
stateThread.SetState("state_SeekLTG");
return SRESULT_DONE_FRAME;
}
// If our enemy is dead, search for another LTG.
if (EntityIsDead(entinfo))
{
stateThread.SetState("state_SeekLTG");
return SRESULT_DONE_FRAME;
}
bs.currentGoal.origin = bs.lastenemyorigin;
//aim at the enemy
BotAimAtEnemy(&bs);
//attack the enemy if possible
BotCheckAttack(&bs);
return SRESULT_WAIT;
}