#include <src/Misc/SWTypes/GenericWarhead.h>
List of all members.
Constructor & Destructor Documentation
SW_GenericWarhead::SW_GenericWarhead |
( |
| ) |
[inline] |
virtual SW_GenericWarhead::~SW_GenericWarhead |
( |
| ) |
[inline, virtual] |
Member Function Documentation
virtual const char* SW_GenericWarhead::GetTypeString |
( |
| ) |
[inline, virtual] |
Reimplemented from NewSWType.
{ return "GenericWarhead"; }
void SW_GenericWarhead::Initialize |
( |
SWTypeExt::ExtData * |
pData, |
|
|
SuperWeaponTypeClass * |
pSW |
|
) |
| [virtual] |
bool SW_GenericWarhead::Launch |
( |
SuperClass * |
pThis, |
|
|
CellStruct * |
pCoords, |
|
|
byte |
IsPlayer |
|
) |
| [virtual] |
Implements NewSWType.
{
SuperWeaponTypeClass *pType = pThis->Type;
SWTypeExt::ExtData *pData = SWTypeExt::ExtMap.Find(pType);
if(!pData || !pData->SW_Warhead) {
Debug::Log("Couldn't launch GenericWarhead SW ([%s])\n", pType->ID);
return 0;
}
CoordStruct coords;
CellClass *Cell = MapClass::Instance->GetCellAt(pCoords);
Cell->GetCoordsWithBridge(&coords);
auto pWHExt = WarheadTypeExt::ExtMap.Find(pData->SW_Warhead);
pWHExt->applyRipples(&coords);
pWHExt->applyIronCurtain(&coords, pThis->Owner, pData->SW_Damage);
BuildingClass *Firer = NULL;
HouseClass *FirerHouse = pThis->Owner;
for(int i = 0; i < FirerHouse->Buildings.Count; ++i) {
BuildingClass *B = FirerHouse->Buildings[i];
if(B->HasSuperWeapon(pThis->Type->ArrayIndex)) {
Firer = B;
break;
}
}
pWHExt->applyEMP(&coords, Firer);
if(!pWHExt->applyPermaMC(&coords, pThis->Owner, Cell->GetContent())) {
MapClass::DamageArea(&coords, pData->SW_Damage, Firer, pData->SW_Warhead, 1, pThis->Owner);
if(AnimTypeClass * DamageAnimType = MapClass::SelectDamageAnimation(pData->SW_Damage, pData->SW_Warhead, Cell->LandType, &coords)) {
AnimClass *DamageAnim;
GAME_ALLOC(AnimClass, DamageAnim, DamageAnimType, &coords);
}
MapClass::FlashbangWarheadAt(pData->SW_Damage, pData->SW_Warhead, coords, false, 0);
}
return 1;
}
The documentation for this class was generated from the following files: