#include <src/Ext/Bullet/Body.h>
List of all members.
Constructor & Destructor Documentation
BulletExt::ExtData::ExtData |
( |
const DWORD |
Canary, |
|
|
TT *const |
OwnerObject |
|
) |
| [inline] |
virtual BulletExt::ExtData::~ExtData |
( |
| ) |
[inline, virtual] |
Member Function Documentation
bool BulletExt::ExtData::DamageOccupants |
( |
| ) |
|
Does the entire PassThrough logic, checks & damage.
This function determines whether the projectile should pass through the outter shell of a building and damage the occupants instead.
If so, it proceeds to damage the occupants, and then returns true. If the projectile did not pass through, and the building has to be damaged according to normal rules. the function returns false.
- Returns:
- true if the bullet passed through and the damage case was handled, otherwise false.
- Author:
- Renegade
- Date:
- 02.12.09+
{
BulletClass* TheBullet = this->AttachedToObject;
if(BuildingClass* Building = specific_cast<BuildingClass *> (TheBullet->Target)) {
BulletTypeExt::ExtData* TheBulletTypeExt = BulletTypeExt::ExtMap.Find(TheBullet->Type);
BuildingTypeExt::ExtData* BuildingAresData = BuildingTypeExt::ExtMap.Find(Building->Type);
if(Building->Occupants.Count && BuildingAresData->UCPassThrough) {
Debug::Log("SubjToTrenches = %d\n", TheBulletTypeExt->SubjectToTrenches);
if(!TheBulletTypeExt->SubjectToTrenches
|| ((ScenarioClass::Instance->Random.RandomRanged(0, 99) / 100.0) < BuildingAresData->UCPassThrough)) {
int poorBastard = ScenarioClass::Instance->Random.RandomRanged(0, Building->Occupants.Count - 1);
Debug::Log("Poor Bastard #%d\n", poorBastard);
if(BuildingAresData->UCFatalRate
&& ((ScenarioClass::Instance->Random.RandomRanged(0, 99) / 100.0) < BuildingAresData->UCFatalRate)) {
Debug::Log("Fatal hit!\n");
Building->Occupants[poorBastard]->Destroyed(TheBullet->Owner);
Building->Occupants[poorBastard]->UnInit();
Building->Occupants.RemoveItem(poorBastard);
Building->UpdateThreatInCell(Building->GetCell());
} else {
Debug::Log("Flesh wound - health(%d) * UCDmgMult(%lf)\n", TheBullet->Health, BuildingAresData->UCDamageMultiplier);
int adjustedDamage = static_cast<int> (ceil(TheBullet->Health * BuildingAresData->UCDamageMultiplier));
Debug::Log("Adjusted damage = %d\n", adjustedDamage);
int result = Building->Occupants[poorBastard]->ReceiveDamage(&adjustedDamage, 0, TheBullet->WH,
TheBullet->Owner, false, true, TheBullet->GetOwningHouse());
Debug::Log("Received damage, %d\n", result);
}
BuildingExt::ExtData* SpecificBuildingExt = BuildingExt::ExtMap.Find(Building);
SpecificBuildingExt->evalRaidStatus();
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
virtual void BulletExt::ExtData::InvalidatePointer |
( |
void * |
ptr | ) |
[inline, virtual] |
virtual size_t BulletExt::ExtData::Size |
( |
| ) |
const [inline, virtual] |
Member Data Documentation
The documentation for this class was generated from the following files: