OpportunisticallyUseWeaponAbilities
OpportunisticallyUseWeaponAbilities is a NextBot action in Team Fortress 2, for tf_bots, that makes the acting bot use a weapon ability. This action is called when bomb is carrying item_teamflag in the Mann Vs. Machine gamemode; and the action is passively called in CTFBotTacticalMonitor::Update
.
Elaboration
OpportunisticallyUseWeaponAbilities uses a timer, between 0.1 seconds (100ms) and 0.2 seconds (200ms), to determine when to use a special ability. If the timer has not elasped, then the action will be aborted.
Shields
The actor bot will generally attempt to charge if they are the Demoman class and they have a shield item equipped.
The bot will not attempt to charge if they have the CTFBot::AIR_CHARGE_ONLY
attribute (the bot is already charging in the air); and their Z velocity is higher than zero. (Positive Z indicates going up.)
B.A.S.E Jumper
If the bot has a BASE Jumper equipped; then it will attempt to use the parachute. The bot will activate the BASE Jumper's parachute when **all** of the below conditions are true:
- The bot's health ratio is higher than the health threshold 0.5.
- The bot does not have TF_COND_BURNING. (The bot is not burning.)
- The bot has negative-Z velocity (or falling).
- The bot can traverse 150hu downards. (Generally this means they can fall 150hu below.)
If the bot already has TF_COND_PARACHUTE_DEPLOYED, then the bot will press the jump button (to deactivate the parachute) if any of these conditions are true:
- The bot's health ratio is lower than 0.5 (50%). (flHealthPercent < flHealthThreshold)
- The bot has TF_COND_BURNING. (The bot is on fire.)
- The bot can not traverse down 150hu. (Generally this means that the bot is 150hu away from the ground.)
TF_WEAPON_BUFF_ITEM
TF_WEAPON_BUFF_ITEM
, in game code, refers to the Buff Banner, Battalion's Backup, and Concheror.If the buff item charge is full, then the bot will attack with the buff item (to use it).
TF_WEAPON_BAT_WOOD
If the Sandman clip is greater than 0, then the acting bot will alt-attack the primary known threat with the Sandman.
TF_WEAPON_LUNCHBOX
If the lunchbox item has ammo, then the bot will (attempt to) use the lunchbox item. The Crit-A-Cola and Bonk charge meters are also checked if the acting bot's class is the Scout.