Ares
Classes | Public Types | Static Public Member Functions | Static Public Attributes

InfantryExt Class Reference

#include <src/Ext/Infantry/Body.h>

List of all members.

Classes

class  ExtData

Public Types

typedef InfantryClass TT

Static Public Member Functions

static eAction GetEngineerEnterEnemyBuildingAction (BuildingClass *pBld)
 Gets the action an engineer will take when entering an enemy building.

Static Public Attributes

static Container< InfantryExtExtMap

Member Typedef Documentation

typedef InfantryClass InfantryExt::TT

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:
pBldThe Building the engineer enters.
Author:
AlexB
Date:
2010-05-28
                                                                            {
        // damage if multi engineer and target isn't that low on health. this
        // only affects multiplay and only if it is enabled.
        if(GameModeOptionsClass::Instance->MPModeIndex && GameModeOptionsClass::Instance->MultiEngineer) {

                // check to always capture tech structures. a structure counts
                // as tech if its initial owner is a multiplayer-passive country.
                bool isTech = false;
                if(HouseClass * pHouse = pBld->OwningPlayer2) {
                        if(HouseTypeClass * pCountry = pHouse->Type) {
                                isTech = pCountry->MultiplayPassive;
                        }
                }

                if(!RulesExt::Global()->EngineerAlwaysCaptureTech || !isTech) {
                        // no civil structure. apply new logic.
                        if(pBld->GetHealthPercentage() > RulesClass::Global()->EngineerCaptureLevel) {
                                return (RulesExt::Global()->EngineerDamage > 0) ? act_Damage : act_NoEnter;
                        }
                }
        }

        // default.
        return act_Capture;
}

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines