#include <src/Ext/Infantry/Body.h>
List of all members.
Member Typedef Documentation
Member Function Documentation
eAction InfantryExt::GetEngineerEnterEnemyBuildingAction |
( |
BuildingClass * |
pBld | ) |
[static] |
Gets the action an engineer will take when entering an enemy building.
This function accounts for the multi-engineer feature.
- Parameters:
-
pBld | The Building the engineer enters. |
- Author:
- AlexB
- Date:
- 2010-05-28
{
if(GameModeOptionsClass::Instance->MPModeIndex && GameModeOptionsClass::Instance->MultiEngineer) {
bool isTech = false;
if(HouseClass * pHouse = pBld->OwningPlayer2) {
if(HouseTypeClass * pCountry = pHouse->Type) {
isTech = pCountry->MultiplayPassive;
}
}
if(!RulesExt::Global()->EngineerAlwaysCaptureTech || !isTech) {
if(pBld->GetHealthPercentage() > RulesClass::Global()->EngineerCaptureLevel) {
return (RulesExt::Global()->EngineerDamage > 0) ? act_Damage : act_NoEnter;
}
}
}
return act_Capture;
}
Member Data Documentation
The documentation for this class was generated from the following files: